﻿/* =============================================================================
   OPTIONS TERMINAL
   ========================================================================== */
html, body.app { height: 100%; }
body.app { display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }

/* ---------- top bar ---------- */
.app-nav {
  flex: none; height: 56px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(8,10,17,0.9); backdrop-filter: blur(10px);
  z-index: 40;
}
.app-nav .brand-name { font-size: 16px; }
.app-nav a.brand { display: inline-flex; align-items: center; gap: 8px; }
.term-tag { font-size: 9.5px; letter-spacing: 0.18em; color: var(--accent);
  border: 1px solid var(--accent-line); border-radius: var(--r-xs); padding: 2px 6px; margin-left: 8px; }
.app-nav-left { display: flex; align-items: center; gap: 16px; }
.app-pool-link { font-size: 12.5px; color: var(--text-2); letter-spacing: .02em; transition: color .15s; }
.app-pool-link:hover { color: var(--accent); }
.app-nav-mid { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.app-nav-right { display: flex; align-items: center; gap: 12px; }
.app-net { display: inline-flex; align-items: center; gap: 7px; font-size: 12px; color: var(--text-2);
  height: 34px; padding: 0 12px; border: 1px solid var(--line); border-radius: var(--r-pill); }
.net-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
/* network switch (mainnet / testnet) */
.net-switch { display: inline-flex; align-items: center; height: 34px; padding: 3px;
  border: 1px solid var(--line); border-radius: var(--r-pill); gap: 2px; }
.net-opt { appearance: none; border: 0; background: transparent; cursor: pointer;
  font: inherit; font-size: 11.5px; letter-spacing: .02em; color: var(--text-3);
  height: 26px; padding: 0 11px; border-radius: var(--r-pill); transition: background .15s, color .15s; }
.net-opt:hover:not(:disabled) { color: var(--text); }
.net-opt:disabled { opacity: .38; cursor: not-allowed; }
.net-opt.active[data-net="mainnet"] { background: var(--accent); color: var(--accent-ink); box-shadow: 0 0 10px var(--accent-glow); }
.net-opt.active[data-net="testnet"] { background: rgba(255,255,255,0.08); color: var(--text); }
.feed-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--text-4); }
.feed-dot.live { background: var(--up); box-shadow: 0 0 8px var(--up); }
.feed-dot.sim { background: var(--accent); box-shadow: 0 0 8px var(--accent-glow); }
#connectBtn.connected { background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid var(--line-2); box-shadow: none; }

/* ---------- body grid ---------- */
.app-body {
  flex: 1 1 auto; min-height: 0; min-width: 0;
  display: grid; grid-template-columns: 232px minmax(0, 1fr) 376px;
  grid-auto-rows: minmax(0, auto);
  gap: 1px; background: var(--line);
}
.rail, .chain-panel, .ticket-panel { background: var(--bg); min-height: 0; min-width: 0; display: flex; flex-direction: column; }

/* ---------- rail ---------- */
.rail-head, .rail-foot { flex: none; padding: 13px 16px; font-size: 11px; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-3); }
.rail-head { border-bottom: none; }
.rail-search { padding: 6px 8px 5px; }
.rail-search input { width: 100%; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 4px; color: var(--text); font-size: 11px; padding: 5px 8px; outline: none; box-sizing: border-box; }
.rail-search input::placeholder { color: var(--text-3); }
.rail-search input:focus { border-color: var(--accent-line); }
.rail-tabs { display: flex; gap: 4px; padding: 4px 8px 6px; border-bottom: 1px solid var(--line); }
.rail-tab { flex: 1; background: transparent; border: 1px solid var(--line-2); border-radius: 4px; color: var(--text-3); font-size: 10px; padding: 4px 0; cursor: pointer; letter-spacing: .08em; text-transform: uppercase; transition: all .15s; }
.rail-tab:hover { color: var(--text); border-color: var(--line-strong); }
.rail-tab.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.rail-list { flex: 1 1 auto; overflow-y: auto; padding: 6px; }
.rail-item {
  width: 100%; display: grid; grid-template-columns: 1fr auto; grid-auto-rows: auto;
  gap: 2px 8px; align-items: center; text-align: left;
  padding: 9px 11px; border-radius: var(--r-sm); transition: background .14s;
}
.rail-item:hover { background: rgba(255,255,255,0.03); }
.rail-item.active { background: var(--accent-soft); }
.rail-item .ri-sym { font-weight: 600; font-size: 13.5px; display: flex; align-items: center; gap: 6px; }
.rail-item .ri-icon { width: 20px; height: 20px; border-radius: 4px; object-fit: contain; flex-shrink: 0; }
.rail-item .ri-icon.ri-card { width: 18px; height: 25px; border-radius: 3px; object-fit: cover; }
.rail-item .ri-px { font-size: 12px; color: var(--text-2); text-align: right; }
.rail-item .ri-d { font-size: 11px; grid-column: 2; }
.rail-item.locked { opacity: .45; }
.rail-item.locked:hover { background: rgba(255,255,255,0.02); cursor: not-allowed; }
.rail-item.locked .ri-px { color: var(--text-3); }
.ri-lock { font-size: 10px; opacity: .8; }
.rail-note { padding: 8px 14px 2px; font-size: 10.5px; line-height: 1.5; color: var(--text-3); }
.rail-foot { border-top: 1px solid var(--line); display: flex; justify-content: space-between; text-transform: none; letter-spacing: 0; }
.rail-foot span { color: var(--text); }

/* ---------- chain ---------- */
.mkt-header { flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px; border-bottom: 1px solid var(--line); }
.mh-left { display: flex; align-items: center; gap: 13px; }
.mh-img { width: 44px; height: 61px; object-fit: cover; border-radius: 5px; flex: none;
  background: #0a0a0f; box-shadow: 0 2px 10px rgba(0,0,0,.5), 0 0 0 1px var(--line),
  0 0 22px var(--accent-glow); }
.mh-id { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 9px; }
.mh-sym { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.mh-name { font-size: 13px; color: var(--text-3); }
.mh-set { font-size: 10.5px; color: var(--text-3); opacity: .7; flex-basis: 100%; letter-spacing: .02em; }
.mh-right { display: flex; align-items: baseline; gap: 12px; }
.mh-spot { font-size: 20px; font-weight: 500; }
.mh-right .delta { font-size: 14px; }

/* price chart */
.chart-wrap { flex: none; padding: 11px 16px 12px; border-bottom: 1px solid var(--line); }
.chart-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.chart-ranges { display: flex; gap: 3px; }
.chart-ranges button { padding: 4px 10px; border-radius: var(--r-xs); font-size: 11.5px;
  color: var(--text-3); border: 1px solid transparent; transition: all .14s; }
.chart-ranges button:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.chart-ranges button.active { background: var(--accent-soft); color: var(--accent); }
.chart-src { font-size: 10.5px; letter-spacing: 0.02em; color: var(--text-4); }
#priceChart { width: 100%; height: 232px; display: block; }
#priceChart:empty { background: repeating-linear-gradient(90deg, transparent 0 3px, rgba(255,255,255,0.015) 3px 4px); border-radius: var(--r-sm); }
/* lightweight-charts attribution link (kept subtle) */
#priceChart a[href*="tradingview"] { color: var(--text-4) !important; }

.chain-title { flex: none; padding: 12px 16px 2px; font-size: 10px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-3); }

.expiry-tabs { flex: none; display: flex; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--line); overflow-x: auto; }
.exp-tab { display: inline-flex; align-items: baseline; gap: 6px; padding: 7px 13px; border-radius: var(--r-pill);
  font-size: 12.5px; color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; transition: all .15s; }
.exp-tab:hover { border-color: var(--line-2); color: var(--text); }
.exp-tab.active { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
.exp-tab .exp-d { font-size: 10px; opacity: 0.6; }

.chain-scroll { flex: 1 1 auto; overflow-y: auto; overflow-x: auto; }
.chain-table { width: 100%; min-width: 440px; border-collapse: collapse; font-size: 12.5px; }
.chain-table thead th { position: sticky; top: 0; background: var(--bg-2); z-index: 1;
  padding: 9px 12px; font-size: 10px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-3); font-weight: 500; text-align: right; border-bottom: 1px solid var(--line); }
.chain-table th.side-lbl.call { text-align: left; color: var(--up); }
.chain-table th.side-lbl.put { color: var(--text-2); }
.chain-table th.strike-col { text-align: center; }
.crow { border-bottom: 1px solid rgba(255,255,255,0.03); }
.crow .c { padding: 8px 12px; text-align: right; cursor: pointer; transition: background .1s; }
.crow .call-cell:first-child { text-align: left; }
.crow .c.dim { color: var(--text-3); }
.crow .c.call-cell:not(.dim) { color: var(--up); }
.crow .c.put-cell:not(.dim) { color: var(--text); }
.crow .c.itm { background: rgba(255,255,255,0.02); }
.crow .strike { text-align: center; color: var(--text-2); font-weight: 600; background: rgba(255,255,255,0.02); cursor: default; }
.crow:hover .call-cell, .crow:hover .put-cell { background: rgba(255,255,255,0.03); }
.crow .call-cell:hover, .crow .put-cell:hover { background: var(--accent-soft) !important; color: var(--accent) !important; }
.crow.atm .strike { color: var(--accent); background: var(--accent-soft); }
.crow.sel { background: rgba(255, 143, 171,0.05); }

/* ---------- ticket ---------- */
.ticket-panel { border-left: none; }
.ticket { flex: 1 1 auto; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.ticket-sides { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.ticket-sides button { padding: 10px; border-radius: var(--r-sm); font-size: 13px; font-weight: 500;
  background: var(--surface); border: 1px solid var(--line); color: var(--text-2); transition: all .14s; }
.ticket-sides button:hover { border-color: var(--line-2); color: var(--text); }
.ticket-sides button[data-side="buyCall"].active, .ticket-sides button[data-side="buyPut"].active { background: var(--up-soft); border-color: rgba(47,224,160,0.4); color: var(--up); }
.ticket-sides button[data-side="sellCall"].active, .ticket-sides button[data-side="sellPut"].active { background: var(--down-soft); border-color: rgba(255,93,110,0.4); color: var(--down); }

.ticket-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ticket-row label { font-size: 12.5px; color: var(--text-3); }
.ticket-row select { flex: 1; max-width: 190px; height: 38px; padding: 0 12px; text-align: right;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 13px; }
.qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; }
.qty button { width: 34px; height: 38px; background: var(--surface); font-size: 16px; color: var(--text-2); }
.qty button:hover { background: var(--surface-2); color: var(--text); }
.qty input { width: 60px; height: 38px; text-align: center; background: var(--bg); border: none; border-inline: 1px solid var(--line); font-size: 14px; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
/* spend-by-amount field */
.budget-field { display: flex; align-items: center; flex: 1; max-width: 190px; height: 38px;
  border: 1px solid var(--line); border-radius: var(--r-sm); overflow: hidden; background: var(--bg); }
.budget-field input { flex: 1; min-width: 0; height: 100%; text-align: right; background: transparent;
  border: none; padding: 0 10px; font-size: 14px; color: var(--text); }
.budget-field input::-webkit-outer-spin-button, .budget-field input::-webkit-inner-spin-button { -webkit-appearance: none; }
.budget-suffix { padding: 0 10px; font-size: 12px; color: var(--text-3); border-left: 1px solid var(--line); height: 100%; display: flex; align-items: center; }

.ticket-metrics { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 6px 14px; }
.tm-row { display: flex; align-items: center; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; }
.tm-row:last-of-type { border-bottom: none; }
.tm-l { color: var(--text-3); }
.tm-v { color: var(--text); font-weight: 500; }
.tm-v.up { color: var(--up); }
.tm-v.down { color: var(--down); }
.tm-greeks { display: flex; justify-content: space-between; gap: 8px; padding: 12px 2px 4px; margin-top: 4px; border-top: 1px solid var(--line); font-size: 12px; color: var(--text-3); }
.tm-greeks b { color: var(--text); font-weight: 600; margin-left: 3px; }

.payoff-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 12px; }
.payoff-head { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-3); margin-bottom: 6px; }
#payoff { width: 100%; display: block; }

.place-btn { width: 100%; height: 48px; font-size: 14.5px; }
.place-btn.disabled, .place-btn:disabled { opacity: .45; cursor: not-allowed; filter: grayscale(0.4); }
.ticket-note { text-align: center; font-size: 11px; color: var(--text-4); }

/* ---------- positions ---------- */
.positions { flex: none; height: 232px; border-top: 1px solid var(--line); display: flex; flex-direction: column; background: var(--bg-2); }
.pos-summary { flex: none; display: flex; gap: 0; border-bottom: 1px solid var(--line); }
.ps { flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 14px 20px; border-right: 1px solid var(--line); }
.ps:last-child { border-right: none; }
.ps-l { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: 0.05em; }
.ps-v { font-size: 18px; font-weight: 600; }
.ps-v.up { color: var(--up); } .ps-v.down { color: var(--down); }
.pos-scroll { flex: 1 1 auto; overflow-y: auto; overflow-x: auto; }
.pos-table { width: 100%; min-width: 640px; border-collapse: collapse; font-size: 12.5px; }
.pos-table thead th { position: sticky; top: 0; background: var(--bg-2); text-align: right; padding: 10px 16px;
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-3); font-weight: 500; border-bottom: 1px solid var(--line); }
.pos-table thead th:first-child, .pos-table thead th:nth-child(2) { text-align: left; }
.prow td { padding: 10px 16px; text-align: right; border-bottom: 1px solid rgba(255,255,255,0.03); }
.prow td:first-child, .prow td:nth-child(2) { text-align: left; }
.prow .p-sym { font-weight: 600; }
.close-x { color: var(--text-4); font-size: 12px; padding: 4px 6px; border-radius: var(--r-xs); }
.close-x:hover { color: var(--down); background: var(--down-soft); }
.pos-empty td { text-align: center !important; color: var(--text-4); padding: 34px; font-size: 13px; }

/* ---------- wallet picker ---------- */
.wallet-modal { position: fixed; inset: 0; z-index: 300; display: flex; align-items: center; justify-content: center;
  background: rgba(2,3,6,0.72); backdrop-filter: blur(6px); opacity: 0; transition: opacity .2s var(--ease); padding: 20px; }
.wallet-modal.in { opacity: 1; }
.wallet-card { width: 100%; max-width: 380px; background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: var(--r-lg); box-shadow: var(--shadow-lg); transform: translateY(10px); transition: transform .2s var(--ease); overflow: hidden; }
.wallet-modal.in .wallet-card { transform: none; }
.wallet-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--line); font-size: 15px; font-weight: 600; }
.wallet-x { color: var(--text-3); font-size: 15px; padding: 4px 8px; border-radius: 6px; }
.wallet-x:hover { color: var(--text); background: rgba(255,255,255,0.05); }
.wallet-list { display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.wallet-item { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-radius: var(--r-md);
  background: var(--surface); border: 1px solid var(--line); font-size: 14.5px; font-weight: 500; text-align: left; transition: all .14s; }
.wallet-item:hover { border-color: var(--accent-line); background: var(--surface-3); transform: translateY(-1px); }
.wallet-item img { border-radius: 7px; }
.wallet-dot { width: 26px; height: 26px; border-radius: 7px; background: var(--accent-soft); display: inline-block; }
.wallet-empty { color: var(--text-3); font-size: 13.5px; line-height: 1.6; padding: 8px; }

/* ---------- toast ---------- */
.toast-host { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.toast { padding: 12px 16px; border-radius: var(--r-md); font-size: 13px; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--line-2); color: var(--text);
  box-shadow: var(--shadow-lg); opacity: 0; transform: translateY(10px); transition: all .3s var(--ease); max-width: 320px; }
.toast.in { opacity: 1; transform: none; }
.toast.up { border-color: rgba(47,224,160,0.4); }
.toast.down { border-color: rgba(255,93,110,0.4); }
.toast.muted { color: var(--text-2); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  body.app { overflow-x: hidden; overflow-y: visible; height: auto; }
  .app-body { grid-template-columns: minmax(0, 1fr); }
  .positions { min-width: 0; }
  .rail { flex-direction: column; }
  .rail-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px,1fr)); max-height: 200px; }
  .ticket-panel { order: 3; }
  .positions { height: auto; }
}
@media (max-width: 620px) {
  .app-nav-mid { display: none; }
  .term-tag { display: none; }                 /* free up header space for the switch */
  .net-switch { height: 30px; }
  .net-opt { padding: 0 8px; font-size: 10.5px; height: 22px; }
  .pos-summary { flex-wrap: wrap; }
  .ps { min-width: 50%; }
  /* chain -> exact 3-column grid rows (Calls | Strike | Puts), no table quirks */
  .chain-scroll { overflow-x: hidden; }
  .chain-table th:nth-child(2), .chain-table th:nth-child(3),
  .chain-table th:nth-child(5), .chain-table th:nth-child(6),
  .crow .c.dim { display: none; }
  .chain-table, .chain-table thead, .chain-table tbody { display: block; width: 100%; min-width: 0; }
  .chain-table thead tr, .crow { display: grid; grid-template-columns: minmax(0,1fr) 84px minmax(0,1fr); align-items: center; }
  .chain-table thead th, .crow .c { padding: 12px 14px; font-size: 13.5px; }
  .pos-scroll { overflow-x: auto; }
}

/* =============================================================================
   CARDSTRIKE TERMINAL THEME — near-black / matrix green
   ========================================================================== */

/* no holo rainbow — clean border only */
.app-nav { position: relative; }
.app-nav::after { display: none; }
.app-body::before { display: none; }
.app-body { position: relative; }
.rail, .chain-panel, .ticket-panel { position: relative; z-index: 1; }
.place-btn { height: 46px; font-size: 15px; }

body.app {
  --green:#ff8fab;
  --bg:#0a0a0a; --bg-2:#060606;
  --surface:#111111; --surface-2:#161616; --surface-3:#1e1e1e;
  --line:#211520; --line-2:#222222; --line-strong:#2e2e2e;
  --text:#e0e0e0; --text-2:#aaaaaa; --text-3:#555555; --text-4:#2e2e2e;
  --accent:#ff8fab;
  --accent-soft:rgba(255,143,171,.07);
  --accent-line:rgba(255,143,171,.22);
  --accent-glow:rgba(255,143,171,.28);
  --accent-ink:#0a0a0a;
  --up:#ff8fab; --down:#ff4444;
  --up-soft:rgba(255,143,171,.09); --down-soft:rgba(255,68,68,.09);
  --font-display:'Bricolage Grotesque',sans-serif;
  --font-sans:'Outfit',sans-serif;
  --font-mono:'IBM Plex Mono',monospace;
  --r-xs:4px; --r-sm:6px; --r-md:10px; --r-lg:16px; --r-pill:999px;
  font-family: var(--font-mono);
  color: var(--text);
  background: var(--bg);
}

body.app .mono,
body.app .chain-table,
body.app .pos-table,
body.app select,
body.app input { font-family: var(--font-mono); }

/* ---------- top bar ---------- */
body.app .app-nav {
  background: #060606;
  border-bottom: 1px solid #211520;
}
body.app .app-nav .brand-mark {
  background: none; width: auto; height: auto; display: inline-flex; align-items: center;
}
body.app .app-nav .brand-mark img {
  object-fit: cover; display: block; border: none; box-shadow: none; border-radius: 10px;
}
body.app .brand-name {
  font-family: 'Press Start 2P', monospace; font-weight: 400;
  text-transform: uppercase; letter-spacing: .02em; font-size: 11px;
}
body.app .term-tag {
  background: rgba(255,143,171,.08);
  color: var(--green);
  border: 1px solid rgba(255,143,171,.3);
  border-radius: 5px;
  font-weight: 700; letter-spacing: .14em;
}
body.app .app-pool-link { color: var(--text-3); }
body.app .app-pool-link:hover { color: var(--green); }

body.app .net-switch { border: 1px solid #211520; background: #0a0a0a; }
body.app .net-opt { color: var(--text-3); }
body.app .net-opt.active[data-net="mainnet"],
body.app .net-opt.active[data-net="testnet"] {
  background: var(--green); color: #0a0a0a; font-weight: 700; box-shadow: none;
}

/* feed dot: sim = green, live = green glow */
body.app .feed-dot.sim { background: var(--green); box-shadow: 0 0 8px rgba(255,143,171,.5); }
body.app .feed-dot.live { background: var(--green); box-shadow: 0 0 8px rgba(255,143,171,.7); }

/* ---------- connect + place buttons (neo-brutalist) ---------- */
body.app .btn-holo {
  background: #e0e0e0;
  color: #0a0a0a;
  border: 1px solid #333333;
  border-radius: 10px;
  font-family: var(--font-sans);
  font-weight: 800;
  box-shadow: 0 3px 0 #555555, 0 3px 0 2px rgba(0,0,0,.5);
  animation: none;
  transition: transform .12s ease, box-shadow .12s ease;
}
body.app .btn-holo:hover {
  transform: translateY(-2px);
  box-shadow: 0 5px 0 #555555, 0 5px 0 2px rgba(0,0,0,.5);
}
body.app .btn-holo:active {
  transform: translateY(2px);
  box-shadow: 0 1px 0 #555555, 0 1px 0 2px rgba(0,0,0,.5);
}
body.app #connectBtn.connected {
  background: var(--surface-2); color: var(--text);
  border: 1px solid #222222; box-shadow: none; transform: none;
}

/* ---------- body grid ---------- */
body.app .app-body { gap: 1px; background: #111111; }

/* ---------- rail ---------- */
body.app .rail { background: #080808; }
body.app .rail-head { color: var(--text-3); border-bottom: 1px solid #141414; letter-spacing: .18em; }
body.app .rail-foot { border-top: 1px solid #141414; color: var(--text-3); }
body.app .rail-foot span { color: var(--text-2); }
body.app .rail-item .ri-sym { color: var(--text); }
body.app .rail-item .ri-px { color: var(--text-2); }
body.app .rail-item.active { background: var(--accent-soft); position: relative; }
body.app .rail-item.active::before {
  content: '';
  position: absolute; left: 0; top: 6px; bottom: 6px;
  width: 2px; border-radius: 0 2px 2px 0;
  background: var(--green);
  box-shadow: 0 0 8px rgba(255,143,171,.5);
  animation: none;
}
body.app .rail-item .ri-sym.up  { color: var(--green); }
body.app .rail-note { color: var(--text-4); }

/* ---------- market header ---------- */
body.app .mkt-header { background: #080808; border-bottom: 1px solid #141414; }
body.app .mh-img {
  box-shadow: 0 2px 10px rgba(0,0,0,.7), 0 0 0 1px #211520;
  border-radius: 6px;
}
body.app .mh-sym {
  font-family: var(--font-display); font-weight: 800;
  text-transform: uppercase; letter-spacing: -.01em;
}
body.app .mh-name { color: var(--text-3); }
body.app .mh-set { color: var(--text-4); }
body.app .delta.pos { color: var(--green); }
body.app .delta.neg { color: var(--down); }

/* ---------- chart ---------- */
body.app .chart-wrap { background: #080808; border-bottom: 1px solid #141414; }
body.app .chart-ranges button { color: var(--text-3); border-color: transparent; border-radius: 5px; }
body.app .chart-ranges button:hover { color: var(--text); background: rgba(255,255,255,.03); }
body.app .chart-ranges button.active {
  background: var(--green); color: #0a0a0a; border-color: var(--green);
  box-shadow: 0 0 8px rgba(255,143,171,.3);
}
body.app .chart-src { color: var(--text-4); }

/* ---------- chain ---------- */
body.app .chain-title { color: var(--text-4); letter-spacing: .18em; }
body.app .expiry-tabs { border-bottom: 1px solid #141414; }
body.app .exp-tab {
  border: 1px solid #211520; color: var(--text-3); border-radius: 6px;
}
body.app .exp-tab:hover { border-color: #2e2e2e; color: var(--text-2); }
body.app .exp-tab.active {
  background: var(--green); color: #0a0a0a;
  border-color: var(--green); font-weight: 700;
  box-shadow: 0 0 10px rgba(255,143,171,.25);
}

/* chain table */
body.app .chain-table thead th { background: #060606; color: var(--text-4); border-bottom: 1px solid #141414; }
body.app .chain-table th.side-lbl.call { color: var(--green); }
body.app .chain-table th.side-lbl.put  { color: var(--down); }
body.app .chain-table th.strike-col    { color: var(--text-3); }

body.app .crow { border-bottom: 1px solid #0e0e0e; }
body.app .crow .c.call-cell:not(.dim) { color: var(--green); }
body.app .crow .c.put-cell:not(.dim)  { color: var(--down); }
body.app .crow .c.dim { color: var(--text-4); }
body.app .crow .strike {
  color: #e0e0e0; background: #0d0d0d;
  border-left: 1px solid #141414; border-right: 1px solid #141414;
}
body.app .crow.atm .c { background: rgba(255,143,171,.03); }
body.app .crow.atm .strike {
  background: #0d1a0d !important; color: var(--green);
  text-shadow: 0 0 8px rgba(255,143,171,.4);
}
body.app .crow:hover .call-cell,
body.app .crow:hover .put-cell { background: rgba(255,255,255,.02); }
body.app .crow .call-cell:hover { background: var(--accent-soft) !important; color: var(--green) !important; }
body.app .crow .put-cell:hover  { background: var(--down-soft) !important; color: var(--down) !important; }

/* ---------- ticket ---------- */
body.app .ticket { background: #080808; }
body.app .ticket-sides button {
  border: 1px solid #211520; background: #111111; color: var(--text-3);
  border-radius: 7px;
}
body.app .ticket-sides button:hover { border-color: #2e2e2e; color: var(--text); }
body.app .ticket-sides button[data-side="buyCall"].active,
body.app .ticket-sides button[data-side="buyPut"].active {
  background: rgba(255,143,171,.1); border-color: rgba(255,143,171,.35); color: var(--green);
}
body.app .ticket-sides button[data-side="sellCall"].active,
body.app .ticket-sides button[data-side="sellPut"].active {
  background: rgba(255,68,68,.1); border-color: rgba(255,68,68,.35); color: var(--down);
}

body.app select,
body.app .budget-field,
body.app .qty { border: 1px solid #211520; background: #111111; color: var(--text); }
body.app .qty button { background: #111111; color: var(--text-2); }
body.app .qty button:hover { background: #211520; color: var(--text); }
body.app .qty input { background: #0a0a0a; color: var(--text); border-inline: 1px solid #211520; }
body.app .budget-field input { color: var(--text); }
body.app .budget-suffix { color: var(--text-4); border-left: 1px solid #211520; }

body.app .ticket-metrics,
body.app .payoff-wrap { background: #111111; border: 1px solid #141414; border-radius: 8px; }
body.app .tm-row { border-bottom: 1px solid #141414; }
body.app .tm-l { color: var(--text-3); }
body.app .tm-v { color: var(--text); }
body.app .tm-v.up   { color: var(--green); }
body.app .tm-v.down { color: var(--down); }
body.app .tm-greeks { border-top: 1px solid #141414; color: var(--text-3); }
body.app .tm-greeks b { color: var(--text-2); }
body.app .payoff-head { color: var(--text-3); }
body.app .ticket-note { color: var(--text-4); }

/* ---------- positions bar ---------- */
body.app .positions { background: #060606; border-top: 1px solid #141414; }
body.app .pos-summary { border-bottom: 1px solid #141414; }
body.app .ps { border-right: 1px solid #141414; }
body.app .ps-l { color: var(--text-4); }
body.app .ps-v { color: var(--text); }
body.app .ps-v.up   { color: var(--green); }
body.app .ps-v.down { color: var(--down); }
body.app .pos-table thead th {
  background: #060606; color: var(--text-4); border-bottom: 1px solid #141414;
}
body.app .prow td { border-bottom: 1px solid #0e0e0e; }
body.app .pos-empty td { color: var(--text-4); }
body.app .close-x { color: var(--text-4); }
body.app .close-x:hover { color: var(--down); background: var(--down-soft); }

/* ---------- wallet menu ---------- */
.wallet-menu { position: absolute; top: calc(100% + 8px); right: 0; min-width: 160px; background: #111111; border: 1px solid #222222; border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.6); overflow: hidden; z-index: 400; }
.wm-item { display: block; width: 100%; text-align: left; padding: 10px 14px; font-size: 13px; font-family: 'IBM Plex Mono', monospace; color: var(--text); background: transparent; border: none; cursor: pointer; }
.wm-item:hover { background: rgba(255,255,255,.05); }
.wm-disc { color: var(--down); }
.wm-disc:hover { background: var(--down-soft); }

/* ---------- wallet modal ---------- */
body.app .wallet-modal { background: rgba(0,0,0,.8); }
body.app .wallet-card { background: #111111; border: 1px solid #222222; }
body.app .wallet-head { border-bottom: 1px solid #211520; }
body.app .wallet-item { background: #161616; border: 1px solid #211520; }
body.app .wallet-item:hover { border-color: rgba(255,143,171,.3); background: #211520; }

/* ---------- toast ---------- */
body.app .toast { background: #111111; border: 1px solid #222222; }
body.app .toast.up   { border-color: rgba(255,143,171,.35); }
body.app .toast.down { border-color: rgba(255,68,68,.35); }

/* ---------- battle toggle button ---------- */
.battle-toggle {
  font-size: 11px; color: var(--text-3);
  padding: 3px 9px; border-radius: 6px;
  border: 1px solid transparent; background: transparent;
  cursor: pointer; white-space: nowrap; line-height: 1;
  transition: color .15s, border-color .15s, background .15s;
}
.battle-toggle:hover { color: var(--text); border-color: var(--line-2); }
.battle-toggle.active { color: #ffb347; border-color: rgba(255,179,71,.3); background: rgba(255,179,71,.07); }

