/* Shared by the judges' pages. Units 7.7 to 7.9 give them one look, copied from the mockups in
   docs/design/. Normal states are grey; orange and red appear only when a tier is crossed;
   blue is live data. */
:root {
  --bg: #E4E7EA;
  --panel: #F4F5F6;
  --panel-line: #C9CED3;
  --card: #FFFFFF;
  --card-line: #8C959D;
  --line: #7D868E;
  --ink: #1C2126;
  --ink2: #59626A;      /* secondary text */
  --ink3: #3E464D;      /* body text inside panels, step badges */
  --zone: #E6E9EC;      /* a grey zone, an empty bar track, a neutral chip */
  --rule: #DDE1E4;      /* hairlines inside cards */
  --bar: #22282D;
  --bar-text: #E9ECEE;
  --bar-muted: #A9B1B8;
  --bar-accent: #8FB0FF;
  --blue: #2756C5;
  --blue-text: #1E46A3;
  --blue-tint: #DDE6FA;
  --orange: #D8632C;
  --orange-text: #A9461A;
  --orange-deep: #8F3A14; /* orange text on the orange tint */
  --orange-tint: #FBE3D6;
  --orange-tint2: #F6C7AE;
  --red: #B8322A;
  --red-text: #9A2A23;
  --red-tint: #F7DAD7;
  --sans: "Barlow", system-ui, sans-serif;
  --cond: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); font-variant-numeric: tabular-nums; }
a { color: var(--blue-text); }
a:hover { color: #132F73; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
[hidden] { display: none !important; }

/* --- One screen: the top bar, then a page that fills the rest of the window. */
body.screen { height: 100vh; display: flex; flex-direction: column; }
.page { flex: 1; min-height: 0; width: 100%; max-width: 1400px; margin: 0 auto; padding: 16px 20px; display: flex; flex-direction: column; gap: 12px; }
.page h1, .page h2, .page h3, .page p { margin: 0; }
.page h1 { font: 500 26px/32px var(--cond); }
.page h2 { font: 500 19px/24px var(--cond); }
.page h3 { font-size: 17px; line-height: 24px; font-weight: 600; }
.note { font-size: 14px; line-height: 20px; color: var(--ink3); }
.fine { font-size: 12px; line-height: 16px; color: var(--ink2); }
.titled { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 8px; }

/* --- The top bar: name, tabs, status. */
.bar { flex: none; background: var(--bar); color: var(--bar-text); }
.bar :focus-visible { outline-color: var(--bar-accent); }
.bar-in { max-width: 1400px; margin: 0 auto; padding: 0 20px; min-height: 48px; display: flex; flex-wrap: wrap; align-items: stretch; gap: 0 28px; }
.bar .brand { color: inherit; text-decoration: none; display: flex; align-items: center; gap: 10px; min-height: 48px; font: 600 17px var(--cond); }
.bar nav { display: flex; align-items: stretch; gap: 2px; }
.bar nav a { display: flex; align-items: center; padding: 0 14px; font-size: 15px; font-weight: 500; color: var(--bar-muted); text-decoration: none; border-bottom: 2px solid transparent; }
.bar nav a:hover { color: #FFFFFF; }
.bar nav a[aria-current] { color: #FFFFFF; border-bottom-color: var(--bar-accent); }
.bar .status { margin-left: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; padding: 4px 0; font-size: 13px; color: var(--bar-muted); }
.bar .dot { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--bar-accent); }
.bar .dot.off { background: #6E7881; }
.bar #bar-stream { min-height: 40px; padding: 0 12px; border: 1px solid #4A535B; border-radius: 6px; background: none; color: inherit; font: inherit; cursor: pointer; }
.bar #bar-stream:hover, .bar #bar-stream[aria-expanded="true"] { border-color: var(--bar-accent); background: rgba(255, 255, 255, 0.08); color: #FFFFFF; }
.howtext.over.streampanel { top: 54px; width: min(760px, calc(100vw - 40px)); max-height: calc(100vh - 70px); overflow-y: auto; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 20px; }
.howtext.over.streampanel[hidden] { display: none; }
.streampanel h2 { font: 600 17px var(--cond); }
.streampanel .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.streampanel ul { margin: 4px 0 0; padding-left: 18px; color: var(--ink3); }
.streampanel table { width: 100%; font-size: 13px; }
.streampanel td, .streampanel th { text-align: left; padding: 3px 8px 3px 0; vertical-align: top; }

/* --- Parts: panel, card, numbered step badge, chip, link button. */
.panel { padding: 12px 16px; display: flex; flex-direction: column; gap: 10px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 8px; min-width: 0; }
.panel.dashed { border: 1px dashed var(--line); }
.card { background: var(--card); border: 1px solid var(--card-line); border-radius: 6px; }
.card.soft { border-color: var(--panel-line); }
.card.orange { border: 1.5px solid var(--orange); }
.card.red { border: 1.5px solid var(--red); }
.badge { flex: none; width: 22px; height: 22px; border-radius: 11px; background: var(--ink3); color: #FFFFFF; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 600; }
.chip { padding: 2px 8px; border-radius: 4px; background: var(--zone); color: var(--ink); font-size: 13px; font-weight: 500; white-space: nowrap; }
.chip.line { background: none; border: 1px solid var(--card-line); padding: 1px 7px; }
.chip.blue { background: var(--blue-tint); color: var(--blue-text); }
.chip.orange { background: var(--orange-tint); color: var(--orange-deep); }
.chip.red { background: var(--red-tint); color: var(--red-text); }
.go { margin-top: auto; flex: none; min-height: 40px; display: flex; align-items: center; justify-content: center; border: 1px solid var(--card-line); border-radius: 6px; background: var(--card); font-size: 14px; font-weight: 500; text-decoration: none; color: var(--ink); }
.go:hover { background: var(--panel); color: var(--ink); border-color: var(--ink3); }
.go.none { border-style: dashed; background: none; font-weight: 400; color: var(--ink2); }

/* --- The 0–100 rule bar (drawn by ruleBar in demo.js) and the two-bar picture. */
.pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: start; }
.at { padding: 10px 12px; border-radius: 6px; background: var(--zone); }
.picture { display: flex; flex-direction: column; gap: 6px; }
.at b { display: block; font-size: 18px; line-height: 24px; font-weight: 600; }
.at span { display: block; font-size: 12px; line-height: 16px; color: var(--ink3); }
.at.blue { background: var(--blue-tint); }
.at.orange { background: var(--orange-tint); }
.at.red { background: var(--red-tint); }
.bars { display: grid; grid-template-columns: minmax(72px, max-content) minmax(0, 1fr) minmax(40px, max-content); white-space: nowrap; gap: 6px; align-items: center; font-size: 12px; line-height: 16px; }
.bars .track { display: block; height: 10px; background: var(--zone); border-radius: 2px; }
.bars .track i { display: block; height: 10px; border-radius: 2px; background: var(--card-line); }
.bars .track i.blue { background: var(--blue); }
.bars .track i.orange { background: var(--orange); }
.bars .track i.red { background: var(--red); }
.bars b { text-align: right; font-weight: 600; }

/* --- Event rows. The mark says what kind: diamond = warning, triangle = critical,
   filled circle = data, outline circle = info, square = an agent action. */
.events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.events li { display: grid; grid-template-columns: 40px 16px minmax(0, 1fr); gap: 10px; align-items: start; padding: 6px 8px; border-top: 1px solid var(--rule); font-size: 14px; line-height: 19px; }
.events li.new { background: #E6ECFB; }
.events time, .events .more { color: var(--ink2); }
.events svg { margin-top: 3px; }
.events b { font-weight: 600; }

/* --- An arrow between two panels. Blue dots run along it for about 2 s when a real event
   passes (runFlow in demo.js). */
.conn { flex: 0 0 36px; display: flex; align-items: center; justify-content: center; }
.conn svg { display: block; overflow: visible; }
.conn .flow { fill: none; stroke: var(--blue); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 0.1 12; opacity: 0; }
.conn.live .flow { opacity: 1; animation: dcflow 1.1s linear infinite; }
@keyframes dcflow { to { stroke-dashoffset: -12.1; } }
@media (prefers-reduced-motion: reduce) { .conn.live .flow { animation: none; } }

/* --- The home page (unit 7.7). Headings stand alone: no subtitle or helper line under them.
   Each card explains itself in one paragraph (.overview). */
.top-row { flex: none; display: flex; min-height: min(268px, 27.5vh); }
.prices { flex: 0 0 384px; }
.prices .between { white-space: nowrap; }
.prices .list { flex: 1; display: flex; flex-direction: column; gap: 10px; }
.price { flex: 1; padding: 10px 12px; display: flex; flex-direction: column; justify-content: center; gap: 6px; }
.price b { font-size: 15px; line-height: 20px; font-weight: 600; }
.price .quote { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 8px; align-items: end; font-size: 11px; line-height: 15px; color: var(--ink2); }
.price .quote span span { display: block; font-size: 15px; line-height: 20px; color: var(--ink); }
.price .quote .yes { font-size: 22px; line-height: 28px; font-weight: 500; color: var(--blue-text); }
.outputs { flex: 1 1 600px; }
.outs { flex: 1; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.out { padding: 10px 14px; display: grid; grid-template-columns: 188px minmax(0, 1fr); gap: 4px 14px; }
.out .words { display: flex; flex-direction: column; gap: 4px; }
.out .name { font-size: 15px; line-height: 20px; font-weight: 600; }
.out .value { font-size: 48px; line-height: 52px; font-weight: 300; }
.out .math { font-size: 13px; line-height: 18px; color: var(--ink3); }
.out.orange .value { color: var(--orange-text); }
.out.red .value { color: var(--red-text); }
.out .posted { margin-top: auto; }
/* The charts are 190 px tall, and the first thing to shrink when the window is short. */
.out .spark { display: block; width: 100%; height: clamp(120px, calc(100vh - 732px), 190px); font-family: inherit; }
.users { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.users > .titled { padding: 0 4px; }
.three { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr); gap: 12px; }
.tags { display: flex; gap: 6px; }
.rulebar { display: block; width: 100%; height: 50px; font-family: inherit; }
.three .pair { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); }
.three .pair.wide { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; }
.pair.wide .picture { padding-top: 6px; }
.overview { font-size: 15px; line-height: 22px; color: var(--ink); }
.settings { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; overflow-x: auto; }
.settings table { width: 100%; border-collapse: collapse; font-size: 13px; line-height: 18px; }
.settings th, .settings td { padding: 6px 10px; text-align: right; font-weight: 400; }
.settings th:first-child { text-align: left; }
.settings thead th { padding: 7px 10px; font-size: 12px; font-weight: 500; color: var(--ink2); border-bottom: 1px solid var(--rule); }
.settings tbody th { font-weight: 500; }
.settings tbody tr + tr > * { border-top: 1px solid #EEF0F2; }
.settings td.to { font-weight: 600; }
.settings td.to.orange { color: var(--orange-text); }
.settings td.to.red { color: var(--red-text); }
.foot { margin-top: auto; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; font-size: 13px; line-height: 18px; color: var(--ink2); }
.foot .go { margin: 0; padding: 0 16px; }
button.go { font-family: inherit; cursor: pointer; }
dialog.proposal button.go { width: 100%; }
dialog.proposal { width: min(760px, calc(100vw - 40px)); padding: 16px 20px; border: 1px solid var(--card-line); border-radius: 8px; background: var(--panel); color: var(--ink); }
dialog.proposal::backdrop { background: rgba(28, 33, 38, 0.45); }
dialog.proposal h3 { margin: 0; font-size: 17px; line-height: 24px; font-weight: 600; }
dialog.proposal pre { margin: 12px 0; padding: 12px 14px; background: var(--card); border: 1px solid var(--panel-line); border-radius: 6px; font: 13px/19px ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; }

/* Narrow windows scroll instead of squeezing. */
@media (max-width: 1199px) {
  body.screen { height: auto; }
  .conn { display: none; }
  .top-row { flex-wrap: wrap; gap: 12px; }
  .outs, .three { grid-template-columns: 1fr; }
}


/* --- The two demo pages (units 7.8 and 7.9): header with progress and button, a banner that
   follows the run, a tall row (chart beside a card) and a 236 px row (flow, events). */
.demo-head { flex: none; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; }
.demo-head .controls { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.progress { width: 240px; }
.progress .track { height: 6px; border-radius: 3px; background: var(--panel-line); }
.progress .track i { display: block; width: 0; height: 6px; border-radius: 3px; background: var(--blue); }
.progress .labels { display: flex; justify-content: space-between; margin-top: 6px; font-size: 13px; line-height: 16px; color: var(--ink2); }
.progress .labels b { color: var(--ink); font-weight: 500; }
/* The buttons, one set for every page: .primary (filled blue: the one thing to do here),
   .how (outlined: everything else) and .seg (a choice between a few). All at least 40px tall,
   and each label says what happens. */
.primary { min-height: 44px; padding: 0 18px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--blue); border-radius: 6px; background: var(--blue); color: #FFFFFF; font: 500 15px var(--sans); cursor: pointer; white-space: nowrap; }
.primary:hover:not(:disabled) { background: var(--blue-text); border-color: var(--blue-text); }
.primary:disabled { background: var(--card-line); border-color: var(--card-line); cursor: default; }
.banner { flex: none; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; min-height: 50px; padding: 12px 18px; background: var(--zone); border: 1px solid var(--panel-line); border-radius: 8px; }
.banner.blue { background: var(--blue-tint); border-color: #9DB4EA; }
.banner.orange { background: var(--orange-tint); border-color: #E9A988; }
.banner.red { background: #F7DEDB; border-color: #D98F88; }
.banner svg { flex: none; }
.banner b { font-size: 17px; line-height: 24px; font-weight: 600; }
.banner span { font-size: 15px; line-height: 22px; color: var(--ink3); }
.banner a { margin-left: auto; font-size: 15px; font-weight: 500; }
.banner svg.blink { animation: blink 0.5s steps(1) 3; }
@keyframes blink { 50% { opacity: 0.1; } }
.plot { flex: 1; min-height: 0; display: block; width: 100%; font-family: inherit; }
.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.steps li { display: grid; grid-template-columns: 22px minmax(0, 1fr); gap: 10px; align-items: start; padding: 8px 12px; background: var(--card); border: 1px solid var(--rule); border-radius: 6px; font-size: 14px; line-height: 20px; }
.steps .badge { font-size: 12px; }
.steps li.on { border: 1.5px solid var(--blue); padding: 7.5px 11.5px; }
.steps li.on .badge { background: var(--blue); }
.steps b, .result b { font-weight: 600; }
.result { padding: 10px 12px; background: var(--zone); border-radius: 6px; font-size: 14px; line-height: 20px; }
.result.blue { background: var(--blue-tint); }
.scroll { flex: 1; min-height: 0; overflow-y: auto; }
.events li.blue { background: #E6ECFB; }
.events li.red { background: #F9E3E0; }
.events li:last-child { border-bottom: 1px solid var(--rule); }
.tiers { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; overflow-x: auto; }
.tiers table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.tiers th, .tiers td { padding: 6px 12px; text-align: right; font-weight: 400; color: var(--ink2); }
.tiers th:first-child { text-align: left; }
.tiers thead th { padding: 7px 12px; font-size: 12px; font-weight: 500; border-bottom: 1px solid var(--rule); }
.tiers tbody tr + tr > * { border-top: 1px solid #EEF0F2; }
.tiers tr.now > * { font-weight: 600; color: var(--ink); background: var(--zone); }
.tiers tr.now.orange > * { color: var(--orange-deep); background: var(--orange-tint); }
.tiers tr.now.red > * { color: var(--red-text); background: var(--red-tint); }
@media (prefers-reduced-motion: reduce) { .banner svg.blink { animation: none; } }
.events li.empty { display: block; color: var(--ink2); }

/* --- Card shapes while a value is loading (unit 7.10): an empty part keeps its size and shows
   as a quiet block, so a card never has blank space or jumps when its numbers arrive. */
.at:empty, .bars:empty, .overview:empty, svg.rulebar:empty, .settings table:empty, .prices .list:empty, .outs:empty { background: var(--zone); border-radius: 6px; }
.at:empty { min-height: 76px; }
.bars:empty { min-height: 58px; }
.overview:empty { min-height: 132px; }
.settings table:empty { display: block; min-height: 96px; }
.prices .list:empty { min-height: 150px; }
.outs:empty { min-height: 190px; }

/* --- The workflow diagram and the side column of the two demo pages (units 7.16, 7.17). */
.wsteps { flex: 1; min-height: 0; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 8px 18px; }
.wsteps.five { grid-template-columns: repeat(5, minmax(0, 1fr)); flex: none; height: 152px; }
.wstep { position: relative; display: flex; flex-direction: column; gap: 3px; padding: 8px 10px; background: var(--card); border: 1px solid var(--panel-line); border-radius: 6px; font-size: 13px; line-height: 18px; transition: opacity 0.2s, border-color 0.2s; }
.wstep:not(:last-child)::after { content: ""; position: absolute; left: 100%; top: 50%; width: 18px; height: 12px; margin: -6px 0 0 1px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='12' viewBox='0 0 18 12' fill='none' stroke='%237D868E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 6H14M10 2L14.5 6L10 10'/%3E%3C/svg%3E") center no-repeat; }
.wsteps:not(.five) .wstep:nth-child(4)::after { display: none; }
.wstep .whead { display: flex; align-items: center; gap: 8px; }
.wstep .badge { flex: none; font-size: 12px; }
.wstep b { font-size: 14px; line-height: 18px; font-weight: 600; }
.wstep code { margin-top: auto; font: 500 12px/16px var(--sans); color: var(--ink2); overflow-wrap: anywhere; }
.wstep span:not(.badge) { color: var(--ink3); }
.wstep a { font-size: 12px; }
.wstep.off { opacity: 0.42; }
.wstep.on { border-color: var(--card-line); }
.wstep.now, .wstep.blue { border: 1.5px solid var(--blue); padding: 7.5px 9.5px; }
.wstep.now .badge, .wstep.blue .badge { background: var(--blue); }
.wstep.orange { border: 1.5px solid var(--orange); padding: 7.5px 9.5px; }
.wstep.orange span:not(.badge) { color: var(--orange-deep); font-weight: 500; }
.wstep.red { border: 1.5px solid var(--red); padding: 7.5px 9.5px; }
.wstep.red span:not(.badge) { color: var(--red-text); font-weight: 500; }
.ladder { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
.ladder div { position: relative; z-index: 0; overflow: hidden; display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; background: var(--zone); border-radius: 4px; font-size: 13px; line-height: 18px; color: var(--ink2); }
.ladder div::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: calc(var(--h) * 0.72); background: #D3D8DC; transition: background 0.3s; }
.ladder b { font: 400 26px/30px var(--sans); color: var(--ink3); }
.ladder b.words { font: 500 17px/22px var(--sans); }
.ladder div.now { outline: 1.5px solid var(--ink); outline-offset: -1.5px; color: var(--ink); } .ladder div.now b { color: var(--ink); font-weight: 500; }
.ladder div.now::before { background: #AEB6BD; }
.ladder div.now.orange { background: var(--orange-tint); outline-color: var(--orange); } .ladder div.now.orange b { color: var(--orange-deep); }
.ladder div.now.orange::before { background: var(--orange-tint2); }
.ladder div.now.red { background: var(--red-tint); outline-color: var(--red); } .ladder div.now.red b { color: var(--red-text); }
@media (prefers-reduced-motion: reduce) { .wstep { transition: none; } }
@media (max-width: 1100px) { .wsteps, .wsteps.five, .ladder { grid-template-columns: 1fr 1fr; } .wstep::after { display: none; } }

.howtext.over.left { right: auto; left: max(20px, calc(50vw - 680px)); width: min(760px, calc(100vw - 40px)); display: flex; flex-direction: column; gap: 8px; }
.howtext.over.left[hidden] { display: none; }

/* --- "How this works": the small toggle that holds a page's explanation. */
.how { min-height: 40px; padding: 0 14px; border: 1px solid var(--card-line); border-radius: 6px; background: var(--card); color: var(--ink); font: 500 14px var(--sans); cursor: pointer; white-space: nowrap; }
.how:hover:not(:disabled) { border-color: var(--ink); background: var(--panel); }
.how[aria-expanded="true"] { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }
.howtext { padding: 10px 14px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 6px; max-width: 110ch; }
button:focus-visible, input:focus-visible, summary:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* --- The Oracle tab (unit 7.14): a live feed, one row per market. The one page that scrolls. */
body.flowing { height: auto; min-height: 100vh; }
body.flowing .bar { position: sticky; top: 0; z-index: 6; }
body.flowing .page { flex: none; padding-top: 0; }
.feedhead { position: sticky; top: 48px; z-index: 5; display: flex; flex-direction: column; gap: 10px; padding: 16px 0 10px; background: var(--bg); border-bottom: 1px solid var(--panel-line); }
.feedbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; font-size: 14px; }
.feedbar input { min-height: 30px; width: 160px; padding: 0 10px; border: 1px solid var(--card-line); border-radius: 6px; background: var(--card); color: var(--ink); font: 400 14px var(--sans); }
.legend { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink2); white-space: nowrap; }
.legend i { width: 16px; height: 3px; border-radius: 2px; background: var(--blue); }
.legend i.orange { background: var(--orange); }
.legend i:not(:first-child) { margin-left: 8px; }
.legend i.ink { background: var(--ink); }
.frows { list-style: none; margin: 0; padding: 0 0 24px; display: flex; flex-direction: column; gap: 8px; }
.frow { display: grid; grid-template-columns: minmax(0, 0.9fr) 36px minmax(0, 1.2fr) minmax(240px, 1fr) 232px; column-gap: 14px; align-items: center; min-height: 132px; padding: 10px 14px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 8px; }
.frow.wait { background: var(--zone); border-color: transparent; }
.frow.none { display: block; min-height: 0; color: var(--ink2); font-size: 14px; }
.fgem { display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; min-width: 0; }
.fgem b { font-size: 15px; line-height: 20px; font-weight: 600; }
.fgem small { font-size: 12px; color: var(--ink2); }
.fgem .quote { display: flex; align-items: baseline; gap: 16px; }
.fgem .quote > span:not(.yes) { display: flex; flex-direction: column; font-size: 11px; line-height: 14px; color: var(--ink2); }
.fgem .quote > span:not(.yes) span { font-size: 14px; line-height: 18px; color: var(--ink); }
.fgem .quote .yes { margin-left: auto; font-size: 18px; color: var(--blue-text); white-space: nowrap; }
.frow .conn { display: flex; justify-content: center; }
.fout { display: flex; align-items: center; gap: 14px; min-width: 0; }
.fout strong { flex: none; min-width: 96px; font: 400 40px/44px var(--sans); letter-spacing: -0.01em; color: var(--orange-text); }
.fout strong.unposted { color: var(--card-line); }
.fout > div { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.fout b { font-size: 15px; line-height: 20px; font-weight: 600; }
.fout span { font-size: 13px; line-height: 18px; color: var(--ink2); }
.fposted { display: flex; flex-wrap: wrap; gap: 0 10px; }
.fposted .posted-ago { color: var(--ink3); }
.fposted .chip, .out .posted .chip { font-size: 12px; padding: 0 6px; align-self: center; }
.fchart { display: block; width: 100%; height: 112px; font-family: inherit; }
.fchart .ghost { animation: pulse 1.4s ease-in-out infinite; }
.frows { overflow-anchor: none; }
@media (prefers-reduced-motion: reduce) { .fchart .ghost { animation: none; } }
.fresult { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; align-items: start; padding: 10px 12px; border-radius: 6px; background: var(--zone); border: 1px solid transparent; font-size: 14px; line-height: 19px; color: var(--ink3); }
.fresult svg { width: 20px; height: 20px; }
.fresult.orange { background: var(--orange-tint); border-color: var(--orange); color: var(--orange-deep); font-weight: 500; }
.fresult.red { background: var(--red-tint); border-color: var(--red); color: var(--red-text); font-weight: 500; }
.seglabel { font-size: 13px; color: var(--ink2); margin-right: -8px; }
.legend i.thin { height: 1px; opacity: 0.6; margin-left: 8px; }
.fmore { display: flex; align-items: center; gap: 12px; padding: 0 0 28px; }
@media (max-width: 1100px) { .frow { grid-template-columns: 1fr; row-gap: 8px; } .frow .conn { display: none; } }

/* --- The BTC pools tab (units 7.12, 7.15): pick a pool on the left; the rest follows it. */
.howtext.over { position: absolute; z-index: 7; top: 104px; right: max(20px, calc(50vw - 680px)); width: min(640px, calc(100vw - 40px)); box-shadow: 0 6px 20px rgba(28, 33, 38, 0.18); }
.papp { flex: 1; min-height: 0; display: grid; grid-template-columns: 318px minmax(0, 1fr); gap: 12px; }
.papp[hidden], .pgrid[hidden], .pmain[hidden], .pchance[hidden] { display: none; }
.ptitle { display: flex; align-items: center; gap: 14px; }
.pfollow { display: flex; flex-direction: column; gap: 2px; margin-left: 10px; min-width: 0; }
.pfollow[hidden] { display: none; }
/* A labelled dropdown that reads as one button: the question, then the answer and its arrow. */
.pick { align-self: flex-start; display: flex; align-items: stretch; min-height: 40px; border: 1px solid var(--card-line); border-radius: 6px; background: var(--card); font: 500 14px var(--sans); color: var(--ink2); cursor: pointer; }
.pick:hover { border-color: var(--ink); }
.pick:focus-within { outline: 2px solid var(--blue); outline-offset: 2px; }
.pick > span { display: flex; align-items: center; padding: 0 12px; border-right: 1px solid var(--card-line); white-space: nowrap; }
.pick select { appearance: none; min-width: 0; max-width: 420px; padding: 0 34px 0 12px; border: 0; border-radius: 0 6px 6px 0; outline: 0; color: var(--ink); font: 600 14px var(--sans); cursor: pointer;
  background: var(--card) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%231C2126' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") no-repeat right 12px center; }
.pgrid { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-rows: minmax(0, 1fr); gap: 12px; }
.pcard { display: flex; flex-direction: column; gap: 8px; min-height: 0; padding: 12px 16px; text-align: left; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 8px; color: var(--ink); font: 400 14px/20px var(--sans); cursor: pointer; }
.pcard:hover:not(.off) { border-color: var(--ink); }
.pcard.off { cursor: default; }
.pcard .between button { padding: 0; border: 0; background: none; color: inherit; font: 600 16px/20px var(--sans); text-align: left; cursor: pointer; }
.pcard.moved { border-color: var(--ink); box-shadow: 0 0 0 3px var(--zone); }
.pcard.moved.orange { border-color: var(--orange); box-shadow: 0 0 0 3px var(--orange-tint); }
.pcard.moved.red { border-color: var(--red); box-shadow: 0 0 0 3px var(--red-tint); }
.pcard:first-child { background: var(--card); border-color: var(--blue); }
.pcard .between b { font-size: 16px; font-weight: 600; }
.pmini { flex: 1; min-height: 0; width: 100%; display: block; font-family: inherit; }
.pline { display: flex; justify-content: space-between; gap: 10px; color: var(--ink2); }
.pline strong { font-weight: 600; color: var(--ink3); white-space: nowrap; }
.pline strong.orange { color: var(--orange-text); } .pline strong.red { color: var(--red-text); }
.ministeps { flex: 1; min-height: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 3px; }
.ministeps.wait { background: var(--zone); border-radius: 4px; }
.ministeps i { position: relative; z-index: 0; overflow: hidden; display: flex; align-items: flex-start; padding: 6px 8px; border-radius: 4px; background: var(--zone); font-style: normal; font-size: 15px; font-weight: 500; color: var(--ink2); }
.ministeps i::before { content: ""; position: absolute; z-index: -1; left: 0; right: 0; bottom: 0; height: calc(var(--h) * 0.7); background: #D3D8DC; }
.ministeps i.now { outline: 1.5px solid var(--ink); outline-offset: -1.5px; color: var(--ink); font-weight: 600; }
.ministeps i.now::before { background: #AEB6BD; }
.ministeps i.now.orange { background: var(--orange-tint); outline-color: var(--orange); color: var(--orange-deep); } .ministeps i.now.orange::before { background: var(--orange-tint2); }
.ministeps i.now.red { background: var(--red-tint); outline-color: var(--red); color: var(--red-text); }
.orun { flex: none; padding: 12px 18px; gap: 10px; }
.orun .tags h2 { margin-right: 6px; }
.orun .controls { flex-wrap: nowrap; }
.osteps { flex: none; padding: 12px 18px; gap: 8px; }
.osteps .wsteps.five { height: 124px; }
.osplit { flex: 1; min-height: 0; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; }
.osplit > .panel { min-height: 0; padding: 12px 18px; gap: 8px; }
.plist { min-height: 0; overflow-y: auto; padding: 12px; gap: 6px; }
.plist h2 { font-size: 15px; line-height: 20px; color: var(--ink2); margin-top: 6px; }
.plist h2:first-child { margin-top: 0; }
.plist button { display: flex; flex-direction: column; gap: 3px; width: 100%; padding: 8px 12px; text-align: left; background: var(--card); border: 1px solid var(--rule); border-radius: 6px; color: var(--ink); font: 400 13px/18px var(--sans); cursor: pointer; }
.plist button:hover { border-color: var(--card-line); }
.plist button.on { border: 1.5px solid var(--blue); padding: 7.5px 11.5px; background: #F3F6FD; }
.plist .row { display: flex; justify-content: space-between; gap: 8px; color: var(--ink2); }
.plist .row b { font-size: 15px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.plist .row .orange { color: var(--orange-text); font-weight: 600; }
.plist .row .red { color: var(--red-text); font-weight: 600; }
.pmain { min-height: 0; min-width: 0; display: flex; flex-direction: column; gap: 12px; }
.pchance { flex: none; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 8px 28px; align-items: center; padding: 10px 18px; }
.pchance > div:first-child { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.whatif { display: grid; grid-template-columns: 1fr auto auto auto; gap: 4px 12px; align-items: center; font-size: 14px; }
.whatif label { grid-column: 1 / -1; font-weight: 500; }
.whatif input { width: 100%; accent-color: var(--blue); min-height: 24px; }
.whatif output { min-width: 44px; font-size: 17px; font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.whatif .primary { min-height: 40px; min-width: 128px; justify-content: center; }
.how:disabled { color: var(--card-line); border-color: var(--rule); cursor: default; }
.pmid { flex: none; height: min(352px, 41vh); display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.3fr); gap: 12px; }
.pmid > .panel { min-height: 0; padding: 12px 16px; gap: 8px; overflow: hidden; }
.kv { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.kv th { padding: 4px 12px 4px 0; text-align: left; font-weight: 400; color: var(--ink2); white-space: nowrap; vertical-align: top; }
.kv td { padding: 4px 0; text-align: right; font-weight: 500; }
.kv tr + tr > * { border-top: 1px solid var(--rule); }
.kv tr.flash td { animation: flash 1.6s ease-out; }
@keyframes flash { 0% { background: var(--blue-tint); color: var(--blue-text); } 100% { background: transparent; } }
.read.pulse { animation: flash 1.6s ease-out; }
.pmid .read { margin-top: auto; }
.adjust .big { display: grid; grid-template-columns: auto 1fr; align-items: baseline; gap: 0 12px; padding: 8px 12px; background: var(--zone); border-radius: 6px; }
.adjust .big b { font: 400 34px/38px var(--sans); }
.adjust .big b.words { font: 500 20px/26px var(--sans); }
.adjust .big span { font-size: 13px; color: var(--ink2); }
.adjust .big.orange { background: var(--orange-tint); } .adjust .big.orange b { color: var(--orange-deep); }
.adjust .big.red { background: var(--red-tint); } .adjust .big.red b { color: var(--red-text); }
.pviz { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 4px; padding: 6px 118px 0 40px; }
.vplot { position: relative; flex: 1; min-height: 0; display: flex; align-items: flex-end; gap: 3px; }
.vgrid { position: absolute; left: 0; right: 0; height: 0; border-top: 1px dashed var(--panel-line); }
.vgrid.base { border-top: 1px solid var(--line); }
.vgrid em { position: absolute; right: 100%; top: -8px; margin-right: 8px; font-style: normal; font-size: 12px; color: var(--ink2); }
.vcol { position: relative; flex: 1; height: 100%; }
.vcol b { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 3px 3px 0 0; transition: height 0.45s ease; }
.vcol.dep b { background: #AEB6BD; opacity: 0.75; }
.vcol.now b { background: rgba(39, 86, 197, 0.3); }
.vcol.now b.borrowed { background: rgba(28, 33, 38, 0.78); }
.vcol.sug b { background: rgba(216, 99, 44, 0.42); }
.pviz.same .vcol.sug b { background: rgba(39, 86, 197, 0.3); }
.pviz.red .vcol.sug b { background: rgba(184, 50, 42, 0.42); }
.vline { position: absolute; left: 0; right: -6px; height: 0; transition: bottom 0.45s ease; }
.vline.theirs { border-top: 2px solid var(--ink); }
.vline.ours { border-top: 2px dashed var(--orange); }
.pviz.red .vline.ours { border-top-color: var(--red); }
.vline span { position: absolute; left: 100%; top: -9px; margin-left: 6px; font-size: 13px; line-height: 16px; font-weight: 600; white-space: nowrap; transition: transform 0.45s ease; }
.vline.theirs span { color: var(--ink); }
.vline.ours span { color: var(--orange-text); }
.pviz.red .vline.ours span { color: var(--red-text); }
.vline.lent span { color: var(--ink2); font-weight: 500; }
.vunder { flex: none; display: flex; gap: 3px; font-size: 11px; line-height: 14px; color: var(--ink2); text-align: center; }
.vunder span { flex: 1; display: flex; flex-direction: column; }
.vunder b { font-size: 13px; line-height: 17px; font-weight: 600; color: var(--ink); }
.phist { flex: 1; min-height: 0; padding: 12px 18px 8px; gap: 4px; }
.phist .plot { flex: 1; min-height: 0; }
@media (prefers-reduced-motion: reduce) { .vcol b, .vline, .vline span { transition: none; } .kv tr.flash td, .read.pulse { animation: none; } }
@media (max-width: 1100px) {
  .papp, .pchance, .pmid { grid-template-columns: 1fr; height: auto; }
  .plist { max-height: 320px; }
  .pviz { height: 240px; flex: none; }
  .phist .plot { height: 220px; flex: none; }
}

/* --- The Agents page (unit 8.0j): the stage on the left (who, progress, five connected steps,
   the order and the cover), the chart and the feed on the right, one line of proven numbers
   below. The wire is drawn over the panels and under the cards. */
.seg { flex: none; display: flex; border: 1px solid var(--card-line); border-radius: 6px; overflow: hidden; }
.seg button { min-height: 38px; padding: 0 14px; border: 0; background: var(--card); color: var(--ink); font: 500 14px var(--sans); cursor: pointer; white-space: nowrap; }
.seg button:hover:not([aria-pressed="true"]) { background: var(--panel); }
.seg button:focus-visible { outline-offset: -3px; }
.seg button + button { border-left: 1px solid var(--card-line); }
.seg button[aria-pressed="true"] { background: var(--blue); color: #FFFFFF; }
.howtext.over.left.drawer { width: 340px; max-height: 70vh; overflow-y: auto; gap: 10px; }
.create { flex: none; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.create select { min-height: 36px; padding: 0 8px; border: 1px solid var(--card-line); border-radius: 6px; background: var(--card); color: var(--ink); font: 500 14px var(--sans); }
.create .primary { grid-column: 1 / -1; min-height: 40px; justify-content: center; }
.agentlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.agentlist button { width: 100%; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; text-align: left; background: var(--card); border: 1px solid var(--panel-line); border-radius: 6px; color: var(--ink3); font: 400 13px/18px var(--sans); font-variant-numeric: tabular-nums; cursor: pointer; }
.agentlist button:hover { border-color: var(--ink3); }
.agentlist button.on { border: 1.5px solid var(--blue); padding: 7.5px 9.5px; }
.agentlist b { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agentlist .chip { font-size: 12px; }
.agentlist .state { color: var(--ink2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.agentlist .state.blue { color: var(--blue-text); font-weight: 500; }
.agentlist .state.red { color: var(--red-text); }
.agentlist .empty { padding: 4px 2px; font-size: 14px; line-height: 20px; color: var(--ink2); }
.copyrow { display: flex; align-items: flex-start; gap: 8px; }
.copyrow pre { flex: 1; min-width: 0; margin: 0; padding: 8px 10px; background: var(--card); border: 1px solid var(--rule); border-radius: 6px; font: 12px/17px ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; overflow-wrap: anywhere; }

.floor { flex: 1; min-height: 0; position: relative; z-index: 0; display: grid; grid-template-columns: minmax(0, 1.36fr) minmax(0, 1fr); gap: 12px; }
.floor > .panel, .watch > .panel { min-height: 0; }
.wire { position: absolute; z-index: 1; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
.wire path.second { stroke-width: 1.5; stroke-dasharray: none; opacity: 0.55; }
.wire text { font: 600 13.5px var(--sans); fill: var(--blue-text); paint-order: stroke; stroke: var(--panel); stroke-width: 5px; stroke-linejoin: round; }
/* The map: the agent and the platforms it calls (unit 10b.4). */
.amap { flex: 1; min-height: 150px; position: relative; display: grid; grid-template-columns: 150px 1fr 210px; grid-template-rows: repeat(4, minmax(0, 1fr)); gap: 8px 0; align-items: center; }
.pnode { position: relative; z-index: 2; grid-column: 3; min-height: 36px; display: flex; align-items: center; padding: 6px 12px; background: var(--card); border: 1px solid var(--card-line); border-radius: 6px; font: 500 15px/20px var(--sans); color: var(--ink3); text-align: left; }
.pnode.me { grid-column: 1; grid-row: 1 / -1; min-height: 56px; justify-content: center; border-radius: 28px; font: 600 16px/20px var(--cond); color: var(--ink); text-align: center; }
.pnode.on { border: 2px solid var(--blue); padding: 5px 11px; background: var(--blue-tint); color: var(--blue-text); font-weight: 600; }
button.pnode { min-height: 40px; }
button.pnode:not(:disabled) { cursor: pointer; border-color: var(--blue); }
button.pnode:not(:disabled):hover { background: var(--blue-tint); }
button.pnode:disabled { opacity: 1; }
/* The cover as a picture (unit 10b.2). */
.cover { flex: 1; min-height: 0; display: grid; grid-template-columns: 132px minmax(0, 1fr) minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; gap: 8px 14px; }
.cover[hidden] { display: none; }
.cover, .sbox.open { cursor: pointer; }
.cover:hover .cout, .cover:hover .chold, .sbox.open:hover { border-color: var(--ink); }
.whyp { font-size: 16px; line-height: 24px; color: var(--ink); }
.chold { display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 10px 12px; background: var(--card); border: 1px solid var(--card-line); border-radius: 6px; font-size: 14px; line-height: 19px; color: var(--ink3); }
.chold strong { font: 600 28px/32px var(--cond); color: var(--ink); }
.ccoin { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--rule); display: flex; align-items: center; gap: 8px; }
.ccoin i { flex: none; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--blue); color: #FFFFFF; font: 600 14px var(--sans); box-shadow: inset 0 0 0 2px var(--blue), inset 0 0 0 3.5px rgba(255, 255, 255, 0.55); }
.ccoin b { color: var(--ink); font-weight: 600; }
.cout { min-height: 0; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; background: var(--card); border: 1px solid var(--panel-line); border-radius: 6px; font-size: 13.5px; line-height: 18px; color: var(--ink3); }
.cout > b { font-weight: 600; color: var(--ink); }
.cbars { flex: 1; min-height: 60px; display: grid; grid-template-rows: 1fr 1fr; }
.cup, .cdown { min-height: 0; display: flex; flex-direction: column; align-items: center; }
.cup { justify-content: flex-end; border-bottom: 1.5px solid var(--ink); }
.cup i, .cdown i { flex: none; width: 56px; max-height: calc(100% - 20px); background: var(--zone); }
.cup i { border-radius: 4px 4px 0 0; } .cdown i { border-radius: 0 0 4px 4px; }
.cup i.blue { background: var(--blue); } .cdown i.red { background: var(--red); }
.cbars span { flex: none; font-weight: 500; color: var(--ink2); white-space: nowrap; }
.cbars span.blue { color: var(--blue-text); } .cbars span.red { color: var(--red-text); }
.csum { font-weight: 600; color: var(--ink); text-align: center; }
.cline { grid-column: 1 / -1; font-size: 15px; line-height: 20px; font-weight: 500; color: var(--ink); }
/* The contracts it compared (unit 10b.3). */
.mfeed.decide th, .mfeed.decide td { padding: 5px 6px; }
.mfeed.decide thead th:nth-child(n + 2) { text-align: right; }
.mfeed.decide tr.under > * { color: var(--ink2); }
.feedp .note { flex: none; font-weight: 500; color: var(--ink); }
.howtext.over.left.orderp { top: auto; bottom: 110px; width: min(620px, calc(100vw - 40px)); }
.wire path { fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.wire path.draw { animation: wire-draw 0.7s ease-out; }
.wire circle { fill: var(--blue); stroke: var(--panel); stroke-width: 2; }
@keyframes wire-draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }

.stage { padding: 16px 18px; gap: 14px; }
.who { flex: none; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "ident controls" "state state"; align-items: center; gap: 10px 16px; }
.who .ident { grid-area: ident; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.who .id { display: flex; align-items: center; gap: 10px; }
.who .name { font: 500 22px/28px var(--cond); color: var(--ink); }
.who .facts { display: flex; flex-wrap: wrap; gap: 0 14px; font-size: 14px; line-height: 20px; color: var(--ink3); }
.who .controls { grid-area: controls; display: flex; align-items: center; gap: 8px; }
.who .controls .how { min-height: 44px; font-size: 15px; padding: 0 16px; }
.who .controls .how:disabled { color: var(--ink2); border-color: var(--panel-line); cursor: default; }
.who .controls .primary { min-width: 96px; justify-content: center; }
.who .state { grid-area: state; position: relative; z-index: 2; min-height: 48px; display: flex; align-items: center; gap: 12px; padding: 8px 16px; background: var(--zone); border-radius: 6px; font: 500 22px/28px var(--cond); color: var(--ink); }
.who .state::before { content: ""; flex: none; width: 10px; height: 10px; border-radius: 5px; background: var(--ink2); }
.who .state.doing { background: var(--blue-tint); color: var(--blue-text); }
.who .state.doing::before { background: var(--blue); animation: pulse 1s ease-in-out infinite; }
.who .state.red { background: var(--red-tint); color: var(--red-text); font-size: 17px; line-height: 22px; }
.who .state.red::before { background: var(--red); }
.who .create { display: flex; gap: 8px; }
.who .create .primary { min-height: 44px; }
.who .create select { min-height: 44px; }
@keyframes pulse { 50% { opacity: 0.25; } }

.flowbar { flex: none; height: 6px; border-radius: 3px; background: var(--zone); overflow: hidden; }
.flowbar i { display: block; height: 100%; width: 0; background: var(--blue); border-radius: 3px; transition: width 0.6s ease; }
.sboxes { flex: none; list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.sbox { position: relative; z-index: 2; min-height: 124px; display: flex; flex-direction: column; gap: 6px; padding: 14px 14px 16px; background: var(--card); border: 1px solid var(--card-line); border-radius: 8px; font-size: 14px; line-height: 19px; color: var(--ink3); }
.sbox + .sbox::before { content: ""; position: absolute; left: -18px; top: 50%; width: 17px; height: 2px; background: var(--line); }
.sbox > b { font: 600 17px/22px var(--cond); color: var(--ink); }
.sbox strong { margin-top: auto; font: 600 26px/30px var(--cond); color: var(--ink); white-space: nowrap; }
.sbox.off { background: var(--panel); border-color: var(--panel-line); color: var(--ink2); }
.sbox.off > b, .sbox.off strong { color: var(--ink2); }
.sbox.off .badge { background: var(--line); }
.sbox.on .badge, .sbox.now .badge { background: var(--blue); }
.sbox.on + .sbox.on::before, .sbox.on + .sbox.now::before { background: var(--blue); }
.sbox.now { border: 2.5px solid var(--blue); padding: 12.5px 12.5px 14.5px; background: var(--blue-tint); }
.sbox.now + .sbox::before, .sbox.red + .sbox::before { left: -19.5px; }
.sbox.now::before { left: -19.5px; }
.sbox.now strong, .sbox.now > b { color: var(--blue-text); }
.sbox.now.doing { animation: doing 1.2s ease-in-out infinite; }
.sbox.red { border: 2.5px solid var(--red); padding: 12.5px 12.5px 14.5px; background: var(--red-tint); color: var(--red-text); }
.sbox.red .badge { background: var(--red); }
@keyframes doing { 50% { border-color: #9DB5EC; } }

.after { flex: none; display: flex; flex-direction: column; gap: 8px; }
button.aline { width: 100%; font-family: var(--sans); text-align: left; cursor: pointer; }
button.aline:disabled { cursor: default; }
.aline .open { margin-left: auto; padding: 2px 10px; border: 1px solid var(--card-line); border-radius: 6px; background: var(--card); color: var(--ink); font-weight: 500; }
button.aline:hover:not(:disabled) .open { border-color: var(--ink); background: var(--panel); }
.aline { min-height: 44px; display: flex; align-items: center; gap: 10px; padding: 8px 14px; background: var(--card); border: 1px solid var(--panel-line); border-radius: 6px; font-size: 15px; line-height: 20px; color: var(--ink); }
.aline > b { flex: none; width: 132px; font-weight: 600; }
.aline.blue { border-color: var(--blue); }
.aline .none, .proven .none, .mfeed .none { color: var(--ink2); }
.chip.doing { background: var(--blue-tint); color: var(--blue-text); animation: pulse 1s ease-in-out infinite; }

.watch { min-height: 0; display: grid; grid-template-rows: minmax(0, 0.82fr) minmax(0, 1fr); gap: 12px; }
.watch h2 { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chartp { padding: 12px 16px 8px; gap: 6px; }
.feedp { gap: 6px; }
.mfeed { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.mfeed th, .mfeed td { padding: 6px 8px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--rule); }
.mfeed th { font-weight: 500; text-align: left; color: var(--ink); }
.mfeed thead th { position: sticky; top: 0; z-index: 1; background: var(--panel); font-size: 13px; font-weight: 500; color: var(--ink2); border-bottom-color: var(--panel-line); }
.mfeed thead th:nth-child(n + 3) { text-align: right; }
.mfeed td.m { width: 22px; padding: 6px 0 6px 6px; text-align: left; }
.mfeed td.m svg { display: block; }
.mfeed td.none { text-align: left; border: 0; }
.mfeed .chip { font-size: 12px; padding: 1px 6px; margin-left: 4px; }
.mfeed tr.aim .chip { background: var(--card); }
.mfeed tbody tr[data-key] { cursor: default; }
.mfeed.pick tbody tr[data-key] { cursor: pointer; }
.mfeed.pick tbody tr[data-key]:hover > * { background: var(--zone); }
.mfeed tr.focus > * { background: var(--zone); }
.mfeed tr.aim > * { background: var(--blue-tint); color: var(--blue-text); font-weight: 600; }
.mfeed tr.aim > :first-child { box-shadow: inset 4px 0 0 var(--blue); }

.proven { flex: none; min-height: 40px; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 8px 16px; background: var(--panel); border: 1px solid var(--panel-line); border-radius: 8px; font-size: 14px; line-height: 22px; color: var(--ink3); }
.proven b { font-weight: 600; color: var(--ink); }
.proven i { font-style: normal; color: var(--ink2); }
.proven .total { margin-left: auto; font-weight: 600; color: var(--ink); }
@media (prefers-reduced-motion: reduce) { .wire path.draw, .who .state.doing::before, .sbox.now.doing, .chip.doing { animation: none; } .flowbar i { transition: none; } }
@media (max-width: 1199px) {
  .floor { grid-template-columns: 1fr; }
  .wire { display: none; }
  .sboxes { grid-template-columns: 1fr 1fr; }
  .sbox + .sbox::before { display: none; }
  .watch { grid-template-rows: 260px 320px; }
}
