/* NavStak Mission v3 — mock-faithful Sterile Lab (light default)
   Target: operator mock — portrait list rows + landscape card grid
*/

:root {
  --st-bg: #eef3f8;
  --st-surface: rgba(255, 255, 255, 0.82);
  --st-surface-2: rgba(255, 255, 255, 0.94);
  --st-border: rgba(15, 40, 60, 0.08);
  --st-text: #0f1b2a;
  --st-muted: #5a6b7c;
  --st-accent: #00b89c;
  --st-accent-glow: rgba(0, 184, 156, 0.28);
  --st-danger: #e24b5a;
  --st-ok: #00b89c;
  --st-radius: 18px;
  --st-radius-sm: 14px;
  --st-font-display: Inter, system-ui, -apple-system, sans-serif;
  --st-font-body: Inter, system-ui, -apple-system, sans-serif;
  --st-bg-wash: linear-gradient(165deg, #f3f7fb 0%, #e8eef6 45%, #e4edf5 100%);
  --st-pad: clamp(0.85rem, 3.2vw, 1.35rem);
  --st-gap: 0.55rem;
  --st-shadow: 0 10px 30px rgba(15, 40, 80, 0.06);
}

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

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--st-font-body);
  color: var(--st-text);
  background-color: var(--st-bg);
  background-image: var(--st-bg-wash);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}

body.v3-shell {
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
}

a { color: var(--st-accent); text-decoration: none; }
button { font: inherit; cursor: pointer; }

.v3-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem var(--st-pad) 0.35rem;
  background: transparent;
  position: sticky;
  top: 0;
  z-index: 40;
}

.v3-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
}
.v3-brand-logo {
  width: 28px;
  height: 21px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
  border-radius: 3px;
  opacity: 0.95;
}
html[data-theme="dark"] .v3-brand-logo {
  /* soft blend on dark sterile chrome */
  filter: brightness(1.05) contrast(1.05);
  opacity: 0.92;
}
html[data-theme="light"] .v3-brand-logo {
  filter: none;
  opacity: 1;
}
.v3-brand-text {
  line-height: 1;
}

.v3-topbar-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.v3-icon-btn {
  position: relative;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  border: 1px solid var(--st-border);
  background: var(--st-surface);
  color: var(--st-text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--st-shadow);
  padding: 0;
}
/* Sterile portal SVGs ship light stroke (#E8ECF0) for dark chrome.
   Light theme → invert to dark ink. Dark theme → leave light. */
.v3-icon-btn img {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
  opacity: 0.92;
  filter: invert(1) brightness(0.22);
}
html[data-theme="dark"] .v3-icon-btn {
  background: color-mix(in srgb, var(--st-surface-2) 90%, #0a0a0a);
  border-color: color-mix(in srgb, var(--st-border) 75%, #6b7c95);
}
html[data-theme="dark"] .v3-icon-btn img {
  filter: none;
  opacity: 0.95;
}
.v3-icon-btn:hover {
  border-color: color-mix(in srgb, var(--st-accent) 45%, var(--st-border));
  color: var(--st-accent);
  background: color-mix(in srgb, var(--st-accent) 10%, var(--st-surface));
}
.v3-icon-btn:hover img { opacity: 1; }
.v3-avatar-btn {
  overflow: hidden;
}
.v3-badge-dot {
  position: absolute;
  top: -0.15rem;
  right: -0.15rem;
  min-width: 1rem;
  height: 1rem;
  padding: 0 0.25rem;
  border-radius: 999px;
  background: var(--st-danger, #e24b5a);
  color: #fff;
  font-size: 0.58rem;
  font-weight: 750;
  line-height: 1rem;
  text-align: center;
  pointer-events: none;
}

.v3-page {
  flex: 1;
  width: min(1100px, 100%);
  margin: 0 auto;
  padding: 0 var(--st-pad) calc(5rem + env(safe-area-inset-bottom, 0px));
}

.v3-kicker {
  margin: 0.15rem 0 0;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--st-muted);
}

.v3-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.75rem;
  margin: 0.2rem 0 0.15rem;
}

.v3-title {
  margin: 0;
  font-family: var(--st-font-display);
  font-size: clamp(1.55rem, 5vw, 1.85rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  color: var(--st-text);
}

.v3-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--st-accent) 30%, var(--st-border));
  background: color-mix(in srgb, var(--st-accent) 8%, var(--st-surface-2));
  color: var(--st-text);
  font-size: 0.58rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.v3-subline {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 1rem;
  margin: 0.15rem 0 0.85rem;
}

.v3-theme-label {
  margin: 0;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--st-muted);
}

.v3-preserve {
  margin: 0;
  font-size: 0.78rem;
  color: var(--st-muted);
  max-width: 16rem;
  line-height: 1.35;
}

/* Portrait = full-width stacked list rows (mock). Landscape 900+ = card grid. */
.v3-hub {
  display: flex;
  flex-direction: column;
  gap: var(--st-gap);
}

.v3-hub-tile {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  justify-items: stretch;
  gap: 0.65rem 0.75rem;
  width: 100%;
  text-align: left;
  padding: 0.85rem 0.95rem;
  border-radius: var(--st-radius);
  border: 1px solid var(--st-border);
  background: var(--st-surface);
  color: var(--st-text);
  box-shadow: var(--st-shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.v3-hub-tile:hover,
.v3-hub-tile:focus-visible {
  border-color: color-mix(in srgb, var(--st-accent) 35%, var(--st-border));
  box-shadow: 0 12px 32px var(--st-accent-glow);
  outline: none;
}

.v3-hub-body { min-width: 0; }

.v3-hub-title-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.v3-hub-title {
  margin: 0;
  font-weight: 700;
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

.v3-status {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.62rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--st-ok);
}

.v3-status::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  border-radius: 50%;
  background: var(--st-ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--st-ok) 22%, transparent);
}

.v3-status.is-off { color: var(--st-muted); }
.v3-status.is-off::before {
  background: #c5ced8;
  box-shadow: none;
}

.v3-hub-meta {
  margin: 0.28rem 0 0;
  color: var(--st-muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.v3-hub-meta strong {
  color: var(--st-text);
  font-weight: 650;
}

.v3-hub-viz {
  width: 3.6rem;
  height: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--st-accent);
  opacity: 0.9;
}

.v3-hub-viz svg {
  width: 100%;
  height: 100%;
  display: block;
}

.v3-hub-chev {
  color: color-mix(in srgb, var(--st-muted) 70%, transparent);
  font-size: 1.15rem;
  line-height: 1;
  padding-left: 0.15rem;
}

.v3-foot-note {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  margin: 1rem 0 0;
  padding: 0.65rem 0.15rem;
  color: var(--st-muted);
  font-size: 0.78rem;
  line-height: 1.4;
}

.v3-foot-note::before {
  content: "i";
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--st-accent) 35%, var(--st-border));
  color: var(--st-accent);
  font-size: 0.65rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0.1rem;
}

@media (min-width: 900px) {
  .v3-topbar { padding-top: 1.1rem; }
  .v3-hub {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.85rem;
  }
  .v3-hub-tile {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    align-items: stretch;
    min-height: 9.5rem;
    padding: 1rem 1.05rem 0.95rem;
  }
  .v3-hub-tile .v3-hub-chev { display: none; }
  .v3-hub-viz {
    width: 100%;
    height: 2.6rem;
    margin-top: 0.55rem;
    justify-content: flex-start;
  }
}

.v3-bottom {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem calc(0.55rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--st-border);
  background: color-mix(in srgb, var(--st-surface-2) 88%, transparent);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 40;
}

.v3-bottom a,
.v3-foot-btn {
  flex: 1;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  text-align: center;
  color: var(--st-muted);
  font-size: 0.78rem;
  font-weight: 650;
  padding: 0.45rem 0.35rem;
  border: none;
  background: transparent;
  border-radius: var(--st-radius-sm);
}
.v3-foot-ico {
  width: 1.1rem;
  height: 1.1rem;
  display: block;
  flex: 0 0 auto;
  color: inherit;
}
.v3-foot-ico svg {
  width: 100%;
  height: 100%;
  display: block;
  stroke: currentColor;
  fill: none;
}
.v3-foot-btn:hover,
.v3-foot-btn.is-on,
.v3-bottom a.is-on,
.v3-bottom a:hover {
  color: var(--st-accent);
  background: color-mix(in srgb, var(--st-accent) 8%, transparent);
}
.v3-foot-label { display: block; }
.v3-popup-body { padding: 0.35rem 0.15rem 0.75rem; }
.v3-popup-sm { width: min(400px, 100%); }
.v3-account-row {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 0.85rem;
}
.v3-inbox-item {
  padding: 0.65rem 0.75rem;
  border-radius: var(--st-radius-sm);
  border: 1px solid var(--st-border);
  background: var(--st-surface);
  margin-bottom: 0.4rem;
}
.v3-inbox-item strong { display: block; font-size: 0.88rem; }
.v3-inbox-item .v3-muted { margin: 0.2rem 0 0; font-size: 0.75rem; }

.v3-muted { color: var(--st-muted); font-size: 0.82rem; line-height: 1.45; }
.v3-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.35rem; padding: 0.45rem 0.75rem; border-radius: var(--st-radius-sm);
  border: 1px solid var(--st-border); background: var(--st-surface-2);
  color: var(--st-text); font-weight: 650; font-size: 0.8rem;
}
.v3-btn:hover { border-color: color-mix(in srgb, var(--st-accent) 40%, var(--st-border)); color: var(--st-accent); }
.v3-btn.ghost { background: transparent; }
.v3-input {
  width: 100%; margin: 0.5rem 0; padding: 0.55rem 0.75rem;
  border-radius: var(--st-radius-sm); border: 1px solid var(--st-border);
  background: var(--st-surface-2); color: var(--st-text); font: inherit;
}
.v3-seg { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.5rem 0 0.75rem; }
.v3-seg-btn {
  padding: 0.35rem 0.7rem; border-radius: 999px; border: 1px solid var(--st-border);
  background: transparent; color: var(--st-muted); font-size: 0.75rem; font-weight: 650;
}
.v3-seg-btn.is-on, .v3-seg-btn:hover {
  color: var(--st-accent);
  border-color: color-mix(in srgb, var(--st-accent) 40%, var(--st-border));
  background: color-mix(in srgb, var(--st-accent) 10%, transparent);
}
.v3-metric-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.65rem; margin-bottom: 0.85rem;
}
.v3-metric {
  padding: 0.75rem; border-radius: var(--st-radius-sm); border: 1px solid var(--st-border);
  background: var(--st-surface);
}
.v3-metric strong { display: block; margin-top: 0.25rem; font-size: 1.05rem; }
.v3-inline-actions { display: flex; flex-wrap: wrap; gap: 0.45rem; margin-top: 0.75rem; }
.v3-table-wrap {
  overflow: auto; max-height: min(60vh, 520px);
  border: 1px solid var(--st-border); border-radius: var(--st-radius-sm);
  background: var(--st-surface);
}
.v3-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.v3-table th, .v3-table td {
  padding: 0.45rem 0.55rem; border-bottom: 1px solid var(--st-border); text-align: left;
}
.v3-table th.num, .v3-table td.num { text-align: right; font-variant-numeric: tabular-nums; }
.v3-table th {
  color: var(--st-muted); font-weight: 650; position: sticky; top: 0;
  background: var(--st-surface-2);
}
.v3-pre {
  margin: 0; padding: 0.75rem; overflow: auto; max-height: 50vh;
  border-radius: var(--st-radius-sm); border: 1px solid var(--st-border);
  background: var(--st-surface); font-size: 0.72rem; color: var(--st-muted);
}

/* CRITICAL: author display:flex must not override HTML hidden */
[hidden],
.v3-sheet-layer[hidden],
.v3-sheet[hidden],
.v3-popup-layer[hidden],
[data-focus-panel][hidden] {
  display: none !important;
}

#v3-hub-wrap.is-dimmed { opacity: 0.35; pointer-events: none; filter: saturate(0.7); }
.v3-sheet-layer {
  position: fixed; inset: 0; z-index: 70;
  display: flex; flex-direction: column; justify-content: flex-end;
}
.v3-sheet-backdrop { position: absolute; inset: 0; background: rgba(15, 27, 42, 0.35); }
.v3-sheet {
  position: relative; z-index: 1; max-height: min(92dvh, 900px);
  margin: 0 auto; width: min(720px, 100%);
  border-radius: var(--st-radius) var(--st-radius) 0 0;
  border: 1px solid var(--st-border); border-bottom: none;
  background: var(--st-surface-2);
  display: none;
  flex-direction: column;
  box-shadow: 0 -12px 40px rgba(15, 40, 80, 0.12);
}
.v3-sheet.is-on {
  display: flex;
}
@media (min-width: 900px) {
  .v3-sheet-layer { justify-content: center; padding: 1.5rem; }
  .v3-sheet.is-on {
    border-radius: var(--st-radius); border-bottom: 1px solid var(--st-border);
    max-height: min(85vh, 860px);
  }
}
.v3-sheet-head {
  display: flex; align-items: center; gap: 0.65rem;
  padding: 0.75rem 1rem; border-bottom: 1px solid var(--st-border);
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--st-surface-2);
  /* keep Back above any scrolled sheet content */
  flex-shrink: 0;
}
.v3-sheet-head h2 { margin: 0; flex: 1; font-size: 1.05rem; }
.v3-sheet-body { padding: 0.85rem 1rem 1.25rem; overflow: auto; }

.v3-popup-layer {
  position: fixed; inset: 0; z-index: 70;
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 900px) {
  .v3-popup-layer { align-items: center; }
}
.v3-popup {
  position: relative; z-index: 1; width: min(520px, 100%);
  max-height: min(80dvh, 640px); overflow: auto;
  margin: 0; padding: 0.5rem 1rem 1rem;
  border-radius: var(--st-radius) var(--st-radius) 0 0;
  border: 1px solid var(--st-border);
  background: var(--st-surface-2);
  box-shadow: 0 16px 48px rgba(15, 40, 80, 0.18);
}
@media (min-width: 900px) {
  .v3-popup { border-radius: var(--st-radius); }
}
.v3-seats-list { display: flex; flex-direction: column; gap: 0.35rem; }
.v3-seat-row {
  display: flex; justify-content: space-between; gap: 0.75rem;
  padding: 0.55rem 0.65rem; border-radius: var(--st-radius-sm);
  border: 1px solid var(--st-border); background: var(--st-surface);
  font-size: 0.85rem;
}
body.v3-sheet-open { overflow: hidden; }
.v3-scaffold-banner { display: none; }

/* Phase 3 content mount */
.v3-pos { color: var(--st-ok, #00b89c); }
.v3-neg { color: var(--st-danger, #e24b5a); }
.v3-row-focus td { background: color-mix(in srgb, var(--st-accent) 8%, transparent); }
.v3-continuity {
  margin-top: 0.85rem;
  padding: 0.65rem 0.75rem;
  border-radius: var(--st-radius-sm);
  border: 1px dashed var(--st-border);
  background: var(--st-surface);
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  font-size: 0.78rem;
}
.v3-spark-wrap {
  margin: 0.5rem 0 0.75rem;
  padding: 0.5rem;
  border-radius: var(--st-radius-sm);
  border: 1px solid var(--st-border);
  background: var(--st-surface);
  color: var(--st-accent);
}
.v3-spark { display: block; }

/* ——— Market board module (content-first) ——— */
.v3-market-module {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 0;
  flex: 1;
}
.v3-board-chrome {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  flex: 0 0 auto;
}
.v3-market-meta {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
}
.v3-table-scroll {
  flex: 1 1 auto;
  min-height: 12rem;
  max-height: min(62vh, 560px);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  -webkit-overflow-scrolling: touch;
}
.v3-board-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0;
  font-size: 0.74rem;
}
.v3-board-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: color-mix(in srgb, var(--st-surface-2) 92%, var(--st-surface));
  border-bottom: 1px solid var(--st-border);
  padding: 0.32rem 0.28rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--st-muted);
  white-space: nowrap;
  overflow: visible;
}
.v3-board-table td {
  padding: 0.34rem 0.28rem;
  border-bottom: 1px solid color-mix(in srgb, var(--st-border) 70%, transparent);
  vertical-align: middle;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
}
/* Column band widths — Pair | Mark | Chg | Bias | Vol */
.v3-board-table th:nth-child(1),
.v3-board-table td:nth-child(1) { width: 34%; }
.v3-board-table th:nth-child(2),
.v3-board-table td:nth-child(2) { width: 16%; }
.v3-board-table th:nth-child(3),
.v3-board-table td:nth-child(3) { width: 22%; }
.v3-board-table th:nth-child(4),
.v3-board-table td:nth-child(4) { width: 12%; }
.v3-board-table th:nth-child(5),
.v3-board-table td:nth-child(5) { width: 16%; }
.v3-board-table tr.is-focus {
  background: color-mix(in srgb, var(--st-accent) 10%, transparent);
}
.v3-board-table tr.is-authority {
  box-shadow: inset 3px 0 0 var(--st-ok, #2db87a);
}
.v3-board-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.v3-pair {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}
.v3-coin {
  width: 1rem;
  height: 1rem;
  border-radius: 50%;
  flex: 0 0 auto;
}
.v3-pair-text {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-start;
  gap: 0.28rem;
  min-width: 0;
  max-width: 100%;
}
.v3-pair-text strong {
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: nowrap;
  flex: 0 0 auto;
}
.v3-sym { font-size: 0.65rem; }
.v3-chips {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.2rem;
  flex-wrap: nowrap;
  align-items: center;
  overflow: visible;
}
.v3-chip {
  display: inline-block;
  padding: 0.08rem 0.32rem;
  border-radius: 999px;
  font-size: 0.56rem;
  font-weight: 750;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  border: 1px solid var(--st-border);
  color: var(--st-muted);
  line-height: 1.15;
  background: var(--st-surface);
}
.v3-chip.is-focus {
  color: var(--st-accent);
  border-color: color-mix(in srgb, var(--st-accent) 45%, var(--st-border));
  background: color-mix(in srgb, var(--st-accent) 12%, transparent);
}
.v3-chip.is-armed {
  color: var(--st-ok, #2db87a);
  border-color: color-mix(in srgb, var(--st-ok, #2db87a) 40%, var(--st-border));
}
.v3-chip.is-deck { color: var(--st-muted); }
.v3-pos { color: var(--st-ok, #2db87a); font-weight: 700; }
.v3-neg { color: var(--st-danger, #e24b5a); font-weight: 700; }
.v3-gate {
  display: inline-block;
  padding: 0.1rem 0.35rem;
  border-radius: 0.35rem;
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.02em;
}
.v3-gate.is-allow {
  color: var(--st-ok, #2db87a);
  background: color-mix(in srgb, var(--st-ok, #2db87a) 14%, transparent);
}
.v3-gate.is-block {
  color: var(--st-danger, #e24b5a);
  background: color-mix(in srgb, var(--st-danger, #e24b5a) 12%, transparent);
}
.v3-gate.is-soft {
  color: var(--st-muted);
  background: color-mix(in srgb, var(--st-border) 35%, transparent);
}
.v3-board-table tr[data-symbol] { cursor: pointer; }
.v3-board-table tr[data-symbol]:active { background: color-mix(in srgb, var(--st-accent) 14%, transparent); }

/* ——— Focus module ——— */
.v3-focus-module { display: flex; flex-direction: column; gap: 0.65rem; }
.v3-focus-panel { min-height: 4rem; }
.v3-focus-head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.55rem;
}
.v3-focus-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  flex: 0 0 auto;
}
.v3-focus-id { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; flex: 1; }
.v3-focus-name { font-size: 1.05rem; }
.v3-focus-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.1rem;
  font-variant-numeric: tabular-nums;
}
.v3-focus-chart {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  padding: 0.45rem 0.5rem 0.25rem;
  margin-bottom: 0.55rem;
}
.v3-focus-chart-cap { margin: 0.2rem 0 0; font-size: 0.68rem; }
.v3-spark-empty { padding: 1rem 0.5rem; text-align: center; }
.v3-focus-meta { margin: 0.5rem 0 0; font-size: 0.72rem; }
.v3-focus-meta a { color: var(--st-accent); }
.v3-news-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}
.v3-news-list li {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid color-mix(in srgb, var(--st-border) 70%, transparent);
}
.v3-news-list a {
  color: var(--st-text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.86rem;
  line-height: 1.35;
}
.v3-news-list a:hover { color: var(--st-accent); }

/* Focus candlestick + tools */
.v3-focus-toolbar { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 0.45rem; }
.v3-focus-ranges, .v3-focus-toolrow { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.v3-chip-btn {
  border: 1px solid var(--st-border);
  background: var(--st-elevated);
  color: var(--st-muted);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  font-size: 0.68rem;
  font-weight: 600;
  cursor: pointer;
}
.v3-chip-btn.is-on {
  color: var(--st-text);
  border-color: color-mix(in srgb, var(--st-accent) 55%, var(--st-border));
  background: color-mix(in srgb, var(--st-accent) 18%, var(--st-elevated));
}
.v3-focus-chart-wrap {
  position: relative;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  height: 280px;
  margin-bottom: 0.55rem;
  overflow: hidden;
}
.v3-focus-chart-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}
.v3-focus-chart-wrap .v3-spark-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

/* Long vs short gauge */
.v3-ls-gauge { margin-bottom: 0.65rem; }
.v3-ls-gauge.is-empty { opacity: 0.7; }
.v3-ls-labels {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.v3-ls-track {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--st-elevated);
  border: 1px solid var(--st-border);
}
.v3-ls-long { background: #2db87a; height: 100%; }
.v3-ls-short { background: #e24b5a; height: 100%; }
.v3-liq-chart-wrap {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  height: 240px;
  overflow: hidden;
}
.v3-liq-chart-canvas { width: 100%; height: 100%; display: block; }

.v3-tool-lab {
  font-size: 0.65rem;
  align-self: center;
  margin-right: 0.15rem;
}
.v3-focus-chart-wrap {
  height: 300px;
}
.v3-focus-crosshair-hud {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 2;
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.45rem 0.65rem;
  padding: 0.2rem 0.4rem;
  font-size: 0.68rem;
  line-height: 1.2;
  background: transparent;
  border: none;
  backdrop-filter: none;
  pointer-events: none;
  overflow: hidden;
  white-space: nowrap;
  text-shadow:
    0 0 3px var(--st-surface),
    0 0 6px var(--st-surface),
    0 1px 2px var(--st-surface);
}
.v3-focus-crosshair-hud[hidden] { display: none !important; }
.v3-focus-crosshair-hud strong {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.v3-ch-time {
  color: var(--st-muted);
  margin-right: 0.2rem;
}

/* Under-chart production-style tool strip */
.v3-focus-ranges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.4rem;
}
.v3-focus-toolbar--under {
  margin-top: 0.45rem;
  margin-bottom: 0.55rem;
}
.v3-fct-strip {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.28rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem 0.15rem 0.45rem;
  scrollbar-width: thin;
}
.v3-fct-k {
  flex: 0 0 auto;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--st-muted);
  padding: 0 0.15rem;
}
.v3-fct-chips {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.22rem;
  flex: 0 0 auto;
}
.v3-fct-sep {
  flex: 0 0 1px;
  align-self: stretch;
  width: 1px;
  min-height: 1.4rem;
  background: color-mix(in srgb, var(--st-border) 80%, transparent);
  margin: 0 0.2rem;
}
.v3-focus-toolbar--under .v3-chip-btn {
  min-width: 2rem;
  min-height: 2rem;
  padding: 0.28rem 0.48rem;
  font-size: 0.7rem;
  touch-action: manipulation;
}
.v3-chip-ghost {
  opacity: 0.75;
}

.v3-focus-crosshair-hud {
  background: color-mix(in srgb, var(--st-surface) 92%, #22d3ee 8%);
  border-bottom: 1px solid color-mix(in srgb, #22d3ee 45%, var(--st-border));
  color: var(--st-text);
  font-weight: 500;
}
.v3-focus-crosshair-hud strong {
  color: #22d3ee;
}
html[data-theme="light"] .v3-focus-crosshair-hud strong {
  color: #0e7490;
}

/* Compact coin metrics above chart — one line + link row */
.v3-focus-stats {
  margin: 0.15rem 0 0.4rem;
  padding: 0.3rem 0.4rem;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-elevated);
  font-size: 0.72rem;
}
.v3-focus-stats-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: baseline;
  gap: 0.45rem 0.6rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  white-space: nowrap;
  scrollbar-width: none;
}
.v3-focus-stats-row::-webkit-scrollbar { display: none; }
.v3-fstat {
  display: inline-flex;
  align-items: baseline;
  gap: 0.2rem;
  white-space: nowrap;
  flex: 0 0 auto;
}
.v3-fstat em {
  font-style: normal;
  color: var(--st-muted);
  font-weight: 600;
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.v3-fstat strong {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.v3-fstat-link {
  margin-left: auto;
  color: var(--st-accent, #2db87a);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.85rem;
  line-height: 1;
  padding: 0.1rem 0.2rem;
  flex: 0 0 auto;
}
.v3-focus-head {
  margin-bottom: 0.35rem;
}
.v3-focus-icon {
  width: 2rem;
  height: 2rem;
}

/* Landscape: wider Focus sheet + taller chart */
@media (orientation: landscape) {
  .v3-sheet-layer:has(.v3-sheet.is-on[data-sheet="focus"]) {
    justify-content: center;
    align-items: stretch;
    padding: 0.4rem 0.5rem;
  }
  .v3-sheet.is-on[data-sheet="focus"] {
    width: min(98vw, 1200px);
    max-width: 98vw;
    max-height: min(98dvh, 920px);
    border-radius: var(--st-radius);
    border-bottom: 1px solid var(--st-border);
    margin: 0 auto;
  }
  .v3-sheet.is-on[data-sheet="focus"] .v3-sheet-body {
    padding: 0.55rem 0.75rem 0.85rem;
  }
  .v3-sheet.is-on[data-sheet="focus"] .v3-focus-chart-wrap {
    height: min(62dvh, 440px);
  }
  .v3-sheet.is-on[data-sheet="focus"] .v3-liq-chart-wrap {
    height: min(55dvh, 360px);
  }
}

/* Short landscape phones — prioritize chart height */
@media (orientation: landscape) and (max-height: 500px) {
  .v3-sheet.is-on[data-sheet="focus"] .v3-focus-chart-wrap {
    height: min(70dvh, 320px);
  }
  .v3-sheet.is-on[data-sheet="focus"] .v3-sheet-head {
    padding: 0.4rem 0.75rem;
  }
  .v3-sheet.is-on[data-sheet="focus"] .v3-focus-stats {
    margin: 0.1rem 0 0.25rem;
    padding: 0.2rem 0.35rem;
  }
}

/* Focus · Liquidations metrics */
.v3-liq-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.75rem;
  margin-bottom: 0.45rem;
}
.v3-liq-ranges { display: flex; gap: 0.28rem; }
.v3-liq-venues { font-size: 0.68rem; }
.v3-liq-metrics {
  margin: 0.45rem 0 0.55rem;
  padding: 0.4rem 0.5rem;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-elevated);
}
.v3-liq-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--st-muted);
}
.v3-liq-mgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem 0.45rem;
}
@media (max-width: 420px) {
  .v3-liq-mgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.v3-liq-m {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.v3-liq-m em {
  font-style: normal;
  font-size: 0.58rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--st-muted);
}
.v3-liq-m b {
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v3-liq-note {
  margin: 0.4rem 0 0;
  font-size: 0.65rem;
}
.v3-liq-chart-wrap {
  width: 100%;
  height: 240px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  overflow: hidden;
  background: var(--st-surface);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}
.v3-liq-chart-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.v3-liq-timeline-wrap {
  height: 160px;
  margin-top: 0.55rem;
}
.v3-maxpain {
  margin: 0.55rem 0 0.35rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-elevated);
}
.v3-maxpain.is-empty {
  opacity: 0.85;
}
.v3-maxpain-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin: 0.25rem 0;
  font-size: 0.78rem;
}
.v3-maxpain-px {
  font-variant-numeric: tabular-nums;
  color: var(--st-accent, #2db87a);
  font-size: 0.95rem;
}

.v3-liq-tip {
  position: fixed;
  z-index: 120;
  max-width: min(240px, 92vw);
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  border: 1px solid var(--st-border);
  background: color-mix(in srgb, var(--st-surface) 94%, var(--st-elevated));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22);
  font-size: 0.74rem;
  line-height: 1.4;
  pointer-events: none;
  color: var(--st-text);
  user-select: none;
}
.v3-liq-tip[hidden] { display: none !important; }
.v3-liq-tip strong { font-variant-numeric: tabular-nums; }
#v3-liq-chart,
#v3-liq-timeline {
  touch-action: none;
}

/* Focus · Reports workflow */
.v3-rep {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.v3-rep-card {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-elevated);
  padding: 0.65rem 0.75rem;
}
.v3-rep-card h4 {
  margin: 0 0 0.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.v3-rep-hint {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  line-height: 1.35;
}
.v3-rep-verdict.tone-ok {
  border-color: color-mix(in srgb, #10b981 45%, var(--st-border));
}
.v3-rep-verdict.tone-bad {
  border-color: color-mix(in srgb, #ef4444 45%, var(--st-border));
}
.v3-rep-verdict.tone-warn {
  border-color: color-mix(in srgb, #f59e0b 40%, var(--st-border));
}
.v3-rep-verdict-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 0.75rem;
  align-items: baseline;
  margin: 0.25rem 0;
}
.v3-rep-gate {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}
.v3-rep-blurb {
  margin: 0.35rem 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: var(--st-muted, inherit);
}
.v3-rep-reasons {
  margin: 0.2rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.78rem;
  line-height: 1.45;
}
.v3-rep-reasons li {
  margin: 0.2rem 0;
}
.v3-rep-factors {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.v3-rep-factor-lab {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  margin-bottom: 0.15rem;
}
.v3-rep-bar {
  height: 7px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--st-border) 80%, transparent);
  overflow: hidden;
}
.v3-rep-bar > i {
  display: block;
  height: 100%;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, #38bdf8 70%, transparent),
    color-mix(in srgb, #34d399 80%, transparent)
  );
}
.v3-rep-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.v3-rep-pill {
  font-size: 0.68rem;
  font-weight: 650;
  padding: 0.2rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--st-border);
  color: var(--st-muted, #94a3b8);
  opacity: 0.75;
}
.v3-rep-pill.is-on {
  opacity: 1;
  color: var(--st-text);
  border-color: color-mix(in srgb, #34d399 50%, var(--st-border));
  background: color-mix(in srgb, #34d399 12%, transparent);
}
.v3-rep-steps {
  margin: 0.25rem 0 0.5rem;
  padding-left: 1.15rem;
  font-size: 0.78rem;
  line-height: 1.45;
}
.v3-rep-steps li {
  margin: 0.25rem 0;
}
.v3-rep-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.v3-rep-gen-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin: 0.45rem 0;
}
@media (max-width: 640px) {
  .v3-rep-gen-grid { grid-template-columns: 1fr; }
}
.v3-rep-gen-btn {
  text-align: left;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  color: var(--st-text);
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.v3-rep-gen-btn:hover {
  border-color: color-mix(in srgb, #38bdf8 50%, var(--st-border));
  background: color-mix(in srgb, #38bdf8 8%, var(--st-surface));
}
.v3-rep-gen-btn strong {
  font-size: 0.88rem;
}
.v3-rep-gen-btn span {
  font-size: 0.72rem;
  color: var(--st-muted, #94a3b8);
  line-height: 1.35;
}
.v3-rep-generated {
  margin-top: 0.55rem;
}
.v3-rep-gen-head h4 {
  margin: 0 0 0.2rem;
}
.v3-rep-md {
  margin-top: 0.5rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  font-size: 0.8rem;
  line-height: 1.45;
  max-height: 28rem;
  overflow: auto;
}
.v3-rep-md h3,
.v3-rep-md h4,
.v3-rep-md h5 {
  margin: 0.75rem 0 0.35rem;
  line-height: 1.3;
}
.v3-rep-md h3 { font-size: 1rem; }
.v3-rep-md h4 { font-size: 0.9rem; }
.v3-rep-md h5 { font-size: 0.82rem; }
.v3-rep-md p {
  margin: 0.35rem 0;
}
.v3-rep-md ul,
.v3-rep-md ol {
  margin: 0.3rem 0 0.5rem;
  padding-left: 1.15rem;
}
.v3-rep-md-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  margin: 0.4rem 0 0.6rem;
}
.v3-rep-md-table th,
.v3-rep-md-table td {
  border: 1px solid var(--st-border);
  padding: 0.28rem 0.4rem;
  text-align: left;
}
.v3-rep-md-table th {
  background: color-mix(in srgb, var(--st-elevated) 80%, transparent);
  font-weight: 650;
}

.v3-rep-oi-comps {
  margin-top: 0.55rem;
}
.v3-rep-oi-comps > .v3-muted {
  display: block;
  font-size: 0.72rem;
  margin-bottom: 0.3rem;
}

.v3-rep-gen-grid {
  grid-template-columns: 1fr 1fr;
}
.v3-rep-gen-expert {
  grid-column: 1 / -1;
  border-color: color-mix(in srgb, #a78bfa 40%, var(--st-border));
}
.v3-rep-gen-expert:hover {
  border-color: color-mix(in srgb, #a78bfa 65%, var(--st-border));
  background: color-mix(in srgb, #a78bfa 10%, var(--st-surface));
}

.v3-rep-life {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  line-height: 1.4;
  color: var(--st-muted, #94a3b8);
}

/* Focus report: discourage casual copy-paste; PDF is the share artifact */
.v3-rep-md-protected {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}
.v3-rep-dl-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.75rem;
  margin-top: 0.45rem;
}
.v3-rep-dl {
  text-decoration: none;
}
.v3-rep-dl-note {
  font-size: 0.7rem;
  line-height: 1.3;
}

/* Focus · Social */
.v3-soc {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.v3-soc-scores {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}
@media (max-width: 520px) {
  .v3-soc-scores { grid-template-columns: 1fr; }
}
.v3-soc-score {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-elevated);
  padding: 0.65rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}
.v3-soc-score strong {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}
.v3-soc-score.tone-ok strong { color: #34d399; }
.v3-soc-score.tone-bad strong { color: #f87171; }
.v3-soc-score.tone-warn strong { color: #fbbf24; }
.v3-soc-note {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
}
.v3-soc-section h4 {
  margin: 0 0 0.25rem;
  font-size: 0.85rem;
  font-weight: 700;
}
.v3-soc-inf {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.v3-soc-feed {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-top: 0.35rem;
}
.v3-soc-card {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  padding: 0.55rem 0.65rem;
}
.v3-soc-card-meta {
  font-size: 0.72rem;
  margin-bottom: 0.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.35rem;
  align-items: baseline;
}
.v3-soc-card-text {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  line-height: 1.4;
}
.v3-soc-card-link {
  font-size: 0.72rem;
  font-weight: 650;
  color: #38bdf8;
  text-decoration: none;
}
.v3-soc-card-link:hover { text-decoration: underline; }
.v3-soc-follow-form {
  display: flex;
  gap: 0.4rem;
  margin: 0.4rem 0;
}
.v3-soc-follow-form input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  color: var(--st-text);
  padding: 0.4rem 0.55rem;
  font-size: 0.85rem;
}
.v3-soc-follow-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.45rem;
}

.v3-soc-card.is-pin {
  border-color: color-mix(in srgb, #38bdf8 35%, var(--st-border));
  background: color-mix(in srgb, #38bdf8 6%, var(--st-surface));
}
.v3-soc-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #7dd3fc;
  margin-bottom: 0.25rem;
}

.v3-soc-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0.15rem;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-elevated);
  width: fit-content;
  max-width: 100%;
}
.v3-soc-tab {
  border: none;
  background: transparent;
  color: var(--st-muted, #94a3b8);
  font-size: 0.8rem;
  font-weight: 650;
  padding: 0.4rem 0.85rem;
  border-radius: calc(var(--st-radius-sm) - 2px);
  cursor: pointer;
}
.v3-soc-tab:hover {
  color: var(--st-text);
}
.v3-soc-tab.is-on {
  background: color-mix(in srgb, #38bdf8 18%, var(--st-surface));
  color: var(--st-text);
}

.v3-news-list-rich {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.v3-news-row {
  margin: 0;
}
.v3-news-link {
  display: flex;
  gap: 0.65rem;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  padding: 0.45rem 0.55rem;
}
.v3-news-link:hover {
  border-color: color-mix(in srgb, #38bdf8 35%, var(--st-border));
}
.v3-news-thumb {
  width: 72px;
  height: 54px;
  object-fit: cover;
  border-radius: 4px;
  flex-shrink: 0;
  background: var(--st-elevated);
}
.v3-news-thumb-empty {
  width: 72px;
  height: 54px;
  border-radius: 4px;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--st-border) 50%, var(--st-elevated));
}
.v3-news-body {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.v3-news-title {
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.35;
}
.v3-news-src {
  font-size: 0.7rem;
}


/* Footer Focus: logo + name */
.v3-foot-focus-prefix {
  margin-right: 0.25rem;
  opacity: 0.85;
}
#v3-foot-focus-label {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  max-width: 100%;
}
#v3-foot-focus-asset {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  min-width: 0;
  font-weight: 700;
}
.v3-foot-focus-icon {
  width: 16px;
  height: 16px;
  border-radius: 3px;
  object-fit: cover;
  flex-shrink: 0;
}
.v3-foot-focus-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 9.5rem;
}


/* Autopilot desk */
.v3-auto {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.v3-auto-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-elevated);
  padding: 0.65rem 0.85rem;
}
.v3-auto-status.is-engaged {
  border-color: color-mix(in srgb, #14b8a6 40%, var(--st-border));
  background: color-mix(in srgb, #14b8a6 8%, var(--st-elevated));
}
.v3-auto-status.is-standby {
  border-color: var(--st-border);
}
.v3-auto-status-copy {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}
.v3-auto-status-title {
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--st-text);
}
.v3-auto-status.is-engaged .v3-auto-status-title {
  color: #14b8a6;
}
.v3-auto-status-detail {
  font-size: 0.78rem;
  color: var(--st-muted);
  line-height: 1.35;
}
.v3-auto-status-radar {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--st-muted) 35%, transparent);
  display: grid;
  place-items: center;
}
.v3-auto-status.is-standby .v3-auto-status-radar {
  opacity: 0.45;
}
.v3-radar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--st-muted);
  z-index: 1;
}
.v3-auto-status.is-engaged .v3-radar-dot {
  background: #14b8a6;
  box-shadow: 0 0 0 3px color-mix(in srgb, #14b8a6 25%, transparent);
}
.v3-radar-ring {
  position: absolute;
  inset: 4px;
  border-radius: 50%;
  border: 1.5px solid color-mix(in srgb, var(--st-muted) 30%, transparent);
  opacity: 0;
}
.v3-auto-status.is-engaged .v3-radar-ring {
  border-color: color-mix(in srgb, #14b8a6 55%, transparent);
  animation: v3-radar-pulse 2.2s ease-out infinite;
}
.v3-auto-status.is-engaged .v3-radar-ring:nth-child(2) {
  animation-delay: 1.1s;
}
@keyframes v3-radar-pulse {
  0% { transform: scale(0.55); opacity: 0.7; }
  70% { opacity: 0.15; }
  100% { transform: scale(1.15); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .v3-auto-status.is-engaged .v3-radar-ring { animation: none; opacity: 0.35; }
}
.v3-auto-status-main {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.35rem;
}
.v3-auto-pill {
  display: inline-flex;
  align-items: center;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--st-border);
}
.v3-auto-pill.is-on {
  color: #4ade80;
  border-color: color-mix(in srgb, #4ade80 40%, var(--st-border));
  background: color-mix(in srgb, #4ade80 12%, transparent);
}
.v3-auto-pill.is-off {
  color: var(--st-muted);
}
.v3-auto-focus {
  margin: 0;
  font-size: 0.82rem;
}
.v3-auto-controls {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-elevated);
  padding: 0.85rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.v3-auto-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--st-muted);
  margin-bottom: 0.3rem;
}
.v3-select {
  width: 100%;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  color: var(--st-text);
  padding: 0.5rem 0.65rem;
  font-size: 0.88rem;
}
.v3-auto-tip {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  line-height: 1.35;
}
.v3-auto-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.15rem;
}
.v3-btn-primary {
  background: color-mix(in srgb, #38bdf8 22%, var(--st-surface));
  border-color: color-mix(in srgb, #38bdf8 45%, var(--st-border));
  font-weight: 700;
}
.v3-btn-danger {
  background: color-mix(in srgb, #f87171 14%, var(--st-surface));
  border-color: color-mix(in srgb, #f87171 40%, var(--st-border));
  font-weight: 700;
}
.v3-auto-note {
  min-height: 1.1em;
  margin: 0;
  font-size: 0.78rem;
}


/* Autopilot desk v2 */
.v3-auto-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  padding: 0.65rem 0.85rem;
}
.v3-auto-head-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}
.v3-auto-head-actions {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}
.v3-btn-arm {
  background: color-mix(in srgb, #f59e0b 22%, var(--st-surface));
  border-color: color-mix(in srgb, #f59e0b 50%, var(--st-border));
  color: #b45309;
  font-weight: 700;
}
.v3-btn-disarm {
  background: color-mix(in srgb, #ef4444 18%, var(--st-surface));
  border-color: color-mix(in srgb, #ef4444 48%, var(--st-border));
  color: #b91c1c;
  font-weight: 700;
}
.v3-btn-restart {
  background: color-mix(in srgb, #fb923c 16%, var(--st-surface));
  border-color: color-mix(in srgb, #fb923c 42%, var(--st-border));
  color: #c2410c;
  font-weight: 650;
}
.v3-btn-apply {
  background: color-mix(in srgb, #14b8a6 18%, var(--st-surface));
  border-color: color-mix(in srgb, #14b8a6 45%, var(--st-border));
  color: #0f766e;
  font-weight: 700;
}
/* Dark: lighter label colors on tinted fills */
html[data-theme="dark"] .v3-btn-arm {
  color: #fcd34d;
}
html[data-theme="dark"] .v3-btn-disarm {
  color: #fecaca;
}
html[data-theme="dark"] .v3-btn-restart {
  color: #fdba74;
}
html[data-theme="dark"] .v3-btn-apply {
  color: #5eead4;
}
/* Light: ensure readable ink on soft fills */
html[data-theme="light"] .v3-btn-arm {
  color: #92400e;
  background: color-mix(in srgb, #f59e0b 14%, #fff);
  border-color: color-mix(in srgb, #d97706 40%, var(--st-border));
}
html[data-theme="light"] .v3-btn-disarm {
  color: #991b1b;
  background: color-mix(in srgb, #ef4444 12%, #fff);
  border-color: color-mix(in srgb, #dc2626 38%, var(--st-border));
}
html[data-theme="light"] .v3-btn-restart {
  color: #9a3412;
  background: color-mix(in srgb, #fb923c 12%, #fff);
  border-color: color-mix(in srgb, #ea580c 36%, var(--st-border));
}
html[data-theme="light"] .v3-btn-apply {
  color: #0f766e;
  background: color-mix(in srgb, #14b8a6 12%, #fff);
  border-color: color-mix(in srgb, #0d9488 40%, var(--st-border));
}
html[data-theme="light"] .v3-mode-seg.is-on {
  color: #0f766e;
  background: color-mix(in srgb, #14b8a6 16%, #fff);
}
html[data-theme="light"] .v3-mode-seg.is-on.is-live {
  color: #b91c1c;
  background: color-mix(in srgb, #ef4444 12%, #fff);
}
html[data-theme="light"] .v3-mode-seg:not(.is-on) {
  color: #475569;
}
html[data-theme="light"] .v3-auto-status.is-engaged .v3-auto-status-title {
  color: #0f766e;
}
html[data-theme="light"] .v3-auto-status-detail {
  color: #64748b;
}
html[data-theme="light"] .v3-inline-actions .v3-btn {
  color: #0f172a;
  border-color: color-mix(in srgb, #0f172a 18%, var(--st-border));
}
.v3-auto-telemetry {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}
.v3-auto-telemetry li {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-elevated);
  padding: 0.45rem 0.55rem;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.v3-auto-telemetry .k {
  font-size: 0.68rem;
  color: var(--st-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.v3-auto-telemetry .v {
  font-size: 0.9rem;
  font-weight: 700;
}
.v3-auto-telemetry .v.ok { color: #4ade80; }
.v3-auto-telemetry .v.warn { color: #fbbf24; }
.v3-auto-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}
@media (max-width: 640px) {
  .v3-auto-field-row { grid-template-columns: 1fr; }
  .v3-auto-telemetry { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.v3-auto-field-lab {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.3rem;
}
.v3-gear {
  border: 1px solid var(--st-border);
  background: var(--st-surface);
  color: var(--st-muted);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  line-height: 1;
  font-size: 0.95rem;
}
.v3-gear:hover {
  color: var(--st-text);
  border-color: color-mix(in srgb, #38bdf8 35%, var(--st-border));
}
.v3-auto-apply-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}
.v3-auto-pop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0,0,0,0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1.25rem, env(safe-area-inset-top, 0px)) max(0.75rem, env(safe-area-inset-right, 0px)) max(1.25rem, env(safe-area-inset-bottom, 0px)) max(0.75rem, env(safe-area-inset-left, 0px));
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.v3-auto-pop-card {
  width: min(440px, 100%);
  max-height: min(88dvh, calc(100% - 1.5rem));
  overflow: auto;
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  padding: 0.9rem 1rem 1rem;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
  margin: auto;
}
@media (max-width: 480px) {
  .v3-auto-pop {
    align-items: flex-end;
    padding: max(0.5rem, env(safe-area-inset-top, 0px)) 0 0 0;
  }
  .v3-auto-pop-card {
    width: 100%;
    max-width: 100%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    max-height: min(85dvh, calc(100dvh - env(safe-area-inset-top, 0px) - 0.5rem));
    padding-bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  }
}
.v3-auto-pop-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}
.v3-auto-pop-head h3 {
  margin: 0;
  font-size: 1rem;
}
.v3-auto-pop-lead {
  margin: 0 0 0.75rem;
  font-size: 0.78rem;
}
.v3-auto-pop-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--st-muted);
  margin-bottom: 0.25rem;
}
.v3-input {
  width: 100%;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-elevated);
  color: var(--st-text);
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.65rem;
  font-size: 0.88rem;
}
.v3-slider-row {
  margin-bottom: 0.55rem;
}
.v3-slider-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.78rem;
  margin-bottom: 0.2rem;
}
.v3-range {
  width: 100%;
  accent-color: #38bdf8;
}
.v3-auto-pop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.4rem;
  margin-top: 0.75rem;
}



.v3-mode-toggle {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--st-border);
  border-radius: 999px;
  overflow: hidden;
  background: var(--st-elevated);
  flex-shrink: 0;
}
.v3-mode-seg {
  border: none;
  background: transparent;
  color: var(--st-muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.34rem 0.7rem;
  cursor: pointer;
  line-height: 1.2;
  transition: background 0.15s ease, color 0.15s ease;
}
.v3-mode-seg.is-on {
  background: color-mix(in srgb, #14b8a6 22%, var(--st-surface));
  color: #14b8a6;
}
.v3-mode-seg.is-on.is-live {
  background: color-mix(in srgb, #ef4444 18%, var(--st-surface));
  color: #f87171;
}
.v3-mode-seg:not(.is-on):hover {
  color: var(--st-text);
  background: color-mix(in srgb, var(--st-text) 6%, transparent);
}
.v3-mode-seg:focus-visible {
  outline: 2px solid color-mix(in srgb, #14b8a6 55%, transparent);
  outline-offset: -2px;
  z-index: 1;
}

.v3-mode-btn {
  border: 1.5px solid var(--st-border);
  border-radius: 999px;
  background: transparent;
  color: var(--st-text);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.34rem 0.75rem;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}
/* Paper = outline only (never a heavy dark fill) — still tappable to switch Live */
.v3-mode-btn.is-paper {
  color: var(--st-text);
  border-color: color-mix(in srgb, var(--st-text) 28%, var(--st-border));
  background: transparent;
}
.v3-mode-btn.is-paper:hover {
  border-color: color-mix(in srgb, #14b8a6 55%, var(--st-border));
  color: #14b8a6;
  background: color-mix(in srgb, #14b8a6 8%, transparent);
}
/* Live = soft danger outline so mode is obvious */
.v3-mode-btn.is-live {
  color: #f87171;
  border-color: color-mix(in srgb, #ef4444 50%, var(--st-border));
  background: color-mix(in srgb, #ef4444 10%, transparent);
}
.v3-mode-btn.is-live:hover {
  filter: brightness(1.06);
  background: color-mix(in srgb, #ef4444 16%, transparent);
}
.v3-mode-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, #14b8a6 60%, transparent);
  outline-offset: 2px;
}
.v3-live-card {
  width: min(520px, 100%);
}
.v3-live-summary {
  margin: 0 0 0.55rem;
  font-size: 0.85rem;
  font-weight: 650;
}
.v3-live-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  max-height: 40vh;
  overflow: auto;
}
.v3-live-list li {
  display: grid;
  grid-template-columns: 3rem 1fr;
  gap: 0.45rem;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  padding: 0.4rem 0.5rem;
  background: var(--st-elevated);
  font-size: 0.8rem;
}
.v3-live-list .st {
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.v3-live-list .st.pass,
.v3-live-list .st.ok { color: #4ade80; }
.v3-live-list .st.fail { color: #f87171; }
.v3-live-list .st.info { color: var(--st-muted); }
.v3-live-list strong { display: block; font-size: 0.8rem; }
.v3-live-list p { margin: 0.15rem 0 0; }


/* Compact dials: style / aggression / universe / apply */
.v3-auto-controls {
  gap: 0.55rem;
  padding: 0.7rem 0.75rem;
}
.v3-auto-field-row {
  gap: 0.5rem;
}
.v3-auto-field label {
  font-size: 0.68rem;
  margin-bottom: 0;
}
.v3-auto-field-lab {
  margin-bottom: 0.2rem;
}
.v3-select {
  padding: 0.4rem 0.5rem;
  font-size: 0.84rem;
}
.v3-auto-universe {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.v3-uni-lab {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--st-muted);
}
.v3-uni-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.v3-uni-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  border: 1px solid var(--st-border);
  border-radius: 999px;
  background: var(--st-surface);
  padding: 0.22rem 0.5rem 0.22rem 0.35rem;
  font-size: 0.72rem;
  font-weight: 650;
  cursor: pointer;
  user-select: none;
}
.v3-uni-chip input {
  margin: 0;
  accent-color: #38bdf8;
}
.v3-uni-chip:has(input:not(:checked)) {
  opacity: 0.55;
}
.v3-auto-apply-row {
  margin-top: 0.15rem;
  gap: 0.5rem;
}


/* Equity / Total assets */
.v3-eq {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.v3-eq-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: nowrap;
  width: 100%;
}
.v3-eq-ranges {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.15rem;
  margin-left: auto;
  justify-content: flex-end;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  min-width: 0;
  flex: 1 1 auto;
}
.v3-eq-ranges::-webkit-scrollbar { display: none; }
.v3-eq-range {
  border: 1px solid transparent;
  background: transparent;
  color: var(--st-muted);
  border-radius: 999px;
  padding: 0.18rem 0.42rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  flex-shrink: 0;
}
.v3-eq-range.is-on {
  color: #14b8a6;
  border-color: color-mix(in srgb, #14b8a6 45%, var(--st-border));
  background: color-mix(in srgb, #14b8a6 12%, var(--st-surface));
}
.v3-eq-order-links {
  display: flex;
  gap: 0.55rem;
  flex-wrap: nowrap;
  flex-shrink: 0;
  align-items: center;
}
.v3-link-btn {
  border: none;
  background: none;
  color: #0d9488;
  font-size: 0.8rem;
  font-weight: 650;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0;
}
.v3-link-btn:hover {
  color: #14b8a6;
}
html[data-theme="dark"] .v3-eq-range.is-on {
  color: #5eead4;
  border-color: color-mix(in srgb, #14b8a6 50%, var(--st-border));
  background: color-mix(in srgb, #14b8a6 14%, var(--st-surface));
}
html[data-theme="dark"] .v3-link-btn {
  color: #5eead4;
}
html[data-theme="dark"] .v3-link-btn:hover {
  color: #99f6e4;
}
html[data-theme="light"] .v3-eq-range {
  color: #64748b;
}
html[data-theme="light"] .v3-eq-range.is-on {
  color: #0f766e;
  border-color: color-mix(in srgb, #0d9488 45%, var(--st-border));
  background: color-mix(in srgb, #14b8a6 12%, #fff);
}
html[data-theme="light"] .v3-link-btn {
  color: #0f766e;
}
html[data-theme="light"] .v3-eq-m span {
  color: #64748b;
}
html[data-theme="light"] .v3-eq-m strong {
  color: #0f172a;
}
html[data-theme="light"] .v3-eq-m em {
  color: #64748b;
}
html[data-theme="light"] .v3-eq-m .v3-pos,
html[data-theme="light"] .v3-pos {
  color: #047857;
}
html[data-theme="light"] .v3-eq-m .v3-neg,
html[data-theme="light"] .v3-neg {
  color: #b91c1c;
}
html[data-theme="light"] .v3-eq-reset-btn {
  color: #9a3412;
  border-color: color-mix(in srgb, #ea580c 35%, var(--st-border));
}
.v3-eq-chart-wrap {
  position: relative;
  width: 100%;
  height: min(42vh, 320px);
  min-height: 220px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  overflow: hidden;
  background-color: var(--st-surface);
  background-image: none;
}
html[data-theme="dark"] .v3-eq-chart-wrap {
  background-color: #0a0a0a;
  border-color: color-mix(in srgb, #334155 70%, var(--st-border));
}
html[data-theme="light"] .v3-eq-chart-wrap {
  background-color: #ffffff;
  border-color: color-mix(in srgb, var(--st-border) 85%, transparent);
}
.v3-eq-chart-wrap canvas,
.v3-eq-chart-wrap #v3-equity-chart {
  width: 100%;
  height: 100%;
  display: block;
  background: transparent !important;
}

.v3-eq-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(3, auto);
  gap: 0.35rem;
}
/* Keep 4×3; only stack to 2×6 on very narrow phones */
@media (max-width: 360px) {
  .v3-eq-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
  }
}
.v3-eq-m {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
  padding: 0.35rem 0.4rem;
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}
.v3-eq-m span {
  font-size: clamp(0.55rem, 2.1vw, 0.66rem);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--st-muted);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}
.v3-eq-m strong {
  font-size: clamp(0.72rem, 2.8vw, 0.92rem);
  font-weight: 750;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.25;
  min-width: 0;
}
.v3-eq-m em {
  font-style: normal;
  font-size: clamp(0.58rem, 2vw, 0.7rem);
  font-weight: 650;
  color: var(--st-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}


/* Orders / seats */
.v3-popup--orders {
  width: min(560px, 100%);
  max-height: min(88vh, 820px);
  min-height: min(50vh, 420px);
  display: flex;
  flex-direction: column;
}
.v3-orders-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0 0.15rem 0.55rem;
  border-bottom: 1px solid var(--st-border);
  margin-bottom: 0.55rem;
}
.v3-orders-tab {
  flex: 1;
  border: 1px solid var(--st-border);
  background: var(--st-surface);
  color: var(--st-muted);
  border-radius: 999px;
  padding: 0.4rem 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}
.v3-orders-tab.is-on {
  color: #7dd3fc;
  border-color: color-mix(in srgb, #38bdf8 45%, var(--st-border));
  background: color-mix(in srgb, #38bdf8 12%, var(--st-surface));
}
.v3-orders-meta {
  margin: 0 0 0.55rem;
  font-size: 0.78rem;
}
.v3-seats-list {
  overflow: auto;
  flex: 1 1 auto;
  min-height: 12rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-bottom: 0.5rem;
}
.v3-seats-list .v3-orders-table-wrap {
  flex: 0 0 auto;
  width: 100%;
  min-height: 4rem;
}
.v3-orders-strip {
  font-size: 0.8rem;
  color: var(--st-muted);
  padding: 0.2rem 0.1rem 0.35rem;
}
.v3-orders-empty {
  text-align: center;
  padding: 1.6rem 0.75rem;
}
.v3-orders-empty p {
  margin: 0.25rem 0;
}
.v3-order-card {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius);
  background: var(--st-elevated);
  padding: 0.7rem 0.75rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}
.v3-order-card.is-closed {
  background: color-mix(in srgb, var(--st-surface) 88%, var(--st-elevated));
}
.v3-order-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}
.v3-order-pair {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}
.v3-order-pair strong {
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}
.v3-order-side {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  border: 1px solid var(--st-border);
  color: var(--st-muted);
}
.v3-order-side.is-long {
  color: #4ade80;
  border-color: color-mix(in srgb, #4ade80 40%, var(--st-border));
  background: color-mix(in srgb, #4ade80 12%, transparent);
}
.v3-order-side.is-short {
  color: #f87171;
  border-color: color-mix(in srgb, #f87171 40%, var(--st-border));
  background: color-mix(in srgb, #f87171 12%, transparent);
}
.v3-order-pnl {
  font-size: 0.95rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.v3-order-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.35rem 0.5rem;
}
.v3-order-grid div {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  min-width: 0;
}
.v3-order-grid span {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--st-muted);
  font-weight: 700;
}
.v3-order-grid strong {
  font-size: 0.8rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v3-order-reason {
  margin: 0;
  font-size: 0.72rem;
  line-height: 1.35;
}




/* Popup header — title left, close (X) upper right corner */
.v3-popup-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  position: sticky;
  top: 0;
  z-index: 20;
  margin: 0 0 0.65rem;
  padding: 0.4rem 2.75rem 0.55rem 0.15rem;
  background: var(--st-surface-2, var(--st-surface));
  border-bottom: 1px solid var(--st-border);
  flex-shrink: 0;
}
.v3-popup-head h2 {
  margin: 0;
  flex: 1 1 auto;
  min-width: 0;
  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.25;
  padding-right: 0.5rem;
}
.v3-popup-head .v3-icon-btn,
.v3-popup--orders .v3-popup-head .v3-icon-btn,
.v3-popup--order-detail .v3-popup-head .v3-icon-btn {
  position: absolute;
  top: 0.25rem;
  right: 0.15rem;
  z-index: 25;
  flex: 0 0 auto;
  margin: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  border-radius: 999px;
}
.v3-popup--orders .v3-popup-head,
.v3-popup--order-detail .v3-popup-head {
  position: sticky;
}

/* Order detail */
.v3-popup--order-detail {
  width: min(560px, 100%);
  max-height: min(90vh, 860px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.v3-order-detail-body {
  overflow: auto;
  padding: 0 0.15rem 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.v3-order-card {
  cursor: pointer;
}
.v3-order-card:hover {
  border-color: color-mix(in srgb, #38bdf8 40%, var(--st-border));
}
.v3-od-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem 0.75rem;
}
.v3-od-row {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.v3-od-row span {
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--st-muted);
  font-weight: 700;
}
.v3-od-row strong {
  font-size: 0.86rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v3-od-code {
  font-size: 0.72rem;
  font-weight: 500;
  word-break: break-all;
}
.v3-od-insight h3,
.v3-od-actions h3 {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--st-muted);
}
.v3-od-insight p {
  margin: 0.25rem 0;
  font-size: 0.84rem;
  line-height: 1.4;
}
.v3-od-sub {
  margin: 0 0 0.55rem;
  font-size: 0.72rem;
}
.v3-od-tpsl {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.65rem;
}
.v3-od-field {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--st-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.v3-od-field input {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm, 8px);
  background: var(--st-surface);
  color: var(--st-text);
  padding: 0.45rem 0.55rem;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}
.v3-od-btns {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.4rem;
  width: 100%;
}
.v3-od-btns .v3-btn {
  width: 100%;
  min-width: 0;
  justify-content: center;
  text-align: center;
  padding: 0.55rem 0.3rem;
  font-size: 0.72rem;
  font-weight: 800;
  white-space: nowrap;
  border-width: 1px;
  border-style: solid;
}
/* High-contrast manage actions — dark ink on solid fills */
.v3-od-btns .v3-btn:not(.v3-btn-primary):not(.v3-btn-danger):not(.v3-btn-warn) {
  background: #ccfbf1;
  border-color: #0d9488;
  color: #0f172a;
}
.v3-od-btns .v3-btn-primary {
  background: #bae6fd;
  border-color: #0284c7;
  color: #0f172a;
}
.v3-od-btns .v3-btn-danger {
  background: #fecaca;
  border-color: #dc2626;
  color: #0f172a;
}
.v3-od-btns .v3-btn-warn {
  background: #fde68a;
  border-color: #d97706;
  color: #0f172a;
}
html[data-theme="dark"] .v3-od-btns .v3-btn:not(.v3-btn-primary):not(.v3-btn-danger):not(.v3-btn-warn) {
  background: #0f766e;
  border-color: #5eead4;
  color: #ecfdf5;
}
html[data-theme="dark"] .v3-od-btns .v3-btn-primary {
  background: #0369a1;
  border-color: #7dd3fc;
  color: #f0f9ff;
}
html[data-theme="dark"] .v3-od-btns .v3-btn-danger {
  background: #b91c1c;
  border-color: #fca5a5;
  color: #fef2f2;
}
html[data-theme="dark"] .v3-od-btns .v3-btn-warn {
  background: #b45309;
  border-color: #fcd34d;
  color: #fffbeb;
}
@media (max-width: 400px) {
  .v3-od-btns {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.v3-od-status {
  min-height: 1.2em;
  margin: 0.45rem 0 0;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.v3-od-status.is-working {
  color: var(--st-muted, #8b9aab);
}
.v3-od-spinner {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--st-teal, #14b8a6) 28%, transparent);
  border-top-color: var(--st-teal, #14b8a6);
  animation: v3-od-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes v3-od-spin {
  to { transform: rotate(360deg); }
}
.v3-od-actions.is-busy .v3-od-btns .v3-btn,
.v3-od-actions.is-busy .v3-od-field input {
  opacity: 0.55;
  pointer-events: none;
}

.v3-od-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.55rem;
}
.v3-od-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 0.25rem;
  padding: 0.22rem 0.45rem;
  border-radius: 999px;
  border: 1px solid var(--st-border);
  background: var(--st-surface);
  font-size: 0.72rem;
  font-weight: 650;
}
.v3-od-chip em {
  font-style: normal;
  color: var(--st-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  font-size: 0.6rem;
}
.v3-od-thesis {
  border-top: 1px solid var(--st-border);
  padding-top: 0.55rem;
  margin-top: 0.15rem;
}
.v3-od-kicker {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--st-muted);
  margin-bottom: 0.25rem;
}
.v3-od-thesis p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.45;
}
.v3-od-bullets {
  margin: 0.4rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  line-height: 1.4;
}
.v3-od-tech {
  margin-top: 0.45rem;
  font-size: 0.78rem;
}
.v3-od-tech pre {
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0.35rem 0 0;
  padding: 0.45rem;
  border-radius: 8px;
  border: 1px solid var(--st-border);
  background: var(--st-surface);
  font-size: 0.72rem;
  max-height: 10rem;
  overflow: auto;
}
.v3-od-engine {
  margin: 0 0 0.25rem;
  font-size: 0.75rem;
}

.v3-order-card--compact {
  padding: 0.55rem 0.65rem 0.5rem;
  gap: 0.3rem;
}
.v3-order-card--compact .v3-order-head {
  margin: 0;
}
.v3-order-compact-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem 0.85rem;
  font-size: 0.72rem;
  color: var(--st-muted);
}
.v3-order-compact-meta strong {
  color: var(--st-text);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.v3-order-tap {
  margin-left: auto;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.v3-order-pnl-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.v3-order-pnl-pct {
  font-size: 0.78rem;
  font-weight: 700;
  opacity: 0.92;
}
.v3-order-pnl-wrap .v3-order-pnl {
  font-size: 0.95rem;
  font-weight: 750;
}

/* Event overlay badge (holiday / special) — driven by theme-runtime */
.v3-event-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 0.45rem;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--st-accent);
  border: 1px solid color-mix(in srgb, var(--st-accent) 40%, var(--st-border));
  background: color-mix(in srgb, var(--st-accent) 12%, var(--st-surface));
  white-space: nowrap;
  max-width: 11rem;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v3-event-badge[hidden] { display: none !important; }
html[data-theme-event] body.v3-shell {
  /* hook for optional deeper skins without forking layout */
}


/* Equity sheet: Reset paper sits right on the title row */
.v3-sheet-head .v3-eq-reset-btn {
  flex: 0 0 auto;
  margin-left: auto;
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.35rem 0.7rem;
  white-space: nowrap;
}
.v3-sheet[data-sheet="assets"] .v3-sheet-head h2 {
  flex: 1 1 auto;
  min-width: 0;
}

.v3-popup--reset .v3-popup-body {
  padding: 0.25rem 0.15rem 0.5rem;
}
.v3-check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin: 0.85rem 0 0.5rem;
  font-size: 0.84rem;
  line-height: 1.35;
  color: var(--st-text);
  cursor: pointer;
}
.v3-check-row input {
  margin-top: 0.2rem;
  flex-shrink: 0;
}
.v3-popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
  margin-top: 0.85rem;
}
.v3-btn.primary {
  background: var(--st-accent);
  color: #fff;
  border: 1px solid color-mix(in srgb, var(--st-accent) 70%, #000);
  font-weight: 650;
}
.v3-btn.primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}


/* V3 Trade Journal — compact sterile blotter */
.v3-j-tabs {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.4rem;
  padding: 0.5rem 1rem 0.4rem;
  border-bottom: 1px solid var(--st-border);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  align-items: center;
}
.v3-j-tab {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  margin: 0;
  min-height: 2rem;
  padding: 0 0.9rem;
  border-radius: 999px;
  border: 1px solid var(--st-border);
  background: var(--st-surface);
  color: var(--st-muted);
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  vertical-align: middle;
}
.v3-j-tab.is-on {
  color: var(--st-accent);
  border-color: color-mix(in srgb, var(--st-accent) 50%, var(--st-border));
  background: color-mix(in srgb, var(--st-accent) 12%, var(--st-surface-2));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--st-accent) 20%, transparent);
}
.v3-j-kpi {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.4rem;
  padding: 0.55rem 1rem 0.35rem;
}
@media (max-width: 720px) {
  .v3-j-kpi { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.v3-j-k {
  padding: 0.45rem 0.5rem;
  border-radius: var(--st-radius-sm);
  border: 1px solid var(--st-border);
  background: var(--st-surface);
  min-width: 0;
  transition: border-color 0.2s ease, box-shadow 0.25s ease;
}
.v3-j-k.is-flash {
  border-color: color-mix(in srgb, var(--st-accent) 50%, var(--st-border));
  box-shadow: 0 0 16px var(--st-accent-glow);
}
.v3-j-k span {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--st-muted);
}
.v3-j-k strong {
  display: block;
  margin-top: 0.15rem;
  font-size: 0.88rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--st-text);
}
.v3-j-k strong.up { color: var(--st-ok); }
.v3-j-k strong.down { color: var(--st-danger); }

.v3-j-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  padding: 0.35rem 1rem 0.55rem;
}
.v3-j-toolbar .v3-input,
.v3-j-toolbar select {
  flex: 1 1 8rem;
  min-width: 6rem;
  max-width: 14rem;
  font-size: 0.8rem;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  border: 1px solid var(--st-border);
  background: var(--st-surface-2);
  color: var(--st-text);
}
.v3-j-meta {
  margin: 0;
  font-size: 0.68rem;
  color: var(--st-muted);
  flex: 1 1 100%;
}

.v3-j-list-head,
.v3-j-row {
  display: grid;
  /* Pair · Side · Net · R · Held · Exit (family hidden — exit gets the width) */
  grid-template-columns: minmax(4.5rem, 1.1fr) 3.2rem 4.4rem 3.2rem 3.6rem minmax(6.5rem, 1.35fr);
  gap: 0.35rem;
  align-items: center;
  padding: 0.4rem 0.55rem;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.v3-j-exit {
  white-space: nowrap;
  text-align: right;
}
.v3-j-list-head span:last-child {
  text-align: right;
}
.v3-j-list-head {
  color: var(--st-muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid var(--st-border);
  position: sticky;
  top: 0;
  background: color-mix(in srgb, var(--st-surface-2) 92%, transparent);
  z-index: 1;
  backdrop-filter: blur(8px);
}
.v3-j-list {
  max-height: min(52vh, 28rem);
  overflow: auto;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: color-mix(in srgb, var(--st-surface) 80%, transparent);
}
.v3-j-row {
  border-bottom: 1px solid color-mix(in srgb, var(--st-border) 70%, transparent);
  cursor: pointer;
  transition: background 0.15s ease;
}
.v3-j-row:hover,
.v3-j-row:focus-visible {
  background: color-mix(in srgb, var(--st-accent) 8%, transparent);
  outline: none;
}
.v3-j-row.is-selected {
  background: color-mix(in srgb, var(--st-accent) 14%, var(--st-surface));
  box-shadow: inset 3px 0 0 var(--st-accent);
}
.v3-j-side-long { color: var(--st-ok); font-weight: 700; }
.v3-j-side-short { color: var(--st-danger); font-weight: 700; }
.v3-j-up { color: var(--st-ok); font-weight: 650; }
.v3-j-down { color: var(--st-danger); font-weight: 650; }
.v3-j-muted { color: var(--st-muted); }
.v3-j-pair strong { font-weight: 650; color: var(--st-text); }
.v3-j-pair small { color: var(--st-muted); font-weight: 500; }

.v3-j-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 0.45rem;
}
.v3-j-cell {
  padding: 0.45rem 0.5rem;
  border-radius: 10px;
  border: 1px solid var(--st-border);
  background: var(--st-surface);
  min-width: 0;
}
.v3-j-cell span {
  display: block;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--st-muted);
}
.v3-j-cell b {
  display: block;
  margin-top: 0.12rem;
  font-size: 0.8rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--st-text);
  word-break: break-word;
}
.v3-j-sec {
  margin: 0.75rem 0;
}
.v3-j-sec-h {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--st-muted);
}
.v3-j-metric-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.65rem;
}
.v3-j-metric-strip .v3-j-cell {
  flex: 1 1 5.5rem;
}

.v3-j-icards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(6.5rem, 1fr));
  gap: 0.4rem;
  margin-bottom: 0.75rem;
}
.v3-j-icard {
  padding: 0.5rem 0.55rem;
  border-radius: var(--st-radius-sm);
  border: 1px solid var(--st-border);
  background: linear-gradient(165deg, var(--st-surface-2), var(--st-surface));
}
.v3-j-icard .ic-k {
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--st-muted);
}
.v3-j-icard .ic-v {
  margin-top: 0.2rem;
  font-size: 0.92rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.v3-j-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}
.v3-j-table th,
.v3-j-table td {
  padding: 0.35rem 0.4rem;
  text-align: left;
  border-bottom: 1px solid var(--st-border);
}
.v3-j-table th {
  font-size: 0.62rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--st-muted);
  font-weight: 700;
}
.v3-j-bars {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin: 0.5rem 0 0.85rem;
}
.v3-j-bar-row {
  display: grid;
  grid-template-columns: 6.5rem 1fr 3.5rem;
  gap: 0.4rem;
  align-items: center;
  font-size: 0.72rem;
}
.v3-j-bar-track {
  height: 0.45rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--st-border) 80%, transparent);
  overflow: hidden;
}
.v3-j-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--st-accent), color-mix(in srgb, var(--st-accent) 40%, #fff));
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.v3-j-bar-fill.neg {
  background: linear-gradient(90deg, var(--st-danger), color-mix(in srgb, var(--st-danger) 50%, #fff));
}
.v3-j-spark {
  width: 100%;
  height: 56px;
  border-radius: 10px;
  border: 1px solid var(--st-border);
  background: var(--st-surface);
  margin: 0.35rem 0 0.75rem;
}
.v3-j-empty {
  margin: 1rem 0.25rem;
  color: var(--st-muted);
  font-size: 0.85rem;
  text-align: center;
}
.v3-sheet[data-sheet="journal"] .v3-sheet-body {
  padding-top: 0.35rem;
}
.v3-j-mode {
  margin-left: auto;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--st-accent);
  border: 1px solid color-mix(in srgb, var(--st-accent) 35%, var(--st-border));
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

.v3-j-mode.v3-j-mode-toggle {
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.v3-j-mode.v3-j-mode-toggle:hover,
.v3-j-mode.v3-j-mode-toggle:focus-visible {
  border-color: color-mix(in srgb, var(--st-accent) 55%, var(--st-border));
  outline: none;
}
.v3-j-mode.is-live {
  color: color-mix(in srgb, var(--st-ok) 80%, var(--st-text));
  border-color: color-mix(in srgb, var(--st-ok) 40%, var(--st-border));
}
.v3-j-mode-lab {
  font-weight: 800;
  letter-spacing: 0.08em;
}
.v3-j-mode-hint {
  font-size: 0.55rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.7;
}
.v3-j-mode.is-view-only .v3-j-mode-hint {
  color: var(--st-accent);
  opacity: 1;
}

/* Journal Paper | Live book segment */
.v3-j-book {
  display: inline-flex;
  align-items: stretch;
  margin-left: auto;
  padding: 2px;
  border-radius: 999px;
  border: 1px solid var(--st-border);
  background: var(--st-surface);
  gap: 0;
}
.v3-j-book-btn {
  box-sizing: border-box;
  margin: 0;
  min-height: 1.7rem;
  padding: 0 0.75rem;
  border: none;
  border-radius: 999px;
  background: transparent;
  color: var(--st-muted);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.06em;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.v3-j-book-btn.is-on {
  color: var(--st-accent);
  background: color-mix(in srgb, var(--st-accent) 14%, var(--st-surface-2));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--st-accent) 28%, transparent);
}
.v3-j-book-btn[data-j-book="live"].is-on {
  color: color-mix(in srgb, var(--st-ok) 85%, var(--st-text));
  background: color-mix(in srgb, var(--st-ok) 14%, var(--st-surface-2));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--st-ok) 30%, transparent);
}
.v3-j-book-btn:not(.is-on):hover,
.v3-j-book-btn:not(.is-on):focus-visible {
  color: var(--st-text);
  outline: none;
}
.v3-j-book.is-view-only {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--st-accent) 22%, transparent);
}

/* Market timescale + mini sparks */
.v3-mkt-range {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.3rem;
  overflow-x: auto;
  padding: 0.15rem 0 0.55rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.v3-mkt-range::-webkit-scrollbar { display: none; }
.v3-mkt-range-btn {
  flex: 0 0 auto;
  margin: 0;
  min-height: 1.65rem;
  padding: 0 0.65rem;
  border-radius: 999px;
  border: 1px solid var(--st-border);
  background: var(--st-surface);
  color: var(--st-muted);
  font-family: inherit;
  font-size: 0.65rem;
  font-weight: 750;
  letter-spacing: 0.04em;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
}
.v3-mkt-range-btn.is-on {
  color: var(--st-accent);
  border-color: color-mix(in srgb, var(--st-accent) 45%, var(--st-border));
  background: color-mix(in srgb, var(--st-accent) 12%, var(--st-surface));
}
.v3-board-table thead th[data-sort] {
  cursor: pointer;
  user-select: none;
}
.v3-board-table thead th.is-sort-asc::after,
.v3-board-table thead th.is-sort-desc::after {
  content: "";
  margin-left: 0.2rem;
  font-size: 0.6em;
  opacity: 0.8;
}
.v3-board-table thead th.is-sort-asc::after { content: "▲"; }
.v3-board-table thead th.is-sort-desc::after { content: "▼"; }
.v3-chg {
  font-variant-numeric: tabular-nums;
  font-weight: 650;
  white-space: nowrap;
}
.v3-chg.is-up { color: color-mix(in srgb, var(--st-ok) 88%, var(--st-text)); }
.v3-chg.is-down { color: color-mix(in srgb, var(--st-danger, #f07178) 88%, var(--st-text)); }
.v3-spark {
  display: block;
  width: 48px;
  height: 14px;
  margin-left: auto;
}
.v3-spark path {
  fill: none;
  stroke-width: 1.35;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.v3-spark.is-up path { stroke: color-mix(in srgb, var(--st-ok) 90%, #fff); }
.v3-spark.is-down path { stroke: color-mix(in srgb, var(--st-danger, #f07178) 90%, #fff); }
.v3-spark.is-flat path { stroke: var(--st-muted); }
.v3-board-table td.v3-td-rank {
  color: var(--st-muted);
  font-variant-numeric: tabular-nums;
  font-size: 0.68rem;
  text-align: right;
  padding-right: 0.2rem;
}

.v3-chg-spark {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.02rem;
  line-height: 1;
  max-width: 100%;
}
.v3-chg-spark .v3-chg {
  font-size: 0.66rem;
  line-height: 1.05;
}
.v3-chg-spark .v3-spark {
  margin-left: 0;
  width: 48px;
  height: 14px;
}

.v3-coin-fallback { color: var(--st-muted); flex: 0 0 auto; }

/* === Market board grid lock v7 ===
   Goal: continuous bottom rule across the FULL row; no empty gutter between Pair and Mark;
   no clipping of chips; Bias/Mcap headers readable. */
.v3-market-module .v3-table-scroll {
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-surface);
}
.v3-market-module .v3-board-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  border-spacing: 0 !important;
  font-size: 0.72rem;
}
.v3-market-module .v3-board-table thead th {
  position: sticky;
  top: 0;
  z-index: 4;
  background: color-mix(in srgb, var(--st-surface-2) 96%, var(--st-surface));
  border: 0;
  border-bottom: 1px solid var(--st-border);
  padding: 0.28rem 0.12rem;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--st-muted);
  text-align: left !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Uniform row height; single continuous bottom edge on every cell */
.v3-market-module .v3-board-table tbody td {
  border: 0 !important;
  border-bottom: 1px solid var(--st-border) !important;
  padding: 0.3rem 0.12rem;
  vertical-align: middle !important;
  text-align: left !important;
  white-space: nowrap;
  height: 2.6rem;
  box-sizing: border-box;
  background-color: var(--st-surface);
  overflow: visible;
}
.v3-market-module .v3-board-table tbody tr:last-child td {
  border-bottom: 0 !important;
}
.v3-market-module .v3-board-table tbody tr.is-focus td {
  background-color: color-mix(in srgb, var(--st-accent) 10%, var(--st-surface));
}
.v3-market-module .v3-board-table tbody tr.is-authority td:first-child {
  box-shadow: inset 3px 0 0 var(--st-ok, #2db87a);
}
/*
  Column shares (sum 100%). Pair sized to fit name+chips without a huge empty tail;
  Mark starts immediately after — closes the yellow gutter.
*/
.v3-market-module .v3-board-table col.pair { width: 30%; }
.v3-market-module .v3-board-table col.bias { width: 11%; }
.v3-market-module .v3-board-table col.chg  { width: 16%; }
.v3-market-module .v3-board-table col.vol  { width: 14%; }
.v3-market-module .v3-board-table col.mcap { width: 13%; }
.v3-market-module .v3-board-table col.mark { width: 16%; }
.v3-market-module .v3-board-table th:nth-child(1),
.v3-market-module .v3-board-table td:nth-child(1) { width: 30%; padding-left: 0.28rem; padding-right: 0.08rem; }
.v3-market-module .v3-board-table th:nth-child(2),
.v3-market-module .v3-board-table td:nth-child(2) { width: 11%; padding-left: 0.08rem; padding-right: 0.08rem; }
.v3-market-module .v3-board-table th:nth-child(3),
.v3-market-module .v3-board-table td:nth-child(3) { width: 16%; padding-left: 0.08rem; padding-right: 0.08rem; }
.v3-market-module .v3-board-table th:nth-child(4),
.v3-market-module .v3-board-table td:nth-child(4) { width: 14%; padding-left: 0.08rem; padding-right: 0.08rem; }
.v3-market-module .v3-board-table th:nth-child(5),
.v3-market-module .v3-board-table td:nth-child(5) { width: 13%; padding-left: 0.08rem; padding-right: 0.08rem; }
.v3-market-module .v3-board-table th:nth-child(6),
.v3-market-module .v3-board-table td:nth-child(6) { width: 16%; padding-left: 0.08rem; padding-right: 0.28rem; }

.v3-market-module .v3-pair {
  display: flex;
  align-items: center;
  gap: 0.22rem;
  max-width: 100%;
  height: 100%;
  overflow: visible;
}
.v3-market-module .v3-pair-text {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center !important;
  gap: 0.16rem !important;
  overflow: visible !important;
}
.v3-market-module .v3-pair-text strong {
  font-size: 0.74rem;
}
.v3-market-module .v3-chips {
  display: inline-flex !important;
  flex: 0 0 auto !important;
  gap: 0.1rem !important;
  overflow: visible !important;
}
.v3-market-module .v3-chip {
  padding: 0.04rem 0.2rem !important;
  font-size: 0.48rem !important;
}
.v3-market-module .v3-chg-spark {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0.02rem;
  height: 100%;
}
.v3-market-module .v3-chg-spark .v3-spark {
  width: 44px;
  height: 12px;
  margin: 0;
}
.v3-market-module .v3-board-table .num {
  text-align: left !important;
}

/* Pair td must remain a table-cell so border-bottom joins Mark/Chg/… */
.v3-market-module .v3-board-table tbody td[data-col="pair"] {
  display: table-cell !important;
  border-bottom: 1px solid var(--st-border) !important;
  vertical-align: middle !important;
}
.v3-market-module .v3-board-table tbody td[data-col="pair"] .v3-pair {
  display: flex;
  align-items: center;
  gap: 0.22rem;
  width: 100%;
  height: 100%;
  min-width: 0;
  overflow: visible;
}


/* Bias: full LONG/SHORT, smaller type */
.v3-market-module .v3-board-table td[data-col="bias"],
.v3-market-module .v3-bias {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.v3-market-module .v3-board-table td[data-col="mark"] {
  transition: color 0.15s ease, background-color 0.15s ease;
  font-variant-numeric: tabular-nums;
}
.v3-market-module .v3-board-table td[data-col="mark"].is-flash-up {
  color: var(--st-ok, #12a866) !important;
  background-color: color-mix(in srgb, var(--st-ok, #12a866) 16%, var(--st-surface)) !important;
  animation: v3MarkFlashUp 0.7s ease;
}
.v3-market-module .v3-board-table td[data-col="mark"].is-flash-down {
  color: var(--st-danger, #e23d3d) !important;
  background-color: color-mix(in srgb, var(--st-danger, #e23d3d) 14%, var(--st-surface)) !important;
  animation: v3MarkFlashDown 0.7s ease;
}
@keyframes v3MarkFlashUp {
  0% { background-color: color-mix(in srgb, var(--st-ok, #12a866) 28%, var(--st-surface)); }
  100% { background-color: transparent; }
}
@keyframes v3MarkFlashDown {
  0% { background-color: color-mix(in srgb, var(--st-danger, #e23d3d) 26%, var(--st-surface)); }
  100% { background-color: transparent; }
}

/* Autopilot hub — sonar / radar viz (theme via currentColor) */
.v3-hub-viz-radar svg {
  overflow: visible;
}
.v3-radar-ring {
  stroke: currentColor;
  stroke-width: 1.25;
  fill: none;
  opacity: 0.4;
}
.v3-radar-ring-mid {
  opacity: 0.32;
}
.v3-radar-cross {
  stroke: currentColor;
  stroke-width: 0.85;
  opacity: 0.28;
}
.v3-radar-sweep {
  transform-origin: 0px 0px;
  transform-box: view-box;
  animation: v3RadarSweep 3.2s linear infinite;
}
.v3-radar-beam {
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  opacity: 0.9;
}
.v3-radar-wedge {
  fill: currentColor;
  opacity: 0.16;
}
.v3-radar-dot {
  fill: currentColor;
  opacity: 0.85;
}
.v3-radar-blip {
  fill: currentColor;
  opacity: 0.55;
}
.v3-radar-blip-a {
  animation: v3RadarBlip 3.2s ease-in-out infinite;
}
.v3-radar-blip-b {
  animation: v3RadarBlip 3.2s ease-in-out infinite 1.05s;
}
.v3-radar-blip-c {
  animation: v3RadarBlip 3.2s ease-in-out infinite 2.1s;
}
@keyframes v3RadarSweep {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}
@keyframes v3RadarBlip {
  0%, 100% { opacity: 0.25; }
  40% { opacity: 0.9; }
  55% { opacity: 0.35; }
}
/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .v3-radar-sweep,
  .v3-radar-blip-a,
  .v3-radar-blip-b,
  .v3-radar-blip-c {
    animation: none !important;
  }
}

/* Standings hub — podium uses theme currentColor only */
.v3-hub-viz-podium svg {
  overflow: visible;
  color: inherit;
}
.v3-podium-block {
  fill: currentColor;
  fill-opacity: 0.12;
  stroke: currentColor;
  stroke-opacity: 0.45;
  stroke-width: 1;
}
.v3-podium-num {
  fill: currentColor;
  fill-opacity: 0.72;
  font-size: 7px;
  font-weight: 700;
  font-family: Inter, system-ui, sans-serif;
}
.v3-podium-cup path,
.v3-podium-cup rect {
  fill: currentColor;
  stroke: currentColor;
  fill-opacity: 0.55;
  stroke-opacity: 0.85;
  stroke-width: 1;
}
.v3-podium-cup path[fill="none"] {
  fill: none;
  fill-opacity: 0;
  stroke-opacity: 0.85;
}
html[data-theme="light"] .v3-podium-block {
  fill-opacity: 0.08;
  stroke-opacity: 0.4;
}
html[data-theme="light"] .v3-podium-cup path,
html[data-theme="light"] .v3-podium-cup rect {
  fill-opacity: 0.42;
  stroke-opacity: 0.7;
}
html[data-theme="light"] .v3-podium-num {
  fill-opacity: 0.55;
}

/* Standings / Arena */
.v3-arena-tabs {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
}
.v3-arena-tab {
  appearance: none;
  border: 1px solid var(--st-border);
  background: var(--st-elevated, var(--st-surface));
  color: var(--st-text);
  border-radius: 999px;
  padding: 0.35rem 0.85rem;
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}
.v3-arena-tab.is-on {
  border-color: color-mix(in srgb, var(--st-accent, #38bdf8) 55%, var(--st-border));
  background: color-mix(in srgb, var(--st-accent, #38bdf8) 16%, transparent);
}
.v3-arena-kicker {
  margin: 0;
  font-weight: 700;
  font-size: 0.95rem;
}
.v3-arena-note { margin: 0.15rem 0 0.65rem; font-size: 0.82rem; }
.v3-arena-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  flex-wrap: wrap;
  margin: 0.35rem 0 0.55rem;
}
.v3-arena-stamp {
  margin: 0;
  font-size: 0.72rem;
}
.v3-btn-sm {
  font-size: 0.75rem;
  padding: 0.28rem 0.7rem;
  min-height: 0;
}
.v3-arena-chart-wrap {
  width: 100%;
  height: min(28vh, 220px);
  min-height: 160px;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm, 8px);
  overflow: hidden;
  margin-bottom: 0.75rem;
  background: color-mix(in srgb, var(--st-elevated, #0a0a0a) 90%, #000);
}
.v3-arena-chart-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.v3-arena-chart-wrap {
  position: relative;
}
.v3-arena-chart-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 0.55rem;
  background: color-mix(in srgb, var(--st-elevated, #0a0a0a) 72%, transparent);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}
.v3-arena-chart-wrap.is-loading .v3-arena-chart-loading {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.v3-arena-chart-spinner {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2.5px solid color-mix(in srgb, var(--st-teal, #14b8a6) 28%, transparent);
  border-top-color: var(--st-teal, #14b8a6);
  animation: v3-arena-spin 0.7s linear infinite;
}
.v3-arena-chart-loading span {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--st-muted, #94a3b8);
}
@keyframes v3-arena-spin {
  to { transform: rotate(360deg); }
}
html[data-theme="light"] .v3-arena-chart-loading {
  background: color-mix(in srgb, #ffffff 70%, transparent);
}

.v3-arena-table-wrap { overflow-x: auto; }
.v3-arena-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}
.v3-arena-table th,
.v3-arena-table td {
  text-align: left;
  padding: 0.4rem 0.45rem;
  border-bottom: 1px solid var(--st-border);
  white-space: nowrap;
}
.v3-arena-table th {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--st-muted, #94a3b8);
  font-weight: 600;
}
.v3-arena-dot {
  display: inline-block;
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 50%;
  margin-right: 0.4rem;
  background: var(--ar-accent, #38bdf8);
  vertical-align: middle;
}
.v3-arena-recent ul {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
}
.v3-arena-recent li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.25rem 0;
  border-bottom: 1px solid var(--st-border);
  font-size: 0.85rem;
}
.v3-up { color: #22c55e; }
.v3-down { color: #f87171; }

.v3-arena-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}
.v3-arena-card {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm, 8px);
  padding: 0.55rem 0.65rem;
  background: var(--st-elevated, var(--st-surface));
  border-top: 2px solid var(--ar-accent, #38bdf8);
}
.v3-arena-card.is-leader {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ar-accent, #38bdf8) 35%, transparent);
}
.v3-arena-card header {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  margin-bottom: 0.15rem;
}
.v3-arena-rank {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--ar-accent, #38bdf8);
  font-variant-numeric: tabular-nums;
}
.v3-arena-card-sub {
  margin: 0 0 0.4rem;
  font-size: 0.75rem;
}
.v3-arena-card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.5rem;
}
.v3-arena-card-grid span {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.v3-arena-card-grid strong {
  font-size: 0.88rem;
}
.v3-arena-opens {
  list-style: none;
  margin: 0.4rem 0 0;
  padding: 0;
  border-top: 1px solid var(--st-border);
  padding-top: 0.35rem;
}
.v3-arena-opens li {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.78rem;
  padding: 0.12rem 0;
}

/* Message Center */
.v3-msg-layer .v3-msg-panel {
  width: min(560px, 96vw);
  max-height: min(88vh, 720px);
  display: flex;
  flex-direction: column;
}
.v3-msg-head {
  align-items: flex-start;
  gap: 0.75rem;
}
.v3-msg-kicker {
  margin: 0;
  font-size: 0.75rem;
}
.v3-msg-head-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  justify-content: flex-end;
}
.v3-msg-tabs {
  display: flex;
  gap: 0.35rem;
  padding: 0 1rem;
  flex-wrap: wrap;
}
.v3-msg-tab {
  appearance: none;
  border: 1px solid var(--st-border);
  background: var(--st-elevated, var(--st-surface));
  color: var(--st-text);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}
.v3-msg-tab.is-on {
  border-color: color-mix(in srgb, var(--st-accent, #38bdf8) 55%, var(--st-border));
  background: color-mix(in srgb, var(--st-accent, #38bdf8) 14%, transparent);
}
.v3-msg-tab-n {
  margin-left: 0.25rem;
  opacity: 0.7;
  font-variant-numeric: tabular-nums;
}
.v3-msg-tab-n.has-unread {
  opacity: 1;
  color: var(--st-accent, #38bdf8);
  font-weight: 700;
}
.v3-msg-hint {
  margin: 0.4rem 1rem 0.25rem;
  font-size: 0.8rem;
}
.v3-msg-list {
  overflow: auto;
  flex: 1;
  min-height: 180px;
}
.v3-msg-pill-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.v3-msg-pill {
  appearance: none;
  width: 100%;
  text-align: left;
  border: 1px solid var(--st-border);
  background: var(--st-elevated, var(--st-surface));
  color: var(--st-text);
  border-radius: 10px;
  padding: 0.55rem 0.7rem;
  display: grid;
  grid-template-columns: 10px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 0.5rem;
  row-gap: 0.15rem;
  cursor: pointer;
  font: inherit;
}
.v3-msg-pill.is-unread {
  border-color: color-mix(in srgb, var(--st-accent, #38bdf8) 40%, var(--st-border));
  background: color-mix(in srgb, var(--st-accent, #38bdf8) 8%, transparent);
}
.v3-msg-pill-dot {
  grid-row: 1 / span 2;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-top: 0.35rem;
  background: transparent;
}
.v3-msg-pill.is-unread .v3-msg-pill-dot {
  background: var(--st-accent, #38bdf8);
}
.v3-msg-pill-from {
  font-size: 0.72rem;
  font-weight: 600;
  opacity: 0.75;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.v3-msg-pill-subj {
  grid-column: 2;
  font-weight: 600;
  font-size: 0.9rem;
}
.v3-msg-pill-when {
  grid-column: 3;
  grid-row: 1 / span 2;
  align-self: center;
  font-size: 0.72rem;
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.v3-msg-full-panel,
.v3-msg-compose-panel {
  width: min(560px, 96vw);
  max-height: min(88vh, 720px);
}
.v3-msg-body {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.45;
}
.v3-msg-compose-body .v3-field-label {
  display: block;
  margin: 0.5rem 0 0.25rem;
  font-size: 0.78rem;
  font-weight: 600;
  opacity: 0.75;
}
.v3-msg-compose-body .v3-input {
  width: 100%;
  box-sizing: border-box;
}
.v3-msg-status-ok { color: #22c55e; }
.v3-msg-status-err { color: #f87171; }
.v3-btn-danger { color: #f87171 !important; }
.v3-btn.sm,
.v3-btn.ghost.sm {
  padding: 0.28rem 0.55rem;
  font-size: 0.8rem;
}

/* Account center — compact platform layout */
.v3-acct-panel {
  width: min(520px, 96vw);
  max-height: min(90vh, 760px);
  display: flex;
  flex-direction: column;
}
.v3-acct-head { align-items: flex-start; }
.v3-acct-kicker { margin: 0; font-size: 0.75rem; }
.v3-acct-body {
  overflow: auto;
  flex: 1;
  padding-top: 0.25rem;
}
.v3-acct-identity {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  margin-bottom: 0.65rem;
}
.v3-acct-identity strong { font-size: 1rem; }
.v3-acct-identity p { margin: 0.1rem 0 0; font-size: 0.8rem; }
.v3-acct-avatar {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 0.95rem;
  background: color-mix(in srgb, var(--st-accent, #38bdf8) 18%, transparent);
  color: var(--st-accent, #38bdf8);
  border: 1px solid color-mix(in srgb, var(--st-accent, #38bdf8) 35%, var(--st-border));
  flex-shrink: 0;
}
.v3-acct-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-bottom: 0.65rem;
}
.v3-acct-tab {
  appearance: none;
  border: 1px solid var(--st-border);
  background: var(--st-elevated, var(--st-surface));
  color: var(--st-text);
  border-radius: 999px;
  padding: 0.28rem 0.65rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
}
.v3-acct-tab.is-on {
  border-color: color-mix(in srgb, var(--st-accent, #38bdf8) 55%, var(--st-border));
  background: color-mix(in srgb, var(--st-accent, #38bdf8) 14%, transparent);
}
.v3-acct-section h3 {
  margin: 0 0 0.45rem;
  font-size: 0.88rem;
  font-weight: 700;
}
.v3-acct-grid {
  display: grid;
  gap: 0.2rem 0.5rem;
  margin-bottom: 0.45rem;
}
.v3-acct-grid .v3-field-label {
  margin-top: 0.35rem;
}
.v3-acct-kv {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}
.v3-acct-kv div {
  border: 1px solid var(--st-border);
  border-radius: 8px;
  padding: 0.4rem 0.5rem;
  background: var(--st-elevated, var(--st-surface));
}
.v3-acct-kv span {
  display: block;
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.v3-acct-kv strong {
  font-size: 0.9rem;
}
.v3-acct-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.55rem;
  align-items: center;
}
.v3-acct-footer {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.75rem;
  padding-top: 0.65rem;
  border-top: 1px solid var(--st-border);
}
.v3-acct-foot {
  margin: 0.5rem 0 0;
  font-size: 0.8rem;
}
.v3-acct-foot.is-ok { color: #22c55e; }
.v3-acct-foot.is-err { color: #f87171; }
.v3-acct-social {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.v3-acct-social-row {
  display: grid;
  grid-template-columns: 5.5rem 1fr auto;
  gap: 0.35rem;
  align-items: center;
}
.v3-acct-social-row label {
  font-size: 0.8rem;
  font-weight: 600;
  opacity: 0.8;
}
.v3-acct-stack .v3-field-label { margin-top: 0.4rem; }
.v3-acct-divider {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0.85rem 0;
  color: var(--st-muted, #94a3b8);
  font-size: 0.75rem;
}
.v3-acct-divider::before,
.v3-acct-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--st-border);
}
.v3-field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.75;
  margin-bottom: 0.15rem;
}
.v3-check-row {
  display: flex;
  gap: 0.45rem;
  align-items: flex-start;
  font-size: 0.82rem;
  margin: 0.45rem 0;
  cursor: pointer;
}
.v3-check-row input { margin-top: 0.15rem; }
@media (max-width: 420px) {
  .v3-acct-social-row {
    grid-template-columns: 1fr;
  }
  .v3-acct-kv {
    grid-template-columns: 1fr;
  }
}


.v3-mfa-setup {
  margin-top: 0.5rem;
  padding: 0.65rem;
  border: 1px solid var(--st-border);
  border-radius: 10px;
  background: var(--st-elevated, var(--st-surface));
}
.v3-mfa-setup p { margin: 0.35rem 0; font-size: 0.84rem; }
.v3-acct-hr {
  border: 0;
  border-top: 1px solid var(--st-border);
  margin: 0.85rem 0;
}

/* Top-right user menu */
.v3-menu {
  position: relative;
  display: inline-flex;
}
.v3-menu-panel {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0;
  min-width: 10.5rem;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--st-border);
  background: var(--st-elevated, var(--st-surface));
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.18);
  z-index: 80;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.v3-menu-item {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--st-text);
  text-align: left;
  text-decoration: none;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  padding: 0.5rem 0.65rem;
  border-radius: 7px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 0.55rem;
  width: 100%;
  box-sizing: border-box;
}
.v3-menu-item img {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  opacity: 0.9;
}
.v3-menu-item span {
  text-align: left;
  line-height: 1.2;
}
.v3-menu-panel {
  min-width: 12rem;
}
.v3-menu-item:hover,
.v3-menu-item:focus-visible {
  background: color-mix(in srgb, var(--st-accent, #38bdf8) 12%, transparent);
  outline: none;
}
.v3-menu-item-danger {
  color: #f87171;
}
.v3-menu-item-danger:hover,
.v3-menu-item-danger:focus-visible {
  background: color-mix(in srgb, #f87171 12%, transparent);
}
.v3-acct-footer { display: none; }

html[data-theme="light"] .v3-menu-item img,
html[data-theme="light"] .v3-topbar-actions .v3-icon-btn img {
  filter: invert(1) brightness(0.25);
}
html[data-theme="dark"] .v3-menu-item img {
  filter: none;
}

/* Landscape: non-focus sheets use wider usable width */
@media (orientation: landscape) {
  .v3-sheet-layer:has(.v3-sheet.is-on:not([data-sheet="focus"])) {
    justify-content: center;
    align-items: stretch;
    padding: 0.35rem 0.5rem;
  }
  .v3-sheet.is-on:not([data-sheet="focus"]) {
    width: min(96vw, 1100px);
    max-width: 96vw;
    max-height: min(96dvh, 900px);
    border-radius: var(--st-radius);
    margin: 0 auto;
  }
  .v3-hub-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (orientation: landscape) and (min-width: 900px) {
  .v3-hub-list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
/* Portrait phone: tighter topbar + safe footer */
@media (max-width: 520px) and (orientation: portrait) {
  .v3-topbar {
    padding-left: max(0.65rem, env(safe-area-inset-left));
    padding-right: max(0.65rem, env(safe-area-inset-right));
  }
  .v3-bottom {
    padding-bottom: max(0.45rem, env(safe-area-inset-bottom));
  }
  .v3-menu-panel {
    right: 0;
    left: auto;
    max-width: min(92vw, 16rem);
  }
}

body.v3-sheet-open .v3-bottom {
  opacity: 0.35;
  pointer-events: none;
}
body.v3-sheet-open .v3-topbar {
  /* Sheet layer is z-index 70. Keep chrome out of the way of sheet Back,
     but allow top-right actions (menu / sign-out) above the sheet. */
  z-index: 80;
  pointer-events: none;
  background: transparent;
}
body.v3-sheet-open .v3-brand,
body.v3-sheet-open .v3-brand-logo,
body.v3-sheet-open .v3-brand-text {
  /* Logo was scrolling/sticking over sheet Back in landscape */
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}
body.v3-sheet-open .v3-topbar-actions {
  pointer-events: auto;
  position: relative;
  z-index: 81;
}
/* Landscape phones: solid sheet head + safe-area so Back never sits under notches/logo */
@media (orientation: landscape) and (max-height: 500px) {
  .v3-sheet.is-on {
    max-height: 100dvh;
  }
  .v3-sheet-head {
    padding-top: max(0.55rem, env(safe-area-inset-top, 0px));
    padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  }
  body.v3-sheet-open .v3-topbar {
    /* collapse brand footprint in short landscape */
    min-height: 0;
  }
}

/* Admin v3 — Ads module */
.admin-v3-ads-layout {
  display: grid;
  gap: 1rem;
}
@media (min-width: 900px) {
  .admin-v3-ads-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}
.admin-v3-card {
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius, 12px);
  padding: 0.85rem 1rem 1rem;
  background: color-mix(in srgb, var(--st-surface-2) 70%, transparent);
}
.admin-v3-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 0.65rem;
}
.admin-v3-card-head strong { font-size: 0.95rem; }
.v3-field-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--st-muted);
  margin: 0.55rem 0 0.25rem;
}
.admin-v3-list { display: flex; flex-direction: column; gap: 0.5rem; }
.admin-v3-list-row {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm, 8px);
  background: var(--st-surface, transparent);
}
.admin-v3-list-row strong { display: block; font-size: 0.88rem; }
.admin-v3-list-row .admin-v3-row-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  flex-shrink: 0;
}
.admin-v3-list-row .admin-v3-row-actions .v3-btn { font-size: 0.72rem; padding: 0.3rem 0.55rem; }

/* Admin v3 — AI desk */
.admin-v3-ai-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.admin-v3-chat-log {
  min-height: 14rem;
  max-height: min(52vh, 420px);
  overflow: auto;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.5rem 0.15rem 0.75rem;
  border-bottom: 1px solid var(--st-border);
  margin-bottom: 0.65rem;
}
.admin-v3-chat-bubble {
  max-width: 92%;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  font-size: 0.86rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}
.admin-v3-chat-bubble.is-user {
  align-self: flex-end;
  background: color-mix(in srgb, var(--st-accent) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--st-accent) 35%, transparent);
}
.admin-v3-chat-bubble.is-assistant {
  align-self: flex-start;
  background: var(--st-surface, transparent);
  border: 1px solid var(--st-border);
}
.admin-v3-chat-bubble .ai-mind-tag {
  display: block;
  font-size: 0.68rem;
  font-weight: 650;
  color: var(--st-muted);
  margin-bottom: 0.2rem;
}
.admin-v3-chat-compose {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 0.45rem;
  align-items: end;
}
@media (max-width: 640px) {
  .admin-v3-chat-compose {
    grid-template-columns: 1fr;
  }
}

.v3-sheet-body--ai {
  max-height: calc(100vh - 5.5rem);
  overflow: auto;
  padding-bottom: 1.5rem;
}
/* Arena port sits inside light/dark v3 sheet */
.v3-sheet-body--ai .ai-stage {
  background: transparent;
}

/* ===== Admin v3 shared section title bubbles (uniform across hubs) ===== */
.v3-learn-badge,
.v3-ops-badge,
.v3-sec-badge,
.v3-sys-badge,
.v3-soc-badge,
.v3-pl-badge,
.v3-dir-badge,
.v3-flt-badge,
.v3-section-badge {
  display: inline-flex !important;
  align-items: center;
  margin: 0 0 0.35rem;
  font-size: 0.58rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
  padding: 0.1rem 0.36rem !important;
  border-radius: 999px !important;
  line-height: 1.2;
  color: var(--st-text, #111) !important;
  background: color-mix(in srgb, var(--st-accent, #00b89c) 14%, var(--st-surface-2, #f3f4f6)) !important;
  border: 1px solid color-mix(in srgb, var(--st-accent, #00b89c) 28%, var(--st-border, #e5e7eb)) !important;
}
/* When badge sits in a row-actions header, keep vertical rhythm */
.v3-sys-row-actions > .v3-sys-badge,
.v3-ops-row-actions > .v3-ops-badge,
.v3-sec-row-actions > .v3-sec-badge,
.v3-soc-form > .v3-soc-badge,
.v3-pl-row-actions > .v3-pl-badge {
  margin-bottom: 0 !important;
}

/* Hub pulse visuals */
.v3-hub-sub { margin: 0 0 0.75rem; font-size: 0.82rem; }
.v3-status.is-warn { color: #b45309; }
.v3-status.is-warn::before {
  background: #f59e0b;
  box-shadow: 0 0 0 3px color-mix(in srgb, #f59e0b 22%, transparent);
}
.v3-status.is-err { color: #b91c1c; }
.v3-status.is-err::before {
  background: #ef4444;
  box-shadow: 0 0 0 3px color-mix(in srgb, #ef4444 22%, transparent);
}
.v3-status.is-on { color: var(--st-ok, #059669); }
.v3-hub-viz {
  margin-top: 0.45rem;
  width: 100%;
  height: auto;
  min-height: 0.35rem;
  justify-content: flex-start;
}
.v3-hub-bar {
  width: 100%;
  height: 0.35rem;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.25);
  overflow: hidden;
}
.v3-hub-bar > i {
  display: block;
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #14b8a6, #0d9488);
  transition: width 0.35s ease;
}
.v3-hub-bar.is-warn > i { background: linear-gradient(90deg, #f59e0b, #d97706); }
.v3-hub-bar.is-err > i { background: linear-gradient(90deg, #f87171, #dc2626); }
.v3-hub-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  margin-top: 0.15rem;
}
.v3-hub-chip {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
  border: 1px solid var(--st-border, #e5e7eb);
  background: color-mix(in srgb, var(--st-surface, #fff) 70%, transparent);
  color: var(--st-text, #0f172a);
}
.v3-foot-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
  line-height: 1.15;
}
.v3-foot-stat {
  font-size: 0.62rem;
  font-weight: 650;
  color: var(--st-muted, #6b7280);
  max-width: 7rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Admin hub category icons — vertically centered */
.v3-hub-bar-host {
  margin-top: 0.4rem;
  width: 100%;
  min-height: 0.35rem;
}
.v3-hub-tile > .v3-hub-viz {
  width: 3.6rem;
  height: 2rem;
  margin: 0;
  padding: 0;
  align-self: center;
  justify-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--st-accent, #0d9488);
  opacity: 0.9;
  flex-shrink: 0;
  line-height: 0;
}
.v3-hub-tile > .v3-hub-viz svg {
  width: 3.2rem;
  height: 1.75rem;
  display: block;
  margin: 0 auto;
  flex-shrink: 0;
}
.v3-hub-tile > .v3-hub-chev {
  align-self: center;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  margin: 0;
  padding: 0 0 0 0.15rem;
}
@media (min-width: 900px) {
  /* Keep icon on the right, vertically centered with body (not stacked bottom) */
  .v3-hub-tile {
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto;
    align-items: center;
    min-height: 0;
  }
  .v3-hub-tile > .v3-hub-viz {
    width: 3.8rem;
    height: 2.2rem;
    margin: 0;
    justify-self: end;
    align-self: center;
  }
  .v3-hub-tile > .v3-hub-viz svg {
    width: 3.5rem;
    height: 1.9rem;
  }
}

/* Mission Recent orders — grid table */
.v3-orders-table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--st-border, #e5e7eb);
  border-radius: 10px;
  background: color-mix(in srgb, var(--st-surface, #fff) 88%, transparent);
}
.v3-orders-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.72rem;
  font-variant-numeric: tabular-nums;
}
.v3-orders-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  text-align: right;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--st-muted, #6b7280);
  padding: 0.4rem 0.45rem;
  border-bottom: 1px solid var(--st-border, #e5e7eb);
  background: color-mix(in srgb, var(--st-surface-2, #f8fafc) 92%, transparent);
  white-space: nowrap;
}
.v3-orders-table thead th.is-left,
.v3-orders-table td.is-left {
  text-align: left;
}
.v3-orders-table td {
  text-align: right;
  padding: 0.42rem 0.45rem;
  border-bottom: 1px solid color-mix(in srgb, var(--st-border, #e5e7eb) 70%, transparent);
  vertical-align: middle;
  white-space: nowrap;
}
.v3-orders-table tbody tr:last-child td {
  border-bottom: 0;
}
.v3-orders-table tbody tr.v3-order-row {
  cursor: pointer;
}
.v3-orders-table tbody tr.v3-order-row:hover td {
  background: color-mix(in srgb, var(--st-accent, #14b8a6) 8%, transparent);
}
.v3-orders-table .v3-order-side {
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  padding: 0.08rem 0.35rem;
  border-radius: 999px;
}
.v3-orders-table .v3-order-side.is-long {
  color: #047857;
  background: rgba(16, 185, 129, 0.14);
}
.v3-orders-table .v3-order-side.is-short {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
}
.v3-orders-table td.is-num {
  font-variant-numeric: tabular-nums;
}





/* P&L green / red — orders table + detail + strip */
.v3-orders-table td.v3-pos,
.v3-orders-table .v3-pos,
.v3-orders-strip .v3-pos,
.v3-od-row strong.v3-pos,
.v3-od-metrics .v3-pos {
  color: #059669 !important;
  font-weight: 750;
}
.v3-orders-table td.v3-neg,
.v3-orders-table .v3-neg,
.v3-orders-strip .v3-neg,
.v3-od-row strong.v3-neg,
.v3-od-metrics .v3-neg {
  color: #dc2626 !important;
  font-weight: 750;
}
html[data-theme="dark"] .v3-orders-table td.v3-pos,
html[data-theme="dark"] .v3-orders-table .v3-pos,
html[data-theme="dark"] .v3-orders-strip .v3-pos,
html[data-theme="dark"] .v3-od-row strong.v3-pos,
html[data-theme="dark"] .v3-od-metrics .v3-pos {
  color: #34d399 !important;
}
html[data-theme="dark"] .v3-orders-table td.v3-neg,
html[data-theme="dark"] .v3-orders-table .v3-neg,
html[data-theme="dark"] .v3-orders-strip .v3-neg,
html[data-theme="dark"] .v3-od-row strong.v3-neg,
html[data-theme="dark"] .v3-od-metrics .v3-neg {
  color: #f87171 !important;
}

/* Recent orders — R4 sticky pair · R6 light theme */
.v3-orders-table thead th.is-left,
.v3-orders-table td.is-left {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--st-surface, #fff);
  box-shadow: 4px 0 8px -4px rgba(0, 0, 0, 0.12);
}
.v3-orders-table thead th.is-left {
  z-index: 3;
  background: color-mix(in srgb, var(--st-surface-2, #f8fafc) 96%, transparent);
}
.v3-orders-table tbody tr.v3-order-row:hover td.is-left {
  background: color-mix(in srgb, var(--st-accent, #14b8a6) 10%, var(--st-surface, #fff));
}
html[data-theme="dark"] .v3-orders-table thead th.is-left,
html[data-theme="dark"] .v3-orders-table td.is-left {
  background: #0f1419;
}
html[data-theme="dark"] .v3-orders-table thead th.is-left {
  background: #121820;
}
html[data-theme="dark"] .v3-orders-table tbody tr.v3-order-row:hover td.is-left {
  background: color-mix(in srgb, #14b8a6 12%, #0f1419);
}
@media (max-width: 520px) {
  .v3-orders-table {
    font-size: 0.65rem;
  }
  .v3-orders-table thead th,
  .v3-orders-table td {
    padding: 0.32rem 0.32rem;
  }
  .v3-orders-table thead th {
    font-size: 0.52rem;
  }
}
.v3-orders-tab.is-on {
  color: #0f766e;
  border-color: color-mix(in srgb, #14b8a6 45%, var(--st-border));
  background: color-mix(in srgb, #14b8a6 12%, var(--st-surface));
  font-weight: 750;
}
html[data-theme="dark"] .v3-orders-tab.is-on {
  color: #5eead4;
  background: color-mix(in srgb, #14b8a6 16%, var(--st-surface));
}
html[data-theme="light"] .v3-orders-tab {
  color: #475569;
}
html[data-theme="light"] .v3-orders-tab.is-on {
  color: #0f766e;
}
html[data-theme="light"] .v3-orders-table thead th {
  color: #64748b;
}
html[data-theme="light"] .v3-orders-table td {
  color: #0f172a;
}
html[data-theme="light"] .v3-orders-table .v3-order-side.is-long {
  color: #047857;
  background: rgba(16, 185, 129, 0.14);
}
html[data-theme="light"] .v3-orders-table .v3-order-side.is-short {
  color: #b91c1c;
  background: rgba(239, 68, 68, 0.12);
}
html[data-theme="dark"] .v3-orders-table .v3-order-side.is-long {
  color: #6ee7b7;
  background: rgba(16, 185, 129, 0.18);
}
html[data-theme="dark"] .v3-orders-table .v3-order-side.is-short {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.16);
}
html[data-theme="light"] .v3-pos {
  color: #047857;
}
html[data-theme="light"] .v3-neg {
  color: #b91c1c;
}
html[data-theme="light"] .v3-od-row span {
  color: #64748b;
}
html[data-theme="light"] .v3-od-row strong {
  color: #0f172a;
}

/* Ava support popup */
.v3-ava-popup { width: min(440px, 100%); max-height: min(78dvh, 640px); display: flex; flex-direction: column; }
.v3-ava-body { display: flex; flex-direction: column; gap: 0.5rem; padding: 0 0.15rem 0.35rem; min-height: 0; flex: 1; }
.v3-ava-log {
  flex: 1; min-height: 10rem; max-height: min(42dvh, 320px); overflow: auto;
  border: 1px solid var(--st-border); border-radius: var(--st-radius-sm);
  background: var(--st-surface); padding: 0.55rem 0.65rem;
  display: flex; flex-direction: column; gap: 0.45rem;
}
.v3-ava-msg { font-size: 0.82rem; line-height: 1.4; margin: 0; }
.v3-ava-msg.is-user { color: var(--st-text); font-weight: 600; }
.v3-ava-msg.is-ava { color: var(--st-muted); }
.v3-ava-msg.is-ava strong { color: var(--st-accent, #00c2a8); font-weight: 700; }
.v3-ava-form { display: flex; flex-direction: column; gap: 0.45rem; }
.v3-ava-form textarea {
  width: 100%; resize: vertical; min-height: 2.6rem; max-height: 8rem;
  border-radius: var(--st-radius-sm); border: 1px solid var(--st-border);
  background: var(--st-surface); color: var(--st-text); font: inherit; padding: 0.5rem 0.6rem;
}
.v3-ava-form .v3-btn { align-self: flex-end; }

@media (max-width: 899px) {
  #v3-ava-layer .v3-popup,
  #v3-ava-layer .v3-ava-popup,
  #v3-ava-layer .v3-popup-sm {
    width: 100%;
    max-width: 100%;
    height: 92dvh;
    max-height: 92dvh;
    margin: 0;
    border-radius: 14px 14px 0 0;
  }
  #v3-ava-layer .v3-ava-log {
    max-height: none;
    min-height: 8rem;
    flex: 1 1 auto;
  }
  #v3-ava-layer .v3-ava-form textarea {
    min-height: 11rem;
    max-height: 18rem;
  }
}

/* —— Legal pages (Terms / Privacy) · Mission v3 theme —— */
.v3-legal-page .v3-legal-main {
  max-width: 42rem;
  margin: 0 auto;
  padding: 0.5rem var(--st-pad, 1rem) 2.5rem;
}
.v3-legal-main h1 {
  margin: 0.15rem 0 0.5rem;
  font-size: 1.45rem;
  font-weight: 750;
  letter-spacing: -0.02em;
  color: var(--st-text);
}
.v3-legal-main h2 {
  margin: 1.35rem 0 0.45rem;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--st-accent, #00b89c);
  text-transform: uppercase;
}
.v3-legal-main h3 {
  margin: 0.9rem 0 0.35rem;
  font-size: 0.88rem;
  font-weight: 650;
  color: var(--st-text);
}
.v3-legal-main p,
.v3-legal-main li {
  font-size: 0.88rem;
  line-height: 1.55;
  color: var(--st-muted);
}
.v3-legal-main p { margin: 0 0 0.65rem; }
.v3-legal-main ul,
.v3-legal-main ol {
  margin: 0 0 0.75rem;
  padding-left: 1.15rem;
}
.v3-legal-main a {
  color: var(--st-accent, #00b89c);
  text-decoration: none;
  font-weight: 600;
}
.v3-legal-main a:hover { text-decoration: underline; }
.v3-legal-meta {
  font-size: 0.78rem !important;
  color: var(--st-muted) !important;
  margin-bottom: 1rem !important;
}
.v3-legal-section {
  margin: 0.25rem 0 0.5rem;
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius, 12px);
  background: color-mix(in srgb, var(--st-surface) 88%, transparent);
}
.v3-legal-foot {
  margin-top: 1.75rem;
  padding-top: 1rem;
  border-top: 1px solid var(--st-border);
  font-size: 0.8rem;
  color: var(--st-muted);
}
.v3-brand-link:hover { opacity: 0.9; }


/* —— Legal TOC · two-column bubble —— */
.v3-legal-toc {
  display: block;
  margin: 0.75rem 0 1.25rem;
  padding: 0.75rem 0.9rem 0.9rem;
  border: 1px solid var(--st-border, #e2e8f0);
  border-radius: 14px;
  background: var(--st-surface, #ffffff);
  box-shadow: 0 1px 2px rgba(15, 40, 60, 0.04);
}
.v3-legal-toc-title {
  margin: 0 0 0.55rem !important;
  font-size: 0.72rem !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--st-accent, #00b89c) !important;
}
.v3-legal-toc-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 0.3rem 0.85rem !important;
  align-items: start;
}
.v3-legal-toc-grid a {
  display: block;
  font-size: 0.8rem !important;
  font-weight: 550 !important;
  line-height: 1.35;
  color: var(--st-text, #0f1b2a) !important;
  text-decoration: none !important;
  padding: 0.2rem 0;
  border-bottom: none !important;
}
.v3-legal-toc-grid a:hover {
  color: var(--st-accent, #00b89c) !important;
  text-decoration: underline !important;
}
html[data-theme="dark"] .v3-legal-toc {
  background: color-mix(in srgb, var(--st-surface, #0a0a0a) 92%, transparent);
  border-color: var(--st-border, rgba(148,163,184,0.2));
}
html[data-theme="dark"] .v3-legal-toc-grid a {
  color: var(--st-text, #e2e8f0) !important;
}
@media (max-width: 420px) {
  .v3-legal-toc-grid {
    grid-template-columns: 1fr !important;
  }
}
/* Embed path (Mission sheet) */
.v3-legal-embed-content .v3-legal-toc {
  display: block;
  margin: 0.5rem 0 1rem;
  padding: 0.65rem 0.75rem 0.8rem;
  border: 1px solid var(--st-border);
  border-radius: 12px;
  background: var(--st-surface, #fff);
}
.v3-legal-embed-content .v3-legal-toc-grid {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 0.28rem 0.75rem !important;
}


/* Dark theme — true black surfaces (Admin + Mission v3) */
html[data-theme="dark"] {
  color-scheme: dark;
  --st-bg: #000000;
  --st-surface: #0a0a0a;
  --st-surface-2: #141414;
  --st-elevated: #1a1a1a;
  --st-border: rgba(255, 255, 255, 0.1);
  --st-text: #f4f4f5;
  --st-muted: #a1a1aa;
  --st-accent: #2dd4bf;
  --st-teal: #14b8a6;
  --st-ok: #2dd4bf;
  --st-danger: #f87171;
  --st-bg-wash: none;
  --st-shadow: 0 10px 28px rgba(0, 0, 0, 0.55);
  background-color: #000000 !important;
  background-image: none !important;
}
html[data-theme="dark"] body,
html[data-theme="dark"] body.v3-shell,
html[data-theme="dark"] .v3-shell {
  background-color: #000000 !important;
  background-image: none !important;
  color: var(--st-text);
}
html[data-theme="dark"] .v3-topbar,
html[data-theme="dark"] .v3-sheet,
html[data-theme="dark"] .v3-sheet-body,
html[data-theme="dark"] .v3-card,
html[data-theme="dark"] .v3-hub-card,
html[data-theme="dark"] .v3-menu {
  background: #0a0a0a !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: var(--st-text);
}
html[data-theme="dark"] .v3-sheet-scrim {
  background: rgba(0, 0, 0, 0.72) !important;
}
html[data-theme="dark"] .v3-icon-btn {
  background: #141414 !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}


.v3-auto-seats-line {
  margin: 0.15rem 0 0.35rem;
  font-size: 0.78rem;
  color: var(--st-muted);
  letter-spacing: 0.01em;
}


/* Order detail — clean sections */
.v3-od-sec {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-elevated, var(--st-surface));
}
.v3-od-sec-title {
  margin: 0 0 0.45rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0d9488;
}
html[data-theme="dark"] .v3-od-sec-title {
  color: #5eead4;
}
.v3-od-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.75rem;
}
.v3-od-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
  min-width: 0;
}
.v3-od-row span {
  font-size: 0.68rem;
  color: var(--st-muted);
  flex-shrink: 0;
}
.v3-od-row strong {
  font-size: 0.8rem;
  font-weight: 700;
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v3-od-thesis-body {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--st-text);
}
.v3-od-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.v3-od-actions .v3-od-sec-title {
  margin-bottom: 0.25rem;
}


/* Order detail — Position head + 3-col invisible grid */
.v3-od-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.v3-od-sec-head .v3-od-sec-title {
  margin: 0;
}
.v3-od-sec-meta {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--st-muted);
  text-align: right;
  line-height: 1.3;
  min-width: 0;
}
.v3-od-sec-meta-sep {
  opacity: 0.5;
  margin: 0 0.2rem;
}
.v3-od-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem 0.65rem;
  border: none;
  background: transparent;
}
.v3-od-cell {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  border: none;
  padding: 0;
  background: transparent;
}
.v3-od-cell-lab {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--st-muted);
}
.v3-od-cell-val {
  font-size: 0.84rem;
  font-weight: 750;
  color: var(--st-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v3-od-cell-val.v3-pos { color: #059669; }
.v3-od-cell-val.v3-neg { color: #dc2626; }
html[data-theme="dark"] .v3-od-cell-val.v3-pos { color: #34d399; }
html[data-theme="dark"] .v3-od-cell-val.v3-neg { color: #f87171; }
@media (max-width: 380px) {
  .v3-od-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}


/* Journal J4 light theme · J5 sticky pair · J6 detail grid */
html[data-theme="light"] .v3-j-tab {
  color: #475569;
}
html[data-theme="light"] .v3-j-tab.is-on {
  color: #0f766e;
  border-color: color-mix(in srgb, #14b8a6 45%, var(--st-border));
  background: color-mix(in srgb, #14b8a6 12%, var(--st-surface));
  font-weight: 750;
}
html[data-theme="dark"] .v3-j-tab.is-on {
  color: #5eead4;
}
html[data-theme="light"] .v3-j-k span {
  color: #64748b;
}
html[data-theme="light"] .v3-j-k strong {
  color: #0f172a;
}
html[data-theme="light"] .v3-j-up,
html[data-theme="light"] .v3-j-side-long {
  color: #047857 !important;
}
html[data-theme="light"] .v3-j-down,
html[data-theme="light"] .v3-j-side-short {
  color: #b91c1c !important;
}
html[data-theme="dark"] .v3-j-up,
html[data-theme="dark"] .v3-j-side-long {
  color: #34d399 !important;
}
html[data-theme="dark"] .v3-j-down,
html[data-theme="dark"] .v3-j-side-short {
  color: #f87171 !important;
}
.v3-j-list-head span:first-child,
.v3-j-row .v3-j-pair {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--st-surface, #fff);
  box-shadow: 4px 0 8px -4px rgba(0, 0, 0, 0.1);
}
.v3-j-list-head span:first-child {
  z-index: 3;
  background: color-mix(in srgb, var(--st-surface-2, #f8fafc) 96%, transparent);
}
html[data-theme="dark"] .v3-j-list-head span:first-child,
html[data-theme="dark"] .v3-j-row .v3-j-pair {
  background: #0f1419;
}
html[data-theme="dark"] .v3-j-list-head span:first-child {
  background: #121820;
}
.v3-j-row:hover .v3-j-pair,
.v3-j-row.is-selected .v3-j-pair {
  background: color-mix(in srgb, var(--st-accent, #14b8a6) 12%, var(--st-surface, #fff));
}
.v3-j-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.55rem 0.65rem;
  border: none;
}
.v3-j-cell {
  padding: 0;
  border: none;
  background: transparent;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
}
.v3-j-cell span {
  display: block;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--st-muted);
}
.v3-j-cell b {
  font-size: 0.84rem;
  font-weight: 750;
  color: var(--st-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.v3-j-sec {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.7rem;
  border: 1px solid var(--st-border);
  border-radius: var(--st-radius-sm);
  background: var(--st-elevated, var(--st-surface));
}
.v3-j-sec-h {
  margin: 0 0 0.45rem;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #0d9488;
}
html[data-theme="dark"] .v3-j-sec-h {
  color: #5eead4;
}
.v3-j-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.v3-j-sec-head .v3-j-sec-h {
  margin: 0;
}
.v3-j-sec-meta {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--st-muted);
  text-align: right;
}
.v3-j-sec-meta-sep {
  opacity: 0.5;
  margin: 0 0.2rem;
}
.v3-j-thesis-body {
  margin: 0;
  font-size: 0.84rem;
  line-height: 1.45;
  color: var(--st-text);
}
@media (max-width: 420px) {
  .v3-j-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .v3-j-list-head,
  .v3-j-row {
    font-size: 0.68rem;
    grid-template-columns: minmax(3.5rem, 1fr) 2rem 3.6rem 2.6rem 3rem minmax(4.5rem, 1fr);
  }
}


/* Journal Position 4×3 left-aligned */
.v3-j-grid--pos {
  grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  grid-template-rows: repeat(3, auto);
  gap: 0.55rem 0.75rem;
}
.v3-j-grid--pos .v3-j-cell {
  text-align: left;
  align-items: flex-start;
}
.v3-j-grid--pos .v3-j-cell span,
.v3-j-grid--pos .v3-j-cell b {
  text-align: left;
  width: 100%;
}
@media (max-width: 420px) {
  .v3-j-grid--pos {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    grid-template-rows: none;
  }
}

.v3-j-bullets {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--st-text);
}
.v3-j-bullets li { margin: 0.15rem 0; }

.v3-j-exit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem 0.65rem;
}
.v3-j-exit-cell {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  min-width: 0;
}
.v3-j-exit-cell span {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--st-muted);
}
.v3-j-exit-cell b {
  font-size: 0.88rem;
  font-weight: 750;
  color: var(--st-text);
}
@media (max-width: 420px) {
  .v3-j-exit-grid { grid-template-columns: 1fr; }
}

/* Forced exposure strip — Leverage / Cost / Notional always visible */
.v3-j-exposure {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
  margin: 0 0 0.65rem;
  padding: 0.55rem 0.6rem;
  border-radius: 10px;
  border: 1px solid color-mix(in srgb, #14b8a6 35%, var(--st-border));
  background: color-mix(in srgb, #14b8a6 10%, var(--st-surface));
}
.v3-j-exp-item {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}
.v3-j-exp-item span {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--st-muted);
}
.v3-j-exp-item strong {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--st-text);
  font-variant-numeric: tabular-nums;
}
html[data-theme="light"] .v3-j-exp-item strong {
  color: #0f172a;
}
html[data-theme="dark"] .v3-j-exp-item strong {
  color: #f1f5f9;
}


/* Equity chart: never allow mobile text selection / callout while crosshairing */
#v3-equity-body,
#v3-equity-body *,
.v3-eq,
.v3-eq *,
.v3-eq-chart,
.v3-eq-chart *,
#v3-equity-chart,
canvas#v3-equity-chart,
.v3-eq-chart-noselect {
  -webkit-user-select: none !important;
  -moz-user-select: none !important;
  -ms-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none !important;
  -webkit-user-drag: none !important;
}
#v3-equity-chart,
canvas#v3-equity-chart {
  touch-action: none !important;
}

html[data-theme=dark] #bill-beta-text, html[data-theme=dark] .bill-beta-scroll {
  background: #0a0a0a !important;
  border-color: #222 !important;
  color: #e8eef4;
}


.v3-j-more {
  display: block;
  width: 100%;
  margin: 0.5rem 0 0.25rem;
  font-size: 0.78rem;
}

.v3-eq-chart-wrap.is-loading{opacity:.55;transition:opacity .15s}

.v3-arena-book {
  margin: 0.35rem 0 0.15rem;
  justify-content: flex-start;
}

.v3-board-tabs-row{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:0.45rem;
  flex-wrap:nowrap;
  width:100%;
}
.v3-board-tabs-row .v3-seg{
  margin:0;
  flex:0 0 auto;
  flex-wrap:nowrap;
}
.v3-mkt-focus-cluster{
  display:flex;
  align-items:center;
  gap:0.4rem;
  min-width:0;
  max-width:62%;
  flex:0 1 auto;
}
.v3-mkt-focus-view{
  flex:0 0 auto;
  font-size:0.72rem;
  font-weight:650;
  letter-spacing:0.02em;
  color:var(--st-muted);
  white-space:nowrap;
}
#v3-mkt-focus-open{
  display:inline-flex;
  align-items:center;
  gap:0.35rem;
  min-width:0;
  max-width:100%;
  overflow:hidden;
}
#v3-mkt-focus-open .v3-mkt-focus-ico{
  width:16px;
  height:16px;
  border-radius:3px;
  object-fit:cover;
  flex:0 0 auto;
}
#v3-mkt-focus-open .v3-mkt-focus-txt{
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
}
#v3-mkt-focus-open.is-on{
  color:var(--st-accent);
  border-color:color-mix(in srgb, var(--st-accent) 40%, var(--st-border));
  background:color-mix(in srgb, var(--st-accent) 10%, transparent);
}

.v3-bottom .v3-foot-btn{
  flex-direction:row;
  align-items:center;
  justify-content:center;
  gap:0.4rem;
  color:var(--st-muted);
}
.v3-bottom .v3-foot-btn:hover,
.v3-bottom .v3-foot-btn.is-on{
  color:var(--st-accent);
}
.v3-bottom .v3-foot-label{
  color:inherit;
}
.v3-bottom .v3-foot-ico{
  color:var(--st-accent);
}

.v3-focus-ranges{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:0.45rem;
  flex-wrap:nowrap;
  margin-bottom:0.4rem;
}
.v3-focus-window-lab{
  font-size:0.62rem;
  font-weight:700;
  letter-spacing:0.04em;
  text-transform:uppercase;
  color:var(--st-muted);
  flex:0 0 auto;
}
.v3-focus-dd{
  position:relative;
  flex:0 0 auto;
}
.v3-focus-window{
  -webkit-appearance:none;
  appearance:none;
  min-width:3.6rem;
  height:1.38rem;
  border:1px solid color-mix(in srgb, var(--st-accent) 50%, var(--st-border));
  border-radius:999px;
  background:color-mix(in srgb, var(--st-accent) 12%, var(--st-surface));
  color:var(--st-accent);
  font:650 0.68rem/1 inherit;
  padding:0 1.15rem 0 0.5rem;
  cursor:pointer;
}
.v3-focus-window::after{
  content:"";
  position:absolute;
  right:0.42rem;
  top:50%;
  width:0.42rem;
  height:0.42rem;
  transform:translateY(-60%) rotate(45deg);
  border-right:1.5px solid var(--st-accent);
  border-bottom:1.5px solid var(--st-accent);
  pointer-events:none;
}
.v3-focus-dd .v3-focus-window{ position:relative; }
.v3-focus-dd-menu{
  position:absolute;
  top:calc(100% + 0.28rem);
  left:auto;
  right:0;
  z-index:40;
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:0.18rem;
  min-width:10.6rem;
  padding:0.32rem;
  border:1px solid var(--st-border);
  border-radius:10px;
  background:var(--st-surface);
  box-shadow:0 8px 24px color-mix(in srgb, #000 18%, transparent);
}
.v3-focus-dd-menu[hidden]{ display:none !important; }
.v3-focus-dd-opt{
  border:1px solid transparent;
  border-radius:7px;
  background:transparent;
  color:var(--st-muted);
  font:650 0.62rem/1 inherit;
  padding:0.28rem 0.2rem;
  cursor:pointer;
}
.v3-focus-dd-opt:hover{
  color:var(--st-text);
  background:color-mix(in srgb, var(--st-accent) 10%, var(--st-surface-2));
}
.v3-focus-dd-opt.is-on{
  color:var(--st-accent);
  border-color:color-mix(in srgb, var(--st-accent) 45%, var(--st-border));
  background:color-mix(in srgb, var(--st-accent) 14%, var(--st-surface));
}
.v3-focus-window:focus{
  outline:none;
  border-color:var(--st-accent);
  box-shadow:0 0 0 2px var(--st-accent-glow);
}



.v3-od-legs{list-style:none;margin:0;padding:0;font-size:0.72rem;line-height:1.35;}
.v3-od-legs li{padding:0.18rem 0;border-bottom:1px solid var(--st-border);}
.v3-od-leg-k{font-weight:700;color:var(--st-accent);}


#v3-order-detail.is-locked [data-close-order-detail] {
  pointer-events: none;
  opacity: 0.35;
}
