:root{
  --studio-bg:hsl(8 6% 6%);--studio-ink:hsl(0 0% 95%);--studio-muted:hsl(0 0% 65%);--studio-border:hsl(0 0% 20%);
  --studio-accent:hsl(40 60% 60%);--studio-deep:#e5bd73;--studio-soft:#2b2418;--studio-surface:hsl(8 6% 10%);--studio-green:hsl(150 60% 15%);
  --green:var(--studio-accent);--green-dark:var(--studio-deep);--ink:var(--studio-ink);--border:var(--studio-border);
  --muted:var(--studio-muted);--cream:#211e19;--soft:#2b2418;
  font-family:Inter,system-ui,-apple-system,'Segoe UI',sans-serif;
}
body{background:var(--studio-bg);color:var(--studio-ink);color-scheme:dark}
button:focus-visible,a:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{
  outline:2px solid var(--studio-accent);outline-offset:2px
}
.sr-only{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}
.studio-shell{min-height:100dvh;display:grid;grid-template-columns:222px minmax(0,1fr)}
.studio-sidebar{
  position:sticky;top:0;height:100dvh;background:var(--studio-surface);border-right:1px solid var(--studio-border);
  display:flex;flex-direction:column;padding:26px 14px 18px;z-index:4
}
.studio-brand{display:flex;align-items:center;gap:11px;text-align:left;border:0;background:none;padding:0 8px;margin:0 0 35px;font-size:20px;font-weight:750;letter-spacing:-.7px}
.studio-brand small{display:block;font-size:10px;letter-spacing:.18px;color:var(--studio-accent);margin-top:3px}
.studio-logo{display:grid;place-items:center;position:relative;width:40px;height:40px;border-radius:12px;background:var(--studio-accent);color:var(--studio-bg);font-size:32px;font-family:Georgia,serif;font-weight:700;letter-spacing:-4px;line-height:1;padding-right:5px;box-shadow:0 2px 6px #0008}
.studio-logo span{position:absolute;right:8px;bottom:8px;font:700 17px/1 Georgia,serif;color:var(--studio-green)}
.studio-sidebar nav{display:grid;gap:3px;overflow:auto;scrollbar-width:thin}
.studio-sidebar nav p{margin:22px 0 5px;padding:0 12px;font-size:10px;font-weight:750;letter-spacing:1.1px;color:var(--studio-muted)}
.studio-sidebar nav button{display:flex;gap:10px;align-items:center;min-height:42px;padding:0 12px;text-align:left;background:none;border:0;border-radius:8px;color:#c6c3bd;font-weight:560;font-size:13px;white-space:nowrap}
.studio-sidebar nav button:hover{background:#24211b;color:var(--studio-accent)}
.studio-sidebar nav button[aria-current]{background:var(--studio-soft);color:var(--studio-accent);font-weight:700}
.studio-sidebar nav button svg{width:17px;height:17px}
.studio-private{margin-top:auto;display:flex;align-items:center;gap:9px;padding:12px 8px 2px;border-top:1px solid var(--studio-border)}
.studio-private>span{width:30px;height:30px;display:grid;place-items:center;border-radius:8px;background:var(--studio-green);color:#add4b8}
.studio-private svg{width:15px;height:15px}
.studio-private strong,.studio-private small{display:block}
.studio-private strong{font-size:11px;font-weight:700}
.studio-private small{margin-top:3px;color:var(--studio-muted);font-size:10px}
.studio-main{min-width:0}
.studio-top{height:66px;border-bottom:1px solid var(--studio-border);background:var(--studio-surface);display:flex;align-items:center;justify-content:space-between;gap:16px;padding:0 32px}
.studio-breadcrumb{display:flex;align-items:center;gap:8px;color:var(--studio-muted);font-size:13px;white-space:nowrap}
.studio-breadcrumb button{border:0;background:none;padding:2px 0;color:inherit}
.studio-breadcrumb button:hover{color:var(--studio-accent)}
.studio-breadcrumb svg{width:13px;height:13px;color:#837f75}
.studio-breadcrumb span{color:var(--studio-ink);font-weight:650}
.studio-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:39px;padding:0 13px;text-decoration:none;border:1px solid #4b4436;border-radius:8px;background:var(--studio-surface);color:var(--studio-ink);font-size:13px;font-weight:650;white-space:nowrap;cursor:pointer}
.studio-btn:hover:not(:disabled){border-color:#8e713a;background:#2b2418}
.studio-btn svg{width:16px;height:16px}
.studio-primary{background:var(--studio-accent);color:var(--studio-bg);border-color:var(--studio-accent);box-shadow:0 2px 3px #0006}
.studio-primary:hover:not(:disabled){background:var(--studio-deep);border-color:var(--studio-deep)}
.studio-subtle{background:#201d18;border-color:#745d32;color:var(--studio-accent)}
.studio-content{max-width:1280px;margin:auto;padding:28px 32px 36px}
.studio-heading{margin:0 0 22px}
.studio-heading h1{margin:0;font-size:clamp(27px,3vw,37px);font-weight:740;letter-spacing:-1.35px;line-height:1.16}
.studio-heading p{margin:9px 0 0;color:var(--studio-muted);font-size:14px;line-height:1.5}
.studio-hero{position:relative;isolation:isolate;overflow:hidden;display:grid;grid-template-columns:1fr minmax(220px,42%);gap:15px;align-items:center;min-height:206px;border:1px solid #4c4935;border-radius:16px;background:linear-gradient(103deg,#221e16 30%,#282219 75%,var(--studio-green));padding:23px 27px 23px 29px}
.hero-icon,.tool-icon,.tool-heading-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:10px;background:#30271a;color:var(--studio-accent)}
.hero-icon{width:34px;height:34px;background:#3c3020}
.hero-icon svg,.tool-icon svg,.tool-heading-icon svg{width:19px;height:19px}
.studio-hero h2{margin:10px 0 4px;font-size:27px;letter-spacing:-.8px;line-height:1.14}
.studio-hero p{margin:0;color:#cbc4b6;font-size:13px;line-height:1.55;max-width:420px}
.hero-actions{display:flex;align-items:center;gap:9px;flex-wrap:wrap;margin-top:15px}
.hero-art{align-self:stretch;position:relative;min-width:0}
.hero-art svg{width:100%;height:100%;position:absolute;inset:0;overflow:visible}
.studio-section{margin-top:26px}
.studio-section h2,.studio-card h2{margin:0 0 12px;font-size:18px;letter-spacing:-.36px;font-weight:710}
.studio-section-head{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
.studio-link{display:inline-flex;align-items:center;gap:5px;border:0;background:none;color:var(--studio-accent);padding:3px 0;font-size:12px;font-weight:700;text-decoration:none}
.studio-link:hover{text-decoration:underline}
.studio-link svg{width:14px;height:14px}
.studio-tools{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:11px}
.studio-tool{position:relative;display:flex;flex-direction:column;align-items:flex-start;gap:7px;min-width:0;text-align:left;padding:13px 11px;min-height:111px;background:var(--studio-surface);border:1px solid var(--studio-border);border-radius:11px;box-shadow:0 1px 3px #0003}
.studio-tool:hover{border-color:#836938;background:#23211b;box-shadow:0 3px 10px #0005}
.studio-tool strong{font-size:13px;line-height:1.2}
.studio-tool small{color:var(--studio-muted);font-size:11px;line-height:1.4}
.studio-tool .tool-icon{width:33px;height:33px}
.tool-icon.split,.tool-heading-icon.split{background:#34261a;color:#e5aa75}
.tool-icon.merge,.tool-heading-icon.merge{background:#1c3028;color:#b3d4bd}
.tool-icon.make,.tool-heading-icon.make{background:var(--studio-green);color:#b7dabe}
.tool-icon.reader,.tool-heading-icon.reader{background:#282219;color:var(--studio-accent)}
.tool-icon.convert,.tool-heading-icon.convert{background:#30291b;color:#e0c083}
.tool-heading-icon{margin-bottom:10px}
.recent-card,.studio-card,.reader-shell{background:var(--studio-surface);border:1px solid var(--studio-border);border-radius:12px;overflow:hidden;box-shadow:0 1px 3px #0003}
.recent-empty{min-height:75px;display:flex;align-items:center;gap:12px;padding:13px 16px;color:var(--studio-muted)}
.recent-empty .tool-icon{background:#2b2418;color:var(--studio-accent);width:32px;height:32px}
.recent-empty strong,.recent-empty small{display:block}
.recent-empty strong{font-size:13px;color:var(--studio-ink);margin-bottom:4px}
.recent-empty small{font-size:12px;line-height:1.4}
.recent-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:14px;align-items:center;padding:12px 16px;border-bottom:1px solid var(--studio-border)}
.recent-row:last-child{border-bottom:0}
.recent-file{display:flex;align-items:center;gap:11px;min-width:0}
.recent-file>div{min-width:0}
.recent-file strong,.recent-file small{display:block}
.recent-file strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px}
.recent-file small,.recent-date{color:var(--studio-muted);font-size:11px;margin-top:3px}
.recent-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.studio-icon-btn{display:grid;place-items:center;background:var(--studio-surface);border:1px solid #4b4436;border-radius:7px;min-width:33px;height:33px;color:#cdc6b6;font-size:19px;padding:0 5px;cursor:pointer}
.studio-icon-btn:hover:not(:disabled){background:#2b2418;color:var(--studio-accent)}
.studio-icon-btn svg{width:15px;height:15px}
.recent-actions .studio-btn{min-height:33px;font-size:12px}
.studio-tool-layout{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(250px,1fr);gap:18px;align-items:start}
.studio-card{padding:18px}
.studio-form{display:grid;gap:15px}
.studio-form label{display:grid;gap:6px;font-size:13px;font-weight:650}
.studio-form input:not([type=file]),.studio-form select,.studio-form textarea,.reader-toolbar input,.reader-toolbar select{
  width:100%;min-height:40px;background:var(--studio-surface);border:1px solid #4b4436;border-radius:8px;padding:8px 10px;color:var(--studio-ink);font-size:14px;line-height:1.35
}
.studio-form textarea{min-height:150px}
.studio-form label small{font-size:11px;color:var(--studio-muted);font-weight:450;line-height:1.5}
.studio-form .studio-primary{justify-self:start}
.studio-picker{display:grid;gap:10px}
.studio-drop{width:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:7px;padding:23px 12px;min-height:126px;border:1.5px dashed #806939;border-radius:10px;background:#231f17;color:var(--studio-accent);font-weight:700;font-size:14px}
.studio-drop:hover,.studio-drop.is-dragging{background:#332b1b;border-color:var(--studio-accent)}
.studio-drop svg{width:24px;height:24px}
.studio-drop small{font-size:11px;color:#c0b9ac;font-weight:500;line-height:1.45}
.studio-file-list{display:grid;gap:6px}
.studio-file-row{display:flex;align-items:center;gap:7px;border:1px solid var(--studio-border);border-radius:7px;padding:7px}
.studio-file-row>span{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px}
.studio-file-row .studio-icon-btn{height:26px;min-width:26px;font-size:13px}
.studio-file-row svg{width:15px;height:15px;color:var(--studio-accent)}
.studio-result p,.studio-help{font-size:13px;color:var(--studio-muted);line-height:1.55;margin:0}
.studio-result .studio-error{color:#ff9e9f}
.output-list{display:grid;gap:7px;margin-top:10px}
.output-list .studio-btn{justify-content:flex-start;min-width:0;white-space:normal;overflow-wrap:anywhere;text-align:left}
.reader-top,.reader-toolbar{display:flex;align-items:center;gap:8px;padding:11px 14px;border-bottom:1px solid var(--studio-border)}
.reader-top{justify-content:space-between}
.reader-top strong,.reader-top small{display:block;overflow-wrap:anywhere}
.reader-top small{margin-top:3px;color:var(--studio-muted);font-size:11px}
.reader-toolbar{flex-wrap:wrap}
.reader-pages{display:flex;align-items:center;gap:5px}
.reader-toolbar input,.reader-toolbar select{min-height:34px;width:auto;font-size:12px;padding:4px 7px}
.reader-toolbar input[type=number]{width:57px;text-align:center}
.reader-toolbar form{display:flex;gap:5px;margin-left:auto}
.reader-toolbar form input{min-width:0;max-width:185px}
#reader-status{margin:0;padding:7px 14px;color:var(--studio-muted);font-size:12px;min-height:30px}
.reader-matches{display:flex;gap:6px;overflow:auto;padding:0 14px 8px}
.reader-matches button{flex:none}
.reader-stage{background:#111210;overflow:auto;max-height:70vh;min-height:220px;padding:14px 14px 22px}
#reader-sheet{position:relative;margin:0 auto;background:white;box-shadow:0 2px 12px #0008;min-width:60px}
#reader-image{width:100%;display:block}
#reader-highlights{position:absolute;inset:0;pointer-events:none}
#reader-highlights span{position:absolute;background:#ffda5b72;outline:1px solid #aa770e65}
#editor-screen{height:calc(100dvh - 66px);display:flex;flex-direction:column;min-height:470px}
#editor-screen .editor-header{height:56px;min-height:56px;padding:0 18px;gap:10px;background:var(--studio-surface)}
.editor-header>div:first-child{min-width:0}
.editor-header strong,.editor-header small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.editor-header strong{font-size:15px}
.editor-header small{font-size:11px;color:var(--studio-muted);margin-top:3px}
#editor-screen .workspace{height:auto;min-height:0;flex:1}
#editor-screen .editor-panel{min-height:0}
#editor-screen .canvas-space{background:#101210}
#editor-screen .toolbar,#editor-screen .statusbar,#editor-screen .document-panel,#editor-screen .inspector{background:var(--studio-surface)}
#editor-screen .tool-active,#editor-screen .view-toggle,#editor-screen .inline-start,#editor-screen .font-card{background:#2b2418;color:var(--studio-accent);border-color:#59492e}
#editor-screen .inline-surface{outline-color:#9c7634;box-shadow:0 0 0 3px #d6ad5c26}
#editor-screen .inline-caret{background:#745311}
#editor-screen .inline-toolbar{border-color:#6c562e}
#editor-screen .inline-selection{background:#d6ad5c65}
#editor-screen .text-hit:hover,#editor-screen .text-hit:focus-visible{border-color:#97743a}
#editor-screen .ocr-panel{background:#1b2e23;border-color:#355443;color:#c2dfcb}
@media(max-width:1100px){
  .studio-shell{grid-template-columns:180px minmax(0,1fr)}
  .studio-content{padding-left:22px;padding-right:22px}
  .studio-top{padding:0 22px}
}
@media(max-width:860px){
  .studio-tools{grid-template-columns:repeat(3,minmax(0,1fr))}
  .studio-tool-layout{grid-template-columns:minmax(0,1fr)}
  .studio-hero{grid-template-columns:1fr minmax(130px,34%)}
}
@media(max-width:640px){
  .studio-shell{display:block}
  .studio-sidebar{position:relative;height:auto;padding:10px 12px;border-right:0;border-bottom:1px solid var(--studio-border)}
  .studio-brand{margin:0 0 8px;padding:0 2px;font-size:17px}
  .studio-brand small{font-size:8px}
  .studio-logo{width:31px;height:31px;font-size:26px}
  .studio-logo span{bottom:5px;right:5px}
  .studio-sidebar nav{display:flex;gap:4px;overflow:auto}
  .studio-sidebar nav p,.studio-private{display:none}
  .studio-sidebar nav button{min-height:34px;font-size:11px;gap:5px;padding:0 7px}
  .studio-sidebar nav button svg{width:13px;height:13px}
  .studio-top{height:47px;padding:0 12px}
  .studio-top .studio-btn{min-height:32px;font-size:12px;padding:0 9px}
  .studio-content{padding:20px 12px 30px}
  .studio-heading p{font-size:13px}
  .studio-hero{grid-template-columns:1fr;padding:15px;min-height:0}
  .hero-art{display:none}
  .studio-tools{grid-template-columns:repeat(2,minmax(0,1fr))}
  .studio-section{margin-top:21px}
  .recent-row{grid-template-columns:minmax(0,1fr) auto;padding:9px;gap:7px}
  .recent-date{display:none}
  #editor-screen{height:auto;min-height:0}
  #editor-screen .workspace{height:auto}
  #editor-screen .editor-panel{height:67dvh;min-height:420px}
  #editor-screen .header-actions .btn-plain span{display:inline}
  .reader-toolbar form{margin-left:0}
}

.reader-file-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.reader-file-actions .studio-btn{min-height:32px;font-size:12px}

.output-row{display:flex;gap:5px;align-items:stretch}
.output-row>a{flex:1}
.output-row>button{padding:0 8px;font-size:11px}

/* Shared editor controls sit outside the PDF page itself. */
.btn,.icon-btn,#zoom-level,.inline-toolbar,dialog{background:var(--studio-surface);color:var(--studio-ink);border-color:var(--studio-border)}
.btn:hover:not(:disabled),.icon-btn:hover:not(:disabled){background:var(--studio-soft);color:var(--studio-accent)}
.btn-green,.inline-apply{background:var(--studio-accent);color:var(--studio-bg);border-color:var(--studio-accent)}
.btn-green:hover:not(:disabled),.inline-apply:hover:not(:disabled){background:var(--studio-deep);color:var(--studio-bg)}
.inline-cancel{background:var(--studio-soft);color:var(--studio-ink)}
.inline-hint,.document-topline,.page-bottom,.statusbar,.busy .statusbar,.page-indicator,.panel-label,.pages-label,.file-card span,
.selection-empty p,.inspector-foot,.section-heading,.font-card>span,.font-specs label,.original-label,
.original-text,.font-upload p,.local-tag,.left-bottom p,dialog p,dialog li{color:var(--studio-muted)}
.font-specs strong,.font-preview,.match-tag,.font-upload summary,.eyebrow,.link-btn,.validation,.preview-btn,
.dashed-btn,.selection-empty h2{color:var(--studio-accent)}
.file-icon,.page-item.active,.download-file{background:var(--studio-soft);color:var(--studio-accent);border-color:#59492e}
.download-file{color:var(--studio-accent)!important}
.page-item{color:var(--studio-muted)}
.page-item>span:first-child{color:var(--studio-bg);background:#e9dabb;border-color:#b89b62}
.dashed-btn{border-color:#745d32}
.dashed-btn:hover{background:var(--studio-soft)}
.font-specs,.font-upload{border-color:var(--studio-border)}
#replacement,dialog input{background:var(--studio-bg);color:var(--studio-ink);border-color:#4b4436}
.validation.error{background:#3a201c;color:#ffc5b8}
.validation.warning{color:#ebbb72}
.drop-overlay{background:#162a1ff0;border-color:#ad8947}
.drop-overlay svg,.drop-overlay h2{color:var(--studio-accent)}
.toast{background:var(--studio-green);color:var(--studio-ink);border:1px solid #355443}
.toast.error{background:#502b24;border-color:#894b40}
dialog::backdrop{background:#080806b8}
