/* Money Making Analysis Tool
   Neutral surfaces, hairline edges, one accent. Colour is kept for meaning: the accent marks
   what is chosen or ready, green and red mark results. IBM Plex Sans for the interface,
   Handjet only for what a robot displays. */

@font-face { font-family: Plex; src: url(../fonts/plex.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }
@font-face { font-family: Handjet; src: url(../fonts/handjet.woff2) format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --bg: #eef0f2; --panel: #ffffff; --panel-2: #f3f5f7; --line: #d5dae0; --ink: #14181d; --soft: #55606b;
  --accent: #1c4587; --on-accent: #ffffff; --tint: #dfe7f3; --won: #1a7340; --lost: #b3261e; --on-result: #ffffff;
  --mark: #6f8fb8; --engrave: #8fa3ba; --engrave-hi: #1c4587; --core: #c3cfdc; --core-line: #9fb0c3;
  --shell: #fbfcfd; --shade: #d3dbe3; --gleam: #ffffff; --metal: #7d8b99; --dk: #2c353f; --dk-line: #56626f;
  --screen: #1a2026; --led: #dce6ef; --led-on: #8db6f2; --led-won: #7fd6a2; --led-lost: #f59a90;
}
:root { color-scheme: light; --edge: 20px; --left: max(var(--edge), env(safe-area-inset-left, 0px)); --right: max(var(--edge), env(safe-area-inset-right, 0px)); --r: 10px; --r2: 7px; }

*, *::before, *::after { box-sizing: border-box; min-width: 0; }
[hidden] { display: none !important; }
html { scrollbar-color: var(--line) transparent; -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 15px/1.5 Plex, "Segoe UI", system-ui, sans-serif; overflow-x: clip; min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; }
h1, h2, h3, p, ol, ul, dl, dd, fieldset { margin: 0; padding: 0; border: 0; }
ol, ul { list-style: none; }
h1 { font-size: 28px; font-weight: 600; line-height: 1.15; letter-spacing: -.015em; text-wrap: balance; }
h2 { font-size: 15px; font-weight: 600; line-height: 1.3; }
button, input { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
button, label, .nav a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: not-allowed; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
main:focus { outline: 0; }
.vh, .seg input { position: absolute; opacity: 0; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--bg); padding: 8px 14px; border-radius: var(--r2); z-index: 20; }
.skip:focus { left: 16px; }

/* Header */
.top { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 24px; padding: env(safe-area-inset-top, 0px) var(--right) 0 var(--left); min-height: 60px; background: var(--panel); border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; font-weight: 600; font-size: 17px; line-height: 1.15; letter-spacing: -.01em; border-radius: var(--r2); }
.brand svg { width: 38px; height: 35px; display: block; }
.nav { display: flex; align-self: stretch; gap: 4px; margin-left: 8px; }
.nav a { display: flex; align-items: center; text-decoration: none; padding: 0 14px; color: var(--soft); font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; border-top: 2px solid transparent; }
@media (hover: hover) { .nav a:hover { color: var(--ink); } }
.nav a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.conn { display: flex; align-items: center; gap: 8px; font-weight: 500; white-space: nowrap; font-size: 14px; }
.conn i { width: 8px; height: 8px; border-radius: 50%; background: var(--soft); }
.conn[data-state="live"] i { background: var(--won); }
.conn[data-state="offline"] i, .conn[data-state="reconnecting"] i { background: var(--lost); }

/* Shared pieces */
main { flex: 1; padding: 0 var(--right) 20px var(--left); }
.panel, .rail, .brain, .card, .tile { background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); }
.panel { padding: 16px; }
.btn { background: var(--accent); color: var(--on-accent); font-weight: 600; padding: 9px 16px; border-radius: var(--r2); min-height: 42px; text-align: center; white-space: nowrap; border: 1px solid var(--accent); }
@media (hover: hover) { .btn:hover:not(:disabled) { filter: brightness(1.12); } }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { background: var(--panel-2); color: var(--soft); border-color: var(--line); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
@media (hover: hover) { .btn.ghost:hover:not(:disabled) { background: var(--panel-2); filter: none; } }
.btn.ghost:disabled { color: var(--soft); opacity: .65; }
.btn.danger { background: var(--lost); color: var(--on-result); border-color: var(--lost); }
.note { color: var(--soft); font-size: 13.5px; max-width: 80ch; }
.empty, .muted { color: var(--soft); }
.acts { display: flex; gap: 8px; flex-wrap: wrap; }
.seg { display: inline-flex; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r2); padding: 2px; position: relative; }
.seg label { cursor: pointer; }
.seg span { display: block; padding: 6px 12px; border-radius: 5px; color: var(--soft); font-weight: 500; text-align: center; white-space: nowrap; border: 1px solid transparent; }
@media (hover: hover) { .seg label:hover span { color: var(--ink); } }
.seg input:checked + span { background: var(--panel); color: var(--ink); border-color: var(--line); font-weight: 600; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg input:disabled + span { cursor: not-allowed; opacity: .6; }
.tblWrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-variant-numeric: tabular-nums; }
th { font-weight: 500; color: var(--soft); text-align: left; }

/* Analyzer layout */
.console { display: grid; grid-template-columns: 252px minmax(0, 1fr) 356px; gap: 14px; align-items: stretch; }
.rail { display: flex; flex-direction: column; overflow: hidden; contain: size; min-height: 640px; }
.rail h2 { padding: 14px 16px 4px; }
.railList { overflow-y: auto; padding: 0 8px 8px; scrollbar-width: thin; }
.railList h3 { padding: 9px 8px 5px; font-size: 13px; font-weight: 500; color: var(--soft); display: flex; justify-content: space-between; }
.railList h3 small { font-size: 13px; font-weight: 400; }
.unitBtn { display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 10px; width: 100%; padding: 4px 8px; border-radius: var(--r2); border: 1px solid transparent; }
@media (hover: hover) { .unitBtn:hover { background: var(--panel-2); } }
.unitBtn.on { background: var(--tint); }
.unitBtn.reading { border-color: var(--accent); }
.unitBtn.best::after { content: "Best"; background: var(--accent); color: var(--on-accent); font-size: 12.5px; font-weight: 600; padding: 1px 8px; border-radius: 4px; }
.unitBtn .unit { width: 44px; height: 40px; }
.un { display: grid; line-height: 1.25; }
.un b { font-weight: 500; white-space: nowrap; font-size: 14.5px; }
.unitBtn.on b { font-weight: 600; }
.un small { font-size: 13px; color: var(--soft); font-variant-numeric: tabular-nums; }

.stage { display: flex; flex-direction: column; gap: 10px; }
.stageTop { display: flex; align-items: center; justify-content: space-between; gap: 8px 16px; flex-wrap: wrap; }
.mkt { display: flex; align-items: center; gap: 4px 16px; flex-wrap: wrap; }
.price { font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; line-height: 1; white-space: nowrap; }
.price b { display: inline-block; font-weight: 600; background: var(--ink); color: var(--bg); padding: 4px 7px; border-radius: 5px; margin-left: 2px; }
.price b:empty { display: none; }
.windows { align-items: center; background: var(--panel); }
.windows legend { float: left; padding: 0 6px 0 12px; color: var(--soft); font-size: 14px; white-space: nowrap; line-height: 36px; }
.windows label span { padding: 5px 9px; font-variant-numeric: tabular-nums; }
.windows input:checked + span { background: var(--tint); border-color: transparent; }
.tape { display: grid; grid-template-columns: repeat(24, minmax(0, 1fr)); background: var(--panel); border: 1px solid var(--line); border-radius: var(--r2); padding: 4px; gap: 2px; font-weight: 500; text-align: center; font-variant-numeric: tabular-nums; }
.tape li { height: 28px; line-height: 28px; border-radius: 4px; }
.tape li.hit { background: var(--tint); color: var(--accent); font-weight: 600; }
.tape li.now { background: var(--ink); color: var(--bg); font-weight: 600; }
.tape li.now.hit { background: var(--accent); color: var(--on-accent); }

.dialWrap { position: relative; display: grid; justify-items: center; gap: 2px; flex: 1; align-content: center; }
.dial { position: relative; width: min(calc(100% - 120px), clamp(330px, calc(100vh - 372px), 640px)); aspect-ratio: 1; container-type: inline-size; }
.dial canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.core { position: absolute; inset: 24.5%; border-radius: 50%; background: var(--core); overflow: hidden; box-shadow: inset 0 0 0 1px var(--core-line); }
.core svg { position: absolute; left: 5%; top: 1%; width: 90%; height: 99%; }
.node { --r: 43.6cqw; position: absolute; left: 50%; top: 50%; width: 12.4%; aspect-ratio: 1; margin: -6.2% 0 0 -6.2%; border-radius: 50%; background: var(--panel); display: grid; place-content: center; text-align: center; line-height: 1; gap: 3px; transform: rotate(var(--a)) translateY(calc(var(--r) * -1)) rotate(calc(var(--a) * -1)); box-shadow: inset 0 0 0 1px var(--line); }
.node b { font-weight: 600; font-size: clamp(16px, 4.1cqw, 22px); line-height: .9; }
.node small { font-size: clamp(12px, 2.4cqw, 13px); color: var(--soft); font-variant-numeric: tabular-nums; }
@media (hover: hover) { .node:hover { background: var(--panel-2); } }
.node.most { box-shadow: inset 0 0 0 2.5px var(--ink); }
.node.least { box-shadow: none; outline: 1.5px dashed var(--soft); outline-offset: -2px; }
.node.now { background: var(--ink); color: var(--bg); }
.node.now small { color: var(--bg); opacity: .8; }
.node.picked { background: var(--accent); color: var(--on-accent); }
.node.picked small { color: var(--on-accent); opacity: .85; }
.node.now.picked { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); }
.node:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.dialKey { display: flex; gap: 4px 18px; flex-wrap: wrap; justify-content: center; font-size: 13.5px; color: var(--soft); }
.dialKey span::before { content: ""; display: inline-block; width: 11px; height: 11px; border-radius: 50%; margin-right: 7px; vertical-align: -1px; }
.kMost::before { box-shadow: inset 0 0 0 2.5px var(--ink); }
.kLeast::before { border: 1.5px dashed var(--soft); }
.kNow::before { background: var(--ink); }
.dialKey .kEven::before { border-radius: 0; width: 18px; height: 0; border-top: 2px dotted var(--ink); vertical-align: 4px; }

.hud { position: absolute; inset: 6px max(0px, (100% - 960px) / 2) 34px; pointer-events: none; }
.hud div { position: absolute; width: 148px; line-height: 1.25; }
.hud div:nth-child(1) { left: 0; top: 0; }
.hud div:nth-child(2) { right: 0; top: 0; text-align: right; }
.hud div:nth-child(3) { left: 0; bottom: 0; }
.hud div:nth-child(4) { right: 0; bottom: 0; text-align: right; }
.hud dt, .hud .s { color: var(--soft); font-size: 13.5px; }
.hud dd:not(.s) { font-weight: 600; font-size: 28px; line-height: 1.2; }
.hud dd#hSpread { font-size: 18px; line-height: 1.4; }
.hud dd.on { color: var(--accent); }

.brain { padding: 12px 14px 14px; display: grid; gap: 10px; }
.speech { font-size: 16px; line-height: 1.4; min-height: 45px; display: flex; align-items: center; text-wrap: pretty; }
.steps { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); }
.steps li { display: grid; align-content: start; padding: 2px 12px; min-height: 70px; line-height: 1.3; position: relative; border-left: 1px solid var(--line); }
.steps li:first-child { border-left: 0; padding-left: 0; }
.steps span, .steps small { font-size: 13px; color: var(--soft); }
.steps b { font-weight: 600; font-size: 16px; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.steps .busy b { color: var(--accent); }
.steps .hot b, .steps .hot small { color: var(--won); }

/* Analysis column */
.side { display: grid; gap: 14px; grid-template-rows: auto 1fr; }
.run { display: grid; gap: 10px; }
.kind { display: grid; grid-template-columns: repeat(3, 1fr); }
.kind span { padding: 8px; }
.go { width: 100%; min-height: 52px; font-size: 17px; }
.resultP { display: grid; gap: 10px; align-content: start; scroll-margin-top: 10px; }
.result { display: grid; gap: 10px; align-content: start; justify-items: stretch; }
.result .lead { font-weight: 600; font-size: 18px; line-height: 1.3; letter-spacing: -.01em; }
.prog { height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.prog i { display: block; height: 100%; width: var(--w, 0); background: var(--accent); transition: width .12s linear; }
.sampleTag { background: var(--panel-2); border: 1px dashed var(--soft); border-radius: var(--r2); padding: 7px 11px; font-size: 13.5px; font-weight: 500; }
.verdict { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.bigDigit { display: grid; place-items: center; width: 56px; height: 56px; border-radius: var(--r); background: var(--accent); color: var(--on-accent); font-weight: 600; font-size: 34px; line-height: 1; }
.verdict div { display: grid; line-height: 1.25; }
.verdict b { font-weight: 600; font-size: 20px; letter-spacing: -.01em; }
.verdict small { font-size: 16px; color: var(--soft); }
.state { padding: 8px 14px; border-radius: var(--r2); background: var(--panel-2); border: 1px solid var(--line); font-weight: 500; text-align: center; }
.state.now { background: var(--won); border-color: var(--won); color: var(--on-result); font-weight: 600; }
.state.over { color: var(--lost); }
.setupRows div { display: grid; grid-template-columns: auto 1fr; gap: 12px; padding: 5px 0; border-top: 1px solid var(--line); }
.setupRows.blank dd { color: var(--soft); }
.setupRows div:first-child { border-top: 0; padding-top: 0; }
.setupRows dt { color: var(--soft); }
.setupRows dd { font-weight: 500; text-align: right; overflow-wrap: break-word; }
.setupRows dt { white-space: nowrap; }
.setupRows .key dd { font-weight: 600; color: var(--accent); }
.result .acts .btn { flex: 1 1 auto; min-width: max-content; }
.next { font-size: 13.5px; font-weight: 500; color: var(--soft); border-top: 1px solid var(--line); padding-top: 10px; }
.others { display: grid; gap: 4px; margin-top: -6px; }
.others button { display: flex; justify-content: space-between; gap: 10px; width: 100%; padding: 7px 8px; border-radius: var(--r2); }
@media (hover: hover) { .others button:hover { background: var(--panel-2); } }
.others b { font-weight: 500; }
.others span { color: var(--soft); }

/* Other views */
.head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 20px; flex-wrap: wrap; padding: 6px 0 16px; }
.head p { color: var(--soft); margin-top: 4px; max-width: 70ch; }
.squad { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 14px; }
.card { padding: 14px; display: grid; grid-template-columns: 72px 1fr; gap: 10px 12px; align-items: center; }
@media (hover: hover) { .card:hover { border-color: var(--soft); } }
.card .unit { width: 72px; height: 66px; }
.card.scan { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.cn { display: grid; line-height: 1.3; }
.cn b { font-weight: 600; font-size: 15.5px; }
.cn small { font-size: 14px; color: var(--soft); font-variant-numeric: tabular-nums; }
.cs { grid-column: 1 / -1; display: grid; font-size: 14px; }
.cs span { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; border-top: 1px solid var(--line); }
.cs i { font-style: normal; color: var(--soft); }
.cs b { font-weight: 500; font-variant-numeric: tabular-nums; }
.cv { grid-column: 1 / -1; background: var(--panel-2); border-radius: var(--r2); padding: 5px 10px; font-size: 13.5px; color: var(--soft); text-align: center; }
.cv[data-level="normal"] { color: var(--ink); }
.cv[data-level="mild"] { background: var(--tint); color: var(--ink); font-weight: 500; }
.cv[data-level="odd"] { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.filters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.filters .seg { background: var(--panel); }
.filters .seg input:checked + span { background: var(--tint); border-color: transparent; }
.tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.tile { padding: 14px 16px; display: grid; gap: 2px; align-content: start; }
.tile span, .tile small { color: var(--soft); font-size: 14px; }
.tile b { font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: -.015em; }
td.won, .tile .pos { color: var(--won); }
td.lost, .tile .neg { color: var(--lost); }
#v-record .panel { display: grid; gap: 12px; margin-bottom: 12px; justify-items: start; }
#v-record .tblWrap, .chart { width: 100%; }
.chart { position: relative; min-height: 24px; }
.chart svg { display: block; touch-action: pan-y; }
.chart text { fill: var(--soft); font-size: 13.5px; font-variant-numeric: tabular-nums; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .zero { stroke: var(--soft); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--mark); stroke-width: 2; stroke-linejoin: round; }
.chart .end, .chart .hov circle { fill: var(--accent); stroke: var(--panel); stroke-width: 2; }
.chart .hov line { stroke: var(--soft); }
.tip { position: absolute; background: var(--ink); color: var(--bg); padding: 6px 10px; border-radius: var(--r2); display: grid; font-size: 13.5px; pointer-events: none; white-space: nowrap; }
.log th, .log td { padding: 8px 10px; white-space: nowrap; }
.log thead th { font-size: 13.5px; }
.log tbody tr { border-top: 1px solid var(--line); }
.log .r { text-align: right; }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 8px; background: var(--accent); }
.dot.d { background: none; box-shadow: inset 0 0 0 2px var(--accent); }
.foot { padding: 14px var(--right) 20px var(--left); color: var(--soft); font-size: 13.5px; }
.ask { background: var(--panel); color: var(--ink); border: 1px solid var(--line); border-radius: var(--r); padding: 22px; max-width: min(420px, calc(100vw - 32px)); }
.ask::backdrop { background: rgb(8 12 18 / .6); }
.ask form { display: grid; gap: 18px; }
.ask .acts { justify-content: flex-end; }
.noscript { padding: 20px; text-align: center; }

/* Robots */
.robot { --glow: var(--led); overflow: visible; }
.robot .sh { fill: var(--shell); }
.robot .sd { fill: var(--shade); }
.robot .lt { fill: none; stroke: var(--gleam); stroke-width: 5; stroke-linecap: round; }
.robot .dk { fill: var(--dk); }
.robot .ear { fill: var(--metal); }
.robot .ln { stroke: var(--dk-line); stroke-width: 3; fill: none; stroke-linecap: round; }
.robot .sm { stroke: var(--shade); stroke-width: 2.5; fill: none; }
.robot .vent path { stroke: var(--shade); stroke-width: 4; stroke-linecap: round; }
.robot .bolt { fill: var(--shade); }
.robot .scr { fill: var(--screen); }
.robot .gl { fill: #fff; opacity: .05; }
.robot .stem { stroke: var(--metal); stroke-width: 6; stroke-linecap: round; fill: none; }
.robot .bulb { fill: var(--bulb, var(--metal)); }
.robot .halo { fill: var(--bulb, transparent); opacity: 0; }
.robot .spk { fill: #fff; opacity: .6; }
.robot .chest { fill: var(--glow); font: 600 60px/1 Handjet, monospace; }
.robot .eyes { fill: var(--glow); display: none; }
.robot .e-happy, .robot .e-sad, .robot .e-flat { fill: none; stroke: var(--glow); stroke-width: 9; stroke-linecap: round; }
.robot .e-sad path:first-child { stroke-width: 7; }
.robot .e-sad path:last-child { stroke-width: 17; }
.robot .mb { fill: var(--glow); opacity: .85; transform-box: fill-box; transform-origin: center; }
.robot .sweep { fill: var(--glow); display: none; }
.robot .look { transition: transform .22s cubic-bezier(.2, .9, .3, 1.2); }
.robot[data-mood="watching"] .e-open, .robot[data-mood="waiting"] .e-open, .robot[data-mood="go"] .e-open { display: block; }
.robot[data-mood="waking"] .e-flat, .robot[data-mood="offline"] .e-flat { display: block; }
.robot[data-mood="won"] .e-happy { display: block; }
.robot[data-mood="lost"] .e-sad { display: block; }
.robot[data-mood="scanning"] .sweep { display: block; animation: sweep 1.1s ease-in-out infinite alternate; }
.robot[data-mood="watching"], .robot[data-mood="scanning"] { --bulb: var(--accent); }
.robot[data-mood="waiting"] { --glow: var(--led-on); --bulb: var(--led-on); }
.robot[data-mood="go"], .robot[data-mood="won"] { --glow: var(--led-won); --bulb: var(--led-won); }
.robot[data-mood="lost"], .robot[data-mood="offline"] { --glow: var(--led-lost); --bulb: var(--led-lost); }
.robot.lead[data-mood="watching"] .e-open rect, .robot.lead[data-mood="waiting"] .e-open rect { transform-box: fill-box; transform-origin: center; animation: blink 5.4s infinite; }
.robot.talk .mb { animation: talk .34s ease-in-out infinite alternate; animation-delay: calc(var(--i, 0) * -90ms); }
.robot .mb:nth-child(2) { --i: 1; }
.robot .mb:nth-child(3) { --i: 2; }
.robot .mb:nth-child(4) { --i: 3; }
.robot .mb:nth-child(5) { --i: 4; }
.robot .mb:nth-child(6) { --i: 5; }
.robot .mb:nth-child(7) { --i: 6; }
.robot[data-mood="scanning"] .halo, .robot[data-mood="go"] .halo { animation: pulse .9s ease-in-out infinite alternate; }
.robot.unit .ud { text-rendering: geometricPrecision; fill: var(--led); font: 600 34px/1 Handjet, monospace; }
.robot.unit .stem, .robot.mark .stem { stroke-width: 3; }
.robot.unit .sh, .robot.mark .sh { stroke: var(--shade); stroke-width: 2; }
.robot.mark .eye { fill: var(--led); }
.robot.mark .bulb { fill: var(--accent); }
.g-vol1 .unit { --shell: #cfd9e4; --shade: #a3b3c5; }
.g-jump .unit { --shell: #d9d2c8; --shade: #b5aa9b; }
.g-daily .unit { --shell: #b9c1c9; --shade: #8e98a3; }
.off .unit { opacity: .45; }
@keyframes blink { 0%, 94%, 100% { transform: none; } 97% { transform: scaleY(.08); } }
@keyframes talk { to { transform: scaleY(2.3); } }
@keyframes pulse { to { opacity: .35; } }
@keyframes sweep { to { transform: translateX(114px); } }

/* A small dial needs larger buttons to hold a percentage */
@container (max-width: 330px) {
  .node { --r: 42.2cqw; width: 17%; margin: -8.5% 0 0 -8.5%; gap: 1px; }
  .node small { font-size: 11.5px; letter-spacing: -.02em; }
}

/* Narrower screens */
@media (max-width: 1500px) {
  .windows legend { position: absolute; opacity: 0; width: 1px; overflow: hidden; }
}
@media (max-width: 1240px) {
  .console { grid-template-columns: minmax(0, 1fr) 330px; }
  .rail { grid-column: 1 / -1; contain: none; min-height: 0; }
  .rail h2 { display: none; }
  .mkt, .windows { width: 100%; }
  .mkt { justify-content: space-between; }
  .windows label { flex: 1; }
  .windows label span { padding-inline: 2px; }
  .railList { display: flex; gap: 4px; overflow-x: auto; overscroll-behavior-x: contain; padding: 6px; }
  .railList h3 { display: none; }
  .unitBtn { flex: none; width: auto; padding-right: 12px; }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); row-gap: 10px; }
  .steps li:nth-child(4) { border-left: 0; padding-left: 0; }
  .squad { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .squad, .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tile:last-child { grid-column: 1 / -1; }
  .dialWrap { align-content: start; }
  .dial { width: min(100%, 520px); }
  .hud { position: static; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; width: 100%; order: 3; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 16px; margin-top: 10px; }
  .hud div, .hud div:nth-child(2), .hud div:nth-child(4) { position: static; width: auto; text-align: left; }
  .hud dd:not(.s) { font-size: 25px; }
  .bname span { display: block; }
  .nav a { padding: 0 9px; }
  .top { gap: 14px; }
}

/* Phones held upright, and small tablets: one column, Analyze before the dial, sections in a bar at the bottom */
@media (max-width: 800px) {
  :root { --edge: 14px; --left: max(14px, env(safe-area-inset-left, 0px)); --right: max(14px, env(safe-area-inset-right, 0px)); }
  body { padding-bottom: calc(58px + env(safe-area-inset-bottom, 0px)); }
  .console { display: flex; flex-direction: column; gap: 12px; }
  .stage, .side { display: contents; }
  .stageTop { order: 1; }
  .run { order: 2; padding: 10px; }
  .run h2, .run .note { display: none; }
  .tape { order: 3; }
  .dialWrap { order: 4; flex: none; }
  .resultP { order: 5; }
  .brain { order: 6; }
  .top { grid-template-columns: 1fr auto; min-height: 54px; margin-bottom: 12px; gap: 10px; }
  .brand { font-size: 15.5px; gap: 9px; }
  .brand svg { width: 34px; height: 31px; }
  .nav { position: fixed; inset: auto 0 0; z-index: 10; background: var(--panel); border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin: 0; padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px); }
  .nav a { justify-content: center; min-height: 57px; padding: 0 2px; border-bottom: 0; border-top: 2px solid transparent; }
  .nav a[aria-current] { border-top-color: var(--accent); }
  .tape { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .tape li:nth-child(-n+12) { display: none; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps li, .steps li:nth-child(4) { border-left: 1px solid var(--line); padding-left: 12px; }
  .steps li:nth-child(odd) { border-left: 0; padding-left: 0; }
  .unitBtn { grid-template-columns: 38px auto auto; gap: 8px; }
  .unitBtn .unit { width: 38px; height: 35px; }
  .speech { min-height: 66px; align-items: flex-start; }
  .foot { padding-bottom: 14px; }
}
@media (max-width: 560px) {
  h1 { font-size: 25px; }
  .price { font-size: 21px; }
  .node { --r: 42.6cqw; width: 15.4%; margin: -7.7% 0 0 -7.7%; }
  .squad { gap: 8px; }
  .card { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; padding: 12px 10px; gap: 8px; }
  .cs, .cv { width: 100%; }
  .head .btn { flex: 1; }
  .head .acts { width: 100%; }
  .filters .seg { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
  .tiles { gap: 8px; }
  .tile { padding: 12px 14px; }
  .tile b { font-size: 24px; }
  .verdict b { font-size: 18.5px; }
  .chartP, #v-record .panel { padding: 14px; }
  .ask .acts .btn { flex: 1; }

  /* The entry table becomes a list: market and result on the first line, the rest under it */
  .log, .log tbody { display: block; }
  .log thead { display: none; }
  .log tbody tr { display: grid; grid-template-columns: 1fr auto; gap: 1px 12px; padding: 10px 0; }
  .log tbody tr:first-child { border-top: 0; padding-top: 0; }
  .log td { padding: 0; white-space: normal; }
  .log td:nth-child(2) { order: 1; font-weight: 500; }
  .log td:nth-child(5) { order: 2; text-align: right; }
  .log td:nth-child(3) { order: 3; }
  .log td:nth-child(6) { order: 4; font-weight: 500; }
  .log td:nth-child(1) { order: 5; color: var(--soft); font-size: 13.5px; }
  .log td:nth-child(4) { order: 6; color: var(--soft); font-size: 13.5px; text-align: right; }
  .log td:nth-child(4)::after { content: attr(data-u); }
}

/* Phones on their side: the screen is too short for a bottom bar, so controls go left and the dial right */
@media (max-height: 500px) and (min-width: 560px) and (max-width: 1000px) {
  body { padding-bottom: env(safe-area-inset-bottom, 0px); }
  .top { grid-template-columns: auto 1fr auto; min-height: 46px; margin-bottom: 8px; }
  .brand { font-size: 14px; }
  .nav { position: static; display: flex; background: none; border: 0; padding: 0; justify-content: center; }
  .nav a { min-height: 44px; padding: 0 10px; border-top: 2px solid transparent; border-bottom: 2px solid transparent; }
  .nav a[aria-current] { border-top-color: transparent; border-bottom-color: var(--accent); }
  .console { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: auto auto auto auto auto 1fr; grid-template-areas: "rail rail" "run dial" "res dial" "top dial" "tape dial" "brain dial"; gap: 8px 12px; align-items: start; }
  .stage, .side { display: contents; }
  .rail { grid-area: rail; }
  .railList { padding: 2px; }
  .unitBtn { padding-block: 2px; }
  .run { grid-area: run; padding: 8px; gap: 8px; }
  .run h2, .run .note { display: none; }
  .go { min-height: 46px; }
  .resultP { grid-area: res; }
  .stageTop { grid-area: top; }
  .tape { grid-area: tape; grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .tape li:nth-child(-n+12) { display: none; }
  .dialWrap { grid-area: dial; }
  .dial { width: min(100%, calc(100svh - 20px)); }
  .node { --r: 42.6cqw; width: 15.4%; margin: -7.7% 0 0 -7.7%; }
  .brain { grid-area: brain; }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps li, .steps li:nth-child(4) { border-left: 1px solid var(--line); padding-left: 12px; }
  .steps li:nth-child(odd) { border-left: 0; padding-left: 0; }
}

/* Fingers need more room than a mouse */
@media (pointer: coarse) {
  .seg span { min-height: 44px; display: grid; place-content: center; }
  .seg label { min-width: 46px; }
  .btn { min-height: 46px; }
  .unitBtn { min-height: 48px; }
  .others button { min-height: 46px; align-items: center; }
  .brand { min-height: 44px; }
  .nav a { min-width: 44px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
