:root{font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#242424;background:#e5e5e5;color-scheme:light;--text:#242424;--muted:#737373;--workspace:#e5e5e5;--glass-top:#ffffffd1;--glass-bottom:#f2f2f2ba;--selected:#ffffffb8;--edge:#fffffff0;--lower:#ffffffaa;--shadow:#0000001a;--opaque:#f4f4f4}*{box-sizing:border-box}body{margin:0;overflow:hidden}body[data-theme=dark]{color-scheme:dark;--text:#f2f2f2;--muted:#aaa;--workspace:#121212;--glass-top:#363636c7;--glass-bottom:#232323e0;--selected:#ffffff20;--edge:#ffffff99;--lower:#ffffff55;--shadow:#00000050;--opaque:#292929;color:var(--text)}button,input,select{font:inherit;color:inherit}button{cursor:pointer;border:0;background:transparent;border-radius:5px;min-height:36px;padding:7px 10px;display:inline-flex;align-items:center;justify-content:center;gap:7px;position:relative;touch-action:manipulation;white-space:nowrap}button:hover{background:var(--selected)}button:disabled{opacity:.32;cursor:default}button[aria-pressed=true],button.selected{background:var(--selected);box-shadow:none}button:focus-visible,input:focus-visible,select:focus-visible{outline:2px solid var(--text);outline-offset:2px}svg{display:block}button svg{width:24px;height:24px;flex:none;pointer-events:none}button>*{pointer-events:none}button.icon{width:36px;padding:6px}.glass,dialog{background:linear-gradient(120deg,var(--glass-top),var(--glass-bottom));backdrop-filter:blur(18px) saturate(0);-webkit-backdrop-filter:blur(18px) saturate(0);box-shadow:0 4px 14px var(--shadow);border-radius:8px;border:0}#workspace,#board{position:fixed;inset:0;width:100%;height:100%;background:var(--workspace)}#board{touch-action:none;user-select:none;outline-offset:-3px;cursor:crosshair}#board[data-navigating=true],#board[data-tool=hand]{cursor:grab}#header{position:fixed;top:max(12px,env(safe-area-inset-top));left:12px;right:12px;height:48px;display:flex;align-items:center;padding:6px;gap:10px}#header .mark{width:36px;height:36px;padding:0}#header .mark svg{width:36px;height:36px}.modes{display:flex;padding:0;background:#88888812;border-radius:5px}.spacer{flex:1}#document-label{position:fixed;top:calc(max(12px,env(safe-area-inset-top)) + 57px);left:22px;right:22px;display:flex;gap:12px;justify-content:space-between;font-size:11px;color:var(--muted);pointer-events:none}#name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#save.error{color:var(--text);background:var(--opaque);pointer-events:auto;max-width:75%;padding:5px}#dock{position:fixed;bottom:max(12px,env(safe-area-inset-bottom));left:50%;transform:translateX(-50%);display:flex;justify-content:space-between;padding:6px;width:min(366px,calc(100% - 24px));height:56px}#dock button{width:44px;padding:8px}#navigation{position:fixed;bottom:calc(max(12px,env(safe-area-inset-bottom)) + 66px);left:50%;transform:translateX(-50%);display:flex;gap:8px;width:min(366px,calc(100% - 24px))}#navigation .glass{position:relative;display:flex;padding:4px}#navigation .zoom-value{font-size:12px;min-width:55px}#panel{position:fixed;bottom:calc(max(12px,env(safe-area-inset-bottom)) + 120px);left:50%;transform:translateX(-50%);width:min(366px,calc(100% - 24px));padding:14px;max-height:calc(100dvh - 210px);overflow:auto}#panel[hidden]{display:none}.panel-head{display:flex;align-items:center;justify-content:space-between;height:32px;margin-bottom:14px;font-size:13px}.panel-head strong{font-weight:500}.row{display:flex;gap:6px;align-items:center;flex-wrap:wrap}.row>*{flex:1}.choices{display:flex;gap:4px}.choices>*{flex:1}.hint{font-size:12px;line-height:1.5;color:var(--muted)}.section-label{font-size:12px;color:var(--muted);margin:16px 0 8px}.field{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:12px 0;font-size:13px}.field input,.field select{min-width:0;width:60%;padding:8px;border:0;border-radius:5px;background:var(--selected)}#panel.color-panel{height:296px;overflow:hidden;display:flex;flex-direction:column;gap:10px}#panel.color-panel[hidden]{display:none}.color-panel .panel-head{margin:0;flex:none}.ink-tray{display:flex;align-items:center;justify-content:center;gap:3px;height:100px;flex:none;border-radius:5px;background:var(--paper);color:var(--on-paper)}.ink-tray button{padding:4px 0;min-width:0;flex:1;flex-direction:column;gap:8px;height:64px;max-width:58px}.ink-tray button.selected{background:#88888822}.ink-tray i{display:block;width:24px;height:24px;border-radius:50%;box-shadow:0 0 0 .5px #88888850}.ink-tray small{font-size:8px}.ink-tray .single-swatch{width:48px;height:48px}.restrictions{margin-top:auto}.restrictions button{font-size:12px;padding:8px 4px}.paper-row button{font-size:11px}.paper-chip{display:block;width:15px;height:22px;background:var(--chip);box-shadow:0 0 0 .5px #888;border-radius:1px}#sheets{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(max(12px,env(safe-area-inset-bottom)) + 120px);display:flex;gap:5px;padding:5px;max-width:calc(100% - 24px);overflow:auto}#sheets[hidden]{display:none}#sheets button{padding:4px;min-width:46px;height:48px}#sheets svg{height:36px;width:36px}dialog{color:var(--text);padding:24px;width:min(860px,calc(100% - 24px));max-height:calc(100dvh - 40px)}dialog::backdrop{background:#00000042;backdrop-filter:blur(5px)}.dialog-head{display:flex;justify-content:space-between;align-items:center;gap:15px;margin-bottom:18px}h1,h2{font-weight:500;font-size:22px;letter-spacing:-.6px;margin:0}dialog .row button{background:var(--selected);font-size:13px}#library-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(160px,1fr));gap:20px;margin-top:24px}.library-card{min-width:0}.library-card .thumbnail{width:100%;height:155px;background:#8888880c;padding:10px;display:block}.thumbnail svg{width:100%;height:100%}.card-title{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:10px 0 4px}.card-meta{font-size:11px;color:var(--muted);margin-bottom:8px}.card-actions{display:flex}.card-actions button{font-size:11px;padding:4px 6px;min-height:30px}#form-dialog{width:min(420px,calc(100% - 24px))}#form-fields input,#form-fields select{width:100%}#form-fields label{display:block;font-size:12px;margin:16px 0 6px}.actions{margin-top:22px}#toast{position:fixed;top:90px;left:50%;transform:translateX(-50%);max-width:calc(100% - 24px);background:var(--opaque);box-shadow:0 4px 12px var(--shadow);border-radius:6px;padding:12px 18px;font-size:13px;z-index:10}input[type=number]{width:90px}.notice{font-size:12px;line-height:1.4}#alignment-note{color:var(--muted)}@media(min-width:700px){#header{left:24px;right:24px}#document-label{left:34px;right:34px}#dock{bottom:24px}#navigation{bottom:90px}#panel,#sheets{bottom:144px}}@media(max-width:600px),(pointer:coarse){input,select,textarea{font-size:16px!important}#header{gap:5px}dialog{padding:18px}.ink-tray{gap:0}.ink-tray i{width:22px;height:22px}}@media(prefers-reduced-transparency:reduce),(prefers-contrast:more){.glass,dialog{background:var(--opaque);backdrop-filter:none;-webkit-backdrop-filter:none}button:focus-visible{outline-width:3px}}@media(prefers-reduced-motion:reduce){*{transition:none!important;animation:none!important}}@media(max-height:550px){#panel{bottom:78px;max-height:calc(100dvh - 150px)}#navigation{left:12px;transform:none;width:auto;bottom:78px}#sheets{left:auto;right:12px;transform:none;bottom:78px;max-width:40%}}
@media(max-height:550px){#panel.color-panel{height:240px;max-height:calc(100dvh - 150px);overflow-y:auto}#panel.color-panel .ink-tray{height:64px;min-height:64px}#panel.color-panel .ink-tray button{height:56px}}
#board:focus-visible{outline:1px solid var(--text);outline-offset:-2px}a{color:inherit}input{accent-color:var(--text)}
.grid-choice{flex-direction:column;gap:5px;font-size:11px;padding:8px 4px}.grid-choice svg{width:28px;height:28px}.step-control{display:flex;align-items:center;gap:8px}.step-control label{display:flex;align-items:center;gap:8px;flex:1}.step-control input{width:100%;min-width:0;background:var(--selected);border:0;border-radius:5px;padding:8px;text-align:center;font-size:16px}.step-control label span{font-size:12px;color:var(--muted)}.preview-actions{margin:10px 0}.preview-actions button{font-size:12px}.dimension-fields{display:flex;align-items:end;gap:10px;margin:16px 0}.dimension-fields label{flex:1;min-width:0;font-size:12px;color:var(--muted)}.dimension-fields input{display:block;margin-top:6px;width:100%;min-width:0;background:var(--selected);color:var(--text);padding:8px;border:0;border-radius:5px;font-size:16px}.dimension-fields>span{padding-bottom:9px}.geometry-panel{background:var(--opaque);backdrop-filter:none;-webkit-backdrop-filter:none}@media(min-width:900px){#panel.geometry-panel{left:auto;right:24px;top:90px;bottom:auto;transform:none;width:366px;max-height:calc(100dvh - 180px)}}
#board:focus{outline:none}#board:focus-visible{outline:1px solid var(--text);outline-offset:-2px}

/* Compact footer; preserve generous touch targets on coarse pointers. */
:root{--footer-width:284px;--footer-height:44px;--footer-bottom:max(12px,env(safe-area-inset-bottom))}
#dock{width:min(var(--footer-width),calc(100% - 24px));height:var(--footer-height);padding:4px;bottom:var(--footer-bottom)}
#dock button{width:36px;min-height:36px;padding:7px}
#dock button svg,#navigation button svg{width:21px;height:21px}
#dock .tool-spacer{width:36px}
#navigation{width:min(var(--footer-width),calc(100% - 24px));bottom:calc(var(--footer-bottom) + var(--footer-height) + 8px);gap:6px}
#navigation .glass{padding:3px}
#navigation .zoom-value{min-width:48px;padding:6px;font-size:11px}
#sheets,#panel{bottom:calc(var(--footer-bottom) + var(--footer-height) + 58px)}
#sheets{padding:4px;gap:3px}
#sheets button{height:40px;min-width:40px;padding:3px}
#sheets svg{width:30px;height:30px}
#header{z-index:3}#dock,#navigation{z-index:2}
@media(min-width:700px){:root{--footer-bottom:max(24px,env(safe-area-inset-bottom))}}
@media(pointer:coarse){:root{--footer-width:326px;--footer-height:52px}#dock button,#navigation button{width:44px;min-height:44px}#dock .tool-spacer{width:44px}#sheets button{min-width:44px;height:44px}#sheets,#panel{bottom:calc(var(--footer-bottom) + var(--footer-height) + 66px)}}
@media(max-height:550px){#panel,#sheets,#navigation{bottom:calc(var(--footer-bottom) + var(--footer-height) + 8px)}#navigation{width:auto}}
/* Wide layouts keep sheets within reach along the left viewport edge. */
@media(min-width:900px){
 #sheets{left:max(12px,env(safe-area-inset-left));right:auto;top:50%;bottom:auto;transform:translateY(-50%);flex-direction:column;align-items:stretch;width:max-content;max-width:80px;max-height:calc(100dvh - 200px);overflow-x:hidden;overflow-y:auto}
 #sheets button{flex-shrink:0}
 #sheets button.icon{width:100%}
}
/* Shared popup/dialog rhythm and typography. */
:root{--surface-padding:16px;--surface-gap:12px;--surface-title:18px;--surface-body:13px;--surface-caption:12px}
#panel,dialog{padding:var(--surface-padding);font-size:var(--surface-body);line-height:1.5}
.panel-head,.dialog-head{display:flex;align-items:center;justify-content:space-between;gap:var(--surface-gap);height:auto;min-height:36px;margin:0 0 var(--surface-gap)}
.panel-head strong,.dialog-head h1,.dialog-head h2{font-size:var(--surface-title);font-weight:500;line-height:1.4;letter-spacing:0;margin:0}
button.close-button{width:36px;height:36px;min-height:36px;padding:8px;flex:0 0 36px}
button.close-button svg{width:20px;height:20px}
#panel button,dialog button{font-size:var(--surface-body);line-height:1.4}
#panel .row,dialog .row{gap:8px}
#panel .choices{gap:4px}
#panel .hint,dialog .hint,#panel .section-label,#panel .dimension-fields label,#form-fields label,.card-meta{font-size:var(--surface-caption);line-height:1.5}
#panel .hint,dialog .hint{margin:var(--surface-gap) 0 0}
#panel .section-label{margin:16px 0 8px}
#panel .field,dialog .field{gap:var(--surface-gap);margin:8px 0 16px;font-size:var(--surface-caption)}
#form-fields label{margin:16px 0 8px}
#form-fields>label:first-child{margin-top:0}
#panel input,#panel select,dialog input,dialog select{font-size:16px;line-height:1.4;padding:8px;border:0;border-radius:5px;background:var(--selected)}
#panel .dimension-fields{gap:8px;margin:16px 0}
#panel .dimension-fields input{margin-top:8px}
#panel .preview-actions{margin:var(--surface-gap) 0}
.actions{margin-top:16px}
#library-grid{gap:16px;margin-top:16px}
.card-title{font-size:var(--surface-body);margin:8px 0 4px}
.card-actions{gap:4px}
.card-actions button{min-height:36px;padding:6px 8px}
#panel.color-panel{height:320px;gap:var(--surface-gap)}
#panel.color-panel .panel-head{margin:0;flex:none}
@media(pointer:coarse){button.close-button{width:44px;height:44px;min-height:44px;flex-basis:44px}#panel.color-panel{height:328px}}
@media(max-height:550px){#panel.color-panel{height:260px;overflow-y:auto}}
/* Navigation belongs to the viewport corner, independent of drawing tools. */
#navigation{left:max(12px,env(safe-area-inset-left));bottom:var(--footer-bottom);transform:none;width:auto}
#navigation .touch-navigation{display:none}
@media(any-pointer:coarse){#navigation .touch-navigation{display:flex}}
/* Keep corner navigation clear of the centered dock on narrow screens. */
@media(max-width:700px){#navigation{bottom:calc(var(--footer-bottom) + var(--footer-height) + 8px)}}
.grid-level{margin-top:16px}
.grid-level-heading{display:flex;align-items:center;justify-content:space-between;font-size:13px;gap:12px}
.grid-level-heading button{min-width:44px}
.grid-level-fields{display:flex;gap:8px;align-items:end;margin-top:8px}
.grid-level-fields label{flex:1;min-width:0;font-size:12px;color:var(--muted)}
.grid-level-fields input{display:block;width:100%;margin-top:8px;min-width:0}
.grid-level-fields>span{padding-bottom:10px}
#panel .grid-level .hint{margin-top:8px}
.canvas-units{display:flex;align-items:end;gap:6px;margin-top:16px}
.canvas-units label{flex:1;min-width:0;font-size:12px;color:var(--muted)}
.canvas-units input{display:block;width:100%;min-width:0;margin-top:8px}
.canvas-units>span{padding-bottom:10px}
.sheet-actions{margin-top:12px}
/* Six controls now share one combined Canvas and grid entry. */
:root{--footer-width:246px}
@media(pointer:coarse){:root{--footer-width:280px}}

#sheets button.icon svg{width:21px;height:21px}
#control-tooltip{position:fixed;z-index:1000;pointer-events:none;padding:6px 8px;border-radius:5px;background:var(--opaque);color:var(--text);box-shadow:0 2px 8px var(--shadow);font-size:11px;font-weight:400;line-height:1.3;white-space:nowrap;max-width:calc(100vw - 16px)}
#control-tooltip[hidden]{display:none}

/* Independent floating groups leave the center open to the drawing board. */
#header{padding:0;justify-content:space-between;pointer-events:none}
.header-group{position:relative;display:flex;align-items:center;gap:10px;padding:6px;flex:none;pointer-events:auto}
#save{flex-shrink:0;text-align:right}
@media(max-width:400px){.header-group{gap:2px;padding:4px}#document-label{gap:8px;font-size:10px}}

/* Header actions open directly below their toolbar group. */
#panel.header-panel{left:auto;right:12px;top:calc(max(12px,env(safe-area-inset-top)) + 56px);bottom:auto;transform:none;max-height:calc(100dvh - max(12px,env(safe-area-inset-top)) - 68px)}
@media(min-width:700px){#panel.header-panel{right:24px}}

.header-left{display:flex;align-items:center;gap:8px;pointer-events:none}
.header-modes .modes{background:transparent}
@media(max-width:400px){.header-left{gap:6px}}
#panel.app-panel{left:12px;right:auto}
#feedback-draft{display:block;width:100%;resize:vertical;min-height:100px;max-height:40dvh;margin:8px 0 12px;padding:10px;border:0;border-radius:5px;background:var(--selected);color:inherit;font:inherit;font-size:13px}
@media(min-width:700px){#panel.app-panel{left:24px}}
#library-grid .thumbnail{background:transparent;padding:0}
#library-grid .thumbnail:hover{background:transparent}
.card-title{white-space:normal;overflow-wrap:anywhere;line-height:1.4;min-height:2.8em;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;cursor:text}
.card-title:focus-visible{outline:1px solid var(--text);outline-offset:3px;border-radius:2px}
.card-actions{align-items:center;justify-content:space-between}
.card-actions button.icon svg{width:18px;height:18px}
/* Equal-width masonry cards; only the library dialog scrolls. */
#library{position:fixed;inset:0;margin:0;width:100%;max-width:none;height:100dvh;max-height:none;border-radius:0;padding:24px;overflow:auto}
@media(max-width:600px){#library{padding:16px}}
#library-grid{display:block;columns:260px;column-gap:36px}
.library-card{display:inline-block;width:100%;break-inside:avoid;vertical-align:top;margin-bottom:40px}
.library-sheets{display:grid;grid-template-columns:repeat(var(--sheet-columns,1),minmax(0,1fr));gap:6px;align-items:start}
#library-grid .library-sheets .thumbnail{height:auto;min-height:0;width:100%;padding:0;border-radius:0;display:block}
#library-grid .library-sheets .thumbnail svg{width:100%;height:auto}
.card-title{min-height:0;margin-top:12px}
#library-grid{margin-top:28px}
@media(max-width:600px){#library-grid{column-gap:24px}.library-card{margin-bottom:32px}}

#library .library-header{position:sticky;top:-24px;z-index:2;margin:-24px -24px 0;padding:24px 24px 12px;background:var(--opaque);box-shadow:0 1px 0 #88888826}
#library .library-header .hint{margin-bottom:0}
@media(max-width:600px){#library .library-header{top:-16px;margin:-16px -16px 0;padding:16px 16px 12px}}

/* One viewport inset for every floating toolbar. */
:root{--edge-gap:12px;--edge-top:max(var(--edge-gap),env(safe-area-inset-top));--edge-right:max(var(--edge-gap),env(safe-area-inset-right));--edge-bottom:max(var(--edge-gap),env(safe-area-inset-bottom));--edge-left:max(var(--edge-gap),env(safe-area-inset-left));--footer-bottom:var(--edge-bottom)}
#header{top:var(--edge-top);left:var(--edge-left);right:var(--edge-right);align-items:flex-start}
#document-label{top:calc(var(--edge-top) + 57px);left:calc(var(--edge-left) + 10px);right:calc(var(--edge-right) + 10px)}
#navigation{left:var(--edge-left)}
#dock{bottom:var(--edge-bottom)}
@media(min-width:900px){#sheets{left:var(--edge-left)}}
#panel.header-panel{right:var(--edge-right);top:calc(var(--edge-top) + 56px);max-height:calc(100dvh - var(--edge-top) - var(--edge-bottom) - 56px)}
#panel.app-panel{left:var(--edge-left);right:auto}

/* Colors: shared choices, document ink, and per-mark full color. */
#panel.color-panel{height:auto;display:block;overflow:auto;width:min(380px,calc(100% - 24px));max-height:calc(100dvh - var(--edge-top) - var(--footer-bottom) - var(--footer-height) - 32px);bottom:calc(var(--footer-bottom) + var(--footer-height) + 8px)}
#panel.color-panel .panel-head{margin-bottom:6px}
.color-modes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
.color-modes button{flex-direction:column;padding:6px 2px;font-size:12px;gap:4px;min-width:0}
.color-modes button svg{width:28px;height:28px}
.color-section{border-top:.5px solid #88888840;margin-top:8px;padding-top:8px}
.color-heading{display:flex;justify-content:space-between;align-items:center;min-height:28px}
.color-heading strong,.color-section>strong{font-size:13px;font-weight:500}
.auto-ink{width:16px;height:16px;border-radius:50%;background:linear-gradient(90deg,#000 50%,#fff 50%);box-shadow:0 0 0 .5px #888}
.color-presets{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:4px;margin:4px 0}
.color-presets .color-swatch{aspect-ratio:1;min-height:0;padding:3px}
.color-presets .color-swatch>span{height:auto;aspect-ratio:1}
.color-swatch{min-width:0;min-height:44px;position:relative;padding:5px;border-radius:6px}
.color-swatch>span{display:block;width:100%;height:34px;border-radius:4px;box-shadow:inset 0 0 0 .5px #88888840}
.color-swatch[aria-pressed=true]{outline:1px solid var(--text);outline-offset:-1px;box-shadow:none}
.color-swatch b{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-size:12px;line-height:20px;text-align:center;width:20px;height:20px;border-radius:50%;color:white;background:#202020}
.custom-color summary{display:flex;align-items:center;gap:10px;cursor:pointer;min-height:44px;font-size:13px;list-style:none}
.custom-color summary::-webkit-details-marker{display:none}
.custom-color summary:after{content:'›';margin-left:auto;font-size:20px}
.custom-color[open] summary:after{transform:rotate(90deg)}
.spectrum{width:24px;height:24px;border-radius:4px;background:conic-gradient(red,yellow,lime,cyan,blue,magenta,red)}
.custom-color-fields{display:flex;gap:10px;align-items:center;padding:8px 0}
.custom-color-fields input{height:44px;border:0;border-radius:5px;background:var(--selected);font-size:16px;min-width:0}
#custom-ink{width:64px;padding:4px;cursor:pointer}#custom-hex{flex:1;width:100%;padding:8px}
.shade-options{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin-top:8px}
.shade-options .color-swatch{padding:3px;min-height:44px;height:44px}.shade-options .color-swatch>span{height:38px}.shade-options small{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);font-size:11px;font-weight:500;line-height:18px;padding:0 3px;border-radius:3px;color:#fff;background:#0009;pointer-events:none}.shade-options .color-swatch b{display:none}
.color-scope{margin:6px 0;font-size:11px;line-height:1.4}.paper-appearance .choices{margin-top:4px}.paper-appearance button{min-height:44px}
@media(max-width:700px){#panel.color-panel{bottom:calc(var(--footer-bottom) + var(--footer-height) + 8px);max-height:calc(100dvh - var(--edge-top) - var(--footer-bottom) - var(--footer-height) - 32px)}}
#panel.color-panel{z-index:4;background:var(--opaque)}
#panel.color-panel .panel-head{position:sticky;top:-14px;z-index:2;background:var(--opaque);padding:8px 0;margin-top:-8px}
#panel.color-panel .section-label{margin:4px 0;font-size:11px}
#panel.color-panel .color-scope{margin:6px 0;font-size:11px;line-height:1.4}
#panel.color-panel .panel-head{padding:4px 0;margin-top:-4px}
.shade-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.shade-heading strong{font-size:13px;font-weight:500}.shade-stepper{display:flex;align-items:center;gap:2px;font-size:12px}.shade-stepper>span{color:var(--muted);margin-right:4px}.shade-stepper button{width:44px;min-height:44px;padding:0;font-size:18px}.shade-stepper output{min-width:20px;text-align:center;font-variant-numeric:tabular-nums}

/* One shared chrome rhythm for every floating toolbar. */
:root{--toolbar-padding:4px;--toolbar-gap:4px;--toolbar-radius:12px;--toolbar-button-radius:8px;--toolbar-top:#ffffffa8;--toolbar-bottom:#f2f2f28c}
body[data-theme=dark]{--toolbar-top:#3636369e;--toolbar-bottom:#232323b3}
#header .header-group,#dock,#sheets>.glass,#navigation .glass{padding:var(--toolbar-padding);gap:var(--toolbar-gap);border-radius:var(--toolbar-radius);background:linear-gradient(120deg,var(--toolbar-top),var(--toolbar-bottom))}
#header .modes{gap:var(--toolbar-gap);padding:0}
#header button,#dock button,#sheets button,#navigation button{border-radius:var(--toolbar-button-radius)}
.header-left,#navigation{gap:8px}
#dock{width:max-content;max-width:calc(100% - 24px)}
#navigation .glass:not(.touch-navigation){display:flex;align-items:center}
@media(prefers-reduced-transparency:reduce),(prefers-contrast:more){#header .header-group,#dock,#sheets>.glass,#navigation .glass{background:var(--opaque);backdrop-filter:none;-webkit-backdrop-filter:none}}
@media(max-width:899px){#sheets{bottom:calc(var(--footer-bottom) + var(--footer-height) * 2 + 16px)}}

/* Borderless floating surfaces: selection uses fill, never a bevel. */
:root{--toolbar-radius:14px;--toolbar-button-radius:10px;--toolbar-surface:#f4f4f4b8;--toolbar-control:36px;--toolbar-height:44px}
body[data-theme=dark]{--toolbar-surface:#292929b8}
#header .header-group,#dock,#sheets>.glass,#navigation .glass{background:var(--toolbar-surface);border:0;box-shadow:0 3px 12px #00000018}
#header .header-group:before,#header .header-group:after,#dock:before,#dock:after,#sheets:before,#sheets:after,#navigation .glass:before,#navigation .glass:after{display:none}
#header button,#header .mark,#dock button,#navigation button{width:var(--toolbar-control);height:var(--toolbar-control);min-height:var(--toolbar-control);padding:7px;flex-shrink:0;box-shadow:none}
#header button[aria-pressed=true],#dock button[aria-pressed=true],#sheets button[aria-pressed=true],#navigation button[aria-pressed=true]{box-shadow:none;background:var(--selected)}
#header button svg,#dock button svg,#navigation button svg,#sheets button.icon svg{width:22px;height:22px}
#header .mark svg{width:30px;height:30px}
#header{height:auto}
#dock{height:var(--toolbar-height)}
#sheets button{min-height:var(--toolbar-control);height:var(--toolbar-control)}
#document-label{top:calc(var(--edge-top) + var(--toolbar-height) + 8px)}
#panel.header-panel{top:calc(var(--edge-top) + var(--toolbar-height) + 8px)}
@media(max-width:700px),(pointer:coarse){:root{--toolbar-control:44px;--toolbar-height:52px;--footer-height:52px}}
@media(max-width:389px){#header{flex-wrap:wrap;gap:8px}.header-actions{margin-left:auto}#document-label{top:calc(var(--edge-top) + var(--toolbar-height) * 2 + 16px)}#panel.header-panel{top:calc(var(--edge-top) + var(--toolbar-height) * 2 + 16px)}}
@media(prefers-reduced-transparency:reduce),(prefers-contrast:more){#header .header-group,#dock,#sheets>.glass,#navigation .glass{background:var(--opaque)}}

/* Popups follow the same flat, borderless treatment as the toolbars. */
#panel,dialog{background:var(--opaque);border:0}
#panel,dialog:not(#library){border-radius:14px}

/* Popup controls share the toolbar's rounded control shape. */
#panel button,#panel input,#panel select,#panel textarea,
dialog button,dialog input,dialog select,dialog textarea,#feedback-draft{
 border-radius:var(--toolbar-button-radius)
}
#panel .color-swatch>span{border-radius:calc(var(--toolbar-button-radius) - 4px)}

/* A shared track makes mutually exclusive options read as one control. */
:root{--segment-track:#0000000c;--settings-divider:#00000012}
body[data-theme=dark]{--segment-track:#00000030;--settings-divider:#ffffff12}
#panel .choices,#panel .color-modes,dialog .choices{
 background:var(--segment-track);padding:4px;gap:4px;border-radius:var(--toolbar-radius)
}
#panel .settings-section{
 margin-top:20px;padding-top:16px;border-top:1px solid var(--settings-divider)
}
#panel .settings-section>.section-label{margin:0 0 10px;color:var(--text);font-size:var(--surface-body)}
#panel .canvas-units input:disabled{opacity:.45;cursor:not-allowed}

/* Accessible switches retain a generous target around the compact track. */
#panel .level-switch{width:44px;height:44px;min-height:44px;padding:0;background:transparent;flex:none}
.level-switch .switch-track{display:block;width:40px;height:24px;padding:3px;border-radius:12px;background:var(--selected)}
.level-switch .switch-track>span{display:block;width:18px;height:18px;border-radius:50%;background:var(--muted)}
.level-switch[aria-checked=true] .switch-track{background:var(--text)}
.level-switch[aria-checked=true] .switch-track>span{transform:translateX(16px);background:var(--opaque)}
#panel .grid-level-fields input:disabled{opacity:.45;cursor:not-allowed}

/* Quiet scrollbars: reveal the thumb without changing the content width. */
:root{--scroll-thumb:#00000040;--scroll-thumb-active:#00000066}
body[data-theme=dark]{--scroll-thumb:#ffffff40;--scroll-thumb-active:#ffffff66}
#panel,dialog,#sheets .sheet-list,textarea{
 scrollbar-width:thin;scrollbar-color:transparent transparent
}
:is(#panel,dialog,#sheets .sheet-list,textarea):hover,
:is(#panel,dialog,#sheets .sheet-list,textarea):has(:focus-visible),textarea:focus-visible{
 scrollbar-color:var(--scroll-thumb) transparent
}
:is(#panel,dialog,#sheets .sheet-list,textarea)::-webkit-scrollbar{width:6px;height:6px}
:is(#panel,dialog,#sheets .sheet-list,textarea)::-webkit-scrollbar-track,
:is(#panel,dialog,#sheets .sheet-list,textarea)::-webkit-scrollbar-corner{background:transparent}
:is(#panel,dialog,#sheets .sheet-list,textarea)::-webkit-scrollbar-thumb{background:transparent;border-radius:6px}
:is(#panel,dialog,#sheets .sheet-list,textarea):hover::-webkit-scrollbar-thumb,
:is(#panel,dialog,#sheets .sheet-list,textarea):has(:focus-visible)::-webkit-scrollbar-thumb,
textarea:focus-visible::-webkit-scrollbar-thumb{background:var(--scroll-thumb)}
:is(#panel,dialog,#sheets .sheet-list,textarea)::-webkit-scrollbar-thumb:hover{background:var(--scroll-thumb-active)}
@media(hover:none){
 #panel,dialog,#sheets .sheet-list,textarea{scrollbar-color:var(--scroll-thumb) transparent}
 :is(#panel,dialog,#sheets .sheet-list,textarea)::-webkit-scrollbar-thumb{background:var(--scroll-thumb)}
}

/* Keep the settings title reachable and trim repeated grid-level spacing. */
#panel.geometry-panel .panel-head{
 position:sticky;top:calc(-1 * var(--surface-padding));z-index:3;
 margin:calc(-1 * var(--surface-padding)) calc(-1 * var(--surface-padding)) 12px;
 padding:var(--surface-padding) var(--surface-padding) 8px;
 background:var(--opaque)
}
#panel .grid-level.settings-section{margin-top:12px;padding-top:8px}
#panel .grid-level-fields{margin-top:0}
#panel .grid-level-fields input{margin-top:4px}

#panel.color-panel .panel-head+.paper-appearance{border-top:0;margin-top:0;padding-top:0}

#panel.color-panel .panel-head strong,
#panel.color-panel .color-section-title{font-size:var(--surface-title);font-weight:500;line-height:1.4;letter-spacing:0}

.about-identity{display:flex;flex-direction:column;align-items:center;text-align:center;padding:24px 8px 20px;gap:12px}
.about-identity img{display:block;width:88px;height:88px;clip-path:path("M44 0C6 0 0 6 0 44C0 82 6 88 44 88C82 88 88 82 88 44C88 6 82 0 44 0Z")}
body[data-theme=dark] .about-identity img{filter:invert(1)}
.about-identity h2{font-size:26px;font-weight:600;line-height:1.2;letter-spacing:-.5px;margin:0}
.about-identity p{max-width:270px;font-size:14px;line-height:1.5;color:var(--muted);margin:0}

/* Separate sheet navigation from sheet actions; only previews scroll. */
#sheets{padding:0;gap:8px;overflow:visible}
#sheets>.glass{display:flex;flex-direction:inherit;align-items:stretch;min-width:0;min-height:0}
#sheets .sheet-list{overflow:auto}
#sheets .sheet-actions{flex:none;margin-top:0}
#sheets button{flex-shrink:0}

.about-maker{font-size:13px;line-height:1.5;color:var(--text);text-underline-offset:3px}
