:root {
  --bg: #000;
  --ink: #fff;
  --dim: rgba(255, 255, 255, 0.55);
  --faint: rgba(255, 255, 255, 0.22);
  --line: rgba(255, 255, 255, 0.82);
  --green: #46ff78;
  --mono: "Space Mono", "Courier New", monospace;
  --display: "Archivo", "Arial Black", sans-serif;
  --gap: 12px;
}
* { box-sizing: border-box; }
html { background: var(--bg); color: var(--ink); font-synthesis: none; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); font: 15px/1.5 var(--mono); }
img { display: block; max-width: 100%; height: auto; image-rendering: pixelated; }
[hidden] { display: none !important; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--green); outline-offset: 2px; }
code { font: inherit; }

.sheet { max-width: 1240px; margin: 0 auto; padding: 16px 16px 40px; display: grid; gap: var(--gap); }
.lbl { margin: 0; font-size: 14px; letter-spacing: 0.02em; text-transform: uppercase; }
.lbl.big { font-size: 16px; font-weight: 700; }
.dim { color: var(--dim); text-transform: none; letter-spacing: 0; }
.hint { margin: 6px 0 0; color: var(--dim); font-size: 14px; max-width: 70ch; }
.mono { font-family: var(--mono); }
.empty { margin: 0; color: var(--dim); }
.frame { border: 1px solid var(--line); padding: 16px; min-width: 0; }

/* header row: the sheet's own cells */
.hdr { display: grid; grid-template-columns: auto 1fr auto; border: 1px solid var(--line); min-height: 52px; }
.hcell { display: flex; align-items: center; gap: 12px; padding: 0 16px; min-width: 0; }
.hcell + .hcell { border-left: 1px solid var(--line); }
.hcell.name .sub { color: var(--dim); font-size: 13px; white-space: nowrap; }
.index { gap: 0; padding: 0; overflow-x: auto; scrollbar-width: none; }
.index::-webkit-scrollbar { display: none; }
.index a { display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 18px; text-decoration: none; text-transform: uppercase; font-size: 14px; white-space: nowrap; border-right: 1px solid var(--faint); }
.index a:last-child { border-right: 0; }
.index a b { font-weight: 700; }
.index a[aria-current="page"] { background: var(--ink); color: var(--bg); }
.xcell { width: 56px; justify-content: center; padding: 0; }
.xcell img { width: 20px; height: 20px; image-rendering: auto; filter: invert(1); }
.xcell[aria-disabled="true"] { opacity: 0.35; pointer-events: none; }
.xcell:not([aria-disabled="true"]):hover { background: var(--ink); }
.xcell:not([aria-disabled="true"]):hover img { filter: none; }

.page { display: grid; gap: var(--gap); }

/* 01 top: picture + about */
.top { display: grid; grid-template-columns: 1.45fr 1fr; gap: var(--gap); }
.pic { margin: 0; display: flex; align-items: center; justify-content: center; padding: 8px; }
.pic .panel { width: 100%; height: auto; }
.about { display: grid; gap: 10px; align-content: start; }
.coinline { margin: 0; font-family: var(--display); font-weight: 900; font-stretch: 125%; font-size: clamp(28px, 4vw, 48px); line-height: 1; text-transform: uppercase; letter-spacing: 0.01em; word-break: break-word; }
.coinline .ticker { color: var(--dim); }
.about-text { margin: 0; max-width: 46ch; }
#statusLbl.on { color: var(--green); }
.dial { position: relative; width: 240px; height: 240px; margin: 4px auto 0; display: grid; place-items: center; text-align: center; }
.dial img { position: absolute; inset: 0; width: 240px; height: 240px; }
.dial b { position: relative; font-size: 34px; line-height: 1.4; max-width: 130px; margin-top: 8px; }
.dialcap { margin: 4px 0 0; text-align: center; color: var(--dim); font-size: 12px; text-transform: uppercase; }

/* spec rows */
.rows { display: grid; border: 1px solid var(--line); }
.rows .row { display: grid; grid-template-columns: minmax(150px, 1fr) minmax(0, 2fr); gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.rows .row:last-child { border-bottom: 0; }
.rows .row .k { text-transform: uppercase; font-size: 14px; }
.rows .row .k::before { content: "//"; }
.rows .row .v { text-align: right; overflow-wrap: anywhere; min-width: 0; }
.rows .row .v .sub { color: var(--dim); }
.rows .row .v a { text-decoration: underline; text-underline-offset: 3px; }
.rows.tight .row { padding: 8px 12px; }
.rows .row .v input { width: 100%; background: transparent; border: 1px solid var(--faint); padding: 8px 10px; text-align: right; min-height: 44px; }
.rows .row .v input:focus { border-color: var(--ink); outline: 0; }
.ok { color: var(--green); }
.bad { color: #ff5d5d; }

/* waterfall bars */
.bars #waterfall { display: grid; gap: 8px; margin-top: 12px; }
.wf { display: grid; grid-template-columns: 170px 56px 1fr 130px; gap: 12px; align-items: center; font-size: 14px; }
.wf .n { text-transform: uppercase; }
.wf .p { text-align: right; font-weight: 700; }
.wf .bar { height: 14px; border: 1px solid var(--line); position: relative; }
.wf .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); }
.wf .d { text-align: right; color: var(--dim); white-space: nowrap; }
.wf.off { color: var(--dim); }
.wf.off .bar { border-color: var(--faint); }

/* log */
.log #logRows { display: grid; margin-top: 12px; }
.lr { display: grid; grid-template-columns: 24px 150px 1fr 150px auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--faint); font-size: 14px; }
.lr img { width: 16px; height: auto; }
.lr .t { color: var(--dim); white-space: nowrap; }
.lr .s { text-transform: uppercase; }
.lr .m { overflow-wrap: anywhere; }
.lr a { text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

/* the data plate */
.platewrap { display: flex; justify-content: center; }
.plate { position: relative; width: 100%; max-width: 640px; }
.plate-bg { width: 100%; height: auto; }
.plate-fields { position: absolute; inset: 9% 6%; display: grid; align-content: center; gap: 12px; color: var(--bg); }
.pf { display: grid; gap: 4px; }
.pf .k { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: #222; }
.pf .v { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.pf code { font-size: 14px; overflow-wrap: anywhere; font-weight: 700; }
.copy { min-height: 36px; padding: 0 12px; border: 1px solid #000; background: transparent; cursor: pointer; text-transform: uppercase; font-size: 13px; }
.copy:disabled { opacity: 0.45; cursor: default; }
.copy.ok { background: #000; color: #fff; }
.link { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border: 1px solid #000; text-decoration: none; font-size: 14px; }
.link img { width: 20px; height: 20px; image-rendering: auto; }
#dexBtn img { filter: invert(1); }
#dexBtn:not([aria-disabled="true"]):hover img { filter: none; }
.link.big { font-weight: 700; }
.link[aria-disabled="true"] { opacity: 0.45; pointer-events: none; }
.link:not([aria-disabled="true"]):hover { background: #000; color: #fff; }
.link:not([aria-disabled="true"]):active { transform: translateY(1px); }

/* 02 rules */
.panel-head { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: center; }
.engaged { display: grid; justify-items: center; gap: 6px; }
.engaged img { height: 120px; width: auto; }
.engaged .lbl { font-size: 13px; }
.engaged.on .lbl { color: var(--green); }
.knobs { display: grid; grid-template-columns: repeat(6, 1fr); border: 1px solid var(--line); }
.knob { display: grid; justify-items: center; gap: 8px; padding: 16px 8px; border-right: 1px solid var(--line); text-align: center; min-width: 0; }
.knob:last-child { border-right: 0; }
.knob .n { font-size: 13px; text-transform: uppercase; min-height: 2.6em; display: grid; align-items: end; }
.knob .kw { width: 110px; height: 110px; touch-action: none; cursor: ns-resize; user-select: none; border-radius: 50%; }
.knob .kw img { width: 110px; height: 110px; transition: transform 80ms linear; }
.knob .win { position: relative; width: 118px; height: 92px; display: grid; place-items: center; }
.knob .win img { position: absolute; inset: 0; width: 118px; height: 92px; }
.knob .win b { position: relative; font-size: 26px; line-height: 1.4; }
.knob .win b::after { content: "%"; font-size: 14px; margin-left: 2px; font-weight: 400; }
.knob .cap { width: 100%; max-width: 118px; display: grid; gap: 2px; font-size: 12px; color: var(--dim); text-transform: uppercase; }
.knob .cap input { width: 100%; background: transparent; border: 1px solid var(--faint); padding: 6px 8px; text-align: center; min-height: 40px; font-size: 14px; }
.knob.off { color: var(--dim); }
.knob.off .kw { cursor: default; }
.knob.locked .kw { cursor: default; }
.knob .kw:focus-visible { outline: 2px solid var(--green); }

.actions { display: grid; grid-template-columns: 1fr auto; gap: 16px; align-items: start; }
.wallet { display: grid; gap: 8px; }
.wlist { display: flex; flex-wrap: wrap; gap: 8px; }
.wbtn { min-height: 44px; padding: 0 14px; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.wbtn:hover { background: var(--ink); color: var(--bg); }
.keys { display: flex; gap: 16px; flex-wrap: wrap; align-items: start; }
.keybtn { display: grid; justify-items: center; gap: 4px; background: transparent; border: 0; padding: 4px; cursor: pointer; text-transform: uppercase; font-size: 13px; text-decoration: none; min-width: 96px; min-height: 48px; }
.keybtn img { height: 84px; width: auto; }
.keybtn.small img { height: 64px; }
.keybtn:not(:disabled):active img { transform: translateY(2px); }
.keybtn:disabled { opacity: 0.4; cursor: default; }
.olog { margin: 0; padding-left: 20px; font-size: 14px; display: grid; gap: 4px; grid-column: 1 / -1; }
.olog li.err { color: #ff5d5d; }
.olog:empty { display: none; }

/* 03 connect */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.step { display: grid; gap: 12px; align-content: start; }
.field { display: grid; gap: 4px; font-size: 13px; text-transform: uppercase; color: var(--dim); }
.field input { background: transparent; border: 1px solid var(--line); padding: 10px 12px; min-height: 48px; color: var(--ink); text-transform: none; font-size: 14px; width: 100%; }
.field input:focus { outline: 0; border-color: var(--green); }

/* 04 fleet */
.fleet { display: grid; }
.fr { display: grid; grid-template-columns: 40px 1.4fr 1fr 1fr 1fr 90px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--faint); font-size: 14px; text-decoration: none; }
.fr:first-child { border-top: 0; }
.fr.head { color: var(--dim); text-transform: uppercase; font-size: 12px; }
.fr img { width: 36px; height: auto; }
.fr .r { text-align: right; }
.fr:hover:not(.head) { background: rgba(255, 255, 255, 0.06); }
.globe { display: grid; grid-template-columns: 140px 1fr; gap: 16px; align-items: center; }
.globe img { width: 140px; height: auto; }

/* foot: the wordmark, as on the sheet */
.foot { display: grid; gap: 8px; justify-items: center; padding-top: 8px; }
.wordmark { margin: 0; font-family: var(--display); font-weight: 900; font-stretch: 125%; font-size: clamp(44px, 9.6vw, 150px); line-height: 1.2; letter-spacing: -0.01em; text-transform: uppercase; color: #cfd6dc; text-align: center; width: 100%; }
.runway { width: 220px; height: auto; opacity: 0.8; }

@media (max-width: 1100px) {
  .knobs { grid-template-columns: repeat(3, 1fr); }
  .knob:nth-child(3) { border-right: 0; }
  .knob:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
  .steps { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .top { grid-template-columns: 1fr; }
  .hdr { grid-template-columns: 1fr auto; }
  .hcell.name { grid-column: 1 / -1; border-bottom: 1px solid var(--line); height: 44px; }
  .xcell { border-left: 1px solid var(--line); height: 52px; }
  .index { border-left: 0; }
  .panel-head { grid-template-columns: 1fr; }
  .engaged { justify-items: start; }
  .actions { grid-template-columns: 1fr; }
  .wf { grid-template-columns: 1fr 48px; grid-template-areas: "n p" "bar bar" "d d"; gap: 4px 12px; padding: 6px 0; border-top: 1px solid var(--faint); }
  .wf .n { grid-area: n; } .wf .p { grid-area: p; } .wf .bar { grid-area: bar; } .wf .d { grid-area: d; text-align: left; }
  .lr { grid-template-columns: 24px 1fr auto; grid-template-areas: "i s a" "i m m" "i t t"; gap: 2px 10px; }
  .lr img { grid-area: i; } .lr .s { grid-area: s; } .lr .m { grid-area: m; } .lr .t { grid-area: t; } .lr a { grid-area: a; }
  .fr { grid-template-columns: 36px 1fr 1fr; grid-template-areas: "i n k" "i a b" "i c c"; }
  .fr.head { display: none; }
  .fr img { grid-area: i; } .fr .n { grid-area: n; } .fr .k { grid-area: k; } .fr .a { grid-area: a; } .fr .b { grid-area: b; } .fr .c { grid-area: c; }
  .fr .r { text-align: left; }
  .globe { grid-template-columns: 100px 1fr; }
  .globe img { width: 100px; }
}
@media (max-width: 560px) {
  .sheet { padding: 12px 12px 32px; --gap: 10px; }
  .frame { padding: 12px; }
  .hdr { grid-template-columns: 1fr 56px; }
  .index { display: grid; grid-template-columns: 1fr 1fr; overflow: visible; }
  .index a { padding: 0 12px; font-size: 13px; height: 46px; border-right: 0; }
  .index a:nth-child(odd) { border-right: 1px solid var(--faint); }
  .index a:nth-child(-n+2) { border-bottom: 1px solid var(--faint); }
  .xcell { height: auto; }
  .hcell.name { padding: 0 12px; gap: 8px; }
  .hcell.name .sub { font-size: 12px; }
  .rows .row { grid-template-columns: 1fr; gap: 2px; padding: 8px 12px; }
  .rows .row .v { text-align: left; }
  .rows .row .v input { text-align: left; }
  .knobs { grid-template-columns: repeat(2, 1fr); }
  .knob:nth-child(3) { border-right: 1px solid var(--line); }
  .knob:nth-child(even) { border-right: 0; }
  .knob:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .knob .kw, .knob .kw img { width: 96px; height: 96px; }
  .plate-fields { inset: 7% 5%; gap: 6px; }
  .pf code { font-size: 12px; }
  .pf .k { font-size: 11px; }
  .link { min-height: 40px; padding: 0 8px; font-size: 12px; }
  .copy { min-height: 32px; font-size: 12px; padding: 0 8px; }
  .dial { width: 200px; height: 200px; }
  .dial img { width: 200px; height: 200px; }
  .dial b { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .knob .kw img { transition: none; }
}
