/* Splat Studio: the site's quiet look (dark, Krona One titles, Geist Mono) over a full-screen 3D view.
   One rule keeps it readable: words to read are plain sentence case; anything you can press is a bounded
   control in small tracked capitals; and the site's pale blue warp glow marks what's chosen, or the way on. */

:root {
  --bg: #030306;
  --ink: rgb(238 236 230 / .95);
  --ink-2: rgb(238 236 230 / .76);
  --ink-3: rgb(238 236 230 / .56);
  --ink-4: rgb(238 236 230 / .34);
  --line: rgb(238 236 230 / .12);
  --line-2: rgb(238 236 230 / .24);
  --line-3: rgb(238 236 230 / .42);
  --fill: rgb(238 236 230 / .045);
  --fill-2: rgb(238 236 230 / .1);
  /* the warp glow (css/site.css .warp-go) */
  --act: rgb(205 222 255);
  --act-ink: rgb(222 233 255);
  --act-line: rgb(190 210 255 / .6);
  --act-fill: rgb(150 180 255 / .14);
  --act-glow: rgb(150 180 255 / .3);
  --hot: rgb(255 132 90);
  --hot-line: rgb(255 132 90 / .5);
  --hot-fill: rgb(255 132 90 / .12);
  --display: "Krona One", "Michroma", "Eurostile", "Arial Black", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(.22, .61, .36, 1);
  --m: clamp(20px, 4vw, 48px);
  --r: 4px;
  --glass: rgb(6 6 11 / .82);
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; overscroll-behavior: none; background: var(--bg); }
body { font: 400 13px/1.55 var(--mono); color: var(--ink); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; user-select: none; -webkit-user-select: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; letter-spacing: inherit; text-transform: inherit; }
button:disabled { cursor: default; }
a { color: var(--act-ink); text-decoration: underline; text-decoration-color: var(--act-line); text-underline-offset: 3px; transition: color .3s var(--ease); }
a:hover { color: #fff; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--act-line); outline-offset: 2px; }
input, textarea { user-select: text; -webkit-user-select: text; }

#gl, #ov { position: fixed; inset: 0; width: 100%; height: 100%; display: block; }
#gl { touch-action: none; background: radial-gradient(ellipse at 50% 40%, #0d0d14 0%, #030306 70%); }
#ov { pointer-events: none; }
body.lasso #gl { cursor: crosshair; }
body.grab #gl { cursor: grab; }
body.moving #gl { cursor: move; }

/* ---------------------------------------------------------------- controls */

/* the way on: Build it, New scan */
.ss-primary { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: 0 26px 0 calc(26px + .2em);
  border: 1px solid var(--act-line); border-radius: var(--r); background: var(--act-fill); color: #fff;
  font: 400 11.5px/1 var(--display); letter-spacing: .2em; text-transform: uppercase; white-space: nowrap;
  text-shadow: 0 0 10px rgb(190 210 255 / .55); box-shadow: 0 0 22px rgb(150 180 255 / .2), inset 0 0 16px rgb(150 180 255 / .1);
  transition: background .35s var(--ease), border-color .35s var(--ease), box-shadow .35s var(--ease), color .35s var(--ease); }
.ss-primary:hover:not(:disabled) { background: rgb(150 180 255 / .22); border-color: var(--act); box-shadow: 0 0 30px rgb(150 180 255 / .36), inset 0 0 18px rgb(150 180 255 / .16); }
.ss-primary:disabled { color: var(--ink-4); border-color: var(--line); background: transparent; box-shadow: none; text-shadow: none; }

/* everything else you can press */
.ss-btn, .ss-panel .btns button, .ss-entry .act button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 16px 0 calc(16px + .14em);
  border: 1px solid var(--line-2); border-radius: var(--r); background: var(--fill); color: var(--ink);
  font-size: 11px; line-height: 1; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap;
  transition: background .3s var(--ease), border-color .3s var(--ease), color .3s var(--ease); }
.ss-btn:hover:not(:disabled), .ss-panel .btns button:hover, .ss-entry .act button:hover { border-color: var(--line-3); background: var(--fill-2); }
.ss-btn:disabled { color: var(--ink-4); border-color: var(--line); background: none; }
.ss-btn.ss-sm, .ss-entry .act button { min-height: 28px; padding: 0 10px 0 calc(10px + .12em); font-size: 10px; letter-spacing: .12em; }
.ss-btn.hot, .ss-panel .btns button.hot, .ss-entry .act button.del { color: var(--hot); border-color: var(--hot-line); background: none; }
.ss-btn.hot:hover, .ss-panel .btns button.hot:hover, .ss-entry .act button.del:hover { background: var(--hot-fill); border-color: var(--hot); }

/* toggles: Quick/Standard/..., All/Places/Objects */
.ss-seg { display: inline-flex; flex-wrap: wrap; gap: 3px; padding: 3px; border: 1px solid var(--line-2); border-radius: calc(var(--r) + 3px); background: var(--fill); }
.ss-seg button { min-height: 32px; padding: 0 14px 0 calc(14px + .14em); border: 1px solid transparent; border-radius: var(--r); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2);
  transition: color .3s var(--ease), background .3s var(--ease), border-color .3s var(--ease); }
.ss-seg button:hover { color: var(--ink); background: var(--fill-2); }
.ss-seg button[aria-pressed="true"] { color: #fff; background: var(--act-fill); border-color: var(--act-line); box-shadow: 0 0 12px rgb(150 180 255 / .14); }

/* disclosure rows (sentence case, with a chevron) */
details > summary { display: inline-flex; align-items: center; gap: 10px; padding: 6px 0; list-style: none; cursor: pointer; font-size: 13px; color: var(--ink-2); transition: color .3s var(--ease); }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: 6px; height: 6px; margin: 0 2px 0 3px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); transition: transform .3s var(--ease); }
details[open] > summary::before { transform: rotate(45deg) translate(-2px, -1px); }
details > summary:hover { color: var(--ink); }

input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; cursor: pointer; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; border-radius: 1px; background: var(--line-2); }
input[type="range"]::-moz-range-track { height: 2px; border-radius: 1px; background: var(--line-2); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; margin-top: -6px; border-radius: 50%; background: var(--act); border: 0; box-shadow: 0 0 10px var(--act-glow); }
input[type="range"]::-moz-range-thumb { width: 14px; height: 14px; border-radius: 50%; background: var(--act); border: 0; box-shadow: 0 0 10px var(--act-glow); }
input[type="checkbox"] { accent-color: rgb(170 195 255); width: 15px; height: 15px; margin: 0; }
kbd { display: inline-block; min-width: 24px; margin: 0 4px 3px 0; padding: 2px 6px 1px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 4px; background: var(--fill);
  font: 500 11px/1.4 var(--mono); color: var(--ink); text-align: center; }

/* ---------------------------------------------------------------- corner title and nav, like the site's */

.ss-head { position: fixed; z-index: 8; left: calc(var(--m) + env(safe-area-inset-left)); top: calc(var(--m) * .8 + env(safe-area-inset-top)); pointer-events: none; text-shadow: 0 0 8px rgb(0 0 0 / .9); max-width: calc(100vw - var(--m) * 2 - 230px); }
.ss-title { margin: 0; font: 400 clamp(17px, 2.2vw, 26px)/1.1 var(--display); letter-spacing: .16em; text-transform: uppercase; }
.ss-sub { margin: 10px 0 0; font-size: 12px; line-height: 1.5; color: var(--ink-3); min-height: 1.5em; }
.ss-sub b { font-weight: 500; color: var(--ink); }
.ss-credit { color: var(--ink-3); }
.ss-corner { position: fixed; z-index: 8; right: calc(var(--m) + env(safe-area-inset-right)); top: calc(var(--m) * .8 + env(safe-area-inset-top) - 2px); display: flex; gap: 22px; text-shadow: 0 0 8px rgb(0 0 0 / .9); }
.ss-corner > * { font-size: 10.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--ink-2); text-decoration: none; padding: 8px 0; transition: color .3s var(--ease); }
.ss-corner > *:hover { color: var(--ink); }
.ss-corner > [aria-expanded="true"] { color: var(--act-ink); text-shadow: 0 0 10px rgb(190 210 255 / .5); }
#back::before { content: "← "; }

/* ---------------------------------------------------------------- home */

.ss-home { position: fixed; inset: 0; z-index: 5; overflow-y: auto; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  /* what scrolls up fades out before it reaches the title */
  -webkit-mask-image: linear-gradient(to bottom, transparent calc(var(--m) * .8 + 34px), #000 calc(var(--m) * .8 + 96px));
  mask-image: linear-gradient(to bottom, transparent calc(var(--m) * .8 + 34px), #000 calc(var(--m) * .8 + 96px)); }
.ss-homein { min-height: 100%; width: min(920px, calc(100% - var(--m) * 2)); margin: 0 auto; display: flex; flex-direction: column; justify-content: center; gap: 64px;
  padding: calc(var(--m) * .8 + 110px + env(safe-area-inset-top)) 0 calc(var(--m) + 8px + env(safe-area-inset-bottom)); }
.ss-hero { text-align: center; }
.ss-lead { margin: 0 auto 30px; max-width: 24em; font: 400 clamp(17px, 2.3vw, 24px)/1.5 var(--display); letter-spacing: .04em; color: var(--ink); text-wrap: balance; }
.ss-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; }
.ss-actions .ss-btn { min-height: 46px; padding: 0 22px 0 calc(22px + .14em); }
a.ss-btn { text-decoration: none; color: var(--ink); }
.ss-h { margin: 0 0 6px; font: 400 13px/1.3 var(--display); letter-spacing: .14em; text-transform: uppercase; color: var(--ink); }
.ss-meta { margin: 0; font-size: 12px; line-height: 1.6; color: var(--ink-3); max-width: 68ch; }
.ss-more { margin-top: 18px; }
.ss-fine { margin: 0; font-size: 11.5px; line-height: 1.6; color: var(--ink-3); text-align: center; }
.ss-recent { display: grid; grid-template-columns: 1fr 1fr; column-gap: 28px; }
.ss-recent:empty { display: none; }
.ss-recent .ss-h { grid-column: 1 / -1; margin-bottom: 12px; }

/* free videos: a picture, a name, what it is */
.ss-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 22px 16px; margin-top: 20px; }
.ss-tiles-s { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px 10px; margin-top: 0; }
.ss-tile { display: flex; flex-direction: column; align-items: stretch; text-align: left; border-radius: var(--r); }
.ss-thumb { position: relative; display: block; aspect-ratio: 4 / 3; margin-bottom: 10px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: #0b0b10;
  transition: border-color .35s var(--ease), box-shadow .35s var(--ease); }
.ss-thumb img { display: block; width: 100%; height: 100%; object-fit: cover; opacity: .84; transition: opacity .35s var(--ease), transform .8s var(--ease); }
.ss-tile b { font-weight: 500; font-size: 13px; line-height: 1.35; color: var(--ink); }
.ss-tile small { margin-top: 2px; font-size: 11.5px; color: var(--ink-3); }
.ss-tile:hover .ss-thumb, .ss-tile:focus-visible .ss-thumb { border-color: var(--act-line); box-shadow: 0 0 20px rgb(150 180 255 / .2); }
.ss-tile:hover img { opacity: 1; transform: scale(1.035); }
.ss-tile:focus-visible { outline: none; }
.ss-tile.added .ss-thumb { border-color: var(--act-line); }
.ss-tile.added .ss-thumb::after { content: "Added"; position: absolute; left: 8px; top: 8px; padding: 4px 8px 3px calc(8px + .12em); border: 1px solid var(--act-line); border-radius: 3px;
  background: rgb(6 8 16 / .82); color: var(--act-ink); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.ss-tiles-s .ss-thumb { margin-bottom: 7px; }
.ss-tiles-s .ss-tile b { font-size: 12.5px; }
.ss-tiles-s .ss-tile small { font-size: 11px; }

/* ---------------------------------------------------------------- cards (new scan, library, help) */

.ss-card { position: fixed; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(600px, calc(100vw - 24px)); max-height: calc(100svh - 40px); overflow: auto; padding: 24px 28px 28px;
  background: var(--glass); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid var(--line); border-radius: 8px; z-index: 20;
  box-shadow: 0 30px 80px rgb(0 0 0 / .5); }
.ss-card header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 24px; }
.ss-card h2 { margin: 0; font: 400 15px/1.2 var(--display); letter-spacing: .16em; text-transform: uppercase; }
.ss-x { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border: 1px solid var(--line-2); border-radius: var(--r); font-size: 19px; line-height: 1; color: var(--ink-2);
  transition: color .3s var(--ease), border-color .3s var(--ease), background .3s var(--ease); }
.ss-x:hover { color: var(--ink); border-color: var(--line-3); background: var(--fill-2); }
.ss-k { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font: 500 13px/1.3 var(--mono); color: var(--ink); }
.ss-n { flex: none; display: grid; place-items: center; width: 21px; height: 21px; border: 1px solid var(--line-3); border-radius: 50%; font-size: 11px; font-weight: 400; color: var(--ink-2); }
.ss-step { margin-bottom: 28px; }
.ss-note { margin: 10px 0 0; font-size: 12px; line-height: 1.6; color: var(--ink-3); }

.ss-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ss-choice button { position: relative; display: flex; flex-direction: column; justify-content: flex-start; text-align: left; padding: 14px 16px 15px 44px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--fill);
  transition: border-color .3s var(--ease), background .3s var(--ease); }
.ss-choice button::before { content: ""; position: absolute; left: 16px; top: 16px; width: 15px; height: 15px; border: 1px solid var(--line-3); border-radius: 50%; transition: border-color .3s var(--ease), box-shadow .3s var(--ease); }
.ss-choice button b { display: block; margin-bottom: 4px; font-weight: 500; font-size: 13px; color: var(--ink); }
.ss-choice button span { display: block; font-size: 12px; line-height: 1.5; color: var(--ink-2); }
.ss-choice button:hover { border-color: var(--line-3); background: var(--fill-2); }
.ss-choice button[aria-pressed="true"] { border-color: var(--act-line); background: var(--act-fill); }
.ss-choice button[aria-pressed="true"]::before { border-color: var(--act); background: radial-gradient(circle, var(--act) 0 3.5px, transparent 4.5px); box-shadow: 0 0 10px var(--act-glow); }

.ss-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 24px 16px 22px; border: 1px dashed var(--line-3); border-radius: var(--r); background: rgb(238 236 230 / .02); cursor: pointer; text-align: center;
  transition: border-color .3s var(--ease), background .3s var(--ease); }
.ss-drop:hover, .ss-drop.over { border-color: var(--act-line); background: rgb(150 180 255 / .05); }
.ss-drop span { font-size: 13px; color: var(--ink); word-break: break-word; }
.ss-drop u { color: var(--act-ink); text-decoration-color: var(--act-line); text-underline-offset: 3px; }
.ss-drop small { font-size: 11.5px; line-height: 1.5; color: var(--ink-3); }
.ss-drop.ok { border-style: solid; border-color: var(--line-2); }
.ss-url { display: flex; gap: 8px; margin-top: 10px; }
.ss-url input { flex: 1; min-width: 0; min-height: 38px; padding: 0 12px; font: 400 13px var(--mono); color: var(--ink); background: rgb(238 236 230 / .04); border: 1px solid var(--line-2); border-radius: var(--r); outline: none;
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease); }
.ss-url input::placeholder { color: var(--ink-3); }
.ss-url input:focus { border-color: var(--act-line); box-shadow: 0 0 0 3px rgb(150 180 255 / .12); }
.ss-linknote { margin-top: 10px; }
.ss-linknote.bad { color: rgb(255 180 150); }
.ss-queue { list-style: none; margin: 12px 0 0; padding: 0; max-height: 196px; overflow: auto; border-top: 1px solid var(--line); }
.ss-queue li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0 7px; border-bottom: 1px solid var(--line); }
.ss-queue li > span { min-width: 0; display: grid; gap: 1px; }
.ss-queue b { font-weight: 400; font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-queue small { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ss-queue button { flex: none; display: grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r); font-size: 17px; color: var(--ink-3); transition: color .3s var(--ease), background .3s var(--ease); }
.ss-queue button:hover { color: var(--ink); background: var(--fill-2); }
.ss-samples { margin-top: 14px; }
.ss-sgroup { margin-top: 16px; }
.ss-sghead { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 28px; margin-bottom: 10px; }
.ss-sghead b { font-weight: 500; font-size: 12.5px; color: var(--ink); }
.ss-sghead span { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; }
.ss-sghead small { font-size: 11.5px; color: var(--ink-3); }
.ss-range { display: grid; gap: 6px; margin-top: 14px; }
.ss-range label { display: grid; grid-template-columns: 44px 1fr 52px; align-items: center; gap: 12px; font-size: 12px; color: var(--ink-2); }
.ss-range output { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.ss-check { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-2); cursor: pointer; }
/* the Lab's upgrades: a labelled group of switches */
.ss-ups { margin: 16px 0 16px; padding: 12px 14px 12px; border: 1px solid var(--line); border-radius: 10px; }
.ss-ups .ss-upk { display: block; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.ss-ups .ss-check { align-items: flex-start; margin-top: 10px; }
.ss-ups .ss-check input { margin-top: 3px; flex: none; }
.ss-ups .ss-check b { color: var(--ink); font-weight: 500; }
.ss-ups .ss-meta { margin: 10px 0 0; }
.ss-tips { margin: 0 0 22px; }
.ss-tips ul { margin: 8px 0 0; padding-left: 18px; font-size: 12.5px; line-height: 1.65; color: var(--ink-2); }
.ss-tips li + li { margin-top: 6px; }
.ss-go { display: flex; justify-content: flex-end; padding-top: 18px; border-top: 1px solid var(--line); }

/* ---------------------------------------------------------------- processing */

.ss-proc { position: fixed; left: calc(var(--m) + env(safe-area-inset-left)); bottom: calc(var(--m) * .8 + env(safe-area-inset-bottom)); width: min(420px, calc(100vw - var(--m) * 2)); z-index: 10;
  padding: 8px 18px 16px; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 8px; }
.ss-rows > div { position: relative; display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 10px 0 9px; border-bottom: 1px solid var(--line); font-size: 12.5px; color: var(--ink-3); transition: color .5s var(--ease); }
.ss-rows dt { display: flex; align-items: center; gap: 10px; }
.ss-rows dt::before { content: ""; flex: none; width: 7px; height: 7px; border: 1px solid currentColor; border-radius: 50%; transition: background .5s var(--ease), box-shadow .5s var(--ease); }
.ss-rows dd { margin: 0; white-space: nowrap; text-align: right; font-size: 12px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.ss-rows > div.on { color: var(--ink); }
.ss-rows > div.on dt::before { border-color: var(--act); background: var(--act); box-shadow: 0 0 8px var(--act); animation: ss-pulse 1.6s ease-in-out infinite; }
.ss-rows > div.on dd { color: var(--ink-2); }
.ss-rows > div.done { color: var(--ink-2); }
.ss-rows > div.done dt::before { background: var(--ink-2); border-color: var(--ink-2); }
.ss-rows i { position: absolute; left: 0; bottom: -1px; height: 2px; width: calc(var(--p, 0) * 100%); background: var(--act); box-shadow: 0 0 8px var(--act-glow); transition: width .3s linear; }
.ss-rows > div.done i { opacity: 0; }
@keyframes ss-pulse { 50% { box-shadow: 0 0 2px var(--act); opacity: .6; } }
.ss-strip { display: flex; gap: 2px; margin: 12px 0 0; height: 30px; overflow: hidden; }
.ss-strip canvas { height: 30px; width: auto; opacity: .8; border-radius: 2px; }
.ss-procnote { margin: 12px 0 0; font-size: 12px; line-height: 1.6; color: var(--ink-3); }
.ss-procbtns { display: flex; gap: 8px; margin-top: 12px; }
.ss-procbtns .ss-btn { min-height: 32px; }

/* ---------------------------------------------------------------- viewer: the bottom bar, three docks */

.ss-bar { position: fixed; left: 0; right: 0; bottom: calc(18px + env(safe-area-inset-bottom)); z-index: 12; padding: 0 calc(var(--m) + env(safe-area-inset-right)) 0 calc(var(--m) + env(safe-area-inset-left));
  display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; pointer-events: none; }
.ss-bar > div { display: flex; gap: 2px; padding: 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); pointer-events: auto; }
.ss-bar button { min-height: 34px; padding: 0 13px 0 calc(13px + .14em); border-radius: 6px; font-size: 10.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-2); white-space: nowrap;
  transition: color .3s var(--ease), background .3s var(--ease), box-shadow .3s var(--ease); }
.ss-bar button:hover { color: var(--ink); background: var(--fill-2); }
.ss-bar button[aria-pressed="true"], .ss-bar button[aria-expanded="true"] { color: #fff; background: var(--act-fill); box-shadow: inset 0 0 0 1px var(--act-line), 0 0 12px rgb(150 180 255 / .14); }

/* tool panel: above the bar, on the right */
.ss-panel { position: fixed; right: calc(var(--m) + env(safe-area-inset-right)); bottom: calc(80px + env(safe-area-inset-bottom)); width: min(380px, calc(100vw - 24px)); max-height: calc(100svh - 200px); overflow: auto; padding: 18px 20px;
  background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 8px; z-index: 15; box-shadow: 0 20px 60px rgb(0 0 0 / .45); }
.ss-panel h3 { margin: 0 0 8px; font: 400 11.5px/1.35 var(--display); letter-spacing: .16em; text-transform: uppercase; color: var(--ink); }
.ss-panel p { margin: 0 0 12px; font-size: 12.5px; line-height: 1.55; color: var(--ink-2); }
.ss-panel .row { display: grid; grid-template-columns: 84px 1fr 52px; align-items: center; gap: 12px; padding: 3px 0; font-size: 12px; color: var(--ink-2); }
.ss-panel .row output { text-align: right; color: var(--ink); font-variant-numeric: tabular-nums; }
.ss-panel .btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.ss-panel .btns button { min-height: 32px; padding: 0 12px 0 calc(12px + .12em); font-size: 10.5px; letter-spacing: .12em; }
.ss-panel .btns button.go { color: #fff; border-color: var(--act-line); background: var(--act-fill); box-shadow: 0 0 14px rgb(150 180 255 / .18); }
.ss-panel .btns button.go:hover { border-color: var(--act); background: rgb(150 180 255 / .22); }
.ss-panel .check { display: flex; align-items: center; gap: 10px; padding: 4px 0; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.ss-panel details > summary { font-size: 12.5px; }
.ss-panel .ss-tips { margin: 8px 0 0; }
.ss-items { display: flex; flex-direction: column; margin: 6px 0 4px; max-height: 200px; overflow: auto; }
.ss-items button { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 9px 8px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink); text-align: left; border-radius: 3px; transition: background .25s var(--ease); }
.ss-items button:last-child { border-bottom: 1px solid var(--line); }
.ss-items button b { font-weight: 400; }
.ss-items button span { font-size: 11.5px; color: var(--ink-3); }
.ss-items button:hover, .ss-items button[aria-pressed="true"] { background: var(--fill-2); }

.ss-menu { position: fixed; right: calc(var(--m) + env(safe-area-inset-right)); bottom: calc(80px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 2px; padding: 6px; min-width: 320px;
  background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 9px; z-index: 16; box-shadow: 0 20px 60px rgb(0 0 0 / .45); }
.ss-menu button { display: flex; justify-content: space-between; align-items: baseline; gap: 22px; padding: 11px 12px 10px; border-radius: 6px; text-align: left; font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--ink);
  transition: background .25s var(--ease); }
.ss-menu button span { font-size: 12px; letter-spacing: 0; text-transform: none; color: var(--ink-3); }
.ss-menu button:hover { background: var(--fill-2); }

/* ---------------------------------------------------------------- library */

.ss-libtabs { margin-bottom: 16px; }
.ss-list { display: flex; flex-direction: column; }
.ss-entry { display: grid; grid-template-columns: 80px 1fr auto; align-items: center; gap: 14px; padding: 10px 0; border-top: 1px solid var(--line); }
.ss-entry:last-child { border-bottom: 1px solid var(--line); }
.ss-entry img, .ss-entry .ph { width: 80px; height: 52px; object-fit: cover; border-radius: 3px; border: 1px solid var(--line); background: #0b0b10; display: block; cursor: pointer; transition: border-color .3s var(--ease); }
.ss-entry .nm { min-width: 0; cursor: pointer; }
.ss-entry .nm b { display: block; font-weight: 500; font-size: 13px; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color .3s var(--ease); }
.ss-entry .nm small { font-size: 11.5px; color: var(--ink-3); }
.ss-entry:hover img, .ss-entry:hover .ph { border-color: var(--act-line); }
.ss-entry:hover .nm b { color: #fff; }
.ss-entry .act { display: flex; gap: 6px; }
.ss-entry .act:empty { display: none; }
.ss-empty { padding: 22px 0; font-size: 12.5px; color: var(--ink-3); text-align: center; }
.ss-recent .ss-entry { grid-template-columns: 72px 1fr; }
.ss-recent .ss-entry img, .ss-recent .ss-entry .ph { width: 72px; height: 46px; }
.ss-recent .ss-entry:nth-last-child(2):nth-child(even) { border-bottom: 1px solid var(--line); }

/* ---------------------------------------------------------------- lab */

.ss-lab { width: min(880px, calc(100vw - 24px)); }
.ss-labintro { margin: -8px 0 24px; }
.ss-labboard:not(:empty) { margin-bottom: 30px; }
.ss-tablewrap { max-height: 46svh; overflow: auto; border-top: 1px solid var(--line); }
.ss-table { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.ss-table th, .ss-table td { padding: 7px 10px 6px; text-align: left; white-space: nowrap; }
.ss-table thead th { position: sticky; top: 0; z-index: 1; background: rgb(10 10 16); font-weight: 400; font-size: 11.5px; color: var(--ink-3); border-bottom: 1px solid var(--line); }
.ss-table td { border-top: 1px solid var(--line); color: var(--ink); }
.ss-table tr.grp th { padding-top: 16px; font-weight: 500; font-size: 13px; color: var(--ink); }
.ss-table tr.grp th small { margin-left: 8px; font-weight: 400; font-size: 11.5px; color: var(--ink-3); }
.ss-table tr.ref td { color: var(--ink-3); }
.ss-table .n { text-align: right; }
.ss-table .dim { color: var(--ink-4); }
.ss-table .up { color: var(--act-ink); }
.ss-table .down { color: var(--ink-3); }
.ss-table td.x { width: 1px; padding: 2px 4px; }
.ss-table td.x button { display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r); font-size: 15px; color: var(--ink-4); transition: color .3s var(--ease), background .3s var(--ease); }
.ss-table td.x button:hover { color: var(--ink); background: var(--fill-2); }
.ss-table td small { margin-left: 6px; font-size: 11px; color: var(--ink-3); }
.ss-table i.warn { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 6px; border: 1px solid var(--line-3); border-radius: 50%; font-style: normal; font-size: 10px; color: var(--ink-2); vertical-align: 1px; cursor: help; }
.ss-labbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.ss-labscenes { display: grid; gap: 6px; }
.ss-labscenes:not(:empty) { margin-bottom: 12px; }
.ss-labscene { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 12px; padding: 9px 12px; border: 1px solid var(--line-2); border-radius: var(--r); background: var(--fill); cursor: pointer; transition: border-color .3s var(--ease); }
.ss-labscene:hover { border-color: var(--line-3); }
.ss-labscene:has(input:checked) { border-color: var(--act-line); background: var(--act-fill); }
.ss-labscene span { min-width: 0; display: grid; gap: 1px; }
.ss-labscene b { font-weight: 500; font-size: 13px; color: var(--ink); }
.ss-labscene small { font-size: 11.5px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; }
.ss-labscene em { font-style: normal; font-size: 11.5px; color: var(--ink-3); white-space: nowrap; }
.ss-labscene.bad small { color: rgb(255 180 150); }
.ss-labpick { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.ss-field { display: grid; grid-template-columns: 128px 1fr; align-items: center; gap: 12px; margin: 0 0 10px; font-size: 12.5px; color: var(--ink-2); }
.ss-field .ss-seg { justify-self: start; }
.ss-field .ss-seg button { white-space: nowrap; }
.ss-input { width: min(320px, 100%); min-height: 36px; padding: 0 12px; font: 400 13px var(--mono); color: var(--ink); background: rgb(238 236 230 / .04); border: 1px solid var(--line-2); border-radius: var(--r); outline: none; transition: border-color .3s var(--ease), box-shadow .3s var(--ease); }
.ss-input::placeholder { color: var(--ink-3); }
.ss-input:focus { border-color: var(--act-line); box-shadow: 0 0 0 3px rgb(150 180 255 / .12); }

/* ---------------------------------------------------------------- help */

.ss-help { width: min(760px, calc(100vw - 24px)); }
.ss-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.ss-keys { margin: 0; }
.ss-keys > div { display: grid; grid-template-columns: 136px 1fr; gap: 14px; align-items: baseline; padding: 8px 0 7px; border-top: 1px solid var(--line); font-size: 12.5px; }
.ss-keys dt { color: var(--ink); }
.ss-keys dd { margin: 0; color: var(--ink-2); }
.ss-help > .ss-note { margin-top: 22px; }

/* ---------------------------------------------------------------- bits */

.ss-toast { position: fixed; left: 50%; top: calc(var(--m) * .8 + env(safe-area-inset-top) + 44px); transform: translate(-50%, -6px); padding: 10px 16px; font-size: 12.5px; line-height: 1.5; color: var(--ink);
  background: var(--glass); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: 0 14px 40px rgb(0 0 0 / .45);
  opacity: 0; pointer-events: none; transition: opacity .4s var(--ease), transform .4s var(--ease); z-index: 40; max-width: min(560px, calc(100vw - 30px)); text-align: center; }
.ss-toast.on { opacity: 1; transform: translate(-50%, 0); }
.ss-toast.bad { color: rgb(255 190 165); border-color: var(--hot-line); }
.ss-dropzone { position: fixed; inset: 0; display: grid; place-items: center; background: rgb(3 3 6 / .72); z-index: 50; border: 1px dashed var(--act-line); }
.ss-dropzone p { font: 400 14px var(--display); letter-spacing: .2em; text-transform: uppercase; color: var(--act-ink); text-shadow: 0 0 14px rgb(190 210 255 / .5); }
.ss-nogpu { max-width: 480px; margin: 0 auto; font-size: 13px; line-height: 1.7; color: var(--ink-2); }
#home > .ss-lead { margin-top: 30vh; text-align: center; }

@media (max-width: 760px) {
  .ss-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 12px; }
  .ss-recent { grid-template-columns: 1fr; }
  .ss-recent .ss-entry:nth-last-child(2):nth-child(even) { border-bottom: 0; }
}
@media (max-width: 700px) {
  .ss-homein { gap: 48px; padding-top: calc(110px + env(safe-area-inset-top)); }
  .ss-actions { flex-direction: column; align-items: stretch; width: min(320px, 100%); margin: 0 auto; }
  .ss-card { padding: 20px 18px 22px; }
  .ss-choice { grid-template-columns: 1fr; }
  .ss-cols { grid-template-columns: 1fr; gap: 14px; }
  .ss-keys > div { grid-template-columns: 112px 1fr; }
  .ss-go .ss-primary { flex: 1; }
  .ss-bar { flex-wrap: wrap; justify-content: center; bottom: calc(12px + env(safe-area-inset-bottom)); gap: 6px 6px; padding: 0 8px; }
  /* the tools on a line of their own above the others */
  .ss-bar .ss-tools { order: -2; }
  .ss-bar::after { content: ""; order: -1; flex-basis: 100%; height: 0; }
  .ss-bar button { min-height: 34px; padding: 0 9px 0 calc(9px + .12em); font-size: 10px; letter-spacing: .12em; }
  .ss-panel { right: 10px; left: 10px; width: auto; bottom: calc(118px + env(safe-area-inset-bottom)); max-height: 44svh; padding: 14px 16px; }
  .ss-panel p { margin-bottom: 8px; }
  .ss-menu { right: 10px; left: 10px; min-width: 0; bottom: calc(118px + env(safe-area-inset-bottom)); }
  .ss-proc { bottom: calc(14px + env(safe-area-inset-bottom)); left: 10px; width: calc(100vw - 20px); }
  .ss-corner { gap: 16px; }
  .ss-corner > * { font-size: 10px; letter-spacing: .16em; }
  .ss-head { top: calc(18px + env(safe-area-inset-top)); max-width: calc(100vw - 40px); }
  .ss-title { max-width: 50vw; }
  .ss-home { -webkit-mask-image: linear-gradient(to bottom, transparent calc(64px + env(safe-area-inset-top)), #000 calc(124px + env(safe-area-inset-top)));
    mask-image: linear-gradient(to bottom, transparent calc(64px + env(safe-area-inset-top)), #000 calc(124px + env(safe-area-inset-top))); }
  #quality.ss-seg { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  #quality.ss-seg button { padding: 0 4px 0 calc(4px + .1em); letter-spacing: .1em; }
  .ss-field .ss-seg button { padding: 0 10px 0 calc(10px + .12em); letter-spacing: .12em; }
  .ss-entry { grid-template-columns: 64px 1fr; row-gap: 8px; }
  .ss-entry img, .ss-entry .ph { width: 64px; height: 42px; }
  .ss-entry .act { grid-column: 2; }
  .ss-corner { top: calc(14px + env(safe-area-inset-top)); }
  .ss-panel .row { grid-template-columns: 76px 1fr 48px; }
  .ss-field { grid-template-columns: 1fr; gap: 6px; }
  .ss-labscene { grid-template-columns: auto 1fr; }
  .ss-labscene em { grid-column: 2; }
}
@media (max-width: 380px) {
  #quality.ss-seg button { font-size: 10px; letter-spacing: .06em; padding: 0 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .ss-rows > div.on dt::before { animation: none; }
  .ss-tile:hover img { transform: none; }
}
body.gl-only [data-x="video"] { display: none; }
