/* ==========================================================
   THE EXCHANGE GAZETTE
   A financial broadsheet that you can also trade on.
   Cream paper. Ink black. Vermillion accent.
   Fraunces (display) + Inter Tight (body) + JetBrains Mono (figures)
   ========================================================== */

:root {
  /* Palette — paper & ink */
  --paper:        #F2EBE0;
  --paper-2:      #ECE3D2;
  --paper-3:      #E0D5BE;
  --paper-sunk:   #DFD5C0;
  --ink:          #1A1614;
  --ink-2:        #3A3530;
  --ink-3:        #6E6760;
  --ink-4:        #9A938A;
  --rule:         #1A1614;
  --rule-thin:    #B6AC99;
  --rule-soft:    #C2B8A7;

  /* Signals */
  --accent:       #C84B2A;   /* vermillion */
  --accent-tint:  #F1D7CC;
  --gain:         #2F5D3D;   /* forest */
  --gain-tint:    #D4DDD0;
  --loss:         #962E2E;   /* oxblood */
  --loss-tint:    #ECCFCB;
  --gold:         #9C7A33;
  --ribbon:       #1A1614;
  --ribbon-fg:    #F2EBE0;

  /* Type */
  --serif:  'Fraunces', 'Times New Roman', serif;
  --sans:   'Inter Tight', -apple-system, sans-serif;
  --mono:   'JetBrains Mono', ui-monospace, Menlo, monospace;
  --num:    'JetBrains Mono', ui-monospace, monospace;

  --tab-feat: "tnum", "zero", "ss01";
}

/* ---------- RESET ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--paper); color: var(--ink); }
html { font-size: 16px; }
body {
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
  background:
    repeating-linear-gradient(0deg,
      rgba(26,22,20,0.012) 0,
      rgba(26,22,20,0.012) 1px,
      transparent 1px, transparent 4px),
    var(--paper);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01";
  overflow-x: hidden;
}

button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input { font-family: inherit; }
.hidden { display: none !important; }
.muted { color: var(--ink-3); }
em { font-style: italic; }
.num { font-family: var(--num); font-feature-settings: var(--tab-feat); }

/* ---------- PAPER GRAIN OVERLAY ---------- */
.paper-grain {
  position: fixed; inset: 0;
  pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0 0.07 0 0 0 0.18 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.55;
  mix-blend-mode: multiply;
  z-index: 1;
}

/* ---------- TYPE PRIMITIVES ---------- */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--ink);
  font-feature-settings: "ss01";
  letter-spacing: -0.01em;
}

/* ---------- HORIZONTAL RULES ---------- */
.rule { width: 100%; }
.rule-thin {
  height: 1px;
  background: var(--ink);
  opacity: 1;
  margin: 4px 0;
}
.rule-double {
  height: 5px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  margin: 6px 0;
}

/* ====================================================
   SPLASH SCREEN — "Today's edition"
   ==================================================== */
.splash {
  position: fixed; inset: 0;
  background: var(--paper);
  display: flex; justify-content: center;
  padding: 24px 24px 60px;
  overflow-y: auto;
  z-index: 100;
}
.splash-inner {
  max-width: 760px; width: 100%;
  position: relative;
  z-index: 2;
}

/* Masthead — newspaper top */
.masthead-block { text-align: center; padding-bottom: 14px; }
.masthead-meta {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
  display: flex; justify-content: center; gap: 14px;
  padding: 7px 0;
}
.masthead-title {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(46px, 7vw, 76px);
  line-height: 0.9;
  letter-spacing: -0.035em;
  font-feature-settings: "ss01";
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0;
  padding: 8px 0 10px;
  text-align: center;
  color: var(--ink);
}
.masthead-title em {
  font-style: italic;
  font-weight: 400;
  font-variation-settings: "opsz" 144, "SOFT" 100, "WONK" 1;
  display: block;
  margin-top: -6px;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.masthead-tag {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 14px;
  letter-spacing: 0.04em;
  color: var(--ink-2);
  padding: 8px 0;
}

/* Splash loading */
.splash-load {
  margin: 56px auto 0;
  max-width: 420px;
}
.splash-load-line {
  display: flex; justify-content: space-between;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-bottom: 8px;
}
.splash-load-bar {
  height: 2px;
  background: var(--rule-soft);
  overflow: hidden;
}
.splash-load-bar > div {
  height: 100%; width: 0%;
  background: var(--ink);
  transition: width .25s linear;
}

/* Lead article on splash */
.lead-article {
  margin: 18px 0 16px;
  padding: 12px 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.lead-eyebrow {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  color: var(--ink-2);
  margin-bottom: 14px;
  font-weight: 500;
}
.lead-body {
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 14;
  font-size: 16.5px;
  line-height: 1.55;
  color: var(--ink);
  text-align: justify;
  hyphens: auto;
  column-count: 1;
}
.dropcap {
  font-family: var(--serif);
  font-weight: 700;
  font-variation-settings: "opsz" 144, "SOFT" 0;
  font-size: 56px;
  line-height: 0.85;
  float: left;
  padding: 4px 8px 0 0;
  color: var(--ink);
}

/* Onboarding sections */
.onboard-section { margin: 16px 0; }

.section-head {
  display: flex; align-items: baseline; gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 14px;
}
.section-num {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 18px;
  color: var(--ink);
}
.section-title {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink);
}
.section-tail {
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-3);
  font-size: 13px;
  font-weight: 300;
}
.section-rule {
  flex: 1;
  height: 0;
  border-top: 1px solid var(--ink);
  align-self: center;
}

/* Starter grid */
.starter-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0;
  border-top: 1px solid var(--rule-thin);
  border-left: 1px solid var(--rule-thin);
}
.starter-card {
  background: var(--paper);
  border-right: 1px solid var(--rule-thin);
  border-bottom: 1px solid var(--rule-thin);
  padding: 14px 14px 16px;
  cursor: pointer;
  transition: background .12s;
  position: relative;
}
.starter-card:hover { background: var(--paper-2); }
.starter-card.selected {
  background: var(--ink);
  color: var(--paper);
}
.starter-card.selected .st-ticker,
.starter-card.selected .st-name,
.starter-card.selected .st-desc { color: var(--paper); }
.starter-card.selected::before {
  content: "✓";
  position: absolute;
  top: 8px; right: 10px;
  font-family: var(--serif);
  font-weight: 700;
  color: var(--accent);
}
.starter-card .st-tier {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink-3);
}
.starter-card.selected .st-tier { color: var(--paper-3); }
.starter-card .st-ticker {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink);
  margin: 4px 0 0;
}
.starter-card .st-name {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  margin: 2px 0 4px;
  color: var(--ink);
}
.starter-card .st-desc {
  font-size: 11.5px;
  line-height: 1.45;
  color: var(--ink-3);
}

/* Splash name input */
.splash-name input {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--ink);
  padding: 10px 0;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: var(--ink);
}
.splash-name input::placeholder { color: var(--ink-4); font-style: italic; }
.splash-name input:focus { outline: none; border-bottom-color: var(--accent); }

.check-row {
  display: flex; align-items: center; gap: 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14.5px;
  color: var(--ink);
  cursor: pointer;
  padding: 6px 0;
}
.check-row em { color: var(--ink-3); font-weight: 300; }
.check-row input {
  appearance: none;
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border: 1px solid var(--ink);
  background: var(--paper);
  cursor: pointer;
  position: relative;
}
.check-row input:checked {
  background: var(--ink);
}
.check-row input:checked::after {
  content: "✓";
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--paper);
  font-size: 13px;
  font-weight: 700;
}

/* Splash start CTA */
.splash-start {
  margin-top: 36px;
  text-align: center;
}
.splash-start .btn-press { margin: 6px auto; }

/* Resume card */
.splash-resume { margin-top: 24px; }
.resume-card {
  border: 1px solid var(--ink);
  padding: 18px;
  background: var(--paper-2);
}
.resume-line {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px dotted var(--rule-soft);
}
.resume-line:last-child { border-bottom: none; }
.resume-label {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.resume-value {
  font-family: var(--serif);
  font-style: italic;
  font-size: 16px;
  color: var(--ink);
}
.resume-value.num {
  font-family: var(--mono);
  font-style: normal;
  font-weight: 600;
}
.resume-actions {
  display: flex; gap: 12px; justify-content: center;
  margin-top: 18px;
}

/* ====================================================
   BUTTONS — "Letterpress" style
   ==================================================== */
.btn-press {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 12px 22px;
  border: 1px solid var(--ink);
  position: relative;
  transition: transform .08s, background .12s;
}
.btn-press:hover {
  background: var(--accent);
  border-color: var(--accent);
}
.btn-press:active { transform: translateY(1px); }
.btn-press:disabled {
  background: var(--paper-3);
  color: var(--ink-3);
  border-color: var(--rule-thin);
  cursor: not-allowed;
}
.btn-press:disabled:hover { background: var(--paper-3); border-color: var(--rule-thin); }
.btn-press-large {
  padding: 16px 36px;
  font-size: 14px;
  letter-spacing: 0.16em;
}
.btn-press-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--ink);
}
.btn-press-ghost:hover {
  background: var(--ink);
  color: var(--paper);
}
.btn-press-gain {
  background: var(--gain);
  border-color: var(--gain);
  width: 100%;
  margin-top: 6px;
}
.btn-press-gain:hover {
  background: #224A2F;
  border-color: #224A2F;
}
.btn-press-loss {
  background: var(--loss);
  border-color: var(--loss);
  width: 100%;
  margin-top: 6px;
}
.btn-press-loss:hover {
  background: #7A2222;
  border-color: #7A2222;
}

.press-corner { font-family: var(--mono); opacity: 0.6; font-weight: 400; letter-spacing: 0; }

.btn-thin {
  display: inline-flex; align-items: center; gap: 4px;
  background: transparent;
  color: var(--ink-2);
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 7px 0;
  border: none;
  border-bottom: 1px solid var(--ink-2);
  margin-top: 6px;
  text-align: center;
  width: 100%;
  cursor: pointer;
  transition: color .12s, border-color .12s;
}
.btn-thin:hover { color: var(--accent); border-bottom-color: var(--accent); }

/* ====================================================
   TICKERTAPE — scrolling marquee
   ==================================================== */
.ticker {
  position: sticky; top: 0;
  z-index: 60;
  display: flex;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--mono);
  font-size: 12px;
  font-feature-settings: var(--tab-feat);
  height: 28px;
  align-items: center;
  border-bottom: 1px solid var(--ink);
  overflow: hidden;
}
.ticker-edge {
  flex-shrink: 0;
  padding: 0 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 10.5px;
  border-right: 1px solid var(--paper);
  height: 100%;
  display: flex; align-items: center;
  background: var(--accent);
  color: var(--paper);
}
.ticker-edge-r {
  border-right: none;
  border-left: 1px solid var(--paper);
  background: var(--ink);
  color: var(--paper-3);
}
.ticker-window {
  flex: 1;
  overflow: hidden;
  position: relative;
}
.ticker-track {
  display: inline-block;
  white-space: nowrap;
  animation: tickerScroll 110s linear infinite;
  padding-left: 100%;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes tickerScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-100%); }
}
.ticker-item {
  display: inline-flex; align-items: center; gap: 6px;
  margin-right: 28px;
}
.ticker-sym { color: var(--paper); font-weight: 700; letter-spacing: 0.04em; }
.ticker-px  { color: var(--paper-3); }
.ticker-pct.up   { color: #62C188; }
.ticker-pct.down { color: #E68682; }
.ticker-sep { color: var(--ink-3); }

/* ====================================================
   TOPBAR — masthead carried into the app (compact)
   ==================================================== */
.topbar {
  position: sticky; top: 28px;
  z-index: 55;
  display: flex; justify-content: space-between; align-items: center;
  padding: 8px 28px 6px;
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}
.topbar-left { display: flex; align-items: baseline; gap: 12px; }
.paper-logo {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 0.95;
  font-feature-settings: "ss01";
  display: flex;
  align-items: baseline;
  gap: 6px;
}
.paper-logo-the {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink-2);
}
.paper-logo-name {
  font-size: 22px;
  font-variation-settings: "opsz" 144, "SOFT" 50, "WONK" 1;
  letter-spacing: -0.025em;
  color: var(--ink);
}
.paper-logo-name em { font-style: italic; font-weight: 400; }
.topbar-meta {
  display: flex; gap: 6px;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.topbar-stats {
  display: flex; align-items: flex-end; gap: 16px;
}
.stat-sep {
  width: 1px;
  align-self: stretch;
  background: var(--rule-soft);
}
.stat { display: flex; flex-direction: column; gap: 1px; min-width: 72px; text-align: right; }
.stat-label {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.stat-value {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  font-feature-settings: var(--tab-feat);
  line-height: 1.1;
}
.stat.alert {
  background: var(--accent);
  color: var(--paper);
  padding: 4px 10px;
  font-size: 11px;
}

/* ====================================================
   SECTION NAV (compact)
   ==================================================== */
.sections {
  position: sticky; top: 72px;
  z-index: 50;
  background: var(--paper);
  padding: 0 28px;
}
.sections-row {
  display: flex; align-items: center; gap: 0;
  padding: 2px 0;
}
.tab {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 15px;
  font-variation-settings: "opsz" 24, "SOFT" 50;
  letter-spacing: -0.005em;
  color: var(--ink-3);
  padding: 4px 10px;
  transition: color .12s;
  display: flex; align-items: baseline; gap: 5px;
}
.tab:first-child { padding-left: 0; }
.tab:hover { color: var(--ink); }
.tab.active { color: var(--ink); font-style: italic; font-weight: 600; }
.tab.active .tab-num { color: var(--accent); }
.tab-num {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-4);
  font-feature-settings: "ss01";
  letter-spacing: 0;
}
.sep {
  font-family: var(--serif);
  color: var(--ink-4);
  font-weight: 300;
  font-size: 15px;
}

/* ====================================================
   MAIN APP LAYOUT
   ==================================================== */
.app {
  padding: 14px 28px 60px;
  max-width: 1500px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

.panel { animation: fadeIn .18s ease; }
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(2px); }
  to { opacity: 1; transform: none; }
}

/* Page title block (compact — eyebrow + title inline, tag on right) */
.page-title-block {
  padding: 4px 0 8px;
  border-bottom: 1px solid var(--ink);
  margin-bottom: 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  gap: 0 14px;
  align-items: baseline;
}
.page-title-eyebrow {
  grid-column: 1; grid-row: 1;
  font-family: var(--mono);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 0;
}
.page-title {
  grid-column: 1; grid-row: 2;
  font-family: var(--serif);
  font-weight: 700;
  font-variation-settings: "opsz" 144, "SOFT" 0, "WONK" 0;
  font-size: 26px;
  letter-spacing: -0.02em;
  line-height: 1;
  color: var(--ink);
  margin-bottom: 0;
  white-space: nowrap;
}
.page-title-tag {
  grid-column: 2; grid-row: 1 / 3;
  align-self: end;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-variation-settings: "opsz" 14;
  font-size: 12.5px;
  color: var(--ink-3);
  text-align: right;
  max-width: 480px;
  justify-self: end;
}
@media (max-width: 760px) {
  .page-title-block { grid-template-columns: 1fr; }
  .page-title-tag { grid-column: 1; grid-row: 3; text-align: left; justify-self: start; }
}

/* Panel section divider */
.panel-section { margin-bottom: 36px; }

/* 12-column grids */
.floor-grid, .ledger-grid, .wire-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px 18px;
}
.span-4 { grid-column: span 4; }
.span-5 { grid-column: span 5; }
.span-6 { grid-column: span 6; }
.span-7 { grid-column: span 7; }
.span-8 { grid-column: span 8; }
.span-12 { grid-column: span 12; }
@media (max-width: 760px) {
  .span-4, .span-5, .span-6, .span-7, .span-8 { grid-column: span 12; }
}

/* Blocks — replaces "cards", no rounded corners or shadows */
.block {
  background: var(--paper);
  border-top: 1px solid var(--ink);
  padding: 8px 0 0;
  position: relative;
}
.block-feature {
  border-top-width: 3px;
}
.block-head {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-bottom: 8px;
  gap: 10px;
}
.block-label {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
}
.block-meta {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-3);
  font-weight: 300;
}

.block-divider {
  height: 1px;
  background: var(--rule-soft);
  margin: 14px 0;
}

/* ====================================================
   DASHBOARD (Floor)
   ==================================================== */
.empire-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--ink);
}
.empire-summary > div {
  padding: 6px 10px 5px;
  border-bottom: 1px solid var(--rule-soft);
  border-right: 1px solid var(--rule-soft);
}
.empire-summary > div:nth-child(3n) { border-right: none; }
.empire-summary > div:nth-last-child(-n+3) { border-bottom: none; }
.empire-summary .lbl {
  font-family: var(--sans);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: block;
  margin-bottom: 2px;
  font-weight: 500;
}
.empire-summary .vl {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  font-feature-settings: var(--tab-feat);
  color: var(--ink);
  line-height: 1.1;
}

/* Production list (compact) */
.production-list {
  display: flex; flex-direction: column;
  max-height: 220px;
  overflow-y: auto;
  border-top: 1px solid var(--ink);
}
.prod-row {
  display: grid;
  grid-template-columns: 48px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 6px 4px;
  border-bottom: 1px solid var(--rule-soft);
}
.prod-row:nth-child(even) { background: var(--paper-2); }
.prod-ticker {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.05em;
  text-align: center;
  padding: 4px 0;
  border: 1px solid var(--ink);
  background: var(--paper);
}
.prod-row.starved .prod-ticker {
  background: var(--accent);
  color: var(--paper);
  border-color: var(--accent);
}
.prod-name {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 14.5px;
  color: var(--ink);
}
.prod-out {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  margin-top: 1px;
}
.prod-bar {
  height: 3px; background: var(--paper-3);
  margin-top: 5px;
  overflow: hidden;
}
.prod-bar > div { height: 100%; background: var(--ink); transition: width 1s linear; }
.prod-row.prod-ready .prod-bar > div { background: var(--gain); }
.prod-row.starved .prod-bar > div { background: var(--accent); }
.prod-time {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-2);
  text-align: right;
  min-width: 36px;
  font-feature-settings: var(--tab-feat);
}

/* Activity feed */
.activity-feed {
  max-height: 220px; overflow-y: auto;
  border-top: 1px solid var(--ink);
}
.feed-row {
  display: grid;
  grid-template-columns: 48px 1fr;
  padding: 4px 4px;
  border-bottom: 1px dotted var(--rule-soft);
  font-size: 12px;
}
.feed-row .t {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.02em;
  padding-top: 2px;
}
.feed-row .m {
  font-family: var(--serif);
  font-weight: 400;
  font-variation-settings: "opsz" 14;
  color: var(--ink);
  line-height: 1.4;
}

/* Movers grid */
.movers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--rule-soft);
}
.mover {
  padding: 6px 10px;
  border-right: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  cursor: pointer;
  background: var(--paper);
  transition: background .12s;
  position: relative;
}
.mover:hover { background: var(--paper-2); }
.mover .nm {
  font-family: var(--sans);
  font-size: 9.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.mover .mv-ticker {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}
.mover .pr {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  font-feature-settings: var(--tab-feat);
  margin: 2px 0 0;
  line-height: 1.1;
}
.mover .dl {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 500;
  font-feature-settings: var(--tab-feat);
}
.mover .dl.gain { color: var(--gain); }
.mover .dl.loss { color: var(--loss); }

/* ====================================================
   BUSINESSES (Holdings)
   ==================================================== */
.biz-grid {
  /* Chain-grouped layout — each section stacks vertically and has its own
     internal card grid via .biz-chain-row. */
  display: block;
}
.biz-card {
  background: var(--paper);
  border-right: 1px solid var(--rule-thin);
  border-bottom: 1px solid var(--rule-thin);
  padding: 10px 12px 12px;
  position: relative;
}
.biz-card-head {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px;
  align-items: center;
  margin-bottom: 8px;
}
.biz-ticker {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  text-align: center;
  letter-spacing: 0.04em;
  color: var(--ink);
  padding: 8px 4px;
  border: 1px solid var(--ink);
  background: var(--paper);
  position: relative;
}
.biz-count {
  display: block;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 11px;
  color: var(--accent);
  margin-top: 2px;
  letter-spacing: 0;
}
.biz-corp {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 14px;
  color: var(--accent);
  letter-spacing: 0;
}
.biz-owned-badge {
  position: absolute;
  top: 6px; right: 8px;
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  background: var(--ink);
  color: var(--paper);
  padding: 2px 6px;
}
.btn-thin.disabled, .btn-thin:disabled {
  color: var(--ink-4);
  border-bottom-color: var(--ink-4);
  cursor: not-allowed;
}
.btn-thin.disabled:hover, .btn-thin:disabled:hover {
  color: var(--ink-4);
  border-bottom-color: var(--ink-4);
}
.biz-title {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-variation-settings: "opsz" 24, "SOFT" 50;
  font-size: 18px;
  color: var(--ink);
  line-height: 1;
}
.biz-tier {
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 2px;
  font-weight: 500;
}
.biz-recipe {
  font-family: var(--mono);
  font-size: 10.5px;
  background: var(--paper-2);
  padding: 5px 8px;
  border-left: 2px solid var(--ink);
  color: var(--ink-2);
  letter-spacing: 0.02em;
  font-feature-settings: var(--tab-feat);
}
.biz-recipe .arrow { color: var(--accent); margin: 0 6px; font-weight: 600; }
.biz-recipe-p2p {
  background: var(--accent-tint);
  border-left-color: var(--accent);
  color: var(--ink);
}
.biz-recipe-p2p strong {
  color: var(--accent);
  font-weight: 700;
  letter-spacing: 0.06em;
}
.biz-recipe-passive {
  background: var(--paper-3);
  border-left-color: var(--ink-3);
  color: var(--ink-2);
  font-family: var(--mono);
  letter-spacing: 0.08em;
}

/* Tier 4 fee badge on shop cards */
/* Buy biz modal (BM-prefixed classes) */
.bm-row { margin-bottom: 12px; }
.bm-label {
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-2);
  display: block;
  margin-bottom: 6px;
}
.bm-qty-ctrl {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper-2);
  padding: 6px 10px;
  border: 1px solid var(--ink);
}
.bm-qty-ctrl button {
  width: 28px; height: 28px;
  background: var(--ink); color: var(--paper);
  font-family: var(--mono); font-size: 16px; font-weight: 700;
  cursor: pointer;
}
.bm-qty-ctrl button:hover { background: var(--accent); }
.bm-qty-val {
  font-family: var(--mono); font-size: 20px; font-weight: 700;
  min-width: 36px; text-align: center;
  font-feature-settings: var(--tab-feat);
}
.bm-qty-asset {
  font-family: var(--mono); font-size: 11px; color: var(--ink-3);
  margin-left: auto;
}

.bm-providers {
  display: flex; flex-direction: column;
  border: 1px solid var(--ink);
  background: var(--paper);
  max-height: 200px;
  overflow-y: auto;
}
.bm-prov {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 10px;
  border-bottom: 1px dotted var(--rule-soft);
  cursor: pointer;
  transition: background .1s;
}
.bm-prov:hover { background: var(--paper-2); }
.bm-prov:last-child { border-bottom: none; }
.bm-prov input { accent-color: var(--accent); margin: 0; }
.bm-prov.selected { background: var(--accent-tint); }
.bm-prov-main { flex: 1; }
.bm-prov-line1 {
  display: flex; justify-content: space-between; align-items: baseline;
}
.bm-prov-name {
  font-family: var(--serif);
  font-size: 14px;
  color: var(--ink);
}
.bm-prov-name em { color: var(--accent); font-style: italic; font-size: 11px; }
.bm-prov-rate {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 700;
  font-feature-settings: var(--tab-feat);
  color: var(--ink);
}
.bm-prov.selected .bm-prov-rate { color: var(--accent); }
.bm-prov-line2 {
  display: flex; gap: 10px; align-items: baseline;
  font-family: var(--mono); font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 2px;
}
.bm-prov-bonus {
  color: var(--gain);
  font-weight: 700;
  letter-spacing: 0.04em;
}
.bm-no-provider {
  padding: 12px;
  font-family: var(--serif); font-style: italic;
  color: var(--ink-3);
  background: var(--paper-2);
  border: 1px solid var(--rule-thin);
}

.bm-bonus-banner {
  background: var(--gain-tint);
  border-left: 3px solid var(--gain);
  padding: 8px 12px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink);
  margin: 8px 0;
}
.bm-bonus-banner strong {
  font-family: var(--mono);
  font-style: normal;
  font-weight: 700;
  color: var(--gain);
}

/* Set Terms modal */
.terms-slider {
  display: flex; align-items: center; gap: 12px;
  background: var(--paper-2);
  padding: 6px 10px;
  border: 1px solid var(--ink);
}
.terms-slider input[type="range"] {
  flex: 1;
  accent-color: var(--accent);
}
.terms-slider-min, .terms-slider-max {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  font-feature-settings: var(--tab-feat);
}
.terms-rate-display {
  font-family: var(--mono);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  margin-top: 8px;
  font-feature-settings: var(--tab-feat);
}
.terms-note {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 8px 12px;
  background: var(--paper-2);
  border-left: 2px solid var(--ink-3);
  margin: 8px 0;
}
.terms-note em { color: var(--ink); }
.terms-comp {
  margin-top: 12px;
  border-top: 1px solid var(--ink);
}
.terms-comp-head {
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-2);
  padding: 6px 0 4px;
}
.terms-comp-row {
  display: flex; justify-content: space-between;
  font-family: var(--serif);
  font-size: 13px;
  padding: 3px 4px;
  border-bottom: 1px dotted var(--rule-soft);
}
.terms-comp-row em { color: var(--accent); font-size: 11px; }
.terms-comp-row .num {
  font-family: var(--mono);
  font-weight: 700;
  font-feature-settings: var(--tab-feat);
}

/* Loans table on the Floor */
.loans-empty {
  padding: 14px;
  font-family: var(--serif); font-style: italic; font-size: 13px;
  color: var(--ink-3);
  background: var(--paper-2);
  border-top: 1px solid var(--ink);
}
.loans-table {
  border-top: 1px solid var(--ink);
}
.loans-row {
  display: grid;
  grid-template-columns: 1.5fr 0.7fr 1fr 1fr 0.9fr 1.4fr 0.8fr;
  gap: 10px;
  padding: 6px 8px;
  border-bottom: 1px dotted var(--rule-soft);
  align-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
  font-feature-settings: var(--tab-feat);
}
.loans-row.loans-head {
  background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: 9.5px;
  letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 700;
}
.loans-cp {
  font-family: var(--serif); font-size: 13px;
  color: var(--ink);
}
.loans-role {
  font-weight: 700;
  letter-spacing: 0.08em;
}
.loans-role.gain { color: var(--gain); }
.loans-role.loss { color: var(--loss); }
.loans-row .num { text-align: right; }
.loans-row .gain { color: var(--gain); font-weight: 700; }
.loans-row .loss { color: var(--loss); font-weight: 700; }

/* M&A acquisitions table */
.mna-table {
  border-top: 1px solid var(--ink);
}
.mna-row {
  display: grid;
  grid-template-columns: 60px 1.5fr 1.2fr 60px 1fr 1.2fr 90px;
  gap: 10px;
  padding: 5px 8px;
  border-bottom: 1px dotted var(--rule-soft);
  align-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
  font-feature-settings: var(--tab-feat);
}
.mna-row.mna-head {
  background: var(--ink); color: var(--paper);
  font-family: var(--sans); font-size: 9.5px;
  letter-spacing: 0.16em; text-transform: uppercase;
  font-weight: 700;
}
.mna-row:nth-child(even):not(.mna-head) { background: var(--paper-2); }
.mna-ticker {
  font-family: var(--mono);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.mna-name {
  font-family: var(--serif);
  font-size: 13px;
  color: var(--ink);
}
.mna-op {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink-2);
}
.mna-row .num { text-align: right; }

.biz-fee-badge {
  font-family: var(--mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--accent);
  padding: 3px 8px;
  background: var(--accent-tint);
  border-left: 2px solid var(--accent);
  margin: 4px 0;
}
.biz-shop-card.is-p2p { background: linear-gradient(180deg, var(--accent-tint) 0%, var(--paper) 30%); }
.biz-shop-card.is-passive { background: linear-gradient(180deg, var(--paper-3) 0%, var(--paper) 30%); }
.biz-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  margin: 6px 0;
  border-top: 1px solid var(--rule-soft);
  border-left: 1px solid var(--rule-soft);
}
.biz-meta div {
  padding: 3px 8px 2px;
  border-bottom: 1px solid var(--rule-soft);
  border-right: 1px solid var(--rule-soft);
}
.biz-meta .lb {
  font-family: var(--sans);
  font-size: 8.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  display: block;
  font-weight: 500;
}
.biz-meta .vl {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  font-feature-settings: var(--tab-feat);
  color: var(--ink);
}
.biz-inv {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-2);
  letter-spacing: 0.02em;
  margin: 4px 0;
  padding: 3px 0;
  border-top: 1px dotted var(--rule-soft);
  border-bottom: 1px dotted var(--rule-soft);
}
.biz-actions {
  display: flex; gap: 6px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.biz-actions .btn-thin {
  flex: 1;
  margin-top: 0;
  padding: 4px 0;
  font-size: 10px;
}
.biz-status-bar {
  height: 3px;
  background: var(--paper-3);
  margin: 6px 0 2px;
  overflow: hidden;
}
.biz-status-bar > div {
  height: 100%; background: var(--ink);
  transition: width 1s linear;
}
.biz-card.ready .biz-status-bar > div { background: var(--gain); }
.biz-status-time {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  text-align: right;
  font-feature-settings: var(--tab-feat);
}

/* Acquisition catalog */
.biz-shop-grid {
  /* Chain-grouped layout — each section stacks vertically with its own
     internal card grid via .biz-chain-row. */
  display: block;
}
.biz-shop-card {
  background: var(--paper);
  border-right: 1px solid var(--rule-thin);
  border-bottom: 1px solid var(--rule-thin);
  padding: 8px 12px 10px;
  position: relative;
}
.biz-shop-card.locked { opacity: 0.55; }
.biz-shop-card .lock {
  /* Inline badge instead of absolute-positioned overlay so it doesn't
     overlap the title row on narrow cards. Sits at the top, full width. */
  display: block;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--accent);
  letter-spacing: 0.06em;
  padding: 3px 0;
  margin-bottom: 4px;
  border-bottom: 1px dashed var(--rule-thin);
  text-align: right;
}
.biz-shop-card .btn-thin { margin-top: 10px; }

/* Filter chips */
.biz-filter {
  display: flex; gap: 0;
  margin-left: 16px;
}
.chip {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-3);
  padding: 4px 11px;
  border: 1px solid var(--rule-thin);
  border-right: none;
  background: var(--paper);
  transition: all .1s;
}
.chip:first-child { border-left: 1px solid var(--rule-thin); }
.chip:last-child { border-right: 1px solid var(--rule-thin); }
.chip:hover { background: var(--paper-2); color: var(--ink); }
.chip.active {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}

/* ====================================================
   MARKETPLACE (Exchange)
   ==================================================== */
.market-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
@media (max-width: 760px) {
  .market-layout { grid-template-columns: 1fr; }
}
.market-side {
  border-right: 1px solid var(--ink);
  display: flex; flex-direction: column;
  max-height: 70vh;
  background: var(--paper);
}
.market-search {
  padding: 10px;
  border-bottom: 1px solid var(--ink);
  background: var(--paper-2);
}
.market-search input {
  width: 100%;
  background: var(--paper);
  border: 1px solid var(--rule-thin);
  padding: 7px 10px;
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink);
}
.market-search input::placeholder { color: var(--ink-4); }
.market-search input:focus { outline: none; border-color: var(--ink); }

.market-list { flex: 1; overflow-y: auto; }
.market-item {
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 8px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--rule-soft);
  cursor: pointer;
  align-items: center;
}
.market-item:nth-child(even) { background: var(--paper-2); }
.market-item:hover { background: var(--paper-3); }
.market-item.active { background: var(--ink); color: var(--paper); }
.market-item.active .mi-ticker,
.market-item.active .mi-nm,
.market-item.active .mi-pr { color: var(--paper); }

.mi-ticker {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: 0.05em;
}
.mi-nm {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 13px;
  color: var(--ink);
}
.mi-tier {
  font-family: var(--mono);
  font-size: 9px;
  color: var(--ink-3);
  letter-spacing: 0.05em;
  margin-left: 4px;
}
.mi-pr {
  font-family: var(--mono);
  font-size: 12px;
  font-feature-settings: var(--tab-feat);
  color: var(--ink);
  font-weight: 500;
}

/* Market main */
.market-main {
  padding: 12px 18px;
  display: flex; flex-direction: column;
  gap: 2px;
  background: var(--paper);
}
.market-head {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: flex-start;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ink);
}
.market-head-left { min-width: 0; }
.market-ticker {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.market-name-row { margin: 2px 0; }
.market-name-row h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-variation-settings: "opsz" 144, "SOFT" 0;
  font-size: 26px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.market-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.market-price { text-align: right; }
.market-price-eyebrow {
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.market-price-value {
  font-family: var(--mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--ink);
  font-feature-settings: var(--tab-feat);
  line-height: 1;
  margin-top: 2px;
}
.market-price-delta {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 500;
  margin-top: 4px;
  font-feature-settings: var(--tab-feat);
}

/* Order book */
.book-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--ink);
}
.book { background: var(--paper); }
.book-bids { border-right: 1px solid var(--ink); }
.book-head {
  display: grid;
  grid-template-columns: 1fr 60px 80px;
  padding: 7px 12px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
}
.book-asks .book-head {
  grid-template-columns: 80px 60px 1fr;
}
.book-asks .book-head > span:nth-child(3) { text-align: right; }
.book-row {
  display: grid;
  grid-template-columns: 1fr 60px 80px;
  padding: 2px 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  font-feature-settings: var(--tab-feat);
  position: relative;
  cursor: pointer;
  border-bottom: 1px dotted var(--rule-soft);
}
.book-asks .book-row {
  grid-template-columns: 80px 60px 1fr;
}
.book-asks .book-row > span:nth-child(3) { text-align: right; }

.book-row .bar {
  position: absolute;
  top: 0; bottom: 0;
  pointer-events: none;
  grid-column: 1 / -1;
  grid-row: 1;
  z-index: 0;
}
.book-row > span:not(.bar) {
  position: relative;
  z-index: 1;
}
.book-bids .book-row .bar { right: 0; background: var(--gain-tint); }
.book-asks .book-row .bar { left: 0; background: var(--loss-tint); }
.book-bids .book-row { color: var(--gain); }
.book-asks .book-row { color: var(--loss); }
.book-bids .book-row > span:last-child,
.book-asks .book-row > span:first-child {
  font-weight: 700;
}
.book-row .mine {
  color: var(--accent);
  font-weight: 700;
}
.book-row .npc {
  color: var(--ink-4);
  font-style: italic;
  font-family: var(--serif);
  font-size: 11px;
}
.book-row .cp {
  color: var(--ink-2);
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  font-weight: 400;
}
.book-row:hover { background: var(--paper-2); }
.book-empty {
  padding: 18px;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-3);
  font-size: 13px;
}

/* Order panel */
.order-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--ink);
}
.order-side {
  padding: 8px 12px 10px;
}
.order-buy { border-right: 1px solid var(--ink); }
.order-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 5px;
  border-bottom: 1px solid var(--rule-soft);
  margin-bottom: 6px;
}
.order-side-label {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
}
.order-buy .order-side-label { color: var(--gain); }
.order-sell .order-side-label { color: var(--loss); }
.order-side-meta {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  font-feature-settings: var(--tab-feat);
}
.order-row {
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}
.order-row label {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.order-row input {
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 6px 8px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  font-feature-settings: var(--tab-feat);
}
.order-row input:focus { outline: none; border-color: var(--accent); background: var(--accent-tint); }
.order-total {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  margin: 10px 0 6px;
  text-align: right;
  font-feature-settings: var(--tab-feat);
}
.order-total span { font-weight: 700; color: var(--ink); }

/* My orders */
.my-orders {
  border-top: 1px solid var(--ink);
  margin-top: 4px;
}
.my-orders .section-head { padding-bottom: 8px; margin-bottom: 8px; }
.my-order {
  display: grid;
  grid-template-columns: 70px 1fr 1fr 40px;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dotted var(--rule-soft);
  align-items: center;
  font-family: var(--mono);
  font-size: 11.5px;
  font-feature-settings: var(--tab-feat);
}
.my-order .side-buy {
  font-weight: 700;
  color: var(--gain);
  letter-spacing: 0.1em;
}
.my-order .side-sell {
  font-weight: 700;
  color: var(--loss);
  letter-spacing: 0.1em;
}
.my-order button {
  font-family: var(--mono);
  font-size: 10px;
  color: var(--loss);
  padding: 2px 6px;
  border: 1px solid var(--loss);
  background: transparent;
  transition: all .1s;
}
.my-order button:hover { background: var(--loss); color: var(--paper); }

/* ====================================================
   LEDGER (Empire)
   ==================================================== */
.ledger {
  font-family: var(--mono);
  font-size: 11.5px;
  font-feature-settings: var(--tab-feat);
  border-top: 1px solid var(--ink);
  max-height: 480px;
  overflow-y: auto;
}
.ledger-row {
  display: grid;
  grid-template-columns: 90px 1fr 110px;
  padding: 4px 6px;
  border-bottom: 1px dotted var(--rule-soft);
  align-items: baseline;
}
.ledger-row:nth-child(even) { background: var(--paper-2); }
.ledger-row .lg-time {
  color: var(--ink-3);
  font-size: 10.5px;
  letter-spacing: 0.02em;
}
.ledger-row .lg-label {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink);
}
.ledger-row .lg-amt { text-align: right; font-weight: 700; }
.ledger-row .lg-amt.pos { color: var(--gain); }
.ledger-row .lg-amt.pos::before { content: "▲ "; font-size: 9px; }
.ledger-row .lg-amt.neg { color: var(--loss); }
.ledger-row .lg-amt.neg::before { content: "▼ "; font-size: 9px; }

.legend {
  display: flex; gap: 22px;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-top: 10px;
  font-weight: 500;
}
.leg-mark { font-family: var(--mono); font-size: 10px; margin-right: 4px; }
.leg-gain .leg-mark { color: var(--gain); }
.leg-loss .leg-mark { color: var(--loss); }

/* ====================================================
   WIRE (World)
   ==================================================== */
.event-card {
  padding: 8px 14px;
  margin-bottom: 0;
  background: var(--paper);
  border-top: 1px solid var(--ink);
  border-left: 3px solid var(--ink);
  position: relative;
}
.event-card.danger {
  border-left-color: var(--loss);
  background: linear-gradient(90deg, var(--loss-tint) 0%, var(--paper) 60%);
}
.event-card.boon {
  border-left-color: var(--gain);
  background: linear-gradient(90deg, var(--gain-tint) 0%, var(--paper) 60%);
}
.events-list {
  max-height: 320px;
  overflow-y: auto;
}
.event-card .ev-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 4px;
  font-weight: 600;
}
.event-card.danger .ev-eyebrow { color: var(--loss); }
.event-card.boon .ev-eyebrow { color: var(--gain); }
.event-card .ev-title {
  font-family: var(--serif);
  font-weight: 700;
  font-variation-settings: "opsz" 24, "SOFT" 0;
  font-size: 18px;
  color: var(--ink);
  margin-bottom: 2px;
  letter-spacing: -0.015em;
}
.event-card .ev-desc {
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  font-weight: 300;
  color: var(--ink-2);
}
.event-card .ev-time {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 6px;
  letter-spacing: 0.04em;
}

/* Econ stats table */
.econ-stats {
  border-top: 1px solid var(--ink);
}
.econ-stats > div {
  display: flex; justify-content: space-between;
  padding: 5px 6px;
  border-bottom: 1px dotted var(--rule-soft);
}
.econ-stats > div:nth-child(even) { background: var(--paper-2); }
.econ-stats .lab {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 500;
}
.econ-stats .val {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
  font-feature-settings: var(--tab-feat);
}

/* Leaderboard */
.lb-optin {
  padding: 10px 14px;
  background: var(--paper-2);
  border-left: 3px solid var(--accent);
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-2);
  margin-bottom: 14px;
  display: none;
}
.lb-optin.show { display: block; }

.leaderboard {
  border-top: 1px solid var(--ink);
  max-height: 280px;
  overflow-y: auto;
}
.lb-row {
  display: grid;
  grid-template-columns: 36px 1fr 130px 76px;
  gap: 14px;
  padding: 4px 6px;
  border-bottom: 1px dotted var(--rule-soft);
  align-items: baseline;
}
.lb-row:nth-child(even) { background: var(--paper-2); }
.lb-row .rank {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 16px;
  color: var(--ink-3);
  font-feature-settings: "ss01";
}
.lb-row .rank.gold {
  color: var(--accent);
  font-weight: 700;
}
.lb-row .nm {
  font-family: var(--serif);
  font-weight: 400;
  font-size: 15px;
  color: var(--ink);
}
.lb-row .nm.you {
  color: var(--accent);
  font-weight: 700;
  font-style: italic;
}
.lb-row .nm.you::before {
  content: "▸ ";
  color: var(--accent);
  font-family: var(--mono);
}
.lb-row .nw {
  font-family: var(--mono);
  font-weight: 700;
  text-align: right;
  font-feature-settings: var(--tab-feat);
  font-size: 13.5px;
  color: var(--ink);
}
.lb-row .bz {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--ink-3);
  text-align: right;
  font-feature-settings: var(--tab-feat);
}

/* ====================================================
   MODALS / TOASTS
   ==================================================== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(26, 22, 20, 0.72);
  display: flex; align-items: center; justify-content: center;
  z-index: 200;
  padding: 24px;
  animation: fadeIn .12s ease;
}
.modal {
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  position: relative;
}
.modal::before {
  content: ""; position: absolute;
  top: -1px; left: -1px; right: -1px;
  height: 5px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.modal h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 24px;
  letter-spacing: -0.02em;
  margin-bottom: 8px;
}
.modal p {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 300;
  font-size: 14.5px;
  color: var(--ink-2);
  margin-bottom: 18px;
}
.modal-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  margin-top: 18px;
}
.modal-body { margin-bottom: 12px; }

/* Liquidation modal summary table */
.liq-summary {
  border-top: 1px solid var(--ink);
  font-family: var(--mono);
  font-feature-settings: var(--tab-feat);
  margin: 8px 0;
}
.liq-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 6px 4px;
  border-bottom: 1px dotted var(--rule-soft);
  font-size: 12px;
}
.liq-row em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--ink-2);
  margin-left: 6px;
}
.liq-row .muted { color: var(--ink-3); }
.liq-row .gain { color: var(--gain); font-weight: 700; }
.liq-row .loss { color: var(--loss); font-weight: 700; }
.liq-divider {
  height: 1px; background: var(--ink); margin: 6px 0;
}
.liq-total {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 600;
  font-size: 15px;
  padding: 8px 4px;
  background: var(--paper-2);
}
.liq-total span:last-child { font-family: var(--mono); font-style: normal; font-size: 14px; }
.liq-warn {
  margin-top: 10px;
  padding: 8px;
  background: var(--paper-2);
  border-left: 2px solid var(--accent);
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-3);
}

/* ====================================================
   SHARES — IPO modal, share block on biz card, market section
   ==================================================== */
.market-section-head {
  padding: 8px 12px;
  background: var(--ink);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  font-weight: 700;
  text-align: center;
}
.market-item.is-share .mi-ticker { color: var(--accent); }
.market-item.is-share .mi-tier {
  background: var(--accent);
  color: var(--paper);
  padding: 1px 4px;
}

/* Biz card share block */
.biz-shares-block {
  margin: 6px 0;
  padding: 6px 10px;
  background: var(--paper-2);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule-soft);
}
.biz-shares-head {
  display: flex; justify-content: space-between; align-items: baseline;
  padding-bottom: 6px;
  border-bottom: 1px dotted var(--rule-soft);
  margin-bottom: 6px;
}
.biz-shares-ticker {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: 0.06em;
}
.biz-shares-meta {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.biz-shares-row {
  display: flex; justify-content: space-between;
  font-family: var(--mono);
  font-feature-settings: var(--tab-feat);
  font-size: 11.5px;
  padding: 2px 0;
}
.biz-shares-row > span:first-child {
  color: var(--ink-3);
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* IPO modal */
.ipo-form { font-family: var(--serif); }
.ipo-intro {
  font-style: italic;
  font-size: 14px;
  line-height: 1.5;
  color: var(--ink-2);
  margin-bottom: 16px;
  padding: 10px 12px;
  background: var(--paper-2);
  border-left: 2px solid var(--accent);
}
.ipo-intro em { color: var(--ink); font-weight: 500; }
.ipo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 16px;
  margin-bottom: 14px;
}
.ipo-grid label {
  display: flex; flex-direction: column; gap: 4px;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  font-weight: 500;
}
.ipo-grid label:has(input[type="number"]:not([disabled])):nth-child(5) { grid-column: 1 / -1; }
.ipo-grid input {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  font-feature-settings: var(--tab-feat);
  padding: 8px 10px;
  background: var(--paper);
  border: 1px solid var(--ink);
  color: var(--ink);
}
.ipo-grid input:focus { outline: none; border-color: var(--accent); background: var(--accent-tint); }
.ipo-grid input:disabled { background: var(--paper-3); color: var(--ink-2); }
.ipo-preview {
  border-top: 1px solid var(--ink);
  padding: 8px 4px;
  margin-bottom: 8px;
}
.ipo-prev-row {
  display: flex; justify-content: space-between;
  padding: 4px 0;
  font-family: var(--mono);
  font-size: 12px;
  font-feature-settings: var(--tab-feat);
  border-bottom: 1px dotted var(--rule-soft);
}
.ipo-prev-row:last-child { border-bottom: none; }
.ipo-prev-row > span:first-child {
  font-family: var(--sans);
  font-size: 10.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
}
.ipo-prev-row .gain { color: var(--gain); font-weight: 700; }

/* ====================================================
   EQUITIES TAB — master/detail trading terminal
   ==================================================== */

/* Top stats strip (compact) */
.eq-stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border: 1px solid var(--ink);
  margin-bottom: 10px;
  background: var(--paper);
}
.eq-stat-block {
  padding: 8px 12px 8px;
  border-right: 1px solid var(--rule-soft);
  position: relative;
  display: grid;
  grid-template-columns: 1fr 60px;
  grid-template-rows: auto auto;
  gap: 0 8px;
  align-items: baseline;
}
.eq-stat-block:last-child { border-right: none; }
.eq-stat-label {
  grid-column: 1; grid-row: 1;
  font-family: var(--sans);
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-3);
}
.eq-stat-value {
  grid-column: 1; grid-row: 2;
  font-family: var(--mono);
  font-feature-settings: var(--tab-feat);
  font-size: 19px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1;
  margin-top: 1px;
}
.eq-stat-value.gain { color: var(--gain); }
.eq-stat-value.loss { color: var(--loss); }
.eq-stat-spark {
  grid-column: 2; grid-row: 1 / 3;
  display: block;
  width: 100% !important;
  height: 28px;
  align-self: end;
}
.eq-stat-sub {
  grid-column: 1 / 3; grid-row: 3;
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 9.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
@media (max-width: 880px) {
  .eq-stats-strip { grid-template-columns: 1fr 1fr; }
  .eq-stat-block:nth-child(2) { border-right: none; }
  .eq-stat-block:nth-child(1), .eq-stat-block:nth-child(2) {
    border-bottom: 1px solid var(--rule-soft);
  }
}

/* Filter strip */
.eq-filters {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ink);
}
.eq-filter-chips {
  display: flex; gap: 0;
}
.eq-sort {
  display: flex; align-items: center; gap: 8px;
}
.eq-sort-label {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
#eqSort {
  font-family: var(--mono);
  font-size: 11.5px;
  padding: 4px 8px;
  background: var(--paper);
  border: 1px solid var(--ink);
  color: var(--ink);
  cursor: pointer;
}
#eqSort:focus { outline: none; border-color: var(--accent); }

/* Master / detail layout */
.eq-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 0;
  border: 1px solid var(--ink);
  background: var(--paper);
  min-height: 500px;
}
@media (max-width: 880px) {
  .eq-layout { grid-template-columns: 1fr; }
}

.eq-rail {
  border-right: 1px solid var(--ink);
  display: flex; flex-direction: column;
  max-height: 70vh;
  overflow: hidden;
}
.eq-rail-head {
  display: flex; justify-content: space-between;
  padding: 8px 12px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
}
.eq-rail-list {
  flex: 1;
  overflow-y: auto;
}
.eq-rail-row {
  display: grid;
  grid-template-columns: 1.2fr 60px 70px;
  gap: 10px;
  padding: 8px 12px;
  align-items: center;
  border-bottom: 1px dotted var(--rule-soft);
  cursor: pointer;
  transition: background .1s;
}
.eq-rail-row:hover { background: var(--paper-2); }
.eq-rail-row.selected {
  background: var(--ink);
  color: var(--paper);
}
.eq-rail-row.selected .eq-rail-ticker { color: var(--accent); }
.eq-rail-row.selected .eq-rail-line2 { color: var(--paper-3); }
.eq-rail-row.selected .eq-rail-price { color: var(--paper); }
.eq-rail-row.is-mine .eq-rail-ticker { color: var(--accent); }
.eq-rail-main { min-width: 0; }
.eq-rail-line1 {
  display: flex; align-items: center; gap: 6px;
}
.eq-rail-ticker {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--ink);
}
.eq-rail-mine {
  font-family: var(--mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.14em;
  background: var(--accent);
  color: var(--paper);
  padding: 1px 4px;
}
.eq-rail-hold {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  background: var(--gain);
  color: var(--paper);
  padding: 1px 5px;
}
.eq-rail-line2 {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-3);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eq-rail-spark {
  display: block;
  width: 100% !important;
  height: 32px;
}
.eq-rail-right {
  text-align: right;
}
.eq-rail-price {
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  font-feature-settings: var(--tab-feat);
}
.eq-rail-delta {
  font-family: var(--mono);
  font-size: 10.5px;
  font-feature-settings: var(--tab-feat);
  margin-top: 1px;
}
.eq-rail-delta.gain { color: var(--gain); }
.eq-rail-delta.loss { color: var(--loss); }
.eq-rail-empty {
  padding: 24px 16px;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-3);
  font-size: 13px;
}

/* Detail panel */
.eq-detail {
  padding: 10px 16px;
  display: flex; flex-direction: column; gap: 8px;
  overflow-y: auto;
  max-height: 68vh;
}
.eq-d-head {
  display: grid; grid-template-columns: 1fr auto; gap: 24px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--ink);
}
.eq-d-ticker {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--accent);
}
.eq-d-mine {
  font-family: var(--mono);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  background: var(--ink);
  color: var(--paper);
  padding: 2px 6px;
  margin-left: 6px;
  vertical-align: middle;
}
.eq-d-title {
  font-family: var(--serif);
  font-weight: 700;
  font-variation-settings: "opsz" 144, "SOFT" 0;
  font-size: 24px;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 2px 0;
  color: var(--ink);
}
.eq-d-title em {
  font-style: italic;
  font-weight: 400;
  font-size: 16px;
  color: var(--accent);
}
.eq-d-issuer {
  font-family: var(--serif);
  font-style: italic;
  font-size: 11.5px;
  color: var(--ink-2);
}
.eq-d-issuer strong { color: var(--ink); font-weight: 500; }
.eq-d-head-right { text-align: right; }
.eq-d-last {
  font-family: var(--mono);
  font-feature-settings: var(--tab-feat);
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  color: var(--ink);
}
.eq-d-change {
  font-family: var(--mono);
  font-feature-settings: var(--tab-feat);
  font-size: 13px;
  font-weight: 500;
  margin-top: 4px;
}
.eq-d-change.gain { color: var(--gain); }
.eq-d-change.loss { color: var(--loss); }

.eq-d-chart-wrap { padding: 4px 0; }

.eq-d-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--rule-soft);
}
@media (max-width: 720px) { .eq-d-stats { grid-template-columns: repeat(2, 1fr); } }
.eq-d-stat {
  padding: 5px 10px 4px;
  border-right: 1px solid var(--rule-soft);
  border-bottom: 1px solid var(--rule-soft);
  display: flex; flex-direction: column;
  gap: 1px;
}
.eq-d-stat .lbl {
  font-family: var(--sans);
  font-size: 8.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--ink-3);
}
.eq-d-stat .val {
  font-family: var(--mono);
  font-feature-settings: var(--tab-feat);
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
}

.eq-d-position {
  border: 1px solid var(--ink);
  padding: 6px 12px 8px;
  background: var(--accent-tint);
}
.eq-d-position.empty {
  background: var(--paper-2);
  border-color: var(--rule-thin);
}
.eq-d-pos-head {
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 3px;
}
.eq-d-pos-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 2px 0;
  border-bottom: 1px dotted var(--rule-soft);
}
.eq-d-pos-row:last-child { border-bottom: none; }
.eq-d-pos-row .lbl {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12px;
  color: var(--ink-2);
}
.eq-d-pos-row .val {
  font-family: var(--mono);
  font-feature-settings: var(--tab-feat);
  font-size: 13px;
  font-weight: 700;
  color: var(--ink);
}
.eq-d-pos-empty {
  font-family: var(--serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-3);
}

.eq-d-trade {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border: 1px solid var(--ink);
}
.eq-d-trade-side {
  padding: 8px 12px 10px;
}
.eq-d-trade-buy { border-right: 1px solid var(--ink); }
.eq-d-trade-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink);
  padding-bottom: 5px;
  margin-bottom: 6px;
  border-bottom: 1px solid var(--rule-soft);
}
.eq-d-trade-buy .eq-d-trade-head { color: var(--gain); }
.eq-d-trade-sell .eq-d-trade-head { color: var(--loss); }
.eq-d-trade-stock {
  font-family: var(--mono);
  font-size: 10.5px;
  color: var(--ink-3);
  letter-spacing: 0.04em;
  font-weight: 400;
  text-transform: none;
}
.eq-d-trade-row {
  display: grid; grid-template-columns: 56px 1fr; gap: 8px;
  align-items: center;
  margin-bottom: 4px;
}
.eq-d-trade-row label {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 600;
}
.eq-d-trade-row input {
  background: var(--paper);
  border: 1px solid var(--ink);
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
  font-feature-settings: var(--tab-feat);
}
.eq-d-trade-row input:focus { outline: none; border-color: var(--accent); background: var(--accent-tint); }
.eq-d-trade-total {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--ink-2);
  margin: 8px 0 6px;
  text-align: right;
  font-feature-settings: var(--tab-feat);
}
.eq-d-trade-total span { font-weight: 700; color: var(--ink); }

.eq-d-book {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0;
  border: 1px solid var(--ink);
}
.eq-d-book-side:first-child { border-right: 1px solid var(--ink); }
.eq-d-book-head {
  padding: 6px 10px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 9.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 700;
}
.eq-d-book-row {
  display: grid;
  grid-template-columns: 1fr 50px 70px;
  gap: 8px;
  padding: 4px 10px;
  align-items: center;
  position: relative;
  border-bottom: 1px dotted var(--rule-soft);
  font-family: var(--mono);
  font-size: 11.5px;
  font-feature-settings: var(--tab-feat);
}
.eq-d-book-row > *:not(.eq-d-book-bar) { position: relative; z-index: 1; }
.eq-d-book-bar {
  position: absolute;
  top: 0; bottom: 0;
  z-index: 0;
}
.eq-d-book-bar-bid { right: 0; background: var(--gain-tint); }
.eq-d-book-bar-ask { left: 0; background: var(--loss-tint); }
.eq-d-book-cp {
  font-family: var(--serif);
  font-style: italic;
  font-size: 12.5px;
  color: var(--ink);
  font-weight: 400;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.eq-d-book-cp.npc {
  color: var(--ink-3);
}
.eq-d-book-qty { text-align: center; color: var(--ink-2); }
.eq-d-book-px { text-align: right; font-weight: 700; }
.eq-d-book-px.gain { color: var(--gain); }
.eq-d-book-px.loss { color: var(--loss); }
.eq-d-book-row.mine .eq-d-book-cp { color: var(--accent); font-weight: 700; font-style: normal; font-family: var(--mono); }
.eq-d-book-empty {
  padding: 14px;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-3);
  font-size: 12px;
}

.eq-empty {
  padding: 60px 24px;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  color: var(--ink-3);
  font-size: 16px;
}

.toast-root {
  position: fixed;
  top: 50px; right: 24px;
  display: flex; flex-direction: column; gap: 6px;
  z-index: 150;
  pointer-events: none;
  max-width: 340px;
}
.toast {
  background: var(--paper);
  border: 1px solid var(--ink);
  border-left: 3px solid var(--ink);
  padding: 10px 14px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 13.5px;
  color: var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  animation: slideIn .2s ease, slideOut .25s ease 4s forwards;
  pointer-events: auto;
}
.toast.success { border-left-color: var(--gain); }
.toast.error { border-left-color: var(--loss); }
.toast.warn { border-left-color: var(--accent); }
@keyframes slideIn { from { transform: translateX(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes slideOut { to { transform: translateX(20px); opacity: 0; } }

/* ====================================================
   SCROLLBARS — slim, paper-toned
   ==================================================== */
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-track { background: var(--paper-2); }
*::-webkit-scrollbar-thumb { background: var(--ink-4); }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-2); }

/* ====================================================
   UTILITY ANIMATIONS
   ==================================================== */
.pulse-gain {
  animation: pulseGain .8s;
}
@keyframes pulseGain {
  0% { background: var(--gain-tint); }
  100% { background: transparent; }
}

.pulse-loss {
  animation: pulseLoss .8s;
}
@keyframes pulseLoss {
  0% { background: var(--loss-tint); }
  100% { background: transparent; }
}

/* ============ BUSINESS CHAIN SECTIONS ============ */
.biz-chain-section {
  margin-bottom: 22px;
  /* Reset the grid-column override that was needed when sections were
     inside a CSS-Grid parent — parents are now display:block. */
  grid-column: auto;
}
.biz-chain-section:last-child { margin-bottom: 0; }

.biz-chain-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 0;
  padding: 6px 10px;
  background: var(--paper-2);
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--rule-thin);
}
.biz-chain-icon { font-size: 15px; line-height: 1; }
.biz-chain-name {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--ink);
}
.biz-chain-rule {
  flex: 1;
  height: 1px;
  background: transparent;
}

/* Card rows preserve the original connected-paper aesthetic — cards
   share borders within a chain, matching the look the global biz-grid
   had before chain grouping. The OUTER border on the row provides
   the top/left edge that was previously on .biz-grid. */
.biz-chain-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(310px, 1fr));
  gap: 0;
  border-left: 1px solid var(--rule-thin);
  border-bottom: 1px solid var(--rule-thin);
}
/* Inside the catalog (shop) the cards are narrower */
#bizShopGrid .biz-chain-row {
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
}

/* ============ ADMIN PANEL (dev cheats) ============ */
.admin-overlay {
  position: fixed;
  top: 60px;
  right: 16px;
  width: 460px;
  max-height: calc(100vh - 80px);
  z-index: 9000;
  font-family: var(--mono);
  font-size: 11px;
  color: #d7d2c2;
  background: #181412;
  border: 1px solid #c84b2a;
  box-shadow: 0 8px 32px rgba(0,0,0,0.6);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.admin-panel { display: flex; flex-direction: column; height: 100%; }
.admin-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  background: linear-gradient(90deg, #c84b2a 0%, #6b2412 100%);
  color: #f4ecd8;
  border-bottom: 1px solid #c84b2a;
  flex-shrink: 0;
}
.admin-title { font-weight: 700; letter-spacing: 0.10em; font-size: 12px; }
.admin-sub { font-size: 9.5px; opacity: 0.7; flex: 1; text-align: right; }
.admin-close {
  background: transparent; border: 1px solid #f4ecd866; color: #f4ecd8;
  width: 22px; height: 22px; cursor: pointer; line-height: 0;
  padding: 0;
}
.admin-close:hover { background: #f4ecd822; }
.admin-body {
  padding: 10px 12px;
  overflow-y: auto;
  flex: 1;
  background: #181412;
}
.admin-section {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px dashed #3a322a;
}
.admin-section:last-child { border-bottom: none; }
.admin-section-head {
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: #c84b2a;
  margin-bottom: 6px;
  font-weight: 700;
}
.admin-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px 10px;
}
.admin-grid > div {
  display: flex;
  justify-content: space-between;
  font-size: 10.5px;
  padding: 1px 0;
}
.admin-grid .lb { color: #8a8474; }
.admin-grid .vl { color: #f4ecd8; font-weight: 600; }
.admin-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}
.admin-row {
  display: flex;
  gap: 4px;
  align-items: stretch;
  margin-bottom: 4px;
}
.admin-btn {
  background: #2a221c;
  color: #d7d2c2;
  border: 1px solid #4a3d30;
  padding: 4px 8px;
  font-family: var(--mono);
  font-size: 10.5px;
  cursor: pointer;
  letter-spacing: 0.04em;
}
.admin-btn:hover { background: #3a2f24; border-color: #c84b2a; }
.admin-btn.admin-danger { border-color: #c84b2a; color: #ffb3a0; }
.admin-btn.admin-danger:hover { background: #6b2412; color: #fff; }
.admin-select, .admin-input {
  background: #14110f;
  color: #d7d2c2;
  border: 1px solid #4a3d30;
  padding: 4px 6px;
  font-family: var(--mono);
  font-size: 10.5px;
  flex: 1;
  min-width: 0;
}
.admin-input { max-width: 80px; flex: 0 0 auto; }
.admin-log {
  background: #14110f;
  border: 1px solid #2a221c;
  padding: 4px 6px;
  max-height: 140px;
  overflow-y: auto;
  font-size: 10px;
  line-height: 1.4;
}
.admin-log-row {
  padding: 1px 0;
  color: #c2bda8;
  border-bottom: 1px dotted #2a221c;
}
.admin-log-row.muted { color: #6a6356; font-style: italic; }
.admin-log-row:last-child { border-bottom: none; }
.admin-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.admin-tag {
  background: #2a221c;
  color: #d7d2c2;
  border: 1px solid #4a3d30;
  padding: 2px 6px;
  font-size: 10px;
  letter-spacing: 0.04em;
}

/* ============ MULTIPLAYER LOGIN OVERLAY ============ */
.mp-login-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: #1A1614;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono, monospace);
}
.mp-login-overlay.hidden { display: none; }
.mp-login-card {
  width: min(560px, 92vw);
  background: var(--paper, #F2EBE0);
  border: 1px solid #000;
  box-shadow: 0 20px 60px rgba(0,0,0,.5);
  padding: 32px 36px 28px;
}
.mp-login-masthead {
  font-family: var(--serif, Georgia, serif);
  font-size: 34px; font-weight: 800; letter-spacing: .01em;
  text-align: center; color: var(--ink, #1A1614);
}
.mp-login-masthead em { font-style: italic; font-weight: 500; }
.mp-login-sub {
  text-align: center; font-size: 12px; letter-spacing: .04em;
  color: var(--ink-3, #6a6356); margin: 6px 0 22px;
  border-bottom: 1px solid var(--rule-thin, #B6AC99); padding-bottom: 16px;
}
.mp-field { margin-bottom: 14px; }
.mp-field label { display: block; font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3, #6a6356); margin-bottom: 4px; }
.mp-field input {
  width: 100%; box-sizing: border-box; padding: 9px 11px;
  background: #fff; border: 1px solid var(--rule-thin, #B6AC99);
  font-family: var(--mono, monospace); font-size: 14px; color: var(--ink, #1A1614);
}
.mp-field input:focus { outline: none; border-color: var(--accent, #C84B2A); }
.mp-login-btns { display: flex; gap: 10px; margin-top: 18px; }
.mp-login-btns .btn-press, .mp-login-btns .btn-press-ghost { flex: 1; }
.mp-login-status { margin-top: 12px; min-height: 16px; font-size: 12px; color: var(--accent, #C84B2A); text-align: center; }

.mp-starter-title { font-family: var(--serif, serif); font-size: 18px; font-weight: 700; margin-bottom: 12px; text-align: center; color: var(--ink, #1A1614); }
.mp-starter-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; max-height: 46vh; overflow-y: auto; margin-bottom: 16px; }
.mp-starter-card { border: 1px solid var(--rule-thin, #B6AC99); padding: 8px 10px; cursor: pointer; background: #fff; }
.mp-starter-card:hover { border-color: var(--accent, #C84B2A); }
.mp-starter-card.selected { background: var(--accent, #C84B2A); color: #fff; }
.mp-starter-card.selected .mp-starter-ds, .mp-starter-card.selected .mp-starter-tk { color: #fff; }
.mp-starter-tk { font-size: 11px; letter-spacing: .1em; color: var(--accent, #C84B2A); font-weight: 700; }
.mp-starter-nm { font-family: var(--serif, serif); font-size: 15px; font-weight: 700; margin: 2px 0; }
.mp-starter-ds { font-size: 11px; color: var(--ink-3, #6a6356); line-height: 1.3; }
#mpStartBtn { width: 100%; }

/* ============ HUD LOGOUT BUTTON ============ */
.hud-logout {
  background: transparent;
  border: 1px solid var(--rule-thin, #B6AC99);
  color: var(--ink-3, #6a6356);
  font-family: var(--mono, monospace);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  margin-left: 14px;
  cursor: pointer;
  transition: all 0.15s;
}
.hud-logout:hover {
  background: var(--accent, #C84B2A);
  color: #fff;
  border-color: var(--accent, #C84B2A);
}

/* ============ MP LOGIN — RESUME PROMPT ============ */
#mpLoginResume { text-align: center; }
.mp-resume-title {
  font-family: var(--mono, monospace);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3, #6a6356);
  margin-bottom: 6px;
}
.mp-resume-name {
  font-family: var(--serif, Georgia, serif);
  font-size: 28px;
  font-weight: 700;
  color: var(--accent, #C84B2A);
  margin-bottom: 10px;
  word-break: break-word;
}
.mp-resume-sub {
  font-family: var(--serif, Georgia, serif);
  font-style: italic;
  font-size: 13px;
  color: var(--ink-2, #4a4640);
  line-height: 1.5;
  margin-bottom: 18px;
  padding: 0 8px;
}
#mpLoginResume .mp-login-btns { flex-direction: column; }
#mpLoginResume .mp-login-btns .btn-press { flex: none; padding: 10px; }
#mpLoginResume .mp-login-btns .btn-press-ghost { flex: none; padding: 8px; }

/* ============ EQUITIES "MY OPEN ORDERS" PANEL ============ */
.eq-d-myorders {
  margin-top: 14px;
  padding: 10px 12px;
  background: var(--paper-2, #ECE3D2);
  border: 1px solid var(--rule-thin, #B6AC99);
}
.eq-d-myorders-head {
  font-family: var(--mono, monospace);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent, #C84B2A);
  margin-bottom: 6px;
}
.eq-d-myorders .my-order {
  display: grid;
  grid-template-columns: 60px 1fr 90px auto;
  gap: 10px;
  align-items: center;
  padding: 4px 0;
  font-family: var(--mono, monospace);
  font-size: 11.5px;
  border-bottom: 1px dotted var(--rule-soft, #d8cdb5);
}
.eq-d-myorders .my-order:last-child { border-bottom: none; }
.eq-d-myorders .my-order .side-buy { color: var(--gain, #2a7a3a); font-weight: 700; }
.eq-d-myorders .my-order .side-sell { color: var(--loss, #c84b2a); font-weight: 700; }
.eq-d-myorders .my-order button {
  background: transparent;
  border: 1px solid var(--rule-thin, #B6AC99);
  color: var(--ink-3, #6a6356);
  cursor: pointer;
  width: 24px; height: 22px;
  font-size: 12px;
  line-height: 0;
}
.eq-d-myorders .my-order button:hover {
  background: var(--accent, #C84B2A);
  color: #fff;
  border-color: var(--accent, #C84B2A);
}

/* Stronger emphasis on the "Your Open Orders" panel so it's hard to miss */
.eq-d-myorders {
  margin-top: 14px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: linear-gradient(180deg, var(--accent-tint, #f4e0d8) 0%, var(--paper-2, #ECE3D2) 100%);
  border: 1px solid var(--accent, #C84B2A);
  border-left-width: 4px;
}
.eq-d-myorders-head {
  font-family: var(--mono, monospace);
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--accent, #C84B2A);
  font-weight: 700;
  margin-bottom: 8px;
}
.eq-d-myorders .my-order button {
  background: var(--paper, #F2EBE0);
  border: 1px solid var(--accent, #C84B2A);
  color: var(--accent, #C84B2A);
  cursor: pointer;
  padding: 4px 10px;
  font-family: var(--mono, monospace);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.eq-d-myorders .my-order button:hover {
  background: var(--accent, #C84B2A);
  color: #fff;
}
