/* City Kit — a modular city builder. Colour only through tokens; the accent is set from JS. */
:root {
  color-scheme: dark;
  --bg: #121314; --panel: rgba(22, 23, 24, .88); --panel-solid: #161718; --line: #26292b; --line-hi: #34383b;
  --ink: #c9d0db; --ink-hi: #eef1f4; --dim: #7d8796; --faint: #4a5059;
  --accent: #ff9d3c;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --gut: 16px; --lib-w: 264px; --insp-w: 248px;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #e9eaea; --panel: rgba(246, 246, 245, .92); --panel-solid: #f4f4f3; --line: #d6d8d8; --line-hi: #c3c6c8;
  --ink: #2b2e30; --ink-hi: #101213; --dim: #6b7075; --faint: #a3a8ac;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 12px/1.5 var(--mono); overflow: hidden; -webkit-font-smoothing: antialiased; }
#stage, #stage canvas { position: fixed; inset: 0; display: block; touch-action: none; outline: none; }
button { font: inherit; color: inherit; }
kbd { font: inherit; }
.ui { position: fixed; z-index: 2; }
.noscript { position: fixed; inset: 0; display: grid; place-items: center; margin: 0; }
body.photo .ui:not(#top), body.photo .frame { opacity: 0; pointer-events: none; }
body.photo #top > *:not(.tools) { opacity: 0; pointer-events: none; }
body.photo #top .tools > *:not(#photo) { opacity: 0; pointer-events: none; }
.ui, .frame, #top > *, #top .tools > * { transition: opacity .35s; }

/* plate frame: crop marks */
.frame { position: fixed; inset: 58px calc(var(--gut) + 6px) 58px calc(var(--lib-w) + var(--gut) + 14px); pointer-events: none; z-index: 1; }
.frame .c { position: absolute; width: 14px; height: 14px; border-color: var(--line-hi); border-style: solid; border-width: 0; }
.frame .tl { left: 0; top: 0; border-left-width: 1px; border-top-width: 1px; }
.frame .tr { right: 0; top: 0; border-right-width: 1px; border-top-width: 1px; }
.frame .bl { left: 0; bottom: 0; border-left-width: 1px; border-bottom-width: 1px; }
.frame .br { right: 0; bottom: 0; border-right-width: 1px; border-bottom-width: 1px; }

/* top bar */
#top { z-index: 8; top: var(--gut); left: var(--gut); right: var(--gut); display: flex; justify-content: space-between; align-items: center; gap: 12px; pointer-events: none; }
#top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 9px; color: var(--ink-hi); text-decoration: none; letter-spacing: .16em; text-transform: uppercase; font-size: 12px; font-weight: 600; white-space: nowrap; }
.brand svg { width: 22px; height: 22px; }
.brand .acc { stroke: var(--accent); fill: none; }
.tools { display: flex; gap: 8px; align-items: center; }
.pill, .round { all: unset; cursor: pointer; height: 28px; display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--dim); }
.pill { padding: 0 11px 0 9px; }
.pill span { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.round { width: 28px; justify-content: center; }
.pill svg, .round svg { width: 14px; height: 14px; }
.pill:hover, .round:hover { color: var(--ink); border-color: var(--line-hi); }
.pill:focus-visible, .round:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; }
.pill[aria-pressed="true"], .round[aria-pressed="true"]:not(#sound) { color: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
#sound .mute { display: none; }
#sound[aria-pressed="false"] .wave { display: none; }
#sound[aria-pressed="false"] .mute { display: inline; }
body.photo #photo { color: var(--accent); border-color: var(--accent); }
body.photo #top .tools > #snap { opacity: 1; pointer-events: auto; }
body.photo #snap[hidden] { display: flex !important; }
body.photo #snap span { display: inline !important; }

/* clock */
.clock { display: flex; align-items: center; gap: 6px; padding: 2px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); position: absolute; left: 50%; transform: translateX(-50%); }
#clk-time { all: unset; cursor: pointer; display: flex; align-items: center; gap: 7px; padding: 0 10px 0 9px; height: 24px; border-radius: 999px; color: var(--ink-hi); }
#clk-time:hover { background: var(--bg); }
#clk-time svg { width: 14px; height: 14px; color: var(--accent); }
#clk-time b { font-weight: 500; font-size: 13px; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
#clk-time span { color: var(--dim); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.clock .moon { display: none; }
.clock.night .moon { display: block; } .clock.night .sun { display: none; }
.speeds { display: flex; gap: 1px; }
#wx { all: unset; cursor: pointer; display: flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px 0 7px; border-radius: 999px; color: var(--dim); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; border-left: 1px solid var(--line); }
#wx svg { width: 14px; height: 14px; }
#wx:hover { color: var(--ink); }
#wx.on { color: var(--accent); }
#clk-time[aria-expanded="true"], #wx[aria-expanded="true"] { color: var(--ink-hi); }

/* environment panel: time, season and place, weather */
body.env-open #toast, body.recp-open #toast { top: auto; bottom: 132px; }
#env { top: 52px; left: 50%; transform: translateX(-50%); width: 372px; max-width: calc(100vw - 2 * var(--gut)); max-height: calc(100vh - 70px); overflow: auto; padding: 4px 14px 12px; border: 1px solid var(--line-hi); border-radius: 12px; background: var(--panel-solid); z-index: 7; display: flex; flex-direction: column; animation: envin .18s ease both; }
@keyframes envin { from { opacity: 0; transform: translate(-50%, -4px); } }
#env section { padding: 10px 0 8px; display: flex; flex-direction: column; gap: 7px; }
#env section + section { border-top: 1px solid var(--line); }
#env header { display: flex; align-items: baseline; gap: 8px; }
#env header span { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); margin-right: auto; }
#env header b { font-size: 15px; font-weight: 500; color: var(--ink-hi); font-variant-numeric: tabular-nums; letter-spacing: .04em; }
#env header small { font-size: 10px; color: var(--dim); letter-spacing: .06em; }
.env-sky { position: relative; height: 26px; border-radius: 7px; background: var(--sky, #333); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--line-hi) 70%, transparent); }
.env-sky input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: none; -webkit-appearance: none; appearance: none; cursor: ew-resize; z-index: 1; }
.env-sky input::-webkit-slider-runnable-track { height: 100%; background: none; }
.env-sky input::-moz-range-track { height: 100%; background: none; }
.env-sky input::-webkit-slider-thumb { -webkit-appearance: none; width: 4px; height: 34px; margin-top: -4px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 0 2px var(--panel-solid), 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent); }
.env-sky input::-moz-range-thumb { width: 4px; height: 34px; border: 0; border-radius: 2px; background: var(--accent); box-shadow: 0 0 0 2px var(--panel-solid); }
.env-sky input:focus-visible { outline: 1px solid var(--accent); outline-offset: 3px; border-radius: 7px; }
.sunmark { position: absolute; top: -5px; width: 1px; height: 36px; background: color-mix(in srgb, var(--ink) 55%, transparent); pointer-events: none; }
.sunmark::after { content: ''; position: absolute; top: -3px; left: -2px; width: 5px; height: 5px; border-radius: 50%; background: var(--ink); }
.env-ticks { display: flex; justify-content: space-between; font-size: 9px; color: var(--faint); letter-spacing: .08em; margin-top: -2px; font-variant-numeric: tabular-nums; }
#env .chips { display: flex; flex-wrap: wrap; gap: 4px; }
#env .chips button, #env-wind-auto, #env-bolt { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
#env .chips button svg { width: 12px; height: 12px; }
#env .chips button:hover, #env-wind-auto:hover, #env-bolt:hover { color: var(--ink-hi); border-color: var(--line-hi); }
#env .chips button[aria-checked="true"], #env .chips button[aria-pressed="true"], #env-wind-auto[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
#env .chips button:focus-visible, #env-wind-auto:focus-visible, #env-bolt:focus-visible, .env-wx button:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
#env-parts #env-hold { margin-left: auto; }
.env-wx { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.env-wx button { all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 7px 0 6px; border: 1px solid var(--line); border-radius: 8px; color: var(--dim); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.env-wx button svg { width: 17px; height: 17px; }
.env-wx button:hover { color: var(--ink-hi); border-color: var(--line-hi); }
.env-wx button[aria-checked="true"] { color: var(--accent); border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, transparent); }
.env-wx button.now:not([aria-checked="true"]) { color: var(--ink-hi); border-style: dashed; border-color: var(--ink); }
.env-row { display: grid; grid-template-columns: 62px 1fr 44px auto; align-items: center; gap: 8px; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.env-row b { font-weight: 400; color: var(--ink); text-align: right; letter-spacing: .02em; font-variant-numeric: tabular-nums; text-transform: none; }
.env-row input { width: 100%; accent-color: var(--accent); }
.env-row input:disabled { opacity: .35; }
.env-row:not(:has(button)) { grid-template-columns: 62px 1fr 44px; }
.env-note { margin: 0; font-size: 10.5px; color: var(--dim); line-height: 1.45; }
#env-bolt { align-self: flex-start; color: var(--ink); }
#env-bolt[hidden] { display: none; }

/* city dashboard */
#stats { cursor: pointer; border-radius: 6px; padding: 2px 4px; margin: -2px -4px; }
#stats:hover, #stats:focus-visible { color: var(--ink-hi); background: color-mix(in srgb, var(--panel) 80%, transparent); outline: none; }
#cityp { right: var(--gut); bottom: 44px; width: 360px; max-width: calc(100vw - 2 * var(--gut)); max-height: calc(100vh - 120px); overflow: auto; z-index: 7; padding: 10px 14px 12px; border: 1px solid var(--line-hi); border-radius: 12px; background: var(--panel-solid); font-size: 11px; color: var(--ink); animation: envin2 .18s ease both; }
#cityp header { display: flex; align-items: baseline; gap: 8px; }
#cityp header span { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
#cityp header b { font-weight: 500; color: var(--ink-hi); margin-right: auto; letter-spacing: .04em; }
.cp-x { all: unset; cursor: pointer; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--dim); }
.cp-x:hover { color: var(--ink-hi); background: var(--bg); }
.cp-nums { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin: 10px 0 4px; }
.cp-nums div { display: flex; flex-direction: column; gap: 1px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; }
.cp-nums b { font-size: 15px; font-weight: 500; color: var(--ink-hi); font-variant-numeric: tabular-nums; }
.cp-nums span { font-size: 9.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); }
#cityp b.warn { color: var(--accent); }
#cityp section { padding: 9px 0 2px; border-top: 1px solid var(--line); margin-top: 8px; }
#cityp h4 { margin: 0 0 6px; display: flex; align-items: center; gap: 8px; font-size: 10px; font-weight: 400; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); }
#cityp h4 small { margin-left: auto; letter-spacing: .04em; text-transform: none; color: var(--faint); font-size: 10px; }
#cityp p { margin: 3px 0; line-height: 1.5; }
#cityp p b { font-weight: 500; color: var(--ink-hi); }
.cp-dim { color: var(--dim); }
.cp-bar { display: flex; height: 10px; border-radius: 3px; overflow: hidden; gap: 2px; }
.cp-bar i, .cp-legend i { display: block; }
.cp-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 6px 0 4px; color: var(--dim); }
.cp-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cp-legend i { width: 8px; height: 8px; border-radius: 2px; }
.cp-legend b { color: var(--ink); font-weight: 500; }
.m-car { background: color-mix(in srgb, var(--ink) 55%, transparent); }
.m-bus { background: var(--accent); }
.m-metro { background: color-mix(in srgb, var(--accent) 70%, var(--ink-hi)); }
.m-rail { background: color-mix(in srgb, var(--accent) 45%, var(--ink)); }
.m-walk { background: color-mix(in srgb, var(--ink) 25%, transparent); }
.m-tram { background: color-mix(in srgb, var(--accent) 55%, #ffd166); }
.m-ferry { background: color-mix(in srgb, var(--accent) 40%, #4cc9f0); }
.cp-k { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 6px; vertical-align: 1px; }
#cityp svg { display: block; width: 100%; height: 46px; margin-top: 6px; }
.cp-line { fill: none; stroke: var(--accent); stroke-width: 1.3; vector-effect: non-scaling-stroke; }
.cp-jam { fill: none; stroke: #ff4d4d; stroke-width: 1; stroke-dasharray: 3 2; vector-effect: non-scaling-stroke; opacity: .8; }
.cp-axis { display: flex; justify-content: space-between; color: var(--faint); font-size: 9.5px; margin-top: 2px; }
.cp-axis i.j { display: inline-block; width: 10px; border-top: 1px dashed #ff4d4d; vertical-align: middle; }
.cp-tog, .cp-go { all: unset; cursor: pointer; color: var(--ink); border-bottom: 1px dotted var(--dim); }
.cp-tog { margin-left: auto; letter-spacing: .04em; text-transform: none; font-size: 10px; border: 1px solid var(--line); border-radius: 999px; padding: 2px 8px; }
.cp-tog[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.cp-tog kbd { font: inherit; color: var(--faint); }
.cp-go:hover, .cp-tog:hover { color: var(--ink-hi); }
.cp-go:focus-visible, .cp-tog:focus-visible, .cp-x:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.cp-adv ul { margin: 0; padding-left: 14px; display: flex; flex-direction: column; gap: 4px; }
.cp-adv li { line-height: 1.45; }
.cp-adv li::marker { color: var(--accent); }
body.rec #cityp, body.cine #cityp, body.photo #cityp { display: none; }
@media (max-width: 900px) { #cityp { bottom: 150px; } }

/* new city: the blank canvas */
#newcity { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(6px); }
.nc-card { width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 14px 16px 16px; border: 1px solid var(--line-hi); border-radius: 14px; background: var(--panel-solid); }
.nc-card header { display: flex; align-items: center; }
.nc-card h2 { margin: 0 auto 0 0; font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.nc-body { display: grid; grid-template-columns: auto 1fr; gap: 18px; margin-top: 12px; align-items: start; }
.nc-map { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.nc-map canvas { display: block; border-radius: 6px; image-rendering: pixelated; }
#nc-shuffle, #nc-dice, #nc-cancel, #tr-preview, #tr-cancel { all: unset; cursor: pointer; height: 24px; padding: 0 10px; border: 1px solid var(--line); border-radius: 999px; font-size: 10px; letter-spacing: .08em; text-transform: uppercase; color: var(--dim); display: inline-flex; align-items: center; }
#nc-shuffle:hover, #nc-dice:hover, #nc-cancel:hover, #tr-preview:hover, #tr-cancel:hover { color: var(--ink-hi); border-color: var(--line-hi); }
#nc-cancel, #tr-preview, #tr-cancel { height: 32px; border-radius: 8px; padding: 0 14px; color: var(--ink); }
#tr-preview { border-color: var(--line-hi); color: var(--ink-hi); }
#tr-go:disabled, #tr-preview:disabled { opacity: .4; cursor: default; }
.nc-opts { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.nc-row { display: grid; grid-template-columns: 58px 1fr; gap: 8px; align-items: center; }
.nc-row > span:first-child { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
.nc-name { display: flex; gap: 6px; align-items: center; }
#nc-name { flex: 1; min-width: 0; height: 28px; padding: 0 9px; border: 1px solid var(--line-hi); border-radius: 7px; background: var(--bg); color: var(--ink-hi); font: inherit; font-size: 12px; letter-spacing: .04em; }
#nc-name:focus { outline: 1px solid var(--accent); outline-offset: 1px; }
#newcity .chips, #trailer .chips { display: flex; flex-wrap: wrap; gap: 4px; }
#newcity .chips button, #trailer .chips button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 10px; letter-spacing: .06em; color: var(--dim); }
#newcity .chips button small, #trailer .chips button small { color: var(--faint); font-size: 9px; }
#newcity .chips button:hover, #trailer .chips button:hover { color: var(--ink-hi); border-color: var(--line-hi); }
#newcity .chips button[aria-checked="true"], #newcity .chips button[aria-pressed="true"], #trailer .chips button[aria-checked="true"], #trailer .chips button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
#newcity button:focus-visible, #trailer button:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.nc-note { margin: 12px 0 0; font-size: 10.5px; color: var(--dim); line-height: 1.5; }
.nc-acts { display: flex; gap: 8px; margin-top: 12px; }
@media (max-width: 700px) { .nc-body { grid-template-columns: 1fr; } }

/* the city gallery */
#gallery, #tours { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(6px); }
.gal-card { width: min(1060px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 14px 16px 16px; border: 1px solid var(--line-hi); border-radius: 14px; background: var(--panel-solid); }
.gal-card header { display: flex; align-items: center; }
.gal-card h2 { margin: 0 auto 0 0; font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.gal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; margin-top: 12px; }
.gal-c { display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.gal-c:hover { border-color: var(--line-hi); }
.gal-c canvas { display: block; border-radius: 6px; image-rendering: pixelated; max-width: 100%; }
.gal-t { display: flex; flex-direction: column; gap: 1px; margin-top: 4px; }
.gal-t small { font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.gal-t b { font-size: 14px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-hi); }
.gal-c p { margin: 0; font-size: 11px; line-height: 1.5; color: var(--ink); }
.gal-c p.gal-m { color: var(--dim); font-size: 10px; text-transform: none; }
.gal-a { display: flex; gap: 6px; margin-top: auto; padding-top: 6px; }
.gal-a button:not(.rec-go) { all: unset; cursor: pointer; height: 32px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--line-hi); color: var(--ink); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; display: inline-flex; align-items: center; }
.gal-a button:not(.rec-go):hover { color: var(--ink-hi); border-color: var(--ink); }
.gal-a button:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.gal-mine { border-style: dashed; }
#tours[hidden] { display: none; }
.gal-first { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.gal-new { display: grid; place-items: center; height: 170px; border-radius: 6px; background: color-mix(in srgb, var(--line) 35%, transparent); color: var(--dim); }
.gal-first .gal-new { color: var(--accent); }
.gal-new svg { width: 62%; height: auto; }
.gal-none p { color: var(--dim); }
.gal-a button.rec-go[disabled] { opacity: .35; cursor: default; pointer-events: none; }

/* first-build coach */
#coach { top: 64px; left: calc(var(--lib-w) + 2 * var(--gut)); width: 300px; max-width: calc(100vw - 2 * var(--gut)); z-index: 6; padding: 12px 14px 14px; border: 1px solid var(--line-hi); border-radius: 12px; background: var(--panel-solid); box-shadow: 0 18px 50px rgba(0, 0, 0, .35); animation: envin2 .25s ease both; }
#coach .coach-top { display: flex; align-items: center; gap: 8px; }
#coach .coach-top small { font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--dim); margin-right: auto; }
.coach-dots { display: flex; gap: 4px; }
.coach-dots i { width: 14px; height: 3px; border-radius: 2px; background: var(--line-hi); }
.coach-dots i.done { background: color-mix(in srgb, var(--accent) 55%, transparent); }
.coach-dots i.now { background: var(--accent); }
.coach-x { all: unset; cursor: pointer; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 6px; color: var(--dim); font-size: 11px; }
.coach-x:hover { color: var(--ink-hi); background: var(--bg); }
#coach h3 { margin: 8px 0 4px; font-size: 14px; font-weight: 500; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-hi); }
#coach p { margin: 0; font-size: 11.5px; line-height: 1.55; color: var(--ink); }
#coach p em { font-style: normal; color: var(--accent); white-space: nowrap; }
#coach ul { margin: 8px 0 0; padding: 0; list-style: none; font-size: 10.5px; line-height: 1.6; color: var(--dim); }
#coach kbd { font: inherit; font-size: 9.5px; padding: 0 4px; border: 1px solid var(--line-hi); border-radius: 4px; color: var(--ink); }
.coach-acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.coach-acts button { all: unset; cursor: pointer; height: 28px; padding: 0 12px; border-radius: 7px; border: 1px solid var(--line-hi); color: var(--ink); font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; display: inline-flex; align-items: center; }
.coach-acts button:hover { color: var(--ink-hi); border-color: var(--ink); }
.coach-acts .coach-go { background: var(--accent); border-color: var(--accent); color: #111; font-weight: 600; }
.coach-acts .coach-go:hover { color: #111; filter: brightness(1.08); }
.coach-acts button:focus-visible, .coach-x:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.coach-hl { position: relative; z-index: 3; box-shadow: 0 0 0 2px var(--accent), 0 0 18px color-mix(in srgb, var(--accent) 60%, transparent) !important; animation: coachpulse 1.4s ease-in-out infinite; }
@keyframes coachpulse { 50% { box-shadow: 0 0 0 2px var(--accent), 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); } }
body.rec #coach, body.cine #coach, body.touring #coach, body.photo #coach { display: none; }
@media (max-width: 900px) { #coach { top: auto; bottom: 150px; left: var(--gut); right: var(--gut); width: auto; } }

/* video recorder: settings card, HUD, the frame, the result */
#rec-btn .dot { transition: fill .2s; }
#rec-btn.on { color: #ff4d4d; border-color: #ff4d4d; }
#rec-btn.on .dot { animation: recblink 1.2s steps(2, end) infinite; }
@keyframes recblink { 50% { opacity: .25; } }
#recp { top: 52px; right: var(--gut); width: 330px; max-width: calc(100vw - 2 * var(--gut)); padding: 10px 14px 14px; border: 1px solid var(--line-hi); border-radius: 12px; background: var(--panel-solid); z-index: 7; display: flex; flex-direction: column; gap: 8px; animation: envin2 .18s ease both; }
@keyframes envin2 { from { opacity: 0; transform: translateY(-4px); } }
#recp header { display: flex; align-items: baseline; gap: 8px; padding-bottom: 4px; }
#recp header span { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); margin-right: auto; }
#recp header small { font-size: 10px; color: var(--faint); letter-spacing: .06em; }
.rec-opt { display: grid; grid-template-columns: 54px 1fr; align-items: center; gap: 8px; }
.rec-opt > span { font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--dim); }
#recp .chips { display: flex; flex-wrap: wrap; gap: 4px; }
#recp .chips button { all: unset; cursor: pointer; display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border: 1px solid var(--line); border-radius: 999px; font-size: 10px; letter-spacing: .06em; color: var(--dim); }
#recp .chips button:hover { color: var(--ink-hi); border-color: var(--line-hi); }
#recp .chips button[aria-checked="true"], #recp .chips button[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
#recp .chips button:disabled { opacity: .35; cursor: default; }
#recp .chips button:focus-visible, .rec-go:focus-visible, #rec-hud button:focus-visible, #rec-discard:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.rec-note { margin: 2px 0 0; font-size: 10.5px; line-height: 1.5; color: var(--dim); }
.rec-go { all: unset; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 32px; padding: 0 14px; border-radius: 8px; background: var(--accent); color: #111; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; font-weight: 600; }
.rec-go i { width: 9px; height: 9px; border-radius: 50%; background: #c0201a; box-shadow: 0 0 0 2px rgba(0,0,0,.15); }
.rec-go:hover { filter: brightness(1.08); }
.rec-go:disabled { opacity: .4; cursor: default; filter: none; }
#rec-hud { top: 12px; left: var(--gut); z-index: 8; display: flex; align-items: center; gap: 10px; height: 34px; padding: 0 6px 0 12px; border: 1px solid var(--line-hi); border-radius: 999px; background: var(--panel-solid); font-size: 11px; color: var(--dim); font-variant-numeric: tabular-nums; }
#rec-hud b { color: var(--ink-hi); font-weight: 500; letter-spacing: .04em; min-width: 34px; }
.rec-dot { width: 9px; height: 9px; border-radius: 50%; background: #ff4d4d; box-shadow: 0 0 8px #ff4d4d; animation: recblink 1.2s steps(2, end) infinite; }
.rec-bar { width: 110px; height: 3px; border-radius: 2px; background: var(--line); overflow: hidden; }
.rec-bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s linear; }
#rec-hud button { all: unset; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; height: 24px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--line-hi); color: var(--ink); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
#rec-hud button svg { width: 11px; height: 11px; color: #ff4d4d; }
#rec-hud button:hover { color: var(--ink-hi); border-color: var(--ink); }
body.rec .brand { opacity: 0; pointer-events: none; }
body.rec #stage canvas { box-shadow: 0 0 0 1px var(--line-hi), 0 24px 70px rgba(0, 0, 0, .45); }
body.rec #letterbox i { height: 0 !important; }
body.rec #lib, body.rec #insp, body.rec #toolbar, body.rec #stats, body.rec #credit, body.rec .frame, body.rec #hint { opacity: 0; pointer-events: none; }
body.rec #focus, body.rec.cine #focus { left: 50%; bottom: 14px; top: auto; }
body.rec-titles #caption { opacity: 0; }
body.rec-render #stage, body.rec-render #focus, body.rec-render #top .tools, body.rec-render .clock { pointer-events: none; }
body.rec-render #top .tools, body.rec-render .clock { opacity: .35; }
#rec-done { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 24px; background: color-mix(in srgb, var(--bg) 70%, transparent); backdrop-filter: blur(6px); }
.rec-card { width: min(720px, 100%); max-height: calc(100vh - 48px); display: flex; flex-direction: column; gap: 12px; padding: 16px; border: 1px solid var(--line-hi); border-radius: 14px; background: var(--panel-solid); }
.rec-card h2 { margin: 0; font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
#rec-video { display: block; width: 100%; max-height: calc(100vh - 220px); object-fit: contain; border-radius: 8px; background: #000; }
#rec-done-info { margin: 0; font-size: 11px; color: var(--ink); font-variant-numeric: tabular-nums; }
.rec-acts { display: flex; gap: 8px; }
#rec-discard { all: unset; cursor: pointer; height: 32px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-hi); color: var(--ink); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; display: inline-flex; align-items: center; }
#rec-discard:hover { color: var(--ink-hi); border-color: var(--ink); }
@media (max-width: 520px) { #rec-hud span { display: none; } }
.speeds button { all: unset; cursor: pointer; height: 24px; min-width: 26px; padding: 0 5px; box-sizing: border-box; display: grid; place-items: center; border-radius: 999px; color: var(--dim); font-size: 10px; letter-spacing: .04em; }
.speeds button svg { width: 12px; height: 12px; }
.speeds button:hover { color: var(--ink); }
.speeds button[aria-checked="true"] { color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }

/* menu */
#menu { top: 52px; right: var(--gut); width: 230px; padding: 6px; border: 1px solid var(--line-hi); border-radius: 10px; background: var(--panel-solid); display: flex; flex-direction: column; gap: 2px; z-index: 6; }
#menu button { all: unset; cursor: pointer; padding: 7px 9px; border-radius: 6px; color: var(--ink); display: flex; flex-direction: column; }
#menu button small { color: var(--dim); font-size: 10px; }
#menu button:hover, #menu button:focus-visible { background: var(--bg); color: var(--ink-hi); }
#menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 2px; width: auto; }
.menu-credit { display: none; padding: 8px 9px 4px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); text-decoration: none; }
.menu-credit:hover { color: var(--ink); }
@media (max-width: 900px) { .menu-credit { display: block; } }
.menu-sizes { display: flex; gap: 4px; padding: 0 6px 4px; }
.menu-sizes button { flex: 1; text-align: center; border: 1px solid var(--line) !important; font-size: 11px; align-items: center; }

/* library */
#lib { top: 60px; left: var(--gut); bottom: 64px; width: var(--lib-w); display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); overflow: hidden; }
.lib-head { display: flex; align-items: center; gap: 8px; padding: 10px 12px 6px; font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.lib-head b { font-weight: 400; color: var(--faint); margin-left: auto; letter-spacing: .06em; }
#lib-x { all: unset; cursor: pointer; display: none; padding: 0 4px; color: var(--dim); }
.lib-tabs { display: flex; flex-wrap: wrap; gap: 4px; padding: 0 10px 8px; border-bottom: 1px solid var(--line); }
.lib-tabs button { all: unset; cursor: pointer; padding: 3px 8px; border: 1px solid var(--line); border-radius: 999px; color: var(--dim); font-size: 10px; letter-spacing: .1em; text-transform: uppercase; }
.lib-tabs button:hover { color: var(--ink); border-color: var(--line-hi); }
.lib-tabs button[aria-selected="true"] { color: var(--ink-hi); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.lib-grid { flex: 1; overflow: auto; padding: 10px; display: grid; grid-template-columns: 1fr 1fr; grid-auto-rows: max-content; gap: 8px; align-content: start; scrollbar-width: thin; scrollbar-color: var(--line-hi) transparent; }
.card { all: unset; cursor: pointer; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); overflow: hidden; position: relative; }
.card > * { flex-shrink: 0; }
.card canvas { width: 100%; height: auto; aspect-ratio: 5 / 4; display: block; }
.card .ph { width: 100%; aspect-ratio: 5 / 4; display: grid; place-items: center; color: var(--faint); font-size: 10px; }
.card .nm { padding: 4px 7px 2px; color: var(--ink); font-size: 11px; line-height: 1.25; }
.card .meta { padding: 0 7px 6px; color: var(--faint); font-size: 10px; display: flex; gap: 6px; white-space: nowrap; overflow: hidden; }
.card .meta span { overflow: hidden; text-overflow: ellipsis; }
.card .meta i { font-style: normal; color: var(--dim); }
.card .num { position: absolute; top: 5px; left: 7px; color: var(--faint); font-size: 10px; }
.card:hover { border-color: var(--line-hi); }
.card:hover .nm { color: var(--ink-hi); }
.card:focus-visible { outline: 1px solid var(--ink); outline-offset: 1px; }
.card[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.card[aria-pressed="true"] .num { color: var(--accent); }
.card.new::after { content: 'new'; position: absolute; top: 5px; right: 6px; font-size: 9px; letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

/* toolbar */
#toolbar { bottom: var(--gut); left: calc(50% + (var(--lib-w) - var(--insp-w)) / 2); transform: translateX(-50%); display: flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); max-width: calc(100vw - 2 * var(--gut)); overflow-x: auto; scrollbar-width: none; }
#toolbar button { all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; min-width: 52px; padding: 5px 6px 4px; border-radius: 8px; color: var(--dim); position: relative; box-sizing: border-box; }
#toolbar button svg { width: 20px; height: 20px; }
#toolbar button span { font-size: 10px; letter-spacing: .06em; }
#toolbar button kbd { position: absolute; top: 2px; right: 4px; font-size: 9px; color: var(--faint); }
#toolbar button:hover { color: var(--ink); background: var(--bg); }
#toolbar button:focus-visible { outline: 1px solid var(--ink); }
#toolbar button[aria-pressed="true"] { color: var(--ink-hi); background: var(--bg); box-shadow: 0 0 0 1px var(--accent) inset; }
#toolbar button[aria-pressed="true"] svg { color: var(--accent); }
#toolbar .sep { width: 1px; background: var(--line); margin: 6px 3px; flex: none; }
#toolbar button:disabled { opacity: .35; cursor: default; }
#hint { bottom: 86px; left: calc(50% + (var(--lib-w) - var(--insp-w)) / 2); transform: translateX(-50%); max-width: min(560px, calc(100vw - 2 * var(--gut))); padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: var(--dim); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; pointer-events: none; transition: opacity .3s; }
#hint:empty { opacity: 0; }
#brush { bottom: 118px; left: calc(50% + (var(--lib-w) - var(--insp-w)) / 2); transform: translateX(-50%); display: flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); }
#brush[hidden] { display: none; }
#brush button { all: unset; cursor: pointer; padding: 4px 12px; border-radius: 999px; color: var(--dim); font-size: 11px; letter-spacing: .04em; }
#brush button:hover { color: var(--ink-hi); }
#brush button[aria-checked="true"] { color: var(--ink-hi); background: var(--line); box-shadow: inset 0 0 0 1px var(--accent); }
#brush button:focus-visible { outline: 1px solid var(--accent); }
body.rec #brush, body.cine #brush, body.intro #brush { opacity: 0; pointer-events: none; }
#hint b { color: var(--ink-hi); font-weight: 500; }
#hint em { color: var(--accent); font-style: normal; }

/* cinematic: letterbox bars, the panels step aside */
#letterbox i { position: fixed; left: 0; right: 0; height: 0; background: color-mix(in srgb, var(--bg) 55%, #000); z-index: 1; pointer-events: none; transition: height .6s cubic-bezier(.2, .7, .2, 1); }
#letterbox i:first-child { top: 0; } #letterbox i:last-child { bottom: 0; }
body.cine #letterbox i { height: 7vh; }
body.intro #letterbox i { height: 0 !important; }       /* the intro fills the whole screen */
body.cine #lib, body.cine #insp, body.cine #toolbar, body.cine #stats, body.cine #credit, body.cine .frame, body.cine #hint { opacity: 0; pointer-events: none; }
body.cine #focus { bottom: calc(7vh + 14px); }
:root[data-theme="light"] #letterbox i { background: color-mix(in srgb, var(--bg) 70%, #000); }

/* focus bar: what the camera is looking at, and how */
#focus { bottom: 86px; left: calc(50% + (var(--lib-w) - var(--insp-w)) / 2); transform: translateX(-50%); display: flex; align-items: center; gap: 10px; padding: 5px 6px 5px 12px; border: 1px solid var(--line-hi); border-radius: 12px; background: var(--panel); max-width: calc(100vw - 2 * var(--gut)); }
body.focusing #hint { opacity: 0; }
.fc-who { display: flex; flex-direction: column; min-width: 0; max-width: 230px; }
.fc-who small { font-size: 9px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-who b { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fc-who span { font-size: 10px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.fc-who span:empty { display: none; }
.fc-modes { display: flex; gap: 2px; padding-left: 8px; border-left: 1px solid var(--line); }
.fc-modes button, #fc-speed, #fc-x { all: unset; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 1px; min-width: 50px; padding: 4px 5px 3px; border-radius: 8px; color: var(--dim); box-sizing: border-box; }
.fc-modes button svg { width: 18px; height: 18px; }
.fc-modes button span { font-size: 10px; letter-spacing: .05em; }
.fc-modes button:hover, #fc-speed:hover, #fc-x:hover { color: var(--ink); background: var(--bg); }
.fc-modes button:focus-visible, #fc-speed:focus-visible, #fc-x:focus-visible { outline: 1px solid var(--ink); }
.fc-modes button[aria-pressed="true"] { color: var(--ink-hi); background: var(--bg); box-shadow: 0 0 0 1px var(--accent) inset; }
.fc-modes button[aria-pressed="true"] svg { color: var(--accent); }
#fc-speed { min-width: 34px; font-size: 11px; justify-content: center; height: 36px; font-variant-numeric: tabular-nums; }
#fc-x { min-width: 30px; justify-content: center; height: 36px; font-size: 12px; }

/* inspector */
#insp { top: 60px; right: var(--gut); width: var(--insp-w); max-height: calc(100vh - 150px); overflow: auto; scrollbar-width: none; padding: 12px 13px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.insp-tag { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); margin-bottom: 3px; }
#insp h1 { margin: 0 0 4px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
#insp p { margin: 0; color: var(--ink); }
.insp-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 10px 0 8px; }
.insp-stats div { border: 1px solid var(--line); border-radius: 6px; padding: 4px 6px; }
.insp-stats b { display: block; color: var(--ink-hi); font-weight: 500; font-variant-numeric: tabular-nums; }
.insp-stats span { color: var(--faint); font-size: 10px; letter-spacing: .08em; text-transform: uppercase; }
.insp-read { color: var(--ink); font-variant-numeric: tabular-nums; min-height: 18px; margin-bottom: 8px; }
.insp-read .off { color: var(--dim); }
.insp-panel, .insp-acts { display: flex; flex-direction: column; gap: 5px; }
.insp-acts { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); flex-direction: row; flex-wrap: wrap; }
#insp button { all: unset; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--bg); color: var(--dim); user-select: none; -webkit-user-select: none; touch-action: manipulation; box-sizing: border-box; }
#insp button:hover { color: var(--ink); border-color: var(--line-hi); }
#insp button:focus-visible { outline: 1px solid var(--ink); outline-offset: 1px; }
#insp button.on { color: var(--ink-hi); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
#insp button kbd { opacity: .65; font-size: 10px; }
#insp .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
#insp .grid2 button { justify-content: center; }
.insp-acts button { flex: 1; justify-content: center !important; font-size: 11px; }
#insp .rng { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 7px; color: var(--dim); }
#insp .rng input { width: 100%; accent-color: var(--accent); margin: 0; }
#insp .rng output { color: var(--ink); }
#insp h3 { margin: 4px 1px 0; font-size: 10px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }

/* stats, credit */
#stats { right: var(--gut); bottom: 18px; text-align: right; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums; font-size: 11px; max-width: calc(50vw - 300px); overflow: hidden; text-overflow: ellipsis; }
#stats .k { color: var(--faint); }
#stats .warn { color: var(--accent); }
#credit { left: calc(var(--gut) + 2px); bottom: 22px; font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: var(--dim); text-decoration: none; }
#credit:hover { color: var(--ink); }

/* callout */
#callout-svg { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 3; overflow: visible; }
#callout-path { fill: none; stroke: var(--dim); stroke-width: 1; vector-effect: non-scaling-stroke; }
#callout-dot { fill: var(--accent); }
#callout-svg.off { display: none; }
#callout { position: fixed; left: 0; top: 0; z-index: 3; pointer-events: none; max-width: 250px; padding: 6px 9px 7px; border: 1px solid var(--line-hi); border-radius: 6px; background: var(--panel); opacity: 0; transform: translateY(3px); transition: opacity .16s, transform .16s; }
#callout.show { opacity: 1; transform: none; }
#callout b { display: block; font-size: 10px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-hi); }
#callout span { display: block; color: var(--dim); font-size: 11px; line-height: 1.4; margin-top: 1px; }
#callout em.act { font-style: normal; color: var(--accent); }

/* tour caption: a film title card, lower left */
#caption { position: fixed; left: calc(var(--gut) + 8px); bottom: 38px; z-index: 6; max-width: min(520px, calc(100vw - 32px)); pointer-events: none; display: flex; flex-direction: column; gap: 3px; animation: capin .7s ease both; }
#caption small { font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--faint); }
#caption b { font-size: 22px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-hi); }
#caption span { color: var(--ink); font-size: 12px; }
#caption em { font-style: normal; color: var(--accent); font-size: 11px; font-variant-numeric: tabular-nums; }
@keyframes capin { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
body.touring .ui:not(#top), body.touring .frame { opacity: 0; pointer-events: none; }
body.touring #focus { display: none; }
body.touring #top > *:not(.tools) { opacity: 0; pointer-events: none; }
body.touring #top .tools > *:not(#tour) { opacity: 0; pointer-events: none; }

/* toast */
#toast { position: fixed; left: 50%; top: 62px; transform: translate(-50%, -6px); z-index: 7; padding: 6px 12px; border: 1px solid var(--line-hi); border-radius: 999px; background: var(--panel-solid); color: var(--ink); font-size: 11px; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; white-space: nowrap; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* help */
#help { position: fixed; inset: 0; z-index: 8; display: grid; place-items: center; background: color-mix(in srgb, var(--bg) 70%, transparent); padding: var(--gut); }
#help[hidden] { display: none; }
.help-card { position: relative; width: min(900px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 18px 20px; border: 1px solid var(--line-hi); border-radius: 12px; background: var(--panel-solid); }
.help-card h2 { margin: 0 0 12px; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); font-weight: 600; }
.help-cols { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.help-cols h3 { margin: 0 0 6px; font-size: 10px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.help-cols ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; color: var(--ink); }
.help-cols kbd { display: inline-block; min-width: 18px; padding: 0 4px; border: 1px solid var(--line-hi); border-radius: 4px; text-align: center; color: var(--ink-hi); font-size: 10px; line-height: 16px; }
.help-x { all: unset; cursor: pointer; position: absolute; top: 12px; right: 14px; color: var(--dim); }

/* tighter desktops: pills become icons, the clock sits after the brand */
@media (max-width: 1500px) { #top .tools .pill:not(.main) span { display: none; } #top .tools .pill:not(.main) { padding: 0 8px; } }
@media (max-width: 1340px) { .clock { position: static; transform: none; margin-right: auto; } }

/* phones and narrow windows: library as a bottom sheet, inspector above the toolbar */
@media (max-width: 900px) {
  :root { --lib-w: 0px; --insp-w: 0px; }
  .frame, #credit, #spin span, #ovl span { display: none; }
  .clock { position: static; transform: none; }
  #top { gap: 6px; }
  .brand span { display: none; }
  #lib { top: auto; bottom: 76px; left: var(--gut); right: var(--gut); width: auto; height: min(52vh, 440px); transform: translateY(calc(100% + 100px)); transition: transform .3s; z-index: 5; }
  body.lib-open #lib { transform: none; }
  #lib-x { display: block; }
  .lib-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); }
  #toolbar { left: 50%; bottom: 12px; }
  #toolbar button { min-width: 46px; }
  #toolbar button kbd { display: none; }
  #insp { top: auto; bottom: 80px; left: var(--gut); right: var(--gut); width: auto; max-height: 40vh; }
  #focus { left: 50%; top: 78px; bottom: auto; gap: 6px; padding-left: 9px; }
  body.cine #focus { top: auto; bottom: calc(7vh + 10px); }
  .fc-who { max-width: 120px; }
  .fc-modes button { min-width: 42px; }
  #hint { bottom: 80px; }
  #brush { bottom: 110px; }
  body.insp-open #hint { opacity: 0; }
  #stats { top: 52px; bottom: auto; right: var(--gut); max-width: calc(100vw - 32px); font-size: 10px; }
  .help-cols { grid-template-columns: 1fr; }
}
@media (max-width: 520px) {
  .speeds button[data-speed="3"] { display: none; }
  #clk-time span, #wx span { display: none; }
  #ovl, #spin, #photo, #help-btn { display: none; }
  .tools { gap: 5px; }
  .brand svg { width: 20px; height: 20px; }
  #wx { display: none; }
  #toast { top: 86px; white-space: normal; text-align: center; width: max-content; max-width: calc(100vw - 32px); border-radius: 12px; }
}

/* performance HUD (?perf=1 or `) */
#perfhud { position: fixed; top: 52px; left: var(--gut); z-index: 20; padding: 6px 9px; border: 1px solid var(--line-hi); border-radius: 8px; background: var(--panel-solid); font: 10px/1.55 var(--mono); color: var(--dim); font-variant-numeric: tabular-nums; pointer-events: none; }
#perfhud b { color: var(--ink-hi); font-weight: 500; }

/* ── missions: the card above the library, banners, the list, the briefing and the report ── */
body.mission #lib { top: calc(60px + var(--mhud-h, 0px) + 8px); }
#mhud { top: 60px; left: var(--gut); width: var(--lib-w); box-sizing: border-box; max-height: calc(100vh - 220px); overflow: auto; scrollbar-width: none; padding: 9px 11px 9px; border: 1px solid var(--line-hi); border-radius: 12px; background: var(--panel); font-size: 11px; color: var(--ink); }
#mhud header { display: flex; align-items: flex-start; gap: 4px; }
#mhud header div { display: flex; flex-direction: column; gap: 1px; margin-right: auto; min-width: 0; }
#mhud header small { font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
#mhud header b { font-size: 13px; font-weight: 500; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-hi); }
#mhud header button { all: unset; cursor: pointer; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 5px; color: var(--dim); font-size: 11px; flex: none; }
#mhud header button:hover { color: var(--ink-hi); background: var(--bg); }
.mh-time { display: flex; gap: 8px; align-items: center; margin: 4px 0 2px; color: var(--dim); font-variant-numeric: tabular-nums; }
.mh-time b { color: var(--ink-hi); font-weight: 500; }
.mh-ev { padding: 0 6px; border-radius: 999px; border: 1px solid var(--accent); color: var(--accent); font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; animation: mhpulse 1.6s ease-in-out infinite; }
@keyframes mhpulse { 50% { opacity: .45; } }
.mh-goals { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mh-goals li { display: grid; grid-template-columns: 12px 1fr auto; column-gap: 6px; row-gap: 3px; align-items: baseline; }
.mh-goals .mh-l { color: var(--ink); line-height: 1.35; }
.mh-goals b { font-weight: 500; color: var(--ink-hi); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mh-goals b em { font-style: normal; color: var(--faint); }
.mh-goals small { grid-column: 2 / 4; color: var(--faint); font-size: 10px; margin-top: -1px; }
.mh-bar { grid-column: 2 / 4; height: 2px; border-radius: 2px; background: var(--line); overflow: hidden; }
.mh-bar i { display: block; height: 100%; background: var(--dim); transition: width .5s; }
.mh-goals li.ok .mh-bar i { background: var(--accent); }
.mh-goals li.ok b { color: var(--accent); }
.mh-goals li.bad .mh-l { color: var(--dim); text-decoration: line-through; }
.mh-dot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--dim); box-sizing: border-box; align-self: center; display: inline-block; }
li.ok > .mh-dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 8px color-mix(in srgb, var(--accent) 60%, transparent); }
li.bad > .mh-dot { border-color: #ff4d4d; }
.mh-bonus { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.mh-bonus div { display: grid; grid-template-columns: auto 1fr auto; gap: 6px; align-items: center; color: var(--dim); }
.mh-bonus div b { font-weight: 500; color: var(--dim); font-variant-numeric: tabular-nums; }
.mh-bonus div.ok, .mh-bonus div.ok b { color: var(--ink-hi); }
#mhud footer { margin-top: 8px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--dim); font-size: 10.5px; display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
#mhud footer em { font-style: normal; color: var(--accent); }
#mhud footer button { all: unset; cursor: pointer; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.m-stars { display: inline-flex; gap: 1px; }
.m-stars i { width: 11px; height: 11px; display: inline-block; color: var(--faint); }
.m-stars svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.1; stroke-linejoin: round; }
.m-stars i.on { color: var(--accent); }
.m-stars i.on svg { fill: currentColor; }
.m-stars.b { min-width: 25px; }
.m-stars.b i { width: 8px; height: 8px; color: var(--faint); }
.m-stars.b.ok i { color: var(--accent); }
.mb-list .m-stars.b i { width: 9px; height: 9px; }
body.rec #mhud, body.cine #mhud, body.photo #mhud { opacity: 0; pointer-events: none; }
.card.locked { opacity: .32; filter: grayscale(1); }
.card.locked::after { content: ''; position: absolute; top: 6px; right: 6px; width: 12px; height: 12px; background: currentColor; color: var(--dim); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='3.5' y='7' width='9' height='6.5' rx='1.2' fill='none' stroke='black' stroke-width='1.4'/%3E%3Cpath d='M5.5 7V5a2.5 2.5 0 0 1 5 0v2' fill='none' stroke='black' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Crect x='3.5' y='7' width='9' height='6.5' rx='1.2' fill='none' stroke='black' stroke-width='1.4'/%3E%3Cpath d='M5.5 7V5a2.5 2.5 0 0 1 5 0v2' fill='none' stroke='black' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat; }
.card .left { position: absolute; top: 5px; right: 6px; font-size: 9px; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
#mis-btn svg path { stroke: var(--accent); }
body.mission #mis-btn { color: var(--ink-hi); border-color: var(--line-hi); }

#malert { top: 54px; left: 50%; transform: translateX(-50%); z-index: 8; display: flex; align-items: center; gap: 10px; padding: 7px 14px 7px 8px; border: 1px solid var(--line-hi); border-radius: 12px; background: var(--panel-solid); box-shadow: 0 12px 40px rgba(0, 0, 0, .3); animation: envin .25s ease both; max-width: calc(100vw - 2 * var(--gut)); }
#malert.out { opacity: 0; transform: translate(-50%, -6px); transition: opacity .35s, transform .35s; }
#malert div { display: flex; flex-direction: column; gap: 1px; }
#malert b { font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-hi); }
#malert span { font-size: 11px; color: var(--ink); }
.ma-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font-style: normal; font-size: 14px; color: var(--accent); border: 1px solid var(--accent); flex: none; }
.ma-ic.storm, .ma-ic.warn { background: var(--accent); color: #111; }
body.rec #malert { display: none; }

#missions, #mbrief, #mreport { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(6px); }
#mbrief, #mreport { background: color-mix(in srgb, var(--bg) 55%, transparent); backdrop-filter: blur(3px); }
#missions[hidden], #mbrief[hidden], #mreport[hidden] { display: none; }
.ms-card header { gap: 10px; }
.ms-total { display: inline-flex; align-items: center; gap: 5px; color: var(--dim); font-size: 11px; }
.ms-total svg { width: 13px; height: 13px; fill: var(--accent); }
.ms-total b { color: var(--ink-hi); font-weight: 500; }
#ms-back { all: unset; cursor: pointer; font-size: 10.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink); padding: 4px 9px; border: 1px solid var(--line-hi); border-radius: 7px; }
#ms-back:hover { color: var(--ink-hi); border-color: var(--ink); }
.ms-intro { margin: 8px 0 0; font-size: 11.5px; line-height: 1.55; color: var(--dim); max-width: 720px; }
.ms-c { position: relative; }
.ms-c .m-stars { position: absolute; top: 18px; right: 18px; padding: 3px 5px; border-radius: 6px; background: color-mix(in srgb, var(--panel-solid) 85%, transparent); }
.ms-c .m-stars i { width: 13px; height: 13px; }
.ms-c.cur { border-color: var(--accent); }
.ms-c.locked canvas, .ms-c.locked p, .ms-c.locked .ms-goals { opacity: .4; }
.ms-goals { margin: 0; padding: 0 0 0 14px; font-size: 10.5px; line-height: 1.55; color: var(--ink); }
.ms-goals li::marker { color: var(--accent); }
.ms-lock { display: inline-flex; align-items: center; gap: 6px; font-size: 10.5px; color: var(--dim); }
.ms-lock svg { width: 14px; height: 14px; }
.mb-card { width: min(760px, 100%); max-height: calc(100vh - 40px); overflow: auto; padding: 16px 18px 16px; border: 1px solid var(--line-hi); border-radius: 14px; background: var(--panel-solid); box-shadow: 0 30px 80px rgba(0, 0, 0, .4); animation: envin2 .25s ease both; }
.mb-tag { font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--accent); }
.mb-card h2 { margin: 4px 0 6px; font-size: 20px; font-weight: 500; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-hi); }
.mb-brief { margin: 0 0 6px; font-size: 13px; line-height: 1.6; color: var(--ink); max-width: 640px; }
.mb-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 24px; }
.mb-card h3 { margin: 12px 0 6px; font-size: 10px; font-weight: 400; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.mb-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--ink-hi); }
.mb-list li { display: flex; align-items: center; gap: 8px; line-height: 1.4; }
.mb-list li small { color: var(--faint); }
.mb-list.dim li { color: var(--dim); font-size: 11px; }
.mb-list.dim li::before { content: ''; width: 3px; height: 3px; border-radius: 50%; background: var(--faint); flex: none; }
.mb-chips { display: flex; flex-wrap: wrap; gap: 4px; margin: 0; }
.mb-chips span { padding: 3px 8px; border: 1px solid var(--line-hi); border-radius: 999px; font-size: 10.5px; color: var(--ink); }
.mb-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.mb-acts button:not(.rec-go) { all: unset; cursor: pointer; height: 32px; padding: 0 14px; border-radius: 8px; border: 1px solid var(--line-hi); color: var(--ink); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; display: inline-flex; align-items: center; }
.mb-acts button:not(.rec-go):hover { color: var(--ink-hi); border-color: var(--ink); }
.mb-acts button:focus-visible { outline: 1px solid var(--accent); outline-offset: 2px; }
.mr-card { width: min(560px, 100%); text-align: left; }
.mr-name { margin: 0; color: var(--dim); font-size: 12px; }
.mr-stars { margin: 14px 0 6px; }
.mr-stars .m-stars { gap: 8px; }
.mr-stars .m-stars i { width: 38px; height: 38px; }
.mr-stars.won .m-stars i.on { animation: starin .5s cubic-bezier(.3, 1.6, .5, 1) both; filter: drop-shadow(0 0 10px color-mix(in srgb, var(--accent) 70%, transparent)); }
.mr-stars.won .m-stars i:nth-child(2) { animation-delay: .18s; }
.mr-stars.won .m-stars i:nth-child(3) { animation-delay: .36s; }
@keyframes starin { from { transform: scale(.2) rotate(-40deg); opacity: 0; } }
.mr-new { margin: 0 0 6px; color: var(--accent); font-size: 11px; letter-spacing: .08em; }
.mr-rows { margin-top: 10px; }
.mr-rows li { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; }
.mr-rows li b { font-weight: 500; color: var(--ink-hi); font-variant-numeric: tabular-nums; }
.mr-rows li.bad span { color: var(--dim); }
.mr-bonus { padding-top: 8px; border-top: 1px solid var(--line); color: var(--dim); }
.mr-bonus li { color: var(--dim); }
.mr-bonus li.ok, .mr-bonus li.ok b { color: var(--ink-hi); }
.mr-nums { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; margin-top: 14px; padding: 10px 0 0; border-top: 1px solid var(--line); }
.mr-nums div { display: flex; flex-direction: column; gap: 2px; }
.mr-nums b { font-size: 14px; font-weight: 500; color: var(--ink-hi); font-variant-numeric: tabular-nums; }
.mr-nums span { font-size: 9.5px; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); }
@media (max-width: 900px) {
  #mhud { top: 76px; left: var(--gut); right: var(--gut); width: auto; max-height: 38vh; }
  body.mission #lib { top: auto; }
  body.mission #focus { top: calc(84px + var(--mhud-h, 0px)); }
  .mb-cols { grid-template-columns: 1fr; }
  .mr-nums { grid-template-columns: repeat(3, 1fr); }
}


/* ── money: the account in the top bar, prices on the cards, what a placement costs ── */
#money { all: unset; cursor: pointer; display: flex; align-items: baseline; gap: 8px; height: 26px; padding: 0 11px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); font-variant-numeric: tabular-nums; white-space: nowrap; }
#money[hidden] { display: none; }
#money:hover { border-color: var(--line-hi); }
#money b { font-size: 12.5px; font-weight: 500; color: var(--ink-hi); letter-spacing: .02em; line-height: 26px; }
#money b.red { color: #ff5a4f; }
#money span { font-size: 10.5px; color: var(--dim); }
#money span.pos { color: var(--accent); }
#money span.neg { color: #ff5a4f; }
#money small { font-size: 10px; color: var(--faint); }
.card .meta .price { margin-left: auto; font-weight: 500; color: var(--ink); font-variant-numeric: tabular-nums; }
.card.dear .meta .price { color: #ff5a4f; }
.card.dear canvas { opacity: .55; }
.mfloat { position: fixed; z-index: 40; transform: translate(-50%, -140%); pointer-events: none; font: 600 12px/1 var(--mono, ui-monospace, monospace); padding: 3px 7px; border-radius: 6px; background: var(--panel-solid); border: 1px solid var(--line-hi); animation: mfloat 1.4s ease-out both; white-space: nowrap; }
.mfloat.neg { color: var(--ink-hi); }
.mfloat.pos { color: var(--accent); border-color: var(--accent); }
@keyframes mfloat { 0% { opacity: 0; transform: translate(-50%, -100%); } 12% { opacity: 1; } 100% { opacity: 0; transform: translate(-50%, -330%); } }
.cp-budget .cp-bal { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.cp-budget .cp-bal b { font-size: 18px; font-weight: 500; color: var(--ink-hi); font-variant-numeric: tabular-nums; }
.cp-budget .cp-bal span { font-size: 11px; font-variant-numeric: tabular-nums; }
.cp-budget .pos { color: var(--accent); } .cp-budget .neg { color: #ff5a4f; }
.cp-mrow { display: grid; grid-template-columns: 112px 1fr 70px; align-items: center; gap: 8px; margin: 2px 0; }
.cp-mrow span { color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cp-mrow i { display: block; height: 5px; border-radius: 2px; background: var(--accent); min-width: 2px; }
.cp-mrow.out i { background: color-mix(in srgb, var(--ink) 45%, transparent); }
.cp-mrow b { text-align: right; font-weight: 400; color: var(--ink); font-variant-numeric: tabular-nums; }
.cp-mrow.out b::before { content: '−'; }
.cp-fares, .cp-loan { display: flex; align-items: center; gap: 5px; margin-top: 8px; flex-wrap: wrap; }
.cp-fares > span, .cp-loan > span { color: var(--dim); margin-right: 4px; }
.cp-fares small { color: var(--faint); margin-left: 4px; }
.cp-loan > span { margin-right: auto; }
.cp-loan b { color: var(--ink-hi); font-weight: 500; }
.cp-fares button, .cp-loan button { all: unset; cursor: pointer; padding: 3px 8px; border: 1px solid var(--line-hi); border-radius: 6px; color: var(--ink); font-size: 10.5px; }
.cp-fares button[aria-pressed="true"] { border-color: var(--accent); color: var(--ink-hi); box-shadow: 0 0 0 1px var(--accent) inset; }
.cp-fares button:hover, .cp-loan button:hover:not(:disabled) { color: var(--ink-hi); border-color: var(--ink); }
.cp-loan button:disabled { opacity: .35; cursor: default; }
.ms-group { grid-column: 1 / -1; margin: 10px 0 -2px; display: flex; align-items: baseline; gap: 10px; font-size: 11px; font-weight: 500; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-hi); }
.ms-group small { font-size: 11px; letter-spacing: .02em; text-transform: none; font-weight: 400; color: var(--dim); }
.mh-offers { margin-top: 8px; padding-top: 7px; border-top: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.mh-offers div { display: grid; grid-template-columns: 1fr auto; gap: 1px 8px; padding: 6px 8px; border: 1px dashed var(--accent); border-radius: 8px; }
.mh-offers small { grid-column: 1 / 3; font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
.mh-offers span { color: var(--ink); }
.mh-offers b { font-weight: 500; color: var(--ink-hi); font-variant-numeric: tabular-nums; }
.mh-offers em { grid-column: 1 / 3; font-style: normal; font-size: 10px; color: var(--faint); }
.ma-ic.offer { background: var(--accent); color: #111; }

/* ── the top bar: the city (name, money) on the left, the clock, then by how often it's used ── */
.top-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
#city-name { all: unset; cursor: pointer; display: flex; align-items: center; gap: 4px; height: 26px; padding: 0 6px 0 10px; border-left: 1px solid var(--line); color: var(--ink); font-size: 11.5px; letter-spacing: .06em; white-space: nowrap; max-width: 190px; }
#city-name span { overflow: hidden; text-overflow: ellipsis; }
#city-name svg { width: 12px; height: 12px; color: var(--dim); flex: none; }
#city-name:hover { color: var(--ink-hi); }
#city-name:hover svg { color: var(--ink); }
#city-name:focus-visible { outline: 1px solid var(--ink); outline-offset: 2px; border-radius: 4px; }
.pill.main { color: var(--ink); }
.pill.main svg { color: var(--accent); }
.pop-wrap { position: relative; }
#view-btn .caret { width: 11px; height: 11px; margin-left: -2px; }
.pop-menu { position: absolute; top: 34px; right: 0; z-index: 9; width: 236px; display: flex; flex-direction: column; padding: 6px; border: 1px solid var(--line-hi); border-radius: 12px; background: var(--panel-solid); box-shadow: 0 16px 44px rgba(0, 0, 0, .38); animation: envin .15s ease both; }
.pop-menu[hidden] { display: none; }
.pop-menu small { padding: 7px 8px 3px; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--faint); }
.pop-menu > button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 7px; font-size: 11.5px; color: var(--ink); }
.pop-menu > button i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line-hi); box-sizing: border-box; flex: none; display: grid; place-items: center; }
.pop-menu > button[aria-checked="true"] { color: var(--ink-hi); }
.pop-menu > button[aria-checked="true"] i { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 6px color-mix(in srgb, var(--accent) 60%, transparent); }
.pop-menu > button kbd { margin-left: auto; font: inherit; font-size: 10px; color: var(--faint); }
.pop-menu > button:hover, .pop-menu > button:focus-visible { background: var(--bg); outline: none; }
.glow-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 3px; padding: 4px 2px 2px; }
.glow-grid button { all: unset; cursor: pointer; display: flex; align-items: center; gap: 6px; padding: 5px 6px; border: 1px solid transparent; border-radius: 7px; font-size: 10.5px; color: var(--dim); }
.glow-grid button i { width: 9px; height: 9px; border-radius: 50%; background: var(--sw); flex: none; }
.glow-grid button:hover, .glow-grid button:focus-visible { color: var(--ink-hi); background: var(--bg); outline: none; }
.glow-grid button[aria-checked="true"] { color: var(--ink-hi); border-color: var(--sw); }
#toolbar button.only { min-width: 34px; justify-content: center; padding: 5px 4px; }
#toolbar button.only svg { width: 18px; height: 18px; }
.coach-ways { display: grid; grid-template-columns: 1fr; gap: 6px; margin-top: 10px; }
.coach-ways button { all: unset; cursor: pointer; display: flex; flex-direction: column; gap: 1px; padding: 8px 10px; border: 1px solid var(--line-hi); border-radius: 9px; }
.coach-ways button b { font-size: 11.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-hi); }
.coach-ways button span { font-size: 10.5px; color: var(--dim); }
.coach-ways button:hover, .coach-ways button:focus-visible { border-color: var(--accent); outline: none; }
.coach-ways button:first-child { border-color: var(--accent); }
@media (max-width: 1180px) { #city-name { display: none; } }
@media (max-width: 900px) { #top .tools .pill.main span { display: none; } #top .tools .pill.main { padding: 0 8px; } #money span, #money small { display: none; } }
#coach .coach-acts [data-a="tut"] { all: unset; cursor: pointer; margin-top: 2px; font-size: 10.5px; color: var(--dim); text-decoration: underline; text-underline-offset: 3px; }
#coach .coach-acts [data-a="tut"]:hover, #coach .coach-acts [data-a="tut"]:focus-visible { color: var(--ink-hi); }

/* ── the overlay legend (bottom right, over the numbers) ── */
#legend { right: var(--gut); bottom: 44px; width: 250px; padding: 8px 11px 9px; border: 1px solid var(--line-hi); border-radius: 10px; background: var(--panel); font-size: 10.5px; color: var(--dim); }
#legend[hidden] { display: none; }
#legend b { display: block; margin-bottom: 5px; font-size: 10px; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-hi); }
#legend p { margin: 6px 0 0; line-height: 1.45; }
#legend em { font-style: normal; color: var(--ink-hi); }
.lg-ramp i { display: block; height: 6px; border-radius: 3px; background: linear-gradient(90deg, #14b8c4, #ffd23f 55%, #ff2d55); }
:root[data-theme="light"] .lg-ramp i { background: linear-gradient(90deg, #0e8f9a, #e0a400 55%, #e11d48); }
.lg-ends { display: flex; justify-content: space-between; margin-top: 3px; color: var(--faint); }
.lg-sw { display: flex; flex-wrap: wrap; gap: 4px 10px; }
.lg-sw span { display: inline-flex; align-items: center; gap: 5px; color: var(--ink); }
.lg-sw i { width: 9px; height: 9px; border-radius: 2px; }
body.cityp-open #legend, body.rec #legend, body.photo #legend { display: none; }
@media (max-width: 900px) { #legend { bottom: 150px; } }
.lg-dia { display: inline-block; width: 8px; height: 8px; margin-right: 6px; background: #ff4d6d; transform: rotate(45deg); }
:root[data-theme="light"] .lg-dia { background: #e11d48; }

/* ── the intro: the city filmed under the title; everything else steps aside ── */
body.intro .ui, body.intro .frame, body.intro #credit, body.intro #focus, body.intro #caption, body.intro #toast, body.intro #callout, body.intro #callout-svg { opacity: 0 !important; pointer-events: none !important; }
#intro { position: fixed; inset: 0; z-index: 40; pointer-events: none; transition: opacity .6s; }
#intro[hidden] { display: none; }
#intro.out { opacity: 0; }
.in-title { position: absolute; left: 50%; top: 42%; transform: translate(-50%, -50%); display: flex; flex-direction: column; align-items: center; gap: 10px; color: #eef1f4; opacity: 0; transition: opacity 1.1s ease, transform 1.4s ease; text-shadow: 0 2px 30px rgba(0, 0, 0, .7); }
.in-title.on { opacity: 1; transform: translate(-50%, -54%); }
.in-title svg { width: 54px; height: 54px; color: #eef1f4; }
.in-title .acc { stroke: var(--accent); }
.in-title h1 { margin: 0; font: 600 clamp(28px, 5vw, 56px)/1 var(--mono); letter-spacing: .32em; text-transform: uppercase; padding-left: .32em; }
.in-title p { margin: 0; font-size: clamp(11px, 1.3vw, 14px); letter-spacing: .26em; text-transform: uppercase; color: color-mix(in srgb, #eef1f4 70%, transparent); }
.in-title .t2 { display: none; color: var(--accent); }
.in-title.end .t1 { display: none; } .in-title.end .t2 { display: block; }
.in-cap { position: absolute; left: max(32px, 5vw); bottom: calc(5vh + 26px); display: flex; flex-direction: column; gap: 4px; max-width: min(520px, 80vw); color: #eef1f4; opacity: 0; transform: translateY(8px); text-shadow: 0 2px 18px rgba(0, 0, 0, .8); }
.in-cap.on { animation: incap 4.6s ease both; }
@keyframes incap { 0% { opacity: 0; transform: translateY(10px); } 14% { opacity: 1; transform: none; } 86% { opacity: 1; transform: none; } 100% { opacity: 0; transform: translateY(-4px); } }
.in-cap::before { content: ''; position: absolute; left: -60px; right: -80px; top: -40px; bottom: -30px; z-index: -1; background: radial-gradient(ellipse at 30% 60%, rgba(6, 7, 8, .72), rgba(6, 7, 8, 0) 70%); }
.in-cap small { font-size: 11px; letter-spacing: .2em; color: var(--accent); }
.in-cap b { font-size: clamp(18px, 2.4vw, 28px); font-weight: 500; letter-spacing: .18em; text-transform: uppercase; }
.in-cap span { font-size: clamp(11px, 1.2vw, 14px); line-height: 1.5; color: color-mix(in srgb, #eef1f4 80%, transparent); letter-spacing: .03em; }
.in-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: rgba(255, 255, 255, .08); }
.in-bar i { display: block; height: 100%; background: var(--accent); transform-origin: left; transform: scaleX(0); }
#intro-skip { all: unset; pointer-events: auto; cursor: pointer; position: absolute; right: max(24px, 4vw); bottom: calc(5vh + 22px); display: flex; align-items: center; gap: 8px; padding: 9px 16px; border: 1px solid rgba(238, 241, 244, .35); border-radius: 999px; background: rgba(10, 11, 12, .55); backdrop-filter: blur(6px); color: #eef1f4; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
#intro-skip:hover, #intro-skip:focus-visible { border-color: var(--accent); color: #fff; }
#intro-skip span { font-size: 15px; line-height: 1; color: var(--accent); }
@media (max-width: 700px) { .in-cap { bottom: calc(5vh + 70px); } #intro-skip { bottom: calc(5vh + 16px); } }

/* ── make a trailer ── */
#trailer { position: fixed; inset: 0; z-index: 30; display: grid; place-items: center; padding: 20px; background: color-mix(in srgb, var(--bg) 72%, transparent); backdrop-filter: blur(6px); }
#trailer[hidden] { display: none; }
.tr-card { width: min(880px, 100%); }
.tr-body { display: grid; grid-template-columns: 1.15fr 1fr; gap: 18px; margin-top: 10px; }
.tr-card h3 { margin: 12px 0 6px; font-size: 10px; font-weight: 400; letter-spacing: .16em; text-transform: uppercase; color: var(--dim); }
.tr-card h3 small { letter-spacing: .04em; text-transform: none; color: var(--faint); margin-left: 6px; }
.tr-card input { all: unset; flex: 1; min-width: 0; padding: 5px 9px; border: 1px solid var(--line-hi); border-radius: 7px; background: var(--bg); color: var(--ink-hi); font-size: 12px; }
.tr-card input:focus { border-color: var(--accent); }
.tr-list { list-style: none; margin: 0; padding: 0; max-height: 330px; overflow: auto; display: flex; flex-direction: column; gap: 3px; scrollbar-width: thin; }
.tr-list li { display: flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 8px; padding: 2px 4px 2px 2px; }
.tr-list li.on { border-color: var(--line-hi); background: color-mix(in srgb, var(--bg) 60%, transparent); }
.tr-tick { all: unset; cursor: pointer; flex: 1; min-width: 0; display: flex; align-items: center; gap: 9px; padding: 5px 6px; border-radius: 6px; }
.tr-tick i { width: 12px; height: 12px; border-radius: 3px; border: 1px solid var(--line-hi); flex: none; box-sizing: border-box; }
.tr-tick[aria-checked="true"] i { background: var(--accent); border-color: var(--accent); }
.tr-tick span { display: flex; flex-direction: column; min-width: 0; }
.tr-tick b { font-size: 11.5px; font-weight: 500; color: var(--ink); }
.tr-tick b small { color: var(--faint); font-weight: 400; }
.tr-tick em { font-style: normal; font-size: 10px; color: var(--faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tr-list li.on .tr-tick b { color: var(--ink-hi); }
.tr-tick:focus-visible { outline: 1px solid var(--accent); }
.tr-move { display: flex; gap: 2px; }
.tr-move button { all: unset; cursor: pointer; width: 22px; height: 22px; display: grid; place-items: center; border-radius: 5px; color: var(--dim); font-size: 12px; }
.tr-move button:hover:not(:disabled) { color: var(--ink-hi); background: var(--bg); }
.tr-move button:disabled { opacity: .25; cursor: default; }
.tr-right .nc-row { margin-bottom: 8px; }
.rec-trailer { all: unset; cursor: pointer; display: flex; align-items: center; gap: 10px; margin: 8px 0 10px; padding: 8px 10px; border: 1px solid var(--accent); border-radius: 9px; }
.rec-trailer svg { width: 18px; height: 18px; color: var(--accent); flex: none; }
.rec-trailer span { display: flex; flex-direction: column; gap: 1px; }
.rec-trailer b { font-size: 11px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-hi); }
.rec-trailer small { font-size: 10px; color: var(--dim); }
.rec-trailer:hover { background: var(--bg); }
@media (max-width: 760px) { .tr-body { grid-template-columns: 1fr; } .tr-list { max-height: 220px; } }
