/* WORKERS: IMD-inspired control room. Black, white, mono, hairlines; green = mined/live, red = alert. */
:root {
  --bg: #000;
  --fg: #fff;
  --mute: #9a9a9a;
  --dim: #3b3b3b;
  --line: #262626;
  --panel: #0a0a0a;
  --code: #141414;
  --green: #3ecf7a;
  --green-soft: #b0edba;
  --red: #ff6b62;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--fg); font: 13px/1.6 var(--mono); }
a { color: inherit; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.muted { color: var(--mute); }
.small { font-size: 12px; }

/* top bar */
.top { display: flex; align-items: center; gap: 28px; padding: 16px 34px; }
.logo { display: flex; align-items: stretch; height: 40px; border: 1px solid var(--fg); text-decoration: none; }
.logo-mark { width: 40px; display: grid; place-items: center; border-right: 1px solid var(--fg); background: #000; }
.logo-mark img { width: 32px; height: 32px; image-rendering: pixelated; display: block; }
.logo-word { display: flex; align-items: center; padding: 0 16px 0 18px; font-weight: 600; letter-spacing: .35em; }
.logo-word .cur { font-style: normal; color: var(--green); letter-spacing: 0; animation: blink 1s steps(2) infinite; }
nav { display: flex; gap: 28px; }
nav a { text-decoration: none; font-weight: 600; letter-spacing: .08em; font-size: 12px; }
nav a:hover { color: var(--green); }
.net { margin-left: auto; color: var(--mute); font-size: 11px; letter-spacing: .1em; }
.connect { height: 40px; padding: 0 18px; border: 1px solid var(--fg); font-weight: 600; letter-spacing: .1em; font-size: 12px; }
.connect:hover, .connect.on { background: var(--fg); color: var(--bg); }

/* the wall */
.wall-wrap { position: relative; margin: 0 34px; border: 1px solid #d6d6d2; overflow: hidden; }
.wall { display: grid; gap: 0; background: #0a0a0a; }
.wall img { width: 100%; aspect-ratio: 1; display: block; image-rendering: pixelated;
  filter: grayscale(1) contrast(1.15) brightness(.82); transition: filter .6s; }
.wall img.mined { filter: none; }
.wall img.fresh { filter: none; outline: 2px solid var(--green); outline-offset: -2px; z-index: 1; position: relative; }

.console { z-index: 5; position: absolute; left: 50%; bottom: 34px; transform: translateX(-50%); width: min(760px, calc(100% - 48px));
  background: rgba(6, 12, 8, .94); border: 1px solid #2e4a36; box-shadow: 0 0 0 6px rgba(0,0,0,.55);
  color: #cfe9d5; font-size: 12px; padding: 14px 16px 10px; }
.con-head, .con-foot { display: flex; gap: 22px; color: #8fb79a; }
.con-head b, .con-foot b { color: var(--fg); font-weight: 500; }
.con-right { margin-left: auto; }
.dot { display: inline-block; width: 7px; height: 7px; background: var(--green); margin-right: 8px; vertical-align: 1px; animation: blink 1.6s steps(2) infinite; }
.con-title { margin: 12px 0 4px; color: var(--red); }
.con-title .muted { color: #6f8a76; }
.log { height: 168px; overflow: hidden; display: flex; flex-direction: column; justify-content: flex-end; color: #a9cdb2; }
.log div { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.log .t { color: #6f8a76; }
.log .ok { color: var(--green); }
.log .gold { color: #ffd650; }
.log .new { color: var(--fg); font-weight: 500; }
.prompt { margin: 10px 0 8px; padding: 6px 10px; border: 1px solid #2e4a36; color: #8fb79a; }
.caret { color: var(--green); }
.cursor { display: inline-block; width: 7px; height: 13px; background: var(--red); vertical-align: -2px; animation: blink 1s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0; } }

/* sections: docs-style label column + body */
.block { display: grid; grid-template-columns: 220px minmax(0, 720px); gap: 48px; padding: 72px 34px 0; margin: 0 auto; max-width: 1100px; }
.block .label { color: var(--mute); font-size: 11px; letter-spacing: .14em; padding-top: 8px; border-top: 1px solid var(--line); }
.block .body { border-top: 1px solid var(--line); padding-top: 4px; }
h2 { font-size: 24px; font-weight: 600; margin: 4px 0 10px; letter-spacing: -.01em; }
.lead { color: var(--mute); max-width: 640px; margin: 0 0 26px; }

/* miner: one surface, hairline rows */
.miner { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 150px 1fr; align-items: center; min-height: 46px; border-bottom: 1px solid var(--line); }
.k { color: var(--mute); font-size: 11px; letter-spacing: .1em; }
.v b { font-weight: 500; }
.seg { display: inline-flex; border: 1px solid var(--dim); margin-right: 18px; }
.seg button { padding: 3px 12px; font-size: 12px; color: var(--mute); }
.seg button.on { background: var(--fg); color: var(--bg); }
.threads button { width: 22px; border: 1px solid var(--dim); margin: 0 6px; }
.actions .v { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.btn { height: 36px; padding: 0 16px; border: 1px solid var(--fg); font-weight: 600; letter-spacing: .08em; font-size: 12px; }
.btn:hover { background: var(--fg); color: var(--bg); }
.btn.primary { background: var(--green); border-color: var(--green); color: #000; }
.btn.primary:hover { background: var(--green-soft); border-color: var(--green-soft); }
.btn.primary.running { background: var(--red); border-color: var(--red); }
.minerlog { background: var(--code); color: #cfcfcf; padding: 14px 16px; margin: 18px 0 0; height: 132px; overflow: hidden; font: 12px/1.6 var(--mono); }

/* after the mint */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.steps > div { padding: 16px 16px 18px 0; display: flex; flex-direction: column; gap: 4px; }
.steps > div + div { padding-left: 16px; border-left: 1px solid var(--line); }
.steps .n { color: var(--green); font-size: 11px; }
.steps span:last-child { color: var(--mute); font-size: 12px; }
.eras { margin-top: 26px; display: grid; grid-template-columns: 120px 1fr 90px; row-gap: 6px; align-items: center; font-size: 12px; }
.eras .bar { height: 10px; background: var(--code); position: relative; }
.eras .bar i { position: absolute; inset: 0 auto 0 0; background: var(--fg); }
.eras .r { text-align: right; color: var(--mute); }

/* token */
.alloc { display: flex; height: 34px; border: 1px solid var(--line); margin-bottom: 8px; }
.alloc div { display: flex; align-items: center; padding: 0 8px; font-size: 11px; white-space: nowrap; overflow: hidden; border-right: 1px solid #000; }
.alloc-legend { display: flex; gap: 18px; flex-wrap: wrap; color: var(--mute); font-size: 11px; margin-bottom: 24px; }
.alloc-legend i { display: inline-block; width: 9px; height: 9px; margin-right: 6px; vertical-align: 0; }
.kv > div { display: grid; grid-template-columns: 150px 1fr; padding: 10px 0; border-bottom: 1px solid var(--line); }
.kv > div:first-child { border-top: 1px solid var(--line); }

footer { display: flex; justify-content: space-between; padding: 80px 34px 34px; color: var(--fg); font-size: 12px; }

/* phone */
@media (max-width: 760px) {
  .top { flex-wrap: wrap; gap: 14px; padding: 14px 16px; }
  nav { order: 3; width: 100%; gap: 18px; }
  .net { display: none; }
  .connect { margin-left: auto; }
  .wall-wrap { margin: 0 16px; }
  .console { position: relative; left: 0; bottom: 0; transform: none; width: 100%; box-shadow: none; border-width: 1px 0 0; }
  .con-head { flex-wrap: wrap; gap: 4px 14px; }
  .block { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 48px 16px 0; }
  .v, .kv span { min-width: 0; overflow-wrap: anywhere; }
  .seg { margin-right: 10px; }
  .actions .v { flex-wrap: wrap; }
  .btn { white-space: nowrap; }
  .minerlog { white-space: pre-wrap; word-break: break-all; }
  .block .body { border-top: 0; }
  .row, .kv > div { grid-template-columns: 110px 1fr; }
  .steps { grid-template-columns: 1fr 1fr; }
  .steps > div:nth-child(3) { padding-left: 0; border-left: 0; }
  .steps > div:nth-child(n+3) { border-top: 1px solid var(--line); }
  .eras { grid-template-columns: 70px 1fr 70px; }
  footer { padding: 56px 16px 24px; }
}

/* ---------------------------------------------------------------- the floor (app) */
nav a.here { color: var(--green); }
.app { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 48px; max-width: 1180px; margin: 0 auto; padding: 36px 34px 0; }
.side { position: sticky; top: 24px; align-self: start; display: flex; flex-direction: column; }
.side .grp { color: var(--mute); font-size: 11px; letter-spacing: .14em; margin: 22px 0 8px; }
.side .grp:first-child { margin-top: 0; }
.side a { text-decoration: none; padding: 6px 0 6px 12px; border-left: 1px solid var(--line); color: #cfcfcf; }
.side a:hover { color: var(--fg); }
.side a.on { border-left-color: var(--fg); color: var(--fg); font-weight: 600; }
.side-foot { margin-top: 28px; color: var(--mute); font-size: 12px; }
.g { color: var(--green); font-weight: 500; }
.goldt { color: #ffd650; font-size: 11px; }
.panel h1 { font-size: 24px; font-weight: 600; margin: 0 0 8px; }
.panel section > .kv { margin-bottom: 26px; }
.sub { color: var(--mute); font-size: 11px; letter-spacing: .14em; margin: 30px 0 10px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.tile { position: relative; display: flex; flex-direction: column; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tile img { width: 100%; aspect-ratio: 1; image-rendering: pixelated; display: block; margin-bottom: 8px; }
.tile .cap { font-size: 12px; line-height: 1.5; }
.tile input { position: absolute; opacity: 0; pointer-events: none; }
.tile.pickable { cursor: pointer; }
.tile.pickable:hover { background: #0d0d0d; }
.tile:has(input:checked) { background: #0f1a13; box-shadow: inset 0 0 0 1px var(--green); }
.tile:has(input:checked)::after { content: "\2713"; position: absolute; top: 14px; right: 16px; background: var(--green); color: #000; width: 20px; height: 20px; display: grid; place-items: center; font-weight: 600; }
.bar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.bar-actions .seg { margin: 0; }
.btn.danger { border-color: var(--red); color: var(--red); }
.btn.danger:hover { background: var(--red); color: #000; }
.table > div { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.4fr; align-items: center; min-height: 46px; border-bottom: 1px solid var(--line); }
.table > div.th { min-height: 34px; color: var(--mute); font-size: 11px; letter-spacing: .1em; border-top: 1px solid var(--line); }
.table img { width: 30px; height: 30px; image-rendering: pixelated; vertical-align: middle; margin-right: 10px; }
#lb-mode { margin: 0 0 16px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.filters input, .filters select { background: #000; color: var(--fg); border: 1px solid var(--dim); font: 12px var(--mono); height: 32px; padding: 0 8px; }
.filters input { width: 90px; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.g-item { display: flex; flex-direction: column; align-items: flex-start; padding: 8px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); text-align: left; font-size: 12px; }
.g-item:hover { background: #0d0d0d; }
.g-item img { width: 100%; aspect-ratio: 1; image-rendering: pixelated; margin-bottom: 6px; }
.pager { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.detail { position: fixed; inset: 0; background: rgba(0, 0, 0, .86); display: grid; grid-template-columns: minmax(0, 420px) minmax(0, 420px); gap: 34px; place-content: center; padding: 24px; z-index: 50; }
.detail[hidden] { display: none; }
.detail > img { width: 100%; image-rendering: pixelated; border: 1px solid var(--line); }
.detail .x { position: absolute; top: 18px; right: 24px; font-size: 28px; }
.power button { min-width: 52px; }

@media (max-width: 760px) {
  .app { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 18px 16px 0; }
  .side { position: static; flex-direction: row; flex-wrap: wrap; gap: 4px 14px; border-bottom: 1px solid var(--line); padding-bottom: 12px; }
  .side .grp, .side-foot { display: none; }
  .side a { border-left: 0; padding: 4px 0; }
  .side a.on { color: var(--green); }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .table > div { grid-template-columns: 1.3fr .8fr .9fr 1.2fr; font-size: 12px; }
  .table img { display: none; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .detail { grid-template-columns: minmax(0, 1fr); overflow: auto; place-content: start; }
}

/* home polish */
.steps b a { text-decoration: none; }
.steps b a:hover { color: var(--green); }
.cta { margin: 30px 0 0; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cta .btn { display: inline-flex; align-items: center; text-decoration: none; }
details { border-bottom: 1px solid var(--line); }
details:first-of-type { border-top: 1px solid var(--line); }
summary { cursor: pointer; padding: 13px 0; list-style: none; display: flex; justify-content: space-between; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; color: var(--mute); }
details[open] summary::after { content: "−"; }
details p { margin: 0 0 14px; color: var(--mute); max-width: 640px; }
.seg button:disabled { cursor: not-allowed; }

/* ---------------------------------------------------------------- v3 hero: machine wall + floor */
.wall-wrap { border-color: #d6d6d2; background: #0a0a0a; }
.wallc { display: block; width: 100%; height: 600px; }
.console { bottom: 26px; }
.log div.new { animation: typing .9s steps(56) both; }
@keyframes typing { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.tag-btn { position: absolute; right: 18px; bottom: 18px; z-index: 6; display: flex; align-items: center; gap: 10px;
  background: #d6d6d2; color: #141414; border: 1px solid #141414; outline: 1px solid #7d7d79; padding: 8px 14px;
  font-size: 11px; font-weight: 600; letter-spacing: .14em; text-decoration: none; }
.tag-btn i { width: 14px; height: 14px; background: repeating-linear-gradient(90deg, #3ecf7a 0 2px, transparent 2px 4px); }
.tag-btn:hover { background: #3ecf7a; }
.block { opacity: 0; transform: translateY(18px); transition: opacity .7s ease, transform .7s ease; }
.block.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .log div.new { animation: none !important; } .block { opacity: 1; transform: none; } }
@media (max-width: 760px) {
  .wallc { height: 340px; }
  .tag-btn { display: none; }
}

/* easy management */
.mybtn { margin-left: auto; height: 40px; display: flex; align-items: center; gap: 8px; padding: 0 16px; border: 1px solid var(--dim); text-decoration: none; font-size: 12px; font-weight: 600; letter-spacing: .08em; }
.mybtn b { background: var(--green); color: #000; padding: 0 6px; font-weight: 600; }
.mybtn .muted { font-weight: 400; letter-spacing: 0; }
.mybtn:hover { border-color: var(--fg); }
.mybtn + .connect { margin-left: 0; }
.top .net { margin-left: 0; }
.selbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 12px; }
.selbar .btn { height: 30px; padding: 0 12px; font-size: 11px; }
.quick { display: flex; gap: 12px; margin-top: 6px; font-size: 12px; }
.quick a { color: var(--fg); }
.quick a:hover { color: var(--green); }
.quick a.r { color: var(--red); }
.dock { position: sticky; bottom: 0; z-index: 20; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 12px 14px; margin-top: 14px;
  background: #050805; border: 1px solid #2e4a36; box-shadow: 0 -10px 30px rgba(0,0,0,.7); }
.dock[hidden] { display: none; }
.dock-n { font-weight: 600; margin-right: 6px; }
.dock .btn:disabled { opacity: .35; cursor: not-allowed; }
@media (max-width: 760px) {
  .mybtn .muted { display: none; }
  .mybtn { order: 2; height: 36px; padding: 0 10px; }
}

.earn { display: flex; align-items: baseline; gap: 14px; padding: 18px 0 22px; border-top: 1px solid var(--line); }
.earn b { font-size: 44px; font-weight: 600; color: var(--green); font-variant-numeric: tabular-nums; }
@media (max-width: 760px) { .earn { flex-wrap: wrap; } .earn b { font-size: 32px; } }

/* ================================================================ interaction pass: one button system */
.btn, .connect, .mybtn { transition: background .12s, color .12s, border-color .12s, transform .06s; }
.btn { height: 40px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.btn:active:not(:disabled), .connect:active, .seg button:active { transform: translateY(1px); }
.btn:disabled { opacity: .35; cursor: not-allowed; }
.btn.xl { height: 52px; padding: 0 30px; font-size: 14px; letter-spacing: .12em; }
.btn.primary.running, .btn.running { background: transparent; border-color: var(--red); color: var(--red); }
.btn.running:hover { background: var(--red); color: #000; }
.btn.danger.solid { background: var(--red); color: #000; }
.btn.busy { opacity: .8; }
.dots::after { content: ""; animation: dots 1s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
:where(button, a, input, select, summary, label.tile):focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
.link { color: var(--mute); text-decoration: underline; text-underline-offset: 3px; font-size: 12px; }
.link:hover { color: var(--fg); }
.seg.big button { height: 34px; padding: 0 14px; font-size: 12px; }
.seg button:hover:not(.on):not(:disabled) { color: var(--fg); }

/* ---------------------------------------------------------------- miner: steps + rig */
.steps4 { list-style: none; padding: 0; margin: 0 0 18px; display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); }
.steps4 li { display: flex; align-items: center; gap: 10px; padding: 12px 14px; font-size: 11px; letter-spacing: .12em; color: var(--mute); border-right: 1px solid var(--line); }
.steps4 li:last-child { border-right: 0; }
.steps4 b { width: 22px; height: 22px; display: grid; place-items: center; border: 1px solid var(--dim); font-weight: 600; color: var(--mute); }
.steps4 li.now { color: var(--fg); background: #0b120d; box-shadow: inset 0 -2px 0 var(--green); }
.steps4 li.now b { border-color: var(--green); color: var(--green); }
.steps4 li.done { color: var(--fg); }
.steps4 li.done b { background: var(--green); border-color: var(--green); color: #000; font-size: 0; }
.steps4 li.done b::after { content: "\2713"; font-size: 12px; }
.rig { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); border: 1px solid var(--line); }
.rig-main { padding: 22px 22px 20px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 18px; }
.rig-side { padding: 6px 18px 14px; }
.rig-side .row { grid-template-columns: 110px 1fr; min-height: 42px; }
.status { display: inline-flex; align-items: center; gap: 10px; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; color: var(--mute); }
.status i { width: 10px; height: 10px; background: var(--dim); }
.status.on { color: var(--green); }
.status.on i { background: var(--green); box-shadow: 0 0 10px var(--green); animation: blink 1.2s steps(2) infinite; }
.status.hit { color: #ffd650; }
.status.hit i { background: #ffd650; box-shadow: 0 0 14px #ffd650; }
.rate { display: flex; flex-direction: column; gap: 2px; }
.rate b { font-size: 38px; font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.rate .muted { font-size: 12px; }
.ctrl { display: grid; grid-template-columns: 70px auto; gap: 10px 12px; align-items: center; justify-items: start; }
.cta-row { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 4px; }
.cta-row [hidden] { display: none; }
.getimd { margin-left: 10px; font-size: 11px; letter-spacing: .08em; color: var(--green); text-decoration: none; border: 1px solid #2e4a36; padding: 2px 8px; }
.getimd:hover { background: var(--green); color: #000; }
.getimd[hidden] { display: none; }
.feed-h { color: var(--mute); font-size: 11px; letter-spacing: .14em; margin: 14px 0 6px; }
.rig-side .minerlog { margin: 0; height: 120px; font-size: 11px; }

/* ---------------------------------------------------------------- toasts */
.toasts { position: fixed; right: 20px; bottom: 20px; z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 380px; padding: 11px 14px; background: #0a0a0a; border: 1px solid var(--dim);
  font-size: 12px; cursor: pointer; opacity: 0; transform: translateY(8px); transition: .22s; box-shadow: 0 8px 30px rgba(0,0,0,.6); }
.toast.in { opacity: 1; transform: none; }
.toast i { width: 8px; height: 8px; background: var(--mute); flex: none; }
.toast.ok { border-color: #2e4a36; } .toast.ok i { background: var(--green); }
.toast.bad { border-color: #5a2a27; } .toast.bad i { background: var(--red); }
.toast.pending i { background: #ffd650; animation: blink .8s steps(2) infinite; }

/* ---------------------------------------------------------------- confirm dialog */
.modal { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.78); display: grid; place-items: center; padding: 20px; }
.sheet { width: min(520px, 100%); background: #050505; border: 1px solid var(--fg); padding: 22px 22px 18px; box-shadow: 0 0 0 6px rgba(255,255,255,.04); }
.sheet h3 { margin: 0 0 14px; font-size: 18px; font-weight: 600; }
.sheet .kv > div { grid-template-columns: 130px 1fr; }
.sheet .note { color: var(--mute); font-size: 12px; margin: 14px 0 0; }
.sheet .note.bad { color: var(--red); }
.typein { display: flex; flex-direction: column; gap: 6px; margin-top: 14px; font-size: 12px; color: var(--mute); }
.typein input { height: 38px; background: #000; color: var(--fg); border: 1px solid var(--dim); font: 14px var(--mono); padding: 0 10px; }
.sheet-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

/* ---------------------------------------------------------------- floor buttons */
.bar-actions .btn { min-width: 120px; }
.dock .btn { height: 38px; }

@media (max-width: 760px) {
  .steps4 { grid-template-columns: repeat(2, 1fr); }
  .steps4 li:nth-child(2) { border-right: 0; }
  .steps4 li:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .rig { grid-template-columns: minmax(0, 1fr); }
  .rig-main { border-right: 0; border-bottom: 1px solid var(--line); }
  .rate b { font-size: 30px; }
  .btn.xl { width: 100%; }
  .toasts { left: 12px; right: 12px; align-items: stretch; }
  .toast { max-width: none; }
}

.rig-side .minerlog { white-space: pre-wrap; word-break: break-all; overflow-y: auto; }
.typein b { color: var(--fg); }

/* ================================================================ floor v2: tabs + workshop */
.app { display: block; max-width: 1240px; padding-top: 18px; }
.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 0; border-bottom: 1px solid var(--line); margin-bottom: 26px; }
.tabs a { text-decoration: none; padding: 12px 16px; font-size: 11px; font-weight: 600; letter-spacing: .12em; color: var(--mute); border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--fg); }
.tabs a.on { color: var(--fg); border-bottom-color: var(--green); }
.tabs-phase { margin-left: auto; color: var(--mute); font-size: 12px; padding: 0 4px; }
.shop { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: 0; border: 1px solid var(--line); }
.inv { padding: 20px 22px; border-right: 1px solid var(--line); }
.inv-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 16px; }
.inv-head h1 { margin: 0 0 2px; }
.inv-head p { margin: 0; font-size: 12px; }
.inv-earn { text-align: right; display: flex; flex-direction: column; }
.inv-earn b { font-size: 30px; color: var(--green); font-variant-numeric: tabular-nums; line-height: 1.1; }
.inv-filter { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.inv-filter button { height: 28px; padding: 0 12px; border: 1px solid var(--dim); font-size: 11px; letter-spacing: .08em; color: var(--mute); }
.inv-filter button.on { border-color: var(--fg); color: var(--fg); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.slot { position: relative; aspect-ratio: 1; padding: 0; border: 1px solid var(--dim); background: #070707; display: block; overflow: hidden; }
.slot img { width: 100%; height: 100%; image-rendering: pixelated; display: block; transition: transform .15s; }
.slot:hover img { transform: scale(1.04); }
.slot span { position: absolute; left: 0; bottom: 0; background: rgba(0,0,0,.75); font-size: 11px; padding: 2px 6px; }
.slot.sel { border-color: var(--green); box-shadow: 0 0 0 2px var(--green), 0 0 24px rgba(62,207,122,.25); }
.slot.empty { border-style: dashed; background: transparent; display: grid; place-items: center; text-decoration: none; }
.slot.empty span { position: static; background: none; color: var(--mute); text-align: center; line-height: 1.4; }
a.slot.empty:hover { border-color: var(--green); }
a.slot.empty:hover span { color: var(--green); }
.st { display: inline-block; width: 10px; height: 10px; border: 1px solid #000; }
.slot .st { position: absolute; top: 6px; right: 6px; }
.slot .st.oc { top: 6px; right: 20px; }
.st.earning { background: var(--green); box-shadow: 0 0 8px var(--green); }
.st.staked { background: #6aa8ff; }
.st.idle { background: #555; }
.st.oc { background: #ffd650; }
.legend { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 16px; font-size: 11px; color: var(--mute); }
.legend .st { margin-right: 6px; vertical-align: -1px; }
.bench { padding: 20px; position: sticky; top: 0; align-self: start; }
.bench-img { border: 1px solid var(--line); margin-bottom: 14px; }
.bench-img.oc { border-color: #ffd650; box-shadow: 0 0 30px rgba(255,214,80,.25); }
.bench-img img { width: 100%; display: block; image-rendering: pixelated; }
.bench-title h2 { margin: 0; font-size: 20px; }
.bench-title .muted { font-size: 12px; }
.pill { display: inline-flex; align-items: center; gap: 8px; margin: 12px 0 10px; padding: 4px 10px; border: 1px solid var(--dim); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }
.pill.earning { border-color: #2e4a36; color: var(--green); }
.pill.staked { border-color: #2c3e5a; color: #9cc3ff; }
.bench .kv > div { grid-template-columns: 100px 1fr; padding: 8px 0; }
.bench-actions { display: flex; flex-direction: column; gap: 8px; margin: 16px 0 6px; }
.btn.wide { width: 100%; }
.stake-row { display: flex; gap: 8px; }
.stake-row .seg { flex: 1; display: flex; margin: 0; }
.stake-row .seg button { flex: 1; height: 40px; font-size: 11px; }
.traits { margin-top: 10px; border-top: 1px solid var(--line); }
.traits summary { font-size: 11px; letter-spacing: .12em; color: var(--mute); }
.bench-empty { text-align: center; padding: 40px 0; }
@media (max-width: 900px) {
  .shop { grid-template-columns: minmax(0, 1fr); }
  .inv { border-right: 0; border-bottom: 1px solid var(--line); padding: 16px; }
  .slots { grid-template-columns: repeat(3, 1fr); gap: 8px; }
  .bench { position: static; }
  .tabs { flex-wrap: nowrap; overflow-x: auto; }
  .tabs a { white-space: nowrap; padding: 10px 12px; }
  .tabs-phase { display: none; }
  .inv-head { flex-direction: column; }
  .inv-earn { text-align: left; }
}
.mybtn b[hidden] { display: none; }

/* ================================================================ QA fixes */
/* 2. laptops 760-1100px: narrower label column so sections never exceed the screen */
@media (max-width: 1100px) and (min-width: 761px) {
  .block { grid-template-columns: 150px minmax(0, 1fr); gap: 28px; padding-left: 24px; padding-right: 24px; }
  .rig { grid-template-columns: minmax(0, 1fr); }
  .rig-main { border-right: 0; border-bottom: 1px solid var(--line); }
}
/* 3. phones: toasts at the top, never covering the main buttons; they also let taps through around them */
.toasts { pointer-events: none; }
.toast { pointer-events: auto; }
@media (max-width: 760px) {
  .toasts { top: 12px; bottom: auto; }
  .toast { transform: translateY(-8px); }
}
/* 4. phones: finger-sized tap targets */
@media (max-width: 760px) {
  nav { gap: 4px; }
  nav a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 10px; margin-left: -10px; }
  nav a + a { margin-left: 0; }
  .inv-filter button { height: 38px; }
  .link { display: inline-flex; align-items: center; min-height: 40px; }
  .getimd { display: inline-flex; align-items: center; min-height: 36px; }
  .detail .x { width: 44px; height: 44px; top: 10px; right: 10px; }
  .seg button, .seg.big button { min-height: 38px; }
  .sheet-actions .btn { flex: 1; height: 46px; }
}
.detail .x { width: 40px; height: 40px; display: grid; place-items: center; }

@media (max-width: 420px) {
  .ctrl { grid-template-columns: minmax(0, 1fr); gap: 6px; }
  .ctrl .seg { display: flex; width: 100%; }
  .ctrl .seg button { flex: 1; padding: 0 6px; }
}
.tabs { scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }

.slots-empty { grid-column: 1 / -1; padding: 30px 0; text-align: center; }

@media (max-width: 760px) {
  .mybtn { display: none; }
  footer { flex-direction: column; gap: 8px; }
  .toasts .toast:nth-last-child(n+3) { display: none; }
}
