/* BikasB document workspace — modern SaaS interface */
:root{
  --tool-accent:#d91f3d;
  --tool-accent-soft:rgba(217,31,61,.09);
  --tool-surface:var(--card-bg);
  --tool-panel:var(--card-elevated);
  --tool-shadow:0 18px 50px rgba(15,23,42,.07);
  --tool-radius:18px;
}
html[data-theme="dark"]{
  --tool-accent-soft:rgba(244,63,94,.13);
  --tool-shadow:0 18px 50px rgba(0,0,0,.22);
}
body{padding-top:5rem;background:var(--bg-color)}
.navbar{background:color-mix(in srgb,var(--bg-color) 88%,transparent)!important;border-bottom:1px solid var(--border-tint)}
.navbar.scrolled{background:color-mix(in srgb,var(--bg-color) 94%,transparent)!important}
.nav-cta{border-radius:999px;padding:.72rem 1.2rem}
.theme-toggle-btn{border-radius:999px;padding:.55rem .85rem}
.tools-hero{
  padding:clamp(3.2rem,7vw,5.6rem) var(--container-pad) clamp(2.2rem,5vw,3.5rem);
  background:radial-gradient(ellipse at 85% 20%,rgba(217,31,61,.09),transparent 38%),linear-gradient(135deg,var(--bg-color),var(--card-elevated));
  border:0;
}
.tools-hero .wrap{max-width:1440px}
.tools-hero .eyebrow{display:inline-flex;align-items:center;gap:.55rem;padding:.42rem .75rem;border:1px solid rgba(217,31,61,.22);border-radius:999px;background:var(--tool-accent-soft);letter-spacing:.08em}
.tools-hero h1{max-width:850px;font-size:clamp(2.5rem,5.8vw,4.7rem);letter-spacing:-.055em;line-height:1.02;margin:1.1rem 0}
.tools-hero p{max-width:680px;font-size:1.02rem;line-height:1.75}
.privacy-note{border-radius:999px;background:var(--tool-surface);padding:.7rem 1rem;box-shadow:0 4px 16px rgba(15,23,42,.04)}
main.wrap{max-width:1440px}
.tools-layout{grid-template-columns:minmax(250px,300px) minmax(0,1fr);gap:1.25rem;padding-top:1.5rem;padding-bottom:5rem;align-items:start}
.tool-list,.workspace{border:1px solid var(--border-tint);border-radius:var(--tool-radius);background:var(--tool-surface);box-shadow:var(--tool-shadow)}
.tool-list{top:5.8rem;max-height:calc(100vh - 6.5rem);padding:.85rem}
.tool-list-head{padding:.7rem .7rem 1rem}
.tool-list-head h2{font-size:.95rem;text-transform:none;letter-spacing:-.02em;color:var(--text-color);font-weight:700}
.tool-list-head h2 span{font-size:.72rem;color:var(--muted-text);font-weight:600;border:1px solid var(--border-tint);background:var(--tool-panel)}
.tool-list-head p{font-size:.78rem;line-height:1.5}
.tool-search-label{margin:.25rem .7rem .4rem;color:var(--muted-text);font-size:.74rem}
.tool-search{width:calc(100% - 1.4rem);margin:0 .7rem 1rem;padding:.8rem .9rem;border-radius:11px;background:var(--tool-panel);border-color:var(--border-tint);outline:none}
.tool-search:focus,.field input:focus,.field select:focus{border-color:var(--tool-accent);box-shadow:0 0 0 3px var(--tool-accent-soft);outline:none}
.tool-group{border-top:1px solid var(--border-tint);padding:.35rem 0 .55rem}
.tool-group h3{padding:.8rem .75rem .35rem;font-size:.67rem;letter-spacing:.12em}
.tool-group .tool-choice{display:flex;gap:.7rem;align-items:center;padding:.68rem .75rem;margin:.12rem 0;border-radius:10px;font-size:.84rem;line-height:1.35;transition:background .16s,color .16s,transform .16s}
.tool-choice .ico{width:1.7rem;height:1.7rem;display:inline-flex;align-items:center;justify-content:center;border-radius:8px;background:var(--tool-panel);color:var(--muted-text);font-size:1rem;flex:0 0 auto}
.tool-choice:hover{transform:translateX(2px);background:var(--tool-panel)}
.tool-choice.active{background:var(--tool-accent-soft);color:var(--tool-accent);font-weight:700}
.tool-choice.active .ico{background:var(--tool-accent);color:#fff}
.workspace{padding:clamp(1.25rem,3vw,2.35rem);min-height:560px}
.workspace h2{font-size:clamp(1.45rem,2.5vw,2rem);letter-spacing:-.035em;line-height:1.2;margin-bottom:.45rem}
.workspace>.muted{max-width:720px;font-size:.92rem}
.upload{
  margin:1.65rem 0 1.1rem;padding:clamp(1.8rem,4vw,3.2rem) 1rem;
  border:1.5px dashed color-mix(in srgb,var(--tool-accent) 38%,var(--border-tint));
  border-radius:16px;background:linear-gradient(145deg,var(--tool-accent-soft),var(--tool-panel));
  transition:border-color .2s,transform .2s,background .2s;cursor:pointer
}
.upload:hover,.upload.drag-over{border-color:var(--tool-accent);transform:translateY(-1px);background:var(--tool-accent-soft)}
.upload-symbol{display:flex;align-items:center;justify-content:center;width:54px;height:54px;margin:0 auto .9rem;border-radius:16px;background:var(--tool-surface);box-shadow:0 6px 18px rgba(15,23,42,.07);font-size:1.8rem}
.upload strong{font-size:1.05rem}
.upload .hint{font-size:.85rem;margin:.55rem auto;max-width:520px}
.upload-instruction{font-size:.86rem!important;font-weight:700!important;color:var(--tool-accent);margin:.8rem 0 .35rem!important}
.upload input{display:block;margin:.7rem auto 0;font-size:.8rem}
.upload-limit{display:inline-flex;margin-top:1rem;padding:.35rem .7rem;border-radius:999px;background:var(--tool-surface);border:1px solid var(--border-tint);font-size:.73rem}
.field{padding:1rem 0;margin:.5rem 0}
.field label{font-size:.85rem}
.field input,.field select{max-width:520px;border-radius:10px;padding:.8rem .9rem;background:var(--tool-panel)}
.action{border-radius:11px;padding:.9rem 1.35rem;background:var(--tool-accent);box-shadow:0 7px 18px rgba(217,31,61,.18);transition:transform .16s,box-shadow .16s}
.action:hover:not(:disabled){transform:translateY(-1px);box-shadow:0 10px 24px rgba(217,31,61,.25)}
.action.secondary{box-shadow:none;border-radius:10px}
.status{border:1px solid var(--border-tint);border-radius:11px;background:var(--tool-panel);font-size:.85rem;line-height:1.55}
.status.error{background:rgba(220,38,38,.08);border-color:rgba(220,38,38,.25);color:#dc2626}
.status.success{background:rgba(22,163,74,.08);border-color:rgba(22,163,74,.2);color:#15803d}
.selected-files{border-radius:13px;background:var(--tool-panel)}
.file-card{border-radius:10px;background:var(--tool-surface);padding:.7rem}
.file-thumb{border-radius:8px}
.pdf-preview{border-radius:14px;background:var(--tool-panel)}
.pdf-preview-frame{border-radius:10px}
.tool-meta{gap:.55rem;margin-top:1.4rem}
.tool-meta span{padding:.42rem .72rem;border-radius:999px;background:var(--tool-panel);font-size:.72rem}
.live-edit-preview,.metadata-report,.processing-progress{border-radius:12px;background:var(--tool-panel)}
.page-reorder-card,.page-manager-card{border-radius:11px}
footer{background:var(--tool-panel);padding:2.2rem var(--container-pad)}
footer a:hover{color:var(--tool-accent)}
@media(max-width:980px){
 .tools-layout{grid-template-columns:1fr}
 .tool-list{position:static;max-height:none;overflow:visible}
 #tool-groups{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 1rem}
 .tool-group{min-width:0}
}
@media(max-width:760px){
 body{padding-top:4.4rem}
 .tools-hero{padding:3.2rem 1.2rem 2.3rem}
 .tools-hero h1{font-size:clamp(2.35rem,10vw,3.4rem)}
 .tools-layout{padding-top:1rem;gap:1rem}
 .tool-list{padding:.65rem}
 #tool-groups{grid-template-columns:1fr}
 .tool-group{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:.35rem}
 .tool-group h3{grid-column:1/-1}
 .workspace{padding:1.15rem;min-height:0}
 .upload{padding:1.8rem .8rem}
 .upload input{max-width:100%;font-size:.72rem}
 .pdf-preview-frame{min-height:340px;height:60vh}
 .footer-inner{font-size:.82rem}
}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

/* PDF Studio Explorer workspace */
.pdf-studio-shell{max-width:1440px;margin:0 auto 2rem;padding:0 var(--container-pad);display:grid;grid-template-columns:248px minmax(0,1fr);gap:1rem}
.studio-explorer-sidebar,.studio-explorer-main{background:var(--card-bg);border:1px solid var(--border-tint);border-radius:16px;box-shadow:var(--tool-shadow)}
.studio-explorer-sidebar{padding:1rem .8rem;display:flex;flex-direction:column;min-height:650px}
.explorer-brand{display:flex;align-items:center;gap:.7rem;padding:.55rem .55rem 1.2rem;border-bottom:1px solid var(--border-tint);margin-bottom:.8rem}
.explorer-brand-icon{display:grid;place-items:center;width:40px;height:40px;border-radius:12px;background:var(--tool-accent-soft);color:var(--tool-accent);font-size:1.45rem}
.explorer-brand strong,.explorer-brand small{display:block}.explorer-brand strong{font-size:1rem}.explorer-brand small{font-size:.72rem;color:var(--muted-text);margin-top:.15rem}
.explorer-nav-label{font-size:.64rem;font-weight:800;letter-spacing:.13em;color:var(--muted-text);padding:.85rem .65rem .35rem}
.explorer-nav-item{display:flex;align-items:center;gap:.7rem;width:100%;padding:.68rem .7rem;margin:.1rem 0;border:0;border-radius:9px;background:transparent;color:var(--text-color);font:inherit;font-size:.83rem;text-align:left;cursor:pointer}
.explorer-nav-item kbd{margin-left:auto;font-size:.65rem;color:var(--muted-text);background:var(--tool-panel);border:1px solid var(--border-tint);border-radius:5px;padding:.1rem .35rem}
.explorer-nav-item:hover,.explorer-nav-item.active{background:var(--tool-accent-soft);color:var(--tool-accent);font-weight:700}
.explorer-sidebar-note{display:flex;gap:.65rem;align-items:flex-start;margin-top:auto;padding:.8rem .65rem;border-top:1px solid var(--border-tint);font-size:.8rem}
.explorer-sidebar-note strong,.explorer-sidebar-note small{display:block}.explorer-sidebar-note small{font-size:.7rem;line-height:1.5;color:var(--muted-text);margin-top:.2rem}
.studio-explorer-main{padding:1.2rem clamp(1rem,2.4vw,2rem) 1.4rem;min-width:0}
.explorer-toolbar{display:flex;align-items:center;justify-content:space-between;gap:1rem;padding-bottom:1rem;border-bottom:1px solid var(--border-tint)}
.explorer-breadcrumb{display:flex;align-items:center;gap:.55rem;color:var(--muted-text);font-size:.8rem}.explorer-breadcrumb strong{color:var(--text-color)}
.explorer-toolbar-actions{display:flex;align-items:center;gap:.4rem}.explorer-item-count{font-size:.75rem;color:var(--muted-text);margin-right:.4rem}
.view-toggle{width:34px;height:34px;border:1px solid var(--border-tint);border-radius:8px;background:var(--bg-color);color:var(--muted-text);cursor:pointer}.view-toggle.active{background:var(--tool-accent-soft);border-color:var(--tool-accent);color:var(--tool-accent)}
.studio-heading-row{display:flex;justify-content:space-between;align-items:flex-end;gap:1rem;padding:1.5rem 0 1rem}
.studio-eyebrow{font-size:.64rem;font-weight:800;letter-spacing:.14em;color:var(--tool-accent)}
.studio-heading-row h2{font-size:clamp(1.5rem,3vw,2rem);letter-spacing:-.045em;margin:.35rem 0 .25rem}.studio-heading-row p{margin:0;color:var(--muted-text);font-size:.85rem}
.studio-sort{display:flex;align-items:center;gap:.45rem;font-size:.72rem;color:var(--muted-text);white-space:nowrap}.studio-sort select{padding:.55rem .65rem;border:1px solid var(--border-tint);border-radius:8px;background:var(--bg-color);color:var(--text-color);font:inherit}
.studio-search-row{display:flex;align-items:center;gap:.8rem;margin:.4rem 0 1rem}
.studio-search{display:flex;align-items:center;gap:.65rem;flex:1;min-width:0;padding:.68rem .85rem;border:1px solid var(--border-tint);border-radius:10px;background:var(--tool-panel)}
.studio-search>span{font-size:1.2rem;color:var(--muted-text)}.studio-search input{width:100%;min-width:0;border:0;outline:0;background:transparent;color:var(--text-color);font:inherit;font-size:.82rem}
.studio-search-hint{font-size:.7rem;color:var(--muted-text);white-space:nowrap}
.studio-category-tabs{display:flex;gap:.45rem;overflow-x:auto;padding:.15rem 0 1rem;scrollbar-width:thin}
.studio-tab{padding:.52rem .82rem;border:1px solid var(--border-tint);border-radius:999px;background:var(--bg-color);color:var(--muted-text);font:inherit;font-size:.75rem;font-weight:600;white-space:nowrap;cursor:pointer;transition:.15s}
.studio-tab:hover,.studio-tab.active{background:#292a30;color:#fff;border-color:#292a30}
.studio-tools-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.8rem}
.studio-tool-card{display:flex;flex-direction:column;align-items:flex-start;min-width:0;min-height:190px;padding:1rem;text-align:left;border:1px solid var(--border-tint);border-radius:13px;background:var(--bg-color);color:var(--text-color);cursor:pointer;transition:transform .16s,border-color .16s,box-shadow .16s}
.studio-tool-card:hover{transform:translateY(-3px);border-color:var(--tool-accent);box-shadow:0 12px 28px rgba(15,23,42,.08)}
.studio-tool-icon{display:grid;place-items:center;width:43px;height:43px;margin-bottom:.85rem;border-radius:11px;font-size:1.2rem;font-weight:800}
.studio-tool-icon.coral{background:#ffe1d9;color:#e65f43}.studio-tool-icon.orange{background:#ffead8;color:#e77735}.studio-tool-icon.green{background:#e1f2df;color:#5b9e53}.studio-tool-icon.blue{background:#e2ebff;color:#507ac4}.studio-tool-icon.peach{background:#ffe6dc;color:#e66b4b}.studio-tool-icon.purple{background:#f0e3f2;color:#a05c9a}.studio-tool-icon.slate{background:#e7eaf0;color:#64748b}
.studio-tool-title{font-size:.91rem;font-weight:750;letter-spacing:-.02em;line-height:1.3}.studio-tool-desc{font-size:.74rem;line-height:1.5;color:var(--muted-text);margin-top:.4rem}.studio-tool-meta{font-size:.65rem;font-weight:700;color:var(--muted-text);margin-top:auto;padding-top:.8rem}
.studio-tool-card[hidden]{display:none!important}.studio-tools-grid.list-view{grid-template-columns:1fr;gap:.45rem}
.studio-tools-grid.list-view .studio-tool-card{min-height:0;display:grid;grid-template-columns:42px minmax(130px,.7fr) minmax(180px,1.5fr) auto;align-items:center;column-gap:.85rem;padding:.7rem .85rem}
.studio-tools-grid.list-view .studio-tool-icon{margin:0}.studio-tools-grid.list-view .studio-tool-desc{margin:0}.studio-tools-grid.list-view .studio-tool-meta{padding:0}
.studio-no-results{padding:2rem;text-align:center;color:var(--muted-text);font-size:.85rem}
.studio-footer-note{display:flex;align-items:center;gap:.55rem;margin-top:1rem;padding:.8rem .2rem 0;border-top:1px solid var(--border-tint);font-size:.72rem;color:var(--muted-text)}
.tool-execution-view{padding-top:1rem}.execution-toolbar{display:flex;align-items:center;gap:1rem;flex-wrap:wrap;margin-bottom:1rem;padding-bottom:.9rem;border-bottom:1px solid var(--border-tint)}
.back-to-studio{border:1px solid var(--border-tint);border-radius:8px;padding:.55rem .75rem;background:var(--bg-color);color:var(--text-color);font:inherit;font-size:.78rem;font-weight:700;cursor:pointer}.back-to-studio:hover{border-color:var(--tool-accent);color:var(--tool-accent)}
.execution-breadcrumb{font-size:.75rem;color:var(--muted-text)}.execution-breadcrumb strong{color:var(--text-color)}
@media(max-width:1050px){.pdf-studio-shell{grid-template-columns:205px minmax(0,1fr)}.studio-tools-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:760px){.pdf-studio-shell{grid-template-columns:minmax(0,1fr);gap:.7rem}.studio-explorer-sidebar{min-height:0;padding:.7rem}.explorer-brand{padding:.35rem .4rem .7rem}.explorer-sidebar-note{display:none}.explorer-nav-label{padding:.55rem .45rem .25rem}.studio-explorer-sidebar .explorer-nav-item{display:inline-flex;width:auto;margin:.1rem .15rem;padding:.5rem .6rem;font-size:.72rem}.explorer-toolbar{padding-bottom:.75rem}.studio-heading-row{align-items:flex-start;flex-direction:column;padding:1.1rem 0 .8rem}.studio-sort{align-self:flex-end}.studio-search-hint{display:none}.studio-tools-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:.55rem}.studio-tool-card{min-height:190px;padding:.8rem}.studio-tool-title{font-size:.82rem}.studio-tool-desc{font-size:.69rem}.studio-tools-grid.list-view .studio-tool-card{grid-template-columns:38px 1fr;gap:.25rem .65rem}.studio-tools-grid.list-view .studio-tool-desc,.studio-tools-grid.list-view .studio-tool-meta{grid-column:2}.tools-layout.tool-execution-view{display:grid;grid-template-columns:minmax(0,1fr);width:100%;max-width:100%;gap:.7rem}.tools-layout.tool-execution-view .tool-list{position:static;width:100%;max-width:100%;min-width:0;max-height:none;overflow:visible}.tools-layout.tool-execution-view .workspace{width:100%;max-width:100%;min-width:0}.tools-layout.tool-execution-view .tool-list .tool-group{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));column-gap:.5rem}.tools-layout.tool-execution-view .tool-list .tool-group h3{grid-column:1/-1}.tools-layout.tool-execution-view .tool-choice{min-width:0;overflow-wrap:anywhere;white-space:normal}}
@media(max-width:430px){.studio-tools-grid{grid-template-columns:1fr}.studio-tool-card{min-height:155px}.studio-category-tabs{margin-right:-.3rem}}
html[data-theme="dark"] .studio-tool-icon.coral{background:#4a2928;color:#ff9a83}html[data-theme="dark"] .studio-tool-icon.orange{background:#4b3325;color:#ffb276}html[data-theme="dark"] .studio-tool-icon.green{background:#253f2c;color:#9ad391}html[data-theme="dark"] .studio-tool-icon.blue{background:#263751;color:#9dbbff}html[data-theme="dark"] .studio-tool-icon.peach{background:#4a3028;color:#ffad91}html[data-theme="dark"] .studio-tool-icon.purple{background:#432e46;color:#d9a1d5}html[data-theme="dark"] .studio-tool-icon.slate{background:#343b47;color:#b8c2d1}

/* Direct-entry mode: the catalogue is the only tool selector. */
.tools-layout.tool-execution-view.direct-tool-mode{grid-template-columns:minmax(0,1fr)}
.tools-layout.tool-execution-view.direct-tool-mode .tool-list{display:none!important}
.tools-layout.tool-execution-view.direct-tool-mode .workspace{grid-column:1/-1;width:100%;max-width:100%;min-width:0}


/* Continuous, restrained motion for every Tools Explorer card. */
@keyframes studio-card-attention {
  0%, 100% {
    translate: 0 0;
    border-color: var(--border-tint);
    box-shadow: 0 0 0 rgba(217,31,61,0);
  }
  50% {
    translate: 0 -4px;
    border-color: color-mix(in srgb,var(--tool-accent) 42%,var(--border-tint));
    box-shadow: 0 10px 26px rgba(217,31,61,.075);
  }
}
@keyframes studio-icon-attention {
  0%, 82%, 100% { transform: translateY(0) rotate(0); }
  88% { transform: translateY(-3px) rotate(-5deg); }
  94% { transform: translateY(0) rotate(4deg); }
}
.studio-tool-card {
  animation: studio-card-attention 7.2s ease-in-out infinite;
  animation-delay: var(--studio-card-delay, 0s);
  will-change: translate, box-shadow;
}
.studio-tool-card:nth-child(6n + 1) { --studio-card-delay: -0.4s; }
.studio-tool-card:nth-child(6n + 2) { --studio-card-delay: -1.5s; }
.studio-tool-card:nth-child(6n + 3) { --studio-card-delay: -2.6s; }
.studio-tool-card:nth-child(6n + 4) { --studio-card-delay: -3.7s; }
.studio-tool-card:nth-child(6n + 5) { --studio-card-delay: -4.8s; }
.studio-tool-card:nth-child(6n) { --studio-card-delay: -5.9s; }
.studio-tool-icon {
  animation: studio-icon-attention 5.8s ease-in-out infinite;
  animation-delay: var(--studio-card-delay, 0s);
}
.studio-tool-card:hover,
.studio-tool-card:focus-visible {
  animation-play-state: paused;
  translate: 0 -5px;
}
.studio-tool-card:hover .studio-tool-icon,
.studio-tool-card:focus-visible .studio-tool-icon {
  animation-play-state: paused;
}
.studio-tools-grid.list-view .studio-tool-card {
  animation-duration: 8.5s;
}
@media (prefers-reduced-motion: reduce) {
  .studio-tool-card,
  .studio-tool-icon {
    animation: none !important;
    translate: none;
    will-change: auto;
  }
}
