.workspace-library{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,260px),1fr));gap:16px}
.workspace-card{background:var(--surface);border:1px solid var(--border);border-radius:20px;padding:20px}.workspace-card .btn{margin:4px}
.workspace-actions{display:flex;flex-wrap:wrap;gap:8px;align-items:center}.workspace-input{font:inherit;min-height:48px;max-width:100%;width:100%;border:1px solid var(--border-strong);border-radius:12px;padding:12px;color:var(--text);background:var(--surface-raised)}
.workspace-editor{position:fixed;inset:0 auto auto 0;width:100vw;max-width:none;height:100dvh;max-height:none;margin:0;padding:0 0 env(safe-area-inset-bottom,0px);border:0;border-radius:0;background:var(--surface-raised);color:var(--text);overflow:hidden;animation:none!important;transform:none!important;box-sizing:border-box}
.workspace-editor[open]{display:flex;flex-direction:column}.workspace-editor [hidden],.workspace-sheet [hidden]{display:none!important}
.workspace-top{display:grid;grid-template-columns:44px minmax(0,1fr) repeat(4,44px);gap:2px;align-items:center;flex:0 0 auto;min-height:60px;padding:4px 6px;border-bottom:1px solid var(--border)}
.workspace-heading{min-width:0;display:grid;gap:1px}.workspace-heading strong{font-size:14px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.workspace-status{font-size:11px;line-height:1.4;color:var(--text-2);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.workspace-icon-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;flex-shrink:0;width:44px;height:44px;min-height:44px;padding:10px;border:0;border-radius:14px;background:transparent;color:var(--text-2);font:inherit;cursor:pointer;position:relative;overflow:hidden;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.workspace-icon-btn svg{width:24px;height:24px;flex-shrink:0;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.workspace-icon-btn:active{background:var(--brand-soft)}.workspace-icon-btn:focus-visible{outline:2px solid var(--brand);outline-offset:-2px}.workspace-icon-btn[aria-pressed=true]{background:var(--brand-soft);color:var(--on-brand-soft);box-shadow:inset 0 0 0 1px var(--brand)}.workspace-icon-btn:disabled{opacity:.35;cursor:default}.workspace-icon-btn[data-action=tool-options]{color:var(--ink,var(--text));background:var(--surface-2)}
.workspace-stage{position:relative;flex:1 1 0;min-width:0;min-height:0;overflow:hidden;background:var(--surface-2);overscroll-behavior:contain;touch-action:none;isolation:isolate}
.workspace-canvas{display:block;max-width:none;background:#fff;border:0;box-shadow:0 1px 5px #0002;touch-action:none}
.workspace-toolbar{display:flex;flex-wrap:nowrap;align-items:center;justify-content:space-between;gap:2px;min-height:56px;flex:0 0 56px;overflow-x:auto;overflow-y:hidden;padding:6px;border-top:1px solid var(--border);background:var(--surface-raised);scrollbar-width:none}.workspace-toolbar::-webkit-scrollbar{display:none}
.workspace-pages{display:flex;align-items:center;gap:4px;padding:0 8px;flex:0 0 44px;min-height:44px;background:var(--surface);border-top:1px solid var(--border)}.workspace-pages [data-action=pages]{width:auto;min-width:80px;font-size:14px}.workspace-pages [data-action=pages] svg{width:20px;height:20px}.workspace-zoom{flex:1;text-align:end;color:var(--text-2);font-size:12px;margin-inline-end:4px}
.workspace-reference{padding:0 12px;max-height:25vh;overflow:auto;flex:0 0 auto;background:var(--surface)}.workspace-reference summary{cursor:pointer;min-height:44px;display:list-item;align-content:center;font-size:13px}.workspace-reference p{white-space:pre-wrap;overflow-wrap:anywhere;font-size:14px}
.workspace-selection-bar{display:flex;align-items:center;gap:4px;min-height:44px;flex:0 0 auto;background:var(--brand-soft);padding-inline:8px}.workspace-selection-hint{font-size:12px;flex:1;color:var(--on-brand-soft)}
.workspace-sheet{width:min(520px,calc(100vw - 24px));max-width:none;max-height:min(90dvh,calc(var(--workspace-vh,100dvh) - 24px));padding:0;border:1px solid var(--border);border-radius:24px;background:var(--surface-raised);color:var(--text);overflow:hidden;box-sizing:border-box}
.workspace-sheet[open]{display:flex;flex-direction:column}.workspace-sheet-head{display:flex;align-items:center;gap:8px;padding:8px 12px;flex:0 0 auto;border-bottom:1px solid var(--border)}.workspace-sheet-head h2{flex:1;font-size:18px;margin:0;min-width:0}.workspace-sheet-body{min-height:0;overflow:auto;overscroll-behavior:contain;padding:16px 16px calc(20px + env(safe-area-inset-bottom,0px));display:grid;gap:12px}.workspace-sheet h3{font-size:14px;margin:8px 0 0}.workspace-sheet .btn{white-space:normal;min-height:48px}.workspace-menu-grid{display:flex;flex-wrap:wrap;gap:8px}.workspace-help-rule{display:flex;gap:12px;align-items:flex-start}.workspace-help-rule>b{display:grid;place-items:center;flex:0 0 28px;height:28px;border-radius:50%;background:var(--brand-soft);color:var(--on-brand-soft)}.workspace-help-rule p{font-size:14px;margin:0;line-height:1.8}.workspace-swatches{display:flex;gap:8px;flex-wrap:wrap}.workspace-swatch{width:44px;height:44px;border-radius:50%;border:2px solid var(--border-strong);cursor:pointer}.workspace-swatch:focus-visible,.workspace-swatch[aria-pressed=true]{outline:3px solid var(--brand);outline-offset:2px}.workspace-sheet input[type=color]{height:44px;width:64px}.workspace-width-label{display:grid;gap:8px;font-size:14px}.workspace-width-label input{width:100%;min-height:44px}.workspace-export-note{font-size:12px;color:var(--text-2);margin:0}.workspace-print-frame{position:fixed;width:1px;height:1px;opacity:0;pointer-events:none;inset:0}
.workspace-name-dialog{max-width:90vw;padding:24px;border-radius:24px;background:var(--surface);color:var(--text)}.workspace-name-dialog .btn{margin:12px 8px 0 0}
@media(max-height:450px){.workspace-top{min-height:48px;padding-block:2px}.workspace-reference{max-height:64px}.workspace-toolbar{flex-basis:48px;min-height:48px;padding-block:2px}.workspace-pages{flex-basis:44px}.workspace-sheet-head{padding-block:2px}.workspace-sheet-body{padding-block:10px}}
@media(prefers-reduced-motion:reduce){.workspace-editor,.workspace-sheet{animation:none!important}.workspace-icon-btn{transition:none}}
.workspace-colour-panel{gap:10px}.workspace-colour-panel h3{margin:0;font-size:14px}.workspace-colour-heading{display:flex;align-items:center;justify-content:space-between;gap:12px}.workspace-colour-selected{font-size:12px;color:var(--text-2)}
.workspace-swatches{display:grid;grid-template-columns:repeat(6,minmax(44px,1fr));gap:4px;justify-items:center;padding:4px 0}
.workspace-swatch{display:grid;place-items:center;width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border:1px solid color-mix(in srgb,var(--text) 22%,transparent);border-radius:50%;background:var(--swatch);color:var(--swatch-ink);overflow:hidden;-webkit-tap-highlight-color:transparent}
.workspace-swatch svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:2.6;stroke-linecap:round;stroke-linejoin:round;opacity:0}.workspace-swatch[aria-pressed=true] svg{opacity:1}.workspace-swatch[aria-pressed=true]{outline:2px solid var(--brand);outline-offset:2px}.workspace-swatch:focus-visible{outline:3px solid var(--brand);outline-offset:2px}
.workspace-custom-label{display:grid;gap:8px;font-size:14px}.workspace-custom-colour{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:10px}
.workspace-sheet input.workspace-colour-picker[type=color]{height:44px;width:44px;min-width:44px;padding:0;border:1px solid var(--border-strong);border-radius:50%;background:transparent;overflow:hidden;cursor:pointer}.workspace-colour-picker::-webkit-color-swatch-wrapper{padding:0}.workspace-colour-picker::-webkit-color-swatch{border:0;border-radius:50%}
.workspace-hex-input{font:500 15px ui-monospace,monospace;letter-spacing:.06em;min-width:0;width:100%;height:44px;border:1px solid var(--border-strong);border-radius:12px;padding:8px 12px;background:var(--surface);color:var(--text);text-transform:uppercase}.workspace-hex-input[aria-invalid=true]{border-color:var(--bad)}
.workspace-colour-hint{font-size:12px;color:var(--text-2);line-height:1.5;margin:0}.workspace-width-output{font-size:13px;color:var(--text-2);font-variant-numeric:tabular-nums}.workspace-stroke-preview{display:block;width:100%;height:50px;border:1px solid var(--border);border-radius:12px;background:#fff}
.workspace-width-presets{display:flex;gap:8px}.workspace-width-preset{display:grid;place-items:center;flex:1;min-width:44px;height:44px;padding:0;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);cursor:pointer;-webkit-tap-highlight-color:transparent}.workspace-width-preset[aria-pressed=true]{background:var(--brand-soft);color:var(--on-brand-soft);border-color:var(--brand)}.workspace-width-dot{display:block;width:var(--dot);height:var(--dot);border-radius:50%;background:currentColor}.workspace-width-range{min-height:44px;width:100%;margin:0;accent-color:var(--brand)}
@media(max-width:340px){.workspace-swatches{grid-template-columns:repeat(5,minmax(44px,1fr))}.workspace-width-presets{gap:4px}}
