:root {
  --green: #22c55e;
  --amber: #f59e0b;
  --red:   #ef4444;
  --bg:    #0f172a;
  --surface: #1e293b;
  --border:  #334155;
  --text:    #e2e8f0;
  --muted:   #94a3b8;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Navbar ─────────────────────────────────────────────── */
.navbar {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.75rem 1.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.navbar-brand {
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}
.navbar-links { display: flex; gap: 1.25rem; }
.navbar-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
}
.navbar-links a:hover { color: var(--text); }

/* ── Navbar info strip (right side) ──────────────────────── */
.navbar-info-strip {
  margin-left: auto;
  display: flex;
  align-items: stretch;
}
.nav-stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-end;
  padding: 0.2rem 0.75rem;
  border-left: 1px solid var(--border);
  gap: 0.05rem;
}
.nav-stat-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  white-space: nowrap;
}
.nav-stat-value {
  font-size: 0.78rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.nav-stat-sub {
  font-size: 0.62rem;
  color: var(--muted);
  white-space: nowrap;
}
.mkt-open      { color: var(--green); }
.mkt-preopen   { color: var(--amber); }
.mkt-premarket { color: var(--amber); }
.mkt-closed    { color: var(--muted); }

/* ── Kill-switch banner ──────────────────────────────────── */
.kill-switch-banner {
  background: var(--red);
  color: #fff;
  text-align: center;
  padding: 0.5rem 1rem;
  font-weight: 600;
}

/* ── Layout ──────────────────────────────────────────────── */
.container {
  flex: 1;
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 1.25rem;
  width: 100%;
}

.page-title   { font-size: 1.5rem; margin-bottom: 0.25rem; }
.page-subtitle { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.75rem; }

/* ── Account grid ────────────────────────────────────────── */
.account-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 1rem;
  margin-bottom: 2rem;
}

.account-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.card-connected { border-color: var(--green); }
.card-pending   { border-color: var(--border); }

.card-name { font-weight: 600; font-size: 1rem; }
.card-id   { color: var(--muted); font-size: 0.8rem; font-family: monospace; }

/* ── Badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  font-size: 0.78rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-weight: 500;
}
.badge-connected { background: #14532d; color: var(--green); }
.badge-pending   { background: #292524; color: var(--amber); }

/* ── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 0.45rem 1rem;
  border-radius: 0.35rem;
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  border: none;
  margin-top: 0.25rem;
}
.btn-login   { background: #3b82f6; color: #fff; }
.btn-login:hover { background: #2563eb; }
.btn-logout  { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.btn-logout:hover { color: var(--red); border-color: var(--red); }
.btn-proceed { background: var(--green); color: #052e16; font-weight: 700; }
.btn-proceed:hover { opacity: 0.9; }

/* ── Proceed banner ──────────────────────────────────────── */
.proceed-banner {
  background: #052e16;
  border: 1px solid var(--green);
  border-radius: 0.5rem;
  padding: 1rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.expiry-today { color: var(--amber); }

/* ── Connected count badge (in page heading) ─────────────── */
.connected-count {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.15rem 0.65rem;
  margin-left: 0.75rem;
  vertical-align: middle;
  letter-spacing: 0.02em;
}
.connected-count.all-connected {
  color: var(--green);
  border-color: var(--green);
  background: #052e16;
}

/* ── Per-card auth metadata ──────────────────────────────── */
.card-auth-time,
.card-expiry-countdown {
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── Kill-switch panel (dashboard toggle) ────────────────── */
.ks-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.9rem 1.25rem;
  border-radius: 0.5rem;
  border: 1px solid var(--border);
  margin-top: 1.5rem;
}
.ks-panel-inactive {
  background: var(--surface);
  border-color: var(--border);
}
.ks-panel-active {
  background: #450a0a;
  border-color: var(--red);
}
.ks-panel-label {
  font-size: 0.9rem;
  font-weight: 500;
}
.ks-panel-inactive .ks-panel-label { color: var(--muted); }
.ks-panel-active  .ks-panel-label { color: var(--red); }

.btn-ks-stop { background: var(--red); color: #fff; }
.btn-ks-stop:hover { background: #dc2626; }
.btn-ks-lift { background: var(--surface); color: var(--green); border: 1px solid var(--green); }
.btn-ks-lift:hover { background: #052e16; }

/* ── Wide container (positions page) ─────────────────────── */
.container-wide {
  max-width: 1100px;
}

/* ── Positions Dashboard ─────────────────────────────────── */

/* ── Positions card grid: vertical stack ─────────────────── */
.positions-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

/* ── Individual account panel (dynamic height, flex column) ── */
.positions-panel {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.panel-connected { border-color: var(--green); }
.panel-pending   { border-color: var(--border); }

/* ── Panel header (pinned top) ───────────────────────────── */
.panel-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.7rem 0.9rem;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.panel-name { font-weight: 600; font-size: 0.9rem; }
.panel-id   { color: var(--muted); font-size: 0.75rem; font-family: monospace; flex: 1; min-width: 0; }

/* ── Not-connected fill ──────────────────────────────────── */
.panel-not-connected {
  padding: 1.5rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
}
.panel-not-connected a { color: #3b82f6; text-decoration: none; }
.panel-not-connected a:hover { text-decoration: underline; }

/* ── Error strip (pinned, above body) ────────────────────── */
.panel-error {
  flex-shrink: 0;
  padding: 0.45rem 0.9rem;
  background: #450a0a;
  color: var(--red);
  font-size: 0.75rem;
  border-bottom: 1px solid #7f1d1d;
}

/* ── Margin summary strip (pinned top) ───────────────────── */
.margins-summary {
  flex-shrink: 0;
  display: flex;
  border-bottom: 1px solid var(--border);
}
.margin-stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 0.5rem 0.65rem;
  gap: 0.1rem;
  border-right: 1px solid var(--border);
  min-width: 0;
}
.margin-stat:last-child { border-right: none; }
.margin-label {
  font-size: 0.58rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  white-space: nowrap;
}
.margin-value {
  font-size: 0.8rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.margin-pct {
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--muted);
  margin-left: 0.3rem;
}

/* ── Scrollable body (positions table) ───────────────────── */
/* max-height caps at ~5 rows (each row ≈45px) + sticky header (≈25px) */
.panel-body {
  overflow-y: auto;
  max-height: 260px;
}

.panel-empty {
  padding: 1.25rem 1rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
}

/* ── Positions table ─────────────────────────────────────── */
.positions-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}
.positions-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 0.35rem 0.6rem;
  text-align: left;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: #111c2e;
  white-space: nowrap;
}
.positions-table thead th.text-right { text-align: right; }
.positions-table td {
  padding: 0.4rem 0.6rem;
  border-bottom: 1px solid rgba(51,65,85,0.4);
  vertical-align: middle;
}
.positions-table tbody tr:last-child td { border-bottom: none; }

.text-right  { text-align: right; }
.text-left   { text-align: left; }
.text-center { text-align: center; }
.mono        { font-family: monospace; font-variant-numeric: tabular-nums; }

.pos-symbol  { font-family: monospace; font-size: 0.76rem; display: block; white-space: nowrap; }
.pos-exchange {
  display: block;
  font-size: 0.62rem;
  color: var(--muted);
  font-family: system-ui, sans-serif;
  margin-top: 0.1rem;
}

.qty-short    { color: var(--red); }
.qty-long     { color: var(--green); }
.pnl-positive { color: var(--green); }
.pnl-negative { color: var(--red); }

/* ── Net P&L footer (pinned bottom) ─────────────────────── */
.panel-footer-pnl {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.9rem;
  border-top: 1px solid var(--border);
  background: rgba(0,0,0,0.15);
}
.footer-pnl-label {
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.footer-pnl-value {
  font-size: 0.9rem;
  font-weight: 700;
}

/* ── Basket Builder ─────────────────────────────────────── */

/* Live spot bar */
.spot-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 0.65rem 1rem;
  margin-bottom: 1.25rem;
}
.spot-info { display: flex; align-items: baseline; gap: 0.6rem; }
.spot-label {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.spot-value {
  font-size: 1.15rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.spot-value.spot-error { color: var(--red); font-size: 0.85rem; font-weight: 400; }
.spot-time { font-size: 0.72rem; color: var(--muted); }

/* Form panel */
.basket-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  padding: 1.25rem 1.25rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.form-row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.form-label {
  flex: 0 0 140px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--muted);
  padding-top: 0.35rem;
}
.form-hint {
  font-size: 0.72rem;
  color: var(--muted);
  padding-top: 0.4rem;
  margin-left: 0.5rem;
}
.form-input {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 0.35rem;
  color: var(--text);
  font-size: 0.85rem;
  padding: 0.35rem 0.6rem;
}
.form-input:focus { outline: none; border-color: #3b82f6; }
.form-input-select { min-width: 220px; }
.form-input-sm { width: 80px; text-align: right; }

/* OTM band inputs */
.band-inputs { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.band-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  align-items: center;
}
.band-label { font-size: 0.65rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; }

/* Transaction type toggle */
.txn-toggle { display: flex; gap: 1rem; padding-top: 0.1rem; }
.txn-option {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  cursor: pointer;
}
.txn-option input[type="radio"] { accent-color: #3b82f6; }
.txn-sell-label { color: var(--red); }
.txn-buy-label  { color: var(--green); }

/* Form action row */
.form-actions { display: flex; align-items: center; gap: 1rem; padding-top: 0.25rem; }
.form-error { font-size: 0.8rem; color: var(--red); }

/* Generate button */
.btn-generate {
  background: #3b82f6;
  color: #fff;
  padding: 0.5rem 1.25rem;
  font-size: 0.88rem;
  font-weight: 600;
}
.btn-generate:hover { background: #2563eb; }
.btn-generate:disabled { opacity: 0.5; cursor: not-allowed; }

/* Small ghost button (refresh spot) */
.btn-sm { font-size: 0.78rem; padding: 0.3rem 0.75rem; }
.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}
.btn-ghost:hover { color: var(--text); border-color: var(--text); }

/* ── Basket output section ───────────────────────────────── */
.basket-output { margin-top: 0.5rem; }

.basket-summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem 0.5rem 0 0;
  border-bottom: none;
  font-size: 0.88rem;
}
.summary-spot   { font-weight: 700; font-variant-numeric: tabular-nums; }
.summary-expiry { color: var(--text); }
.summary-sep    { color: var(--border); }
.summary-lotsize { color: var(--muted); font-size: 0.8rem; }

/* Legs table */
.legs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  border: 1px solid var(--border);
  border-top: 2px solid var(--border);
}
.legs-table thead th {
  background: #111c2e;
  padding: 0.4rem 0.7rem;
  text-align: left;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.legs-table thead th.text-right { text-align: right; }
.legs-table td {
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid rgba(51,65,85,0.4);
  vertical-align: middle;
}
.legs-table tbody tr:last-child td { border-bottom: none; }
.leg-put  { background: rgba(239,68,68,0.03); }
.leg-call { background: rgba(34,197,94,0.03); }
.leg-num  { color: var(--muted); width: 2rem; }
.leg-symbol { font-size: 0.78rem; white-space: nowrap; }

/* Option type badge */
.opt-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  border-radius: 0.25rem;
  letter-spacing: 0.04em;
}
.opt-pe { background: rgba(239,68,68,0.15); color: var(--red); }
.opt-ce { background: rgba(34,197,94,0.15); color: var(--green); }

/* Transaction type badge */
.txn-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 0.25rem;
}
.txn-sell { background: rgba(239,68,68,0.15); color: var(--red); }
.txn-buy  { background: rgba(34,197,94,0.15); color: var(--green); }

/* Basket action bar */
.basket-actions {
  display: flex;
  justify-content: flex-end;
  padding: 0.85rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 0.5rem 0.5rem;
}

/* ── Option Chain ────────────────────────────────────────── */

.chain-topbar {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.chain-expiry-wrap {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.chain-expiry-label {
  flex: none;
  padding-top: 0;
  white-space: nowrap;
  margin: 0;
}
.chain-spot-inline {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
  margin-left: auto;
}

/* Basket strip — appears on first leg selection */
.basket-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.6rem 1rem;
  background: #052e16;
  border: 1px solid var(--green);
  border-radius: 0.5rem;
  margin-bottom: 1rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.strip-count {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--green);
}
.strip-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Chain table wrapper */
.chain-wrap { overflow-x: auto; margin-bottom: 1.5rem; }

.chain-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  white-space: nowrap;
}

/* Column headers */
.chain-table thead th {
  padding: 0.3rem 0.45rem;
  text-align: center;
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: #111c2e;
  white-space: nowrap;
}
.ce-col-header  { background: rgba(34,197,94,0.06); }
.pe-col-header  { background: rgba(239,68,68,0.06); }
.mid-col-header { background: #0d1628; }

/* Body cells */
.chain-table td {
  padding: 0.3rem 0.45rem;
  border-bottom: 1px solid rgba(51,65,85,0.25);
  vertical-align: middle;
}
.chain-table tbody tr:hover td { background: rgba(255,255,255,0.03) !important; }

/* Column tints */
.ce-col    { background: rgba(34,197,94,0.025); }
.pe-col    { background: rgba(239,68,68,0.025); }
.strike-col, .pct-col { background: #131f34; }

/* ATM row highlight */
.chain-table tbody tr.atm-row td {
  background: rgba(245,158,11,0.06) !important;
}
.chain-table tbody tr.atm-row .strike-col,
.chain-table tbody tr.atm-row .pct-col {
  background: rgba(245,158,11,0.1) !important;
  color: var(--amber);
  font-weight: 700;
}

/* Column sizing */
.col-oi     { min-width: 52px; }
.col-ltp    { min-width: 62px; }
.col-action { width: 34px; text-align: center; padding: 0.25rem 0.2rem; }
.col-strike { min-width: 68px; }
.col-pct    { min-width: 60px; font-size: 0.74rem; }

/* % distance colour */
.pct-pos { color: var(--green); }
.pct-neg { color: var(--red);   }

/* ITM cells — dim OI and LTP columns for in-the-money strikes */
td.itm-cell { color: #3d4f63 !important; }

/* Chain action buttons (S / B) */
.btn-chain-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 20px;
  border-radius: 0.25rem;
  font-size: 0.68rem;
  font-weight: 800;
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  transition: background 0.1s, border-color 0.1s, color 0.1s;
}
.btn-sell { border-color: rgba(239,68,68,0.35); color: rgba(239,68,68,0.7); }
.btn-sell:hover,
.btn-sell.active { background: rgba(239,68,68,0.2); border-color: var(--red); color: var(--red); }

.btn-buy  { border-color: rgba(34,197,94,0.35); color: rgba(34,197,94,0.7); }
.btn-buy:hover,
.btn-buy.active  { background: rgba(34,197,94,0.2); border-color: var(--green); color: var(--green); }

/* Stale / session-expired spot indicator */
.spot-stale { color: var(--amber) !important; }

/* Auth error link inside the chain error panel */
.chain-auth-link { color: var(--amber); font-weight: 600; text-decoration: underline; }
.chain-auth-link:hover { color: var(--text); }

/* Chain error panel */
.chain-error {
  padding: 0.75rem 1rem;
  background: rgba(239,68,68,0.08);
  border: 1px solid rgba(239,68,68,0.35);
  border-radius: 0.5rem;
  color: var(--red);
  font-size: 0.85rem;
  margin-bottom: 1rem;
}

/* Selected legs panel (below chain table) */
.chain-legs-panel { margin-top: 0.5rem; }
.chain-legs-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}
.chain-legs-title { font-size: 1rem; font-weight: 600; }

/* Remove-leg × button */
.btn-remove-leg {
  background: transparent;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1rem;
  padding: 0 0.3rem;
  line-height: 1;
}
.btn-remove-leg:hover { color: var(--red); }

/* ── Sizing Preview ──────────────────────────────────────── */
.sizing-basket-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  margin-bottom: 1.25rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.sizing-summary-text { font-size: 0.85rem; color: var(--muted); }
.sizing-back-link { flex-shrink: 0; }

.sizing-loading {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.sizing-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--border);
  border-top-color: var(--green);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Account panel */
.sizing-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 0.5rem;
  margin-bottom: 1.25rem;
  overflow: hidden;
}
.sizing-panel-dim { opacity: 0.6; }

.sizing-panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  gap: 1rem;
  flex-wrap: wrap;
}
.sizing-acct-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
}
/* Margin row: Available · Required · Utilisation */
.sizing-margin-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-wrap: wrap;
}
.sz-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  padding: 0 0.9rem;
  border-left: 1px solid var(--border);
}
.sz-stat:first-child { border-left: none; }
.sz-stat-muted .sz-val { color: var(--muted); }
.sz-label {
  font-size: 0.6rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
  line-height: 1.2;
}
.sz-val {
  font-family: monospace;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
}

.sizing-acct-error {
  padding: 0.65rem 1rem;
  color: var(--red);
  font-size: 0.85rem;
}
.sizing-acct-warning {
  padding: 0.5rem 1rem;
  background: rgba(245,158,11,0.08);
  border-bottom: 1px solid rgba(245,158,11,0.2);
  color: var(--amber);
  font-size: 0.82rem;
}

/* Legs table inside panel */
.sizing-legs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.sizing-legs-table thead th {
  padding: 0.3rem 0.75rem;
  text-align: left;
  font-size: 0.65rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  background: #111c2e;
  white-space: nowrap;
}
.sizing-legs-table thead th.text-right { text-align: right; }
.sizing-legs-table tbody tr:hover td { background: rgba(255,255,255,0.02); }
.sizing-legs-table td {
  padding: 0.35rem 0.75rem;
  border-bottom: 1px solid rgba(51,65,85,0.2);
  vertical-align: middle;
}

/* Quantity input */
.qty-input {
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 0.25rem;
  color: var(--text);
  font-family: monospace;
  font-size: 0.82rem;
  padding: 0.2rem 0.4rem;
  width: 76px;
  text-align: right;
}
.qty-input:focus {
  outline: none;
  border-color: var(--green);
}
.qty-input:disabled { opacity: 0.4; cursor: not-allowed; }

/* Recalculate row */
.sizing-recalc-row {
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--border);
  background: #111c2e;
}

/* Footer */
.sizing-footer {
  position: sticky;
  bottom: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding: 0.75rem 1rem;
  margin-top: 1rem;
  z-index: 10;
}
.sizing-footer-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.sizing-footer-note {
  font-size: 0.78rem;
  color: var(--muted);
}

/* ── Footer ──────────────────────────────────────────────── */
.footer {
  text-align: center;
  padding: 0.75rem;
  color: var(--muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--border);
}
