:root {
  color-scheme: dark;
  --bg: #070a08;
  --bg-soft: #0d120f;
  --panel: #111713;
  --panel-2: #182019;
  --paper: #e9e3ca;
  --paper-dim: #ded7be;
  --ink: #111510;
  --acid: #b7ff43;
  --acid-2: #79e61d;
  --coral: #ff5b3b;
  --cyan: #74f8e6;
  --gold: #ffd45b;
  --muted: #a1aea5;
  --line: #334137;
  --danger: #ff3e55;
  --shadow: 7px 7px 0 rgba(0, 0, 0, 0.55);
  --mono: "IBM Plex Mono", "Courier New", monospace;
  --display: "Space Mono", "IBM Plex Mono", monospace;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    radial-gradient(circle at 20% -10%, rgba(183, 255, 67, 0.1), transparent 34rem),
    radial-gradient(circle at 100% 40%, rgba(255, 91, 59, 0.08), transparent 28rem),
    var(--bg);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 15px;
  line-height: 1.55;
}

body::before {
  position: fixed;
  z-index: 9998;
  inset: 0;
  pointer-events: none;
  content: "";
  opacity: 0.12;
  background: repeating-linear-gradient(
    to bottom,
    transparent 0,
    transparent 3px,
    rgba(0, 0, 0, 0.32) 4px
  );
  mix-blend-mode: multiply;
}

body::after {
  position: fixed;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  content: "";
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.08'/%3E%3C/svg%3E");
}

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

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

a {
  color: inherit;
}

button {
  color: inherit;
}

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

.boot-screen {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  padding: clamp(1.5rem, 5vw, 5rem);
  background: #020302;
  color: var(--acid);
}

.boot-screen pre {
  width: min(850px, 100%);
  margin: 0 0 1.5rem;
  white-space: pre-wrap;
  font-size: clamp(0.72rem, 1.5vw, 1rem);
}

.boot-skip {
  cursor: pointer;
  border: 1px solid var(--acid);
  padding: 0.55rem 0.8rem;
  background: transparent;
  color: var(--acid);
}

.site-shell {
  width: min(1540px, 100%);
  min-height: 100vh;
  margin: 0 auto;
  border-inline: 1px solid #1c251f;
}

.topbar {
  position: sticky;
  z-index: 50;
  top: 0;
  display: grid;
  grid-template-columns: minmax(250px, 1fr) auto auto;
  align-items: center;
  gap: 1rem;
  min-height: 74px;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  background: rgba(7, 10, 8, 0.94);
  backdrop-filter: blur(14px);
}

.wordmark {
  display: grid;
  grid-template-columns: auto auto;
  justify-content: start;
  color: var(--acid);
  font-family: var(--display);
  font-size: clamp(1.05rem, 2vw, 1.45rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1;
  text-decoration: none;
}

.wordmark small {
  grid-column: 2;
  margin-top: 0.35rem;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.58rem;
  font-weight: 500;
  letter-spacing: 0.12em;
}

.wordmark-glyph {
  grid-row: 1 / 3;
  margin-right: 0.7rem;
  font-size: 2rem;
  animation: pulse-ring 2.4s ease-in-out infinite;
}

.market-status {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--paper-dim);
  font-size: 0.67rem;
  letter-spacing: 0.12em;
}

.status-separator {
  color: var(--coral);
}

.status-dot {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
  background: var(--acid);
  box-shadow: 0 0 12px var(--acid);
  animation: blink 1.4s steps(1) infinite;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
}

.text-button,
.wallet-button,
.action-button,
.secondary-button,
.danger-button,
.icon-button {
  cursor: pointer;
  border-radius: 0;
  text-transform: uppercase;
}

.text-button {
  border: 0;
  padding: 0.4rem;
  background: transparent;
  color: var(--paper-dim);
  font-size: 0.67rem;
  letter-spacing: 0.08em;
}

.text-button:hover,
.text-button:focus-visible {
  color: var(--acid);
}

.wallet-button,
.action-button {
  border: 1px solid var(--acid);
  padding: 0.72rem 0.9rem;
  background: var(--acid);
  color: var(--ink);
  font-weight: 700;
  letter-spacing: 0.04em;
  box-shadow: 3px 3px 0 #40591e;
}

.wallet-button:hover,
.action-button:hover {
  transform: translate(2px, 2px);
  box-shadow: 1px 1px 0 #40591e;
}

.wallet-button.connected {
  background: transparent;
  color: var(--acid);
}

.secondary-button {
  cursor: pointer;
  border: 1px solid var(--paper-dim);
  padding: 0.65rem 0.85rem;
  background: transparent;
  color: var(--paper);
  font-weight: 600;
}

.secondary-button:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

.danger-button {
  cursor: pointer;
  border: 1px solid var(--danger);
  padding: 0.65rem 0.85rem;
  background: transparent;
  color: var(--danger);
  font-weight: 700;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.4;
  transform: none !important;
  box-shadow: none !important;
}

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

.ticker {
  overflow: hidden;
  border-bottom: 1px solid var(--coral);
  background: var(--coral);
  color: var(--ink);
  font-weight: 700;
  white-space: nowrap;
}

.ticker-track {
  display: inline-block;
  min-width: 100%;
  padding: 0.28rem 0;
  animation: ticker-scroll 32s linear infinite;
}

.ticker:hover .ticker-track {
  animation-play-state: paused;
}

.main-nav {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}

.main-nav a {
  padding: 0.8rem 0.45rem;
  border-right: 1px solid var(--line);
  color: var(--paper-dim);
  font-size: clamp(0.57rem, 0.8vw, 0.72rem);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  letter-spacing: 0.04em;
}

.main-nav a:last-child {
  border-right: 0;
}

.main-nav a:hover,
.main-nav a.active {
  background: var(--paper);
  color: var(--ink);
}

#app {
  min-height: calc(100vh - 190px);
  outline: none;
}

.page {
  animation: page-in 0.35s ease both;
}

.page-pad {
  padding: clamp(1rem, 3vw, 2.5rem);
}

.section-kicker {
  margin: 0 0 0.55rem;
  color: var(--coral);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.page-title {
  max-width: 1000px;
  margin: 0;
  color: var(--paper);
  font-family: var(--display);
  font-size: clamp(2rem, 6vw, 5.6rem);
  line-height: 0.96;
  letter-spacing: -0.07em;
  text-transform: uppercase;
}

.page-title em {
  color: var(--acid);
  font-style: normal;
}

.page-intro {
  max-width: 760px;
  margin: 1.2rem 0 0;
  color: var(--paper-dim);
  font-size: clamp(0.92rem, 1.6vw, 1.1rem);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(310px, 0.65fr);
  min-height: 650px;
  border-bottom: 1px solid var(--line);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: clamp(1.5rem, 5vw, 5rem);
  border-right: 1px solid var(--line);
}

.hero h1 {
  max-width: 970px;
  margin: 0;
  font-family: var(--display);
  font-size: clamp(3.4rem, 9vw, 9.5rem);
  line-height: 0.76;
  letter-spacing: -0.105em;
  text-transform: uppercase;
}

.hero h1 span {
  display: block;
  color: var(--acid);
}

.hero-declaration {
  max-width: 760px;
  margin: 2rem 0;
  color: var(--paper-dim);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
}

.hero-terminal {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  overflow: hidden;
  padding: clamp(1.25rem, 3vw, 2.5rem);
  background:
    linear-gradient(rgba(183, 255, 67, 0.03), rgba(183, 255, 67, 0.03)),
    repeating-linear-gradient(90deg, transparent 0 29px, rgba(183, 255, 67, 0.045) 30px),
    repeating-linear-gradient(0deg, transparent 0 29px, rgba(183, 255, 67, 0.045) 30px);
}

.hero-terminal::before {
  position: absolute;
  top: 0;
  left: -100%;
  width: 80%;
  height: 100%;
  content: "";
  background: linear-gradient(90deg, transparent, rgba(183, 255, 67, 0.06), transparent);
  animation: terminal-scan 6s ease-in-out infinite;
}

.ascii-entity {
  z-index: 1;
  margin: 0;
  color: var(--acid);
  font-size: clamp(0.58rem, 1.15vw, 0.9rem);
  line-height: 1.15;
  text-align: center;
  text-shadow: 0 0 12px rgba(183, 255, 67, 0.35);
}

.terminal-caption {
  z-index: 1;
  border: 1px solid var(--line);
  padding: 1rem;
  background: rgba(7, 10, 8, 0.82);
}

.terminal-caption strong {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--coral);
  font-size: 0.72rem;
}

.terminal-caption p {
  margin: 0;
  color: var(--paper-dim);
  font-size: 0.78rem;
}

.pulse-monitor {
  z-index: 1;
  margin: 1rem 0;
  border: 1px solid var(--line);
  padding: 0.75rem;
  background: rgba(3, 5, 3, 0.8);
}

.pulse-monitor header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.62rem;
  letter-spacing: 0.08em;
}

.pulse-monitor strong {
  color: var(--cyan);
}

.pulse-monitor svg {
  display: block;
  width: 100%;
  height: 74px;
}

.live-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.live-status-cell {
  min-width: 0;
  padding: 0.8rem 1rem;
  border-right: 1px solid rgba(17, 21, 16, 0.24);
}

.live-status-cell:last-child {
  border-right: 0;
}

.live-status-cell span,
.live-status-cell strong {
  display: block;
}

.live-status-cell span {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
}

.live-status-cell strong {
  overflow: hidden;
  margin-top: 0.2rem;
  font-family: var(--display);
  font-size: clamp(0.84rem, 1.4vw, 1.1rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.regret-meter {
  height: 5px;
  margin-top: 0.45rem;
  background: rgba(17, 21, 16, 0.18);
}

.regret-meter > i {
  display: block;
  height: 100%;
  background: var(--coral);
  transition: width 0.5s ease;
}

.metric-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.metric {
  min-height: 140px;
  padding: 1.25rem;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
}

.metric:last-child {
  border-right: 0;
}

.metric span {
  display: block;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
}

.metric strong {
  display: block;
  color: var(--acid);
  font-family: var(--display);
  font-size: clamp(1.5rem, 3vw, 2.7rem);
}

.metric small {
  color: var(--paper-dim);
}

.first-shift {
  display: grid;
  grid-template-columns: minmax(220px, 0.58fr) minmax(0, 1.42fr);
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
}

.first-shift-copy {
  padding: clamp(1.2rem, 3vw, 2.2rem);
  border-right: 1px solid var(--line);
}

.first-shift-copy h2 {
  margin: 0.25rem 0 0.8rem;
  font-family: var(--display);
  font-size: clamp(1.45rem, 3vw, 2.6rem);
  line-height: 1;
}

.first-shift-copy p {
  margin-bottom: 0;
  color: var(--paper-dim);
}

.shift-checklist {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.shift-step {
  position: relative;
  min-height: 180px;
  padding: 1rem;
  border-right: 1px solid var(--line);
  color: var(--paper-dim);
  text-decoration: none;
}

.shift-step:last-child {
  border-right: 0;
}

.shift-step:hover {
  background: rgba(116, 248, 230, 0.05);
}

.shift-step.done {
  background: rgba(183, 255, 67, 0.055);
}

.shift-step b {
  display: block;
  margin-bottom: 1.3rem;
  color: var(--coral);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
}

.shift-step.done b {
  color: var(--acid);
}

.shift-step strong {
  display: block;
  color: var(--paper);
  font-family: var(--display);
  font-size: 0.92rem;
}

.shift-step small {
  display: block;
  margin-top: 0.55rem;
  color: var(--muted);
}

.shift-step::after {
  position: absolute;
  right: 0.8rem;
  bottom: 0.55rem;
  color: rgba(183, 255, 67, 0.08);
  content: attr(data-step);
  font-family: var(--display);
  font-size: 3.8rem;
  font-weight: 700;
}

.shift-step.done::after {
  color: rgba(183, 255, 67, 0.2);
  content: "✓";
}

.manifesto-grid {
  display: grid;
  grid-template-columns: minmax(240px, 0.6fr) minmax(0, 1.4fr);
  border-bottom: 1px solid var(--line);
}

.manifesto-aside {
  padding: clamp(1.5rem, 4vw, 3.5rem);
  border-right: 1px solid var(--line);
  background: var(--coral);
  color: var(--ink);
}

.manifesto-aside pre {
  overflow: hidden;
  margin: 2rem 0;
  font-size: clamp(0.6rem, 1.2vw, 0.9rem);
}

.manifesto-copy {
  padding: clamp(1.5rem, 4vw, 3.5rem);
}

.manifesto-copy p {
  max-width: 900px;
  margin: 0 0 1.4rem;
  font-family: var(--display);
  font-size: clamp(1.05rem, 2.2vw, 1.85rem);
  line-height: 1.4;
}

.manifesto-copy p:nth-child(even) {
  color: var(--acid);
}

.route-grid,
.card-grid,
.desk-grid,
.mission-grid,
.relic-grid,
.report-grid {
  display: grid;
  gap: 1rem;
}

.route-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.route-card,
.panel-card,
.mission-card,
.relic-card,
.report-card,
.agent-card,
.profile-card,
.gate-card {
  border: 1px solid var(--line);
  background: var(--panel);
}

.route-card {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  padding: 1.35rem;
  text-decoration: none;
}

.route-card::after {
  position: absolute;
  right: -1rem;
  bottom: -2.5rem;
  color: rgba(183, 255, 67, 0.06);
  content: attr(data-number);
  font-family: var(--display);
  font-size: 9rem;
  font-weight: 700;
}

.route-card:hover {
  border-color: var(--acid);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.route-card span {
  color: var(--coral);
  font-size: 0.65rem;
  letter-spacing: 0.1em;
}

.route-card h3 {
  margin: 1.5rem 0 0.8rem;
  color: var(--acid);
  font-family: var(--display);
  font-size: 1.25rem;
}

.route-card p {
  max-width: 85%;
  margin: 0;
  color: var(--paper-dim);
  font-size: 0.82rem;
}

.paper-note {
  position: relative;
  margin: 2rem auto;
  padding: clamp(1.4rem, 4vw, 3rem);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 10px 10px 0 rgba(255, 91, 59, 0.65);
  transform: rotate(-0.6deg);
}

.paper-note::before,
.paper-note::after {
  position: absolute;
  top: 0;
  width: 16px;
  height: 100%;
  content: "";
  background: repeating-linear-gradient(180deg, transparent 0 8px, var(--bg) 9px 10px);
}

.paper-note::before {
  left: -8px;
}

.paper-note::after {
  right: -8px;
}

.paper-note h2 {
  margin-top: 0;
  font-family: var(--display);
  font-size: clamp(1.4rem, 3vw, 2.7rem);
}

.paper-note p {
  max-width: 850px;
}

.section-header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.section-header h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.35rem, 3vw, 2.4rem);
  line-height: 1;
}

.section-header p {
  max-width: 600px;
  margin: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.report-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.65fr) minmax(0, 1.35fr);
  min-height: 650px;
  border: 1px solid var(--line);
}

.report-list {
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
}

.report-list button {
  width: 100%;
  cursor: pointer;
  border: 0;
  border-bottom: 1px solid var(--line);
  padding: 1rem;
  background: transparent;
  color: var(--paper);
  text-align: left;
}

.report-list button:hover,
.report-list button.active {
  background: var(--acid);
  color: var(--ink);
}

.report-list small,
.report-list strong {
  display: block;
}

.report-list small {
  margin-bottom: 0.4rem;
  opacity: 0.7;
}

.report-reader {
  padding: clamp(1.4rem, 4vw, 3rem);
  background:
    linear-gradient(rgba(233, 227, 202, 0.96), rgba(233, 227, 202, 0.96)),
    repeating-linear-gradient(0deg, transparent 0 31px, rgba(0, 0, 0, 0.12) 32px);
  color: var(--ink);
}

.report-reader pre {
  overflow-x: auto;
  color: #3c4c31;
  font-size: 0.72rem;
}

.report-reader h2 {
  margin: 1.3rem 0;
  font-family: var(--display);
  font-size: clamp(1.7rem, 4vw, 3.8rem);
  line-height: 1;
}

.report-reader p {
  max-width: 820px;
  white-space: pre-line;
}

.claim-box {
  margin-top: 2rem;
  padding: 1rem;
  border: 2px dashed var(--ink);
}

.claim-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.claim-actions button {
  cursor: pointer;
  border: 1px solid var(--ink);
  padding: 0.5rem 0.75rem;
  background: transparent;
  color: var(--ink);
  font-weight: 700;
}

.claim-actions button:hover,
.claim-actions button.selected {
  background: var(--ink);
  color: var(--paper);
}

.exchange-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  min-height: 690px;
  border: 1px solid var(--line);
}

.agent-rail {
  padding: 1rem;
  border-right: 1px solid var(--line);
  background: var(--bg-soft);
}

.agent-rail h2 {
  margin: 0 0 1rem;
  color: var(--acid);
  font-family: var(--display);
  font-size: 1rem;
}

.agent-selector {
  width: 100%;
  cursor: pointer;
  border: 1px solid var(--line);
  margin-bottom: 0.7rem;
  padding: 0.85rem;
  background: var(--panel);
  color: var(--paper);
  text-align: left;
}

.agent-selector:hover,
.agent-selector.active {
  border-color: var(--agent-color, var(--acid));
  box-shadow: inset 4px 0 0 var(--agent-color, var(--acid));
}

.agent-selector strong,
.agent-selector small {
  display: block;
}

.agent-selector small {
  margin-top: 0.25rem;
  color: var(--muted);
}

.progress-bar {
  height: 8px;
  margin-top: 0.7rem;
  border: 1px solid var(--line);
  background: #030403;
}

.progress-fill {
  height: 100%;
  background: var(--agent-color, var(--acid));
  transition: width 0.35s ease;
}

.exchange-main {
  display: grid;
  grid-template-rows: auto minmax(300px, 1fr) auto;
  min-width: 0;
}

.exchange-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--line);
}

.agent-identity {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.agent-face {
  color: var(--agent-color, var(--acid));
  font-family: var(--display);
  font-size: 1.2rem;
}

.agent-identity strong,
.agent-identity small {
  display: block;
}

.agent-identity small {
  color: var(--muted);
}

.chat-stream {
  overflow-y: auto;
  max-height: 540px;
  padding: 1.2rem;
}

.chat-message {
  display: grid;
  grid-template-columns: 100px minmax(0, 1fr);
  gap: 1rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px dashed rgba(132, 144, 135, 0.25);
}

.chat-message .speaker {
  color: var(--coral);
  font-size: 0.65rem;
  letter-spacing: 0.06em;
}

.chat-message.agent .speaker {
  color: var(--agent-color, var(--acid));
}

.chat-message p {
  margin: 0;
  white-space: pre-wrap;
}

.chat-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  border-top: 1px solid var(--line);
}

.chat-form textarea {
  min-height: 86px;
  resize: vertical;
  border: 0;
  border-right: 1px solid var(--line);
  padding: 1rem;
  outline: none;
  background: #080b09;
  color: var(--paper);
}

.chat-form textarea:focus {
  box-shadow: inset 0 0 0 1px var(--acid);
}

.chat-form button {
  min-width: 150px;
  border: 0;
  background: var(--acid);
  color: var(--ink);
  font-weight: 700;
}

.chat-form button:hover {
  background: var(--coral);
}

.mining-rule {
  margin-top: 1rem;
  padding: 0.75rem;
  border: 1px dashed var(--line);
  color: var(--muted);
  font-size: 0.68rem;
}

.mission-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mission-card {
  position: relative;
  padding: 1.2rem;
  overflow: hidden;
}

.mission-card.completed {
  border-color: var(--acid);
}

.mission-card::before {
  position: absolute;
  top: 0;
  left: 0;
  width: 5px;
  height: 100%;
  content: "";
  background: var(--coral);
}

.mission-card.completed::before {
  background: var(--acid);
}

.mission-meta,
.relic-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.reward-line {
  color: var(--acid);
  font-weight: 700;
}

.mission-card h3,
.relic-card h3,
.panel-card h3 {
  margin: 1rem 0 0.7rem;
  font-family: var(--display);
}

.mission-card p {
  color: var(--paper-dim);
}

.mission-card footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.sealed-order {
  margin-top: 1rem;
  border: 1px dashed var(--cyan);
  padding: 0.8rem;
  background: rgba(116, 248, 230, 0.035);
}

.sealed-order strong,
.sealed-order small {
  display: block;
}

.sealed-order strong {
  color: var(--cyan);
}

.sealed-order small {
  margin-top: 0.35rem;
  color: var(--muted);
}

.sealed-hash {
  overflow-wrap: anywhere;
  color: var(--cyan);
  font-size: 0.7rem;
}

.evidence-form {
  display: grid;
  gap: 0.8rem;
}

.form-field {
  display: grid;
  gap: 0.35rem;
}

.form-field label {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.form-field input,
.form-field textarea,
.form-field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 0.75rem;
  outline: none;
  background: #090d0a;
  color: var(--paper);
}

.form-field textarea {
  min-height: 120px;
  resize: vertical;
}

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

.desk-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.desk-card {
  cursor: pointer;
  border: 1px solid var(--line);
  padding: 1rem;
  background: var(--panel);
  color: var(--paper);
  text-align: left;
}

.desk-card:hover,
.desk-card.selected {
  border-color: var(--desk-color, var(--acid));
  box-shadow: inset 5px 0 0 var(--desk-color, var(--acid));
}

.desk-card strong,
.desk-card small {
  display: block;
}

.desk-card small {
  margin-top: 0.5rem;
  color: var(--muted);
}

.floor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 1rem;
}

.post-composer,
.live-chat,
.panel-card,
.gate-card,
.profile-card {
  padding: 1rem;
}

.post-composer {
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  background: var(--panel);
}

.post-composer textarea,
.live-chat-form input {
  width: 100%;
  border: 1px solid var(--line);
  padding: 0.8rem;
  outline: none;
  background: var(--bg);
  color: var(--paper);
}

.post-composer textarea {
  min-height: 100px;
  resize: vertical;
}

.post-composer footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.7rem;
}

.post-list {
  display: grid;
  gap: 1rem;
}

.post {
  border: 1px solid var(--line);
  padding: 1rem;
  background: var(--panel);
}

.post-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.8rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.post-head strong {
  color: var(--cyan);
}

.post p {
  margin: 0;
  white-space: pre-wrap;
}

.post-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.9rem;
}

.post-actions button {
  cursor: pointer;
  border: 1px solid var(--line);
  padding: 0.35rem 0.55rem;
  background: transparent;
  color: var(--paper-dim);
  font-size: 0.68rem;
}

.post-actions button:hover {
  border-color: var(--coral);
  color: var(--coral);
}

.live-chat {
  position: sticky;
  top: 155px;
  height: fit-content;
  border: 1px solid var(--line);
  background: var(--bg-soft);
}

.live-chat h3 {
  margin-top: 0;
  color: var(--acid);
}

.live-chat-log {
  display: grid;
  gap: 0.65rem;
  overflow-y: auto;
  height: 380px;
  padding-right: 0.35rem;
}

.live-chat-line {
  font-size: 0.73rem;
}

.live-chat-line strong {
  color: var(--coral);
}

.live-chat-line time {
  color: var(--muted);
  font-size: 0.6rem;
}

.live-chat-form {
  display: flex;
  margin-top: 0.8rem;
}

.live-chat-form button {
  border: 0;
  padding: 0.7rem;
  background: var(--acid);
  color: var(--ink);
  font-weight: 700;
}

.gate-card {
  max-width: 760px;
  margin: 3rem auto;
  border-color: var(--coral);
  text-align: center;
}

.gate-card pre {
  color: var(--coral);
  font-size: clamp(0.55rem, 1.5vw, 0.9rem);
}

.gate-card strong {
  color: var(--acid);
}

.relic-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.relic-card {
  padding: 1rem;
}

.relic-card.sold {
  opacity: 0.65;
}

.relic-art {
  display: grid;
  place-items: center;
  min-height: 220px;
  margin: 0.8rem 0;
  border: 1px dashed var(--line);
  background: #050705;
  color: var(--relic-color, var(--acid));
}

.relic-art pre {
  overflow: hidden;
  max-width: 100%;
  margin: 0;
  font-size: clamp(0.55rem, 0.8vw, 0.72rem);
  line-height: 1.1;
}

.relic-card footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.balance-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--acid);
  background: rgba(183, 255, 67, 0.06);
}

.balance-banner strong {
  color: var(--acid);
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.75fr) minmax(0, 1.25fr);
  gap: 1rem;
}

.profile-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
  padding: 0.8rem;
  border: 1px dashed var(--line);
  background: rgba(116, 248, 230, 0.025);
}

.profile-tools .secondary-button {
  flex: 1 1 180px;
}

.forecast-list {
  display: grid;
  gap: 0.7rem;
}

.forecast-row {
  border: 1px solid var(--line);
  padding: 0.8rem;
  background: var(--panel);
}

.forecast-row header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.45rem;
  color: var(--muted);
  font-size: 0.65rem;
}

.forecast-row strong {
  color: var(--cyan);
}

.import-note {
  border: 1px dashed var(--coral);
  padding: 0.8rem;
  color: var(--paper-dim);
  font-size: 0.75rem;
}

.profile-id {
  padding: 1.4rem;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.profile-id pre {
  overflow: hidden;
  font-size: 0.63rem;
}

.profile-id h2 {
  margin: 1rem 0 0.2rem;
  font-family: var(--display);
  font-size: clamp(1.4rem, 4vw, 2.4rem);
}

.profile-id p {
  margin: 0.3rem 0;
}

.profile-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--line);
}

.profile-stat {
  padding: 1rem;
  background: var(--panel);
}

.profile-stat span,
.profile-stat strong {
  display: block;
}

.profile-stat span {
  color: var(--muted);
  font-size: 0.68rem;
}

.profile-stat strong {
  margin-top: 0.4rem;
  color: var(--acid);
  font-family: var(--display);
  font-size: 1.4rem;
}

.inventory-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.inventory-item {
  border: 1px solid var(--line);
  padding: 0.8rem;
  background: var(--panel);
}

.inventory-item pre {
  overflow: hidden;
  color: var(--cyan);
  font-size: 0.55rem;
}

.rank-track {
  margin: 1rem 0;
}

.rank-track header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  color: var(--muted);
  font-size: 0.68rem;
}

.rank-track .progress-bar {
  height: 14px;
}

.settlement-box {
  margin-top: 1rem;
  border: 1px dashed var(--line);
  padding: 1rem;
}

.settlement-box code {
  color: var(--cyan);
  word-break: break-all;
}

.modal-layer {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.86);
  backdrop-filter: blur(5px);
}

.modal-layer[hidden] {
  display: none;
}

.modal-card,
.terminal-modal {
  width: min(720px, 100%);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  border: 1px solid var(--acid);
  background: var(--bg-soft);
  box-shadow: 12px 12px 0 rgba(183, 255, 67, 0.15);
}

.modal-head,
.terminal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--acid);
  color: var(--ink);
  font-weight: 700;
}

.modal-body {
  padding: 1rem;
}

.icon-button {
  cursor: pointer;
  border: 0;
  padding: 0 0.35rem;
  background: transparent;
  color: inherit;
  font-size: 1.4rem;
}

.terminal-output {
  overflow-y: auto;
  min-height: 320px;
  max-height: 60vh;
  padding: 1rem;
  color: var(--acid);
  white-space: pre-wrap;
}

.terminal-form {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  border-top: 1px solid var(--line);
}

.terminal-form label {
  padding-left: 1rem;
  color: var(--coral);
}

.terminal-form input {
  min-width: 0;
  border: 0;
  padding: 1rem 0.7rem;
  outline: none;
  background: transparent;
  color: var(--paper);
}

.toast-stack {
  position: fixed;
  z-index: 10001;
  top: 90px;
  right: 1rem;
  display: grid;
  gap: 0.6rem;
  width: min(360px, calc(100% - 2rem));
}

.toast {
  padding: 0.85rem 1rem;
  border: 1px solid var(--acid);
  background: rgba(8, 12, 9, 0.98);
  color: var(--paper);
  box-shadow: 5px 5px 0 rgba(183, 255, 67, 0.15);
  animation: toast-in 0.25s ease both;
}

.toast strong {
  display: block;
  color: var(--acid);
}

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

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

.empty-state {
  padding: 2rem;
  border: 1px dashed var(--line);
  color: var(--muted);
  text-align: center;
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem;
  border-top: 1px solid var(--line);
  background: #030503;
  color: var(--muted);
  font-size: 0.62rem;
}

.site-footer > div {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.danger-text {
  color: #d26a76;
}

.auth-button.connected,
.text-button.connected {
  color: var(--cyan);
  border-color: color-mix(in srgb, var(--cyan) 55%, transparent);
}

.server-notice {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid color-mix(in srgb, var(--cyan) 50%, transparent);
  background: color-mix(in srgb, var(--cyan) 7%, transparent);
  color: var(--cyan);
}

.server-notice span {
  color: var(--muted);
  font-size: 0.75rem;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line);
}

.auth-switch button {
  padding: 0.85rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.auth-switch button + button {
  border-left: 1px solid var(--line);
}

.auth-switch button.active {
  background: var(--acid);
  color: var(--ink);
  font-weight: 700;
}

.post-actions button.selected {
  color: var(--acid);
  border-color: var(--acid);
  background: color-mix(in srgb, var(--acid) 8%, transparent);
}

.inventory-item [data-claim-receipt] {
  width: 100%;
  margin-top: 0.9rem;
}

.glitch {
  position: relative;
}

.glitch:hover::before,
.glitch:hover::after {
  position: absolute;
  inset: 0;
  content: attr(data-text);
  pointer-events: none;
}

.glitch:hover::before {
  color: var(--coral);
  transform: translate(3px, -1px);
  clip-path: inset(10% 0 65% 0);
}

.glitch:hover::after {
  color: var(--cyan);
  transform: translate(-3px, 1px);
  clip-path: inset(70% 0 5% 0);
}

@keyframes ticker-scroll {
  to { transform: translateX(-50%); }
}

@keyframes terminal-scan {
  0%, 15% { left: -100%; }
  65%, 100% { left: 130%; }
}

@keyframes pulse-ring {
  0%, 100% { opacity: 0.65; text-shadow: 0 0 4px var(--acid); }
  50% { opacity: 1; text-shadow: 0 0 18px var(--acid); }
}

@keyframes blink {
  50% { opacity: 0.2; }
}

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

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

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

  .market-status {
    display: none;
  }

  .main-nav {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .main-nav a:nth-child(4) {
    border-right: 0;
  }

  .main-nav a:nth-child(n + 5) {
    border-top: 1px solid var(--line);
  }

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

  .hero-copy {
    min-height: 580px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .hero-terminal {
    min-height: 560px;
  }

  .route-grid,
  .relic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .first-shift {
    grid-template-columns: 1fr;
  }

  .first-shift-copy {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
}

@media (max-width: 780px) {
  body {
    font-size: 14px;
  }

  .topbar {
    position: relative;
    grid-template-columns: 1fr;
  }

  .topbar-actions {
    justify-content: space-between;
  }

  .main-nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .main-nav a,
  .main-nav a:nth-child(4) {
    border-top: 1px solid var(--line);
    border-right: 1px solid var(--line);
  }

  .main-nav a:nth-child(even) {
    border-right: 0;
  }

  .metric-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-status-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .live-status-cell:nth-child(2) {
    border-right: 0;
  }

  .live-status-cell:nth-child(n + 3) {
    border-top: 1px solid rgba(17, 21, 16, 0.24);
  }

  .shift-checklist {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .shift-step:nth-child(2) {
    border-right: 0;
  }

  .shift-step:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .metric:nth-child(2) {
    border-right: 0;
  }

  .metric:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .manifesto-grid,
  .report-layout,
  .exchange-layout,
  .floor-layout,
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .manifesto-aside,
  .report-list,
  .agent-rail {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .report-list {
    display: flex;
    overflow-x: auto;
  }

  .report-list button {
    min-width: 220px;
    border-right: 1px solid var(--line);
  }

  .agent-rail {
    display: grid;
    grid-template-columns: repeat(3, minmax(180px, 1fr));
    overflow-x: auto;
  }

  .agent-rail h2,
  .mining-rule {
    grid-column: 1 / -1;
  }

  .mission-grid,
  .desk-grid {
    grid-template-columns: 1fr;
  }

  .live-chat {
    position: static;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 540px) {
  .wordmark small,
  #audio-toggle {
    display: none;
  }

  .wallet-button {
    width: 100%;
  }

  .hero-copy {
    min-height: 500px;
  }

  .hero h1 {
    font-size: clamp(3.25rem, 22vw, 6rem);
  }

  .route-grid,
  .relic-grid,
  .inventory-list {
    grid-template-columns: 1fr;
  }

  .chat-message {
    grid-template-columns: 1fr;
    gap: 0.35rem;
  }

  .chat-form {
    grid-template-columns: 1fr;
  }

  .chat-form textarea {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .chat-form button {
    min-height: 52px;
  }

  .profile-stats {
    grid-template-columns: 1fr;
  }

  .live-status-strip,
  .shift-checklist {
    grid-template-columns: 1fr;
  }

  .live-status-cell,
  .live-status-cell:nth-child(2),
  .shift-step,
  .shift-step:nth-child(2) {
    border-right: 0;
    border-bottom: 1px solid rgba(17, 21, 16, 0.24);
  }

  .shift-step {
    min-height: 130px;
  }

  .modal-layer {
    align-items: start;
    padding: 0;
  }

  .modal-card,
  .terminal-modal {
    width: 100%;
    min-height: 100vh;
    max-height: none;
    border-inline: 0;
  }
}

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