:root {
  --ink: #0c0e0b;
  --ink-raised: #11140f;
  --ink-soft: #171a14;
  --paper: #e9ecdF;
  --paper-muted: #a7ada1;
  --paper-faint: #70766c;
  --line: #2b3027;
  --line-soft: #20241d;
  --acid: #c8f06b;
  --acid-dark: #93b63c;
  --mint: #6ee7c8;
  --amber: #f0b85a;
  --rose: #ef8fa8;
  --danger: #ff8b7c;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.38);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
  background: var(--ink);
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  overflow-x: hidden;
  color: var(--paper);
  background:
    linear-gradient(rgba(255, 255, 255, 0.014) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px),
    var(--ink);
  background-size: 48px 48px;
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.45;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.55;
}

a {
  color: inherit;
}

::selection {
  color: var(--ink);
  background: var(--acid);
}

:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
}

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.icon {
  width: 17px;
  height: 17px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.topbar {
  position: sticky;
  z-index: 30;
  top: 0;
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  min-height: 66px;
  border-bottom: 1px solid var(--line);
  background: rgba(12, 14, 11, 0.94);
  backdrop-filter: blur(16px);
}

.brand {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 12px;
  padding: 0 24px;
  border-right: 1px solid var(--line);
  text-decoration: none;
}

.brand-mark {
  position: relative;
  display: block;
  width: 24px;
  height: 24px;
  transform: rotate(45deg);
}

.brand-mark span {
  position: absolute;
  border: 1px solid var(--acid);
}

.brand-mark span:nth-child(1) {
  inset: 2px;
}

.brand-mark span:nth-child(2) {
  inset: 7px;
  background: var(--acid);
}

.brand-mark span:nth-child(3) {
  top: 11px;
  left: -3px;
  width: 30px;
  height: 1px;
  border: 0;
  background: var(--acid);
}

.brand-word {
  color: var(--paper);
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.brand-edition {
  padding: 4px 7px;
  border: 1px solid var(--line);
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.1em;
}

.network-chip {
  display: flex;
  align-items: center;
  align-self: stretch;
  gap: 8px;
  padding: 0 18px;
  border-right: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  flex: 0 0 6px;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 0 4px rgba(200, 240, 107, 0.08);
  animation: status-pulse 2.5s ease-in-out infinite;
}

.status-dot.muted {
  background: var(--paper-faint);
  box-shadow: none;
  animation: none;
}

@keyframes status-pulse {
  0%,
  100% {
    opacity: 1;
    box-shadow: 0 0 0 4px rgba(200, 240, 107, 0.07);
  }
  50% {
    opacity: 0.55;
    box-shadow: 0 0 0 7px rgba(200, 240, 107, 0);
  }
}

.network-state {
  color: var(--paper-faint);
}

.top-metrics {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 28px;
  padding: 0 26px;
}

.top-metrics div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.metric-label {
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
}

.top-metrics strong {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
}

.top-protocol {
  align-self: stretch;
  min-height: 66px;
  padding: 0 22px;
  border-left: 1px solid var(--line);
  border-radius: 0;
  color: var(--paper-muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.06em;
}

.button {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 15px;
  border: 1px solid transparent;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition:
    color 150ms ease,
    background 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button-primary {
  color: #11150b;
  background: var(--acid);
  border-color: var(--acid);
}

.button-primary:hover {
  background: #d8ff84;
  border-color: #d8ff84;
}

.button-secondary {
  color: var(--paper);
  background: transparent;
  border-color: var(--line);
}

.button-secondary:hover {
  border-color: var(--paper-faint);
  background: rgba(255, 255, 255, 0.025);
}

.button-quiet {
  color: var(--paper-muted);
  background: transparent;
  border-color: transparent;
}

.button-quiet:hover {
  color: var(--paper);
  background: rgba(255, 255, 255, 0.025);
}

.button-price {
  margin-left: auto;
  padding-left: 14px;
  border-left: 1px solid rgba(12, 14, 11, 0.2);
  font-size: 9px;
}

.full-width {
  width: 100%;
}

.icon-only {
  width: 42px;
  padding: 0;
  border-color: var(--line);
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(250px, 284px) minmax(0, 1fr) minmax(280px, 330px);
  border-bottom: 1px solid var(--line);
}

.left-rail,
.right-rail {
  min-width: 0;
  background: rgba(14, 17, 12, 0.78);
}

.left-rail {
  border-right: 1px solid var(--line);
}

.right-rail {
  border-left: 1px solid var(--line);
}

.rail-section {
  padding: 21px;
  border-bottom: 1px solid var(--line);
}

.section-kicker {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.08em;
  line-height: 1.3;
}

.section-kicker > span:first-child {
  color: var(--paper-muted);
}

.signal-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 10px;
}

.signal-bars i {
  display: block;
  width: 2px;
  background: var(--acid);
}

.signal-bars i:nth-child(1) {
  height: 3px;
}

.signal-bars i:nth-child(2) {
  height: 6px;
}

.signal-bars i:nth-child(3) {
  height: 4px;
}

.signal-bars i:nth-child(4) {
  height: 9px;
}

.identity-head {
  display: flex;
  align-items: center;
  gap: 13px;
  margin-bottom: 19px;
}

.agent-sigil {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: 0 0 54px;
  border: 1px solid var(--line);
  color: var(--acid);
  background:
    linear-gradient(90deg, transparent 49%, var(--line-soft) 50%, transparent 51%),
    linear-gradient(transparent 49%, var(--line-soft) 50%, transparent 51%);
  font-family: var(--mono);
  font-size: 17px;
}

.agent-sigil::before,
.agent-sigil::after {
  position: absolute;
  width: 8px;
  height: 8px;
  content: "";
}

.agent-sigil::before {
  top: -1px;
  left: -1px;
  border-top: 1px solid var(--acid);
  border-left: 1px solid var(--acid);
}

.agent-sigil::after {
  right: -1px;
  bottom: -1px;
  border-right: 1px solid var(--acid);
  border-bottom: 1px solid var(--acid);
}

.identity-copy {
  min-width: 0;
}

.identity-copy h1 {
  margin: 0 0 4px;
  overflow: hidden;
  color: var(--paper);
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-copy p {
  margin: 0;
  color: var(--paper-faint);
  font-size: 11px;
}

.identity-state {
  margin-bottom: 16px;
  border-top: 1px solid var(--line-soft);
}

.state-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 31px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.05em;
}

.state-line > span {
  color: var(--paper-faint);
}

.state-line strong {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 500;
}

.agent-actions {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 8px;
  margin-top: 8px;
}

.ledger-row {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line-soft);
}

.ledger-row:last-of-type {
  border-bottom: 1px solid var(--line-soft);
}

.ledger-index {
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 9px;
}

.ledger-row div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ledger-row strong {
  font-size: 12px;
  font-weight: 500;
}

.ledger-row small {
  color: var(--paper-faint);
  font-size: 10px;
}

.ledger-price {
  color: var(--acid);
  font-family: var(--mono);
  font-size: 10px;
}

.ledger-note {
  margin: 17px 0 0;
  color: var(--paper-faint);
  font-size: 10px;
  line-height: 1.6;
}

.wallet-section {
  border-bottom: 0;
}

.treasury-address {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--paper-muted);
  background: transparent;
  font-family: var(--mono);
  font-size: 10px;
}

.treasury-address:hover {
  color: var(--acid);
  border-color: var(--acid-dark);
}

.wallet-foot {
  display: flex;
  justify-content: space-between;
  margin-top: 11px;
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.world-panel {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 21px 22px 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(200, 240, 107, 0.035), transparent 36%),
    rgba(12, 14, 11, 0.55);
}

.world-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  min-height: 66px;
  margin-bottom: 14px;
}

.world-heading .section-kicker {
  margin-bottom: 7px;
}

.world-heading h2 {
  margin: 0;
  font-family: var(--sans);
  font-size: clamp(20px, 1.8vw, 27px);
  font-weight: 500;
  letter-spacing: 0;
}

.world-coordinates {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  padding-bottom: 3px;
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.09em;
}

.world-coordinates strong {
  color: var(--paper-muted);
  font-size: 10px;
  font-weight: 500;
}

.map-frame {
  position: relative;
  min-height: 510px;
  flex: 1;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0e110c;
  isolation: isolate;
}

.map-frame::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(rgba(200, 240, 107, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(200, 240, 107, 0.025) 1px, transparent 1px);
  background-size: 28px 28px;
  content: "";
  mask-image: linear-gradient(to bottom, transparent, black 10%, black 90%, transparent);
}

#worldCanvas {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: none;
}

.map-corners {
  position: absolute;
  inset: 7px;
  pointer-events: none;
}

.map-corners i {
  position: absolute;
  width: 13px;
  height: 13px;
}

.map-corners i:nth-child(1) {
  top: 0;
  left: 0;
  border-top: 1px solid var(--paper-faint);
  border-left: 1px solid var(--paper-faint);
}

.map-corners i:nth-child(2) {
  top: 0;
  right: 0;
  border-top: 1px solid var(--paper-faint);
  border-right: 1px solid var(--paper-faint);
}

.map-corners i:nth-child(3) {
  bottom: 0;
  left: 0;
  border-bottom: 1px solid var(--paper-faint);
  border-left: 1px solid var(--paper-faint);
}

.map-corners i:nth-child(4) {
  right: 0;
  bottom: 0;
  border-right: 1px solid var(--paper-faint);
  border-bottom: 1px solid var(--paper-faint);
}

.map-topline {
  position: absolute;
  z-index: 2;
  top: 17px;
  right: 18px;
  left: 18px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  pointer-events: none;
}

.map-label {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--paper-muted);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.map-legend {
  display: flex;
  gap: 15px;
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.07em;
}

.map-legend span {
  display: flex;
  align-items: center;
  gap: 5px;
}

.legend-dot {
  display: inline-block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
}

.legend-dot.discovered {
  background: var(--mint);
}

.legend-dot.scene {
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(240, 184, 90, 0.1);
}

.legend-dot.unknown {
  border: 1px solid var(--paper-faint);
}

.map-tools {
  position: absolute;
  z-index: 4;
  top: 50px;
  right: 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.map-tool {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--paper-faint);
  background: rgba(12, 14, 11, 0.78);
  backdrop-filter: blur(8px);
}

.map-tool:hover {
  color: var(--acid);
  border-color: var(--acid-dark);
}

.map-tool .icon {
  width: 14px;
  height: 14px;
}

.map-boot {
  position: absolute;
  z-index: 5;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  color: var(--paper-faint);
  background: #0e110c;
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.11em;
  transition: opacity 450ms ease, visibility 450ms ease;
}

.map-boot i {
  display: block;
  width: 38px;
  height: 1px;
  overflow: hidden;
  background: var(--line);
}

.map-boot i::after {
  display: block;
  width: 60%;
  height: 1px;
  background: var(--acid);
  content: "";
  animation: boot-line 1.1s ease-in-out infinite;
}

@keyframes boot-line {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(180%);
  }
}

.map-boot.hidden {
  opacity: 0;
  visibility: hidden;
}

.cell-inspector {
  position: absolute;
  z-index: 4;
  bottom: 17px;
  left: 17px;
  width: min(300px, calc(100% - 34px));
  max-height: calc(100% - 34px);
  padding: 14px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(12, 14, 11, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  transition: border-color 180ms ease;
}

.cell-inspector.scene-selected {
  border-color: rgba(240, 184, 90, 0.48);
}

.inspector-coordinate {
  margin-bottom: 5px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.1em;
}

.inspector-title {
  margin-bottom: 2px;
  font-size: 14px;
  font-weight: 500;
}

.inspector-meta {
  min-height: 29px;
  margin-bottom: 11px;
  color: var(--paper-faint);
  font-size: 10px;
  line-height: 1.45;
}

.inspector-artifact {
  margin: 0 0 11px;
  padding: 10px 10px 9px 11px;
  overflow-wrap: anywhere;
  border: 1px solid rgba(110, 231, 200, 0.2);
  border-left: 3px solid var(--mint);
  border-radius: 4px;
  background: rgba(110, 231, 200, 0.035);
}

.inspector-artifact[data-rarity="uncommon"] {
  border-color: rgba(200, 240, 107, 0.24);
  border-left-color: var(--acid);
  background: rgba(200, 240, 107, 0.035);
}

.inspector-artifact[data-rarity="rare"] {
  border-color: rgba(240, 184, 90, 0.25);
  border-left-color: var(--amber);
  background: rgba(240, 184, 90, 0.04);
}

.inspector-artifact[data-rarity="singular"] {
  border-color: rgba(239, 143, 168, 0.28);
  border-left-color: var(--rose);
  background: rgba(239, 143, 168, 0.045);
}

.inspector-artifact > span {
  display: block;
  margin-bottom: 4px;
  color: var(--mint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  line-height: 1.45;
}

.inspector-artifact[data-rarity="uncommon"] > span {
  color: var(--acid);
}

.inspector-artifact[data-rarity="rare"] > span {
  color: var(--amber);
}

.inspector-artifact[data-rarity="singular"] > span {
  color: var(--rose);
}

.inspector-artifact > strong {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 500;
  line-height: 1.4;
}

.inspector-artifact > p {
  margin: 0;
  color: var(--paper-muted);
  font-size: 9px;
  line-height: 1.55;
}

.cell-inspector .button {
  width: 100%;
  min-height: 36px;
}

.map-scale {
  position: absolute;
  right: 18px;
  bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 7px;
}

.map-scale i {
  display: block;
  width: 54px;
  height: 3px;
  border-right: 1px solid var(--paper-faint);
  border-bottom: 1px solid var(--paper-faint);
  border-left: 1px solid var(--paper-faint);
}

.world-footer {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: 15px;
  min-height: 51px;
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.footer-signal,
.footer-time {
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-signal .icon {
  width: 13px;
  height: 13px;
  color: var(--acid);
}

.footer-signal strong,
.footer-time strong {
  color: var(--paper-muted);
  font-weight: 500;
}

.footer-rule {
  height: 1px;
  background: var(--line-soft);
}

.footer-copy {
  color: var(--paper-faint);
}

.feed-section {
  min-height: 310px;
}

.live-label {
  display: flex;
  align-items: center;
  gap: 5px;
  color: var(--acid);
}

.live-label i {
  display: block;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--acid);
}

.feed-list {
  display: flex;
  flex-direction: column;
}

.feed-item {
  position: relative;
  padding: 0 0 14px 16px;
}

.feed-item::before {
  position: absolute;
  top: 5px;
  left: 0;
  width: 5px;
  height: 5px;
  border: 1px solid var(--paper-faint);
  border-radius: 50%;
  content: "";
}

.feed-item::after {
  position: absolute;
  top: 14px;
  bottom: 0;
  left: 2px;
  width: 1px;
  background: var(--line);
  content: "";
}

.feed-item:last-child::after {
  display: none;
}

.feed-item.scene::before {
  border-color: var(--amber);
  background: var(--amber);
}

.feed-item.explore::before {
  border-color: var(--mint);
  background: var(--mint);
}

.feed-item.register::before {
  border-color: var(--acid);
  background: var(--acid);
}

.feed-item.echo::before {
  border-color: var(--rose);
  background: var(--rose);
}

.feed-text {
  display: -webkit-box;
  overflow: hidden;
  margin-bottom: 3px;
  color: var(--paper-muted);
  font-size: 10px;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.feed-meta {
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.05em;
}

.feed-empty {
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 9px;
}

.leaderboard-list {
  display: flex;
  flex-direction: column;
}

.leader-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  min-height: 37px;
  border-top: 1px solid var(--line-soft);
}

.leader-row:last-child {
  border-bottom: 1px solid var(--line-soft);
}

.leader-rank {
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 8px;
}

.leader-name {
  overflow: hidden;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.leader-name i {
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: 7px;
  border-radius: 50%;
  background: var(--agent-accent, var(--acid));
  vertical-align: middle;
}

.leader-score {
  color: var(--paper-muted);
  font-family: var(--mono);
  font-size: 9px;
}

.protocol-section {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 13px;
  border-bottom: 0;
}

.protocol-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--mint);
}

.protocol-mark .icon {
  width: 15px;
  height: 15px;
}

.protocol-section h3 {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 500;
}

.protocol-section p {
  margin: 0 0 9px;
  color: var(--paper-faint);
  font-size: 10px;
  line-height: 1.55;
}

.text-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: var(--acid);
  background: none;
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.text-button:hover {
  color: #dcff91;
}

.text-button .icon {
  width: 12px;
  height: 12px;
}

.text-button.compact {
  font-size: 9px;
}

.protocol-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 38px;
  padding: 0 24px;
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.06em;
}

.site-footer > span:last-child {
  display: flex;
  gap: 17px;
}

.footer-link {
  padding: 0;
  color: var(--paper-faint);
  background: transparent;
  font-family: inherit;
  font-size: inherit;
  letter-spacing: inherit;
}

.footer-link:hover {
  color: var(--acid);
}

.modal {
  width: min(590px, calc(100vw - 28px));
  max-height: calc(100vh - 40px);
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--paper);
  background: var(--ink-raised);
  box-shadow: 0 30px 120px rgba(0, 0, 0, 0.72);
}

.modal::backdrop {
  background: rgba(4, 5, 3, 0.82);
  backdrop-filter: blur(8px);
}

.modal[open] {
  animation: modal-in 180ms ease-out;
}

@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.988);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.modal-shell {
  max-height: calc(100vh - 42px);
  overflow-y: auto;
}

.modal-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  padding: 22px 24px 17px;
  border-bottom: 1px solid var(--line);
  background: rgba(17, 20, 15, 0.96);
  backdrop-filter: blur(14px);
}

.modal-head .section-kicker {
  margin-bottom: 7px;
}

.modal-head h2 {
  margin: 0;
  font-size: 23px;
  font-weight: 500;
  letter-spacing: 0;
}

.modal-close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--paper-muted);
  background: transparent;
}

.modal-close:hover {
  color: var(--paper);
  border-color: var(--paper-faint);
}

.modal-close .icon {
  width: 14px;
  height: 14px;
}

.modal-body {
  padding: 22px 24px 24px;
}

.compact-modal {
  width: min(500px, calc(100vw - 28px));
}

.modal-intro {
  margin: 0 0 20px;
  color: var(--paper-muted);
  font-size: 12px;
  line-height: 1.65;
}

.field {
  display: block;
  margin-bottom: 15px;
}

.field > span {
  display: block;
  margin-bottom: 7px;
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.08em;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--paper);
  background: var(--ink-soft);
  outline: none;
}

.field textarea {
  min-height: 112px;
  resize: vertical;
  line-height: 1.55;
}

.field input::placeholder,
.field textarea::placeholder {
  color: #62685f;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--acid-dark);
}

.field-count {
  display: block;
  margin-top: 5px;
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 8px;
  text-align: right;
}

.wallet-box {
  margin: 18px 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.015);
}

.wallet-box-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 11px;
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.07em;
}

.wallet-box-head span:last-child {
  color: var(--mint);
}

.wallet-line {
  display: flex;
  align-items: center;
  gap: 9px;
}

.wallet-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--mint);
}

.wallet-icon .icon {
  width: 13px;
  height: 13px;
}

.wallet-line strong {
  min-width: 0;
  flex: 1;
  overflow: hidden;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.payment-summary {
  border-top: 1px solid var(--line);
}

.payment-summary > div,
.payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  min-height: 37px;
  border-bottom: 1px solid var(--line-soft);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.payment-summary span,
.payment-row span {
  color: var(--paper-faint);
}

.payment-summary strong,
.payment-row strong {
  color: var(--paper-muted);
  font-size: 9px;
  font-weight: 500;
}

.mono {
  font-family: var(--mono);
}

.fine-print {
  margin: 14px 0 18px;
  color: var(--paper-faint);
  font-size: 9px;
  line-height: 1.6;
}

.modal-error {
  margin: 12px 0;
  padding: 10px 12px;
  border-left: 2px solid var(--danger);
  color: #ffc1b9;
  background: rgba(255, 139, 124, 0.06);
  font-size: 10px;
  line-height: 1.5;
}

.modal-submit {
  width: 100%;
  min-height: 46px;
  margin-top: 12px;
}

.coordinate-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 17px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(200, 240, 107, 0.025);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.06em;
}

.coordinate-banner span {
  color: var(--paper-faint);
}

.coordinate-banner strong {
  color: var(--acid);
  font-weight: 500;
}

.probe-visual {
  position: relative;
  display: grid;
  place-items: center;
  height: 132px;
  margin: -2px 0 18px;
  overflow: hidden;
  border-top: 1px solid var(--line-soft);
  border-bottom: 1px solid var(--line-soft);
  color: var(--acid);
}

.probe-visual::before,
.probe-visual::after {
  position: absolute;
  border: 1px solid var(--line);
  border-radius: 50%;
  content: "";
}

.probe-visual::before {
  width: 70px;
  height: 70px;
}

.probe-visual::after {
  width: 120px;
  height: 120px;
}

.probe-visual span {
  position: absolute;
  width: 1px;
  height: 100%;
  background: var(--line-soft);
}

.probe-visual span:nth-child(2) {
  transform: rotate(90deg);
}

.probe-visual span:nth-child(3) {
  width: 220px;
  height: 1px;
  transform: rotate(45deg);
}

.probe-visual .icon {
  position: relative;
  z-index: 1;
  width: 27px;
  height: 27px;
}

.protocol-modal {
  width: min(720px, calc(100vw - 28px));
}

.protocol-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 17px;
  border: 1px solid var(--line);
  border-radius: 4px;
}

.protocol-item {
  min-width: 0;
  padding: 11px 12px;
  border-right: 1px solid var(--line);
}

.protocol-item:last-child {
  border-right: 0;
}

.protocol-item span {
  display: block;
  margin-bottom: 4px;
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 7px;
}

.protocol-item strong {
  display: block;
  overflow: hidden;
  color: var(--paper-muted);
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.code-block {
  margin-bottom: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: #0a0c09;
}

.code-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 33px;
  padding: 0 11px;
  border-bottom: 1px solid var(--line-soft);
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
}

.copy-code {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  color: var(--paper-faint);
  background: none;
}

.copy-code:hover {
  color: var(--acid);
}

.copy-code .icon {
  width: 12px;
  height: 12px;
}

.code-block pre {
  margin: 0;
  padding: 13px;
  overflow-x: auto;
  color: #bdc9b3;
  font-family: var(--mono);
  font-size: 9px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}

.endpoint-list {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  margin: 16px 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--line);
}

.endpoint-list span {
  padding: 9px 10px;
  color: var(--paper-muted);
  background: var(--ink-raised);
  font-family: var(--mono);
  font-size: 8px;
}

.endpoint-list i {
  margin-right: 8px;
  color: var(--mint);
  font-style: normal;
}

.api-key-panel {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 15px;
  margin-top: 15px;
  padding: 13px;
  border: 1px solid rgba(200, 240, 107, 0.25);
  border-radius: 4px;
  background: rgba(200, 240, 107, 0.035);
}

.api-key-panel span {
  display: block;
  margin-bottom: 3px;
  color: var(--acid);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.07em;
}

.api-key-panel small {
  color: var(--paper-faint);
  font-size: 9px;
}

.reader-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 18px;
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 8px;
  letter-spacing: 0.05em;
}

.reader-description {
  margin: 0 0 22px;
  overflow-wrap: anywhere;
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  line-height: 1.7;
}

.scene-question {
  margin: 0 0 20px;
  padding: 14px 15px;
  overflow-wrap: anywhere;
  border: 1px solid rgba(240, 184, 90, 0.24);
  border-left: 3px solid var(--amber);
  border-radius: 4px;
  background: rgba(240, 184, 90, 0.035);
}

.scene-question > span {
  display: block;
  margin-bottom: 7px;
  color: var(--amber);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.08em;
  line-height: 1.45;
}

.scene-question > p {
  margin: 0;
  color: var(--paper);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  line-height: 1.6;
}

.echo-panel {
  margin: 0 0 18px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.012);
}

.echo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.07em;
}

.echo-head > span {
  color: var(--paper-muted);
}

.echo-head > small {
  color: var(--mint);
  font-size: 7px;
}

.echo-list {
  max-height: 230px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.echo-item {
  min-width: 0;
  padding: 12px;
  overflow-wrap: anywhere;
  border-bottom: 1px solid var(--line-soft);
}

.echo-item:last-child {
  border-bottom: 0;
}

.echo-meta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 6px;
  font-family: var(--mono);
  font-size: 7px;
}

.echo-meta > strong {
  min-width: 0;
  overflow: hidden;
  color: var(--mint);
  font-weight: 500;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.echo-meta > span {
  flex: 0 0 auto;
  color: var(--paper-faint);
}

.echo-item > p {
  margin: 0;
  color: var(--paper-muted);
  font-size: 11px;
  line-height: 1.6;
}

.echo-empty {
  margin: 0;
  padding: 16px 12px;
  color: var(--paper-faint);
  font-size: 10px;
  line-height: 1.55;
}

.echo-form {
  padding: 12px;
  border-top: 1px solid var(--line);
}

.echo-form label {
  display: block;
}

.echo-form label > span {
  display: block;
  margin-bottom: 6px;
  color: var(--paper-faint);
  font-family: var(--mono);
  font-size: 7px;
  letter-spacing: 0.07em;
}

.echo-form textarea {
  display: block;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  padding: 10px 11px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 3px;
  outline: 0;
  color: var(--paper);
  background: var(--ink);
  font-size: 11px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.echo-form textarea:focus {
  border-color: rgba(200, 240, 107, 0.55);
}

.echo-form textarea:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.echo-form .button {
  width: 100%;
  min-height: 38px;
  margin-top: 8px;
}

.reader-coordinate {
  padding: 11px 12px;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  color: var(--acid);
  font-family: var(--mono);
  font-size: 9px;
  letter-spacing: 0.06em;
}

.toast-region {
  position: fixed;
  z-index: 100;
  right: 18px;
  bottom: 18px;
  display: flex;
  width: min(360px, calc(100vw - 36px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 24px 1fr;
  gap: 9px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  color: var(--paper-muted);
  background: rgba(17, 20, 15, 0.98);
  box-shadow: var(--shadow);
  font-size: 10px;
  line-height: 1.5;
  animation: toast-in 220ms ease-out;
}

.toast .icon {
  width: 14px;
  height: 14px;
  color: var(--acid);
}

.toast.error .icon {
  color: var(--danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.is-busy .button-price {
  opacity: 0.5;
}

@media (max-width: 1250px) {
  .app-shell {
    grid-template-columns: 250px minmax(0, 1fr) 276px;
  }

  .brand-edition {
    display: none;
  }

  .top-metrics {
    gap: 17px;
    padding: 0 17px;
  }

  .rail-section {
    padding: 17px;
  }

  .world-panel {
    padding-right: 16px;
    padding-left: 16px;
  }
}

@media (max-width: 1040px) {
  .topbar {
    grid-template-columns: auto 1fr auto;
  }

  .network-chip {
    display: none;
  }

  .top-metrics {
    justify-content: flex-start;
  }

  .app-shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .right-rail {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: 1.25fr 1fr 1fr;
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .right-rail .rail-section {
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .right-rail .rail-section:last-child {
    border-right: 0;
  }

  .feed-section {
    min-height: 250px;
  }

  .protocol-section {
    align-content: start;
  }
}

@media (max-width: 760px) {
  body {
    background-size: 36px 36px;
  }

  .topbar {
    grid-template-columns: 1fr auto;
    min-height: 58px;
  }

  .brand {
    padding: 0 15px;
  }

  .brand-word {
    font-size: 15px;
  }

  .top-metrics {
    display: none;
  }

  .top-protocol {
    min-height: 58px;
    padding: 0 14px;
  }

  .top-protocol span {
    display: none;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
  }

  .left-rail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-right: 0;
  }

  .identity-section {
    grid-column: 1 / -1;
  }

  .ledger-section,
  .wallet-section {
    min-width: 0;
  }

  .wallet-section {
    border-left: 1px solid var(--line);
  }

  .wallet-foot {
    flex-direction: column;
    gap: 4px;
  }

  .world-panel {
    order: -1;
    min-height: auto;
    padding: 15px 12px 0;
  }

  .world-heading {
    min-height: 55px;
    margin-bottom: 11px;
  }

  .world-heading h2 {
    font-size: 20px;
  }

  .world-heading .section-kicker {
    display: none;
  }

  .world-coordinates {
    font-size: 7px;
  }

  .map-frame {
    min-height: 500px;
  }

  .map-legend {
    display: none;
  }

  .cell-inspector {
    bottom: 13px;
    left: 13px;
    width: calc(100% - 26px);
  }

  .map-scale {
    display: none;
  }

  .world-footer {
    grid-template-columns: 1fr auto;
    min-height: 46px;
  }

  .footer-rule,
  .footer-copy {
    display: none;
  }

  .left-rail {
    border-top: 1px solid var(--line);
  }

  .right-rail {
    display: flex;
    flex-direction: column;
  }

  .right-rail .rail-section {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .site-footer {
    padding: 0 15px;
  }

  .site-footer > span:first-child {
    display: none;
  }

  .site-footer {
    justify-content: flex-end;
  }

  .modal-head {
    padding: 18px 17px 15px;
  }

  .modal-head h2 {
    font-size: 20px;
  }

  .modal-body {
    padding: 18px 17px 20px;
  }

  .protocol-grid {
    grid-template-columns: 1fr;
  }

  .protocol-item {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .protocol-item:last-child {
    border-bottom: 0;
  }

  .endpoint-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 460px) {
  .left-rail {
    display: flex;
    flex-direction: column;
  }

  .wallet-section {
    border-left: 0;
  }

  .map-frame {
    min-height: 470px;
  }

  .world-heading {
    align-items: center;
  }

  .world-coordinates > span {
    display: none;
  }

  .top-protocol .icon {
    width: 16px;
    height: 16px;
  }

  .reader-description {
    font-size: 16px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
