.pdf-workbench{max-width:1460px;margin:22px auto;padding:0 26px 28px;font-family:Inter,Arial,sans-serif;color:#ececf3}.pdf-workbench *{box-sizing:border-box}.pdf-page-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:18px}.pdf-eyebrow{font-size:9px;letter-spacing:1.6px;font-weight:700;color:#b88b70}.pdf-page-heading h1{font-size:26px;letter-spacing:-.6px;line-height:1.2;margin:5px 0}.pdf-page-heading p{font-size:12px;color:#8d97aa;margin:0}.pdf-offline{font-size:10px;border:1px solid #36313c;background:#19171e;border-radius:7px;padding:9px 12px;color:#a3adbf;white-space:nowrap}.pdf-workspace{display:grid;grid-template-columns:350px minmax(0,1fr);gap:18px;align-items:start}.pdf-controls,.pdf-preview-panel{min-width:0;background:#15141b;border:1px solid #34303b;border-radius:14px;overflow:hidden}.pdf-controls{padding:18px;max-height:calc(100dvh - 160px);overflow-y:auto;scrollbar-width:thin;scrollbar-color:#49434f transparent}.pdf-control-head{display:flex;justify-content:space-between;align-items:center;gap:9px;margin-bottom:16px}.pdf-control-head h2{font-size:14px;margin:0;font-weight:600}#saveStatus{font-size:9px;color:#8b96a9}.pdf-template-field{border:0;padding:0;margin:0 0 17px;min-width:0}.pdf-template-field legend{padding:0;font-size:10px;color:#a4adbe;margin-bottom:9px}.pdf-design-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.pdf-design-tile{position:relative;border:1px solid #3b3543;background:#1a1821;border-radius:8px;padding:9px;cursor:pointer;text-align:left;min-height:66px;display:flex;align-items:flex-start;gap:8px}.pdf-design-tile input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}.pdf-design-tile .pdf-swatch{width:6px;height:36px;border-radius:3px;flex:none;background:var(--design-colour)}.pdf-design-tile strong{display:block;color:#e6e5ef;font-size:10px;line-height:1.35;font-weight:600}.pdf-design-tile small{display:block;font-size:8px;color:#919bad;line-height:1.45;margin-top:4px}.pdf-design-tile:has(input:checked){border-color:#d08450;background:#302219}.pdf-design-tile:has(input:focus-visible){outline:2px solid #f9b687;outline-offset:2px}.pdf-profile-row{display:flex;align-items:center;gap:12px;border-top:1px solid #302c36;padding-top:14px;margin-bottom:13px}.pdf-profile-row>label{font-size:10px;color:#a4adbe;flex:none}.pdf-profile-row select{width:100%;min-width:0;background:#0f1016;color:#c6cbd8;border:1px solid #3d3745;border-radius:6px;padding:7px;font-size:10px;outline:none}.pdf-input-group{margin:12px 0}.pdf-input-group label{display:block;font-size:10px;color:#a5afbf;margin-bottom:6px}.pdf-input-group input,.pdf-input-group textarea{display:block;width:100%;min-width:0;background:#0e0f15;color:#e8e9f1;border:1px solid #3a3543;border-radius:7px;padding:9px 10px;font-family:inherit;font-size:11px;line-height:1.45;outline:none;resize:vertical}.pdf-input-group input:focus,.pdf-input-group textarea:focus{border-color:#cc8557}.pdf-export-actions{display:grid;gap:8px;margin-top:17px}.pdf-primary,.pdf-secondary{font-family:inherit;display:flex;align-items:center;justify-content:center;gap:12px;padding:11px 12px;border-radius:8px;font-size:11px;font-weight:650;cursor:pointer}.pdf-primary{background:#d06932;color:white;border:1px solid #e89058}.pdf-secondary{color:#bdc6d7;background:#1c1b24;border:1px solid #45404c}.pdf-secondary span{font-size:8px;border:1px solid #4a4553;border-radius:3px;padding:2px 4px;color:#929db1}.pdf-primary:disabled,.pdf-secondary:disabled{opacity:.5;cursor:wait}.pdf-export-status{font-size:9px;color:#8691a5;line-height:1.5;margin:11px 0 0;overflow-wrap:anywhere}.pdf-export-status.error{color:#f9a19a}.pdf-preview-toolbar{display:flex;align-items:center;justify-content:space-between;gap:15px;padding:16px 18px;border-bottom:1px solid #302b38;min-height:55px}.pdf-preview-toolbar>div{display:flex;align-items:center;gap:9px;min-width:0}.pdf-preview-toolbar h2{font-size:12px;font-weight:600;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.pdf-preview-dot{width:6px;height:6px;border-radius:50%;background:#dfa173;flex:none}.pdf-preview-format{font-size:9px;color:#8d97aa;white-space:nowrap;border:1px solid #403a48;border-radius:4px;padding:4px 7px}.pdf-preview-scroll{padding:18px;max-height:calc(100dvh - 241px);min-height:350px;overflow:auto;scrollbar-width:thin;scrollbar-color:#49434f transparent;background:#101016}.pdf-preview-viewport{position:relative;margin:0 auto;overflow:hidden}.pdf-template-host{position:absolute;top:0;left:0;width:794px;transform-origin:top left}.pdf-preview-footer{display:flex;justify-content:space-between;gap:15px;padding:11px 18px;border-top:1px solid #302b38;font-size:9px;color:#8791a5}.pdf-workbench button:focus-visible,.pdf-workbench select:focus-visible{outline:2px solid #f9b687;outline-offset:2px}[data-theme=light] .pdf-workbench{color:#292835}[data-theme=light] .pdf-controls,[data-theme=light] .pdf-preview-panel{background:#fafafa;border-color:#dbd8e2}[data-theme=light] .pdf-design-tile{background:#f0eef4;border-color:#d8d2e0}[data-theme=light] .pdf-design-tile strong{color:#33313e}[data-theme=light] .pdf-design-tile:has(input:checked){background:#fff0e5;border-color:#d08450}[data-theme=light] .pdf-input-group input,[data-theme=light] .pdf-input-group textarea,[data-theme=light] .pdf-profile-row select{background:#fff;color:#33313e;border-color:#d4cedd}@media(max-width:1000px){.pdf-workspace{grid-template-columns:310px minmax(0,1fr);gap:12px}.pdf-workbench{padding:0 16px 24px}.pdf-controls{padding:14px}.pdf-preview-scroll{padding:12px}.pdf-page-heading p{display:none}}@media(max-width:760px){.pdf-workspace{grid-template-columns:1fr}.pdf-workbench{margin-top:18px;padding:0 12px 24px}.pdf-page-heading{gap:10px;align-items:flex-start}.pdf-page-heading h1{font-size:23px}.pdf-offline{font-size:8px;padding:7px}.pdf-controls{max-height:none}.pdf-design-grid{grid-template-columns:repeat(3,minmax(0,1fr))}.pdf-preview-scroll{max-height:none;min-height:0}.pdf-preview-footer>span:last-child{display:none}.pdf-design-tile{min-height:76px}}@media(max-width:430px){.pdf-design-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* A4 workspace */
.pdf-workbench{margin-top:14px;padding-bottom:14px}
.pdf-page-heading{margin-bottom:10px}
.pdf-page-heading h1{font-size:22px;margin:0}
.pdf-eyebrow{display:none}
.pdf-workspace{grid-template-columns:minmax(285px,330px) minmax(0,1fr);gap:14px}
.pdf-controls,.pdf-preview-panel{height:max(360px,calc(100dvh - 130px));display:flex;flex-direction:column}
.pdf-controls{max-height:none;overflow:hidden;padding:0}
.pdf-fields{min-height:0;flex:1;overflow:auto;padding:13px 14px 6px;scrollbar-width:thin}
.pdf-control-head{margin-bottom:10px}.pdf-template-field{margin-bottom:10px}
.pdf-design-grid{gap:5px}.pdf-design-tile{padding:6px;min-height:46px}.pdf-design-tile .pdf-swatch{height:26px}
.pdf-design-tile small{margin-top:2px}.pdf-profile-row{padding-top:9px;margin-bottom:8px}
.pdf-input-group{margin:8px 0}.pdf-input-group label{margin-bottom:4px}
.pdf-input-group input,.pdf-input-group textarea{padding:6px 8px}
.pdf-export-actions{flex:none;grid-template-columns:1fr 1fr;gap:6px;margin:0;padding:9px 12px 0;border-top:1px solid #302b38}
.pdf-primary,.pdf-secondary{padding:8px 5px;gap:4px;font-size:10px}
.pdf-export-status{flex:none;margin:5px 12px 8px}
.pdf-preview-toolbar,.pdf-preview-footer{flex:none;padding:8px 12px;min-height:0}
.pdf-preview-scroll{flex:1;min-height:0;max-height:none;padding:12px;overflow:auto;scrollbar-gutter:stable both-edges;overflow-anchor:none}
.pdf-preview-viewport{outline:1px solid #696573;background:#fff}
.pdf-template-host{width:210mm}
.pdf-view-label{display:flex;align-items:center;gap:6px;color:#a4adbe;font-size:10px}
.pdf-view-label select{background:#191820;color:#e6e6ef;border:1px solid #484451;border-radius:5px;padding:4px;font:inherit}
@media(max-width:900px){.pdf-controls,.pdf-preview-panel{height:max(360px,calc(100dvh - 171px))}}
@media(max-width:760px){.pdf-workspace{grid-template-columns:1fr}.pdf-controls{height:auto}.pdf-fields{overflow:visible}.pdf-preview-panel{height:75dvh}}

/* Equal-width editor and preview */
.pdf-workbench { max-width: 1560px; padding-inline: clamp(14px, 2vw, 28px); }
.pdf-workspace { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.pdf-fields { padding: 16px 16px 8px; }
.pdf-control-head h2, .pdf-preview-toolbar h2 { font-size: 13px; }
.pdf-design-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.pdf-design-tile { min-height: 52px; padding: 8px; align-items: center; }
.pdf-profile-row { margin-top: 12px; }
.pdf-details-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 10px; }
.pdf-details-grid .pdf-input-group { min-width: 0; margin: 4px 0; }
.pdf-export-actions { padding-inline: 16px; }
.pdf-export-status { margin-inline: 16px; }
.pdf-preview-toolbar { flex-wrap: wrap; gap: 6px 10px; }
.pdf-preview-toolbar h2 { white-space: normal; }
@media (max-width: 1050px) {
  .pdf-design-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .pdf-workspace { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
  .pdf-details-grid { grid-template-columns: minmax(0, 1fr); }
}
.pdf-preview-panel { display: grid; grid-template-rows: auto minmax(0, 1fr) auto; } .pdf-preview-scroll { min-width: 0; align-self: stretch; }

/* PDF Lab editor polish */
.pdf-workbench {
  --lab-text: #ececf3;
  --lab-muted: #aab4c6;
  --lab-accent: #ffb484;
  --lab-action: #a9481e;
  --lab-border: #494350;
  --lab-paper-edge: #77717d;
}
.pdf-controls { height: auto; align-self: start; }
.pdf-fields { flex: none; overflow: visible; padding: 16px; }
.pdf-control-head { margin-bottom: 14px; }
.pdf-control-head h2, .pdf-preview-toolbar h2 { font-size: 14px; overflow-wrap: break-word; }
.pdf-template-field legend, .pdf-profile-row > label, .pdf-input-group label { font-size: 11px; color: var(--lab-muted); }
.pdf-design-tile strong { font-size: 11px; }
.pdf-design-tile small, #saveStatus, .pdf-preview-footer { color: var(--lab-muted); font-size: 10px; }
.pdf-input-group input, .pdf-input-group textarea, .pdf-profile-row select { font-size: 12px; min-height: 33px; }
.pdf-export-actions { padding: 12px 16px; }
.pdf-primary, .pdf-secondary { min-height: 34px; font-size: 11px; border-color: var(--lab-border); }
.pdf-primary { background: var(--lab-action); }
.pdf-export-status:empty { display: none; }
.pdf-export-status { color: var(--lab-muted); margin: 0 16px 10px; }
.pdf-preview-toolbar { padding: 10px 12px; }
.pdf-preview-viewport { outline-color: var(--lab-paper-edge); }
.pdf-workbench :is(input, textarea, select, button):focus-visible { outline: 2px solid var(--lab-accent); outline-offset: 2px; }
[data-theme=light] .pdf-workbench { --lab-muted: #535b6d; --lab-accent: #9b4219; }
@media (max-width: 420px) {
  .pdf-export-actions { grid-template-columns: minmax(0, 1fr); }
}
