:root {
  color-scheme: light;
  --canvas: #ECEAE4;
  --surface: #FFFFFF;
  --surface-2: #F4F3EF;
  --well: #E3E1DA;
  --track: #D6D4CD;
  --line: rgb(17 17 16 / .08);
  --fill: rgb(17 17 16 / .05);
  --fill-2: rgb(17 17 16 / .09);
  --ink: #111110;
  --ink-2: #6B6A65;
  --ink-3: #8E8D87;
  --on-ink: #FFFFFF;
  --island: #000000;
  --accent: #E0102F;
  --warn-bg: #F6E9CB;
  --warn-ink: #5C4205;
  --shadow: 0 1px 1px rgb(0 0 0 / .03), 0 8px 24px -12px rgb(0 0 0 / .12);
  --shadow-2: 0 2px 4px rgb(0 0 0 / .05), 0 24px 60px -20px rgb(0 0 0 / .3);
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --hit: 36px;
  --spring: linear(0, .0052 1.19%, .0195 2.38%, .0413 3.57%, .0692 4.76%, .1382 7.14%, .2604 10.71%, .4702 16.67%, .5833 20.24%, .6812 23.81%, .7627 27.38%, .8286 30.95%, .8801 34.52%, .9195 38.1%, .9564 42.86%, .98 47.62%, .9984 54.76%, 1.0061 65.48%, 1);
  --spring-dur: 600ms;
}
@media (pointer: coarse) { :root { --hit: 44px; } }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --canvas: #0E0E0D; --surface: #1A1A19; --surface-2: #222220; --well: #2A2A28; --track: #3A3A37;
    --line: rgb(242 241 237 / .09); --fill: rgb(242 241 237 / .06); --fill-2: rgb(242 241 237 / .11);
    --ink: #F2F1ED; --ink-2: #A09F99; --ink-3: #6E6D68; --on-ink: #111110;
    --warn-bg: #3A3016; --warn-ink: #F1D88E;
    --shadow: 0 0 0 1px rgb(255 255 255 / .04);
    --shadow-2: 0 0 0 1px rgb(255 255 255 / .07), 0 24px 60px -20px rgb(0 0 0 / .7);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #0E0E0D; --surface: #1A1A19; --surface-2: #222220; --well: #2A2A28; --track: #3A3A37;
  --line: rgb(242 241 237 / .09); --fill: rgb(242 241 237 / .06); --fill-2: rgb(242 241 237 / .11);
  --ink: #F2F1ED; --ink-2: #A09F99; --ink-3: #6E6D68; --on-ink: #111110;
  --warn-bg: #3A3016; --warn-ink: #F1D88E;
  --shadow: 0 0 0 1px rgb(255 255 255 / .04);
  --shadow-2: 0 0 0 1px rgb(255 255 255 / .07), 0 24px 60px -20px rgb(0 0 0 / .7);
}
@media (prefers-reduced-motion: reduce) { :root { --spring-dur: 1ms; } }

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 72px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--canvas); color: var(--ink); font: 400 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
button, input, select { font: inherit; color: inherit; }
svg { display: block; }
a { color: inherit; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-2); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.sw-t { display: inline-block; }
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
kbd { font: 500 11px/1 var(--mono); padding: 4px 6px; border-radius: 6px; background: var(--fill-2); color: var(--ink-2); }

#island {
  position: fixed; inset: auto; top: max(10px, env(safe-area-inset-top)); left: 50%; translate: -50% 0;
  margin: 0; padding: 0; border: 0; background: none; overflow: visible; max-width: none; max-height: none;
  z-index: 60; color: #fff; outline: none; transition: translate var(--spring-dur) var(--spring), opacity .3s;
}
#island.away { translate: -50% calc(-100% - 20px); opacity: 0; pointer-events: none; }
#island::backdrop { background: rgb(14 14 13 / .22); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); animation: fade .3s; }
@keyframes fade { from { opacity: 0; } }
.isl { position: relative; overflow: hidden; background: var(--island); box-shadow: var(--shadow-2); isolation: isolate; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .isl { box-shadow: 0 0 0 1px rgb(255 255 255 / .1), var(--shadow-2); } }
:root[data-theme="dark"] .isl { box-shadow: 0 0 0 1px rgb(255 255 255 / .1), var(--shadow-2); }
.isl-l { position: absolute; left: 50%; top: 0; translate: -50% 0; width: max-content; }
.isl-idle { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 8px 0 14px; border: 0; background: none; color: #fff; cursor: pointer; font-size: 13.5px; font-weight: 500; white-space: nowrap; }
.isl-kbd { background: rgb(255 255 255 / .12); color: rgb(255 255 255 / .7); }
@media (pointer: coarse) { .isl-kbd { display: none; } .isl-idle { padding-right: 12px; } }
.ring { width: 18px; height: 18px; rotate: -90deg; }
.ring circle { fill: none; stroke-width: 2.4; }
.ring circle:first-child { stroke: currentColor; opacity: .22; }
.ring circle:last-child { stroke: currentColor; stroke-linecap: round; stroke-dasharray: 0 100; transition: stroke-dasharray var(--spring-dur) var(--spring); }
#islRing.full circle:last-child { stroke: var(--accent); }
.isl-busy, .isl-done { width: 38px; height: 38px; display: grid; place-items: center; }
.isl-busy svg, .isl-done svg { width: 22px; height: 22px; fill: none; stroke: #fff; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.isl-busy circle, .mb-busy circle { stroke-dasharray: 28 100; animation: spin .9s linear infinite; transform-origin: center; }
@keyframes spin { to { rotate: 360deg; } }
.isl-done path { stroke-dasharray: 1; stroke-dashoffset: 1; }
.isl-toast { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 18px 8px 8px; max-width: min(520px, calc(100vw - 24px)); font-size: 14px; font-weight: 500; color: #fff; cursor: pointer; }
.isl-ic { width: 28px; height: 28px; border-radius: 50%; flex: none; background: var(--accent) no-repeat center / 14px; }
.isl-ic[data-kind="ok"] { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 8.5l3 3 6-7'/%3E%3C/svg%3E"); }
.isl-ic[data-kind="warn"] { background-color: #F2B233; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M8 3.5v5.5M8 12.2v.3'/%3E%3C/svg%3E"); }
.isl-ic[data-kind="info"] { background-color: rgb(255 255 255 / .16); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M8 7v5M8 3.8v.3'/%3E%3C/svg%3E"); }
.isl-toast span:last-child { text-wrap: pretty; }
.isl-drop { display: grid; justify-items: center; gap: 6px; padding: 22px 36px 20px; color: #fff; text-align: center; }
.isl-drop .ic { width: 26px; height: 26px; stroke-width: 1.4; }
.isl-drop b { font-size: 17px; font-weight: 600; }
.isl-drop small { color: rgb(255 255 255 / .55); font: 500 11.5px var(--mono); }
.isl-pal { color: var(--ink); }
.pal-in { display: flex; align-items: center; gap: 12px; height: 60px; padding: 0 16px 0 20px; border-bottom: 1px solid var(--line); color: var(--ink-2); }
#palInput { flex: 1; min-width: 0; border: 0; outline: 0; background: none; font-size: 17px; color: var(--ink); }
#palInput::placeholder { color: var(--ink-3); }
.pal-list { position: relative; padding: 6px; }
#palList { position: relative; list-style: none; margin: 0; padding: 0; max-height: min(52vh, 420px); overflow: auto; }
.pal-hi { position: absolute; left: 6px; right: 6px; top: 6px; border-radius: 12px; background: var(--fill-2); pointer-events: none; }
#palList li { position: relative; display: flex; justify-content: space-between; align-items: center; gap: 12px; height: 42px; padding: 0 12px; border-radius: 12px; cursor: pointer; font-size: 14.5px; }
#palList .empty { color: var(--ink-2); cursor: default; }
.isl-confirm { display: grid; gap: 18px; padding: 22px; color: var(--ink); }
.isl-confirm p { margin: 0; font-size: 15.5px; line-height: 1.45; }

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; height: 58px; padding: 0 max(18px, env(safe-area-inset-left)); background: color-mix(in srgb, var(--canvas) 86%, transparent); backdrop-filter: saturate(1.5) blur(16px); -webkit-backdrop-filter: saturate(1.5) blur(16px); border-bottom: 1px solid transparent; transition: border-color .3s; }
.top.scrolled { border-bottom-color: var(--line); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; font-weight: 600; font-size: 16px; letter-spacing: -.01em; }
.brand .ic { width: 20px; height: 20px; stroke-width: 1.5; }
.top-actions { display: flex; gap: 2px; }
.plain { display: inline-flex; align-items: center; gap: 8px; min-height: var(--hit); min-width: var(--hit); justify-content: center; padding: 0 10px; border: 0; border-radius: 999px; background: none; color: var(--ink-2); cursor: pointer; text-decoration: none; font-size: 13.5px; font-weight: 500; transition: background-color .2s, color .2s; }
.plain:hover { background: var(--fill); color: var(--ink); }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 max(18px, env(safe-area-inset-left)) 56px; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 40px; align-items: center; padding: 48px 0 56px; }
@media (max-width: 900px) { .hero { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 32px; } }
.eyebrow { margin: 0 0 18px; font: 500 12.5px/1 var(--mono); letter-spacing: .02em; color: var(--ink-2); }
h1 { font: 600 clamp(42px, 6.2vw, 80px)/.98 var(--font); letter-spacing: -.048em; margin: 0 0 22px; text-wrap: balance; }
.lead { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.45; color: var(--ink-2); margin: 0 0 30px; max-width: 30em; text-wrap: pretty; letter-spacing: -.005em; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; }
.hero-art { margin: 0; position: relative; background: var(--surface); border-radius: 32px; padding: 20px 20px 16px; box-shadow: var(--shadow); }
#heroSvg { width: 100%; height: auto; }
#heroSvg .h-screen { fill: #000; }
#heroSvg .h-sheet { fill: #fff; fill-opacity: .84; stroke: rgb(0 0 0 / .08); }
#heroSvg .h-faint { opacity: .16; }
#heroSvg .h-pencil { filter: grayscale(1) contrast(1.9); }
#heroSvg .h-grid line { stroke: var(--accent); stroke-width: 1; opacity: .55; }
#heroSvg .h-frame { fill: none; stroke: var(--accent); stroke-width: 2; }
#heroSvg .h-check circle { fill: #111110; }
#heroSvg .h-check path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.hero-cap { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 6px 0 0; font: 500 12.5px var(--mono); color: var(--ink-2); }
.hero-cap .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

.layout { display: grid; grid-template-columns: minmax(0, 520px) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 960px) { .layout { grid-template-columns: minmax(0, 1fr); } .plan { order: -1; } }
.steps { display: grid; gap: 16px; min-width: 0; }

.card { background: var(--surface); border-radius: 28px; padding: 22px 22px 24px; box-shadow: var(--shadow); display: grid; gap: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; gap: 12px; }
.card-head h2 { font: 600 19px/1.2 var(--font); letter-spacing: -.02em; margin: 0; }
.num { width: 26px; height: 26px; border-radius: 50%; background: var(--ink); color: var(--on-ink); font: 500 12.5px/26px var(--mono); text-align: center; flex: none; }
.badge { margin-left: auto; font-size: 12.5px; font-weight: 500; padding: 5px 11px; border-radius: 999px; background: var(--fill-2); color: var(--ink-2); transition: background-color var(--spring-dur) var(--spring), color .3s; }
.badge.ok { background: var(--ink); color: var(--on-ink); }
.row { display: grid; grid-template-columns: 100px minmax(0, 1fr); align-items: center; gap: 12px; min-width: 0; }
.label { color: var(--ink-2); font-size: 13.5px; }
@media (max-width: 440px) { .row { grid-template-columns: minmax(0, 1fr); gap: 8px; } }
.hint { margin: 0; color: var(--ink-2); font-size: 14px; text-wrap: pretty; }
.hint .sw-t { display: inline; }
.result { margin: 0; font-size: 13px; color: var(--ink-2); }
.note { margin: 0; padding: 11px 14px; border-radius: 16px; font-size: 14px; }
.note.warn { background: var(--warn-bg); color: var(--warn-ink); }
.privacy { display: flex; gap: 8px; align-items: center; margin: -6px 0 0; font-size: 13px; color: var(--ink-2); }
.privacy .ic { width: 14px; height: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--hit); padding: 0 16px; border-radius: 999px; border: 0; cursor: pointer; font-weight: 500; font-size: 14px; white-space: nowrap; text-decoration: none; transition: scale var(--spring-dur) var(--spring), background-color .2s; }
.btn:active, .chip:active, .plain:active { scale: .96; transition-duration: 90ms; }
.btn.primary { background: var(--ink); color: var(--on-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 84%, var(--canvas)); }
.btn.secondary { background: var(--fill-2); }
.btn.secondary:hover { background: color-mix(in srgb, var(--fill-2), var(--ink) 7%); }
.btn.danger { background: var(--accent); color: #fff; }
.btn.big { min-height: 50px; padding: 0 24px; font-size: 15.5px; }
.btn.big .ic { width: 18px; height: 18px; }
.chip { display: inline-flex; align-items: center; gap: 7px; min-height: var(--hit); padding: 0 13px; border-radius: 999px; border: 0; background: var(--fill); cursor: pointer; font-size: 13.5px; font-weight: 500; transition: scale var(--spring-dur) var(--spring), background-color .2s; }
.chip:hover { background: var(--fill-2); }
.chip.danger { color: var(--accent); }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btnrow.end { justify-content: flex-end; }
.linkbtn { background: none; border: 0; padding: 4px 2px; color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: 13.5px; }

.morph-btn { position: relative; display: block; flex: none; overflow: hidden; background: var(--ink); color: var(--on-ink); cursor: pointer; --btn: var(--ink); }
.mb-l { position: absolute; left: 50%; top: 0; translate: -50% 0; height: 38px; display: grid; place-items: center; white-space: nowrap; font-size: 14px; font-weight: 500; }
#fileBtnLabel { padding: 0 18px; }
.mb-busy, .mb-done { width: 38px; }
.mb-busy svg, .mb-done svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.mb-done path { stroke-dasharray: 1; stroke-dashoffset: 1; }

.seg { position: relative; display: inline-flex; flex-wrap: wrap; padding: 3px; border-radius: 999px; background: var(--well); max-width: 100%; justify-self: start; isolation: isolate; }
.seg label { position: relative; cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg > label > span { display: flex; align-items: center; gap: 6px; padding: 0 14px; height: calc(var(--hit) - 6px); border-radius: 999px; font-size: 13.5px; font-weight: 500; color: var(--ink-2); transition: color .25s; white-space: nowrap; }
.seg input:checked + span { color: var(--ink); }
.seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: -2px; }
.seg .thumb { position: absolute; z-index: -1; left: 0; top: 0; border-radius: 999px; background: var(--surface); box-shadow: 0 1px 2px rgb(0 0 0 / .08), 0 3px 10px -2px rgb(0 0 0 / .1); pointer-events: none; transition: scale .35s var(--spring); }
.seg .thumb.pressed { scale: .95; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg .thumb { background: #48484A; } }
:root[data-theme="dark"] .seg .thumb { background: #48484A; }
@media (forced-colors: active) { .seg input:checked + span { outline: 2px solid; } .seg .thumb { display: none; } }

.switch { display: inline-flex; align-items: center; gap: 10px; min-height: var(--hit); cursor: pointer; font-size: 13.5px; font-weight: 500; -webkit-tap-highlight-color: transparent; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.sw { position: relative; width: 46px; height: 28px; border-radius: 999px; background: var(--track); flex: none; transition: background-color var(--spring-dur) var(--spring); }
.sw i { position: absolute; left: 0; top: 2px; height: 24px; width: 24px; border-radius: 999px; background: #fff; box-shadow: 0 1px 1px rgb(0 0 0 / .06), 0 3px 8px rgb(0 0 0 / .16); }
.switch input:checked + .sw { background: var(--accent); }
.switch input:focus-visible + .sw { outline: 2px solid var(--ink); outline-offset: 2px; }

.slider { position: relative; height: 40px; cursor: grab; touch-action: none; outline: none; min-width: 0; -webkit-tap-highlight-color: transparent; }
.slider.active { cursor: grabbing; }
.sl-body { position: absolute; left: 0; right: 0; top: 0; bottom: 0; border-radius: 999px; background: var(--well); overflow: hidden; }
.sl-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); border-radius: 999px 0 0 999px; }
.sl-name, .sl-val { position: absolute; top: 50%; translate: 0 -50%; font-size: 13px; font-weight: 500; pointer-events: none; }
.sl-name, .sl-val { color: #fff; mix-blend-mode: difference; }
.sl-name { left: 16px; }
.sl-val { right: 16px; font-size: 12.5px; opacity: .75; }
.slider:focus-visible .sl-body { outline: 2px solid var(--ink); outline-offset: 2px; }

.select { position: relative; min-width: 0; }
.select select { appearance: none; width: 100%; min-height: var(--hit); border-radius: 999px; border: 0; background: var(--fill); padding: 0 36px 0 14px; font-size: 14px; font-weight: 500; cursor: pointer; }
.select .ic { position: absolute; right: 12px; top: 50%; translate: 0 -50%; pointer-events: none; color: var(--ink-2); }
.num-input { min-height: var(--hit); border-radius: 999px; border: 0; background: var(--fill); padding: 0 12px; font-size: 14px; width: 84px; font-family: var(--mono); font-variant-numeric: tabular-nums; }
.num-input:focus { outline: 2px solid var(--ink); outline-offset: 0; }
.pair, .grid-ctrl { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.stepper { display: inline-flex; align-items: center; border-radius: 999px; background: var(--fill); }
.stepper button { width: var(--hit); height: var(--hit); border: 0; background: none; border-radius: 999px; cursor: pointer; font-size: 17px; color: var(--ink-2); transition: background-color .2s, scale var(--spring-dur) var(--spring); }
.stepper button:hover { background: var(--fill-2); color: var(--ink); }
.stepper button:active { scale: .88; transition-duration: 80ms; }
.stepper .num-input { width: 46px; text-align: center; background: none; padding: 0 2px; -moz-appearance: textfield; }
.stepper .num-input::-webkit-inner-spin-button, .stepper .num-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.drop { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 10px 10px 10px 10px; border-radius: 22px; background: var(--surface-2); }
.drop img { width: 56px; height: 56px; object-fit: cover; border-radius: 14px; background: #fff; box-shadow: 0 0 0 1px var(--line); }
.drop-text { display: grid; min-width: 0; gap: 2px; grid-column: 2; }
.drop .morph-btn { grid-column: 3; }
.drop-text b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.drop-text span { font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
body.dragging #setup { filter: blur(2px); opacity: .6; transition: filter .3s, opacity .3s; }

.calib { display: grid; gap: 16px; }
.cardzone { overflow-x: auto; padding: 2px 14px 4px 2px; }
.cardbox { position: relative; display: grid; place-items: center; border: 2px solid var(--ink); color: var(--ink-2); font-size: 13px; background: repeating-linear-gradient(135deg, transparent 0 9px, var(--fill-2) 9px 10px); touch-action: none; }
.grip { position: absolute; right: -10px; top: 50%; width: 18px; height: 38px; margin-top: -19px; border-radius: 999px; background: var(--ink); cursor: ew-resize; transition: scale .3s var(--spring); }
.grip:hover, .grip.active { scale: 1.12; }
.grip::after { content: ""; position: absolute; inset: 11px 6px; border-left: 1.5px solid var(--on-ink); border-right: 1.5px solid var(--on-ink); }
.ruler { margin-top: 12px; color: var(--ink); overflow: visible; }
.ruler line { stroke: currentColor; stroke-width: 1; }
.ruler text { fill: var(--ink-2); font: 500 10px var(--mono); text-anchor: middle; }
.calib-ctrl { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.calib-ctrl .fine { gap: 2px; background: var(--fill); border-radius: 999px; }
.calib-ctrl .fine .chip { background: none; min-width: var(--hit); justify-content: center; }
.calib-ctrl .fine .chip:hover { background: var(--fill-2); }
.calib-ctrl .fine .mono { min-width: 58px; text-align: center; font-size: 12.5px; }

.startrow { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.tools { gap: 6px; }
.more { border-radius: 18px; background: var(--surface-2); }
.more summary { cursor: pointer; font-weight: 500; font-size: 14px; list-style: none; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 18px; }
.more summary::-webkit-details-marker { display: none; }
.more summary::before { content: ""; width: 7px; height: 7px; border-right: 1.6px solid; border-bottom: 1.6px solid; rotate: -45deg; transition: rotate var(--spring-dur) var(--spring); margin-left: 2px; }
.more[open] summary::before { rotate: 45deg; }
.more-body { padding: 0 16px 14px 35px; }
.more p, .more ul { font-size: 14px; color: var(--ink-2); margin: 0 0 10px; }
.coords { display: grid; gap: 4px 12px; margin: 10px 0 0; font-size: 13.5px; }
.coords dt { color: var(--ink-2); }
.coords dd { margin: 0 0 6px; overflow-wrap: anywhere; }
.tips { padding-left: 16px; display: grid; gap: 8px; }

.plan { position: sticky; top: 74px; min-width: 0; }
.plan-card { background: var(--surface); border-radius: 28px; padding: 18px; box-shadow: var(--shadow); }
#sheet { width: 100%; height: auto; max-height: calc(100vh - 160px); aspect-ratio: 1.3; }
@media (max-width: 960px) { .plan { position: static; } #sheet { max-height: 60vh; } }
#sheet .sh { fill: #FFFFFF; stroke: var(--ink-3); stroke-width: 1; vector-effect: non-scaling-stroke; }
#sheet .gl { stroke: var(--accent); stroke-width: 1.25; vector-effect: non-scaling-stroke; }
#sheet .cell { cursor: pointer; outline: none; }
#sheet .cell rect { fill: transparent; transition: fill .25s; }
#sheet .cell:hover rect, #sheet .cell:focus-visible rect { fill: rgb(224 16 47 / .07); }
#sheet .cell:focus-visible rect { stroke: var(--accent); stroke-width: 3; vector-effect: non-scaling-stroke; }
#sheet .cell .pin { transform-box: fill-box; transform-origin: center; transition: scale .45s var(--spring); }
#sheet .cell:hover .pin { scale: 1.12; }
#sheet .cell circle { fill: var(--accent); transition: fill .3s; }
#sheet .cell text { fill: #fff; font-family: var(--mono); font-weight: 500; text-anchor: middle; dominant-baseline: central; }
#sheet .cell.done circle { fill: #111110; }
#sheet .cell.cur circle { stroke: #fff; stroke-width: 2; vector-effect: non-scaling-stroke; }
#sheet .dl { stroke: var(--ink-3); stroke-width: 1; vector-effect: non-scaling-stroke; }
#sheet .dt { fill: var(--ink-2); font-family: var(--mono); }
.plan-cap { margin: 10px 0 0; font-size: 12.5px; color: var(--ink-2); text-align: center; }
.plan-tip { position: fixed; left: 0; top: 0; z-index: 30; display: grid; gap: 1px; padding: 8px 12px; border-radius: 14px; background: var(--island); color: #fff; font-size: 13px; pointer-events: none; white-space: nowrap; opacity: 0; box-shadow: var(--shadow-2); }
.plan-tip b { font-weight: 600; }
.plan-tip span { color: rgb(255 255 255 / .65); font-size: 11.5px; }

.foot { display: flex; gap: 16px; justify-content: center; padding: 48px 0 0; font-size: 13px; color: var(--ink-2); }

.grow-fx { position: fixed; left: 0; top: 0; z-index: 55; pointer-events: none; }

#trace { position: fixed; inset: 0; z-index: 50; background: #FFFFFF; overflow: hidden; color-scheme: light; touch-action: none; user-select: none; -webkit-user-select: none; forced-color-adjust: none; color: #111110; --hud-bg: #FFFFFF; --ink: #111110; --ink-2: #6B6A65; --fill: rgb(17 17 16 / .05); --fill-2: rgb(17 17 16 / .09); }
#trace.idle, #trace.idle * { cursor: none; }
#stage { position: absolute; left: 0; top: 0; transform-origin: 0 0; }
#paper { position: absolute; inset: 0; background: #FFFFFF; box-shadow: 0 0 0 100vmax #D9D8D3; }
#stage > img, #stage > svg { position: absolute; max-width: none; pointer-events: none; }
#imgView { -webkit-user-drag: none; }
#trace.pixel #imgView { image-rendering: pixelated; }
.ctl-bar { position: absolute; left: 20px; top: 16px; display: grid; gap: 4px; font-size: 11px; color: #6B6A65; transition: opacity .4s; }
.ctl-bar span { display: block; height: 6px; border: 1.5px solid #111110; border-top: 0; }
#trace.idle .ctl-bar { opacity: 0; }
.lock { position: absolute; inset: 0; z-index: 5; }
.hud { position: absolute; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); translate: -50% 0; z-index: 6; }
.hud-shape { position: relative; overflow: hidden; background: #fff; box-shadow: 0 0 0 1px rgb(17 17 16 / .08), 0 16px 40px -16px rgb(0 0 0 / .3); }
.hud-l { position: absolute; left: 50%; bottom: 0; translate: -50% 0; width: max-content; }
.hud-full { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px; max-width: calc(100vw - 24px); font-size: 13.5px; }
.hud-full button { min-height: var(--hit); min-width: var(--hit); padding: 0 12px; border: 0; border-radius: 999px; background: rgb(17 17 16 / .05); cursor: pointer; font-weight: 500; font-size: 13.5px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; transition: background-color .25s, color .25s, scale var(--spring-dur) var(--spring); }
.hud-full button:hover { background: rgb(17 17 16 / .1); }
.hud-full button:active { scale: .94; transition-duration: 80ms; }
.hud-full button[aria-pressed="true"] { background: #111110; color: #fff; }
#bPrev, #bNext, #bLock, #bFull { padding: 0; }
.done-btn .ic { display: none; }
.done-btn[aria-pressed="true"] .ic { display: block; }
.done-btn[aria-pressed="true"] path { stroke-dasharray: 1; animation: draw .4s cubic-bezier(.3,.7,.3,1) both; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.hud-btns { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.sep { width: 1px; height: 20px; background: rgb(17 17 16 / .1); margin: 0 4px; }
.part { padding: 0 6px; min-width: 112px; }
.part b { display: block; font-size: 15px; font-weight: 600; letter-spacing: -.01em; white-space: nowrap; }
.part small { display: block; color: #6B6A65; font-size: 12px; white-space: nowrap; }
.mini { position: relative; display: grid; gap: 3px; padding-left: 4px; }
.mini button { width: 18px; min-width: 0; height: 12px; min-height: 0; padding: 0; border-radius: 3px; background: rgb(17 17 16 / .1); position: relative; z-index: 1; }
.mini button.done { background: #8E8D87; }
.mini-cur { position: absolute; left: 0; top: 0; width: 18px; height: 12px; border-radius: 3px; background: var(--accent); z-index: 2; pointer-events: none; }
@media (pointer: coarse) { .mini button, .mini-cur { width: 26px; height: 18px; } }
.hud-status { flex-basis: 100%; font-size: 12.5px; color: #6B6A65; padding: 0 8px 2px; }
.hud-status .warn { color: #9A3412; }
.hud-compact { display: flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 10px; border: 0; background: none; font-size: 13px; font-weight: 500; color: #111110; cursor: pointer; }
.hud-compact .ring circle:last-child { stroke: var(--accent); }
.hud-lock { display: flex; align-items: center; gap: 9px; height: 44px; padding: 0 18px; border: 0; background: none; font-size: 13.5px; font-weight: 500; color: #111110; cursor: pointer; overflow: hidden; touch-action: none; }
.hud-lock > * { position: relative; }
.hud-lock i { position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: #111110; }
.hud-lock.holding { color: #fff; transition: color .6s; }

#printArea { display: none; }
@media print {
  @page { size: A4 portrait; margin: 0; }
  body { background: #fff; }
  #setup, #trace, #island, .plan-tip { display: none !important; }
  #printArea { display: block; }
  .pp { position: relative; width: 210mm; height: 297mm; overflow: hidden; break-after: page; }
  .pp .win { position: absolute; left: 10mm; top: 10mm; width: 190mm; height: 267mm; overflow: hidden; }
  .pp .win img { position: absolute; max-width: none; }
  .pp .lbl { position: absolute; left: 10mm; bottom: 8mm; font: 500 9pt var(--mono); color: #444; }
  .pp .ov { position: absolute; border: 0.2mm dashed #999; }
}
