/* ══════════════════════════════════════════════════════════
   极算 Showcase · Glassmorphism + Bento Grid + iOS Mobile
   Design tokens: Fira Sans + Fira Code · 深色主导 · 玻璃面板
   ══════════════════════════════════════════════════════════ */

/* ── Design Tokens · Dark (default) ────────────────────── */
:root,
:root[data-theme="dark"] {
  --bg:           #020617;
  --bg-grad:      radial-gradient(ellipse at top left, #0d1637 0%, #020617 55%) fixed;
  --surface:      rgba(15, 23, 42, 0.72);
  --surface-2:    rgba(30, 41, 59, 0.55);
  --surface-3:    rgba(51, 65, 85, 0.35);
  --elev-1:       0 1px 2px rgba(0,0,0,0.3), 0 4px 16px rgba(0,0,0,0.25);
  --elev-2:       0 8px 32px rgba(0,0,0,0.35);
  --glass-border: rgba(255,255,255,0.08);
  --glass-blur:   16px;
  /* 玻璃渐变：表面顶部 subtle 高光 + 底部 subtle 阴影，增强深度 */
  --surface-highlight: rgba(255,255,255,0.04);
  --surface-shade:     rgba(0,0,0,0.18);
  --glass-top-highlight: rgba(255,255,255,0.10);

  --text:         #F8FAFC;
  --text-2:       #E2E8F0;
  --muted:        #94A3B8;
  --muted-2:      #64748B;

  /* 中国市场习惯：红涨 / 绿跌 */
  --up:           #EF4444;
  --up-bg:        rgba(239, 68, 68, 0.14);
  --down:         #10B981;
  --down-bg:      rgba(16, 185, 129, 0.14);
  --accent:       #6366F1;
  --accent-bg:    rgba(99, 102, 241, 0.14);
  --warn:         #F59E0B;
  --warn-bg:      rgba(245, 158, 11, 0.14);

  --k-up:         #EF4444;
  --k-down:       #10B981;
  --k-grid:       rgba(255,255,255,0.04);
  --k-axis:       rgba(148,163,184,0.6);

  --chip-bg:      rgba(148,163,184,0.12);

  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;

  --sp-1: 4px;  --sp-2: 8px;  --sp-3: 12px;
  --sp-4: 16px; --sp-5: 20px; --sp-6: 24px;
}

/* ── Design Tokens · Light ─────────────────────────────── */
:root[data-theme="light"] {
  --bg:           #F4F6FA;
  --bg-grad:      radial-gradient(ellipse at top left, #E6EAF3 0%, #F4F6FA 55%) fixed;
  --surface:      rgba(255, 255, 255, 0.80);
  --surface-2:    rgba(241, 245, 249, 0.85);
  --surface-3:    rgba(226, 232, 240, 0.65);
  --elev-1:       0 1px 2px rgba(15,23,42,0.04), 0 4px 16px rgba(15,23,42,0.06);
  --elev-2:       0 8px 32px rgba(15,23,42,0.08);
  --glass-border: rgba(15,23,42,0.08);
  --surface-highlight: rgba(255,255,255,0.45);
  --surface-shade:     rgba(15,23,42,0.04);
  --glass-top-highlight: rgba(255,255,255,0.70);

  --text:         #0F172A;
  --text-2:       #1E293B;
  --muted:        #475569;
  --muted-2:      #64748B;

  /* 中国市场习惯：红涨 / 绿跌 */
  --up:           #DC2626;
  --up-bg:        rgba(220,38,38,0.1);
  --down:         #059669;
  --down-bg:      rgba(5,150,105,0.1);
  --accent:       #4F46E5;
  --accent-bg:    rgba(79,70,229,0.1);
  --warn:         #D97706;
  --warn-bg:      rgba(217,119,6,0.1);

  --k-up:         #DC2626;
  --k-down:       #059669;
  --k-grid:       rgba(15,23,42,0.04);
  --k-axis:       rgba(71,85,105,0.7);

  --chip-bg:      rgba(71,85,105,0.08);
}

/* ── Base ──────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Fira Sans', -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Noto Sans SC', system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}

body {
  background: var(--bg-grad);
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: env(safe-area-inset-top, 0);
}

.num {
  font-family: 'Fira Code', 'SF Mono', Menlo, Consolas, monospace;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

button {
  font-family: inherit;
  background: none; border: none; color: inherit;
  cursor: pointer; padding: 0;
}
button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}

.text-up { color: var(--up); }
.text-down { color: var(--down); }

.flash-up   { animation: flash-up   0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
.flash-down { animation: flash-down 0.4s cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes flash-up   { 0% { filter: brightness(1); text-shadow: 0 0 0 transparent; } 30% { filter: brightness(1.4); text-shadow: 0 0 12px var(--up); } 100% { filter: brightness(1); text-shadow: 0 0 0 transparent; } }
@keyframes flash-down { 0% { filter: brightness(1); text-shadow: 0 0 0 transparent; } 30% { filter: brightness(1.4); text-shadow: 0 0 12px var(--down); } 100% { filter: brightness(1); text-shadow: 0 0 0 transparent; } }

/* ── Glass 面板基础（带细腻渐变 + 顶部高光）───────────── */
.glass {
  position: relative;
  /* 表面叠两层：主 surface + 从上到下的微渐变，模拟光源 */
  background:
    linear-gradient(180deg,
      var(--surface-highlight) 0%,
      transparent 40%,
      var(--surface-shade) 100%),
    var(--surface);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--r-md);
  box-shadow:
    var(--elev-1),
    inset 0 1px 0 var(--glass-top-highlight);  /* 顶部一条内高光 */
  overflow: hidden;
}
/* 顶部超细描边高光（glass 的"光源反射"）*/
.glass::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--glass-top-highlight) 45%,
    var(--glass-top-highlight) 55%,
    transparent 100%);
  pointer-events: none;
  z-index: 1;
}

/* ══════════════════════════════════════════════════════════
   DESKTOP LAYOUT (≥ 900px 一屏 bento)
   row1 header / row2 kpis / row3 chart+plan+decisions / row4 equity+activity / row5 footer
   ══════════════════════════════════════════════════════════ */

#app {
  height: 100vh; height: 100dvh;
  padding: var(--sp-3);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) 190px auto;
  gap: var(--sp-4);  /* 原 12px → 16px，让 bento 和 bottom 之间有更清晰的视觉分离 */
}
.sc-bottom { margin-top: 2px; }  /* 再叠一层微分隔 */

/* ── HEADER ───────────────────────────────────────────── */
.sc-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: var(--sp-5);
  padding: var(--sp-3) var(--sp-5);
  height: 60px;
}

.sc-brand-group { display: flex; align-items: center; gap: var(--sp-3); }
.sc-brand-mark  { display: flex; }
.sc-brand-text  { display: flex; flex-direction: column; line-height: 1; }
.sc-brand-name  { font-size: 18px; font-weight: 700; letter-spacing: 0.02em; }
.sc-brand-sub   { font-family: 'Fira Code', monospace; font-size: 10px; color: var(--muted); letter-spacing: 0.15em; margin-top: 2px; }

.sc-ticker {
  display: flex; align-items: baseline; gap: var(--sp-4);
  justify-content: center; flex-wrap: nowrap; min-width: 0;
}
.sc-symbol { color: var(--muted); font-size: 13px; white-space: nowrap; }
.sc-price  { font-size: 24px; font-weight: 600; }
.sc-change { font-size: 13px; }
.sc-change small { font-size: 11px; opacity: 0.7; }

.sc-meta { display: flex; align-items: center; gap: var(--sp-3); }

.sc-phase {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  padding: 5px 12px; border-radius: 100px;
  font-size: 11px; font-weight: 500;
  background: var(--chip-bg);
  color: var(--muted);
  border: 1px solid var(--glass-border);
}
.sc-phase-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sc-phase.phase-pre_market,
.sc-phase.phase-premarket,
.sc-phase.phase-plan_ready { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-bg); }
.sc-phase.phase-intraday    { background: var(--up-bg); color: var(--up); border-color: var(--up-bg); }
.sc-phase.phase-intraday .sc-phase-dot { animation: dot-pulse 1.6s ease-in-out infinite; }
.sc-phase.phase-done        { background: var(--chip-bg); color: var(--muted); }
@keyframes dot-pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}

.sc-ws { position: relative; width: 10px; height: 10px; display: inline-block; }
.sc-ws-pulse { position: absolute; inset: 0; border-radius: 50%; background: currentColor; }
.sc-ws.on  { color: var(--up); }
.sc-ws.off { color: var(--down); }
.sc-ws.on .sc-ws-pulse::before {
  content: ''; position: absolute; inset: 0; border-radius: 50%; background: currentColor;
  animation: ws-ring 2.2s cubic-bezier(0, 0, 0.2, 1) infinite;
}
@keyframes ws-ring {
  0% { transform: scale(1); opacity: 0.6; }
  100% { transform: scale(3.2); opacity: 0; }
}

.sc-theme-btn {
  width: 34px; height: 34px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--chip-bg); color: var(--text-2);
  transition: background 180ms ease, color 180ms ease;
}
.sc-theme-btn:hover { background: var(--surface-2); color: var(--text); }

/* ── KPI CHIP ROW ─────────────────────────────────────── */
.sc-kpis {
  display: grid; grid-template-columns: repeat(6, 1fr);
  gap: 1px; padding: var(--sp-3) var(--sp-4);
  overflow: hidden;
}
.kpi {
  position: relative; padding: 2px var(--sp-4);
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
}
.kpi + .kpi::before {
  content: ''; position: absolute; left: 0; top: 15%; bottom: 15%;
  width: 1px; background: var(--glass-border);
}
.kpi-label { font-size: 11px; color: var(--muted); letter-spacing: 0.02em; }
.kpi-value { font-size: 18px; font-weight: 600; line-height: 1.2; }

/* ── MAIN BENTO (chart + plan + decisions) ───────────── */
.sc-bento {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  grid-template-areas:
    "chart plan"
    "chart decisions";
  gap: var(--sp-3);
  min-height: 0;
}
.bento-chart     { grid-area: chart; display: flex; flex-direction: column; padding: var(--sp-4); min-height: 0; }
.bento-plan      { grid-area: plan;  padding: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); min-height: 0; }
.bento-decisions { grid-area: decisions; padding: var(--sp-3) var(--sp-4) var(--sp-2); display: flex; flex-direction: column; min-height: 0; }

.card-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--sp-3);
}
.card-head-title { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: 0.04em; text-transform: uppercase; }
.card-head-meta  { font-size: 11px; color: var(--muted); font-family: 'Fira Code', monospace; }
.card-empty {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: var(--sp-2);
  color: var(--muted-2); font-size: 12px;
}
.empty-icon { font-size: 28px; opacity: 0.5; line-height: 1; }

/* Chart head */
.chart-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-3); }
.chart-title { font-size: 14px; font-weight: 600; color: var(--text); }
.chart-sub   { color: var(--muted); font-size: 11px; margin-left: 6px; font-family: 'Fira Code', monospace; }
.chart-ctrls { display: flex; align-items: center; gap: var(--sp-2); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--glass-border); border-radius: 8px; padding: 2px; gap: 1px; }
.seg button {
  padding: 4px 10px; font-size: 11px; font-weight: 500;
  color: var(--muted); border-radius: 6px;
  transition: all 160ms ease;
}
.seg button:hover { color: var(--text); }
.seg button.active { background: var(--surface); color: var(--text); box-shadow: 0 1px 2px rgba(0,0,0,0.15); }
.seg-btn {
  padding: 4px 10px; font-size: 11px; font-weight: 500;
  color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--glass-border); border-radius: 8px;
  transition: all 160ms ease;
}
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--accent-bg); color: var(--accent); border-color: var(--accent-bg); }

#tv-chart { flex: 1; min-height: 0; width: 100%; border-radius: var(--r-sm); overflow: hidden; }

/* ── Plan Card ───────────────────────────────────────── */
.plan-age {
  font-family: 'Fira Code', monospace; font-size: 10px;
  color: var(--muted); padding: 2px 6px; border-radius: 4px;
  background: var(--chip-bg);
}
.plan-pills { display: flex; gap: var(--sp-2); flex-wrap: wrap; }
.plan-core {
  font-size: 13px; font-weight: 500; line-height: 1.55;
  color: var(--text); padding-left: 10px;
  border-left: 2px solid var(--accent);
}
.plan-section-label {
  font-size: 10px; color: var(--muted-2);
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px;
}
.plan-list { list-style: none; display: flex; flex-direction: column; gap: 3px; }
.plan-list li {
  position: relative; padding-left: 12px; font-size: 12px; color: var(--text-2); line-height: 1.5;
}
.plan-list li::before {
  content: ''; position: absolute; left: 0; top: 8px;
  width: 4px; height: 4px; border-radius: 50%; background: var(--muted-2);
}
.plan-zones { display: flex; flex-direction: column; gap: 4px; }
.zone {
  display: grid; grid-template-columns: auto 1fr auto;
  align-items: center; gap: var(--sp-2);
  padding: 4px 8px; border-radius: 6px;
  background: var(--surface-2); font-size: 12px;
}
.zone-role {
  font-size: 9px; font-weight: 700;
  padding: 2px 6px; border-radius: 3px;
  letter-spacing: 0.05em; text-transform: uppercase;
}
.zone-role.role-demand  { background: var(--up-bg); color: var(--up); }
.zone-role.role-supply  { background: var(--down-bg); color: var(--down); }
.zone-role.role-pivot,
.zone-role.role-range_top,
.zone-role.role-range_bottom { background: var(--chip-bg); color: var(--muted); }
.zone-role.role-breakout_trigger { background: var(--accent-bg); color: var(--accent); }
.zone-desc { color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.zone-conf { font-size: 10px; color: var(--muted); }

.plan-risk {
  display: flex; align-items: flex-start; gap: 6px;
  padding: 6px 10px; border-radius: var(--r-sm);
  background: var(--warn-bg); color: var(--warn);
  font-size: 11px; line-height: 1.5;
  margin-top: auto;
}
.plan-risk-icon { flex: 0 0 auto; font-size: 13px; }

/* ── Pills (generic) ─────────────────────────────────── */
.pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 100px;
  font-size: 11px; font-weight: 600; line-height: 1.4;
  letter-spacing: 0.02em;
}
.pill.pill-neutral   { background: var(--chip-bg); color: var(--muted); }
.pill.bias-long,
.pill.act-open_long  { background: var(--up-bg); color: var(--up); }
.pill.bias-short,
.pill.act-open_short { background: var(--down-bg); color: var(--down); }
.pill.bias-flat,
.pill.act-observe    { background: var(--chip-bg); color: var(--muted); }
.pill.act-close_long { background: var(--down-bg); color: var(--down); }
.pill.act-close_short{ background: var(--up-bg); color: var(--up); }
.pill.act-adjust,
.pill.act-reduce     { background: var(--accent-bg); color: var(--accent); }

/* ── Decisions Stream ─────────────────────────────────── */
.decisions-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column;
  gap: var(--sp-2); padding-right: 4px;
  scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent;
}
.decisions-scroll::-webkit-scrollbar { width: 4px; }
.decisions-scroll::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

.decision {
  padding: var(--sp-3); border-radius: var(--r-sm);
  background: var(--surface-2);
  border: 1px solid var(--glass-border);
  display: flex; flex-direction: column; gap: 4px;
}
.decision-top { display: flex; align-items: center; gap: var(--sp-2); }
.decision-time { font-size: 11px; color: var(--muted); margin-right: auto; }
.dot-filled { width: 6px; height: 6px; border-radius: 50%; background: var(--up); box-shadow: 0 0 0 3px var(--up-bg); }
.decision-summary { font-size: 12.5px; line-height: 1.5; color: var(--text-2); }
.decision-meta {
  display: flex; align-items: center; gap: var(--sp-2); flex-wrap: wrap;
  font-size: 11px; color: var(--muted);
}
.mini-tag {
  padding: 1px 6px; border-radius: 4px; font-size: 10px;
  background: var(--chip-bg); color: var(--muted); letter-spacing: 0.03em;
}
.oid { font-family: 'Fira Code', monospace; font-size: 10px; color: var(--muted-2); }

.slide-in-enter-active { transition: all 400ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.slide-in-leave-active { transition: all 260ms ease-in; }
.slide-in-enter-from   { opacity: 0; transform: translateY(-20px) scale(0.98); }
.slide-in-leave-to     { opacity: 0; transform: translateX(30px); }

/* ── BOTTOM STRIP ─────────────────────────────────────── */
.sc-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: var(--sp-3);
  min-height: 0;
}
.bottom-equity   { padding: var(--sp-3) var(--sp-4); display: flex; flex-direction: column; min-height: 0; }
.bottom-activity { padding: var(--sp-3) var(--sp-4) var(--sp-2); display: flex; flex-direction: column; min-height: 0; }

.equity-head {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: var(--sp-2);
}
.equity-kpis { display: flex; gap: var(--sp-3); }
.kp { display: flex; align-items: baseline; gap: 4px; }
.kp-v { font-size: 13px; font-weight: 600; }
.kp-l { font-size: 10px; color: var(--muted); letter-spacing: 0.05em; }
#equity-chart { flex: 1; min-height: 0; width: 100%; }

/* ── Activity Stream ─────────────────────────────────── */
.activity-scroll {
  flex: 1; min-height: 0; overflow-y: auto;
  display: flex; flex-direction: column; gap: var(--sp-2);
  scrollbar-width: thin; scrollbar-color: var(--surface-3) transparent;
}
.activity-scroll::-webkit-scrollbar { width: 4px; }
.activity-scroll::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 4px; }

.activity {
  padding: 8px var(--sp-3); border-radius: var(--r-sm);
  background: var(--surface-2);
  border-left: 3px solid var(--chip-bg);
  display: flex; flex-direction: column; gap: 3px;
}
.activity.status-filled    { border-left-color: var(--up); }
.activity.status-cancelled { border-left-color: var(--muted-2); }
.activity.status-pending   { border-left-color: var(--accent); }
.activity.status-partial   { border-left-color: var(--warn); }

.activity-top { display: flex; align-items: center; gap: var(--sp-2); }
.activity-time { font-size: 11px; color: var(--muted); margin-left: auto; }
.activity-mid {
  display: flex; align-items: center; gap: var(--sp-2);
  font-size: 13px;
}
.activity-mid .num { font-weight: 600; }
.activity-decision { font-size: 11px; color: var(--muted-2); line-height: 1.5; padding-top: 3px; border-top: 1px dashed var(--glass-border); }
.status-dot { width: 7px; height: 7px; border-radius: 50%; }
.status-dot.status-filled    { background: var(--up); box-shadow: 0 0 0 3px var(--up-bg); }
.status-dot.status-cancelled { background: var(--muted-2); }
.status-dot.status-pending   { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-bg); animation: dot-pulse 1.6s ease-in-out infinite; }
.status-dot.status-partial   { background: var(--warn); box-shadow: 0 0 0 3px var(--warn-bg); }
.status-text { margin-left: auto; font-size: 10px; padding: 1px 6px; border-radius: 4px; letter-spacing: 0.04em; }
.status-text.status-filled    { background: var(--up-bg); color: var(--up); }
.status-text.status-cancelled { background: var(--chip-bg); color: var(--muted); }
.status-text.status-pending   { background: var(--accent-bg); color: var(--accent); }
.status-text.status-partial   { background: var(--warn-bg); color: var(--warn); }

.activity.just-filled { animation: fill-ring 700ms cubic-bezier(0.2, 0.8, 0.2, 1); }
@keyframes fill-ring {
  0%   { box-shadow: 0 0 0 0 var(--up-bg); }
  50%  { box-shadow: 0 0 0 8px var(--up-bg); }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ── Footer ───────────────────────────────────────────── */
.sc-footer {
  text-align: center; font-size: 10px; color: var(--muted-2);
  padding: 6px var(--sp-4) calc(6px + env(safe-area-inset-bottom, 0));
  letter-spacing: 0.02em;
}

/* ── Skeletons ─────────────────────────────────────────── */
.skeleton {
  border-radius: var(--r-sm);
  background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%);
  background-size: 200% 100%;
  animation: skeleton 1.8s ease-in-out infinite;
}
.chart-skeleton  { flex: 1; }
.equity-skeleton { flex: 1; height: 100px; }
@keyframes skeleton { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ── Toasts ───────────────────────────────────────────── */
.sc-toasts {
  position: fixed;
  top: calc(var(--sp-5) + env(safe-area-inset-top, 0));
  right: var(--sp-5);
  z-index: 50;
  display: flex; flex-direction: column; gap: var(--sp-2);
  pointer-events: none;
}
.sc-toast {
  pointer-events: auto;
  background: var(--surface); backdrop-filter: blur(var(--glass-blur));
  border: 1px solid var(--glass-border); border-radius: var(--r-sm);
  padding: 10px 14px; display: flex; align-items: center; gap: var(--sp-2);
  font-size: 12px; color: var(--text);
  box-shadow: var(--elev-2); min-width: 220px;
}
.toast-enter-active, .toast-leave-active { transition: all 280ms cubic-bezier(0.2, 0.8, 0.2, 1); }
.toast-enter-from { opacity: 0; transform: translateX(40px); }
.toast-leave-to   { opacity: 0; transform: translateY(-10px); }

.sc-tabbar { display: none; }

/* ══════════════════════════════════════════════════════════
   RESPONSIVE / MOBILE (< 900px)
   scroll-snap pages · iOS tab bar · safe-area
   ══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  html, body { overflow: auto; }
  body { padding-top: 0; }

  #app {
    display: block;
    height: auto; min-height: 100dvh;
    padding: 0;
    scroll-snap-type: y mandatory;
    overflow-y: auto;
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 0));
  }

  .sc-header {
    position: sticky; top: 0; z-index: 20;
    padding: calc(10px + env(safe-area-inset-top, 0)) 14px 10px;
    height: auto; border-radius: 0;
    grid-template-columns: auto 1fr auto;
    border-left: none; border-right: none; border-top: none;
    gap: var(--sp-3);
  }
  .sc-ticker { gap: var(--sp-2); justify-content: flex-end; }
  .sc-symbol { display: none; }
  .sc-price  { font-size: 18px; }
  .sc-change { font-size: 11px; }
  .sc-brand-sub { display: none; }

  .sc-kpis {
    scroll-snap-align: start; margin: 10px 10px 0;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 0; padding: 10px 8px;
  }
  .kpi { padding: 8px 10px; }
  .kpi + .kpi::before { display: none; }

  .sc-bento {
    display: flex; flex-direction: column;
    gap: var(--sp-3); padding: 10px 10px 0;
    grid-template-areas: none;
  }
  .bento-chart     { scroll-snap-align: start; height: calc(100dvh - 300px); min-height: 340px; }
  .bento-plan      { scroll-snap-align: start; min-height: 200px; }
  .bento-decisions { scroll-snap-align: start; height: 340px; }

  .sc-bottom {
    display: flex; flex-direction: column;
    gap: var(--sp-3); padding: 0 10px 10px;
  }
  .bottom-equity   { scroll-snap-align: start; height: 200px; }
  .bottom-activity { scroll-snap-align: start; height: 380px; }
  .equity-kpis { gap: var(--sp-2); flex-wrap: wrap; }

  .sc-tabbar {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
    padding: 6px 0 calc(6px + env(safe-area-inset-bottom, 0));
    background: var(--surface);
    backdrop-filter: blur(20px) saturate(200%);
    -webkit-backdrop-filter: blur(20px) saturate(200%);
    border-top: 1px solid var(--glass-border);
  }
  .sc-tabbar button {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    padding: 6px 0; color: var(--muted);
    font-size: 10px; font-weight: 500;
    transition: color 160ms ease;
  }
  .sc-tabbar button:hover { color: var(--text); }
  .sc-tabbar button.active { color: var(--accent); }
  .sc-tabbar button.active svg { transform: scale(1.08); }
  .sc-tabbar button svg { transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1); }

  .sc-footer { font-size: 9px; padding: 8px 14px; }
}

@media (max-width: 480px) {
  .sc-price { font-size: 16px; }
  .kpi-value { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .flash-up, .flash-down { animation: none; }
}

@media (min-width: 1600px) {
  #app { max-width: 1920px; margin: 0 auto; }
  .sc-price { font-size: 26px; }
  .kpi-value { font-size: 20px; }
}
