:root {
  --bg: #080808;
  --bg-soft: #101010;
  --panel: #111111;
  --panel-2: #0d0d0d;
  --text: #f2f2f2;
  --muted: #969696;
  --dim: #717171;
  --border: #262626;
  --border-soft: #1f1f1f;
  --green: #ccff00;
  --green-soft: #e6ff7a;
  --green-dim: rgba(204,255,0,0.12);
  --shadow: rgba(0,0,0,0.4);
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --sans: Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  --display: Impact, Haettenschweiler, "Arial Narrow Bold", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); overflow-x: hidden; }
a { color: inherit; }
::selection { background: var(--green); color: #071003; }

.mono { font-family: var(--mono); }
.shell {
  position: relative;
  min-height: 100vh;
  background:
    linear-gradient(rgba(255,255,255,0.02) 1px, transparent 0),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 0),
    radial-gradient(1000px 500px at 50% 0%, rgba(204,255,0,0.06), transparent 60%),
    var(--bg);
  background-size: 60px 60px, 60px 60px, auto, auto;
  overflow: clip;
}
.shell::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg, transparent 0 3px, rgba(255,255,255,0.012) 3px 4px);
  mix-blend-mode: screen;
}

.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--border);
  background: rgb(8 8 8 / 92%);
  backdrop-filter: blur(12px);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 64px;
  padding: 0 32px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; }
.brand-mark img { width: 100%; height: 100%; display: block; object-fit: contain; }
.brand-name {
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.brand-name::after { content: ".FUN"; color: var(--green); }
.nav-links { display: flex; gap: 40px; }
.nav-links a, .nav-login, .nav-live { font-family: var(--mono); font-size: 11px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); text-decoration: none; }
.nav-links a:hover, .nav-login:hover { color: var(--text); }
.nav-right { display: flex; align-items: center; gap: 14px; }
.nav-live { display: inline-flex; align-items: center; gap: 7px; }
.green-dot { width: 8px; height: 8px; display: inline-block; border-radius: 999px; background: var(--green); box-shadow: 0 0 12px rgba(204,255,0,0.55); }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 13px 24px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
}
.btn-sm { min-height: 38px; padding: 9px 18px; }
.btn-lg { min-height: 52px; padding: 15px 28px; }
.btn-primary { background: var(--green); color: #071003; border-color: var(--green); }
.btn-ghost { background: rgb(13 13 13 / 88%); color: var(--muted); }
.btn-ghost:hover, .btn-primary:hover { transform: translateY(-1px); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.badge .green-dot { width: 6px; height: 6px; }

.hero { position: relative; min-height: min(92vh, 900px); display: flex; flex-direction: column; overflow: hidden; padding-top: 12px; border-bottom: 1px solid var(--border); }
.vlines, .hero-grid { position: absolute; inset: 0; pointer-events: none; }
.vlines { background: repeating-linear-gradient(90deg, rgba(255,255,255,0.028) 0 1px, transparent 1px 110px); mask-image: linear-gradient(180deg, transparent, #000 12%, #000 88%, transparent); }
.hero-grid { z-index: 2; width: 100%; height: 100%; opacity: 0.72; }
.planet-wrap { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.planet-haze { position: absolute; left: 50%; top: 68%; transform: translateX(-50%); width: 150%; height: 60%; background: radial-gradient(50% 55% at 50% 100%, rgba(204,255,0,0.28), rgba(204,255,0,0.1) 45%, transparent 75%); filter: blur(24px); opacity: 0.68; }
.planet { position: absolute; left: 50%; top: 81%; transform: translateX(-50%); width: 190%; aspect-ratio: 1 / 1; border-radius: 50%; background: radial-gradient(58% 30% at 50% 2%, rgba(150,255,170,0.28), transparent 55%), linear-gradient(180deg, #071710, #030906 24%, #020604); box-shadow: 0 -2px 12px rgba(190,255,205,0.48), 0 -12px 42px rgba(204,255,0,0.32), 0 -42px 120px rgba(204,255,0,0.22); }
.hero-inner { position: relative; z-index: 5; flex: 1; display: flex; flex-direction: column; align-items: center; text-align: center; padding: 54px 24px 178px; }
.hero-kicker { display: flex; align-items: center; gap: 10px; margin-bottom: 26px; color: var(--dim); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; }
.hero-title { margin: 0 0 28px; font-family: var(--display); font-size: clamp(2.6rem, 6vw, 5rem); line-height: 1.04; letter-spacing: -0.05em; text-transform: uppercase; }
.hero-title .w-soft, .accent { color: var(--green-soft); }
.sel-box { position: relative; display: inline-block; padding: 0.01em 0.16em 0.055em; border: 1.5px solid rgba(204,255,0,0.75); background: rgba(204,255,0,0.07); box-shadow: 0 0 24px rgba(204,255,0,0.18); }
.sel-box i { position: absolute; width: 7px; height: 7px; background: #06180c; border: 1.5px solid rgba(204,255,0,0.95); border-radius: 1.5px; }
.sel-box i:first-child { top: -4.5px; left: -4.5px; }
.sel-box i:nth-child(2) { top: -4.5px; right: -4.5px; }
.sel-box i:nth-child(3) { bottom: -4.5px; left: -4.5px; }
.sel-box i:nth-child(4) { bottom: -4.5px; right: -4.5px; }
.hero-sub { max-width: 520px; margin: 0 0 36px; color: var(--muted); font-size: 16.5px; line-height: 1.7; }
.hero-ctas { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.hero-foot { position: absolute; left: 0; right: 0; bottom: 0; padding-bottom: 30px; z-index: 6; }
.hero-stats { width: min(100%, 1216px); margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--border); border-bottom: 0; background: rgb(13 13 13 / 92%); }
.hero-stats div { min-height: 78px; display: flex; flex-direction: column; justify-content: center; gap: 7px; padding: 15px 20px; border-right: 1px solid var(--border); }
.hero-stats div:last-child { border-right: 0; }
.hero-stats strong { color: var(--text); font-size: 18px; }
.hero-stats span { color: var(--dim); font-size: 9px; letter-spacing: 0.08em; }

.section-inner { max-width: 1200px; margin: 0 auto; padding: 100px 24px; }
.section-head { margin-bottom: 54px; }
.section-head.center { display: flex; flex-direction: column; align-items: center; text-align: center; }
.section-head h2, .integrity-left h2, .cta-title, .app-hero h1 { margin: 16px 0 0; font-family: var(--display); text-transform: uppercase; letter-spacing: -0.03em; line-height: 1.05; }
.section-head h2 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.section-sub { max-width: 540px; margin-top: 14px; color: var(--dim); font-size: 15px; line-height: 1.65; }

.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step-card, .tile, .cta-card, .integrity-right, .panel {
  background: linear-gradient(180deg, rgba(255,255,255,0.045), rgba(255,255,255,0.012));
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px var(--shadow);
}
.step-card, .tile { padding: 26px 26px 32px; }
.step-card h3, .tile h3 { margin: 20px 0 10px; font-family: var(--display); font-size: 18px; line-height: 1.1; }
.step-card p, .tile p, .integrity-left p, .cta-sub, .app-hero-copy p { margin: 0; color: var(--dim); font-size: 13.8px; line-height: 1.68; }
.step-viz { position: relative; height: 130px; border-radius: 10px; border: 1px solid var(--border-soft); background: radial-gradient(70% 80% at 50% 110%, rgba(204,255,0,0.1), transparent 70%), rgba(3,9,5,0.55); display: grid; place-items: center; overflow: hidden; }
.viz-wallet { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(180deg, rgba(204,255,0,0.2), rgba(204,255,0,0.06)); border: 1px solid rgba(204,255,0,0.35); color: var(--green); box-shadow: 0 0 24px rgba(204,255,0,0.2); }
.viz-ring { position: absolute; width: 52px; height: 52px; border-radius: 16px; border: 1px solid rgba(204,255,0,0.6); animation: ring-pulse 2.4s ease-out infinite; }
@keyframes ring-pulse { 0% { transform: scale(1); opacity: 0.8; } 100% { transform: scale(2); opacity: 0; } }
.viz-chip, .viz-odds, .viz-win { position: absolute; font-size: 10px; letter-spacing: 0.1em; }
.viz-chip { bottom: 10px; color: rgba(169,235,180,0.7); }
.mini-grid { display: grid; grid-template-columns: repeat(5, 26px); gap: 4px; }
.mini-cell { width: 26px; height: 26px; border-radius: 6px; background: rgba(255,255,255,0.035); border: 1px solid rgba(255,255,255,0.05); }
.mini-cell.warm { background: rgba(204,255,0,0.08); border-color: rgba(204,255,0,0.2); }
.mini-cell.hot { background: rgba(204,255,0,0.26); border-color: rgba(204,255,0,0.8); box-shadow: 0 0 16px rgba(204,255,0,0.4); }
.viz-odds { top: 16px; right: 18px; font-weight: 700; color: var(--green); border: 1px solid rgba(204,255,0,0.45); background: rgba(204,255,0,0.1); border-radius: 999px; padding: 3px 9px; }
.viz-spark { width: 100%; height: 100%; position: absolute; inset: 0; }
.spark-cell { fill: rgba(204,255,0,0.16); stroke: rgba(204,255,0,0.7); stroke-width: 1.2; }
.spark-line { stroke: var(--green); stroke-width: 2; filter: drop-shadow(0 0 6px rgba(204,255,0,0.7)); stroke-dasharray: 300; stroke-dashoffset: 300; animation: spark-draw 2.8s ease-out infinite; }
@keyframes spark-draw { to { stroke-dashoffset: 0; } }
.spark-dot { fill: #d9ffe0; filter: drop-shadow(0 0 6px rgba(204,255,0,1)); }
.viz-win { top: 14px; right: 16px; font-weight: 800; color: #06180c; background: linear-gradient(180deg, #eeff99, #ccff00); border-radius: 999px; padding: 4px 10px; }

.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.tile.t-hero { grid-row: span 2; grid-column: span 2; display: flex; flex-direction: column; justify-content: flex-end; min-height: 380px; position: relative; overflow: hidden; }
.tile-visual { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.tile-visual img { width: 100%; height: 100%; display: block; object-fit: cover; opacity: 0.55; }
.tile-body { position: relative; }
.tile-stat { margin-bottom: 14px; font-size: 38px; font-weight: 800; color: var(--green); }
.tile-stat span { font-size: 14px; color: var(--muted); margin-left: 4px; }
.tile-stat .stat-word { font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; }
.tile-kicker { margin-bottom: 10px; color: var(--dim); font-size: 9px; letter-spacing: 0.14em; }
.agent-signal { height: 66px; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 14px; border-block: 1px solid var(--border-soft); margin-bottom: 22px; color: var(--dim); font-size: 9px; letter-spacing: 0.1em; }
.signal-bars { height: 28px; display: flex; align-items: center; gap: 4px; }
.signal-bars i { display: block; flex: 1 1; height: 20%; background: rgba(204,255,0,0.28); }
.signal-bars i:nth-child(2) { height: 52%; }
.signal-bars i:nth-child(3) { height: 80%; }
.signal-bars i:nth-child(4) { height: 44%; }
.signal-bars i:nth-child(5) { height: 66%; }
.signal-bars i:nth-child(6) { height: 34%; }
.wallet-stack { display: grid; margin: -4px 0 20px; border-top: 1px solid var(--border-soft); }
.wallet-stack span { display: grid; grid-template-columns: 24px 1fr auto; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--border-soft); color: var(--dim); font-size: 9px; }
.wallet-stack b { color: var(--dim); font-weight: 400; }
.wallet-stack i { font-style: normal; color: var(--green-soft); }

.integrity { display: grid; grid-template-columns: 1.05fr 1fr; gap: 52px; align-items: center; }
.integrity-left h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); }
.integrity-left p { max-width: 460px; margin-top: 18px; }
.integrity-right { position: relative; padding: 30px 32px; font-size: 12.5px; line-height: 2.4; overflow: hidden; }
.integrity-terminal-head, .integrity-terminal-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; font-size: 9px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.integrity-terminal-title { display: inline-flex; align-items: center; gap: 9px; }
.integrity-ledger { border-top: 1px solid var(--border-soft); border-bottom: 1px solid var(--border-soft); margin: 18px 0 12px; }
.integrity-event { min-height: 55px; display: grid; grid-template-columns: minmax(96px, 0.8fr) minmax(180px, 1.55fr) 132px; align-items: center; gap: 20px; border-bottom: 1px solid var(--border-soft); }
.integrity-event:last-child { border-bottom: 0; }
.integrity-event-label { color: var(--dim); font-size: 9px; font-weight: 700; letter-spacing: 0.1em; }
.integrity-event-value { color: var(--text); white-space: nowrap; }
.integrity-event-status { display: flex; align-items: center; gap: 8px; color: var(--green); white-space: nowrap; }
.integrity-event-status b { display: inline-grid; place-items: center; width: 15px; height: 15px; border: 1px solid rgba(204,255,0,0.5); font-size: 0; }
.integrity-event-status b::after { content: ""; width: 6px; height: 3px; border-bottom: 1px solid; border-left: 1px solid; transform: rotate(-45deg) translateY(-1px); }
.c-green { color: var(--green); }

.cta-card { position: relative; max-width: 1040px; margin: 0 auto; padding: 92px 40px 110px; text-align: center; background: linear-gradient(180deg, #071209, #040b06); }
.cta-planet { position: absolute; left: 50%; top: 88%; transform: translateX(-50%); width: 160%; aspect-ratio: 1 / 1; border-radius: 50%; background: linear-gradient(180deg, #071710, #030905 30%); box-shadow: 0 -3px 16px rgba(190,255,205,0.6), 0 -14px 50px rgba(204,255,0,0.45); pointer-events: none; }
.cta-title { margin: 22px 0 16px; font-size: clamp(2.1rem, 5.2vw, 3.7rem); line-height: 1.08; }
.cta-sub { margin-bottom: 38px; }
.cta-actions { display: flex; justify-content: center; gap: 14px; flex-wrap: wrap; }

.footer { margin-top: 40px; border-top: 1px solid var(--border-soft); }
.footer-inner { max-width: 1200px; margin: 0 auto; padding: 64px 24px 28px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 40px; margin-bottom: 54px; }
.footer-tag { max-width: 260px; margin: 14px 0 0; color: var(--dim); font-size: 13px; line-height: 1.7; }
.footer-col h4 { margin: 0 0 18px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); }
.footer-col a { display: block; margin-bottom: 12px; color: var(--dim); font-size: 13.5px; text-decoration: none; }
.footer-col a:hover { color: var(--green); }
.footer-bottom { padding-top: 24px; border-top: 1px solid var(--border-soft); display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; color: var(--dim); font-family: var(--mono); font-size: 11px; }

.reveal { opacity: 0; transform: translateY(24px); transition: opacity 0.75s cubic-bezier(.16,1,.3,1), transform 0.75s cubic-bezier(.16,1,.3,1); }
.reveal.in { opacity: 1; transform: none; }
.reveal[data-delay="1"] { transition-delay: 0.1s; }
.reveal[data-delay="2"] { transition-delay: 0.2s; }

.shell-app { background-size: 54px 54px, 54px 54px, auto, auto; }
.app-layout { max-width: 1440px; margin: 0 auto; padding: 28px 24px 40px; }
.app-hero { display: grid; grid-template-columns: 1.2fr auto; gap: 24px; align-items: end; margin-bottom: 18px; }
.app-hero-copy h1 { margin: 12px 0 10px; font-family: var(--display); font-size: clamp(3rem, 6vw, 5.2rem); line-height: 0.92; text-transform: uppercase; }
.app-hero-copy p { max-width: 640px; font-size: 15px; }
.app-hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); min-width: 420px; border: 1px solid var(--border); background: rgb(13 13 13 / 92%); }
.app-hero-stats div { min-height: 104px; padding: 18px; display: flex; flex-direction: column; justify-content: center; gap: 8px; border-right: 1px solid var(--border); }
.app-hero-stats div:last-child { border-right: 0; }
.app-hero-stats strong { font-size: 24px; }
.app-hero-stats span { font-size: 9px; color: var(--dim); letter-spacing: 0.08em; }
.board-grid { display: grid; grid-template-columns: 1.5fr 1fr 0.9fr; gap: 16px; align-items: stretch; }
.panel { padding: 18px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.panel-head h2 { margin: 0; font-family: var(--display); font-size: 18px; text-transform: uppercase; letter-spacing: -0.03em; }
.panel-head span { color: var(--dim); font-size: 10px; letter-spacing: 0.08em; text-transform: uppercase; }
.panel-chart { grid-column: 1; min-height: 620px; display: flex; flex-direction: column; }
.app-chart-canvas { width: 100%; height: 420px; display: block; border: 1px solid var(--border-soft); background: #0b0b0b; }
.chart-meta { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.chip { min-height: 34px; padding: 0 14px; border: 1px solid var(--border); background: transparent; color: var(--dim); font-family: var(--mono); font-size: 11px; text-transform: uppercase; cursor: pointer; }
.chip.is-active { color: var(--green); border-color: var(--green); background: rgba(204,255,0,0.08); }
.panel-market, .panel-side { min-height: 620px; }
.cell-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cell-btn { position: relative; aspect-ratio: 1 / 1; border: 1px solid var(--border); background: #0b0b0b; color: var(--text); font-family: var(--mono); font-size: 11px; cursor: pointer; display: grid; place-items: center; padding: 8px; text-align: center; }
.cell-btn .rate { display: block; margin-top: 4px; color: var(--green); font-size: 10px; }
.cell-btn.is-live { box-shadow: inset 0 0 0 1px rgba(204,255,0,0.45), 0 0 18px rgba(204,255,0,0.1); }
.cell-btn.is-selected { border-color: var(--green); background: rgba(204,255,0,0.08); }
.log { display: grid; gap: 10px; max-height: 548px; overflow: auto; padding-right: 4px; }
.log-item { padding: 12px; border: 1px solid var(--border-soft); background: #0b0b0b; font-family: var(--mono); font-size: 11px; line-height: 1.5; color: var(--dim); }
.log-item strong { display: block; margin-bottom: 6px; color: var(--text); font-size: 12px; }

.empty-note { color: var(--dim); font-family: var(--mono); font-size: 11px; line-height: 1.6; }

body.modal-open { overflow: hidden; }
.trade-screen { min-height: calc(100vh - 64px); display: flex; flex-direction: column; background: #080808; }
.trade-toolbar { min-height: 62px; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 20px; border-bottom: 1px solid var(--border); background: rgba(8,8,8,.96); }
.market-picker, .trade-actions { display: flex; align-items: center; gap: 12px; }
.market-label { color: var(--dim); font-size: 9px; letter-spacing: .13em; }
.market-picker select { min-width: 145px; border: 0; outline: 0; background: transparent; color: var(--text); font-family: var(--mono); font-size: 14px; font-weight: 700; cursor: pointer; }
.market-picker select option { background: #111; color: var(--text); }
.market-state { display: inline-flex; align-items: center; gap: 7px; color: var(--green); font-size: 10px; text-transform: uppercase; }
.icon-button { width: 34px; height: 34px; display: grid; place-items: center; border: 1px solid var(--border); background: #0d0d0d; color: var(--muted); font-family: var(--mono); cursor: pointer; }
.icon-button:hover { border-color: var(--green); color: var(--green); }
.trade-stage { position: relative; flex: 1; min-height: 480px; overflow: hidden; }
.trade-stage .app-chart-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.chart-price { position: absolute; right: 18px; z-index: 2; padding: 4px 7px; border: 1px solid var(--border); background: rgba(8,8,8,.8); color: var(--muted); font-size: 10px; pointer-events: none; }
.price-current { top: 48%; color: var(--green); border-color: rgba(204,255,0,.5); }
.price-high { top: 24%; }
.price-low { top: 73%; }
.chart-overlay { position: absolute; left: 20px; right: 20px; bottom: 18px; z-index: 2; display: flex; justify-content: space-between; gap: 16px; color: var(--dim); font-size: 10px; pointer-events: none; }
.chart-overlay strong { color: var(--green); font-weight: 500; letter-spacing: .08em; text-transform: uppercase; }
.trade-ticket { display: grid; grid-template-columns: minmax(210px, 1fr) auto minmax(190px, 240px) minmax(180px, 230px); align-items: center; gap: 14px; padding: 16px 20px; border-top: 1px solid var(--border); background: #101010; }
.ticket-title { display: flex; flex-direction: column; gap: 5px; }
.ticket-title span { color: var(--dim); font-size: 9px; letter-spacing: .1em; }
.ticket-title strong { font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--text); }
.ticket-presets { display: flex; gap: 6px; }
.ticket-presets .chip { min-width: 42px; padding: 0 10px; }
.ticket-input { position: relative; display: flex; align-items: center; height: 40px; border: 1px solid var(--border); background: #0b0b0b; }
.ticket-input label { padding: 0 10px; color: var(--dim); font-family: var(--mono); font-size: 9px; white-space: nowrap; }
.ticket-input label span { color: #555; }
.ticket-input input { width: 76px; height: 100%; border: 0; outline: 0; background: transparent; color: var(--text); font-family: var(--mono); font-size: 12px; }
.stepper { width: 28px; height: 100%; border: 0; border-left: 1px solid var(--border); background: transparent; color: var(--muted); font-family: var(--mono); cursor: pointer; }
.stepper:hover { color: var(--green); background: var(--green-dim); }
.ticket-submit { min-height: 40px; padding-inline: 14px; font-size: 11px; }
.trade-foot { display: flex; justify-content: space-between; gap: 14px; padding: 9px 20px; border-top: 1px solid var(--border-soft); color: var(--dim); font-size: 9px; text-transform: uppercase; letter-spacing: .06em; }
.trade-foot span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.trade-foot .green-dot { width: 5px; height: 5px; }
.trade-foot b { color: var(--green); font-weight: 500; }
.app-panels { display: grid; grid-template-columns: 1.5fr 1fr; gap: 16px; padding: 16px 0 0; }
.panel-log, .panel-info { min-height: 230px; padding: 18px; }
.panel-log .log { max-height: 205px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.log-item strong { display: flex; justify-content: space-between; gap: 10px; }
.log-item strong span { color: var(--dim); font-size: 9px; font-weight: 400; }
.market-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; margin-bottom: 18px; border: 1px solid var(--border-soft); }
.market-facts div { display: flex; flex-direction: column; gap: 8px; min-height: 88px; padding: 14px; border-right: 1px solid var(--border-soft); }
.market-facts div:last-child { border-right: 0; }
.market-facts span { color: var(--dim); font-family: var(--mono); font-size: 9px; letter-spacing: .08em; }
.market-facts strong { color: var(--text); font-family: var(--mono); font-size: 14px; }
.full-button { width: 100%; }
.c-amber { color: #fdcc5c !important; }
.modal-backdrop { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 20px; background: rgba(0,0,0,.72); backdrop-filter: blur(8px); }
.modal-backdrop[hidden] { display: none; }
.modal { position: relative; width: min(100%, 430px); padding: 28px; border: 1px solid var(--border); background: #111; box-shadow: 0 24px 100px rgba(0,0,0,.65); }
.modal-small { width: min(100%, 460px); }
.modal-close { position: absolute; top: 12px; right: 14px; width: 30px; height: 30px; border: 0; background: transparent; color: var(--muted); font-size: 24px; cursor: pointer; }
.modal-close:hover { color: var(--green); }
.modal-tabs { display: flex; gap: 20px; margin-bottom: 24px; border-bottom: 1px solid var(--border); }
.modal-tab { padding: 0 0 12px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--dim); font-family: var(--mono); font-size: 12px; cursor: pointer; }
.modal-tab.is-active { color: var(--green); border-color: var(--green); }
.modal h2 { margin: 0 0 10px; font-family: var(--display); font-size: 30px; text-transform: uppercase; }
.modal p { margin: 0 0 22px; color: var(--dim); font-size: 13px; line-height: 1.55; }
.balance-row { display: flex; justify-content: space-between; gap: 16px; margin-bottom: 24px; padding: 14px 0; border-block: 1px solid var(--border-soft); color: var(--dim); font-family: var(--mono); font-size: 11px; }
.balance-row strong { color: var(--text); font-weight: 500; }
.modal-label { display: block; margin-bottom: 8px; color: var(--dim); font-family: var(--mono); font-size: 9px; letter-spacing: .1em; }
.amount-field { display: flex; align-items: center; height: 52px; margin-bottom: 16px; border: 1px solid var(--border); background: #0b0b0b; }
.amount-field input { min-width: 0; flex: 1; height: 100%; padding: 0 14px; border: 0; outline: 0; background: transparent; color: var(--text); font-family: var(--mono); font-size: 16px; }
.amount-field span { padding: 0 14px; color: var(--green); font-family: var(--mono); font-size: 11px; }
.network-note { display: flex; align-items: center; gap: 9px; min-height: 42px; margin-bottom: 18px; padding: 10px 12px; border: 1px solid var(--border-soft); color: var(--dim); font-family: var(--mono); font-size: 10px; line-height: 1.5; }
.network-note .green-dot { width: 6px; height: 6px; flex: 0 0 auto; }
.history-empty { padding: 18px; border: 1px solid var(--border-soft); color: var(--dim); font-family: var(--mono); font-size: 11px; text-align: center; }

@media (max-width: 980px) {
  .nav-links, .nav-login { display: none; }
  .steps { grid-template-columns: 1fr; }
  .bento { grid-template-columns: repeat(2, 1fr); }
  .integrity { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .trade-ticket { grid-template-columns: 1fr 1fr; }
  .ticket-title { grid-column: 1 / -1; }
  .ticket-submit { width: 100%; }
  .app-panels { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .nav-inner, .section-inner, .footer-inner, .app-layout { padding-left: 20px; padding-right: 20px; }
  .hero-inner { padding-top: 72px; padding-bottom: 190px; align-items: flex-start; text-align: left; }
  .hero-ctas .btn, .hero-ctas { width: 100%; }
  .hero-stats { grid-template-columns: 1fr; }
  .hero-stats div { min-height: 48px; display: grid; grid-template-columns: 92px 1fr; align-items: center; border-right: 0; border-bottom: 1px solid var(--border); }
  .hero-stats div:last-child { border-bottom: 0; }
  .bento { grid-template-columns: 1fr; }
  .tile.t-hero { grid-column: span 1; }
  .integrity-right { padding: 24px; }
  .integrity-event { grid-template-columns: 82px minmax(0, 1fr); gap: 12px; }
  .integrity-event-status { grid-column: 2; grid-row: 2; }
  .footer-grid { grid-template-columns: 1fr; }
  .trade-toolbar { padding-inline: 14px; }
  .market-label, .market-state { display: none; }
  .trade-stage { min-height: 500px; }
  .trade-ticket { grid-template-columns: 1fr; padding: 14px; }
  .ticket-title { grid-column: auto; }
  .ticket-presets { width: 100%; }
  .ticket-presets .chip { flex: 1; }
  .ticket-input { width: 100%; }
  .ticket-input input { flex: 1; width: auto; }
  .chart-overlay { left: 12px; right: 12px; font-size: 8px; }
  .trade-foot { flex-wrap: wrap; padding-inline: 14px; }
  .panel-log .log { grid-template-columns: 1fr; }
  .market-facts { grid-template-columns: 1fr; }
  .market-facts div { min-height: 56px; border-right: 0; border-bottom: 1px solid var(--border-soft); }
  .market-facts div:last-child { border-bottom: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .reveal { opacity: 1; transform: none; }
}

/* CellX trading terminal */
body[data-app="true"] { overflow: hidden; background: #050505; }
body[data-app="true"] .terminal { width: 100vw; height: 100vh; min-width: 1080px; min-height: 700px; display: grid; grid-template-columns: 369px minmax(0, 1fr); grid-template-rows: 84px minmax(0, 1fr); background: #050505; color: #f5f5f5; }
.terminal-header { grid-column: 1 / -1; display: flex; align-items: center; gap: 42px; height: 84px; padding: 0 18px; border-bottom: 1px solid #222; background: #050505; }
.terminal-brand { display: inline-flex; align-items: center; gap: 12px; color: #fff; text-decoration: none; flex: 0 0 auto; }
.terminal-logo { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 10px; overflow: hidden; background: #ccff00; }
.terminal-logo img { width: 33px; height: 33px; filter: brightness(0); object-fit: contain; }
.terminal-wordmark { font-family: var(--sans); font-size: 22px; font-weight: 800; letter-spacing: 0; }
.terminal-wordmark b { color: #ccff00; }
.terminal-nav { display: flex; align-items: center; gap: 22px; height: 100%; }
.terminal-nav a { display: inline-flex; align-items: center; height: 52px; padding: 0 20px; border-radius: 5px; color: #a2a2a2; font-size: 18px; font-weight: 600; text-decoration: none; }
.terminal-nav a:hover { color: #fff; }
.terminal-nav a.is-active { background: #242424; color: #fff; font-weight: 700; }
.terminal-connect { width: 178px; height: 46px; margin-left: auto; border: 0; border-radius: 4px; background: #ccff00; color: #050505; font: 700 18px var(--sans); cursor: pointer; }
.terminal-connect:hover { background: #ddff4d; }
.trade-sidebar { grid-column: 1; grid-row: 2; min-width: 0; padding: 24px 15px; border-right: 1px solid #252525; background: #050505; }
.wallet-status { width: 330px; height: 68px; display: flex; align-items: center; gap: 12px; padding: 9px; border: 1px solid #292929; border-radius: 7px; background: #111; cursor: pointer; }
.wallet-icon { width: 48px; height: 48px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 4px; background: #262626; }
.wallet-icon::before { content: ""; width: 25px; height: 18px; border: 2px solid #ccff00; border-radius: 3px; }
.wallet-icon span { position: absolute; width: 9px; height: 6px; margin: 8px 0 0 12px; border: 2px solid #ccff00; border-right: 0; border-radius: 3px 0 0 3px; }
.wallet-copy { display: flex; flex-direction: column; gap: 6px; }
.wallet-copy strong { color: #fff; font-size: 17px; font-weight: 700; }
.wallet-copy small { color: #9a9a9a; font-size: 14px; }
.wallet-copy small b, .wallet-copy small i { color: #ccff00; font-style: normal; }
.bid-section { width: 330px; margin-top: 20px; }
.bid-heading { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.bid-heading > span { color: #8a8a8a; font-size: 14px; font-weight: 700; }
.bid-heading strong { color: #fff; font-size: 17px; font-weight: 700; white-space: nowrap; }
.bid-heading strong em { font-style: normal; }
.bid-heading strong small { color: #9a9a9a; font-size: 13px; font-weight: 600; }
.quick-bids { display: grid; grid-template-columns: repeat(4, 1fr); gap: 9px; }
.quick-bids button { height: 43px; display: flex; align-items: center; justify-content: center; gap: 5px; border: 1px solid #282828; border-radius: 5px; background: #090909; color: #fff; font: 600 14px var(--mono); cursor: pointer; }
.quick-bids button:hover, .quick-bids button.is-active { border-color: #ccff00; background: #111; }
.quick-bids button b { color: #ccff00; font: 700 10px var(--sans); }
.custom-bid { width: 330px; height: 59px; display: flex; align-items: center; gap: 6px; margin-top: 18px; padding: 0 8px; border: 1px solid #292929; border-radius: 6px; background: #101010; }
.bid-step { width: 43px; height: 43px; border: 0; background: transparent; color: #9a9a9a; font: 26px var(--sans); cursor: pointer; }
.bid-step:hover { color: #ccff00; }
.custom-bid input { min-width: 0; width: 100px; flex: 1; border: 0; outline: 0; background: transparent; color: #fff; text-align: center; font: 700 17px var(--mono); }
.custom-bid select { height: 36px; padding: 0 8px; border: 1px solid #303030; border-radius: 3px; outline: 0; background: #181818; color: #fff; font: 600 12px var(--mono); }
.custom-bid option { background: #111; }
.bid-hint { display: flex; justify-content: space-between; gap: 10px; margin-top: 17px; color: #8a8a8a; font-size: 14px; }
.terminal-bet { width: 330px; min-height: 43px; margin-top: 18px; border: 1px solid #303030; border-radius: 4px; background: #101010; color: #9a9a9a; font: 600 13px var(--sans); cursor: pointer; }
.terminal-bet:hover { border-color: #ccff00; color: #ccff00; }
.terminal-workspace { position: relative; grid-column: 2; grid-row: 2; min-width: 0; min-height: 0; display: grid; grid-template-columns: minmax(0, 62fr) minmax(450px, 38fr) 75px; overflow: hidden; background: #07100a; }
.chart-pane, .coefficient-pane { position: relative; min-width: 0; min-height: 0; background: #07100a; }
.chart-pane { border-right: 1px solid rgba(83,112,85,.25); }
.app-chart-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.chart-controls { position: absolute; z-index: 5; top: 14px; left: 20px; display: flex; align-items: center; gap: 5px; }
.chart-tool { width: 40px; height: 40px; border: 0; border-radius: 4px; background: #222; color: #ccff00; font: 25px/1 var(--sans); cursor: pointer; }
.chart-tool:hover { background: #303030; }
.market-select { width: 145px; height: 40px; display: flex; align-items: center; gap: 8px; margin-left: 3px; padding: 0 9px; border-radius: 4px; background: #242424; }
.btc-mark { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: #f7931a; color: #fff; font: 700 14px var(--sans); }
.market-select select { min-width: 0; flex: 1; border: 0; outline: 0; background: transparent; color: #fff; font: 700 14px var(--mono); appearance: none; }
.market-select option { background: #242424; }
.market-select > span:last-child { color: #fff; font-size: 17px; }
.chart-status { position: absolute; top: 67px; left: 22px; color: #606760; font-size: 10px; pointer-events: none; }
.chart-current { position: absolute; right: 15px; bottom: 54px; color: #9cff63; font-size: 12px; pointer-events: none; }
.chart-time { position: absolute; left: 0; right: 0; bottom: 12px; display: flex; justify-content: space-around; color: #606760; font-size: 12px; pointer-events: none; }
.coefficient-pane { overflow: hidden; }
.coefficient-grid { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(11, minmax(45px, 1fr)); grid-auto-rows: 50px; align-content: start; padding-top: 0; }
.coefficient-cell { min-width: 0; height: 50px; display: grid; place-items: center; border-right: 1px solid rgba(87,119,89,.28); border-bottom: 1px solid rgba(87,119,89,.28); background: transparent; color: #657068; font: 600 11px var(--mono); cursor: pointer; }
.coefficient-cell:hover { background: rgba(204,255,0,.08); border: 1px solid rgba(204,255,0,.6); color: #ccff00; }
.coefficient-cell.is-hot { color: #6bcb22; }
.coefficient-cell.is-faint { opacity: .35; }
.coefficient-cell.is-selected { z-index: 1; border: 2px solid #ccff00; background: rgba(204,255,0,.14); color: #ccff00; }
.price-rail { position: relative; min-width: 75px; background: #050706; border-left: 1px solid rgba(83,112,85,.25); }
.price-ticks { position: absolute; inset: 0 7px 0 0; display: flex; flex-direction: column; justify-content: space-around; align-items: flex-end; padding: 55px 0 26px; color: #656b65; font-size: 11px; }
.price-marker { position: absolute; right: 5px; top: 67%; padding: 3px 8px; border-radius: 4px; background: #a3ff65; color: #050505; font-size: 11px; font-weight: 800; }
.recenter-button { position: absolute; right: 89px; bottom: 10px; width: 45px; height: 45px; border: 0; border-radius: 2px; background: #252a28; color: #fff; font: 24px var(--sans); cursor: pointer; }
.workspace-foot { position: absolute; right: 89px; bottom: 3px; left: 20px; display: flex; justify-content: space-between; pointer-events: none; color: #626862; font-size: 9px; text-transform: uppercase; }
.workspace-foot > span:first-child { display: inline-flex; align-items: center; gap: 5px; }
.workspace-foot .green-dot { width: 5px; height: 5px; box-shadow: none; }
.workspace-foot b { color: #9cff63; font-weight: 600; }
.terminal-modal { border: 1px solid #292929; border-radius: 4px; background: #111; box-shadow: none; }
.terminal-modal h2 { font-family: var(--sans); letter-spacing: 0; text-transform: none; }
.terminal-modal .btn-primary { border-radius: 4px; }
.terminal-modal .modal-tabs { border-color: #292929; }

@media (max-width: 1200px) {
  body[data-app="true"] .terminal { grid-template-columns: 320px minmax(0, 1fr); }
  .trade-sidebar, .bid-section, .wallet-status, .custom-bid, .terminal-bet { width: 290px; }
  .terminal-header { gap: 18px; }
  .terminal-nav { gap: 3px; }
  .terminal-nav a { padding-inline: 12px; }
  .coefficient-grid { grid-template-columns: repeat(9, minmax(45px, 1fr)); }
}

/* Unified rolling price-time market */
body[data-app="true"] { min-width: 1280px; min-height: 720px; overflow: hidden; background: #050505; }
.exchange-app { width: 100vw; height: 100vh; display: grid; grid-template-columns: 510px minmax(0, 1fr); grid-template-rows: 116px minmax(0, 1fr); background: #050505; }
.exchange-header { grid-column: 1 / -1; display: flex; align-items: center; gap: 48px; height: 116px; padding: 0 28px; border-bottom: 1px solid #232323; background: #050505; }
.exchange-brand { display: inline-flex; align-items: center; gap: 13px; color: #fff; text-decoration: none; }
.exchange-logo { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 10px; overflow: hidden; background: #ccff00; }
.exchange-logo img { width: 37px; height: 37px; object-fit: contain; filter: brightness(0); }
.exchange-wordmark { font-size: 24px; font-weight: 800; }
.exchange-wordmark span { color: #ccff00; }
.exchange-nav { height: 100%; display: flex; align-items: center; gap: 16px; }
.exchange-nav a { height: 52px; display: inline-flex; align-items: center; padding: 0 20px; border-radius: 5px; color: #a2a2a2; font-size: 18px; font-weight: 600; text-decoration: none; }
.exchange-nav a.is-active { background: #242424; color: #fff; font-weight: 700; }
.exchange-header-meta { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; color: #7d847f; font: 11px var(--mono); text-transform: uppercase; }
.live-pulse { width: 7px; height: 7px; display: inline-block; border-radius: 50%; background: #9cff63; box-shadow: 0 0 8px rgba(156,255,99,.55); }
.exchange-connect { width: 178px; height: 46px; border: 0; border-radius: 4px; background: #ccff00; color: #050505; font: 700 18px var(--sans); cursor: pointer; }
.exchange-connect:hover { background: #dbff45; }
.exchange-sidebar { grid-column: 1; grid-row: 2; display: flex; flex-direction: column; min-height: 0; padding: 24px 28px 18px; border-right: 1px solid #252525; background: #050505; }
.sidebar-kicker { display: flex; justify-content: space-between; margin-bottom: 13px; color: #666d68; font: 700 11px var(--mono); letter-spacing: .06em; }
.sidebar-kicker span { color: #9cff63; }
.exchange-wallet { width: 100%; height: 70px; flex: 0 0 auto; }
.stake-panel { margin-top: 26px; }
.section-label { display: flex; align-items: center; justify-content: space-between; margin-bottom: 13px; color: #858b87; font: 700 12px var(--mono); letter-spacing: .05em; }
.section-label strong { color: #f5f5f5; font-size: 14px; letter-spacing: 0; }
.section-label em { font-style: normal; }
.exchange-sidebar .quick-bids { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.exchange-sidebar .quick-bids button { height: 45px; font-size: 14px; }
.exchange-sidebar .quick-bids button.is-active { border-color: rgba(204,255,0,.72); color: #ccff00; background: rgba(204,255,0,.07); }
.exchange-sidebar .custom-bid { width: 100%; height: 60px; }
.bid-token { height: 36px; display: inline-flex; align-items: center; padding: 0 9px; border: 1px solid #303030; border-radius: 3px; color: #fff; background: #181818; font: 600 12px var(--mono); }
.contract-panel { margin-top: 30px; padding-top: 24px; border-top: 1px solid #232323; }
.contract-empty { min-height: 116px; display: grid; place-items: center; padding: 18px; border: 1px solid #242824; color: #69706b; background: #080b09; font: 12px/1.6 var(--mono); text-align: center; }
.contract-detail { border-top: 1px solid #242824; }
.contract-row { min-height: 43px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid #242824; }
.contract-row span { color: #707772; font: 10px var(--mono); letter-spacing: .05em; }
.contract-row strong { color: #f5f5f5; font: 600 12px var(--mono); }
.contract-row .accent-text { color: #ccff00; }
.confirm-bet { width: 100%; height: 48px; margin-top: 16px; border: 1px solid #ccff00; border-radius: 4px; background: #ccff00; color: #050505; font: 700 14px var(--sans); cursor: pointer; }
.confirm-bet:disabled { border-color: #292929; background: #111; color: #5f6461; cursor: default; }
.sidebar-spacer { flex: 1; }
.market-readout { display: flex; align-items: center; justify-content: space-between; padding-top: 14px; border-top: 1px solid #232323; color: #686f6a; font: 10px var(--mono); text-transform: uppercase; }
.market-readout span:first-child { display: inline-flex; align-items: center; gap: 7px; }
.market-readout b { color: #9cff63; font-weight: 600; }
.exchange-main { grid-column: 2; grid-row: 2; min-width: 0; min-height: 0; display: grid; grid-template-rows: 54px minmax(0, 1fr); background: #07100a; }
.surface-toolbar { display: flex; align-items: center; gap: 6px; padding: 7px 12px; border-bottom: 1px solid rgba(83,112,85,.25); background: #060907; }
.surface-tool { width: 40px; height: 40px; border: 0; border-radius: 4px; background: #222; color: #ccff00; font: 23px var(--sans); cursor: pointer; }
.surface-tool:hover { background: #2c2c2c; }
.surface-toolbar .market-select { margin-left: 2px; }
.surface-note { margin-left: 12px; color: #626a64; font: 10px var(--mono); text-transform: uppercase; }
.price-surface-wrap { position: relative; min-width: 0; min-height: 0; overflow: hidden; background: #07100a; }
.price-surface { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; }
.now-badge { position: absolute; z-index: 3; top: 8px; left: 40%; transform: translateX(-50%); padding: 3px 7px; border-radius: 3px; background: #ccff00; color: #050505; font: 800 9px var(--mono); pointer-events: none; }
.contract-tooltip { position: absolute; z-index: 6; width: 205px; padding: 11px 12px; border: 1px solid rgba(204,255,0,.5); border-radius: 3px; background: #090d0a; color: #d8ddd9; box-shadow: 0 10px 30px rgba(0,0,0,.45); font: 10px/1.6 var(--mono); pointer-events: none; }
.contract-tooltip b { color: #ccff00; font-weight: 700; }
.surface-crosshair { position: absolute; z-index: 2; width: 1px; height: 100%; top: 0; background: rgba(204,255,0,.32); pointer-events: none; }
.surface-time { position: absolute; z-index: 3; top: 9px; left: 12px; color: #687069; font-size: 10px; pointer-events: none; }
.surface-price { position: absolute; z-index: 3; right: 8px; top: 50%; padding: 3px 8px; border-radius: 3px; background: #a3ff65; color: #050505; font-size: 11px; font-weight: 800; pointer-events: none; }
.surface-help { position: absolute; z-index: 3; left: 12px; bottom: 8px; color: #565e58; font: 9px var(--mono); pointer-events: none; }
.surface-help span { color: #8d968f; }
.surface-recenter { position: absolute; z-index: 4; right: 114px; bottom: 10px; width: 44px; height: 44px; border: 0; border-radius: 2px; background: #252a28; color: #fff; font: 24px var(--sans); cursor: pointer; }
.history-list { display: grid; max-height: 330px; overflow: auto; }
.history-item { display: grid; grid-template-columns: 1fr auto; gap: 6px 18px; padding: 12px 0; border-bottom: 1px solid #252525; font: 10px var(--mono); }
.history-item strong { color: #f5f5f5; }
.history-item span { color: #737a75; }
.history-item .won { color: #9cff63; }
.history-item .lost { color: #8b7373; }
.readout-mono { font-family: var(--mono); }

@media (max-width: 1450px) {
  .exchange-app { grid-template-columns: 430px minmax(0, 1fr); }
  .exchange-sidebar { padding-inline: 22px; }
  .exchange-header { gap: 22px; }
  .exchange-nav { gap: 3px; }
}

/* Refined responsive terminal scale */
body[data-app="true"] { min-width: 0; min-height: 0; overflow: hidden; }
.exchange-app { grid-template-columns: clamp(330px, 23vw, 390px) minmax(0, 1fr); grid-template-rows: 76px minmax(0, 1fr); }
.exchange-header { height: 76px; gap: 32px; padding: 0 20px; }
.exchange-logo { width: 42px; height: 42px; border-radius: 8px; }
.exchange-logo img { width: 29px; height: 29px; }
.exchange-wordmark { font-size: 21px; letter-spacing: -.04em; }
.exchange-nav { gap: 7px; }
.exchange-nav a { height: 40px; padding: 0 14px; font-size: 14px; }
.exchange-header-meta { font-size: 9px; }
.exchange-connect { width: 150px; height: 40px; font-size: 14px; }
.exchange-sidebar { padding: 19px 20px 16px; }
.sidebar-kicker { margin-bottom: 11px; font-size: 9px; }
.exchange-wallet { height: 62px; }
.wallet-icon { width: 42px; height: 42px; }
.wallet-copy strong { font-size: 14px; }
.wallet-copy small { font-size: 11px; }
.stake-panel { margin-top: 20px; }
.section-label { margin-bottom: 10px; font-size: 10px; }
.section-label strong { font-size: 12px; }
.exchange-sidebar .quick-bids button { height: 38px; font-size: 12px; }
.exchange-sidebar .custom-bid { height: 50px; margin-top: 12px; }
.exchange-sidebar .bid-step { height: 38px; width: 34px; font-size: 22px; }
.exchange-sidebar .custom-bid input { font-size: 14px; }
.bid-token { height: 31px; font-size: 10px; }
.bid-hint { margin-top: 10px; font-size: 10px; }
.contract-panel { margin-top: 22px; padding-top: 18px; }
.contract-empty { min-height: 76px; padding: 12px; font-size: 10px; }
.contract-row { min-height: 34px; }
.contract-row span, .contract-row strong { font-size: 9px; }
.confirm-bet { height: 42px; margin-top: 12px; font-size: 12px; }
.market-readout { padding-top: 10px; font-size: 8px; }
.exchange-main { grid-template-rows: 50px minmax(0, 1fr); }
.surface-toolbar { padding: 5px 9px; }
.surface-tool { width: 38px; height: 38px; font-size: 21px; }
.surface-toolbar .market-select { height: 38px; width: 132px; }
.surface-note { font-size: 9px; }
.surface-help { font-size: 8px; }
.surface-recenter { right: 90px; bottom: 8px; width: 38px; height: 38px; font-size: 21px; }
.price-surface-wrap { background: radial-gradient(80% 75% at 44% 50%, rgba(41,82,48,.12), transparent 70%), #07100a; }

@media (max-width: 1050px) {
  .exchange-app { grid-template-columns: 296px minmax(0, 1fr); }
  .exchange-header { gap: 13px; }
  .exchange-nav a { padding-inline: 10px; }
  .exchange-header-meta { display: none; }
  .exchange-connect { margin-left: auto; width: 132px; }
  .exchange-sidebar { padding-inline: 14px; }
  .contract-row { gap: 7px; }
  .surface-note { display: none; }
}

@media (max-width: 760px) {
  body[data-app="true"] { overflow: auto; }
  .exchange-app { min-height: 100vh; height: auto; grid-template-columns: 1fr; grid-template-rows: 64px auto minmax(500px, 68vh); }
  .exchange-header { grid-column: 1; height: 64px; padding-inline: 14px; }
  .exchange-logo { width: 36px; height: 36px; border-radius: 7px; }
  .exchange-logo img { width: 24px; height: 24px; }
  .exchange-wordmark { font-size: 19px; }
  .exchange-nav, .exchange-header-meta { display: none; }
  .exchange-connect { width: 124px; height: 36px; font-size: 12px; }
  .exchange-sidebar { grid-column: 1; grid-row: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding: 16px; border-right: 0; border-bottom: 1px solid #252525; }
  .sidebar-kicker, .exchange-wallet, .market-readout { grid-column: 1 / -1; }
  .sidebar-kicker { margin: 0; }
  .stake-panel, .contract-panel { margin: 0; padding: 0; border: 0; }
  .contract-empty { min-height: 138px; }
  .sidebar-spacer, .market-readout { display: none; }
  .exchange-main { grid-column: 1; grid-row: 3; min-height: 500px; }
  .surface-toolbar { overflow: hidden; }
  .surface-toolbar .market-select { flex: 0 0 auto; }
  .now-badge { top: 6px; }
  .surface-time, .surface-help { display: none; }
  .surface-price { font-size: 9px; }
  .contract-tooltip { display: none; }
  .surface-recenter { right: 72px; }
}

@media (max-width: 480px) {
  .exchange-sidebar { grid-template-columns: 1fr; gap: 14px; }
  .contract-empty { min-height: 62px; }
  .contract-panel { display: grid; grid-template-columns: 1fr auto; column-gap: 10px; align-items: start; }
  .contract-panel .section-label { grid-column: 1 / -1; }
  .contract-detail, .contract-empty { grid-column: 1 / -1; }
  .confirm-bet { margin: 0; }
}
