:root{--rx-blue:#022B63;--rx-cyan:#14C7D1;--soft:#f4f8fb;--line:#dce7ef;--ink:#14213d;--shadow:0 16px 40px rgba(2,43,99,.13)}*{box-sizing:border-box}body{margin:0;background:#eef5f9;color:var(--ink);font-family:Inter,Arial,sans-serif;overflow-x:hidden}.rx-header{height:68px;background:#fff;display:flex;align-items:center;justify-content:space-between;padding:0 28px;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:50;box-shadow:0 5px 22px rgba(0,0,0,.05)}.rx-brand{display:flex;align-items:center;gap:12px;text-decoration:none;color:var(--rx-blue);font-weight:800}.rx-brand img{height:42px}.rx-header nav{display:flex;gap:22px}.rx-header nav a{color:var(--rx-blue);text-decoration:none;font-weight:700;font-size:14px}.rx-header nav a:hover{color:var(--rx-cyan)}.studio-shell{display:grid;grid-template-columns:minmax(96px,150px) minmax(220px,280px) minmax(480px,1fr) minmax(280px,340px) minmax(96px,150px);gap:12px;max-width:1920px;margin:0 auto;padding:12px;width:100%}.panel{background:#fff;border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow);min-width:0}.panel-head{display:flex;align-items:center;justify-content:space-between;padding:12px 14px;border-bottom:1px solid var(--line)}.panel-head h2{margin:0;font-size:16px;color:var(--rx-blue)}.panel-head span{background:#e8fbfd;color:#06717a;border-radius:999px;padding:4px 9px;font-size:12px;font-weight:800}.ad-side{position:sticky;top:82px;height:calc(100vh - 96px);background:transparent}.ad-side div{height:100%;border:1px dashed #a8bdce;border-radius:16px;background:#fff;display:flex;align-items:center;justify-content:center;text-align:center;color:#678;font-weight:700;font-size:13px}.template-panel,.properties-panel{height:calc(100vh - 92px);overflow:auto}.search{width:calc(100% - 24px);margin:12px;border:1px solid var(--line);border-radius:12px;padding:10px 12px;outline:none}.chips,.palette-row{display:flex;flex-wrap:wrap;gap:6px;padding:0 12px 12px}.chips button,.palette-row button{border:1px solid var(--line);background:#f7fbfd;border-radius:999px;padding:7px 10px;font-size:12px;font-weight:700;cursor:pointer}.chips button.active{background:var(--rx-blue);color:#fff}.template-grid{display:grid;grid-template-columns:1fr;gap:10px;padding:0 12px 14px}.tpl-card{border:1px solid var(--line);border-radius:14px;padding:8px;background:#fbfdff;cursor:pointer;transition:.15s}.tpl-card:hover,.tpl-card.active{border-color:var(--rx-cyan);box-shadow:0 8px 20px rgba(20,199,209,.22);transform:translateY(-1px)}.tpl-thumb{height:92px;border-radius:10px;overflow:hidden;position:relative;background:#eee}.tpl-thumb::before,.tpl-thumb::after{content:"";position:absolute}.tpl-meta{display:flex;justify-content:space-between;align-items:center;margin-top:7px;font-size:12px;font-weight:800}.tpl-meta small{color:#6b7c8f;font-weight:700}.canvas-panel{height:calc(100vh - 92px);display:flex;flex-direction:column;overflow:hidden}.topbar,.exportbar{display:flex;gap:8px;align-items:center;flex-wrap:wrap;padding:10px 12px;border-bottom:1px solid var(--line)}.exportbar{border-top:1px solid var(--line);border-bottom:0}.topbar button,.exportbar button,.import-label,.upload-btn,.properties-panel button{border:0;background:var(--rx-blue);color:#fff;border-radius:10px;padding:9px 12px;font-weight:800;cursor:pointer;font-size:12px}.topbar .danger{background:#d93025}.segmented{display:flex;border:1px solid var(--line);border-radius:12px;overflow:hidden}.segmented button{border-radius:0;background:#f2f7fb;color:var(--rx-blue)}.segmented button.active{background:var(--rx-blue);color:#fff}select,input{font:inherit}.topbar select{border:1px solid var(--line);border-radius:10px;padding:8px;background:#fff}.workspace{flex:1;min-height:0;display:flex;align-items:center;justify-content:center;background:linear-gradient(45deg,#f2f7fb 25%,transparent 25%),linear-gradient(-45deg,#f2f7fb 25%,transparent 25%),linear-gradient(45deg,transparent 75%,#f2f7fb 75%),linear-gradient(-45deg,transparent 75%,#f2f7fb 75%);background-size:24px 24px;background-position:0 0,0 12px,12px -12px,-12px 0;padding:20px;overflow:auto}.card-wrap{transform-origin:center}.business-card{width:1050px;height:600px;background:white;border-radius:26px;box-shadow:0 22px 60px rgba(0,0,0,.22);position:relative;overflow:hidden}.bc-el{position:absolute;user-select:none;cursor:grab;display:flex;align-items:center;justify-content:center;white-space:pre-wrap;line-height:1.18}.bc-el.selected{outline:2px solid #1a73e8;outline-offset:2px}.bc-el.selected::after{content:"";position:absolute;right:-7px;bottom:-7px;width:12px;height:12px;background:#1a73e8;border:2px solid #fff;border-radius:50%;box-shadow:0 1px 4px #0004}.bc-shape{pointer-events:auto}.bc-image img,.bc-qr canvas,.bc-qr img{width:100%;height:100%;object-fit:contain}.bottom-ad{margin:0 12px 10px;border:1px dashed #a8bdce;border-radius:12px;text-align:center;padding:10px;color:#678;font-weight:800;background:#f9fcff}details{border-bottom:1px solid var(--line)}summary{padding:12px 14px;font-weight:900;color:var(--rx-blue);cursor:pointer}.form-grid,.color-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px;padding:0 14px 14px}label{display:flex;flex-direction:column;gap:5px;font-size:12px;font-weight:800;color:#4a5d70}.form-grid input,.form-grid select,.properties-panel select{border:1px solid var(--line);border-radius:10px;padding:9px;width:100%;background:#fff}.wide{grid-column:1/-1}.check{flex-direction:row;align-items:center}.color-grid input[type=color]{height:38px;border:1px solid var(--line);border-radius:10px;padding:3px}.upload-row{display:flex;gap:8px;padding:0 14px 12px;flex-wrap:wrap}.logo-chips{display:flex;gap:8px;flex-wrap:wrap;padding:0 14px 12px}.logo-chip{width:32px;height:32px;border-radius:50%;border:3px solid white;box-shadow:0 0 0 1px #b6c6d4;cursor:pointer}.hint{font-size:12px;color:#6b7c8f;margin:0 14px 14px;line-height:1.4}@media(max-width:1350px){.studio-shell{grid-template-columns:230px minmax(460px,1fr) 300px}.ad-side{display:none}.rx-header nav{display:none}}@media(max-width:980px){.studio-shell{grid-template-columns:1fr}.template-panel,.properties-panel,.canvas-panel{height:auto;max-height:none}.workspace{min-height:420px}.business-card{width:700px;height:400px}.rx-header{padding:0 14px}.rx-brand span{font-size:14px}}

/* Reportix UX fixes: centered canvas, compact template filter, visible logo tools */
.category-select{width:calc(100% - 24px);margin:0 12px 12px;border:1px solid var(--line);border-radius:12px;padding:10px 12px;background:#fff;font-weight:700;color:var(--rx-blue)}
.chips{display:none!important}
.toolbar-label{border:0;background:var(--rx-blue);color:#fff;border-radius:10px;padding:9px 12px;font-weight:800;cursor:pointer;font-size:12px;display:inline-flex;align-items:center;line-height:1}
.workspace{position:relative;align-items:center!important;justify-content:center!important;overflow:hidden;scrollbar-gutter:stable both-edges;padding:16px!important}
.workspace.zoom-scroll{overflow:auto!important;align-items:flex-start!important;justify-content:flex-start!important}
.workspace.zoom-scroll .card-wrap{margin:32px auto!important}
.card-wrap{display:block;flex:0 0 auto;margin:auto!important;transform-origin:center center!important}
.business-card{margin:auto}.bc-el{touch-action:none}.bc-el .resize-handle{position:absolute;right:-8px;bottom:-8px;width:16px;height:16px;border-radius:50%;background:#1a73e8;border:2px solid #fff;box-shadow:0 1px 5px #0005;cursor:nwse-resize;z-index:99}.bc-el.bc-qr .resize-handle{cursor:nwse-resize}.bc-el.selected::after{display:none}.template-grid{max-height:calc(100vh - 235px);overflow:auto}.tpl-thumb{height:105px}.topbar{gap:7px}.topbar button,.toolbar-label{padding:8px 10px}.properties-panel{overflow-x:hidden}.form-grid input{min-width:0}
@media(max-width:1350px){.category-select{display:block}.template-grid{max-height:360px}}

/* Final centering + interaction fixes */
.workspace{display:flex!important;align-items:center!important;justify-content:center!important;overflow:hidden!important;min-height:430px!important;}
.workspace.zoom-scroll{overflow:auto!important;align-items:center!important;justify-content:center!important;}
.card-wrap{position:relative!important;flex:0 0 auto!important;margin:auto!important;}
.business-card{position:absolute!important;left:0!important;top:0!important;margin:0!important;}
.bc-el > *{pointer-events:none;}
.bc-el .resize-handle{pointer-events:auto!important;}
.bc-qr canvas,.bc-qr img{pointer-events:none!important;}
.topbar{row-gap:8px;}
@media(max-width:1350px){.workspace{min-height:380px!important}}

/* QR resize fix: keep QR square and keep resize handle clickable */
.bc-qr{align-items:center!important;justify-content:center!important;overflow:visible!important;}
.bc-qr .qrbox{width:100%;height:100%;display:flex;align-items:center;justify-content:center;pointer-events:none;}
.bc-qr .qrbox canvas,.bc-qr .qrbox img{width:100%!important;height:100%!important;object-fit:contain!important;pointer-events:none!important;}
.bc-el .resize-handle{width:18px!important;height:18px!important;right:-10px!important;bottom:-10px!important;z-index:999!important;}

/* User-friendly logo upload controls */
.logo-action{background:#063a7a!important}
.logo-upload-card{margin:0 14px 10px;padding:11px;border:1px solid var(--line);border-radius:14px;background:linear-gradient(180deg,#ffffff,#f7fbff)}
.logo-upload-title{font-size:13px;font-weight:900;color:var(--rx-blue);margin-bottom:8px}
.logo-upload-actions{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:8px}
.logo-upload-actions button{padding:8px 10px!important;border-radius:9px!important;font-size:12px!important}
.logo-upload-actions .soft-danger{background:#fff!important;color:#d93025!important;border:1px solid #ffd0cc!important}
.logo-status{font-size:11px;font-weight:700;color:#60758b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.logo-tools-note{margin:0 14px 10px;padding:9px 10px;background:#e9fbfd;border:1px solid #bfeff3;color:#075d66;border-radius:12px;font-size:12px;font-weight:800;line-height:1.35}
.logo-smart-title{padding:0 14px 7px;font-size:12px;font-weight:900;color:var(--rx-blue)}
.logo-chips.empty{border:1px dashed #b7c7d8;margin:0 14px 12px;padding:12px;border-radius:12px;color:#6b7c8f;font-size:12px;font-weight:800;background:#fbfdff}
.bc-logo img{width:100%;height:100%;object-fit:contain;pointer-events:none;display:block}
.bc-logo{overflow:visible!important}


/* ===== REPORTIX PREMIUM THEME MATCHED WITH MERGE PDF PAGE ===== */
body{
  background:
    radial-gradient(circle at top left, rgba(20,199,209,.13), transparent 32%),
    radial-gradient(circle at top right, rgba(2,43,99,.10), transparent 35%),
    #f5f7fa !important;
  color:var(--ink) !important;
}

.reportix-tool-header{
  position:sticky;
  top:0;
  z-index:9999;
  background:rgba(255,255,255,.96);
  backdrop-filter:blur(10px);
  box-shadow:0 2px 15px rgba(2,43,99,.08);
}
.reportix-tool-header:after{
  content:"";
  display:block;
  height:2px;
  background:linear-gradient(90deg,#022B63,#14C7D1);
}
.reportix-tool-nav{
  max-width:1280px;
  margin:auto;
  height:80px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  padding:0 20px;
  gap:24px;
}
.reportix-tool-logo{display:inline-flex;align-items:center;text-decoration:none;flex-shrink:0}
.reportix-tool-logo img{height:62px;width:auto;display:block;object-fit:contain}
.reportix-tool-menu{display:flex;align-items:center;gap:34px;flex-wrap:wrap;justify-content:flex-end}
.reportix-tool-menu a{text-decoration:none;color:#022B63;font-size:13px;font-weight:700;letter-spacing:.3px;transition:.3s ease;white-space:nowrap;text-transform:uppercase}
.reportix-tool-menu a:hover,.reportix-tool-menu a.active{color:#14C7D1}
.reportix-search{font-size:18px!important;line-height:1}

.hero{
  max-width:1160px;
  position:relative;
  overflow:hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(20,199,209,.18), transparent 28%),
    radial-gradient(circle at 88% 16%, rgba(2,43,99,.10), transparent 30%),
    linear-gradient(135deg,#f7fdff 0%,#ffffff 48%,#eef6fb 100%);
  border:1px solid rgba(20,199,209,.16);
  border-radius:32px;
  box-shadow:0 22px 55px rgba(2,43,99,.08);
  margin:24px auto 14px;
  padding:30px 28px 26px;
  text-align:center;
}
.hero:before{
  content:"";position:absolute;inset:0;pointer-events:none;opacity:.65;
  background-image:
    radial-gradient(circle at 8% 28%,rgba(20,199,209,.34) 0 3px,transparent 4px),
    radial-gradient(circle at 16% 42%,rgba(2,43,99,.15) 0 2px,transparent 3px),
    radial-gradient(circle at 78% 24%,rgba(20,199,209,.28) 0 3px,transparent 4px),
    radial-gradient(circle at 90% 36%,rgba(2,43,99,.16) 0 2px,transparent 3px);
}
.hero>*{position:relative;z-index:2}
.hero h1{margin:0;color:#022B63;font-weight:900;letter-spacing:-1px;font-size:42px;line-height:1.12}
.hero p{max-width:850px;margin:10px auto 0;color:#667085;font-weight:500;font-size:17px;line-height:1.55}

.studio-shell{padding-top:8px!important}
.panel{
  background:rgba(255,255,255,.96)!important;
  border:1px solid #e6ebf1!important;
  box-shadow:0 18px 45px rgba(2,43,99,.10)!important;
}
.panel-head{background:linear-gradient(135deg,#ffffff,#f7fdff)}
.ad-side div,.bottom-ad{
  background:rgba(255,255,255,.78)!important;
  border:1px dashed #c9d3df!important;
  color:#8a98a8!important;
  box-shadow:0 8px 22px rgba(2,43,99,.04)!important;
}
.topbar button,.exportbar button,.import-label,.upload-btn,.properties-panel button{
  background:linear-gradient(135deg,#022B63,#0aa0a8)!important;
  color:#fff!important;
  border:1px solid #022B63!important;
  box-shadow:0 10px 22px rgba(2,43,99,.16);
  transition:.25s ease;
}
.topbar button:hover,.exportbar button:hover,.import-label:hover,.properties-panel button:hover{
  transform:translateY(-1px);
  background:linear-gradient(135deg,#011c44,#14C7D1)!important;
}
.segmented button{background:#eef6fb!important;color:#022B63!important;border:0!important;box-shadow:none!important}
.segmented button.active{background:#022B63!important;color:#fff!important}
.topbar .danger{background:#ef4444!important;border-color:#ef4444!important}
.logo-upload-actions .soft-danger{background:#fff!important;color:#d93025!important;border:1px solid #ffd0cc!important;box-shadow:none!important}
.footer{
  text-align:center;
  padding:28px 18px 42px;
  background:#ffffff;
  border-top:1px solid #e6ebf1;
  color:#022B63;
  font-weight:500;
}

@media(max-width:768px){
  .reportix-tool-nav{height:auto;padding:15px;flex-direction:column;gap:12px}
  .reportix-tool-logo img{height:55px}
  .reportix-tool-menu{justify-content:center;gap:16px}
  .hero h1{font-size:32px}
  .hero{margin:16px 12px;padding:24px 18px}
}

/* ===== RESPONSIVE CANVAS / EXPORT BAR FINAL FIX ===== */
/* Keep the export/download buttons visible on laptop and smaller screens. */
.canvas-panel{
  height:auto !important;
  max-height:none !important;
  min-height:0 !important;
  overflow:visible !important;
  display:flex !important;
  flex-direction:column !important;
}

/* The canvas gets a controlled height instead of pushing buttons below the screen. */
.workspace{
  flex:0 0 auto !important;
  height:clamp(300px, 43vh, 520px) !important;
  min-height:300px !important;
  max-height:520px !important;
  display:flex !important;
  align-items:center !important;
  justify-content:center !important;
  overflow:hidden !important;
  padding:14px !important;
}

/* Only show scrollbars when user chooses high zoom and the card is larger than the workspace. */
.workspace.zoom-scroll{
  overflow:auto !important;
  align-items:center !important;
  justify-content:center !important;
}

.card-wrap{
  margin:auto !important;
}

.exportbar{
  flex:0 0 auto !important;
  position:relative !important;
  z-index:15 !important;
  background:#ffffff !important;
  border-top:1px solid #e6ebf1 !important;
  display:flex !important;
  gap:8px !important;
  flex-wrap:wrap !important;
  align-items:center !important;
  justify-content:center !important;
  padding:10px 12px !important;
}

.exportbar button,
.exportbar .import-label{
  white-space:nowrap !important;
  min-width:120px !important;
  text-align:center !important;
}

.bottom-ad{
  flex:0 0 auto !important;
  margin:8px 12px 12px !important;
}

/* The category chip cloud was wasting space. Keep only the dropdown filter. */
.chips{
  display:none !important;
}

.category-select{
  margin-bottom:12px !important;
}

.template-grid{
  max-height:calc(100vh - 245px) !important;
}

@media(max-width:1500px){
  .workspace{height:clamp(285px, 40vh, 480px) !important;}
  .topbar button,.exportbar button,.import-label,.toolbar-label{padding:8px 10px !important;font-size:12px !important;}
}

@media(max-width:1200px){
  .workspace{height:360px !important;}
  .studio-shell{gap:10px !important;padding:10px !important;}
}

@media(max-width:980px){
  .workspace{height:380px !important;min-height:340px !important;}
  .exportbar{justify-content:flex-start !important;}
}

@media(max-width:640px){
  .workspace{height:310px !important;min-height:300px !important;padding:10px !important;}
  .exportbar button,.exportbar .import-label{min-width:calc(50% - 6px) !important;}
}

/* ===== USER FRIENDLY COLOR THEME PANEL ===== */
.theme-section-title{
  padding:0 14px 8px;
  margin-top:-2px;
  font-size:12px;
  font-weight:900;
  color:#022B63;
}
.theme-palette-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:8px;
  padding:0 14px 14px;
}
.theme-card{
  border:1px solid #dce7ef!important;
  background:#ffffff!important;
  color:#022B63!important;
  border-radius:12px!important;
  padding:7px 8px!important;
  display:flex!important;
  align-items:center!important;
  gap:7px!important;
  min-height:42px!important;
  box-shadow:0 5px 14px rgba(2,43,99,.05)!important;
  font-size:11px!important;
  font-weight:900!important;
  cursor:pointer;
  text-align:left;
}
.theme-card:hover{
  border-color:#14C7D1!important;
  transform:translateY(-1px);
  box-shadow:0 10px 22px rgba(20,199,209,.18)!important;
}
.theme-preview{
  width:42px;
  height:24px;
  border-radius:8px;
  border:1px solid rgba(2,43,99,.18);
  flex:0 0 auto;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.35);
}
.logo-chips:not(.empty){
  display:grid;
  grid-template-columns:repeat(6, 1fr);
  gap:8px;
  padding:0 14px 12px;
}
.logo-chip{
  width:100%!important;
  height:28px!important;
  border-radius:9px!important;
  border:2px solid #ffffff!important;
  box-shadow:0 0 0 1px #b6c6d4, 0 4px 10px rgba(2,43,99,.08)!important;
}
@media(max-width:1350px){
  .theme-palette-grid{grid-template-columns:1fr;}
}
