/* SWARM CITY — overlay UI in the style of the IMD swarm: paper modules, black
   ink, green phosphor screens and a terminal. The city is the page. */
:root {
  --bg: #0b0d0b;
  --paper: #ecebe5;
  --paper-2: #f6f5f0;
  --paper-3: #dcdbd3;
  --ink: #121310;
  --gray: #6b675e;
  --gray-2: #9a968c;
  --line: #121310;
  --lcd-bg: #0c120d;
  --lcd: #4dff7c;
  --lcd-dim: #1d5c2d;
  --go: #46e06f;
  --amber: #ffb020;
  --red: #ff4a3d;
  --term: #0a0d0a;
  --term-ink: #c7d1c7;
  --term-dim: #6c7a6d;
  --radius: 4px;
  --shadow: 3px 3px 0 rgba(0, 0, 0, 0.32);
  --font: "JetBrains Mono", ui-monospace, "Cascadia Code", Menlo, monospace;
  --font-lcd: "VT323", "JetBrains Mono", monospace;
  --gutter: clamp(10px, 1.8vw, 18px);
  --bar: 52px;
  --foot: 26px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 13px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

#scene {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
  touch-action: none;
}

.vignette {
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(120% 90% at 50% 45%, transparent 60%, rgba(0, 0, 0, 0.45) 100%),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.014) 0 1px, transparent 1px 3px);
}

button,
input {
  font: inherit;
  color: inherit;
}

svg {
  display: block;
}

a {
  color: inherit;
}

b {
  font-weight: 700;
}

.eyebrow {
  margin: 0;
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray);
}

.ascii {
  font-family: var(--font);
  white-space: pre;
}

/* A paper module: the building block of the swarm's wall */
.module {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.module-head {
  display: flex;
  justify-content: space-between;
  margin: -14px -16px 16px;
  padding: 5px 10px;
  border-bottom: 1.5px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  font-size: 11px;
  letter-spacing: 0.08em;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper-2);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--ink);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s, transform 0.1s, opacity 0.2s;
}
.btn svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
}
.btn:hover {
  background: var(--ink);
  color: var(--paper);
}
.btn:active {
  transform: translate(1px, 1px);
}
.btn:focus-visible,
.icon-btn:focus-visible,
.label:focus-visible,
.moon:focus-visible,
.place-item:focus-visible,
.chip-btn:focus-visible,
.lcd:focus-visible,
.nav:focus-visible,
.opt:focus-visible,
.street button:focus-visible {
  outline: 2px solid var(--lcd);
  outline-offset: 2px;
}
.btn.accent {
  background: var(--go);
  color: var(--ink);
  box-shadow: 2px 2px 0 var(--ink);
}
.btn.accent:hover {
  background: var(--ink);
  color: var(--lcd);
}
.btn.ghost {
  background: transparent;
}
.btn.ghost:hover {
  background: var(--ink);
}
.btn.small {
  height: 30px;
  padding: 0 10px;
  font-size: 11px;
}
.btn.big {
  height: 46px;
  padding: 0 30px;
  font-size: 14px;
  letter-spacing: 0.14em;
}
.btn.block {
  width: 100%;
}
.btn[disabled],
.btn[aria-disabled="true"] {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn[disabled]:hover {
  background: var(--paper-2);
  color: var(--ink);
}
.btn.accent[disabled]:hover {
  background: var(--go);
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  background: var(--paper-2);
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s, color 0.15s;
}
.icon-btn:hover {
  background: var(--ink);
  color: var(--paper);
}
.icon-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.icon-btn.social {
  text-decoration: none;
  background: transparent;
  border-color: #3b3f3b;
  color: var(--paper);
}
.icon-btn.social:hover {
  border-color: var(--paper);
}
.icon-btn.social svg {
  width: 14px;
  height: 14px;
  fill: currentColor;
  stroke: none;
}

/* ── LCD readouts ── */
.lcd {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  height: 32px;
  padding: 0 10px;
  border: 1px solid #2e3a2f;
  border-radius: 3px;
  background: var(--lcd-bg);
  color: var(--lcd);
  font-family: var(--font-lcd);
  font-size: 20px;
  line-height: 32px;
  white-space: nowrap;
  text-shadow: 0 0 6px rgba(77, 255, 124, 0.5);
}
button.lcd {
  cursor: pointer;
}
button.lcd:hover {
  border-color: var(--lcd);
}
.lcd b {
  font-weight: 400;
}
.lcd-label,
.lcd-unit {
  font-family: var(--font);
  font-size: 9.5px;
  letter-spacing: 0.08em;
  color: #7fbf8f;
  text-shadow: none;
}
.lcd .led {
  align-self: center;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--lcd-dim);
}
.lcd.live .led {
  background: var(--lcd);
  box-shadow: 0 0 8px var(--lcd);
}
.lcd.beat .led {
  animation: beat 0.8s ease;
}
@keyframes beat {
  0% { transform: scale(2.2); }
}
.lcd.big {
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
  height: auto;
  padding: 6px 10px 4px;
  font-size: 30px;
  line-height: 1;
}
.lcd.big .lcd-label {
  margin-bottom: 4px;
}
.lcd.big .lcd-unit {
  margin-top: 2px;
}
.lcd-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 0 0 14px;
}
.lcd-row.three {
  grid-template-columns: repeat(3, 1fr);
}
.lcd-row .lcd {
  min-width: 0;
  overflow: hidden;
}

/* ── Loader ── */
#loader {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: var(--paper-3);
  transition: opacity 1s ease, visibility 1s;
}
#loader-wall {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
#loader.gone {
  opacity: 0;
  visibility: hidden;
}
.loader-inner {
  position: relative;
  width: min(540px, 100%);
  padding: 14px 16px 18px;
  text-align: center;
}
.crest {
  width: 64px;
  height: 64px;
  margin: 4px auto 10px;
  color: var(--ink);
}
.wordmark {
  margin: 0;
  font-weight: 800;
  font-size: clamp(32px, 8vw, 58px);
  letter-spacing: 0.08em;
  line-height: 1;
}
.sub {
  margin: 10px 0 18px;
  color: var(--gray);
  font-size: 11.5px;
  letter-spacing: 0.04em;
}
#progress-ascii {
  margin: 0 0 8px;
  font-size: 13px;
}
.progress {
  height: 4px;
  border: 1px solid var(--line);
  background: var(--paper-2);
  overflow: hidden;
}
#progress-bar {
  display: block;
  height: 100%;
  width: 0;
  background: var(--ink);
  transition: width 0.35s ease;
}
.progress-text {
  min-height: 20px;
  margin: 10px 0 18px;
  color: var(--gray);
  font-size: 12px;
}
#loader.error .progress-text {
  color: var(--red);
}
.fineprint {
  margin: 18px auto 0;
  max-width: 440px;
  color: var(--gray);
  font-size: 10.5px;
  line-height: 1.6;
}

/* ── HUD show/hide ── */
.hud {
  transition: opacity 0.6s ease;
}
body:not(.entered) .hud {
  opacity: 0;
  pointer-events: none;
}
body.instant #loader {
  display: none;
}
body.photo .hud,
body.photo #labels {
  opacity: 0 !important;
  pointer-events: none !important;
}
body.photo .vignette {
  opacity: 0.5;
}

/* ── Top bar: the swarm's black strip ── */
.topbar {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--bar) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--gutter) 0;
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--bg);
  border-bottom: 1px solid #262a26;
  color: var(--paper);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--paper);
  cursor: pointer;
}
.brand svg {
  width: 30px;
  height: 30px;
}
.brand-text {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.15;
}
.brand-text b {
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.1em;
}
.brand-text small {
  font-size: 10px;
  color: var(--gray-2);
}
.top-nav {
  display: flex;
  gap: 2px;
  margin-left: 10px;
}
.nav {
  height: 34px;
  padding: 0 12px;
  border: 0;
  border-radius: 3px;
  background: none;
  color: var(--paper);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}
.nav:hover,
.nav[aria-expanded="true"] {
  background: #222622;
  color: var(--lcd);
}
.top-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn.connect {
  height: 34px;
  background: transparent;
  border-color: var(--paper);
  color: var(--paper);
}
.btn.connect:hover {
  background: var(--paper);
  color: var(--ink);
}
.btn.connect.on {
  border-color: var(--lcd);
  color: var(--lcd);
}

/* ── Panels ── */
.panel {
  position: fixed;
  z-index: 25;
  top: calc(var(--bar) + env(safe-area-inset-top) + var(--gutter));
  right: var(--gutter);
  width: min(400px, calc(100vw - 2 * var(--gutter)));
  max-height: calc(100vh - var(--bar) - var(--foot) - 3 * var(--gutter) - env(safe-area-inset-top));
  overflow: auto;
  padding: 14px 16px 16px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  animation: panel-in 0.28s ease;
  scrollbar-width: thin;
}
.panel.wide {
  width: min(460px, calc(100vw - 2 * var(--gutter)));
}
.panel[hidden] {
  display: none;
}
@keyframes panel-in {
  from { opacity: 0; transform: translateY(-6px); }
}
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin: -14px -16px 14px;
  padding: 10px 12px 10px 16px;
  border-bottom: 1.5px solid var(--line);
  background: var(--paper-2);
}
.panel h2 {
  margin: 2px 0 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
}
.panel h2 .code {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 500;
  color: var(--gray);
  vertical-align: 2px;
}
.panel .close {
  width: 30px;
  height: 30px;
  flex: none;
}
.panel-intro,
.lore-text {
  margin: 0 0 14px;
  font-size: 12.5px;
  line-height: 1.65;
}
.panel-foot {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--gray-2);
}
.mini-title {
  margin: 18px 0 8px;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.fine {
  margin: 8px 0 0;
  color: var(--gray);
  font-size: 11px;
  line-height: 1.55;
}
.fine:empty {
  display: none;
}
.empty {
  margin: 0;
  color: var(--gray);
  font-size: 11.5px;
}

/* places */
.places {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.place-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid transparent;
  border-radius: 3px;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.place-item:hover {
  border-color: var(--line);
  background: var(--paper-2);
}
.place-item b {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
}
.place-item .code {
  margin-left: 6px;
  font-size: 10px;
  font-weight: 500;
  color: var(--gray);
}
.place-item small {
  font-size: 10.5px;
  color: var(--gray);
}
.place-item .dot {
  flex: none;
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
}
.place-item .dot.major {
  background: var(--ink);
  box-shadow: inset 0 0 0 2px var(--paper), 0 0 0 0 transparent;
}

.lore-action:empty,
.lore-agents:empty {
  display: none;
}
.lore-action {
  margin: 0 0 12px;
}
.lore-agents {
  font-size: 11.5px;
  color: var(--gray);
}
.lore-agents button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

/* the ballot */
.mode {
  color: var(--amber);
}
.mode.live {
  color: #1d9b45;
}
.question {
  margin: 0 0 12px;
  font-size: 13.5px;
  font-weight: 700;
  line-height: 1.45;
}
.question:empty {
  display: none;
}
.options {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.opt {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 10px;
  width: 100%;
  padding: 8px 10px 9px;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  background: var(--paper-2);
  text-align: left;
  cursor: pointer;
}
.opt:hover {
  background: #fff;
}
.opt b {
  font-size: 13px;
  letter-spacing: 0.06em;
}
.opt .pct {
  font-family: var(--font-lcd);
  font-size: 22px;
  line-height: 1;
}
.opt small {
  color: var(--gray);
  font-size: 10.5px;
}
.opt .amt {
  color: var(--gray);
  font-size: 10.5px;
  text-align: right;
}
.opt i {
  grid-column: 1 / -1;
  display: block;
  height: 6px;
  margin-top: 4px;
  border: 1px solid var(--line);
  background: var(--paper);
}
.opt i span {
  display: block;
  height: 100%;
  background: var(--ink);
  transition: width 0.6s ease;
}
.opt.on {
  background: var(--ink);
  color: var(--paper);
}
.opt.on small,
.opt.on .amt {
  color: var(--gray-2);
}
.opt.on i {
  border-color: var(--paper);
  background: var(--ink);
}
.opt.on i span {
  background: var(--lcd);
}
.opt.mine::after {
  content: "your vote";
  position: absolute;
  top: -8px;
  right: 8px;
  padding: 0 5px;
  border: 1px solid var(--line);
  background: var(--go);
  color: var(--ink);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.opt.win i span {
  background: var(--go);
}
.opt[disabled] {
  cursor: default;
}
.stake {
  margin-top: 14px;
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  background: var(--paper-2);
}
.stake-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 8px;
}
.stake-me {
  font-size: 11px;
  color: var(--gray);
}
.stake-more {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.stake-more .btn {
  flex: 1;
}
.owner {
  margin-top: 14px;
  padding: 12px;
  border: 1.5px dashed var(--line);
  border-radius: 3px;
}
.owner .mini-title {
  margin-top: 0;
}
.owner .btn {
  margin: 8px 0 12px;
}
.field {
  display: grid;
  gap: 4px;
  font-size: 10.5px;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.field input {
  height: 34px;
  padding: 0 10px;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  background: #fff;
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0;
  color: var(--ink);
}
.wallet-line {
  margin: 12px 0 0;
  font-size: 11px;
  color: var(--gray);
}
.wallet-line:empty {
  display: none;
}
.wallet-line code {
  color: var(--ink);
  font-weight: 700;
}
.rules {
  margin-top: 14px;
  border-top: 1px dashed var(--gray-2);
  padding-top: 10px;
}
.rules summary {
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.rules ul {
  margin: 8px 0 0;
  padding-left: 18px;
  font-size: 11.5px;
  line-height: 1.6;
}
.rules li {
  margin-bottom: 4px;
}
.laws {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}
.laws li {
  padding: 6px 8px;
  border: 1px solid var(--paper-3);
  border-radius: 3px;
  background: var(--paper-2);
  font-size: 11.5px;
}
.laws li.empty {
  border: 0;
  background: none;
  padding: 0;
  color: var(--gray);
}
.laws li b {
  font-weight: 800;
}
.laws li small {
  display: block;
  color: var(--gray);
  font-size: 10.5px;
}
.laws li a {
  color: var(--ink);
}

/* one pepe */
.agent-card {
  display: flex;
  gap: 12px;
  align-items: center;
}
.agent-card .glyph {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: none;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--lcd-bg);
  font-family: var(--font-lcd);
  font-size: 30px;
}
.agent-card .doing {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.5;
}
.agent-card .owner-line {
  margin: 4px 0 0;
  color: var(--gray);
  font-size: 11px;
}
.stats {
  list-style: none;
  margin: 14px 0 0;
  padding: 0;
  display: grid;
  gap: 6px;
}
.stats li {
  display: grid;
  grid-template-columns: 74px 1fr 28px;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  letter-spacing: 0.06em;
}
.stats i {
  height: 7px;
  border: 1px solid var(--line);
  background: var(--paper-2);
}
.stats i span {
  display: block;
  height: 100%;
  background: var(--ink);
}
.stats b {
  text-align: right;
}

/* the market */
.trade {
  padding: 12px;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  background: var(--paper-2);
}
.trade-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.seg {
  display: inline-flex;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  overflow: hidden;
}
.seg button {
  height: 30px;
  padding: 0 14px;
  border: 0;
  background: var(--paper-2);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
}
.seg button + button {
  border-left: 1.5px solid var(--line);
}
.seg button.on {
  background: var(--ink);
  color: var(--lcd);
}
.seg.small button {
  height: 26px;
  padding: 0 10px;
  font-size: 10.5px;
}
.owner .seg {
  margin-top: 10px;
}
.trade-in {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 8px 0 12px;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  background: #fff;
}
.trade-in input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  font-family: var(--font-lcd);
  font-size: 26px;
}
.trade-in span {
  font-size: 11px;
  font-weight: 700;
  color: var(--gray);
}
.trade-in .chip-btn {
  flex: none;
  width: auto;
  padding: 0 8px;
}
.trade-bal {
  min-height: 16px;
  margin: 6px 0 8px;
  color: var(--gray);
  font-size: 10.5px;
}
.trade-out {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 2px 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border-radius: 3px;
  background: var(--lcd-bg);
  color: var(--lcd);
}
.trade-out span {
  font-size: 10.5px;
  color: #7fbf8f;
}
.trade-out b {
  font-family: var(--font-lcd);
  font-size: 24px;
  font-weight: 400;
  text-align: right;
  text-shadow: 0 0 6px rgba(77, 255, 124, 0.45);
}
.trade-out small {
  grid-column: 1 / -1;
  color: #7fbf8f;
  font-size: 10px;
}
.trade-slip {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 10.5px;
  color: var(--gray);
}
.trade-slip span {
  margin-right: auto;
}
.trade-slip .chip-btn {
  flex: none;
  width: 44px;
}
.chip-btn {
  flex: 1;
  height: 26px;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  background: var(--paper-2);
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}
.chip-btn:hover {
  background: var(--paper-3);
}
.chip-btn.on {
  background: var(--ink);
  color: var(--lcd);
}
.ca-box {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  padding: 8px 8px 8px 12px;
  border: 1.5px solid var(--line);
  border-radius: 3px;
}
.ca-box code {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
  font-weight: 700;
}
.ca-box code.pending {
  color: var(--gray);
  font-weight: 400;
}
.ca-box .icon-btn {
  width: 30px;
  height: 30px;
}
.facts {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 12px 0 0;
}
.facts div {
  padding: 6px 8px;
  border-left: 3px solid var(--ink);
  background: var(--paper-2);
}
.facts dt {
  font-size: 9.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gray);
}
.facts dd {
  margin: 0;
  font-size: 12px;
  font-weight: 700;
}
.link-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 12px;
}
.link-grid .btn {
  padding: 0 6px;
  font-size: 10.5px;
}
.howto {
  margin: 0;
  padding-left: 18px;
  font-size: 11.5px;
  line-height: 1.6;
}
.howto li {
  margin-bottom: 4px;
}
.disclaimer {
  margin: 14px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--gray-2);
  color: var(--gray);
  font-size: 10.5px;
  line-height: 1.6;
}

/* ── Left column: the terminal above the signal dock ── */
.left-col {
  position: fixed;
  z-index: 20;
  left: var(--gutter);
  bottom: calc(var(--foot) + var(--gutter) + env(safe-area-inset-bottom));
  width: min(470px, calc(100vw - 2 * var(--gutter)));
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.left-col > * {
  pointer-events: auto;
}

/* ── The terminal ── */
.wire {
  border: 1.5px solid #000;
  border-radius: var(--radius);
  background: var(--term);
  color: var(--term-ink);
  box-shadow: var(--shadow);
}
.wire-head {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 7px 10px 6px;
  border: 0;
  border-bottom: 1px solid #1c241d;
  background: transparent;
  color: var(--term-dim);
  font-size: 11px;
  text-align: left;
  cursor: pointer;
}
.wire-stats b {
  color: #fff;
  font-weight: 700;
}
.wire-stats i {
  font-style: normal;
  margin: 0 4px;
  color: #3a463b;
}
.wire-live {
  flex: none;
  padding: 0 6px;
  border: 1px solid currentColor;
  border-radius: 2px;
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--amber);
}
.wire-live.live {
  color: var(--lcd);
}
#wire-list {
  list-style: none;
  margin: 0;
  padding: 6px 10px;
  max-height: 120px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.wire.open #wire-list {
  max-height: 42vh;
  overflow: auto;
}
#wire-list li {
  display: grid;
  grid-template-columns: 14px 40px 46px 1fr;
  gap: 6px;
  font-size: 11.5px;
  line-height: 1.5;
  animation: wire-in 0.4s ease;
}
#wire-list li > span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#wire-list li .tw {
  color: #3d4b3e;
}
#wire-list li .tt {
  color: var(--term-dim);
}
#wire-list li .tk {
  color: #e8ede8;
}
#wire-list li .tx {
  color: var(--term-ink);
  white-space: normal;
}
#wire-list li.fresh .tw {
  color: var(--lcd);
}
#wire-list li b {
  color: var(--lcd);
  font-weight: 500;
}
#wire-list li a {
  color: inherit;
  text-decoration: underline;
  text-decoration-color: #3d4b3e;
  text-underline-offset: 2px;
}
#wire-list li button {
  border: 0;
  background: none;
  padding: 0;
  color: #fff;
  cursor: pointer;
  text-decoration: underline;
  text-decoration-color: #3d4b3e;
}
#wire-list li.w-sim .tk {
  color: var(--amber);
}
#wire-list li.w-sys .tx {
  color: #9fb0a0;
}
@keyframes wire-in {
  from { opacity: 0; transform: translateX(-6px); }
}
.prompt {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 8px 8px;
  padding: 0 10px;
  height: 30px;
  border: 1px solid #263027;
  border-radius: 3px;
  color: var(--lcd);
}
.prompt input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: none;
  background: none;
  color: #e8ede8;
  font-size: 12px;
  caret-color: var(--lcd);
}
.prompt input::placeholder {
  color: #4b584c;
}

/* ── Signal dock ── */
.dock {
  padding: 10px 12px;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.dock-row {
  display: grid;
  gap: 6px;
}
.moons {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.moon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 26px;
  padding: 0 9px;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  background: var(--paper-2);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.moon:hover {
  background: #fff;
}
.moon.on {
  background: var(--ink);
  color: var(--lcd);
}
.moon-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 1px solid currentColor;
}
.moon-dot.signal { background: #4dff7c; }
.moon-dot.static { background: #c9cfc9; }
.moon-dot.clear { background: #ffffff; }
.moon-dot.storm { background: #6a8cff; }
.moon-dot.overclock { background: #ffb020; }
.moon-note {
  margin: 6px 0 8px;
  min-height: 32px;
  color: var(--gray);
  font-size: 11px;
  line-height: 1.45;
}
.time-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 11px;
  color: var(--gray);
}
.time-label b {
  font-family: var(--font-lcd);
  font-size: 20px;
  font-weight: 400;
  color: var(--ink);
}
#time {
  width: 100%;
  margin: 6px 0;
  accent-color: var(--ink);
  cursor: pointer;
  height: 20px;
}
.time-quick {
  display: flex;
  gap: 5px;
}

/* ── Actions ── */
.actions {
  position: fixed;
  z-index: 20;
  right: var(--gutter);
  bottom: calc(var(--foot) + var(--gutter) + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  gap: 8px;
}
.actions .btn {
  height: 42px;
  padding: 0 18px;
}
.actions .icon-btn {
  width: 42px;
  height: 42px;
  box-shadow: var(--shadow);
}

/* ── Status bar ── */
.statusbar {
  position: fixed;
  z-index: 22;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--foot) + env(safe-area-inset-bottom));
  padding: 0 var(--gutter) env(safe-area-inset-bottom);
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--bg);
  border-top: 1px solid #262a26;
  color: var(--term-dim);
  font-size: 11px;
  white-space: nowrap;
}
.statusbar b {
  color: #fff;
}
#s-mcap,
#s-bar {
  color: var(--lcd);
}
.statusbar .s-right {
  margin-left: auto;
}

.hint {
  position: fixed;
  z-index: 10;
  left: 50%;
  top: calc(var(--bar) + env(safe-area-inset-top) + 10px);
  translate: -50% 0;
  margin: 0;
  padding: 4px 12px;
  border-radius: 3px;
  background: rgba(11, 13, 11, 0.6);
  color: #b9c2b9;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
}

/* ── Floating labels (places and pepes) ── */
#labels {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
  overflow: hidden;
}
.label {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 3px 9px 3px 6px;
  margin: 0;
  border: 1.5px solid var(--line);
  border-radius: 3px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
  cursor: pointer;
  opacity: 0;
  translate: -50% calc(-100% - 14px);
  transition: background 0.15s, color 0.15s;
  will-change: transform, opacity;
}
.label .pin {
  width: 9px;
  height: 9px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
}
.label.major {
  font-size: 12px;
  padding: 4px 11px 4px 7px;
}
.label.major .pin {
  background: var(--ink);
  box-shadow: inset 0 0 0 2px var(--paper);
}
.label:hover,
.label.active {
  background: var(--ink);
  color: var(--lcd);
}
.label:hover .pin,
.label.active .pin {
  border-color: var(--lcd);
}
.label::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 100%;
  width: 1.5px;
  height: 14px;
  background: var(--ink);
}
.label.agent {
  font-size: 10px;
  padding: 1px 7px 1px 4px;
  border-color: #000;
  background: var(--term);
  color: #e8ede8;
  translate: -50% calc(-100% - 6px);
}
.label.agent .g {
  font-family: var(--font-lcd);
  font-size: 15px;
  line-height: 1;
  color: var(--c, var(--lcd));
}
.label.agent::after {
  height: 6px;
  background: #000;
}

/* ── Tour ── */
#tour {
  position: fixed;
  inset: 0;
  z-index: 40;
  pointer-events: none;
}
#tour[hidden] {
  display: none;
}
#tour .bars i {
  position: absolute;
  left: 0;
  right: 0;
  height: 7vh;
  background: #050605;
  animation: bars-in 0.8s ease both;
}
#tour .bars i:first-child { top: 0; }
#tour .bars i:last-child { bottom: 0; }
@keyframes bars-in {
  from { height: 0; }
}
.tour-card {
  position: absolute;
  left: 50%;
  bottom: calc(7vh + 18px);
  translate: -50% 0;
  width: min(620px, calc(100vw - 2 * var(--gutter)));
  padding: 14px 18px 14px;
  pointer-events: auto;
}
.tour-card.in {
  animation: caption 0.6s ease;
}
@keyframes caption {
  from { opacity: 0; transform: translateY(8px); }
}
.tour-card h3 {
  margin: 4px 0 6px;
  font-size: 18px;
  font-weight: 800;
}
.tour-card p:not(.eyebrow) {
  margin: 0;
  font-size: 13px;
  line-height: 1.6;
}
.tour-ctrl {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 10px;
}
body.touring .topbar,
body.touring .statusbar,
body.touring .left-col,
body.touring .actions .icon-btn,
body.touring #btn-tour,
body.touring .hint {
  opacity: 0;
  pointer-events: none;
}

/* ── Toast ── */
#toast {
  position: fixed;
  z-index: 60;
  left: 50%;
  top: calc(var(--bar) + env(safe-area-inset-top) + 14px);
  translate: -50% -8px;
  max-width: min(560px, calc(100vw - 2 * var(--gutter)));
  padding: 9px 16px;
  border: 1.5px solid #000;
  border-radius: 3px;
  background: var(--term);
  color: #e8ede8;
  font-size: 12px;
  text-align: center;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, translate 0.3s;
}
#toast.show {
  opacity: 1;
  translate: -50% 0;
}
#toast.bad {
  border-color: var(--red);
  color: #ffb4ad;
}
#toast.good {
  border-color: var(--lcd);
  color: var(--lcd);
}

/* Title card for the social preview image (?og) */
.og-title {
  display: none;
}
body.og .og-title {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 0 60px 52px;
  background: linear-gradient(180deg, transparent 45%, rgba(5, 7, 5, 0.82) 100%);
  color: #f2f2ec;
}
body.og .og-title h2 {
  margin: 0;
  font-size: 96px;
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1;
}
body.og .og-title p {
  margin: 10px 0;
  font-size: 24px;
  color: #c7d1c7;
}
body.og .og-title p:first-child {
  color: var(--lcd);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 18px;
}

.noscript {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

#tally {
  position: fixed;
  left: 8px;
  top: 64px;
  z-index: 90;
  margin: 0;
  padding: 6px 8px;
  max-width: 60vw;
  white-space: pre-wrap;
  font: 11px var(--font);
  color: #9f9;
  background: rgba(0, 0, 0, 0.6);
}

/* ── Small screens ── */
.only-m {
  display: none;
}
@media (max-width: 1180px) {
  .lcd-label {
    display: none;
  }
  .lcd.big .lcd-label {
    display: block;
  }
  #price-chip .lcd-unit {
    display: none;
  }
}
@media (max-width: 960px) {
  .brand-text small,
  #block-chip,
  .statusbar .s-mid {
    display: none;
  }
}
@media (max-width: 860px) {
  :root {
    --bar: 48px;
  }
  .hint,
  #btn-places,
  #link-x-top,
  .statusbar .s-right {
    display: none;
  }
  .only-m {
    display: inline-grid;
  }
  .top-nav {
    margin-left: 0;
  }
  .nav {
    padding: 0 8px;
  }
  .panel,
  .panel.wide {
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-height: 76vh;
    border-radius: 6px 6px 0 0;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
    animation: sheet-in 0.3s ease;
    z-index: 35;
  }
  @keyframes sheet-in {
    from { transform: translateY(30px); opacity: 0; }
  }
  body.panel-open .left-col,
  body.panel-open .actions {
    opacity: 0;
    pointer-events: none;
  }
  .left-col {
    bottom: calc(var(--foot) + env(safe-area-inset-bottom) + 64px);
  }
  .dock {
    padding: 8px 10px;
  }
  .moons {
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .moon {
    flex: none;
  }
  .moon-note,
  .time-quick {
    display: none;
  }
  #wire-list {
    max-height: 44px;
  }
  .prompt {
    display: none;
  }
  .wire.open .prompt {
    display: flex;
  }
  .actions {
    left: var(--gutter);
    right: var(--gutter);
  }
  .actions #btn-tour {
    flex: 1;
  }
  .tour-card {
    bottom: calc(7vh + 10px);
    padding: 12px 14px;
  }
  .tour-card h3 {
    font-size: 16px;
  }
}

@media (max-width: 560px) {
  .brand-text {
    display: none;
  }
  .top-actions {
    gap: 5px;
  }
  #law-chip .lcd-unit {
    display: none;
  }
  .lcd {
    padding: 0 7px;
    font-size: 18px;
  }
  .btn.connect {
    padding: 0 9px;
    font-size: 10.5px;
  }
  .lcd-row.three {
    grid-template-columns: 1fr 1fr;
  }
  .lcd-row.three .lcd:last-child {
    grid-column: 1 / -1;
  }
  .link-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  #wire-list li {
    grid-template-columns: 12px 36px 1fr;
  }
  #wire-list li .tk {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
