/* Locally served, per the visual standard — no third-party font host, no layout shift from a
   late-arriving webfont, and the app keeps working with no network at all. */
@font-face{
  font-family:'DM Sans';src:url("fonts/dmsans-ed656a.7c87a648293f.woff2") format('woff2');
  font-weight:100 1000;font-style:normal;font-display:swap;
}
@font-face{
  font-family:'JetBrains Mono';src:url("fonts/jbmono-530d03.b636a65da4f0.woff2") format('woff2');
  font-weight:100 800;font-style:normal;font-display:swap;
}

/* plinth — an instrument, not a brochure. Dark by default, dense where it counts. */
:root{
  color-scheme: dark light;
  /* Radii stay at or below 7px: the standard treats restrained corners as part of the system,
     and mixed 8-20px radii read as decoration rather than structure. */
  --r:7px; --r-sm:5px; --r-pill:99px;
  --topbar: 54px;
  --sans:'DM Sans',ui-sans-serif,system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --mono:'JetBrains Mono',ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  /* Semantic accents, not decorative ones: each carries a fixed meaning across the app. */
  --brand:#7aa2ff; --teal:#63e6d2; --orange:#ffb26b; --green:#6ee7a8; --red:#ff7a8a; --purple:#b79cff;
  --brand2:var(--teal); --warm:var(--orange); --bad:var(--red); --good:var(--green);
}
:root, :root[data-theme="dark"]{
  --bg:#0b0d12; --bg2:#0f1218; --surface:#141922; --raised:#1a212c;
  --line:#232c3a; --line2:#2f3a4c;
  --fg:#e8eef8; --mut:#93a1b8; --dim:#67748a;
  --stage-top:#171d29; --shadow:rgba(0,0,0,.55);
}
:root[data-theme="light"]{
  color-scheme: light;
  --bg:#f6f7fa; --bg2:#eef1f6; --surface:#ffffff; --raised:#f2f5fa;
  --line:#dde3ec; --line2:#c6cfdc;
  --fg:#131922; --mut:#4d5a6d; --dim:#6d7a8c;
  --brand:#3b62d4; --teal:#0e8f7f; --orange:#a35a12; --green:#1a7f4f; --red:#c02b45; --purple:#6b4fd0;
  --stage-top:#e6eaf2; --shadow:rgba(20,30,50,.16);
}
*{box-sizing:border-box}
html,body{margin:0;height:100%}
body{
  background:var(--bg); color:var(--fg);
  font:15px/1.55 var(--sans);
  -webkit-font-smoothing:antialiased; overscroll-behavior:none;
}
a{color:var(--brand)}
h1,h2,h3{margin:0;font-weight:700}
:focus-visible{outline:2px solid var(--brand); outline-offset:2px; border-radius:var(--r-sm)}

/* ---------- topbar ---------- */
.topbar{
  height:var(--topbar); display:flex; align-items:center; gap:18px;
  padding:0 16px; border-bottom:1px solid var(--line);
  background:color-mix(in srgb,var(--bg) 86%,transparent); backdrop-filter:blur(10px);
  position:sticky; top:0; z-index:40;
}
.brand{display:flex;align-items:center;gap:9px;color:var(--fg);text-decoration:none;font-weight:700}
.brand .mark{width:22px;height:22px;fill:none;stroke:var(--brand);stroke-width:1.6;stroke-linejoin:round;stroke-linecap:round}
.topbar nav{margin-left:auto;display:flex;gap:4px;align-items:center}
.topbar nav a{
  color:var(--mut);text-decoration:none;padding:6px 11px;border-radius:var(--r);font-size:14px;font-weight:500;
}
.topbar nav a:hover{color:var(--fg);background:var(--surface)}
.topbar nav a.on{color:var(--fg);background:var(--raised)}
.topbar nav a.quiet{color:var(--dim)}

/* ---------- page mode (gallery, about) ---------- */
.page-mode{overflow-y:auto}
.wrap{max-width:1080px;margin:0 auto;padding:44px 22px 90px}
.lede{color:var(--mut);font-size:17px;max-width:62ch}
.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:22px}

/* ---------- studio shell ---------- */
.app-mode{height:100dvh;overflow:hidden}
/* The landmark wrapper must not add a box between the shell and the viewport. */
.app-mode .main-shell{height:calc(100dvh - var(--topbar));display:flex;flex-direction:column}
.app-mode .main-shell > .studio{flex:1;min-height:0;height:auto}
.studio{display:grid;grid-template-rows:1fr auto;height:calc(100dvh - var(--topbar))}
/* min-height:0 is load-bearing: a grid item defaults to min-height:auto, so the 1fr row refuses to
   shrink below the canvas's intrinsic height and pushes the action bar off the bottom of the
   viewport entirely. */
.stage{position:relative;min-width:0;min-height:0;background:
  radial-gradient(120% 90% at 50% 0%, var(--stage-top) 0%, var(--bg) 62%)}
.stage canvas{display:block;width:100%;height:100%;touch-action:none}
/* ---------- the one bar ---------- */
.actionbar{
  display:flex;align-items:center;gap:12px;padding:10px 14px;
  border-top:1px solid var(--line);background:color-mix(in srgb,var(--bg2) 92%,transparent);
  backdrop-filter:blur(12px);
  padding-bottom:max(10px,env(safe-area-inset-bottom));
}
.actionbar[hidden]{display:none}
.actionbar .seg.look{flex:1 1 auto;min-width:0;overflow-x:auto;scrollbar-width:none}
.actionbar .seg.look::-webkit-scrollbar{display:none}
.actionbar .seg.look button{flex:0 0 auto}
.bar-actions{display:flex;align-items:center;gap:8px;flex:0 0 auto}
.bar-actions .btn svg{width:15px;height:15px}

/* ---------- settings sheet ---------- */
.settings-card{padding:0;width:min(560px,100%);display:flex;flex-direction:column;max-height:88dvh}
.settings-head{
  display:flex;align-items:center;gap:12px;padding:18px 20px 14px;
  border-bottom:1px solid var(--line);position:sticky;top:0;background:var(--surface);z-index:2;
  border-radius:var(--r) 16px 0 0;
}
.settings-head h2{flex:1}
.settings-body{overflow-y:auto;overscroll-behavior:contain}
.settings-body .group:last-child{border-bottom:0}
.seg.wrap{flex-wrap:wrap}

.share-grid{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:14px}
.share-grid .btn{flex-direction:column;gap:2px;padding:12px 8px;height:auto}
.share-grid .btn b{font-size:13.5px;font-weight:650}
.share-grid .btn span{font-size:11px;color:var(--dim)}

#diagText{
  white-space:pre-wrap;font:11.5px/1.5 var(--mono);background:var(--bg);
  border:1px solid var(--line);border-radius:var(--r);padding:12px;margin-top:12px;
  max-height:52dvh;overflow:auto;
}

/* ---------- drop / intake ---------- */
.intake{
  position:absolute;inset:0;display:grid;place-items:center;padding:24px;z-index:12;
  background:radial-gradient(90% 70% at 50% 40%, rgba(122,162,255,.10), transparent 70%);
}
.intake.hidden{display:none}
.dropzone{
  width:min(560px,92%);border:1.5px dashed var(--line2);border-radius:var(--r);background:color-mix(in srgb,var(--surface) 88%,transparent);
  backdrop-filter:blur(6px); padding:34px 28px;text-align:center;transition:border-color .18s,background .18s,transform .18s;
}
.dropzone.hot{border-color:var(--brand);background:rgba(122,162,255,.10);transform:scale(1.01)}
.dropzone h2{font-size:22px;margin-bottom:6px}
.dropzone p{color:var(--mut);margin:8px 0 20px;font-size:14px}
.scan-path{color:var(--acc);font-size:13px;margin:-8px 0 18px;min-height:1em}
.scan-path:empty{display:none}
.intake-actions{display:flex;gap:10px;justify-content:center;flex-wrap:wrap}
.samples{margin-top:22px;padding-top:18px;border-top:1px solid var(--line)}
.samples b{font-size:11px;letter-spacing:.09em;text-transform:uppercase;color:var(--dim)}
.sample-row{display:flex;gap:8px;justify-content:center;flex-wrap:wrap;margin-top:10px}
.sample{
  width:64px;height:48px;border-radius:var(--r);border:1px solid var(--line2);cursor:pointer;overflow:hidden;
  padding:0;background:#0b0d12;transition:transform .15s,border-color .15s
}
.sample:hover{transform:translateY(-2px);border-color:var(--brand)}
.sample canvas{width:100%;height:100%;display:block}

.or-line{display:flex;align-items:center;gap:12px;margin:20px 0 14px;color:var(--dim);font-size:12px}
.or-line::before,.or-line::after{content:"";height:1px;flex:1;background:var(--line)}

/* ---------- guided scan ---------- */
.scan{position:absolute;inset:0;z-index:30;overflow:hidden;background:#000}
.scan[hidden]{display:none}
.scan video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.scan-veil{position:absolute;inset:0;background:
  radial-gradient(closest-side circle at 50% 46%, transparent 30%, rgba(6,8,12,.62) 72%)}
.scan-ui{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;
  justify-content:center;gap:12px;text-align:center;padding:22px}
.ring{width:min(56vmin,300px);height:min(56vmin,300px);position:absolute;top:46%;left:50%;
  transform:translate(-50%,-50%);pointer-events:none}
.ring .seg{fill:none;stroke:rgba(255,255,255,.20);stroke-width:9;stroke-linecap:round;
  transition:stroke .3s,opacity .3s}
.ring .seg.on{stroke:var(--brand2);filter:drop-shadow(0 0 6px var(--brand2))}
.ring .seg.live{stroke:#fff}
.coach{position:relative;margin-top:min(56vmin,300px);font-size:22px;font-weight:700;
  text-shadow:0 2px 18px rgba(0,0,0,.85)}
.scan-sub{position:relative;color:#cdd7e6;font-size:14.5px;max-width:38ch;text-shadow:0 2px 14px #000;min-height:2.6em}
.scan-actions{position:relative;display:flex;gap:8px;margin-top:6px}
.scan-count{position:absolute;top:18px;left:50%;transform:translateX(-50%);
  font:12px/1 var(--mono);color:#dbe4f2;background:rgba(10,13,18,.7);border:1px solid var(--line2);
  border-radius:99px;padding:7px 14px;backdrop-filter:blur(8px)}
.scan.blurry .ring .seg.live{stroke:var(--warm)}
.scan-debug{position:absolute;left:10px;right:10px;bottom:8px;font:11px/1.4 var(--mono);
  color:#9fe6c0;background:rgba(8,11,16,.72);border:1px solid var(--line2);border-radius:8px;
  padding:7px 10px;text-align:left;white-space:pre-wrap;word-break:break-word;pointer-events:none}

/* ---------- buttons & controls ---------- */
.btn.big{padding:13px 22px;font-size:15.5px;border-radius:var(--r)}
button{font:inherit;color:inherit}
.btn{
  display:inline-flex;align-items:center;gap:7px;justify-content:center;
  background:var(--raised);border:1px solid var(--line2);color:var(--fg);
  padding:9px 15px;border-radius:var(--r);cursor:pointer;font-size:14px;font-weight:550;
  transition:background .15s,border-color .15s,transform .06s;
}
.btn:hover{background:#212b39;border-color:#3b4a61}
.btn:active{transform:translateY(1px)}
.btn.primary{background:linear-gradient(180deg,#5b86ef,#4a6fd6);border-color:#6f97ff;color:#fff}
.btn.primary:hover{background:linear-gradient(180deg,#6a92f4,#5479e0)}
.btn.ghost{background:transparent;border-color:var(--line2)}
.btn.sm{padding:6px 10px;font-size:13px;border-radius:var(--r)}
.btn[disabled]{opacity:.45;cursor:not-allowed}
.btn svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* rail groups */
.group{border-bottom:1px solid var(--line)}
.group>summary{
  list-style:none;cursor:pointer;padding:12px 14px;display:flex;align-items:center;gap:9px;
  font-size:12px;letter-spacing:.08em;text-transform:uppercase;color:var(--mut);font-weight:650;user-select:none;
}
.group>summary::-webkit-details-marker{display:none}
.group>summary:hover{color:var(--fg);background:var(--surface)}
.group>summary .chev{width:12px;height:12px;stroke:currentColor;fill:none;stroke-width:2;transition:transform .18s}
.group[open]>summary .chev{transform:rotate(90deg)}
.group>summary .tag{margin-left:auto;font-size:10px;color:var(--dim);letter-spacing:.04em;text-transform:none}
.group-body{padding:4px 14px 16px;display:flex;flex-direction:column;gap:12px}

.ctl{display:flex;flex-direction:column;gap:6px}
.ctl-head{display:flex;align-items:baseline;gap:8px;font-size:13px;color:var(--mut)}
.ctl-head .val{margin-left:auto;font:12px/1 var(--mono);color:var(--fg);background:var(--surface);
  border:1px solid var(--line);border-radius:var(--r-sm);padding:3px 6px;min-width:46px;text-align:right}
input[type=range]{
  -webkit-appearance:none;appearance:none;width:100%;height:22px;background:transparent;cursor:pointer;margin:0
}
input[type=range]::-webkit-slider-runnable-track{height:4px;border-radius:99px;background:var(--line2)}
input[type=range]::-moz-range-track{height:4px;border-radius:99px;background:var(--line2)}
input[type=range]::-webkit-slider-thumb{
  -webkit-appearance:none;width:15px;height:15px;border-radius:99px;background:var(--fg);
  border:3px solid var(--bg2);box-shadow:0 0 0 1px var(--line2);margin-top:-6px;transition:background .15s}
input[type=range]::-moz-range-thumb{width:15px;height:15px;border-radius:99px;background:var(--fg);
  border:3px solid var(--bg2);box-shadow:0 0 0 1px var(--line2)}
input[type=range]:hover::-webkit-slider-thumb{background:var(--brand)}
input[type=range]:hover::-moz-range-thumb{background:var(--brand)}

.seg{display:flex;background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:3px;gap:3px;flex-wrap:wrap}
.seg button{
  flex:1 1 auto;min-width:0;background:transparent;border:0;color:var(--mut);padding:6px 8px;border-radius:var(--r-sm);
  cursor:pointer;font-size:12.5px;font-weight:550;white-space:nowrap;transition:background .14s,color .14s}
.seg button:hover{color:var(--fg)}
.seg button.on{background:var(--raised);color:var(--fg);box-shadow:0 1px 0 rgba(255,255,255,.05) inset}

.switch{display:flex;align-items:center;gap:10px;font-size:13.5px;color:var(--mut);cursor:pointer;user-select:none}
.switch input{position:absolute;opacity:0;pointer-events:none}
.switch .track{width:34px;height:19px;border-radius:99px;background:var(--line2);position:relative;transition:background .18s;flex:none}
.switch .track::after{content:"";position:absolute;top:2px;left:2px;width:15px;height:15px;border-radius:99px;background:var(--fg);transition:transform .18s}
.switch input:checked + .track{background:var(--brand)}
.switch input:checked + .track::after{transform:translateX(15px);background:#fff}
.switch:hover{color:var(--fg)}

.row{display:flex;gap:8px}
.row>*{flex:1}
.hint{font-size:12px;color:var(--dim);line-height:1.45}
input[type=text]{
  background:var(--surface);border:1px solid var(--line2);color:var(--fg);border-radius:var(--r);
  padding:9px 11px;font:inherit;font-size:14px;width:100%
}
input[type=color]{width:100%;height:32px;padding:2px;background:var(--surface);border:1px solid var(--line2);border-radius:var(--r);cursor:pointer}

/* ---------- HUD ---------- */
.hud{position:absolute;left:14px;top:14px;display:flex;flex-direction:column;gap:8px;z-index:14;pointer-events:none}
.chip{
  pointer-events:auto;display:inline-flex;align-items:center;gap:7px;background:rgba(15,18,24,.82);
  border:1px solid var(--line2);border-radius:99px;padding:6px 12px;font:12px/1 var(--mono);color:var(--mut);
  backdrop-filter:blur(8px)}
.chip b{color:var(--fg);font-weight:600}
.chip .led,.report .led{width:7px;height:7px;border-radius:99px;background:var(--good);box-shadow:0 0 8px var(--good)}
.chip .led.warn,.report .led.warn{background:var(--warm);box-shadow:0 0 8px var(--warm)}
.chip .led.bad,.report .led.bad{background:var(--bad);box-shadow:0 0 8px var(--bad)}
.chip-btn{cursor:pointer;font:inherit}
.report{display:flex;flex-direction:column;gap:10px;margin-top:14px}
.report .rrow{display:flex;align-items:baseline;gap:10px}
.report .rrow .led{flex:none;position:relative;top:-1px}
.report .rrow b{min-width:72px;text-transform:capitalize}
.report .rrow span{color:var(--dim)}

.stage-tools{position:absolute;right:14px;top:14px;display:flex;gap:6px;z-index:14}
.tool{
  width:34px;height:34px;display:grid;place-items:center;border-radius:var(--r);cursor:pointer;
  background:color-mix(in srgb,var(--bg2) 82%,transparent);border:1px solid var(--line2);color:var(--mut);backdrop-filter:blur(8px)}
.tool:hover{color:var(--fg);border-color:#41516b}
.tool.on{color:var(--brand);border-color:var(--brand)}
.tool svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

.viewcube{position:absolute;right:14px;bottom:14px;opacity:.85;z-index:14;display:grid;
  grid-template-columns:repeat(3,30px);gap:4px}
.viewcube button{
  height:26px;border-radius:var(--r);background:color-mix(in srgb,var(--bg2) 80%,transparent);border:1px solid var(--line2);
  color:var(--mut);font:11px/1 var(--mono);cursor:pointer;backdrop-filter:blur(8px)}
.viewcube button:hover{color:var(--fg);border-color:var(--brand)}
.viewcube .spacer{visibility:hidden}

/* ---------- progress / toast / overlay ---------- */
.solving{
  position:absolute;inset:0;display:grid;place-items:center;z-index:20;
  background:color-mix(in srgb,var(--bg) 72%,transparent);backdrop-filter:blur(6px)}
.solving.hidden{display:none}
.solving-inner{text-align:center;width:min(420px,88%)}
.solving h3{font-size:17px;margin-bottom:6px}
.solving p{color:var(--mut);font-size:13.5px;margin:6px 0 16px;min-height:1.4em}
.bar{height:6px;border-radius:99px;background:var(--line);overflow:hidden}
.bar i{display:block;height:100%;width:0%;border-radius:99px;
  background:linear-gradient(90deg,var(--brand),var(--brand2));transition:width .25s}
.spinner{width:34px;height:34px;margin:0 auto 14px;border-radius:99px;
  border:3px solid var(--line2);border-top-color:var(--brand);animation:spin .8s linear infinite}
@keyframes spin{to{transform:rotate(360deg)}}

.toasts{position:fixed;left:50%;bottom:26px;transform:translateX(-50%);z-index:80;
  display:flex;flex-direction:column;gap:8px;align-items:center;pointer-events:none}
.toast{
  background:var(--raised);border:1px solid var(--line2);border-radius:var(--r);padding:10px 16px;font-size:14px;
  box-shadow:0 12px 32px -12px #000;animation:rise .25s ease both}
.toast.bad{border-color:var(--bad);color:#ffd9de}
.toast.good{border-color:var(--good)}
@keyframes rise{from{opacity:0;transform:translateY(10px)}}

.sheet{position:fixed;inset:0;z-index:90;display:grid;place-items:center;padding:20px;
  background:color-mix(in srgb,var(--bg) 78%,transparent);backdrop-filter:blur(8px)}
.sheet[hidden]{display:none}
.sheet-card{background:var(--surface);border:1px solid var(--line2);border-radius:var(--r);
  padding:24px;width:min(620px,100%);max-height:86dvh;overflow:auto;box-shadow:0 30px 80px -20px var(--shadow)}
.sheet-card h2{font-size:19px;margin-bottom:4px}
.sheet-card .close{position:absolute;right:0;top:0}
.keys{display:grid;grid-template-columns:auto 1fr;gap:8px 16px;margin-top:14px;font-size:13.5px;align-items:center}
kbd{font:12px/1 var(--mono);background:var(--bg);border:1px solid var(--line2);border-bottom-width:2px;
  border-radius:var(--r-sm);padding:4px 7px;color:var(--fg);white-space:nowrap}
.keys span{color:var(--mut)}

/* ---------- gallery ---------- */
.grid{display:grid;gap:16px;grid-template-columns:repeat(auto-fill,minmax(210px,1fr));margin-top:26px}
.tile{
  display:block;border:1px solid var(--line);border-radius:var(--r);overflow:hidden;background:var(--surface);
  text-decoration:none;color:inherit;transition:transform .16s,border-color .16s,box-shadow .16s}
.tile:hover{transform:translateY(-3px);border-color:var(--brand);box-shadow:0 14px 30px -18px var(--brand)}
.tile .shot{aspect-ratio:4/3;background:#0b0d12 center/cover no-repeat;display:block}
.tile .meta{padding:10px 12px}
.tile .meta b{display:block;font-size:14px;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.tile .meta span{font-size:12px;color:var(--dim)}
.empty{margin-top:30px;padding:44px;text-align:center;border:1px dashed var(--line2);border-radius:var(--r);color:var(--mut)}
.pager{display:flex;gap:10px;justify-content:center;margin-top:30px}

.stat-row{display:flex;gap:10px;flex-wrap:wrap;margin:18px 0 0}
.stat{background:var(--surface);border:1px solid var(--line);border-radius:var(--r);padding:10px 14px}
.stat b{display:block;font:18px/1.2 var(--mono)}
.stat span{font-size:11.5px;color:var(--dim);letter-spacing:.06em;text-transform:uppercase}

.prose{max-width:70ch;color:var(--mut);font-size:15.5px}
.prose h2{color:var(--fg);font-size:19px;margin:30px 0 8px}
.prose p{margin:10px 0}
.prose li{margin:5px 0}
.prose strong{color:var(--fg)}

/* ---------- responsive ---------- */
@media (max-width: 900px){
  :root{--rail:300px}
}
@media (max-width: 760px){
  .topbar nav a{padding:6px 8px;font-size:13px}
  .viewcube{grid-template-columns:repeat(3,24px);right:10px;bottom:10px}
  .wrap{padding:28px 16px 70px}
  /* On a phone the sheet is the screen — a floating card wastes the space it needs. */
  .sheet{padding:0}
  .sheet-card{border-radius:0;width:100%;max-width:none;height:100dvh;max-height:100dvh}
  .settings-card{max-height:100dvh}
  .settings-head{border-radius:0;padding-top:max(18px,env(safe-area-inset-top))}
  .settings-body{padding-bottom:max(20px,env(safe-area-inset-bottom))}
  .share-grid{grid-template-columns:repeat(2,1fr)}
  .actionbar{gap:8px;padding-left:10px;padding-right:10px}
  .bar-actions .btn.sm{padding:8px 10px}
  .stage-tools{top:10px;right:10px}
  .hud{left:10px;top:10px}
}
@media (prefers-reduced-motion: reduce){
  *{animation-duration:.01ms !important;transition-duration:.01ms !important}
}


/* ---------- accessibility ---------- */
.skip{
  position:absolute;left:8px;top:-60px;z-index:100;background:var(--brand);color:#fff;
  padding:10px 16px;border-radius:var(--r);font-weight:600;transition:top .15s;text-decoration:none;
}
.skip:focus{top:8px}
.sr-only{
  position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;
  clip:rect(0 0 0 0);white-space:nowrap;border:0;
}
/* A control that is hard to hit is a control that does not work. 44px is the floor on touch. */
@media (pointer: coarse){
  .tool{width:44px;height:44px}
  .btn{min-height:44px}
  .seg button{min-height:38px;padding-inline:12px}
  .topbar nav a{min-height:40px;display:flex;align-items:center}
  input[type=range]{height:40px}
  input[type=range]::-webkit-slider-thumb{width:20px;height:20px;margin-top:-8px}
  input[type=range]::-moz-range-thumb{width:20px;height:20px}
}
.theme-toggle{
  display:grid;place-items:center;width:34px;height:34px;border-radius:var(--r);cursor:pointer;
  background:transparent;border:1px solid transparent;color:var(--mut);
}
.theme-toggle:hover{color:var(--fg);background:var(--surface);border-color:var(--line)}
.theme-toggle svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.7;
  stroke-linecap:round;stroke-linejoin:round}

/* ---------- state surfaces ---------- */
.state{
  display:flex;flex-direction:column;align-items:center;gap:10px;text-align:center;
  padding:26px 20px;border:1px dashed var(--line2);border-radius:var(--r);color:var(--mut);
}
.state .state-icon{width:28px;height:28px;fill:none;stroke:currentColor;stroke-width:1.6;
  stroke-linecap:round;stroke-linejoin:round}
.state b{color:var(--fg);font-size:15px}
.state p{margin:0;font-size:13.5px;max-width:44ch}
.state.warn{border-color:var(--orange);color:var(--orange)}
.state.bad{border-color:var(--red);color:var(--red)}
