:root {
  --bg: #F5F2EB;
  --surface: #FFFDF8;
  --surface-muted: #EFEBE1;
  --ink: #121C22;
  --ink-secondary: #4D5B63;
  --ink-muted: #7C888F;
  --border: #E2DDD1;
  --border-strong: #CEC7B8;

  /* Nordic Spruce Obsidian Hero */
  --obsidian: #101B20;
  --obsidian-card: #16242B;
  --obsidian-border: rgba(255, 248, 232, 0.11);
  --brass: #CCA150;
  --brass-soft: rgba(204, 161, 80, 0.16);

  /* Chinese Market Semantics: Red = Up, Green = Down */
  --up: #C63B32;
  --up-bg: #FDECEB;
  --down: #187C59;
  --down-bg: #E6F5EE;

  /* Strategy Traffic Zones */
  --zone-deep: #18865F;
  --zone-mid: #C7841A;
  --zone-high: #2E678A;

  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 2px 10px rgba(16, 27, 32, 0.04);
  --shadow-md: 0 12px 32px rgba(16, 27, 32, 0.08);
}

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

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  background-color: var(--obsidian);
}

body {
  font-family: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background-color: var(--bg);
  background-image: radial-gradient(rgba(16, 27, 32, 0.035) 1px, transparent 0);
  background-size: 24px 24px;
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  min-height: 100vh;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}

.mono {
  font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-variant-numeric: tabular-nums;
}

.serif {
  font-family: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
}

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

/* ===== Auth Vault Screen ===== */
.auth-overlay {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  background: radial-gradient(circle at 20% 20%, #1B2E36 0%, #0D161A 70%);
}

.auth-card {
  width: 100%;
  max-width: 410px;
  background: rgba(255, 253, 248, 0.97);
  border: 1px solid rgba(204, 161, 80, 0.35);
  border-radius: 22px;
  padding: 40px 32px 32px;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
  text-align: center;
  animation: fadeUp 0.45s ease both;
}

.auth-emblem {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.emblem-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--obsidian);
  color: var(--brass);
  font-family: "Newsreader", Georgia, serif;
  font-size: 20px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(204, 161, 80, 0.45);
}

.emblem-sub {
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-muted);
  font-weight: 700;
}

.auth-title {
  font-family: "Noto Serif SC", "Newsreader", serif;
  font-size: 25px;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 8px;
}

.auth-desc {
  font-size: 13.5px;
  color: var(--ink-secondary);
  margin-bottom: 24px;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.auth-form input {
  width: 100%;
  padding: 13px 16px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: #FFFFFF;
  font-size: 15px;
  color: var(--ink);
  text-align: center;
  letter-spacing: 0.08em;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.auth-form input:focus {
  outline: none;
  border-color: var(--obsidian);
  box-shadow: 0 0 0 3px rgba(16, 27, 32, 0.1);
}

.form-error {
  color: var(--up);
  background: var(--up-bg);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}

.auth-footnote {
  margin-top: 22px;
  font-size: 11.5px;
  color: var(--ink-muted);
}

/* ===== Topbar & Navigation ===== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  padding-top: env(safe-area-inset-top);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
  background: rgba(16, 27, 32, 0.94);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  color: #F6F3EC;
  border-bottom: 1px solid rgba(204, 161, 80, 0.22);
}

.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 12px 20px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, #1E313B, #101B20);
  border: 1px solid rgba(204, 161, 80, 0.55);
  color: var(--brass);
  font-family: "Newsreader", serif;
  font-size: 20px;
  font-weight: 600;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.brand-name {
  font-family: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  font-size: 16.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-tagline {
  font-size: 11.5px;
  color: rgba(246, 243, 236, 0.62);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 9px;
  border: 1px solid rgba(255, 248, 232, 0.16);
  background: rgba(255, 255, 255, 0.05);
  color: #F6F3EC;
  font-size: 13px;
  cursor: pointer;
  transition: background 0.18s, border-color 0.18s;
}

.btn-ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(204, 161, 80, 0.5);
}

.sync-icon.spinning {
  display: inline-block;
  animation: spin 0.9s linear infinite;
}

.nav-tabs {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 16px;
  display: flex;
  gap: 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav-tabs::-webkit-scrollbar { display: none; }

.nav-tab {
  background: transparent;
  border: none;
  color: rgba(246, 243, 236, 0.62);
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 14px;
  white-space: nowrap;
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: color 0.18s, border-color 0.18s;
}

.nav-tab:hover { color: #FFFDF8; }
.nav-tab.active {
  color: var(--brass);
  border-bottom-color: var(--brass);
  font-weight: 600;
}

/* ===== Main Container ===== */
.container {
  max-width: 1240px;
  margin: 0 auto;
  padding: 22px 20px 48px;
}

.tab-panel { display: none; }
.tab-panel.active {
  display: block;
  animation: fadeUp 0.35s ease both;
}

/* Alert Banner */
.alert-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #FFF6E5;
  border: 1px solid #E3BA72;
  border-radius: var(--radius-md);
  padding: 14px 18px;
  margin-bottom: 18px;
}

.alert-icon {
  font-size: 22px;
}

.alert-body {
  flex: 1;
  font-size: 13.5px;
}

.alert-body p {
  color: var(--ink-secondary);
  margin-top: 2px;
}

/* ===== Hero Grid (Cockpit) ===== */
.hero-grid {
  display: grid;
  grid-template-columns: 1.32fr 1fr;
  gap: 18px;
  margin-bottom: 18px;
}

.hero-card {
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.hero-command {
  background: linear-gradient(155deg, #132127 0%, #0E181C 100%);
  color: #F7F4EC;
  border: 1px solid rgba(204, 161, 80, 0.25);
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.hero-wealth {
  background: var(--surface);
  border: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 18px;
}

.card-kicker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kicker {
  font-size: 11px;
  letter-spacing: 0.14em;
  font-weight: 700;
  opacity: 0.65;
}

.zone-pill {
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: var(--brass-soft);
  color: var(--brass);
  border: 1px solid rgba(204, 161, 80, 0.35);
}

.zone-pill.zone-deep { background: rgba(24, 134, 95, 0.22); color: #5CE0AE; border-color: rgba(92, 224, 174, 0.35); }
.zone-pill.zone-mid { background: rgba(204, 161, 80, 0.22); color: #F5CA76; border-color: rgba(245, 202, 118, 0.35); }
.zone-pill.zone-high { background: rgba(65, 143, 191, 0.22); color: #8ACAF2; border-color: rgba(138, 202, 242, 0.35); }

.command-main {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 16px;
  align-items: center;
}

.command-label {
  font-size: 12.5px;
  color: rgba(247, 244, 236, 0.65);
}

.command-figure {
  font-size: 44px;
  font-weight: 700;
  line-height: 1.1;
  color: var(--brass);
  margin: 4px 0;
  letter-spacing: -0.02em;
}

.command-sub {
  font-size: 12.5px;
  color: rgba(247, 244, 236, 0.62);
}

.command-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.mini-metric {
  background: rgba(255, 255, 255, 0.045);
  border: 1px solid var(--obsidian-border);
  border-radius: 12px;
  padding: 12px 14px;
}

.mini-label {
  font-size: 11.5px;
  color: rgba(247, 244, 236, 0.6);
  display: block;
}

.mini-value {
  font-size: 21px;
  font-weight: 600;
  margin: 3px 0 2px;
}

.mini-sub {
  font-size: 11.5px;
  color: rgba(247, 244, 236, 0.56);
}

.command-headline {
  font-family: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  font-size: 17px;
  font-weight: 600;
  color: #FFFDF8;
  border-left: 3px solid var(--brass);
  padding-left: 12px;
}

.breakdown-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.breakdown-chip {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--obsidian-border);
  border-radius: 10px;
  padding: 10px 12px;
}

.breakdown-chip.paused {
  opacity: 0.45;
  border-style: dashed;
}

.breakdown-chip .chip-name {
  font-size: 12px;
  color: rgba(247, 244, 236, 0.8);
}

.breakdown-chip .chip-amt {
  font-size: 16px;
  font-weight: 600;
  color: #FFFDF8;
  margin-top: 2px;
}

.breakdown-chip .chip-st {
  font-size: 11px;
  color: var(--brass);
}

/* Trigger Ruler */
.trigger-ruler {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--obsidian-border);
  border-radius: 12px;
  padding: 12px 14px;
}

.ruler-labels, .ruler-footnotes {
  display: flex;
  justify-content: space-between;
  font-size: 11.5px;
  color: rgba(247, 244, 236, 0.68);
  gap: 8px;
}

.ruler-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  overflow: visible;
  display: flex;
  margin: 10px 0;
  background: rgba(255, 255, 255, 0.08);
}

.ruler-zone { height: 100%; }
.ruler-zone.zone-deep { width: 33.3%; background: linear-gradient(90deg, #167A56, #28A87A); border-radius: 999px 0 0 999px; }
.ruler-zone.zone-mid { width: 33.4%; background: linear-gradient(90deg, #B57614, #D99B30); }
.ruler-zone.zone-high { width: 33.3%; background: linear-gradient(90deg, #2C678A, #4B95BF); border-radius: 0 999px 999px 0; }

.ruler-marker {
  position: absolute;
  top: 50%;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #FFFDF8;
  border: 3px solid var(--brass);
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 4px rgba(204, 161, 80, 0.28);
  transition: left 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.veteran-quote {
  background: rgba(204, 161, 80, 0.09);
  border: 1px solid rgba(204, 161, 80, 0.22);
  border-radius: 11px;
  padding: 12px 14px;
  font-size: 13px;
  color: rgba(247, 244, 236, 0.88);
}

.quote-badge {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--brass);
  margin-bottom: 4px;
}

.hero-footer-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* Wealth Card (Right) */
.wealth-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.wealth-label {
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.wealth-figure {
  font-size: 32px;
  font-weight: 700;
  color: var(--ink);
  margin-top: 4px;
  letter-spacing: -0.02em;
}

.gauge-wrap {
  position: relative;
  width: 96px;
  height: 96px;
  flex-shrink: 0;
}

.donut-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.donut-bg {
  fill: none;
  stroke: var(--surface-muted);
  stroke-width: 10;
}

.donut-fill {
  fill: none;
  stroke: var(--obsidian);
  stroke-width: 10;
  stroke-linecap: round;
  transition: stroke-dasharray 0.7s ease;
}

.gauge-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.gauge-pct {
  font-size: 16px;
  font-weight: 700;
}

.gauge-sub {
  font-size: 10.5px;
  color: var(--ink-muted);
}

.wealth-split {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.split-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  border-radius: 11px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-cash { background: #8A9A9E; }
.dot-equity { background: var(--obsidian); }

.split-label {
  font-size: 12px;
  color: var(--ink-secondary);
}

.split-val {
  font-size: 16px;
  font-weight: 600;
}

.split-pct {
  margin-left: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-secondary);
}

.rampup-box {
  background: #FAF6EC;
  border: 1px solid #E6D8B8;
  border-radius: 12px;
  padding: 13px 14px;
}

.rampup-header {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  font-weight: 600;
  margin-bottom: 8px;
}

.progress-track {
  height: 8px;
  background: #E9DFCA;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #B58734, #D9AC54);
  border-radius: 999px;
  transition: width 0.6s ease;
}

.rampup-sub {
  font-size: 11.5px;
  color: var(--ink-secondary);
  margin-top: 7px;
}

.wealth-footer-meta {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--ink-secondary);
  padding-top: 10px;
  border-top: 1px dashed var(--border-strong);
}

/* ===== Panels & Grids ===== */
.two-col-grid {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 18px;
}

.panel-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.panel-header.compact { margin-bottom: 12px; }

.panel-title {
  font-family: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  font-size: 16.5px;
  font-weight: 600;
}

.panel-sub {
  font-size: 12.5px;
  color: var(--ink-muted);
  margin-top: 2px;
}

.badge-soft {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  background: var(--surface-muted);
  color: var(--ink-secondary);
  white-space: nowrap;
}

.badge-warn {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  background: var(--down-bg);
  color: var(--down);
  white-space: nowrap;
}

/* SVG Chart */
.chart-box {
  width: 100%;
  min-height: 225px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.chart-empty {
  font-size: 13px;
  color: var(--ink-muted);
  padding: 40px 16px;
  text-align: center;
}

.chart-svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

/* ===== Portfolio Profit & Return Curve ===== */
.profit-curve-card {
  margin-bottom: 18px;
}

.profit-curve-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.curve-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.curve-source-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: var(--obsidian);
  color: var(--brass);
}

.curve-source-badge.is-sim {
  background: #FAF3E2;
  color: #9A6712;
  border: 1px solid #E6D1A3;
}

.curve-source-badge.is-est {
  background: #E8F1F6;
  color: #245B7D;
  border: 1px solid #C5DCE8;
}

.curve-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.curve-controls .filter-btn {
  padding: 5px 10px;
  font-size: 12px;
}

.curve-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  background: #FAF6EC;
  border: 1px solid #E6D8B8;
  border-radius: 11px;
  padding: 10px 14px;
  margin-bottom: 14px;
  font-size: 12.5px;
  color: var(--ink-secondary);
}

.curve-notice strong {
  color: var(--ink);
}

.curve-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.curve-kpi {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 11px;
  padding: 11px 14px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.curve-kpi-label {
  font-size: 11.5px;
  color: var(--ink-muted);
}

.curve-kpi-val {
  font-size: 16px;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.curve-legend {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--ink-secondary);
  margin-bottom: 8px;
}

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

.legend-line {
  width: 16px;
  height: 2.5px;
  border-radius: 2px;
  display: inline-block;
}

.legend-line.dashed {
  background: none !important;
  border-top: 2px dashed currentColor;
  height: 0;
}

.legend-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
}

.profit-chart-wrap {
  position: relative;
  width: 100%;
  min-height: 270px;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
}

.profit-chart-svg {
  width: 100%;
  height: auto;
  display: block;
  overflow: visible;
  user-select: none;
  -webkit-user-select: none;
}

.chart-tooltip {
  position: absolute;
  top: 10px;
  left: 0;
  pointer-events: none;
  z-index: 15;
  min-width: 196px;
  background: rgba(16, 27, 32, 0.95);
  color: #F7F4EC;
  border: 1px solid rgba(204, 161, 80, 0.45);
  border-radius: 12px;
  padding: 10px 12px;
  box-shadow: 0 12px 28px rgba(10, 18, 22, 0.28);
  font-size: 12px;
  line-height: 1.5;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: opacity 0.12s ease;
}

.chart-tooltip[hidden] {
  display: none;
}

.tt-date {
  font-weight: 700;
  color: var(--brass);
  padding-bottom: 5px;
  margin-bottom: 6px;
  border-bottom: 1px solid rgba(255, 248, 232, 0.14);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.tt-tx-pill {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(204, 161, 80, 0.2);
  color: #F5CA76;
}

.tt-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.tt-label {
  color: rgba(247, 244, 236, 0.65);
}

.tt-val {
  font-weight: 600;
}

.tt-up { color: #F07972; }
.tt-down { color: #5CE0AE; }

/* Stress Simulator */
.stress-slider-wrap {
  margin: 8px 0 16px;
}

.stress-slider-wrap input[type="range"] {
  width: 100%;
  accent-color: var(--obsidian);
  cursor: pointer;
}

.slider-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--ink-muted);
  margin-top: 4px;
}

.stress-results {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.stress-metric {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--ink-secondary);
}

.stress-metric strong {
  font-size: 15px;
  color: var(--ink);
}

.stress-metric strong.text-down { color: var(--down); }

.stress-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 0;
}

.stress-footnote {
  font-size: 12.5px;
  color: var(--ink-secondary);
  margin-top: 12px;
  line-height: 1.6;
}

/* ===== Section Toolbars ===== */
.section-toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.section-heading {
  font-family: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  font-size: 21px;
  font-weight: 700;
}

.section-desc {
  font-size: 13px;
  color: var(--ink-secondary);
  margin-top: 3px;
}

.toolbar-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pill-filter {
  display: inline-flex;
  background: var(--surface-muted);
  padding: 3px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.filter-btn {
  border: none;
  background: transparent;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-secondary);
  cursor: pointer;
}

.filter-btn.active {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
}

/* ETF Strip */
.etf-strip-card { margin-bottom: 16px; }
.etf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.etf-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.etf-name { font-size: 13.5px; font-weight: 600; }
.etf-meta { font-size: 11.5px; color: var(--ink-muted); margin-top: 2px; }
.etf-prem {
  font-size: 14px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 8px;
  text-align: right;
}
.prem-safe { background: var(--down-bg); color: var(--down); }
.prem-warn { background: #FFF4DC; color: #A66A08; }
.prem-danger { background: var(--up-bg); color: var(--up); }

/* Data Table */
.table-card { padding: 0; overflow: hidden; }
.table-scroll { overflow-x: auto; }

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.data-table th {
  text-align: left;
  padding: 13px 14px;
  background: var(--surface-muted);
  color: var(--ink-secondary);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.03em;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.data-table th.num, .data-table td.num { text-align: right; }

.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr.row-holding { background: #FCF9F0; }

.fund-title { font-weight: 600; color: var(--ink); }
.fund-code-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--ink-muted);
}

.tag {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
}

.tag-core { background: var(--obsidian); color: var(--brass); }
.tag-watch { background: var(--surface-muted); color: var(--ink-secondary); }
.tag-sp { background: #E7F0F7; color: #245B7D; }
.tag-nasdaq { background: #F5EEDF; color: #8A5E14; }

.fee-low { color: var(--down); font-weight: 700; }
.fee-mid { color: var(--ink); font-weight: 600; }
.fee-high { color: var(--up); font-weight: 600; }

/* ===== Thermometer Grid ===== */
.thermo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.thermo-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.thermo-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.thermo-name { font-size: 13px; font-weight: 600; color: var(--ink-secondary); }
.thermo-sym { font-size: 11px; color: var(--ink-muted); }

.thermo-val {
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.thermo-sub {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--ink-secondary);
}

.thermo-badge {
  margin-top: 4px;
  font-size: 12px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--bg);
  color: var(--ink-secondary);
}

.guide-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.guide-card {
  position: relative;
}

.guide-num {
  font-family: "Newsreader", serif;
  font-size: 28px;
  color: var(--brass);
  font-weight: 600;
  line-height: 1;
}

.guide-card h3 {
  font-family: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  font-size: 15.5px;
  margin: 8px 0 6px;
}

.guide-card p {
  font-size: 13px;
  color: var(--ink-secondary);
  line-height: 1.65;
}

/* ===== Ledger & Holdings ===== */
.holdings-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.holding-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.holding-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.holding-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  background: var(--bg);
  border-radius: 10px;
  padding: 11px 12px;
}

.holding-stat span {
  display: block;
  font-size: 11px;
  color: var(--ink-muted);
}

.holding-stat strong {
  font-size: 15px;
}

.tp-input-row label {
  display: block;
  font-size: 12.5px;
  color: var(--ink-secondary);
  margin-bottom: 6px;
}

.tp-controls {
  display: flex;
  gap: 8px;
}

.tp-controls input {
  flex: 1;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  font-size: 15px;
  background: #FFF;
}

.tp-result {
  margin-top: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tp-step {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
}

.tx-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.tx-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 13px;
}

.tx-type {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}
.tx-buy { background: var(--up-bg); color: var(--up); }
.tx-sell { background: var(--down-bg); color: var(--down); }
.tx-pending { background: #FFF4DC; color: #9A6712; border: 1px solid #E8CFA0; }

.pending-pill {
  display: inline-flex;
  align-items: center;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  background: #FAF3E2;
  color: #9A6712;
  border: 1px solid #E6D1A3;
  vertical-align: middle;
}

.holding-pending-tag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  background: #FAF3E2;
  color: #9A6712;
  border: 1px solid #E6D1A3;
}

.label-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 5px;
}

.label-inline label {
  margin-bottom: 0;
}

.field-hint {
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-top: 4px;
  line-height: 1.45;
}

.cost-helper-box {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.tx-status-hint {
  margin-top: 6px;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 11.5px;
  line-height: 1.5;
  background: #FAF6EC;
  border: 1px solid #E6D8B8;
  color: var(--ink-secondary);
}

.tx-status-hint.is-confirmed {
  background: #EDF5F1;
  border-color: #C2DFD2;
  color: #165C43;
}

/* ===== Journal ===== */
.journal-layout { grid-template-columns: 0.95fr 1.15fr; }

.mood-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mood-btn {
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: #FFF;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--ink-secondary);
}

.mood-btn.active {
  background: var(--obsidian);
  color: var(--brass);
  border-color: var(--obsidian);
  font-weight: 600;
}

.journal-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-height: 520px;
  overflow-y: auto;
}

.journal-entry {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.journal-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11.5px;
  color: var(--ink-muted);
  margin-bottom: 6px;
}

.journal-entry h4 {
  font-size: 14.5px;
  margin-bottom: 6px;
}

.journal-entry p {
  font-size: 13px;
  color: var(--ink-secondary);
  white-space: pre-wrap;
  line-height: 1.6;
}

/* ===== Buttons & Forms ===== */
.btn-primary, .btn-brass, .btn-outline, .btn-dark-ghost, .btn-sm, .link-btn, .icon-del {
  font-family: inherit;
  cursor: pointer;
  transition: all 0.18s ease;
}

.btn-primary {
  background: var(--obsidian);
  color: #FFFDF8;
  border: 1px solid var(--obsidian);
  padding: 9px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 600;
}
.btn-primary:hover { background: #1D3038; }

.btn-brass {
  background: linear-gradient(135deg, #D2A858, #B88A36);
  color: #101B20;
  border: none;
  padding: 10px 18px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 700;
}
.btn-brass:hover { filter: brightness(1.06); transform: translateY(-1px); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--border-strong);
  padding: 8px 14px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}
.btn-outline:hover { background: var(--surface-muted); }

.btn-dark-ghost {
  background: rgba(255, 255, 255, 0.06);
  color: #F7F4EC;
  border: 1px solid rgba(255, 248, 232, 0.22);
  padding: 10px 16px;
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
}
.btn-dark-ghost:hover { background: rgba(255, 255, 255, 0.13); }

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 8px; }
.btn-full { width: 100%; }

.link-btn {
  background: none;
  border: none;
  color: #2C678A;
  font-size: 12.5px;
  font-weight: 600;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }

.icon-del {
  background: none;
  border: none;
  color: var(--ink-muted);
  font-size: 13px;
  padding: 3px 6px;
  border-radius: 6px;
}
.icon-del:hover { color: var(--up); background: var(--up-bg); }

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.field-row label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-secondary);
  margin-bottom: 5px;
}

.field-row input[type="text"],
.field-row input[type="number"],
.field-row input[type="password"],
.field-row input[type="date"],
.field-row select,
.field-row textarea {
  width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  border: 1px solid var(--border-strong);
  background: #FFF;
  font-size: 14px;
  color: var(--ink);
  font-family: inherit;
}

.field-row input:focus, .field-row select:focus, .field-row textarea:focus {
  outline: none;
  border-color: var(--obsidian);
}

.checkbox-row {
  display: flex;
  align-items: flex-end;
  padding-bottom: 8px;
}

.checkbox-row label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  cursor: pointer;
}

.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }

/* ===== Modals & Toast ===== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(12, 20, 24, 0.58);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
}

.modal-backdrop[hidden] { display: none; }

.modal-card {
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  padding: 22px 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

.modal-sm { max-width: 440px; }

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.modal-header h3 {
  font-family: "Songti SC", "STSong", "Noto Serif SC", Georgia, serif;
  font-size: 18px;
}

.modal-close {
  background: var(--surface-muted);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
}

.modal-divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

.sub-heading {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  background: var(--obsidian);
  color: #FFFDF8;
  border: 1px solid rgba(204, 161, 80, 0.45);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.3);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 16px 20px;
  font-size: 12px;
  color: var(--ink-muted);
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ===== Mobile Native Tabbar & Fund Cards (Hidden on Desktop) ===== */
.mobile-tabbar {
  display: none;
}

.funds-mobile-list {
  display: none;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes sheetUp {
  from { opacity: 0; transform: translateY(36px); }
  to { opacity: 1; transform: translateY(0); }
}

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

/* ===== Responsive: Tablet & Small Desktop ===== */
@media (max-width: 960px) {
  .hero-grid, .two-col-grid, .guide-grid, .holdings-grid, .etf-grid, .journal-layout {
    grid-template-columns: 1fr;
  }
  .command-main {
    grid-template-columns: 1fr;
  }
  .curve-kpi-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ===== Responsive: iPhone / Mobile Native App Experience ===== */
@media (max-width: 820px) {
  /* Hide desktop top tabs; activate sleek iOS frosted bottom tabbar */
  .nav-tabs {
    display: none;
  }

  .topbar-inner {
    padding: 10px 16px 11px;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    font-size: 18px;
  }

  .brand-name {
    font-size: 15.5px;
  }

  .brand-tagline {
    font-size: 10.5px;
  }

  .topbar-actions {
    gap: 6px;
    flex-shrink: 0;
  }

  .topbar-actions .btn-ghost {
    width: 36px;
    height: 36px;
    padding: 0;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 248, 232, 0.14);
    font-size: 15px;
  }

  .topbar-actions .btn-ghost:active {
    transform: scale(0.92);
    background: rgba(204, 161, 80, 0.2);
  }

  .hide-xs {
    display: none;
  }

  /* Bottom Frosted Tabbar (Home Indicator Safe) */
  .mobile-tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    align-items: center;
    padding: 7px 6px calc(8px + env(safe-area-inset-bottom));
    background: rgba(16, 27, 32, 0.93);
    backdrop-filter: blur(24px) saturate(170%);
    -webkit-backdrop-filter: blur(24px) saturate(170%);
    border-top: 1px solid rgba(204, 161, 80, 0.24);
    box-shadow: 0 -8px 28px rgba(8, 15, 19, 0.22);
  }

  .m-tab {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 2px 3px;
    border: none;
    background: transparent;
    color: rgba(246, 243, 236, 0.56);
    font-family: inherit;
    font-size: 10.5px;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.18s ease, transform 0.14s ease;
  }

  .m-tab:active {
    transform: scale(0.92);
  }

  .m-tab-icon {
    width: 21px;
    height: 21px;
    transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1);
  }

  .m-tab.active {
    color: var(--brass);
    font-weight: 700;
  }

  .m-tab.active .m-tab-icon {
    transform: translateY(-1px);
  }

  .m-tab.active::before {
    content: "";
    position: absolute;
    top: -7px;
    width: 24px;
    height: 2.5px;
    border-radius: 0 0 4px 4px;
    background: linear-gradient(90deg, #E2BC6D, #B88A36);
    box-shadow: 0 1px 8px rgba(204, 161, 80, 0.6);
  }

  /* Container safe clearance for bottom tabbar */
  .container {
    padding: 14px 14px calc(92px + env(safe-area-inset-bottom));
  }

  .footer {
    display: none;
  }

  /* Toast positioned cleanly above bottom tabbar */
  .toast {
    bottom: calc(78px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 32px);
    text-align: center;
    font-size: 13px;
    padding: 10px 16px;
  }

  /* Switch Radar Table -> Native Mobile Card Stream */
  .desktop-funds-table {
    display: none;
  }

  .funds-mobile-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  .m-fund-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 15px;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 11px;
    position: relative;
    overflow: hidden;
  }

  .m-fund-card.is-holding {
    background: #FCF9F0;
    border-color: #DFCEA6;
    border-left: 3.5px solid var(--brass);
  }

  .m-fund-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
  }

  .m-fund-name {
    font-size: 14.5px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.35;
  }

  .m-fund-tags {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 5px;
    font-size: 11px;
    color: var(--ink-muted);
  }

  .m-fund-nav-col {
    text-align: right;
    flex-shrink: 0;
  }

  .m-fund-nav {
    font-size: 17px;
    font-weight: 700;
    color: var(--ink);
    line-height: 1.2;
  }

  .m-fund-chg {
    font-size: 11.5px;
    font-weight: 600;
    margin-top: 2px;
  }

  .m-fund-metrics {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 11px;
    padding: 9px 10px;
  }

  .m-fund-m {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
  }

  .m-fund-m span {
    font-size: 10.5px;
    color: var(--ink-muted);
  }

  .m-fund-m strong {
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .m-fund-m small {
    font-size: 10px;
    color: var(--ink-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .m-fund-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 2px;
  }

  .m-fund-rules {
    font-size: 11.5px;
    color: var(--ink-secondary);
    line-height: 1.45;
  }

  /* Thermometer 1 + 2x2 Grid */
  .thermo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .thermo-grid .thermo-card:first-child {
    grid-column: 1 / -1;
  }

  .thermo-card {
    padding: 14px;
    border-radius: 15px;
  }

  .thermo-val {
    font-size: 22px;
  }

  /* Section toolbars compact */
  .section-heading {
    font-size: 18px;
  }

  .section-desc {
    font-size: 12px;
  }

  .toolbar-controls {
    width: 100%;
    justify-content: space-between;
  }

  .toolbar-controls .pill-filter {
    flex: 1;
    display: flex;
    justify-content: space-between;
  }

  .toolbar-controls .pill-filter .filter-btn {
    flex: 1;
    padding: 6px 4px;
    font-size: 12px;
    text-align: center;
  }
}

@media (max-width: 680px) {
  .hero-card, .panel-card {
    padding: 16px;
    border-radius: 16px;
  }

  .hero-grid {
    gap: 14px;
    margin-bottom: 14px;
  }

  .hero-command {
    gap: 14px;
  }

  .command-figure {
    font-size: 38px;
  }

  .command-metrics {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }

  .mini-metric {
    padding: 10px 11px;
  }

  .mini-label {
    font-size: 10.5px;
  }

  .mini-value {
    font-size: 18px;
  }

  .command-headline {
    font-size: 15px;
  }

  /* Keep 3 core funds compact side-by-side instead of tall vertical stack */
  .breakdown-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
  }

  .breakdown-chip {
    padding: 8px 8px;
    text-align: center;
  }

  .breakdown-chip .chip-name {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .breakdown-chip .chip-amt {
    font-size: 14px;
  }

  .breakdown-chip .chip-st {
    font-size: 10px;
  }

  .ruler-labels {
    font-size: 10.5px;
  }

  .ruler-labels span:nth-child(2) {
    display: none;
  }

  .ruler-footnotes {
    font-size: 10.5px;
  }

  .veteran-quote {
    font-size: 12.5px;
    padding: 10px 12px;
  }

  .hero-footer-actions {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 8px;
  }

  .hero-footer-actions .btn-brass,
  .hero-footer-actions .btn-dark-ghost {
    padding: 12px 10px;
    font-size: 13px;
    text-align: center;
    border-radius: 12px;
  }

  /* Wealth Card compact */
  .wealth-figure {
    font-size: 27px;
  }

  .gauge-wrap {
    width: 82px;
    height: 82px;
  }

  .gauge-pct {
    font-size: 14.5px;
  }

  .split-item {
    padding: 10px 11px;
  }

  .split-val {
    font-size: 15px;
  }

  .split-pct {
    font-size: 12px;
  }

  .wealth-footer-meta {
    font-size: 12px;
  }

  /* Profit Curve Mobile Controls & Docked Anti-Finger Tooltip */
  .profit-curve-header {
    gap: 10px;
  }

  .curve-controls {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 7px;
  }

  #curve-metric-toggle {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    width: 100%;
  }

  #curve-source-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  #curve-range-toggle {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
  }

  .curve-controls .filter-btn {
    padding: 7px 6px;
    font-size: 11.5px;
    text-align: center;
  }

  .curve-kpi-strip {
    gap: 8px;
  }

  .curve-kpi {
    padding: 9px 11px;
  }

  .curve-kpi-val {
    font-size: 13.5px;
  }

  .curve-legend {
    gap: 10px;
    font-size: 11px;
  }

  .profit-chart-wrap {
    min-height: 230px;
    padding-top: 2px;
  }

  /* Docked compact HUD tooltip at top of chart on mobile so finger never covers numbers */
  .chart-tooltip {
    top: -4px;
    left: 50% !important;
    transform: translateX(-50%);
    width: calc(100% - 4px);
    min-width: 0;
    padding: 8px 11px;
    font-size: 11.5px;
    border-radius: 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    column-gap: 12px;
    row-gap: 2px;
  }

  .chart-tooltip .tt-date {
    grid-column: 1 / -1;
    margin-bottom: 3px;
    padding-bottom: 4px;
  }

  /* Holdings & Ledger */
  .holding-stats {
    gap: 8px;
    padding: 10px;
  }

  .holding-stat strong {
    font-size: 14px;
  }

  .tx-item {
    padding: 10px;
    font-size: 12.5px;
  }

  /* iOS Native Bottom Sheet Modals */
  .modal-backdrop {
    align-items: flex-end;
    padding: 0;
  }

  .modal-card,
  .modal-sm {
    max-width: 100%;
    width: 100%;
    max-height: 88dvh;
    border-radius: 24px 24px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    padding: 12px 18px calc(22px + env(safe-area-inset-bottom));
    animation: sheetUp 0.26s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .modal-card::before {
    content: "";
    display: block;
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: var(--border-strong);
    margin: 0 auto 12px;
  }

  .form-grid-2, .form-grid-3 {
    grid-template-columns: 1fr;
  }

  /* Prevent iOS Safari auto-zoom on input focus */
  .auth-form input,
  .tp-controls input,
  .field-row input[type="text"],
  .field-row input[type="number"],
  .field-row input[type="password"],
  .field-row input[type="date"],
  .field-row select,
  .field-row textarea {
    font-size: 16px;
    padding: 11px 12px;
  }

  .alert-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
  }

  .alert-banner .btn-sm {
    align-self: flex-end;
  }
}
