/* ==========================================================================
   National Team ETF Monitor — Minimalist WeChat H5 Design System
   A-Share Convention: Crimson = Inflow / Up, Emerald = Outflow / Down
   ========================================================================== */

:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-subtle: #f8fafc;
  --surface-hover: #f1f5f9;
  --border: rgba(15, 23, 42, 0.065);
  --border-strong: rgba(15, 23, 42, 0.12);
  --ink: #0f172a;
  --ink-2: #475569;
  --ink-3: #94a3b8;

  --up: #d92d20;
  --up-soft: rgba(217, 45, 32, 0.09);
  --up-line: rgba(217, 45, 32, 0.22);

  --down: #059669;
  --down-soft: rgba(5, 150, 105, 0.09);
  --down-line: rgba(5, 150, 105, 0.22);

  --accent: #1e293b;
  --amber: #d97706;
  --amber-soft: rgba(217, 119, 6, 0.1);

  --nav-bg: rgba(255, 255, 255, 0.88);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.03), 0 6px 20px -12px rgba(15, 23, 42, 0.08);
  --shadow-sheet: 0 -10px 40px rgba(15, 23, 42, 0.16);
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

[data-theme="dark"] {
  --bg: #0b0e14;
  --surface: #131822;
  --surface-subtle: #19202d;
  --surface-hover: #1e2736;
  --border: rgba(255, 255, 255, 0.075);
  --border-strong: rgba(255, 255, 255, 0.15);
  --ink: #f1f5f9;
  --ink-2: #94a3b8;
  --ink-3: #64748b;

  --up: #f87171;
  --up-soft: rgba(248, 113, 113, 0.13);
  --up-line: rgba(248, 113, 113, 0.28);

  --down: #34d399;
  --down-soft: rgba(52, 211, 153, 0.12);
  --down-line: rgba(52, 211, 153, 0.26);

  --accent: #e2e8f0;
  --amber: #fbbf24;
  --amber-soft: rgba(251, 191, 36, 0.14);

  --nav-bg: rgba(19, 24, 34, 0.88);
  --shadow-card: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-sheet: 0 -10px 40px rgba(0, 0, 0, 0.5);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "SF Pro Text", "Inter", "Microsoft YaHei", sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

.num, .hero-big-num, .hero-mid-num, .meta-v, .score-val,
.idx-val, .idx-chg, .etf-price, .etf-chg, .etf-flow-val,
.etf-amt, .radar-kpi-val, .hist-row, .sheet-kpi-val, .tier-val {
  font-variant-numeric: tabular-nums;
}

.up { color: var(--up) !important; }
.down { color: var(--down) !important; }
.muted { color: var(--ink-2) !important; }
.hidden { display: none !important; }

/* Shell */
.app-shell {
  max-width: 480px;
  min-height: 100vh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* Top Bar */
.top-bar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--nav-bg);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}

.top-bar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px 10px;
}

.brand-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.brand-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
  flex-shrink: 0;
}

.brand-dot.live {
  background: var(--up);
  box-shadow: 0 0 0 3px var(--up-soft);
  animation: pulseDot 2s infinite;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.72; }
}

.brand-title {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.brand-sub {
  font-size: 11.5px;
  color: var(--ink-2);
  margin-top: 2px;
  padding-left: 14px;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, transform 0.12s;
}

.icon-btn:active {
  transform: scale(0.92);
}

.icon-btn.spinning svg {
  animation: spin 0.75s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Main Content */
.main-content {
  flex: 1;
  padding: 12px 14px calc(76px + env(safe-area-inset-bottom));
}

/* Loading Skeleton */
.skeleton-wrap {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.skeleton-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

.skeleton-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(148, 163, 184, 0.1), transparent);
  animation: shimmer 1.3s infinite;
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

.skeleton-card.tall { height: 190px; }
.skeleton-card.chart { height: 215px; }
.skeleton-card.sm { height: 84px; }
.skeleton-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* Card Base */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
}

/* Benchmark Index Strip */
.index-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 11px;
}

.idx-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 8px;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.idx-name {
  font-size: 11px;
  color: var(--ink-2);
  font-weight: 500;
}

.idx-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 3px;
  min-width: 0;
}

.idx-val {
  font-size: 12.5px;
  font-weight: 650;
  color: var(--ink);
  white-space: nowrap;
}

.idx-chg {
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* Hero Card */
.hero-card {
  padding: 16px 16px 14px;
  margin-bottom: 12px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.signal-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-subtle);
  color: var(--ink-2);
  border: 1px solid var(--border);
}

.signal-pill .signal-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.signal-pill.strong_in, .signal-pill.in {
  background: var(--up-soft);
  color: var(--up);
  border-color: var(--up-line);
}

.signal-pill.out {
  background: var(--down-soft);
  color: var(--down);
  border-color: var(--down-line);
}

.score-chip {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
}

.score-label {
  font-size: 11px;
  color: var(--ink-2);
}

.score-val {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
}

.hero-numbers {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.metric-caption {
  font-size: 11.5px;
  color: var(--ink-2);
  margin-bottom: 3px;
}

.hero-big-num {
  font-size: 31px;
  font-weight: 750;
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.hero-secondary {
  text-align: right;
}

.hero-mid-num {
  font-size: 18px;
  font-weight: 680;
  letter-spacing: -0.02em;
}

.hero-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px 14px;
  padding: 12px 0 11px;
}

.meta-cell {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}

.meta-k {
  font-size: 11px;
  color: var(--ink-2);
  white-space: nowrap;
}

.meta-v {
  font-size: 12.5px;
  font-weight: 620;
  color: var(--ink);
  white-space: nowrap;
}

.hero-summary {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
  background: var(--surface-subtle);
  padding: 9px 11px;
  border-radius: var(--radius-sm);
}

/* Chart Card */
.chart-card {
  padding: 14px 14px 12px;
  margin-bottom: 14px;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.card-header.compact {
  align-items: center;
  margin-bottom: 8px;
}

.card-title {
  margin: 0;
  font-size: 14.5px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.card-sub {
  font-size: 11.5px;
  color: var(--ink-2);
  margin-top: 2px;
  min-height: 16px;
}

.segmented {
  display: inline-flex;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 2px;
  flex-shrink: 0;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 550;
  padding: 4px 10px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}

.seg-btn.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 650;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.canvas-wrap {
  position: relative;
  width: 100%;
  height: 176px;
  touch-action: pan-y;
}

.canvas-wrap.tall-canvas { height: 196px; }
.canvas-wrap.detail-canvas { height: 164px; }
.canvas-wrap.mini-canvas { height: 108px; }

.canvas-wrap canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-legend {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-3);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.leg-line {
  width: 12px;
  height: 2px;
  background: var(--up);
  border-radius: 2px;
  display: inline-block;
}

.leg-bar {
  width: 7px;
  height: 8px;
  background: rgba(148, 163, 184, 0.45);
  border-radius: 1.5px;
  display: inline-block;
}

.leg-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  display: inline-block;
}

/* Section Headers */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 2px 9px;
}

.section-head.list-head {
  margin-top: 15px;
  margin-bottom: 8px;
}

.section-title {
  margin: 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
}

.text-btn {
  border: none;
  background: none;
  color: var(--up);
  font-size: 12px;
  font-weight: 550;
  cursor: pointer;
  padding: 2px 4px;
}

.update-stamp {
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

/* 4-Group Sector Grid */
.group-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 9px;
}

.group-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 11px 12px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, transform 0.12s;
  box-shadow: var(--shadow-card);
}

.group-card:active { transform: scale(0.98); }

.group-card.active {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.group-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.group-name {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
}

.group-chg {
  font-size: 11.5px;
  font-weight: 600;
}

.group-flow {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.group-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-2);
}

/* Sort Chips */
.sort-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 8px;
  margin-bottom: 4px;
  scrollbar-width: none;
}

.sort-bar::-webkit-scrollbar { display: none; }

.sort-chip {
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12px;
  font-weight: 520;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}

.sort-chip.active {
  background: var(--ink);
  color: var(--surface);
  border-color: var(--ink);
  font-weight: 600;
}

/* ETF List */
.etf-list-card {
  overflow: hidden;
}

.etf-row {
  display: grid;
  grid-template-columns: minmax(0, 1.48fr) minmax(0, 0.72fr) minmax(0, 0.92fr);
  align-items: center;
  gap: 6px;
  padding: 12px 13px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s;
}

.etf-row:last-child { border-bottom: none; }
.etf-row:active { background: var(--surface-hover); }

.etf-left {
  min-width: 0;
}

.etf-name-line {
  display: flex;
  align-items: center;
  gap: 5px;
}

.etf-name {
  font-size: 13.5px;
  font-weight: 630;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.etf-sub-line {
  display: flex;
  align-items: center;
  gap: 5px;
  margin-top: 3px;
  font-size: 11px;
  color: var(--ink-3);
}

.etf-tag {
  font-size: 10px;
  font-weight: 550;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--surface-subtle);
  color: var(--ink-2);
  border: 1px solid var(--border);
  white-space: nowrap;
}

.prem-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 4px;
  white-space: nowrap;
  flex-shrink: 0;
}

.prem-badge.up { background: var(--up-soft); }
.prem-badge.down { background: var(--down-soft); }

.etf-mid {
  text-align: right;
}

.etf-price {
  font-size: 13.5px;
  font-weight: 630;
}

.etf-chg {
  font-size: 11.5px;
  font-weight: 580;
  margin-top: 2px;
}

.etf-right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.etf-flow-val {
  font-size: 13.5px;
  font-weight: 680;
}

.etf-amt {
  font-size: 11px;
  color: var(--ink-2);
}

.mini-bar-track {
  width: 66px;
  height: 3.5px;
  background: var(--surface-subtle);
  border-radius: 4px;
  overflow: hidden;
}

.mini-bar-fill {
  height: 100%;
  border-radius: 4px;
}

.mini-bar-fill.up { background: var(--up); }
.mini-bar-fill.down { background: var(--down); }

/* Footnote */
.footnote {
  text-align: center;
  font-size: 11px;
  color: var(--ink-3);
  padding: 16px 8px 6px;
  line-height: 1.6;
}

/* TAB 2: Signals Radar */
.radar-summary-card {
  padding: 14px;
  margin-bottom: 12px;
}

.radar-kpi-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  text-align: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.radar-kpi-val {
  font-size: 21px;
  font-weight: 720;
  color: var(--ink);
}

.radar-kpi-lbl {
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 2px;
}

.radar-tail-bar {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-2);
  background: var(--surface-subtle);
  padding: 8px 10px;
  border-radius: var(--radius-sm);
}

.timeline-card {
  padding: 6px 14px;
  margin-bottom: 12px;
}

.timeline-item {
  display: flex;
  gap: 11px;
  padding: 11px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
}

.timeline-item:last-child { border-bottom: none; }

.tl-time-col {
  width: 42px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 2px;
}

.tl-time {
  font-size: 12px;
  font-weight: 650;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
}

.tl-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-top: 6px;
  background: var(--ink-3);
}

.tl-dot.in { background: var(--up); }
.tl-dot.out { background: var(--down); }

.tl-content {
  flex: 1;
  min-width: 0;
}

.tl-head {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tl-type-badge {
  font-size: 10px;
  font-weight: 620;
  padding: 1px 6px;
  border-radius: 4px;
}

.tl-type-badge.sync_sweep {
  background: var(--amber-soft);
  color: var(--amber);
}

.tl-type-badge.volume_burst {
  background: var(--up-soft);
  color: var(--up);
}

.tl-type-badge.volume_burst.out {
  background: var(--down-soft);
  color: var(--down);
}

.tl-type-badge.premium {
  background: var(--surface-subtle);
  color: var(--ink-2);
  border: 1px solid var(--border);
}

.tl-title {
  font-size: 13px;
  font-weight: 630;
  color: var(--ink);
}

.tl-detail {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 3px;
  line-height: 1.45;
}

.empty-state {
  text-align: center;
  padding: 28px 12px;
  color: var(--ink-3);
  font-size: 12.5px;
}

/* Algorithm Info Accordion */
.algo-card {
  padding: 12px 14px;
}

.algo-summary {
  font-size: 13px;
  font-weight: 620;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.algo-summary::after {
  content: "+";
  font-size: 16px;
  color: var(--ink-3);
}

.algo-card[open] .algo-summary::after {
  content: "−";
}

.algo-body {
  margin-top: 10px;
  font-size: 12px;
  color: var(--ink-2);
  line-height: 1.6;
}

.algo-body p {
  margin: 0 0 8px;
}

.algo-body p:last-child { margin-bottom: 0; }

/* TAB 3: History */
.hist-stats-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.hist-stat {
  text-align: center;
}

.hist-stat-v {
  font-size: 14px;
  font-weight: 680;
  font-variant-numeric: tabular-nums;
}

.hist-stat-k {
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 2px;
}

.hist-table-card {
  overflow: hidden;
}

.hist-table-head, .hist-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 0.9fr;
  align-items: center;
  padding: 10px 14px;
  font-size: 12.5px;
}

.hist-table-head {
  background: var(--surface-subtle);
  color: var(--ink-2);
  font-size: 11.5px;
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.hist-table-head span:not(:first-child),
.hist-row span:not(:first-child) {
  text-align: right;
}

.hist-row {
  border-bottom: 1px solid var(--border);
}

.hist-row:last-child { border-bottom: none; }

/* Bottom Navigation Bar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 480px;
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  background: var(--nav-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border);
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
}

.nav-item {
  border: none;
  background: transparent;
  color: var(--ink-3);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 550;
  padding: 4px 0;
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}

.nav-item.active {
  color: var(--ink);
  font-weight: 650;
}

.nav-badge {
  position: absolute;
  top: 1px;
  right: calc(50% - 22px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--up);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Bottom Sheet Drawer */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fadeIn 0.18s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.sheet-panel {
  width: 100%;
  max-width: 480px;
  max-height: 88vh;
  background: var(--surface);
  border-radius: 22px 22px 0 0;
  box-shadow: var(--shadow-sheet);
  display: flex;
  flex-direction: column;
  animation: slideUp 0.24s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

@keyframes slideUp {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.sheet-handle-bar {
  display: flex;
  justify-content: center;
  padding: 9px 0 4px;
}

.sheet-handle {
  width: 36px;
  height: 4px;
  border-radius: 4px;
  background: var(--border-strong);
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 4px 16px 12px;
  border-bottom: 1px solid var(--border);
}

.sheet-title-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.sheet-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
}

.sheet-code {
  font-size: 12px;
  color: var(--ink-2);
  margin-top: 2px;
  font-variant-numeric: tabular-nums;
}

.sheet-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--surface-subtle);
  color: var(--ink-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.sheet-body {
  overflow-y: auto;
  padding: 14px 16px calc(22px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.sheet-kpi-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.sheet-kpi {
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 11px;
}

.sheet-kpi-lbl {
  font-size: 11px;
  color: var(--ink-2);
}

.sheet-kpi-val {
  font-size: 16px;
  font-weight: 700;
  margin-top: 3px;
}

.sheet-kpi-sub {
  font-size: 11px;
  color: var(--ink-2);
  margin-top: 2px;
}

.sheet-sec-title {
  font-size: 13px;
  font-weight: 650;
  color: var(--ink);
  margin-bottom: 8px;
}

/* 4-Tier Order Flow Bars */
.tier-bars {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tier-row {
  display: grid;
  grid-template-columns: 48px 1fr 70px;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.tier-lbl { color: var(--ink-2); font-weight: 550; }

.tier-track {
  height: 7px;
  background: var(--surface-subtle);
  border-radius: 6px;
  position: relative;
  overflow: hidden;
}

.tier-fill {
  height: 100%;
  border-radius: 6px;
}

.tier-fill.up { background: var(--up); }
.tier-fill.down { background: var(--down); }

.tier-val {
  text-align: right;
  font-weight: 630;
}

.sheet-events {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sheet-ev-item {
  background: var(--surface-subtle);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 12px;
}

.sheet-ev-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 620;
  margin-bottom: 2px;
}

.sheet-desc {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.55;
  padding-top: 4px;
  border-top: 1px solid var(--border);
}

/* Toast */
.toast {
  position: fixed;
  top: 62px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99;
  background: var(--ink);
  color: var(--surface);
  font-size: 12px;
  font-weight: 550;
  padding: 7px 14px;
  border-radius: 999px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  pointer-events: none;
}
