:root {
  color-scheme: dark;   /* #258: native scrollbars and controls follow the dark theme */
  --bg: #070a0f;
  --panel: #0c121a;
  --panel-2: #111923;
  --line: #1e2a37;
  --line-2: #2a3a4b;
  --text: #d6e2ee;
  --muted: #95a5b8;   /* #69: stronger contrast for secondary text */
  --cyan: #7fe3ff;
  /* #134: one type scale and one spacing scale for every panel */
  --fs-1: 11px; --fs-2: 12px; --fs-3: 13px; --fs-4: 14px; --fs-5: 18px;
  --sp-1: 4px; --sp-2: 8px; --sp-3: 12px; --sp-4: 16px;
  --green: #5cffb1;
  --amber: #ffb25c;
  --red: #ff5c6c;
  --mono: "Share Tech Mono", ui-monospace, "Cascadia Mono", Consolas, monospace;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 14px; }   /* #69: a step larger */
body { overflow: hidden; }
button, select, input { font-family: inherit; font-size: inherit; color: inherit; }
button { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 3px; padding: 5px 10px; cursor: pointer; letter-spacing: 1px; font-family: var(--mono); font-size: 12px; }
button:hover { border-color: var(--cyan); color: var(--cyan); }
button:disabled { opacity: .4; cursor: not-allowed; border-color: var(--line); color: var(--text); }
button.primary { background: #103142; border-color: var(--cyan); color: var(--cyan); }
button.primary:hover { background: #164055; }
button.danger:hover { border-color: var(--red); color: var(--red); }
button.icon { width: 32px; height: 32px; padding: 0; text-align: center; }
select { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 3px; padding: 4px 6px; max-width: 100%; }
input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; background: var(--line-2); border-radius: 2px; outline: none; flex: 1; min-width: 60px; }
input[type=range]:focus-visible { outline: 2px solid var(--cyan); outline-offset: 4px; }   /* #198: outline:none above took the only focus cue */
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--cyan); border: 2px solid var(--panel); cursor: pointer; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--cyan); border: 2px solid var(--panel); cursor: pointer; }
.hidden { display: none !important; }
.small { font-size: var(--fs-2); color: var(--muted); line-height: 1.4; }
.num { font-family: var(--mono); }
.ok { color: var(--green); } .bad { color: var(--red); } .warn { color: var(--amber); } .amber { color: var(--amber); } .cyan { color: var(--cyan); }

/* ---------- layout ---------- */
#app { display: grid; height: 100%; grid-template-rows: 54px 1fr; grid-template-columns: 300px minmax(420px, 1fr) 340px; grid-template-areas: "top top top" "left center right"; }
#top { grid-area: top; display: flex; align-items: center; gap: 22px; padding: 0 14px; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, #0d141d, #090e14); position: relative; }
#top::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 1px; background: linear-gradient(90deg, transparent, var(--cyan), transparent); opacity: .5; }
#left, #right { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; }
#left { grid-area: left; border-right: 1px solid var(--line); }
#right { grid-area: right; border-left: 1px solid var(--line); }
#center { grid-area: center; display: flex; flex-direction: column; gap: 10px; padding: 10px; overflow: hidden; min-width: 0; }

.brand { display: flex; flex-direction: column; line-height: 1; }
.logo { font-family: var(--mono); font-size: 22px; letter-spacing: 2px; color: var(--cyan); }
.logo b { color: var(--text); font-weight: 400; }
.sub { font-size: 10px; letter-spacing: 3px; color: var(--muted); margin-top: 3px; }
.tele { display: flex; flex-direction: column; line-height: 1.1; }
.tele .lbl, .lbl { font-size: 10px; letter-spacing: 2px; color: var(--muted); }
.tele .val { font-family: var(--mono); font-size: 18px; }
.runbox { display: flex; align-items: center; gap: 8px; }
.speed { display: flex; align-items: center; gap: 4px; margin-left: 6px; }
.speed .lbl { margin-right: 4px; }
.spd { padding: 4px 7px; }
.spd.on { border-color: var(--green); color: var(--green); }
.progress { width: 120px; height: 6px; background: var(--line); border-radius: 3px; overflow: hidden; margin-left: 6px; }
#prog { height: 100%; width: 0; background: var(--green); transition: width .2s linear; }
.spacer { flex: 1; }
#btn-run.running { border-color: var(--red); color: var(--red); background: #3a1118; }

/* ---------- panels ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; position: relative; min-width: 0; }
.panel select, .panel input[type=text] { max-width: 100%; }
.panel::before, .panel::after { content: ""; position: absolute; width: 10px; height: 10px; border-color: var(--line-2); border-style: solid; }
.panel::before { top: -1px; left: -1px; border-width: 2px 0 0 2px; }
.panel::after { bottom: -1px; right: -1px; border-width: 0 2px 2px 0; }
.panel h2 { font-family: var(--mono); font-size: 12px; letter-spacing: 3px; text-transform: uppercase; color: var(--cyan); margin: 0 0 8px; display: flex; align-items: center; gap: 8px; }
.panel h3 { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; text-transform: uppercase; color: var(--muted); margin: 12px 0 6px; }
.row { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.row label { width: 74px; flex: none; font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.row select { flex: 1 1 0; min-width: 0; width: 0; }
.tag { font-size: 11px; letter-spacing: 1px; color: var(--muted); border: 1px solid var(--line-2); padding: 1px 6px; border-radius: 2px; }

/* feed composition */
.mat { display: grid; grid-template-columns: 82px 1fr 44px; align-items: center; gap: 8px; margin: 3px 0; }
.mat .name { font-size: 12px; cursor: pointer; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.mat .name:hover { color: var(--cyan); }
.mat .name i { width: 9px; height: 9px; border-radius: 2px; display: inline-block; border: 1px solid rgba(0,0,0,.5); flex: none; }
.mat .pct { font-family: var(--mono); font-size: 11px; text-align: right; color: var(--muted); }
.mat.on .pct { color: var(--text); }
.matinfo { margin-top: 8px; padding: 8px; border: 1px dashed var(--line-2); border-radius: 3px; font-size: 12px; line-height: 1.4; min-height: 24px; }
.matinfo b { color: var(--cyan); }
.matinfo .props { display: flex; flex-wrap: wrap; gap: 4px 10px; font-family: var(--mono); font-size: 11px; color: var(--muted); margin: 4px 0 6px; }
.matinfo .tags span { display: inline-block; font-size: 11px; letter-spacing: 1px; text-transform: uppercase; border: 1px solid var(--line-2); border-radius: 2px; padding: 0 5px; margin: 0 4px 4px 0; color: var(--muted); }

/* flowsheet nodes */
#line-nodes { display: flex; flex-direction: column; gap: 6px; margin: 8px 0; }
.node { display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line-2); border-radius: 3px; background: var(--panel-2); cursor: pointer; }
.node:hover { border-color: var(--cyan); }
.node.sel { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.node .idx { font-family: var(--mono); color: var(--muted); font-size: 12px; }
.node .nm { font-size: 12px; }
.node .src { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.node .st { font-family: var(--mono); font-size: 11px; color: var(--cyan); text-align: right; }
.node .st.bad { color: var(--red); }
.node .st.warn { color: var(--amber); }
.node.limit .idx { color: var(--amber); }
.addrow select { flex: 1 1 0; min-width: 0; width: 0; }
.addrow button { flex: 0 0 auto; white-space: nowrap; }
.empty { color: var(--muted); font-size: 12px; padding: 6px; text-align: center; border: 1px dashed var(--line-2); border-radius: 3px; }

/* cam */
#cam-wrap { position: relative; flex: 1; min-height: 220px; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; background: #0b1018; }
#cam { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
#cam-wrap::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.09) 0 1px, transparent 1px 3px); mix-blend-mode: multiply; }
#cam-title { position: absolute; top: 8px; left: 10px; display: flex; flex-direction: column; pointer-events: none; }
#cam-name { font-family: var(--mono); font-size: 16px; letter-spacing: 2px; color: var(--cyan); text-shadow: 0 0 8px rgba(127,227,255,.4); }
#cam-cat { font-size: 11px; letter-spacing: 2px; color: var(--muted); }
#cam-status { position: absolute; top: 8px; right: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 2px; padding: 2px 8px; border: 1px solid var(--green); color: var(--green); border-radius: 2px; pointer-events: none; }
#cam-status.idle { border-color: var(--muted); color: var(--muted); }
#cam-status.on { animation: blink 1.2s steps(2) infinite; }
@keyframes blink { 50% { opacity: .45; } }
#cam-hint { position: absolute; bottom: 6px; left: 10px; pointer-events: none; letter-spacing: 1px; }

/* machine panel */
.mhead { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.mhead h2 { margin: 0; }
.mbtns { display: flex; align-items: center; gap: 6px; }
.setting { display: grid; grid-template-columns: 150px 1fr 72px; align-items: center; gap: 8px; margin: 6px 0; }
.setting label { font-size: 11px; color: var(--muted); letter-spacing: 1px; text-transform: uppercase; }
.setting .v { font-family: var(--mono); text-align: right; color: var(--cyan); }
.mech { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.mech span { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; border: 1px solid var(--line-2); border-radius: 2px; padding: 2px 6px; color: var(--muted); position: relative; overflow: hidden; }
.mech span i { position: absolute; left: 0; top: 0; bottom: 0; background: rgba(127,227,255,.18); z-index: 0; }
.mech span em { position: relative; font-style: normal; }
.how { line-height: 1.5; margin: 6px 0; color: var(--text); }
.bestavoid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; font-size: 12px; line-height: 1.4; }
.bestavoid b { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; display: block; }

/* telemetry */
.readouts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ro { background: var(--panel-2); border: 1px solid var(--line); border-radius: 3px; padding: 5px 7px; }
.ro .lbl { display: block; }
.ro .v { font-family: var(--mono); font-size: 16px; color: var(--text); }
.ro .u { font-size: 11px; color: var(--muted); margin-left: 2px; }
.ro.hi .v { color: var(--amber); } .ro.bad .v { color: var(--red); } .ro.good .v { color: var(--green); }
.chart-wrap { position: relative; margin-top: 8px; border: 1px solid var(--line); border-radius: 3px; background: #0a0f16; }
#psd { display: block; width: 100%; height: 150px; }
.legend { position: absolute; top: 4px; right: 6px; display: flex; gap: 10px; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; }
.legend .k::before { content: ""; display: inline-block; width: 12px; height: 2px; margin-right: 4px; vertical-align: middle; background: currentColor; }
.legend .in { color: var(--muted); } .legend .out { color: var(--cyan); } .legend .p80 { color: var(--amber); }
#mat-table { margin-top: 8px; font-family: var(--mono); font-size: 11px; }
#mat-table .r { display: grid; grid-template-columns: 1fr 48px 60px 62px; gap: 6px; padding: 2px 0; border-bottom: 1px dotted var(--line); align-items: center; }
#mat-table .r.h { color: var(--muted); font-size: 11px; letter-spacing: 1px; }
#mat-table .bar { height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
#mat-table .bar i { display: block; height: 100%; background: var(--green); }
#mat-table .bar i.lo { background: var(--red); } #mat-table .bar i.mid { background: var(--amber); }
#warnings { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.w { font-size: 11px; line-height: 1.35; padding: 5px 8px; border-left: 3px solid var(--muted); background: var(--panel-2); border-radius: 0 3px 3px 0; }
.w.info { border-color: var(--cyan); } .w.warn { border-color: var(--amber); } .w.bad { border-color: var(--red); }

/* bins */
.bin { border: 1px solid var(--line-2); border-radius: 3px; padding: 6px 8px; margin: 4px 0; background: var(--panel-2); }
.bin .h { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; }
.bin .h b { color: var(--cyan); font-weight: 400; letter-spacing: 1px; }
.bin .comp { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin: 5px 0 3px; background: var(--line); }
.bin .comp i { display: block; height: 100%; }
.bin .d { font-size: 11px; color: var(--muted); display: flex; justify-content: space-between; gap: 6px; }
.bin .val { color: var(--amber); font-family: var(--mono); }

/* log */
#log { font-family: var(--mono); font-size: 11px; max-height: 260px; overflow-y: auto; display: flex; flex-direction: column; gap: 2px; }
#log div { padding: 1px 0; border-bottom: 1px dotted var(--line); line-height: 1.35; }
#log .t { color: var(--muted); margin-right: 6px; }
#log .bad { color: var(--red); } #log .warn { color: var(--amber); } #log .ok { color: var(--green); }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(3,6,10,.8); display: flex; align-items: center; justify-content: center; z-index: 80; padding: 20px; }   /* #310: help sits above a station, the drawer and the LOT DONE card */
.modal-box { background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; max-width: 760px; max-height: 90vh; overflow-y: auto; padding: 20px 26px; position: relative; line-height: 1.5; }
.modal-box h2 { font-family: var(--mono); letter-spacing: 3px; color: var(--cyan); margin-top: 0; }
.modal-box h3 { font-family: var(--mono); letter-spacing: 2px; font-size: 12px; color: var(--muted); text-transform: uppercase; }
.modal-box .close { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px; padding: 0; font-size: 18px; }
.modal-box a { color: var(--cyan); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  #app { grid-template-columns: 270px 1fr 300px; }
  .readouts { grid-template-columns: repeat(2, 1fr); }
  .setting { grid-template-columns: 120px 1fr 64px; }
}
@media (max-width: 900px) {
  body { overflow: auto; }
  #app { grid-template-rows: auto auto auto auto; grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "center" "left" "right"; height: auto; }
  .mhead, .mbtns, .runbox { flex-wrap: wrap; }
  .bestavoid { grid-template-columns: 1fr; }
  .setting { grid-template-columns: 110px 1fr 64px; }
  .panel, #cam-wrap { min-width: 0; }
  #top { flex-wrap: wrap; height: auto; padding: 8px 10px; gap: 12px; }
  #left, #right { border: 0; }
  #cam-wrap { min-height: 300px; }
  #center { overflow: visible; }
}

/* ---------- bank and upgrades ---------- */
.readouts.two { grid-template-columns: repeat(2, 1fr); }
.rankbar { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin: 8px 0 2px; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--muted); }
.rankbar .track { height: 5px; background: var(--line); border-radius: 3px; overflow: hidden; }
.rankbar .track i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--green)); transition: width .3s; }
.urow { display: grid; grid-template-columns: 22px 1fr auto; gap: 8px; align-items: center; padding: 6px 6px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel-2); margin: 4px 0; }
.urow .ic { text-align: center; font-size: 14px; }
.urow .nm { font-size: 12px; }
.urow .cur { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 1px; }
.urow .cur b { color: var(--cyan); font-weight: 400; }
button.buy { background: #2a2210; border-color: var(--amber); color: var(--amber); }
button.buy:hover { background: #3b2f12; color: var(--amber); border-color: var(--amber); }
button.buy.poor { background: transparent; border-color: var(--line-2); color: var(--muted); }
button.buy.max { background: transparent; border-color: var(--green); color: var(--green); cursor: default; }
.node .lvl { font-family: var(--mono); font-size: 10px; color: var(--green); margin-left: 6px; letter-spacing: 1px; }
.node.unowned { border-style: dashed; }
#scorecard { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; background: rgba(5,9,14,.72); z-index: 5; cursor: pointer; }
.card { width: min(440px, 92%); background: var(--panel); border: 1px solid var(--line-2); border-radius: 6px; padding: 16px 20px; box-shadow: 0 0 0 1px rgba(127,227,255,.15), 0 20px 50px rgba(0,0,0,.6); }
.card h2 { font-family: var(--mono); letter-spacing: 3px; color: var(--cyan); font-size: 14px; margin: 0 0 10px; display: flex; justify-content: space-between; }
.card h2 span { color: var(--muted); font-size: 11px; }
.card .net { font-family: var(--mono); font-size: 34px; letter-spacing: 1px; margin: 4px 0 10px; }
.card .net small { font-size: 11px; color: var(--muted); letter-spacing: 2px; display: block; }
.card dl { display: grid; grid-template-columns: 1fr auto; gap: 4px 14px; margin: 0; font-size: 12px; }
.card dt { color: var(--muted); } .card dd { margin: 0; text-align: right; font-family: var(--mono); }
.card .rankup { margin-top: 10px; padding: 8px 10px; border: 1px solid var(--green); color: var(--green); border-radius: 3px; font-family: var(--mono); letter-spacing: 2px; font-size: 12px; text-align: center; }
.card .tip { margin-top: 10px; font-size: 11px; color: var(--muted); }
#run-net { margin-left: 8px; min-width: 70px; }
button.bad { border-color: var(--red); color: var(--red); }
@media (max-width: 1180px) { .tele.hide-narrow { display: none; } }

/* ---------- list rows (auction lots, jobs) ---------- */
.crow { display: grid; grid-template-columns: 1fr auto; gap: 3px 8px; align-items: start; padding: 7px 8px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel-2); margin: 4px 0; }
.crow.active { border-color: var(--green); box-shadow: 0 0 0 1px var(--green) inset; }
.crow .ch { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; grid-column: 1; }
.crow .cd { font-size: 11px; color: var(--muted); grid-column: 1; line-height: 1.35; }
.crow button { grid-column: 2; grid-row: 1 / span 3; align-self: center; }
.crow .cbtns { grid-column: 2; grid-row: 1 / span 3; align-self: center; display: flex; flex-direction: column; align-items: stretch; gap: 5px; }
.crow .cbtns button { white-space: nowrap; }
.stars { font-family: var(--mono); letter-spacing: 2px; color: var(--line-2); white-space: nowrap; }
.stars.got { color: var(--amber); }
#feed-panel.locked .mat input, #feed-panel.locked #feed-tons, #feed-panel.locked #feed-preset { opacity: .45; }
#feed-lock { color: var(--amber); margin: 4px 0; }
.card .stars { font-size: 22px; letter-spacing: 4px; color: var(--amber); margin: 2px 0 6px; }
.card .reason { font-size: 12px; margin-bottom: 8px; }
.card .lesson { margin-top: 10px; padding: 8px 10px; border-left: 3px solid var(--cyan); background: var(--panel-2); font-size: 12px; line-height: 1.4; }
.card .loss { margin-top: 8px; font-size: 11px; color: var(--amber); }

/* ---------- run economics (#18 to #22) ---------- */
#btn-run .proj { font-size: 11px; letter-spacing: 0; margin-left: 6px; color: var(--green); }
#btn-run.neg { border-color: var(--amber); color: var(--amber); background: #33230e; }
#btn-run.neg .proj { color: var(--amber); }
#run-net.reason { color: var(--amber); font-size: 11px; max-width: 300px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bin .d.price { color: var(--text); }
.bin .d.price b { font-family: var(--mono); color: var(--amber); font-weight: 400; }
.chk-auto { display: inline-flex; align-items: center; gap: 4px; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--muted); cursor: pointer; white-space: nowrap; }
.chk-auto input { margin: 0; accent-color: var(--green); }
.card { max-height: 94%; overflow-y: auto; }
.card dd.warn { color: var(--amber); }
.card .sec { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--muted); margin: 10px 0 4px; }
.card .ptable { display: grid; grid-template-columns: 1fr 60px 72px 64px; gap: 2px 8px; font-family: var(--mono); font-size: 11px; }
.card .ptable span:nth-child(4n+2), .card .ptable span:nth-child(4n+3), .card .ptable span:nth-child(4n+4) { text-align: right; }
.card .ptable .h { color: var(--muted); font-size: 11px; letter-spacing: 1px; }
.card .ptable .tot { border-top: 1px solid var(--line-2); color: var(--cyan); padding-top: 2px; }
.card .loss b { color: var(--amber); font-weight: 400; }
.card .loss > b { letter-spacing: 2px; font-family: var(--mono); font-size: 11px; }
.card .loss div { margin: 3px 0; color: var(--text); }
.card .loss .cause { color: var(--muted); }
.card .bynode { font-family: var(--mono); font-size: 11px; color: var(--muted); letter-spacing: 1px; margin-top: 4px; }
.card .hint { margin-top: 8px; font-size: 11px; color: var(--green); }

/* ---------- blueprints ---------- */
.bp-name { flex: 1; min-width: 0; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 3px; padding: 4px 6px; font-family: var(--mono); font-size: 12px; }
.bp-name:focus { outline: none; border-color: var(--cyan); }
.urow.fit { border-color: var(--green); }
.urow .btns { display: flex; gap: 4px; }
.tag.fit { color: var(--green); border-color: var(--green); margin-left: 6px; }

/* ---------- calm layout (layout.js): feed + 4-section plant; everything else behind toolbar drawers ---------- */
body.lay #app { grid-template-rows: 54px 40px 1fr; grid-template-columns: 300px minmax(0, 1fr); grid-template-areas: "top top" "tool tool" "left center"; }
body.lay #right { display: none; }
body.lay #center { overflow-y: auto; }
#toolbar { grid-area: tool; display: flex; align-items: center; gap: 6px; padding: 0 14px; border-bottom: 1px solid var(--line); background: var(--panel); overflow-x: auto; }
#toolbar .tool { white-space: nowrap; }
#toolbar .tool.on { border-color: var(--cyan); color: var(--cyan); background: #103142; }
#flow-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#flow-panel h2 .tag { margin-left: 8px; }
.flow-feed { font-family: var(--mono); letter-spacing: 1px; color: var(--muted); padding: 6px 2px 10px; }
.flow-feed b { color: var(--amber); font-weight: 400; }
.flow { flex: 1; display: grid; grid-template-columns: 28px minmax(0, 1fr) 28px; gap: 6px; min-height: 300px; }
.flow-nav { padding: 0; font-size: 22px; }
#flow-nodes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) minmax(0, 1.25fr); border: 1px solid var(--line-2); border-radius: 4px; background: var(--panel-2); }
.fcol { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px 10px; border-right: 2px solid var(--line-2); text-align: center; min-width: 0; }
.fcol:last-child { border-right: 0; }
.fcol.mach, .fcol.add { cursor: pointer; }
.fcol.mach:hover, .fcol.mach:focus-visible, .fcol.add:hover, .fcol.add:focus-visible { background: #14202c; outline: none; }
.fcol.mach:focus-visible, .fcol.add:focus-visible { outline: 2px solid var(--cyan); outline-offset: -4px; }   /* #255: the outline:none above left the focused column with only a faint tint; inset so the grid border does not clip it */
.fcol.mach:hover .fn-n { color: var(--cyan); }
.fcol.unowned { opacity: .6; }
.fn-k { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--muted); }
.fn-shape { width: min(150px, 90%); height: auto; }
.fn-n { font-family: var(--mono); font-size: 15px; letter-spacing: 1px; }
.fn-s { font-size: 12px; color: var(--muted); }
.fn-w { font-size: 11px; font-family: var(--mono); letter-spacing: 1px; }
.fn-w.bad { color: var(--red); } .fn-w.warn { color: var(--amber); }
.fn-plus { font-size: 46px; line-height: 1; color: var(--muted); font-family: var(--mono); }
.fcol.add:hover .fn-plus { color: var(--cyan); }
.fcol.buckets { justify-content: flex-start; align-items: stretch; text-align: left; overflow-y: auto; }
.fcol.buckets .fn-k { text-align: center; padding-bottom: 4px; }
.bk-list { display: flex; flex-direction: column; gap: 6px; }
.bk { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto auto; gap: 6px; align-items: center; padding: 6px; border: 1px solid var(--line-2); border-radius: 3px; background: var(--panel); }
.bk.misc { grid-template-columns: 10px minmax(0, 1fr) auto; border-style: dashed; }
.bk-sw { width: 10px; height: 26px; border-radius: 2px; }
.bk-sw.misc { background: repeating-linear-gradient(45deg, var(--muted) 0 3px, transparent 3px 6px); }
.bk-t { display: flex; flex-direction: column; min-width: 0; }
.bk-t b { font-weight: 500; }
.bk button { padding: 4px 6px; font-size: 11px; }
.flow-hint { padding-top: 8px; }
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(5,9,14,.72); display: flex; align-items: flex-start; justify-content: center; padding: 64px 16px 16px; }
.sheet { width: min(760px, 100%); max-height: 100%; display: flex; flex-direction: column; background: var(--bg); border: 1px solid var(--line-2); border-radius: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.6); }
.sheet.wide { width: min(1280px, 100%); height: 100%; }
.sheet-h { display: flex; align-items: center; justify-content: space-between; padding: 10px 14px; border-bottom: 1px solid var(--line); font-family: var(--mono); letter-spacing: 2px; color: var(--cyan); }
.sheet-b { overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.station-b { flex: 1; display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 10px; }
.st-main, .st-side { display: flex; flex-direction: column; gap: 10px; min-width: 0; min-height: 0; }
.st-main #cam-wrap { min-height: 320px; height: 46vh; flex: none; }
body.lay #scorecard { position: fixed; z-index: 50; }
@media (max-width: 900px) {
  body.lay #app { grid-template-rows: auto auto auto auto; grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "tool" "center" "left"; }
  #flow-nodes { grid-template-columns: minmax(0, 1fr); }
  .fcol { border-right: 0; border-bottom: 2px solid var(--line-2); }
  .fcol.empty { display: none; }
  .station-b { grid-template-columns: minmax(0, 1fr); }
  .overlay { padding: 8px; }
}

/* plant stations: live cam, the bins each station fills, and what moves on */
.fcol.mach { justify-content: flex-start; align-items: stretch; text-align: center; gap: 5px; }
.fn-camwrap { position: relative; width: 100%; aspect-ratio: 900 / 380; border: 1px solid var(--line); border-radius: 3px; overflow: hidden; background: #0b1018; flex: none; }
.fn-cam { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.fcol.mach:hover .fn-camwrap { border-color: var(--cyan); }
.fn-sub { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--muted); margin: 6px 0 2px; text-align: left; }
.fbins { display: flex; flex-direction: column; gap: 5px; text-align: left; }
.fbin { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 7px; align-items: center; }
.fbin-box { height: 30px; border: 2px solid #5d6b7b; border-top: 0; border-radius: 0 0 4px 4px; padding: 2px; display: flex; align-items: flex-end; background: #0b1018; }
.fbin.pure .fbin-box { border-color: var(--green); }
.fbin-fill { width: 100%; height: 80%; display: flex; flex-direction: column-reverse; border-radius: 1px; overflow: hidden; }
.fbin-fill i { display: block; min-height: 2px; }
.fbin-t { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.fbin-t b { font-weight: 500; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fbin-t span { font-size: 11px; color: var(--muted); }
.fbin.pure .fbin-t span { color: var(--green); }
.fnext { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 4px; align-items: start; margin-top: 8px; padding-top: 6px; border-top: 1px dashed var(--line-2); text-align: left; font-size: 12px; }
.fnext-a { color: var(--cyan); font-size: 16px; line-height: 1; }
.fcol.skipped { opacity: .45; }
.fcol.skipped .fn-camwrap { filter: grayscale(1); }
.fn-k.entry { color: var(--amber); }
.flow-entry select { margin-left: 4px; max-width: 260px; }
.mk { font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--muted); white-space: nowrap; }
.mk.hot { color: var(--green); } .mk.cold { color: var(--red); }
.mk.up { color: var(--green); } .mk.down { color: var(--amber); }
.fn-w.neck { color: var(--amber); border: 1px solid var(--amber); border-radius: 2px; padding: 1px 4px; align-self: center; }
.ship { display: inline-block; font-style: normal; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; margin-top: 2px; }
.ship.ok { color: var(--green); } .ship.bad { color: var(--red); }
.bk .refine { grid-column: 2 / -1; justify-self: stretch; }
.bk .refine.buy { border-color: var(--amber); color: var(--amber); }
.slot-pips { display: flex; gap: 3px; margin: 4px 0; }
.slot-pips i { width: 14px; height: 10px; border-radius: 2px; border: 1px solid var(--line-2); }
.slot-pips i.used { background: var(--cyan); border-color: var(--cyan); }
.slot-pips i.free { background: transparent; border-color: var(--green); }
.slot-pips i.locked { background: repeating-linear-gradient(45deg, var(--line-2) 0 2px, transparent 2px 4px); }

/* the game loop strip (#58) and THE BIN (#50) */
.loop { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; margin: 0 0 10px; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; }
.loop-step { display: flex; flex-direction: column; align-items: center; gap: 1px; border: 0; border-right: 1px solid var(--line-2); border-radius: 0; padding: 6px 4px; background: var(--panel-2); position: relative; }
.loop-step:last-child { border-right: 0; }
.loop-step b { font-weight: 400; letter-spacing: 2px; font-size: 13px; }
.loop-step span { font-family: var(--sans); font-size: 11px; letter-spacing: 0; color: var(--muted); }
.loop-step:not(:last-child)::after { content: "\25B6"; position: absolute; right: -6px; top: 50%; transform: translateY(-50%); font-size: 10px; color: var(--line-2); z-index: 1; }
.loop-step.on { background: #103142; color: var(--cyan); box-shadow: inset 0 -2px 0 var(--cyan); }
.loop-step.on span { color: var(--text); }
.fcol.bincol { justify-content: flex-start; align-items: stretch; text-align: center; gap: 6px; background: #0e151d; }
.bigbin { height: 120px; margin: 4px 12px 0; border: 3px solid #5d6b7b; border-top: 0; border-radius: 0 0 8px 8px; padding: 4px; display: flex; align-items: flex-end; background: #0b1018; }
.bigbin-fill { width: 100%; height: 85%; display: flex; flex-direction: column-reverse; overflow: hidden; border-radius: 2px; }
.bigbin-fill i { display: block; min-height: 2px; }
.bin-list { display: flex; flex-direction: column; gap: 2px; text-align: left; font-size: 11px; }
.bin-row { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.bin-row .sw { width: 10px; height: 10px; border-radius: 2px; }
.bin-row b { font-weight: 500; font-family: var(--mono); }
.fcol.flash { animation: colflash 1.2s ease-out; }
@keyframes colflash { 0% { box-shadow: inset 0 0 0 2px var(--cyan); } 100% { box-shadow: inset 0 0 0 2px transparent; } }
@media (max-width: 900px) { .loop-step span { display: none; } }
/* #328: the whole process in one line: lot > shred > every station > buckets > refine > money */
.loop.process { display: flex; align-items: stretch; overflow-x: auto; scrollbar-width: thin; }
.p-node { flex: 1 1 0; min-width: 104px; position: relative; align-items: flex-start !important; text-align: left; gap: 2px !important; padding: 7px 10px !important; border-right: 0 !important; }
.p-node::after { display: none; }
.p-node small { font-family: var(--mono); font-size: 10px; letter-spacing: 1.5px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.p-node b { font-family: var(--sans); font-weight: 600 !important; font-size: 12.5px !important; line-height: 1.25; letter-spacing: 0 !important; color: var(--text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; max-width: 100%; }
.p-node span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.p-node.sorter { background: #0d1d27; }
.p-node.money b { color: var(--green); }
.p-node.off b, .p-node.off span { opacity: .55; }
.p-node.on b { color: var(--cyan); }
.p-chips { display: flex; gap: 3px; }
.p-chip { display: inline-block; width: 12px; height: 12px; border-radius: 2px; border: 1px solid rgba(0,0,0,.4); }
.p-bar { display: block; width: 100%; height: 3px; background: var(--line-2); border-radius: 2px; overflow: hidden; margin-top: 2px; }
.p-bar i { display: block; height: 100%; background: var(--green); transition: width .3s linear; }
.p-link { flex: 0 0 16px; position: relative; background: var(--panel-2); }
.p-link::after { content: "\25B6"; position: absolute; right: 2px; top: 50%; transform: translateY(-50%); font-size: 9px; color: var(--line-2); }
.p-link i { position: absolute; left: 0; right: 6px; top: 50%; height: 2px; transform: translateY(-50%); background: var(--line-2); }
.p-link.run i { height: 4px; background: repeating-linear-gradient(90deg, var(--amber) 0 4px, transparent 4px 9px); animation: pflow .6s linear infinite; }
.p-link.run::after { color: var(--amber); }
@keyframes pflow { from { background-position: 0 0; } to { background-position: 9px 0; } }
@media (prefers-reduced-motion: reduce) { .p-link.run i { animation: none; } }
@media (max-width: 900px) { .p-node { min-width: 84px; } .p-node span:not(.p-chips) { display: none; } }

/* game modes */
.modesw { margin-left: auto; display: flex; gap: 0; border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; flex: none; }
.modesw .tool.mode { border: 0; border-radius: 0; }
.modesw .tool.mode.on { background: #103142; color: var(--cyan); }
.mode-b { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mode-b .small { grid-column: 1 / -1; text-align: center; }
.mode-card { display: flex; flex-direction: column; gap: 8px; text-align: left; padding: 16px; font-family: var(--sans); letter-spacing: 0; line-height: 1.4; }
.mode-card b { font-family: var(--mono); font-size: 18px; letter-spacing: 3px; color: var(--cyan); font-weight: 400; }
@media (max-width: 900px) { .mode-b { grid-template-columns: 1fr; } }

/* the auction round (RIVALS mode) */
.round-b { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 14px; flex: 1; }
.round-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.round-side { border-left: 1px solid var(--line); padding-left: 14px; display: flex; flex-direction: column; gap: 8px; }
.round-side h3 { margin: 0; font-family: var(--mono); letter-spacing: 3px; color: var(--cyan); font-weight: 400; font-size: 13px; }
.pls { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.pl { border: 1px solid var(--line-2); border-radius: 4px; padding: 6px 8px; display: flex; flex-direction: column; gap: 2px; background: var(--panel-2); }
.pl b { font-weight: 500; } .pl span { font-size: 11px; color: var(--muted); }
.pl em { font-style: normal; font-family: var(--mono); font-size: 11px; letter-spacing: 1px; color: var(--amber); }
.pl.you { border-color: var(--cyan); } .pl.lead { box-shadow: inset 0 0 0 1px var(--amber); } .pl.won em { color: var(--green); }
.rcards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.rcard { border: 1px solid var(--line-2); border-radius: 6px; padding: 10px; display: flex; flex-direction: column; gap: 6px; background: var(--panel); }
.rcard.now { border-color: var(--amber); box-shadow: 0 0 0 1px var(--amber), 0 8px 24px rgba(0,0,0,.4); }
.rcard.done { opacity: .6; } .rcard.mine { opacity: 1; border-color: var(--green); }
.rc-cat { font-family: var(--mono); letter-spacing: 2px; font-size: 12px; border-left: 4px solid; padding-left: 6px; }
.rc-bin { height: 70px; margin: 0 18px; border: 3px solid #5d6b7b; border-top: 0; border-radius: 0 0 8px 8px; padding: 3px; display: flex; align-items: flex-end; background: #0b1018; }
.rc-fill { width: 100%; height: 85%; display: flex; flex-direction: column; overflow: hidden; border-radius: 2px; }
.rc-fill i { display: block; min-height: 2px; }
.rc-h b { font-family: var(--mono); color: var(--amber); font-weight: 400; }
.rc-d { font-size: 12px; color: var(--muted); }
.rc-comp { display: flex; height: 5px; border-radius: 3px; overflow: hidden; background: var(--line); }
.rc-comp i { display: block; height: 100%; }
.rc-price { font-family: var(--mono); font-size: 14px; color: var(--cyan); margin-top: auto; display: flex; flex-direction: column; }
.rc-price span { font-size: 11px; color: var(--amber); }
.rc-price.sold { color: var(--green); font-size: 12px; } .rc-price.wait { color: var(--muted); font-size: 12px; }
.round-act { display: flex; gap: 10px; align-items: center; }
.round-act button { padding: 10px 16px; font-size: 14px; }
.round-log { font-family: var(--mono); font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.round-log div:first-child { color: var(--text); }
.round-next { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.round-next button { padding: 10px 18px; font-size: 14px; }
.round-next .warn { color: var(--amber); margin: 0; }
.mk-hc { border: 1px solid var(--line-2); border-radius: 4px; padding: 6px 8px; }
.mk-hc b { font-family: var(--mono); letter-spacing: 2px; font-weight: 400; }
.mk-hc.hot { border-color: var(--green); } .mk-hc.hot b, .mk-hc.hot span { color: var(--green); }
.mk-hc.cold { border-color: var(--red); } .mk-hc.cold b, .mk-hc.cold span { color: var(--red); }
.mk-t .r { display: grid; grid-template-columns: minmax(0, 1fr) 70px 54px; gap: 6px; font-family: var(--mono); font-size: 11px; padding: 2px 0; border-bottom: 1px dotted var(--line); align-items: center; }
.mk-t .r.h { color: var(--muted); font-size: 11px; letter-spacing: 1px; }
.mk-t .r i { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 5px; }
.mk-t .r span:nth-child(n+2) { text-align: right; }
.mk-t .up { color: var(--green); } .mk-t .down { color: var(--amber); }
@media (max-width: 900px) { .round-b { grid-template-columns: 1fr; } .round-side { border-left: 0; padding-left: 0; } .rcards, .pls { grid-template-columns: 1fr; } }

/* station settings on the plant screen (#63) */
.fset { display: flex; flex-direction: column; gap: 3px; margin: 2px 0 4px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 3px; background: #0d141c; cursor: default; }
.fset-r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; }
.fset-l { font-size: 11px; color: var(--muted); text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fset-c { display: flex; align-items: center; gap: 4px; }
.fset-b { width: 22px; height: 20px; padding: 0; font-size: 14px; line-height: 1; }
.fset-v { min-width: 64px; text-align: center; font-family: var(--mono); font-size: 11px; color: var(--cyan); }
.flow-margin { font-family: var(--mono); font-size: 12px; letter-spacing: 1px; color: var(--muted); padding: 0 2px 10px; }
.flow-margin b { font-weight: 400; } .flow-margin .ok { color: var(--green); } .flow-margin .bad { color: var(--red); }
.flow-margin .dm { margin-left: 6px; padding: 1px 6px; border: 1px solid currentColor; border-radius: 2px; }

/* run the whole lot (#74) */
#btn-runlot { white-space: nowrap; }
#btn-runlot.running { border-color: var(--red); color: var(--red); background: #3a1118; }
.lotcard .rows { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; margin: 10px 0; font-size: 13px; }
.lotcard .rows b { font-family: var(--mono); font-weight: 400; text-align: right; }

/* Rivals match (#72, #77) and auction looks (#71) */
.emb { display: inline-flex; align-items: center; justify-content: center; width: 16px; height: 16px; border-radius: 50%; font-style: normal; font-family: var(--mono); font-size: 11px; color: #0b1018; margin-right: 5px; vertical-align: -2px; }
.pl { border-left: 3px solid var(--pc, var(--line-2)); }
.pl-w { font-family: var(--mono); color: var(--text) !important; font-size: 12px !important; }
.pl-w small { color: var(--muted); font-size: 11px; }
.match-len { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.match-len .ml.on { border-color: var(--cyan); color: var(--cyan); background: #103142; }
.rc-artwrap { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 8px; align-items: end; }
.rc-art { width: 64px; height: 48px; }
.rc-artwrap .rc-bin { margin: 0; }
.rcard { position: relative; overflow: hidden; }
.stamp { position: absolute; top: 38%; left: 50%; transform: translate(-50%, -50%) rotate(-14deg); border: 3px solid; border-radius: 6px; padding: 4px 12px; font-family: var(--mono); font-size: 18px; letter-spacing: 3px; background: rgba(11, 16, 24, .72); animation: stampin .35s ease-out; pointer-events: none; }
@keyframes stampin { 0% { transform: translate(-50%, -50%) rotate(-14deg) scale(2.2); opacity: 0; } 100% { transform: translate(-50%, -50%) rotate(-14deg) scale(1); opacity: 1; } }
.rc-price.pop0, .rc-price.pop1 { animation: bidpop .4s ease-out; }
.rc-price.pop1 { animation-name: bidpop2; }
@keyframes bidpop { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes bidpop2 { 0% { transform: scale(1.25); } 100% { transform: scale(1); } }
.standings { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }
.standings h3 { margin: 0; font-family: var(--mono); letter-spacing: 3px; color: var(--cyan); font-weight: 400; }
.standings p { margin: 0; font-size: 16px; } .standings .ok { color: var(--green); } .standings .warn { color: var(--amber); }
.st-t { width: 100%; max-width: 640px; }
.st-t .r { display: grid; grid-template-columns: 30px minmax(0, 1fr) 120px 50px 80px; gap: 8px; padding: 6px 4px; border-bottom: 1px solid var(--line); font-family: var(--mono); font-size: 13px; align-items: center; }
.st-t .r.h { color: var(--muted); font-size: 11px; letter-spacing: 1px; } .st-t .r.you { color: var(--cyan); }
.st-t .r span:nth-child(n+3) { text-align: right; }

/* ---------- the lot card (#64) ---------- */
.lotcard-panel { display: flex; flex-direction: column; gap: 8px; }
.lc-h { display: flex; flex-direction: column; gap: 2px; }
.lc-h b { font-family: var(--mono); color: var(--amber); font-weight: 400; letter-spacing: 1px; font-size: 15px; }
.lc-h span { font-size: 14px; }
.lc-bin { height: 84px; margin: 2px 26px; border: 3px solid #5d6b7b; border-top: 0; border-radius: 0 0 10px 10px; padding: 4px; display: flex; align-items: flex-end; background: #0b1018; }
.lc-fill { width: 100%; height: 88%; display: flex; flex-direction: column; overflow: hidden; border-radius: 2px; }
.lc-fill i { display: block; min-height: 2px; }
.lc-t { display: flex; flex-wrap: wrap; column-gap: 8px; justify-content: space-between; align-items: baseline; font-size: 13px; }
.lc-t b, .lc-t span { white-space: nowrap; }   /* #353: '10,000 t' and 'paid $134/t' wrap as whole pieces */
.lc-t b { font-family: var(--mono); font-size: 16px; font-weight: 400; color: var(--text); margin-right: 4px; }
.lc-t span { color: var(--muted); font-size: 12px; }
.lc-comp { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line); }
.lc-comp i { display: block; height: 100%; }
.lc-m { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 6px; align-items: center; font-size: 13px; }
.lc-m .sw { width: 10px; height: 10px; border-radius: 2px; }
.lc-m b { font-family: var(--mono); font-weight: 400; }
.lc-empty { display: flex; flex-direction: column; gap: 10px; align-items: stretch; text-align: center; padding: 10px 0; }
.lc-empty .lc-go { padding: 14px; font-size: 16px; letter-spacing: 2px; }
.lc-yard { display: flex; flex-direction: column; gap: 4px; border-top: 1px dashed var(--line-2); padding-top: 6px; }
.lc-y { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; align-items: center; font-size: 12px; }
.lot-tons { margin-top: 2px; }

/* ---------- the idle plant (#65) ---------- */
.flow-wrap { position: relative; min-width: 0; display: flex; }
.flow-wrap #flow-nodes { flex: 1; }
#flow-nodes.idle .fcol.mach, #flow-nodes.idle .fcol.bincol { opacity: .45; filter: grayscale(.8); }
.flow-cta { position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 40; pointer-events: none; }
.cta-card { pointer-events: auto; display: flex; align-items: center; gap: 10px; padding: 6px 8px 6px 12px; background: rgba(12, 18, 26, .94); border: 1px solid var(--line-2, #2a3a4c); border-radius: 4px; box-shadow: 0 4px 16px rgba(0,0,0,.4); }
.cta-card b { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--amber); font-weight: 400; white-space: nowrap; }
.cta-card button { padding: 4px 10px; font-size: 11px; letter-spacing: 1px; white-space: nowrap; }

/* ---------- conveyors (#66) ---------- */
.fcol { position: relative; }
.fcol.mach, .fcol.bincol { padding-bottom: 58px; }
/* #397: one conveyor under the stations, a canvas per column; it runs on into the next column across the divider */
.conv { position: absolute; left: 0; right: -2px; bottom: 0; width: calc(100% + 2px); height: 52px; z-index: 1; pointer-events: none; }
.plant-running .bigbin-fill { animation: binshake .6s ease-in-out infinite alternate; }
@keyframes binshake { from { transform: translateY(0); } to { transform: translateY(-2px); } }

/* ---------- bigger, brighter machines (#67) ---------- */
.fn-camwrap { border-color: #2a3a4b; }
.fn-cam { filter: brightness(1.35) contrast(1.08); }
.fn-n { font-size: 16px; }
.fbin-fill { transition: height .4s ease-out; }

/* ---------- the bucket shelf (#68) ---------- */
.bk.shelf { grid-template-columns: 46px minmax(0, 1fr) auto auto; padding: 8px; }
.bk.misc { grid-template-columns: 46px minmax(0, 1fr) auto; }
.unit { display: block; justify-self: center; width: var(--us); height: var(--us); background: var(--uc); position: relative; }
.unit.bale { border-radius: 3px; box-shadow: inset 0 0 0 2px rgba(0,0,0,.25); background-image: linear-gradient(90deg, transparent 30%, rgba(0,0,0,.35) 30% 36%, transparent 36% 64%, rgba(0,0,0,.35) 64% 70%, transparent 70%); }
.unit.bag { border-radius: 30% 30% 22% 22%; box-shadow: inset 0 -4px 0 rgba(0,0,0,.25); }
.unit.bin { background: transparent; border: 3px solid #6c7a89; border-top: 0; border-radius: 0 0 4px 4px; box-shadow: inset 0 calc(var(--us) * -0.6) 0 var(--uc); }
.unit.drum { border-radius: 6px / 3px; width: calc(var(--us) * .72); background-image: linear-gradient(0deg, transparent 30%, rgba(0,0,0,.3) 30% 36%, transparent 36% 64%, rgba(0,0,0,.3) 64% 70%, transparent 70%); }
.unit.bar { height: calc(var(--us) * .5); clip-path: polygon(14% 0, 86% 0, 100% 100%, 0 100%); align-self: center; }
.unit.heap { background: repeating-linear-gradient(45deg, #6b7684 0 4px, #4a5562 4px 8px); clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.bk.shelf button, .bk.misc button { padding: 7px 10px; font-size: 12px; }
/* #411: one step at a time */
.scene-tog { display: inline-flex; margin-left: 10px; vertical-align: middle; border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; }
.scene-tog button { white-space: nowrap; padding: 2px 8px; font-size: 10px; letter-spacing: 1px; border: 0; border-radius: 0; background: transparent; color: var(--muted); }
.scene-tog button.on { background: #14202c; color: var(--cyan); }
#flow-nodes.scenes { grid-template-columns: minmax(0, 1fr); }
#flow-nodes.scenes .fcol { border-right: 0; }
#flow-nodes.scenes .fcol > * { width: 100%; max-width: 640px; margin-left: auto; margin-right: auto; }
#flow-nodes.scenes .fcol > .conv { max-width: none; }
#flow-nodes.scenes .fcol.mach { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: auto 1fr; align-items: start; column-gap: 18px; }
#flow-nodes.scenes .fcol.mach > .fn-k { grid-column: 1 / -1; }
#flow-nodes.scenes .fcol.mach > * { max-width: none; }
.sc-l, .sc-r { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.sc-r { text-align: left; }
#flow-nodes.scenes .fn-camwrap { max-width: 520px; margin: 0 auto; }
#flow-nodes.scenes .fcol { overflow-y: auto; overflow-x: hidden; }
@media (max-width: 900px) { #flow-nodes.scenes .fcol.mach { display: flex; } }
#flow-nodes.scenes .fcol.buckets .bk-list { max-width: 640px; margin: 0 auto; width: 100%; }
.fcol.pick { justify-content: flex-start; align-items: stretch; gap: 10px; }
.pick-left .bin-bands { display: flex; height: 10px; margin-top: 6px; border-radius: 2px; overflow: hidden; }
.pick-left .bin-bands i { display: block; }
.pick-list { display: flex; flex-direction: column; gap: 6px; text-align: left; }
.pick-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 8px; border: 1px solid var(--line-2); border-radius: 3px; background: var(--panel); }
.pick-row.best { border-color: var(--green); }
.pick-row.cur { border-style: dashed; }
.pick-t { display: flex; flex-direction: column; min-width: 0; }
.pick-t b { font-weight: 500; }
.pick-row button { padding: 6px 10px; font-size: 12px; white-space: nowrap; }
.pick-done { display: flex; flex-direction: column; gap: 4px; padding: 10px; border: 1px dashed var(--line-2); border-radius: 3px; }
.pick-done b { font-family: var(--mono); letter-spacing: 1.5px; color: var(--amber); font-weight: 400; }
.pick-done.ok b { color: var(--green); }
.fcol.pick > button { align-self: center; width: auto; }
@media (max-width: 900px) { .pick-row { grid-template-columns: minmax(0, 1fr) auto; } .pick-row button { grid-column: 1 / -1; } #flow-panel > h2 { flex-wrap: wrap; } .scene-tog { display: flex; width: max-content; margin: 6px 0 0; } }

/* #398: end buckets as bins that fill up */
.vbin { display: block; justify-self: center; position: relative; width: 36px; height: 46px; border: 2px solid #6c7a89; border-top: 0; border-radius: 0 0 5px 5px; background: #0b1018; overflow: hidden; transition: box-shadow .3s, border-color .3s; }
.vbin::before { content: ''; position: absolute; left: -2px; right: -2px; top: 0; height: 2px; background: #8a97a6; }
.vbin-fill { position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column; background: var(--c); background-image: repeating-linear-gradient(135deg, rgba(255,255,255,.12) 0 3px, transparent 3px 7px), linear-gradient(0deg, rgba(0,0,0,.3), transparent 70%); transition: height .9s cubic-bezier(.3,.7,.4,1); }
.vbin-fill i { display: block; flex: none; background: repeating-linear-gradient(45deg, #5d6773 0 2px, #424b56 2px 4px); }
.vbin.ready { border-color: var(--green); box-shadow: 0 0 10px rgba(92,255,177,.35); }
.vbin.lit { animation: binlit 1.6s ease-out 2; }
@keyframes binlit { 0%, 100% { box-shadow: 0 0 10px rgba(92,255,177,.35); } 40% { box-shadow: 0 0 22px rgba(92,255,177,.9); } }
.bk-ready { font-family: var(--mono); font-size: 12px; color: var(--green); margin-left: 4px; }
.pband { position: relative; display: block; height: 5px; margin-top: 4px; background: #1a222c; border-radius: 2px; overflow: visible; }
.pband i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--amber); border-radius: 2px; }
.pband.ok i { background: var(--green); }
.pband b { position: absolute; left: 90%; top: -2px; bottom: -2px; width: 2px; background: #c9d4de; }
.bk.misc .mischeap { align-self: end; }
@media (prefers-reduced-motion: reduce) { .vbin-fill { transition: none; } .vbin.lit { animation: none; } }
.reduce-motion .vbin-fill { transition: none; }
.reduce-motion .vbin.lit { animation: none; }
.flymoney { position: fixed; z-index: 90; transform: translate(-50%, 0); font-family: var(--mono); font-size: 18px; color: var(--green); text-shadow: 0 0 8px rgba(92,255,177,.6); pointer-events: none; transition: transform .7s cubic-bezier(.3,.7,.4,1), opacity .7s ease-in; }
.flymoney.neg { color: var(--red); }
#money.bump { animation: bankbump .5s ease-out; }
@keyframes bankbump { 0% { transform: scale(1.3); color: var(--green); } 100% { transform: scale(1); } }

/* ---------- calmer type (#69) ---------- */
.fn-k, .fn-sub { letter-spacing: 1.5px; }
.fn-s, .fbin-t span, .bk-t .small, .rc-d { font-size: 12.5px; }
.flow-feed, .flow-margin { font-size: 13px; letter-spacing: .5px; }
.loop-step b { letter-spacing: 1.5px; }
.loop-step span { font-size: 11px; color: var(--text); opacity: .75; }
.loop-step.on span { opacity: 1; }

/* milestones (#73) */
.ms { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; padding: 5px 0; border-bottom: 1px dotted var(--line); }
.ms > span:last-child { display: flex; flex-direction: column; }
.ms b { font-weight: 500; }
.ms-ic { width: 18px; height: 18px; border: 1px solid var(--line-2); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: #0b1018; font-size: 12px; }
.ms.done .ms-ic { background: var(--green); border-color: var(--green); }
.ms.done b { color: var(--green); }
.toast { position: fixed; top: 70px; left: 50%; transform: translate(-50%, -20px); opacity: 0; z-index: 95; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 22px; background: rgba(12, 18, 26, .96); border: 1px solid var(--amber); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.5); transition: transform .35s ease-out, opacity .35s ease-out; pointer-events: none; }
.toast.in { transform: translate(-50%, 0); opacity: 1; }
.toast b { font-family: var(--mono); letter-spacing: 3px; color: var(--amber); font-weight: 400; font-size: 12px; }
.toast span { font-size: 16px; }
.fset-q { font-style: normal; display: inline-block; width: 13px; height: 13px; line-height: 13px; text-align: center; border: 1px solid var(--line-2); border-radius: 50%; font-size: 10px; color: var(--muted); margin-left: 3px; cursor: help; }
.fset-r[title] { cursor: help; }
.fset-note { font-family: var(--mono); font-size: 11px; color: var(--amber); padding-top: 3px; border-top: 1px dotted var(--line); }
.sv-row { display: flex; gap: 8px; align-items: center; margin: 6px 0; flex-wrap: wrap; }
.sv-code { width: 100%; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 3px; color: var(--cyan); font-family: var(--mono); font-size: 11px; padding: 6px; resize: vertical; }
.sv-msg.bad { color: var(--red); } .sv-msg.warn { color: var(--amber); }
.samp { font-size: 11px; padding: 4px 8px; }
.cd.sampled, .rc-d.sampled { color: var(--cyan); }
.rep { color: var(--muted); font-size: 11px; }

/* the guided first lot (#79) */
.guide { position: fixed; inset: 0; z-index: 85; pointer-events: none; }
.g-ring { position: fixed; border: 2px solid var(--amber); border-radius: 8px; box-shadow: 0 0 0 4000px rgba(5, 9, 14, .45), 0 0 18px rgba(255, 178, 92, .6); transition: all .25s ease-out; pointer-events: none; }
.g-box { position: fixed; pointer-events: auto; display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; background: var(--panel); border: 1px solid var(--amber); border-radius: 8px; box-shadow: 0 12px 34px rgba(0,0,0,.6); transition: left .25s, top .25s; }
.g-step { font-family: var(--mono); font-size: 11px; letter-spacing: 2px; color: var(--muted); }
.g-title { font-family: var(--mono); letter-spacing: 2px; color: var(--amber); font-weight: 400; }
.g-text { margin: 0; font-size: 14px; line-height: 1.45; }
.g-btns { display: flex; justify-content: space-between; gap: 8px; }

/* a Progress yard is permanent: only a Rivals match can be restarted */
#btn-newgame { display: none; }
body[data-mode="rivals"] #btn-newgame { display: inline-block; }

/* ---------- two games, two screens (#87) ---------- */
.title-screen { position: fixed; inset: 0; z-index: 200; display: flex; align-items: flex-start; justify-content: flex-start; padding: 16px; background: radial-gradient(ellipse at 50% 30%, #0f1a26 0%, #070a0f 70%); overflow: auto; }
.title-screen.hidden { display: none; }
.tt-box { width: min(860px, 100%); text-align: center; }
.tt-logo { font-family: var(--mono); font-size: 46px; letter-spacing: 8px; color: var(--text); }
.tt-logo b { color: var(--cyan); font-weight: 400; }
.tt-sub { font-family: var(--mono); font-size: 12px; letter-spacing: 3px; color: var(--muted); margin: 6px 0 26px; }
.tt-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; text-align: left; }
.tt-card { display: flex; flex-direction: column; gap: 10px; padding: 20px; border: 1px solid var(--line-2); border-radius: 6px; background: var(--panel); }
.tt-card b { font-family: var(--mono); font-size: 22px; letter-spacing: 4px; font-weight: 400; }
.tt-card.tt-progress { border-top: 3px solid #7fe3ff; } .tt-card.tt-progress b { color: #7fe3ff; }
.tt-card.tt-rivals { border-top: 3px solid #ff8a5c; } .tt-card.tt-rivals b { color: #ff8a5c; }
.tt-card p { margin: 0; color: var(--muted); line-height: 1.45; flex: 1; }
.tt-save { font-family: var(--mono); font-size: 12px; color: var(--text); padding: 8px 10px; background: var(--panel-2); border-radius: 3px; }
.tt-card button { padding: 10px; letter-spacing: 2px; }
.tt-foot { margin-top: 16px; }
@media (max-width: 700px) { .tt-cards { grid-template-columns: 1fr; } .tt-logo { font-size: 34px; } }
.modesw .tool.mode-menu { border: 0; border-radius: 0; letter-spacing: 2px; }
/* the Rivals screen has its own colour */
body[data-mode="rivals"] { --cyan: #ff9a6b; }
body[data-mode="rivals"] #top { border-bottom-color: #5a2a1c; }
.match-bar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 8px 10px; margin-bottom: 10px; border: 1px solid #5a2a1c; border-radius: 4px; background: linear-gradient(90deg, rgba(255,138,92,.10), rgba(255,138,92,.02)); }
.match-bar.hidden { display: none; }
.mb-round { display: flex; flex-direction: column; min-width: 120px; }
.mb-round b { font-family: var(--mono); letter-spacing: 2px; color: #ff8a5c; font-weight: 400; }
.mb-round span { font-size: 11px; color: var(--muted); }
.mb-table { display: flex; gap: 8px; flex: 1; flex-wrap: wrap; }
.mb-p { display: flex; align-items: baseline; gap: 6px; padding: 4px 8px; border-left: 3px solid var(--pc); background: var(--panel-2); border-radius: 2px; font-size: 12px; }
.mb-p i { font-style: normal; font-family: var(--mono); color: var(--muted); }
.mb-p span { font-family: var(--mono); color: var(--text); }
.mb-p.you b { color: var(--cyan); }
.mb-go { padding: 8px 14px; letter-spacing: 2px; }
.title-screen { --cyan: #7fe3ff; }
body.at-title .guide, body.at-title .cs-tour, body.at-title #flow-cta, body.at-title .toast { display: none; }
/* #140: a drawer with something new in it */
.tool .newb { font-style: normal; font-size: 10px; letter-spacing: 1px; color: #0b1018; background: var(--amber); border-radius: 2px; padding: 0 4px; margin-left: 4px; vertical-align: middle; }
/* #141: one RUN control: RUN / STOP, what it runs, one speed button */
.runpick { display: inline-flex; border: 1px solid var(--line-2); border-radius: 3px; overflow: hidden; }
.runpick.hidden { display: none; }
.runpick button { border: 0; border-radius: 0; padding: 4px 7px; font-size: 11px; letter-spacing: 1px; background: transparent; color: var(--muted); }
.runpick button.on { background: #103142; color: var(--cyan); }
.spd-cycle { min-width: 44px; font-family: var(--mono); }
/* #143: the next sorter on the empty station */
.fcol.add .add-sug { margin-top: 14px; display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center; font-size: 12px; }
.fcol.add .add-sug b { font-weight: 500; }
.fcol.add .add-sug .ok { color: var(--green); font-family: var(--mono); }
/* #144: things on the plant screen that open their menu */
.clicky { cursor: pointer; }
.fcol.bincol.clicky:hover .bigbin { border-color: var(--cyan); }
.bk.clicky:hover { border-color: var(--line-2); background: var(--panel-2); }
#lot-card.flash { animation: lc-flash .9s ease-out; }
@keyframes lc-flash { 0% { box-shadow: 0 0 0 2px var(--cyan), 0 0 24px rgba(127,227,255,.5); } 100% { box-shadow: none; } }
/* #130: a bucket's buttons go on their own line under its name when the column is narrow */
.bk.shelf, .bk.misc { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.bk.shelf > .unit, .bk.misc > .unit { flex: none; }
.bk.shelf > .bk-t, .bk.misc > .bk-t { flex: 1 1 110px; min-width: 0; }
.bk.shelf > button, .bk.misc > button { flex: 1 0 auto; }
.bk .bk-t .small { overflow-wrap: anywhere; }
/* #131: the header stays on one line */
#top { gap: 16px; white-space: nowrap; }
#top .brand .sub { white-space: nowrap; }
#btn-run { white-space: nowrap; }
#btn-run .proj { display: block; font-size: 11px; }
@media (max-width: 1400px) { #top .brand .sub { display: none; } }
@media (max-width: 1250px) { #run-net { display: none; } #top .tele .val { font-size: 16px; } }
@media (max-width: 1050px) { #top .tele.clock { display: none; } }
/* #132 #135: the left column: the loaded lot, the next step, the last batch */
.nextcard .ns-t { font-family: var(--mono); font-size: 11px; letter-spacing: 3px; color: var(--amber); }
.nextcard .ns-s { font-size: 13px; color: var(--text); margin: 4px 0 10px; line-height: 1.4; }
.nextcard button { width: 100%; padding: 10px; letter-spacing: 2px; }
.lastcard .lb-n { font-family: var(--mono); font-size: 22px; }
.lastcard .lb-n.ok { color: var(--green); } .lastcard .lb-n.bad { color: var(--red); }
body.lay #app { grid-template-columns: 270px minmax(0, 1fr); }
/* #137: drawers slide in at the side, under the header and toolbar: RUN, the bank and the batch stay in view */
#drawer.overlay { top: 94px; left: auto; right: 0; width: min(640px, 100%); padding: 0; background: transparent; align-items: stretch; justify-content: flex-end; z-index: 38; }
#drawer .sheet { width: 100%; max-height: none; height: 100%; border-radius: 0; border-width: 0 0 0 1px; box-shadow: -18px 0 40px rgba(0,0,0,.55); animation: drawer-in .18s ease-out; }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
/* #136: settings */
.set-b { display: flex; flex-direction: column; gap: 8px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 3px; background: var(--panel-2); }
.set-row > span { display: flex; flex-direction: column; gap: 2px; }
.set-row b { font-weight: 500; }
.set-row button { min-width: 110px; }
#settings { z-index: 210; }
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }   /* #258: the OS setting, before any choice is stored */
/* #133: phones and small laptops */
@media (max-width: 900px) {
  body.lay #app { grid-template-columns: minmax(0, 1fr); grid-template-areas: "top" "tool" "left" "center"; }   /* the loaded lot and NEXT STEP come before the plant */
  #left { padding-bottom: 0; }
  #last-card { display: none; }
  #drawer.overlay { top: 0; width: 100%; z-index: 60; }   /* a drawer is the whole screen; CLOSE brings the plant back */
  body.lay #scorecard { z-index: 65; }   /* #317: the LOT DONE card shows over the full-screen drawer */
  #drawer .sheet { border-left: 0; }
  .runbox:not(:has(#btn-run.running)) .progress { display: none; }
}
@media (max-width: 640px) {
  #top { gap: 8px 12px; padding: 6px 8px; }
  .logo { font-size: 17px; }
  #top .tele .val { font-size: 15px; }
  body:not(.mode-rivals) #top .tele:has(#rank) { display: none; }   /* Rivals keeps its match place here (#264) */
  #top .speed .lbl { display: none; }
  #top .icon { width: 30px; height: 30px; padding: 0; }
  #toolbar { gap: 4px; padding: 4px 6px; overflow-x: auto; }
  #toolbar .tool { padding: 6px 9px; font-size: 12px; }
  .lotcard-panel .lc-pic, .lotcard-panel .bigbin { max-height: 70px; }
  .title-screen .tt-logo { font-size: 30px; letter-spacing: 5px; }
}
@media (max-width: 1100px) { .runbox:not(:has(#btn-run.running)) .progress { display: none; } #top { gap: 10px; } #top .speed .lbl { display: none; } }

/* #134: button roles. primary = the one thing to do here; buy = spends money; danger = wipes or gives up something; plain = everything else */
button.danger { border-color: #5a2a33; color: #ff9aa5; }
button.danger:hover { border-color: var(--red); color: var(--red); background: #2a1216; }
button.primary, button.buy, button.danger, button { min-height: 28px; }
.panel h2 { font-size: var(--fs-3); }
.panel h3 { font-size: var(--fs-1); margin: var(--sp-3) 0 var(--sp-1); }
.empty, .small.empty { color: var(--muted); font-size: var(--fs-2); padding: var(--sp-3); text-align: center; border: 1px dashed var(--line-2); border-radius: 3px; }
/* toolbar icons: what each drawer is for at a glance */
#toolbar .tool[data-key]::before { display: inline-block; width: 1.2em; margin-right: 4px; color: var(--muted); font-family: var(--mono); }
#tool-auction::before { content: "◆"; }
#tool-plant::before { content: "⚙"; }
#tool-sell::before { content: "$"; }
#tool-records::before { content: "≡"; }
#toolbar .tool.on::before { color: var(--cyan); }
/* #391: at phone width the drawer icons go, so MENU stays on screen without scrolling the toolbar */
@media (max-width: 420px) { #toolbar .tool[data-key]::before { display: none; } #toolbar .tool { padding: 6px 8px; } }
/* #391: on a short landscape screen the floating NOTHING LOADED bar sat on NEXT STEP's text; NEXT STEP carries the same button */
@media (max-height: 480px) { .flow-cta { display: none; } }

/* #122: the station cam fills its column at 4:3 */
.fn-camwrap { aspect-ratio: 16 / 10; }

/* #123: THE BIN is a heap of shred on a canvas */
.bigbin canvas.heap { display: block; width: 100%; height: 100%; }
.bigbin { padding: 0 2px; }

/* #124: product forms */
.unit.svg { background: none; box-shadow: none; clip-path: none; width: var(--us); height: var(--us); }
.unit.svg svg { display: block; width: 100%; height: 100%; }

/* #125: the belt moves its own pattern at the line's pace, with rollers under it */
.plant-running .belt-load { animation: beltmove2 var(--bd, 1.2s) linear infinite; }
@keyframes beltmove2 { from { background-position: 0 0; } to { background-position: var(--bp, 36px) 0; } }
.belt::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: radial-gradient(circle at 6px 50%, #6c7a89 1.4px, transparent 1.6px) 0 0 / 12px 3px repeat-x; opacity: .7; }

/* #127: the auction moves: cards dealt in, a paddle up for every bid, a flash for the yard that takes a bin */
.rcards.deal .rcard { animation: rc-deal .45s cubic-bezier(.2,.8,.3,1.2) both; }
.rcards.deal .rcard:nth-child(2) { animation-delay: .12s; } .rcards.deal .rcard:nth-child(3) { animation-delay: .24s; }
@keyframes rc-deal { from { transform: translateY(-30px) rotate(-4deg) scale(.9); opacity: 0; } to { transform: none; opacity: 1; } }
.pl.paddle0 .emb, .pl.paddle1 .emb { display: inline-block; }
.pl.paddle0 .emb { animation: paddle0 .45s ease-out; } .pl.paddle1 .emb { animation: paddle1 .45s ease-out; }
@keyframes paddle0 { 0% { transform: none; } 35% { transform: translateY(-9px) rotate(-12deg) scale(1.25); } 100% { transform: none; } }
@keyframes paddle1 { 0% { transform: none; } 35% { transform: translateY(-9px) rotate(12deg) scale(1.25); } 100% { transform: none; } }
.pl.gotbin { animation: gotbin .9s ease-out; }
@keyframes gotbin { 0% { box-shadow: 0 0 0 0 var(--pc); } 30% { box-shadow: 0 0 0 3px var(--pc), 0 0 22px var(--pc); } 100% { box-shadow: none; } }

/* #128: the title screen's yard */
.title-screen canvas.tt-yard { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.title-screen .tt-box { position: relative; z-index: 1; margin: auto; }   /* #317: centred by auto margins, so a box taller than a short screen scrolls instead of clipping its top */
.tt-card { background: rgba(12, 18, 26, .9); }
.tt-ic { width: 48px; height: 32px; }

/* #129: the refinery at the end of the line */
.refbox { margin-top: 10px; padding: 6px; border: 1px solid #5a3a28; border-radius: 4px; background: #160f0b; display: flex; flex-direction: column; align-items: center; gap: 2px; cursor: pointer; }
.refbox svg { width: 100%; max-width: 180px; height: auto; }
.refbox .rf-glow { fill: #ff7a2e; animation: rf-flicker 1.4s ease-in-out infinite alternate; }
@keyframes rf-flicker { from { fill: #ff6a20; opacity: .75; } to { fill: #ffb25c; opacity: 1; } }
.refbox .rf-stream { stroke: #ffb25c; opacity: 0; }
.refbox .rf-ingot { fill: #6b5a4a; }
.refbox.pour .rf-stream { opacity: 1; animation: rf-pour .4s linear infinite; }
@keyframes rf-pour { from { stroke-dasharray: 2 3; stroke-dashoffset: 0; } to { stroke-dasharray: 2 3; stroke-dashoffset: -5; } }
.refbox.pour .rf-ingot { fill: #ff9a4a; transition: fill 2.4s; }
.refbox .rf-smoke { opacity: .5; }

/* #120: volume sliders */
.set-row.vol { display: grid; grid-template-columns: 1fr 160px 44px; }
.set-row.vol input { width: 100%; }
.set-row .vol-v { text-align: right; font-size: 12px; color: var(--muted); }

/* the bid guide on lots and bins */
.est { color: var(--green); font-family: var(--mono); font-size: 11px; }
.est.bad { color: var(--amber); }

/* the 'could not load its files' notice in index.html: hidden whenever this stylesheet loads */
#asset-warn { display: none !important; }
