/* NiftySignals — dense laptop dashboard, calm fintech tone */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: #050505;
  color: #fafafa;
  font-family: var(--font-ui, "Space Grotesk"), -apple-system, "Inter", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "ss01", "cv11";
}

:root {
  --bg: #050505;
  --surface: #0d0d0d;
  --surface-2: #141414;
  --surface-3: #1a1a1a;
  --border: rgba(255,255,255,0.06);
  --border-2: rgba(255,255,255,0.10);
  --border-3: rgba(255,255,255,0.16);
  --fg: #fafafa;
  --muted: rgba(255,255,255,0.55);
  --muted-2: rgba(255,255,255,0.36);
  --muted-3: rgba(255,255,255,0.22);
  --up: #2BD489;
  --down: #FF5A5F;
  --wait: #F5C518;
  --up-soft: rgba(43,212,137,0.10);
  --down-soft: rgba(255,90,95,0.10);
  --wait-soft: rgba(245,197,24,0.10);
  --font-ui: "Space Grotesk";
  --font-num: "Space Grotesk";
}

body {
  font-family: var(--font-ui), -apple-system, system-ui, sans-serif;
}

.tnum, .num {
  font-family: var(--font-num), var(--font-ui), system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

button { font-family: inherit; }

/* ─────────── Shell ─────────── */
.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(ellipse 1200px 600px at 20% -10%, rgba(255,255,255,0.025), transparent 70%),
    var(--bg);
}

/* ─────────── Header strip ─────────── */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 22px;
  border-bottom: 1px solid var(--border);
  gap: 24px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-size: 15px; font-weight: 600;
  letter-spacing: -0.02em;
  min-width: 180px;
}
.brand-mark {
  width: 22px; height: 22px;
  border-radius: 6px;
  background: linear-gradient(135deg, var(--up), color-mix(in oklab, var(--up) 60%, #000));
  position: relative;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 6px 14px rgba(43,212,137,0.20);
}
.brand-mark::after {
  content: "";
  position: absolute; inset: 5px;
  background: var(--bg);
  border-radius: 3px;
}
.brand-mark::before {
  content: "";
  position: absolute;
  top: 50%; left: 50%;
  width: 8px; height: 8px;
  background: var(--up);
  border-radius: 2px;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.ticker {
  display: flex;
  align-items: center;
  gap: 22px;
  flex: 1;
  justify-content: center;
}
.tk {
  display: flex; align-items: baseline; gap: 8px;
}
.tk-name {
  font-size: 11px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.tk-val {
  font-size: 14px;
  letter-spacing: -0.01em;
  font-weight: 500;
}
.tk-chg {
  font-size: 12px;
  padding: 2px 6px;
  border-radius: 4px;
  letter-spacing: -0.005em;
}
.tk-chg.up { color: var(--up); background: var(--up-soft); }
.tk-chg.down { color: var(--down); background: var(--down-soft); }

.topbar-right {
  display: flex; align-items: center; gap: 14px;
  min-width: 180px;
  justify-content: flex-end;
}
.market-status {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 12px;
  color: var(--muted);
  padding: 6px 11px 6px 9px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  letter-spacing: 0.005em;
}
.live-dot {
  width: 6px; height: 6px; border-radius: 99px;
  background: var(--up);
  box-shadow: 0 0 0 4px rgba(43,212,137,0.12);
  animation: pulse 2.2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}
.clock {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: -0.01em;
}
.icon-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}
.icon-btn:hover { color: var(--fg); border-color: var(--border-2); }

/* ─────────── Main grid ─────────── */
.main {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 18px;
  padding: 18px 22px 22px;
  flex: 1;
  min-height: 0;
}
.col-left { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.col-right { display: flex; flex-direction: column; gap: 14px; min-width: 0; }

/* ─────────── Index hero strip ─────────── */
.idx-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 4px 6px;
}
.idx-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 500;
}
.idx-name {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}
.idx-price {
  font-size: 48px;
  letter-spacing: -0.045em;
  font-weight: 500;
  line-height: 0.95;
  display: flex; align-items: baseline; gap: 10px;
}
.idx-chg {
  font-size: 14px;
  letter-spacing: -0.01em;
}
.idx-chg.up { color: var(--up); }
.idx-chg.down { color: var(--down); }

.spark {
  height: 56px;
  width: 240px;
  display: flex;
  align-items: flex-end;
}

/* ─────────── Day Range bar ─────────── */
.range-wrap {
  display: flex; flex-direction: column;
  gap: 8px;
  width: 320px;
  align-items: flex-end;
}
.range-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  display: flex; align-items: center; gap: 6px;
}
.range-label .arrow {
  font-size: 12px;
  letter-spacing: 0;
}
.range-label.toward-high { color: var(--up); }
.range-label.toward-low { color: var(--down); }
.range-label.mid { color: var(--muted); }

.range-track {
  position: relative;
  width: 100%;
  height: 8px;
  background: linear-gradient(90deg, var(--down-soft) 0%, rgba(255,255,255,0.04) 50%, var(--up-soft) 100%);
  border-radius: 4px;
  border: 1px solid var(--border);
}
.range-track::before, .range-track::after {
  content: "";
  position: absolute;
  top: -3px; bottom: -3px;
  width: 1px;
  background: rgba(255,255,255,0.12);
}
.range-track::before { left: 0; }
.range-track::after { right: 0; }

.range-marker {
  position: absolute;
  top: -3px; bottom: -3px;
  width: 3px;
  border-radius: 2px;
  background: var(--fg);
  box-shadow: 0 0 0 2px rgba(5,5,5,0.9), 0 0 12px rgba(255,255,255,0.3);
  transform: translateX(-50%);
  transition: left 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.range-ends {
  display: flex; justify-content: space-between;
  width: 100%;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.005em;
}
.range-end {
  display: flex; flex-direction: column;
  gap: 1px;
}
.range-end.right { text-align: right; align-items: flex-end; }
.range-end-k {
  font-size: 9px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 500;
}
.range-end-v {
  font-size: 12px;
  color: var(--fg);
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.005em;
}
.range-end.low .range-end-v { color: var(--down); }
.range-end.high .range-end-v { color: var(--up); }

.idx-meta {
  display: flex; gap: 16px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: -0.005em;
}
.idx-meta b { color: var(--fg); font-weight: 500; }

/* ─────────── Cards ─────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  position: relative;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.card-title {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.card-side {
  font-size: 11px;
  color: var(--muted-2);
  letter-spacing: 0.02em;
}

/* ─────────── SIGNAL HERO ─────────── */
.signal-card {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  overflow: hidden;
  min-height: 230px;
}
.signal-card.is-buy { background:
  radial-gradient(ellipse 600px 350px at 0% 0%, rgba(43,212,137,0.10), transparent 60%),
  var(--surface);
}
.signal-card.is-sell { background:
  radial-gradient(ellipse 600px 350px at 0% 0%, rgba(255,90,95,0.10), transparent 60%),
  var(--surface);
}
.signal-card.is-wait { background:
  radial-gradient(ellipse 600px 350px at 0% 0%, rgba(245,197,24,0.07), transparent 60%),
  var(--surface);
}

/* Top section: verdict + hint side by side */
.signal-top {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 24px;
  align-items: center;
  padding-bottom: 18px;
}
.signal-verdict-block { display: flex; flex-direction: column; }
.signal-left { display: flex; flex-direction: column; } /* legacy compat */
.signal-tag {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 11px;
  color: var(--muted);
  padding: 5px 10px 5px 8px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  width: fit-content;
  margin-bottom: 14px;
}
.signal-tag .dot { width: 6px; height: 6px; border-radius: 99px; }

.signal-word {
  font-size: 96px;
  line-height: 0.88;
  letter-spacing: -0.05em;
  font-weight: 600;
  margin: 0 0 0;
}
.signal-word.is-buy { color: var(--up); }
.signal-word.is-sell { color: var(--down); }
.signal-word.is-wait { color: var(--wait); }

.signal-meta-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.signal-sub {
  font-size: 13px;
  color: var(--muted);
  letter-spacing: -0.005em;
  line-height: 1.5;
}
.conf-bar {
  display: flex;
  gap: 4px;
}
.conf-seg {
  flex: 1;
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
}
.conf-seg.on.is-buy { background: var(--up); }
.conf-seg.on.is-sell { background: var(--down); }
.conf-seg.on.is-wait { background: var(--wait); }

.conf-line {
  font-size: 12px;
  color: var(--muted);
  display: flex; justify-content: space-between;
}
.conf-line b { color: var(--fg); font-weight: 500; }

/* Bottom section: 2-column supports */
.signal-bottom {
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.supports-head {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.supports-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 24px;
}
.supports-col {
  display: flex;
  flex-direction: column;
}
.support-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.support-row:last-child { border-bottom: 0; }
.support-name {
  font-weight: 500;
  letter-spacing: -0.01em;
}
.support-meta {
  font-size: 11px;
  color: var(--muted-2);
  margin-top: 2px;
  letter-spacing: 0.005em;
}
.support-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.support-status .dot { width: 6px; height: 6px; border-radius: 99px; }
.support-status.agree { color: var(--up); }
.support-status.agree .dot { background: var(--up); box-shadow: 0 0 0 3px rgba(43,212,137,0.12); }
.support-status.disagree { color: var(--down); }
.support-status.disagree .dot { background: var(--down); box-shadow: 0 0 0 3px rgba(255,90,95,0.12); }
.support-status.neutral { color: var(--muted); }
.support-status.neutral .dot { background: var(--muted); }
.support-status.bullish { color: var(--up); opacity: 0.75; }
.support-status.bullish .dot { background: var(--up); opacity: 0.75; }
.support-status.bearish { color: var(--down); opacity: 0.75; }
.support-status.bearish .dot { background: var(--down); opacity: 0.75; }

/* ─────────── Indicator grid ─────────── */
.ind-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.ind {
  padding: 14px 14px 13px;
  display: flex; flex-direction: column;
  min-height: 132px;
}
.ind-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px;
}
.ind-name {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.ind-status {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 7px;
  border-radius: 99px;
  font-weight: 500;
}
.ind-status.agree { color: var(--up); background: var(--up-soft); }
.ind-status.disagree { color: var(--down); background: var(--down-soft); }
.ind-status.neutral { color: var(--muted); background: rgba(255,255,255,0.04); }

.ind-body {
  flex: 1;
  display: flex; flex-direction: column;
  justify-content: flex-end;
}
.ind-big {
  font-size: 28px;
  letter-spacing: -0.03em;
  font-weight: 500;
  line-height: 1;
  display: flex; align-items: baseline; gap: 6px;
  margin-bottom: 6px;
}
.ind-big .u {
  font-size: 13px; color: var(--muted); font-weight: 400;
}
.ind-detail {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: -0.005em;
  display: flex; gap: 10px;
  flex-wrap: wrap;
}
.ind-detail b { color: var(--fg); font-weight: 500; }

.ema-pair {
  display: flex; gap: 16px;
}
.ema-leg .ema-deg {
  font-size: 22px;
  letter-spacing: -0.025em;
  font-weight: 500;
}
.ema-leg .ema-deg .arrow {
  display: inline-block;
  margin-left: 2px;
  transform-origin: center;
}
.ema-leg .ema-lbl {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 2px;
}

/* CPR card */
.cpr-stack {
  display: flex; flex-direction: column; gap: 4px;
  font-size: 12px;
}
.cpr-row {
  display: flex; justify-content: space-between; align-items: center;
  color: var(--muted);
  padding: 3px 0;
}
.cpr-row.tc { color: var(--down); }
.cpr-row.pivot { color: var(--fg); font-weight: 500; }
.cpr-row.bc { color: var(--up); }
.cpr-row .v { font-variant-numeric: tabular-nums; }
.cpr-spot {
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 4px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* RSI dial */
.rsi-wrap {
  display: flex; align-items: center; gap: 12px;
}
.rsi-dial {
  position: relative;
  width: 60px; height: 60px;
  flex-shrink: 0;
}
.rsi-track {
  fill: none;
  stroke: rgba(255,255,255,0.08);
  stroke-width: 5;
}
.rsi-arc {
  fill: none;
  stroke-width: 5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.rsi-num {
  position: absolute;
  inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.rsi-info {
  display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.rsi-state {
  font-size: 12px;
  font-weight: 500;
}
.rsi-hint {
  font-size: 11px;
  color: var(--muted-2);
}

/* Key Levels */
.kl-spot {
  font-size: 24px;
  letter-spacing: -0.03em;
  font-weight: 500;
  line-height: 1;
}
.kl-target {
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
  display: flex; align-items: center; gap: 6px;
}
.kl-bar {
  height: 4px;
  background: rgba(255,255,255,0.06);
  border-radius: 2px;
  margin-top: 10px;
  position: relative;
  overflow: hidden;
}
.kl-fill {
  position: absolute;
  top: 0; bottom: 0; left: 0;
  background: var(--up);
  border-radius: 2px;
}
.kl-marker {
  position: absolute;
  top: -3px; bottom: -3px;
  width: 2px;
  background: var(--fg);
  border-radius: 1px;
}

/* ─────────── Option Chain ─────────── */
.chain-card {
  padding: 0;
  display: flex; flex-direction: column;
  flex: 1;
  min-height: 0;
}
.chain-head {
  padding: 16px 18px 12px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.chain-tabs {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  font-size: 12px;
}
.chain-tab {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 5px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: all 0.15s;
}
.chain-tab.on {
  background: var(--surface-3);
  color: var(--fg);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset;
}

.chain-grid-head {
  display: grid;
  grid-template-columns: 60px 1fr 80px 70px 36px;
  gap: 8px;
  padding: 8px 18px;
  font-size: 10px;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 500;
}
.chain-grid-head .right { text-align: right; }

.chain-list { padding: 0 10px 10px; }
.chain-section-label {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted-2);
  padding: 12px 8px 6px;
  font-weight: 600;
}
.strike-row {
  display: grid;
  grid-template-columns: 60px 1fr 80px 70px 36px;
  gap: 8px;
  align-items: center;
  padding: 9px 8px;
  border-radius: 8px;
  transition: background 0.12s;
}
.strike-row:hover { background: var(--surface-2); }
.strike-row.atm {
  background: rgba(255,255,255,0.02);
  border: 1px dashed rgba(255,255,255,0.08);
  padding: 8px 7px;
}
.strike-row.atm:hover { background: rgba(255,255,255,0.04); }

.strike-badge {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
}
.strike-badge.atm-badge {
  color: var(--wait);
}
.strike-val {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.strike-tag {
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 2px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.strike-ltp {
  font-size: 14px;
  font-weight: 500;
  text-align: right;
  letter-spacing: -0.01em;
}
.strike-chg {
  font-size: 11px;
  text-align: right;
  letter-spacing: -0.005em;
}
.strike-chg.up { color: var(--up); }
.strike-chg.down { color: var(--down); }
.add-btn {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 16px;
  font-weight: 500;
  transition: all 0.15s;
}
.add-btn:hover {
  color: var(--fg);
  border-color: var(--border-3);
  background: var(--surface-3);
}
.add-btn.added {
  background: color-mix(in oklab, var(--up) 18%, transparent);
  border-color: color-mix(in oklab, var(--up) 38%, transparent);
  color: var(--up);
}

/* ─────────── Toast ─────────── */
.pos-card { padding: 0; }
.pos-head {
  padding: 14px 18px;
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border);
}
.pos-pnl {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.pos-pnl.up { color: var(--up); }
.pos-pnl.down { color: var(--down); }

.pos-list {
  display: flex; flex-direction: column;
}
.pos-row {
  display: grid;
  grid-template-columns: 1fr 80px 80px 64px;
  gap: 10px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
}
.pos-row:last-child { border-bottom: 0; }
.pos-leg {
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.01em;
  display: flex; align-items: center; gap: 8px;
}
.pos-side-chip {
  font-size: 9px;
  padding: 2px 5px;
  border-radius: 3px;
  letter-spacing: 0.08em;
  font-weight: 600;
}
.pos-side-chip.ce { color: var(--up); background: var(--up-soft); }
.pos-side-chip.pe { color: var(--down); background: var(--down-soft); }
.pos-leg-sub {
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 3px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.pos-cell {
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}
.pos-cell.right { text-align: right; }
.pos-cell.up { color: var(--up); }
.pos-cell.down { color: var(--down); }
.pos-cell-label {
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 2px;
}
.sell-btn {
  background: transparent;
  border: 1px solid var(--border-2);
  color: var(--fg);
  padding: 7px 0;
  border-radius: 7px;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
}
.sell-btn:hover {
  border-color: var(--down);
  color: var(--down);
  background: var(--down-soft);
}

.pos-empty {
  padding: 28px 18px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: -0.005em;
}
.pos-empty b { display: block; font-size: 13px; color: var(--fg); font-weight: 500; margin-bottom: 4px; }

.pos-foot {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px;
  font-size: 12px;
  color: var(--muted);
  border-top: 1px solid var(--border);
}
.pos-foot b { color: var(--fg); font-weight: 500; }

/* ─────────── Order Ticket (modal) ─────────── */
.modal-scrim {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  z-index: 150;
  padding: 24px;
  animation: fadeIn 0.18s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.ticket {
  width: 380px;
  background: var(--surface);
  border: 1px solid var(--border-2);
  border-radius: 20px;
  padding: 22px 22px 18px;
  animation: ticketIn 0.22s cubic-bezier(0.2, 0.8, 0.2, 1);
  box-shadow: 0 24px 60px rgba(0,0,0,0.6);
}
@keyframes ticketIn {
  from { transform: scale(0.96) translateY(6px); opacity: 0; }
  to { transform: scale(1) translateY(0); opacity: 1; }
}
.ticket-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 18px;
}
.ticket-eyebrow {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
  margin-bottom: 4px;
}
.ticket-title {
  font-size: 22px;
  letter-spacing: -0.02em;
  font-weight: 500;
  line-height: 1;
  display: flex; align-items: baseline; gap: 8px;
}
.ticket-close {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.ticket-close:hover { color: var(--fg); }

.ticket-meta-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 16px;
}
.ticket-meta-row b {
  color: var(--fg);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.ticket-field {
  margin-bottom: 14px;
}
.ticket-field-lbl {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
}
.lot-stepper {
  display: flex; align-items: stretch;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  height: 56px;
}
.lot-stepper button {
  width: 56px;
  background: transparent;
  border: 0;
  color: var(--fg);
  font-size: 22px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}
.lot-stepper button:hover { background: var(--surface-3); }
.lot-stepper button:disabled { color: var(--muted-3); cursor: not-allowed; }
.lot-stepper .lot-val {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 24px;
  font-weight: 500;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
  line-height: 1;
}
.lot-val small {
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-top: 4px;
  font-weight: 500;
}
.lot-quick {
  display: flex; gap: 6px; margin-top: 10px;
}
.lot-quick button {
  flex: 1;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 8px;
  padding: 8px 0;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  letter-spacing: 0.02em;
  transition: all 0.15s;
}
.lot-quick button:hover { color: var(--fg); border-color: var(--border-2); }
.lot-quick button.on {
  color: var(--fg);
  border-color: var(--border-3);
  background: var(--surface-3);
}

.ticket-summary {
  display: flex; flex-direction: column;
  gap: 7px;
  padding: 14px 14px;
  background: var(--surface-2);
  border-radius: 12px;
  margin-bottom: 16px;
  font-size: 13px;
}
.ticket-summary-row {
  display: flex; justify-content: space-between;
  color: var(--muted);
}
.ticket-summary-row b {
  color: var(--fg);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.ticket-summary-row.total {
  border-top: 1px solid var(--border);
  padding-top: 9px;
  margin-top: 2px;
  font-size: 14px;
}
.ticket-summary-row.total b {
  font-size: 18px;
  letter-spacing: -0.02em;
}

.ticket-actions {
  display: flex; gap: 8px;
}
.btn-primary {
  flex: 1;
  background: var(--up);
  color: #062;
  border: 0;
  border-radius: 12px;
  padding: 14px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  font-family: inherit;
  text-transform: uppercase;
  box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 6px 16px color-mix(in oklab, var(--up) 28%, transparent);
  transition: transform 0.1s;
}
.btn-primary:hover { transform: translateY(-1px); }
.btn-primary.pe { background: var(--down); color: #410; box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 6px 16px color-mix(in oklab, var(--down) 28%, transparent); }
.btn-ghost {
  background: var(--surface-2);
  border: 1px solid var(--border-2);
  color: var(--fg);
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}

/* ─────────── Positions tabs ─────────── */
.pos-tabs {
  display: flex;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 3px;
  font-size: 11px;
}
.pos-tab {
  background: transparent;
  border: 0;
  color: var(--muted);
  padding: 5px 10px;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.15s;
}
.pos-tab.on {
  background: var(--surface-3);
  color: var(--fg);
  box-shadow: 0 1px 0 rgba(255,255,255,0.06) inset;
}
.pos-tab .count {
  margin-left: 4px;
  color: var(--muted-2);
  font-variant-numeric: tabular-nums;
}
.pos-tab.on .count { color: var(--muted); }

.day-summary {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 0;
  padding: 12px 18px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.day-stat {
  border-right: 1px solid var(--border);
  padding-right: 12px;
}
.day-stat:last-child { border-right: 0; padding-right: 0; }
.day-stat-k {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
  margin-bottom: 4px;
}
.day-stat-v {
  font-size: 18px;
  letter-spacing: -0.02em;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
.day-stat-v.up { color: var(--up); }
.day-stat-v.down { color: var(--down); }
.day-stat-sub {
  font-size: 10px;
  color: var(--muted-2);
  margin-top: 2px;
  letter-spacing: 0.02em;
}

/* History rows */
.hist-list {
  display: flex; flex-direction: column;
  max-height: 320px;
  overflow-y: auto;
}
.hist-list::-webkit-scrollbar { width: 8px; }
.hist-list::-webkit-scrollbar-track { background: transparent; }
.hist-list::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

.hist-row {
  display: grid;
  grid-template-columns: 1fr 60px 80px 90px;
  gap: 10px;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.hist-row:last-child { border-bottom: 0; }
.hist-leg {
  display: flex; align-items: center; gap: 8px;
  font-weight: 500;
}
.hist-leg .time {
  font-size: 10px;
  color: var(--muted-2);
  letter-spacing: 0.04em;
  margin-top: 3px;
}
.hist-cell-k {
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-2);
  font-weight: 600;
  display: block;
  margin-bottom: 2px;
}
.hist-px {
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: -0.005em;
}
.hist-px b { color: var(--fg); font-weight: 500; font-size: 12px; display: block; }
.hist-pnl {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.hist-pnl.up { color: var(--up); }
.hist-pnl.down { color: var(--down); }
.hist-pnl small {
  display: block;
  font-size: 10px;
  margin-top: 2px;
  font-weight: 400;
  opacity: 0.75;
}
.toast-stack {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 200;
  display: flex; flex-direction: column-reverse;
  gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--surface-3);
  border: 1px solid var(--border-2);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 13px;
  min-width: 240px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.55);
  animation: toastIn 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: auto;
  display: flex; align-items: center; gap: 10px;
}
.toast.up { border-color: color-mix(in oklab, var(--up) 30%, var(--border-2)); }
.toast.down { border-color: color-mix(in oklab, var(--down) 30%, var(--border-2)); }
.toast .dot {
  width: 7px; height: 7px; border-radius: 99px; flex-shrink: 0;
}
.toast.up .dot { background: var(--up); }
.toast.down .dot { background: var(--down); }
.toast-body { flex: 1; }
.toast-body b { font-weight: 500; }
.toast-body small {
  display: block;
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
  letter-spacing: 0.02em;
}
@keyframes toastIn {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
