:root {
  --accent: #ffb04d;
  --accent2: #45b4ff;
  --ink: #eef1f6;
  --dim: rgba(238, 241, 246, 0.56);
  --faint: rgba(238, 241, 246, 0.14);
  --glass: rgba(10, 12, 16, 0.62);
  --line: rgba(255, 255, 255, 0.09);
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: "Inter", "Helvetica Neue", system-ui, -apple-system, "Segoe UI", sans-serif;
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: #050608; color: var(--ink); font-family: var(--sans); overflow: hidden; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
#stage { position: fixed; inset: 0; }
#stage canvas { display: block; width: 100%; height: 100%; touch-action: none; outline: none; }

/* ------------------------------------------------------------------ intro */
#intro { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px;
  background: radial-gradient(ellipse at 50% 60%, rgba(5, 6, 8, 0.25), rgba(5, 6, 8, 0.86) 70%); transition: opacity 1.1s var(--ease), visibility 1.1s; }
#intro.gone { opacity: 0; visibility: hidden; pointer-events: none; }
.intro-inner { max-width: 620px; text-align: center; }
.eyebrow { font: 500 11px/1 var(--mono); letter-spacing: 0.28em; text-transform: uppercase; color: var(--accent); margin: 0 0 22px; }
#intro h1 { font-weight: 200; font-size: clamp(34px, 8.2vw, 96px); letter-spacing: 0.12em; margin: 0; padding-left: 0.12em; line-height: 1; white-space: nowrap; }
#intro h1 span { font-weight: 700; }
.lede { color: var(--dim); font-size: clamp(14px, 1.7vw, 16px); line-height: 1.65; margin: 26px auto 34px; max-width: 46ch; text-wrap: balance; }
.intro-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.btn { border: 1px solid var(--faint); background: transparent; padding: 13px 26px; border-radius: 999px; font: 600 12px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; transition: all 0.25s var(--ease); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #0a0a0a; }
.btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 8px 30px -8px var(--accent); }
.btn.ghost:hover:not(:disabled) { border-color: var(--ink); box-shadow: none; }
.btn:disabled { opacity: 0.35; cursor: default; }
.boot { font: 11px/1 var(--mono); letter-spacing: 0.14em; color: var(--dim); margin-top: 26px; min-height: 1em; text-transform: uppercase; }

/* ------------------------------------------------------------------ intro film */
#cine { position: fixed; inset: 0; z-index: 25; pointer-events: none; --bar: min(10.5vh, 12vw); }
#cine[hidden] { display: none; }
#cine .bar { position: absolute; left: 0; right: 0; height: 0; background: #000; transition: height 1.1s var(--ease); }
#cine .bar.top { top: 0; }
#cine .bar.bot { bottom: 0; }
#cine.on .bar { height: var(--bar); }
#cap { position: absolute; left: clamp(22px, 6vw, 96px); right: clamp(22px, 6vw, 96px); bottom: calc(var(--bar) + clamp(18px, 5vh, 54px)); opacity: 0; transform: translateY(10px); transition: opacity 0.26s ease, transform 0.26s ease; }
#cap.show { opacity: 1; transform: none; transition: opacity 0.7s var(--ease), transform 0.9s var(--ease); }
#cap-kicker { font: 500 11px/1.3 var(--mono); letter-spacing: 0.28em; text-transform: uppercase; color: var(--accent); margin: 0 0 14px; min-height: 14px; text-shadow: 0 1px 14px rgba(0, 0, 0, 0.6); }
#cap-line { font-weight: 200; font-size: clamp(24px, 3.7vw, 56px); line-height: 1.1; letter-spacing: 0.01em; margin: 0; max-width: 20ch; text-wrap: balance; text-shadow: 0 2px 30px rgba(0, 0, 0, 0.55); }
#cap.num #cap-line { font-family: var(--mono); font-weight: 300; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
#cap.ink #cap-line { color: #0c0d10; text-shadow: none; font-weight: 300; }
#cap.ink #cap-kicker { color: #5a4a22; text-shadow: none; }
#skip-intro { position: absolute; right: clamp(14px, 3vw, 40px); bottom: calc((var(--bar) - 32px) / 2); height: 32px; padding: 0 12px 0 14px; border-radius: 999px; border: 1px solid var(--faint); background: rgba(10, 12, 16, 0.6); font: 500 10.5px/1 var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: color-mix(in srgb, var(--ink) 78%, transparent); display: inline-flex; align-items: center; gap: 9px; pointer-events: auto; opacity: 0; transition: opacity 0.5s var(--ease), color 0.2s, border-color 0.2s; }
#cine.on #skip-intro { opacity: 1; transition-delay: 0.9s, 0s, 0s; }
#cine:not(.on) #skip-intro { pointer-events: none; }
#skip-intro:hover { color: var(--ink); border-color: var(--ink); }
#skip-intro kbd { margin: 0; }
body.cine #stage canvas { cursor: none; }
@media (pointer: coarse) { #skip-intro kbd { display: none; } #skip-intro { padding: 0 14px; } }

/* ------------------------------------------------------------------ HUD */
.ui { transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); }
body.pre .ui, body.hide-ui .ui { opacity: 0; pointer-events: none; }
body.idle #hud-top, body.idle #dock, body.idle #top-actions:not(.rec) { opacity: 0.0; }
body.idle #panel:not(:hover) { opacity: 0; pointer-events: none; }

#hud-top { position: fixed; left: 0; top: 0; z-index: 10; display: flex; gap: 26px; align-items: center; padding: max(18px, env(safe-area-inset-top)) 22px 18px; pointer-events: none; }
.brand { font-weight: 300; letter-spacing: 0.3em; font-size: 13px; }
.brand span { font-weight: 700; }
.status { font: 500 10px/1 var(--mono); letter-spacing: 0.22em; color: var(--accent); min-width: 190px; }
.status .bar { height: 1px; background: var(--faint); margin-top: 7px; overflow: hidden; }
.status .bar i { display: block; height: 100%; width: 0%; background: var(--accent); box-shadow: 0 0 8px var(--accent); transition: width 0.2s linear; }

#top-actions { position: fixed; z-index: 12; right: 18px; top: max(14px, env(safe-area-inset-top)); display: flex; gap: 8px; }
.icon-btn { min-width: 40px; height: 40px; padding: 0 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.icon-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; }
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
#fs .exit, body.fs #fs .enter { display: none; }
body.fs #fs .exit { display: inline; }
#rec .dot { fill: #ff3b4e; stroke: none; }
#rec .sq { fill: currentColor; stroke: none; display: none; }
#rec-time { font: 500 11px/1 var(--mono); letter-spacing: 0.06em; font-variant-numeric: tabular-nums; display: none; }
#rec.on { border-color: #ff3b4e; color: #fff; background: rgba(255, 59, 78, 0.22); }
#rec.on .dot { display: none; }
#rec.on .sq { display: inline; fill: #ff3b4e; animation: recpulse 1.2s ease-in-out infinite; }
#rec.on #rec-time { display: inline; }
#rec[hidden] { display: none; }
@keyframes recpulse { 50% { opacity: 0.35; } }

#panel { position: fixed; z-index: 11; right: 18px; --top: calc(max(14px, env(safe-area-inset-top)) + 50px); --room: calc(100vh - var(--top) - 126px); top: var(--top); max-height: var(--room); display: flex; flex-direction: column; width: 286px; border-radius: 18px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3); overflow: hidden; }
body.panel-closed #panel { opacity: 0; transform: translateX(16px); pointer-events: none; }
.panel-scroll { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: 0 16px 14px; scrollbar-width: thin; scrollbar-color: var(--faint) transparent; }
#panel.browsing { height: var(--room); }
/* panel tabs: one short page at a time instead of one long scroll */
.tabs { flex: none; display: flex; padding: 0 8px; border-bottom: 1px solid var(--line); }
.tabs button { flex: 1; border: 0; background: none; padding: 14px 2px 12px; font: 600 9.5px/1 var(--mono); letter-spacing: 0.22em; text-transform: uppercase; color: var(--dim); position: relative; transition: color 0.2s; }
.tabs button::after { content: ""; position: absolute; left: 22%; right: 22%; bottom: -1px; height: 1px; background: var(--accent); transform: scaleX(0); transition: transform 0.3s var(--ease); }
.tabs button:hover { color: var(--ink); }
.tabs button.on { color: var(--ink); }
.tabs button.on::after { transform: scaleX(1); }
.tab-page { display: none; }
.tab-page.on { display: block; animation: tabin 0.3s var(--ease); }
@keyframes tabin { from { opacity: 0; transform: translateY(4px); } }
#panel section { padding: 14px 0 15px; border-bottom: 1px solid var(--line); }
#panel section:last-child { border-bottom: 0; }
#panel h2 { font: 600 9.5px/1 var(--mono); letter-spacing: 0.26em; text-transform: uppercase; color: var(--dim); margin: 0 0 11px; }
.hint { font-size: 11.5px; line-height: 1.5; color: var(--dim); margin: 9px 0 0; }
#panel h2 { display: flex; align-items: center; justify-content: space-between; min-height: 10px; }
.h2-btn { border: 0; background: none; padding: 4px 0 4px 10px; margin: -4px 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: var(--accent); }
.h2-btn:hover { color: var(--ink); }

.h2-btn + .h2-btn { margin-left: 4px; }
/* the one filled button in the panel */
.cta { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 12px; padding: 10px 12px; border: 0; border-radius: 10px; background: var(--accent); color: #0b0c0f; font: 600 12px/1 var(--sans); letter-spacing: 0.02em; transition: filter 0.2s, transform 0.2s var(--ease); }
.cta svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.cta:hover { filter: brightness(1.12); }
.cta:active { transform: scale(0.985); }
.looks { display: flex; gap: 7px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: none; margin: 0 -16px; padding: 1px 16px; -webkit-mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); mask-image: linear-gradient(90deg, transparent, #000 16px, #000 calc(100% - 16px), transparent); }
.looks::-webkit-scrollbar { display: none; }
.looks .look { flex: none; width: 58px; scroll-snap-align: center; }
/* a look: a small tile in the world's colour, its light on the horizon, the form as a thin glyph in the palette's ink */
.look { position: relative; min-width: 0; text-align: center; }
.look-tile { display: grid; place-items: center; width: 100%; aspect-ratio: 5 / 4; padding: 0; border: 1px solid var(--line); border-radius: 10px; background: radial-gradient(125% 85% at 50% 122%, color-mix(in srgb, var(--glow) 46%, transparent), transparent 66%), var(--bg); transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s var(--ease); }
.look-tile svg { width: 40%; max-width: 28px; height: auto; fill: none; stroke: currentColor; stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.look:hover .look-tile { border-color: var(--dim); transform: translateY(-1px); }
.look.on .look-tile { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.look-name { display: block; width: 100%; border: 0; background: none; outline: 0; text-align: center; font-size: 10px; line-height: 1.2; padding: 6px 1px 0; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; transition: color 0.2s; }
.looks .look-name { font-size: 9px; padding-top: 5px; }
.look:hover .look-name, .look.on .look-name { color: var(--ink); }
input.look-name { cursor: text; border-radius: 5px; padding: 4px 2px 3px; margin-top: 2px; }
input.look-name:hover { background: rgba(255, 255, 255, 0.06); }
input.look-name:focus { color: var(--ink); background: rgba(255, 255, 255, 0.1); box-shadow: inset 0 0 0 1px var(--accent); }
.look-del { position: absolute; top: 4px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border: 0; border-radius: 9px; background: rgba(8, 9, 12, 0.78); color: var(--ink); font: 500 9.5px/18px var(--sans); opacity: 0; transition: opacity 0.2s, background 0.2s; }
.look:hover .look-del, .look-del:focus-visible, .look-del.sure { opacity: 1; }
.look-del.sure { background: #d83a4a; }
@media (hover: none) { .look-del { opacity: 1; } }

/* the looks browser: slides in over the controls and takes the whole panel */
.panel-scroll { transition: opacity 0.32s var(--ease), transform 0.32s var(--ease); }
#panel.browsing .panel-scroll { opacity: 0; transform: translateX(-18px); pointer-events: none; }
.looks-view { position: absolute; inset: 0; display: flex; flex-direction: column; opacity: 0; transform: translateX(18px); pointer-events: none; transition: opacity 0.32s var(--ease), transform 0.32s var(--ease); }
#panel.browsing .looks-view { opacity: 1; transform: none; pointer-events: auto; }
.looks-view header { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 16px 11px 10px; border-bottom: 1px solid var(--line); }
#panel .looks-view header h2 { flex: 1; margin: 0; }
.looks-view header .h2-btn { font: 600 9.5px/1 var(--mono); letter-spacing: 0.26em; text-transform: uppercase; }
.looks-view .back { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); display: grid; place-items: center; padding: 0; }
.looks-view .back svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.looks-view .back:hover { border-color: var(--accent); color: var(--accent); }
.looks-scroll { flex: 1; min-height: 0; overflow-y: auto; padding: 2px 16px 18px; scrollbar-width: thin; scrollbar-color: var(--faint) transparent; }
.looks-scroll h3 { display: flex; justify-content: space-between; font: 600 9.5px/1 var(--mono); letter-spacing: 0.26em; text-transform: uppercase; color: var(--dim); margin: 16px 0 10px; }
.looks-scroll h3 span { letter-spacing: 0.06em; }
.look-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 8px; }
.look-grid:empty { display: none; }
.look-save { display: flex; align-items: center; gap: 11px; width: 100%; margin-bottom: 12px; padding: 10px 12px; border: 1px dashed var(--faint); border-radius: 11px; background: rgba(255, 255, 255, 0.02); text-align: left; transition: all 0.2s; }
.look-save svg { flex: none; width: 18px; height: 18px; fill: none; stroke: var(--accent); stroke-width: 1.7; stroke-linecap: round; }
.look-save span { min-width: 0; }
.look-save b { display: block; font-size: 12px; font-weight: 500; }
.look-save small { display: block; margin-top: 4px; font-size: 10px; line-height: 1.35; color: var(--dim); }
.look-save:hover:not(:disabled) { border-color: var(--accent); border-style: solid; background: color-mix(in srgb, var(--accent) 10%, transparent); }
.look-save:disabled { cursor: default; opacity: 0.55; }
.look-save:disabled svg { stroke: var(--dim); }

.seg { display: flex; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 3px; background: rgba(255, 255, 255, 0.03); }
.seg button { flex: 1; border: 0; background: transparent; padding: 8px 4px; border-radius: 7px; font-size: 11.5px; font-weight: 500; color: var(--dim); transition: all 0.2s; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--ink); color: #0b0c0f; }

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.tiles button { display: block; border: 1px solid var(--line); border-radius: 10px; padding: 0; background: #0b0c10; overflow: hidden; transition: all 0.2s; text-align: center; }
.tiles button svg { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; }
.tiles button span { display: block; font-size: 9px; line-height: 1; padding: 6px 2px 7px; color: var(--dim); letter-spacing: 0.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tiles button:hover { border-color: var(--dim); }
.tiles button.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tiles button.on span { color: var(--ink); }

/* palettes: a tight grid of small two-tone dots; the name sits in the section header */
.swatches { display: grid; grid-template-columns: repeat(11, 1fr); gap: 9px 0; justify-items: center; margin: 0 -3px; }
.swatches button { width: 16px; height: 16px; border-radius: 50%; border: 0; padding: 0; position: relative; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.16); outline: 1px solid transparent; outline-offset: 2.5px; transition: outline-color 0.2s, transform 0.2s var(--ease); }
.swatches button::before { content: ""; position: absolute; inset: -4px; border-radius: 50%; }
.swatches button:hover { transform: scale(1.2); }
.swatches button.on { outline-color: var(--ink); }
.h2-val { font: 400 11px/1 var(--sans); letter-spacing: 0; text-transform: none; color: var(--ink); transition: color 0.2s; }
.h2-val.peek { color: var(--dim); }
@media (pointer: coarse) { .swatches { grid-template-columns: repeat(8, 1fr); gap: 12px 0; } .swatches button { width: 22px; height: 22px; } }

/* live numbers at the top of the System tab */
.stats { display: grid; grid-template-columns: 1.25fr 0.75fr 1fr; gap: 8px; margin-bottom: 15px; padding-bottom: 14px; border-bottom: 1px solid var(--line); font-family: var(--mono); }
.stats div { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.stats b { font-weight: 500; font-size: 12.5px; line-height: 1; letter-spacing: 0.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.stats i { font-style: normal; font-size: 9px; line-height: 1; letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); }

.chips2, .chips3 { display: grid; gap: 6px; }
.chips2 { grid-template-columns: repeat(2, 1fr); margin-top: 2px; }
.chips3 { grid-template-columns: repeat(3, 1fr); }
.chips2 button, .chips3 button { border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); border-radius: 9px; padding: 9px 4px; font-size: 11.5px; color: var(--dim); transition: all 0.2s; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips2 button:hover, .chips3 button:hover { color: var(--ink); border-color: var(--dim); }
.chips2 button.full { grid-column: 1 / -1; }
.chips2.gap, .row + .chips2 { margin-top: 12px; }
#panel .chips2 + .row { margin-top: 12px; }
.chips2 button.on, .chips3 button.on { color: var(--ink); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 14%, transparent); }
section > .chips2:not(:first-of-type) { margin-top: 10px; }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; color: var(--dim); margin-top: 11px; }
.row.check { justify-content: flex-start; cursor: pointer; }
.row[hidden] { display: none; }
.row.check:first-of-type { margin-top: 0; }
h2 + .row { margin-top: 0; }
.row.check input { appearance: none; width: 30px; height: 17px; border-radius: 99px; background: var(--faint); position: relative; margin: 0; transition: background 0.2s; flex: none; cursor: pointer; }
.row.check input::after { content: ""; position: absolute; left: 2px; top: 2px; width: 13px; height: 13px; border-radius: 50%; background: var(--ink); transition: transform 0.2s var(--ease); }
.row.check input:checked { background: var(--accent); }
.row.check input:checked::after { transform: translateX(13px); background: #0b0c0f; }
input[type=range] { appearance: none; -webkit-appearance: none; width: 150px; height: 2px; background: var(--faint); border-radius: 2px; outline: none; }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 13px; height: 13px; border-radius: 50%; background: var(--ink); border: 0; cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 13px; height: 13px; border-radius: 50%; background: var(--ink); border: 0; cursor: pointer; }
.pop-head { display: flex; justify-content: space-between; align-items: baseline; font-size: 12px; color: var(--dim); }
.pop-head b { font: 500 11px/1 var(--mono); color: var(--ink); letter-spacing: 0.04em; font-variant-numeric: tabular-nums; }
.pop { display: flex; margin: 9px 0 4px; border-top: 1px solid var(--line); }
.pop button { flex: 1; border: 0; background: none; padding: 9px 0 5px; margin-top: -1px; border-top: 1px solid transparent; font: 500 10.5px/1 var(--mono); letter-spacing: 0.06em; color: var(--dim); transition: color 0.2s, border-color 0.2s; }
.pop button:hover { color: var(--ink); }
.pop button.on { color: var(--accent); border-top-color: var(--accent); }
.pop + .row.check { margin-top: 12px; }
.keys p { font-size: 11px; line-height: 1.9; color: var(--dim); margin: 0 0 4px; }
kbd { font: 10px/1 var(--mono); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; color: var(--ink); margin: 0 1px; }

/* ------------------------------------------------------------------ dock */
#dock { position: fixed; z-index: 10; left: 14px; right: 14px; margin: 0 auto; max-width: 1320px; bottom: max(18px, env(safe-area-inset-bottom)); padding: 4px 7px 7px; border-radius: 18px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(22px) saturate(1.3); -webkit-backdrop-filter: blur(22px) saturate(1.3); }
.dock-main { display: flex; align-items: center; gap: 8px; }
/* form groups: a quiet row of labels above the forms */
.dock-tabs { display: flex; gap: 2px; padding: 0 4px 3px; overflow-x: auto; scrollbar-width: none; }
.dock-tabs::-webkit-scrollbar { display: none; }
.dock-tabs button { flex: none; display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 7px 9px 6px; border-radius: 8px; font: 600 9.5px/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--dim); white-space: nowrap; transition: color 0.2s, background 0.2s; }
.dock-tabs button:hover { color: var(--ink); }
.dock-tabs button.on { color: var(--accent); }
.dock-tabs button i { font-style: normal; letter-spacing: 0.04em; opacity: 0.55; }
.dock-tabs svg, .forms .fav svg { width: 10px; height: 10px; fill: currentColor; stroke: none; }
.forms { min-height: 59px; }
.dock-empty { flex: 1; align-self: center; padding: 0 10px; font-size: 12px; color: var(--dim); white-space: nowrap; }
.dock-empty[hidden] { display: none; }
.forms { display: flex; gap: 4px; min-width: 0; flex: 1 1 auto; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; padding: 0 6px; cursor: grab; -webkit-mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); mask-image: linear-gradient(90deg, transparent, #000 14px, #000 calc(100% - 14px), transparent); }
.forms .sep { flex: none; width: 1px; margin: 8px 6px; background: var(--line); }
.forms button.scene span { letter-spacing: 0; }
.forms button.scene { width: 76px; }
.dock-nav { flex: none; width: 26px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: rgba(255, 255, 255, 0.04); display: grid; place-items: center; color: var(--ink); padding: 0; transition: all 0.2s; }
.dock-nav svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dock-nav:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }
.dock-nav:disabled { opacity: 0.25; cursor: default; }
.dock-nav[hidden] { display: none; }
.forms::-webkit-scrollbar { display: none; }
.forms button { position: relative; flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px; width: 62px; padding: 8px 2px 7px; border: 0; background: transparent; border-radius: 12px; color: var(--dim); transition: all 0.2s; }
.forms button svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
.forms button span { font-size: 9.5px; letter-spacing: 0.04em; white-space: nowrap; }
.forms button[hidden], .forms .sep[hidden] { display: none; }
/* a filtered group has room to breathe: its forms share the row */
.forms.grouped button { flex: 1 0 62px; max-width: 104px; }
/* favourite star: appears on hover, stays once set */
.forms .fav { position: absolute; top: 0; left: calc(50% + 11px); width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: var(--dim); opacity: 0; transition: opacity 0.2s, color 0.2s, transform 0.2s var(--ease); }
.forms button .fav svg { width: 10px; height: 10px; fill: currentColor; stroke: none; }
.forms button:hover .fav { opacity: 0.55; }
.forms button .fav:hover { opacity: 1; color: var(--ink); transform: scale(1.2); }
.forms button.faved .fav { opacity: 1; color: var(--accent); }
.forms button.on .fav { color: rgba(11, 12, 15, 0.45); }
.forms button.on.faved .fav, .forms button.on .fav:hover { color: #0b0c0f; }
.forms button:hover { color: var(--ink); background: rgba(255, 255, 255, 0.05); }
.forms button.on { color: #0b0c0f; background: var(--accent); }
.custom { display: flex; gap: 6px; align-items: center; padding-left: 8px; border-left: 1px solid var(--line); flex: none; }
#text-form { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; background: rgba(255, 255, 255, 0.03); }
#text-form:focus-within { border-color: var(--accent); }
#text-input { width: 118px; border: 0; background: transparent; outline: 0; padding: 10px 4px 10px 12px; font-size: 12px; }
#text-input::placeholder { color: var(--dim); }
#text-form button { border: 0; background: transparent; padding: 8px 11px 8px 6px; color: var(--dim); }
#text-form button:hover { color: var(--accent); }
.dock-btn { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.03); border-radius: 11px; padding: 10px 13px; font-size: 12px; color: var(--dim); white-space: nowrap; }
.dock-btn svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.dock-btn:hover { color: var(--ink); border-color: var(--dim); }
.dock-btn.on { color: #0b0c0f; background: var(--accent); border-color: var(--accent); }
#mirror-bar { position: fixed; z-index: 10; left: 50%; bottom: calc(max(18px, env(safe-area-inset-bottom)) + 114px); transform: translateX(-50%); display: flex; align-items: center; gap: 8px; padding: 7px 8px 7px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--glass); backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px); font: 600 9.5px/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--accent); white-space: nowrap; }
#mirror-bar[hidden] { display: none; }
#mirror-bar button { font: 500 11.5px/1 var(--sans); letter-spacing: 0; text-transform: none; border: 1px solid var(--line); background: rgba(255, 255, 255, 0.04); border-radius: 9px; padding: 8px 11px; color: var(--ink); }
#mirror-bar button:hover { border-color: var(--dim); }
#mirror-bar button.on { border-color: var(--accent); color: var(--accent); }

/* design credit: sits in the margin under the dock, on the title screen too; steps aside for the film */
#credit { position: fixed; z-index: 31; right: max(16px, env(safe-area-inset-right)); bottom: max(1px, calc(env(safe-area-inset-bottom) - 17px)); padding: 4px 6px; font: 500 9px/1 var(--mono); letter-spacing: 0.22em; text-decoration: none; white-space: nowrap; color: rgba(238, 241, 246, 0.74); text-shadow: 0 0 2px rgba(0, 0, 0, 0.9), 0 0 5px rgba(0, 0, 0, 0.8), 0 0 10px rgba(0, 0, 0, 0.6); transition: opacity 0.6s var(--ease), color 0.2s; }
#credit b { font-weight: 600; color: var(--ink); transition: color 0.2s; }
#credit:hover, #credit:hover b, #credit:focus-visible, #credit:focus-visible b { color: var(--accent); }
body.idle #credit { opacity: 0.55; }
body.cine #credit, body.hide-ui #credit { opacity: 0; pointer-events: none; }
@media (min-width: 1680px) { #credit { right: 20px; bottom: 16px; } }
#drop { position: fixed; inset: 14px; z-index: 40; border: 1.5px dashed var(--accent); border-radius: 22px; background: rgba(5, 6, 8, 0.72); display: grid; place-items: center; text-align: center; font-size: 20px; font-weight: 300; letter-spacing: 0.04em; line-height: 1.7; pointer-events: none; }
#drop small { color: var(--dim); font-size: 13px; }
#drop[hidden], #toast[hidden], #fatal[hidden] { display: none; }
#toast { position: fixed; z-index: 50; left: 50%; bottom: 192px; transform: translateX(-50%); background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border-radius: 12px; padding: 10px 16px; font-size: 12.5px; max-width: min(520px, 90vw); text-align: center; }
#fatal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 30px; text-align: center; background: #050608; line-height: 1.7; color: var(--dim); }
#fatal b { color: var(--ink); font-weight: 600; display: block; font-size: 18px; margin-bottom: 8px; }

/* ------------------------------------------------------------------ small screens */
@media (max-width: 760px) {
  #hud-top { gap: 14px; padding-left: 14px; }
  .status { display: none; }
  #panel { left: 10px; right: 10px; width: auto; top: auto; bottom: 176px; max-height: 46vh; --room: 46vh; }
  /* phones: the forms get the full width; typing, mirror and import move to a row of their own */
  .dock-main { flex-wrap: wrap; row-gap: 7px; }
  .forms { flex-basis: 100%; }
  .custom { flex: 1; padding-left: 0; border-left: 0; }
  #text-form { flex: 1; }
  #text-input { flex: 1; min-width: 0; }
  #toast { bottom: 236px; }
  #mirror-bar { bottom: calc(max(18px, env(safe-area-inset-bottom)) + 164px); }
  .look-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  body.panel-closed #panel { transform: translateY(16px); }
  #top-actions { right: 12px; }
  #dock { left: 10px; right: 10px; max-width: none; }
  .dock-nav { display: none; }
  .forms button { width: 54px; }
  #text-input { width: 84px; }
  #import { display: none; }
  #mirror-bar span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .tab-page.on { animation: none; } }
@media (prefers-reduced-motion: reduce) { .ui, #intro, #cap, #cine .bar, .panel-scroll, .looks-view { transition-duration: 0.01s; } }
