/* ==========================================================================
   NEON · Polymarket 智能事件合约终端 — Clean Dark Purple Neon Mobile PWA Theme v2.1
   Palette:
     Base Bg:      #080612
     Surface:      #110c24
     Glass Card:   rgba(19, 14, 39, 0.86)
     Neon Purple:  #9d4edd
     Neon Cyan:    #00f5d4
     Up / Win:     #00e676
     Down / Loss:  #ff3b6b
     Gold / TP:    #ffd166
   ========================================================================== */

:root {
  --bg-deep: #080612;
  --bg-surface: #110c24;
  --bg-card: rgba(19, 14, 39, 0.86);
  --bg-sticky-col: #130e29;
  --neon-purple: #9d4edd;
  --neon-purple-soft: rgba(157, 78, 221, 0.24);
  --neon-cyan: #00f5d4;
  --neon-cyan-soft: rgba(0, 245, 212, 0.18);
  --color-up: #00e676;
  --color-down: #ff3b6b;
  --color-gold: #ffd166;
  --text-main: #f5f3ff;
  --text-muted: #9890b8;
  --border-glass: rgba(157, 78, 221, 0.24);
  --radius-lg: 15px;
  --radius-md: 11px;
  --radius-sm: 8px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html,
body {
  background: radial-gradient(circle at 50% -10%, #1a1038 0%, var(--bg-deep) 52%);
  background-color: var(--bg-deep);
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  font-size: 13.5px;
  line-height: 1.42;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

input[type="date"] {
  color-scheme: dark;
}

:focus-visible {
  outline: 2px solid var(--neon-cyan, #00f0ff);
  outline-offset: 2px;
}

.num {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.hidden {
  display: none !important;
}

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

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

.text-gold {
  color: var(--color-gold) !important;
}

.accent-cyan {
  color: var(--neon-cyan) !important;
}

.glass-card {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: 0 6px 22px rgba(4, 2, 12, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.app-shell {
  max-width: 540px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  position: relative;
}

/* ==========================================================================
   Compact Single-Row Sticky Header
   ========================================================================== */
.top-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 12px 8px;
  background: rgba(8, 6, 18, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(157, 78, 221, 0.25);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}

.brand-badge {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
  color: #080612;
  font-weight: 900;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 12px rgba(157, 78, 221, 0.5);
  flex-shrink: 0;
}

.brand-texts {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  min-width: 0;
}

.brand-subrow {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.mode-chip {
  border: 1px solid rgba(0, 245, 212, 0.4);
  background: rgba(0, 245, 212, 0.1);
  color: var(--neon-cyan);
  font-size: 10.5px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.mode-chip.mode-live {
  border-color: rgba(255, 59, 107, 0.65);
  background: rgba(255, 59, 107, 0.18);
  color: #ff6b8e;
}

.mode-chip.mode-live-unavailable {
  opacity: 0.78;
  border-style: dashed;
}

.ws-tag {
  font-size: 9.5px;
  padding: 1px 5px;
  border-radius: 999px;
  background: rgba(154, 146, 184, 0.14);
  color: var(--text-muted);
  white-space: nowrap;
}

.ws-tag.ws-online {
  display: none;
}

.header-right-inline {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.status-capsule {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(157, 78, 221, 0.14);
  border: 1px solid rgba(157, 78, 221, 0.35);
  font-size: 11px;
  font-weight: 600;
  color: #e9d5ff;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
}

#capsule-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.status-capsule.paused {
  background: rgba(255, 209, 102, 0.14);
  border-color: rgba(255, 209, 102, 0.5);
  color: var(--color-gold);
}

.status-capsule.derisking {
  background: rgba(255, 209, 102, 0.14);
  border-color: rgba(255, 209, 102, 0.52);
  color: var(--color-gold);
}

.status-capsule.halted {
  background: rgba(255, 59, 107, 0.18);
  border-color: rgba(255, 59, 107, 0.58);
  color: #ff8aa6;
}

.breath-dot {
  width: 6.5px;
  height: 6.5px;
  border-radius: 50%;
  background: var(--color-up);
  box-shadow: 0 0 8px var(--color-up);
  animation: neonPulse 1.8s infinite ease-in-out;
  flex-shrink: 0;
}

.breath-dot.paused,
.breath-dot.derisking {
  background: var(--color-gold);
  box-shadow: 0 0 8px var(--color-gold);
}

.breath-dot.paused {
  animation: none;
}

.breath-dot.halted {
  background: var(--color-down);
  box-shadow: 0 0 8px var(--color-down);
  animation: none;
}

@keyframes neonPulse {
  0%,
  100% {
    transform: scale(0.92);
    opacity: 0.7;
  }
  50% {
    transform: scale(1.2);
    opacity: 1;
  }
}

.pause-btn {
  border: 1px solid rgba(157, 78, 221, 0.6);
  background: rgba(157, 78, 221, 0.24);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.pause-btn:active {
  transform: scale(0.95);
}

.pause-btn.resume-mode {
  border-color: var(--color-up);
  background: rgba(0, 230, 118, 0.2);
  color: var(--color-up);
}

/* Contextual Circuit-Breaker Reset Banner */
.risk-breaker-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 7px 12px 0;
  padding: 8px 11px;
  border-radius: var(--radius-md);
  background: rgba(255, 209, 102, 0.1);
  border: 1px solid rgba(255, 209, 102, 0.42);
  border-left: 3px solid var(--color-gold);
}

.risk-breaker-banner.hard-halt {
  background: rgba(255, 59, 107, 0.13);
  border-color: rgba(255, 59, 107, 0.48);
  border-left-color: var(--color-down);
}

.risk-breaker-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.risk-breaker-title {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--color-gold);
}

.risk-breaker-banner.hard-halt .risk-breaker-title {
  color: #ff8aa6;
}

.risk-breaker-detail {
  font-size: 10.5px;
  color: var(--text-muted);
  line-height: 1.3;
}

.risk-reset-btn {
  border: 1px solid rgba(0, 230, 118, 0.55);
  background: rgba(0, 230, 118, 0.16);
  color: var(--color-up);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 11px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.risk-reset-btn:active {
  transform: scale(0.96);
}

.risk-reset-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Withdrawal Confirmation Banner (CONFIRM_WITHDRAW mode) */
.withdraw-confirm-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 10px;
  margin: 7px 12px 0;
  padding: 9px 11px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.16), rgba(157, 78, 221, 0.14));
  border: 1px solid rgba(255, 209, 102, 0.55);
  border-left: 3px solid var(--color-gold);
  box-shadow: 0 4px 16px rgba(255, 209, 102, 0.14);
}

.withdraw-banner-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 190px;
  flex: 1;
}

.withdraw-banner-title {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--color-gold);
}

.withdraw-banner-detail {
  font-size: 10.5px;
  color: var(--text-main);
  opacity: 0.9;
  line-height: 1.32;
}

.withdraw-banner-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.withdraw-confirm-btn {
  border: 1px solid rgba(0, 245, 212, 0.6);
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.22), rgba(0, 230, 118, 0.2));
  color: var(--neon-cyan);
  font-size: 11px;
  font-weight: 800;
  padding: 5px 10px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.withdraw-confirm-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.withdraw-detail-btn {
  border: 1px solid rgba(255, 209, 102, 0.42);
  background: rgba(255, 209, 102, 0.12);
  color: var(--color-gold);
  font-size: 10.5px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

/* ==========================================================================
   Sleek Inline Spot & TWAP Strip
   ========================================================================== */
.spot-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 8px 12px 0;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  background: rgba(16, 11, 34, 0.85);
  border: 1px solid rgba(157, 78, 221, 0.2);
}

.spot-pill {
  flex: 1;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.spot-sym-row {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}

.spot-sym {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--neon-cyan);
}

.spot-px {
  font-size: 13.5px;
  font-weight: 800;
  color: #fff;
}

.spot-twap {
  font-size: 10.5px;
  color: var(--text-muted);
}

.spot-divider {
  width: 1px;
  height: 16px;
  background: rgba(157, 78, 221, 0.28);
  margin: 0 10px;
}

/* Toast */
.toast-banner {
  position: fixed;
  top: calc(58px + env(safe-area-inset-top, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 90;
  max-width: 92vw;
  padding: 8px 15px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(18, 12, 38, 0.96);
  border: 1px solid var(--neon-cyan);
  color: var(--text-main);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.75);
}

.toast-banner.error {
  border-color: var(--color-down);
  color: #ffd5df;
}

/* ==========================================================================
   Tab Views & Hero + 4-Grid Hierarchy
   ========================================================================== */
.tab-view {
  display: none;
  padding: 10px 12px;
  flex-direction: column;
  gap: 10px;
}

.tab-view.active {
  display: flex;
}

.hero-overview-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-equity-card {
  padding: 13px 14px 11px;
  background: linear-gradient(135deg, rgba(30, 19, 64, 0.92), rgba(15, 11, 34, 0.92));
  border-color: rgba(157, 78, 221, 0.42);
}

.hero-eq-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.hero-eq-value {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.4px;
  margin-top: 2px;
  color: #fff;
}

.hero-today-box {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.hero-today-val {
  font-size: 15.5px;
  font-weight: 800;
}

.hero-eq-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(157, 78, 221, 0.2);
  font-size: 11px;
  color: var(--text-muted);
}

.hero-in-flight-tag {
  color: var(--neon-cyan);
  font-weight: 700;
}

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

.kpi-card {
  padding: 9px 11px;
  min-width: 0;
}

.kpi-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 600;
}

.kpi-value {
  font-size: 16.5px;
  font-weight: 800;
  margin: 2px 0 1px;
  color: #ffffff;
  letter-spacing: -0.2px;
}

.kpi-sub {
  font-size: 10.5px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Clean K-Line & Interactive Inspector Panel
   ========================================================================== */
.chart-panel {
  padding: 11px;
}

.panel-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.seg-group {
  display: inline-flex;
  background: rgba(8, 6, 18, 0.78);
  border: 1px solid rgba(157, 78, 221, 0.26);
  border-radius: 9px;
  padding: 2px;
  gap: 2px;
}

.seg-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 7px;
  cursor: pointer;
}

.seg-btn.active {
  background: linear-gradient(135deg, var(--neon-purple), #6d28d9);
  color: #fff;
  box-shadow: 0 0 8px rgba(157, 78, 221, 0.4);
}

.chart-subtoolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 7px 0;
}

.overlay-toggles {
  display: flex;
  gap: 6px;
}

.chip-toggle {
  border: 1px solid rgba(154, 146, 184, 0.25);
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-muted);
  font-size: 10.5px;
  font-weight: 600;
  padding: 2.5px 8px;
  border-radius: 999px;
  cursor: pointer;
}

.chip-toggle.active {
  border-color: rgba(0, 245, 212, 0.65);
  background: rgba(0, 245, 212, 0.12);
  color: var(--neon-cyan);
}

.chart-meta-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.chart-reset-btn {
  border: 1px solid rgba(157, 78, 221, 0.35);
  background: rgba(157, 78, 221, 0.14);
  color: #e9d5ff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 999px;
  cursor: pointer;
}

.chart-reset-btn:active {
  transform: scale(0.95);
}

.chart-meta-tag {
  font-size: 10.5px;
  color: var(--text-muted);
}

.chart-stage-wrap {
  width: 100%;
  height: clamp(310px, 50dvh, 460px);
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  background: #090714;
  border: 1px solid rgba(157, 78, 221, 0.18);
  touch-action: pan-y;
}

/* Keep TradingView Apache-2.0 attribution visible with subtle styling */
.tv-chart-container a[href*="tradingview"] {
  opacity: 0.45;
}

.tv-chart-container,
.fallback-kline-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.chart-inspector {
  margin-top: 7px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(11, 8, 24, 0.72);
  border: 1px solid rgba(157, 78, 221, 0.16);
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-height: 26px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.legend-inline {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   Tracking Cards & Compact Recent Settled List
   ========================================================================== */
.section-block {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.section-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.section-title {
  font-size: 13.5px;
  font-weight: 800;
  color: #f3e8ff;
}

.count-pill {
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 245, 212, 0.14);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 245, 212, 0.3);
}

.count-pill.subtle {
  background: rgba(157, 78, 221, 0.14);
  color: #d8b4fe;
  border-color: rgba(157, 78, 221, 0.28);
}

.cards-stack {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.empty-placeholder {
  padding: 16px 12px;
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  border-radius: var(--radius-md);
  border: 1px dashed rgba(157, 78, 221, 0.24);
  background: rgba(14, 10, 30, 0.45);
}

.empty-placeholder.compact {
  padding: 10px 12px;
  font-size: 11.5px;
}

.tracking-card {
  padding: 11px 12px;
  border: 1px solid rgba(0, 245, 212, 0.5);
  box-shadow: 0 0 18px rgba(0, 245, 212, 0.1);
}

.tracking-card.settling {
  border-color: rgba(255, 209, 102, 0.52);
  box-shadow: 0 0 14px rgba(255, 209, 102, 0.1);
}

.order-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.order-badges {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
}

.sym-pill {
  font-weight: 800;
  font-size: 12.5px;
  color: #fff;
}

.tf-pill {
  font-size: 10.5px;
  padding: 1px 5px;
  border-radius: 5px;
  background: rgba(157, 78, 221, 0.24);
  color: #e9d5ff;
  font-weight: 700;
}

.dir-pill {
  font-size: 10.5px;
  font-weight: 800;
  padding: 1.5px 6px;
  border-radius: 5px;
}

.dir-pill.up {
  background: rgba(0, 230, 118, 0.16);
  color: var(--color-up);
  border: 1px solid rgba(0, 230, 118, 0.4);
}

.dir-pill.down {
  background: rgba(255, 59, 107, 0.16);
  color: var(--color-down);
  border: 1px solid rgba(255, 59, 107, 0.4);
}

.tag-pill {
  font-size: 10.5px;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(0, 245, 212, 0.1);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 245, 212, 0.26);
}

.countdown-label {
  font-size: 12px;
  font-weight: 800;
  color: var(--color-gold);
}

.countdown-label.settling {
  font-size: 11px;
  padding: 1.5px 7px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.14);
  border: 1px solid rgba(255, 209, 102, 0.42);
  color: var(--color-gold);
}

.progress-track {
  width: 100%;
  height: 5px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--neon-purple), var(--neon-cyan));
  border-radius: 999px;
  transition: width 0.4s linear;
}

.order-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 5px 10px;
  font-size: 11.5px;
  margin-bottom: 9px;
}

.om-item {
  display: flex;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
  color: var(--text-muted);
}

.om-item strong {
  color: var(--text-main);
}

.order-action-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 7px;
  border-top: 1px solid rgba(157, 78, 221, 0.2);
}

.early-exit-btn {
  border: 1px solid var(--color-gold);
  background: linear-gradient(135deg, rgba(255, 209, 102, 0.22), rgba(157, 78, 221, 0.22));
  color: var(--color-gold);
  font-size: 11.5px;
  font-weight: 800;
  padding: 5px 12px;
  border-radius: 8px;
  cursor: pointer;
}

.early-exit-btn:active {
  transform: scale(0.96);
}

.early-exit-btn:disabled {
  opacity: 0.52;
  cursor: not-allowed;
  border-color: rgba(154, 146, 184, 0.36);
  background: rgba(154, 146, 184, 0.12);
  color: var(--text-muted);
}

/* Sleek Single-List Recent Settled Container */
.settled-compact-list {
  padding: 4px 12px;
  display: flex;
  flex-direction: column;
}

.settled-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8.5px 0;
  border-bottom: 1px solid rgba(157, 78, 221, 0.14);
}

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

.settled-row-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.settled-row-meta {
  font-size: 10.8px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.settled-row-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  flex-shrink: 0;
}

.more-toggle-btn {
  width: 100%;
  margin: 6px 0 4px;
  padding: 6px 0;
  border: 1px dashed rgba(157, 78, 221, 0.3);
  border-radius: 8px;
  background: rgba(157, 78, 221, 0.08);
  color: #d8b4fe;
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
}

/* ==========================================================================
   Tab 2: Sticky First-Column Signal Table
   ========================================================================== */
.filter-panel {
  padding: 9px 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.filter-row {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.factor-filter-bar {
  margin-bottom: 8px;
}

.pill-btn {
  border: 1px solid rgba(157, 78, 221, 0.24);
  background: rgba(12, 9, 26, 0.7);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 999px;
  white-space: nowrap;
  cursor: pointer;
}

.pill-btn.active {
  background: linear-gradient(135deg, var(--neon-purple), #7c3aed);
  border-color: #c084fc;
  color: #fff;
}

.table-card {
  padding: 10px 0 6px;
  overflow: hidden;
}

.table-header-caption {
  display: flex;
  justify-content: space-between;
  padding: 0 12px 8px;
  font-size: 11px;
  color: var(--text-muted);
}

.sticky-table-scroller {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.neon-table {
  width: max-content;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 11.5px;
}

.neon-table th,
.neon-table td {
  padding: 8px 9px;
  text-align: right;
  border-bottom: 1px solid rgba(157, 78, 221, 0.14);
  white-space: nowrap;
}

.neon-table th {
  font-size: 10.5px;
  color: var(--text-muted);
  background: #140e2c;
  font-weight: 700;
}

.neon-table .sticky-col {
  position: sticky;
  left: 0;
  z-index: 3;
  text-align: left;
  background: var(--bg-sticky-col);
  border-right: 1px solid rgba(0, 245, 212, 0.22);
  box-shadow: 4px 0 10px rgba(0, 0, 0, 0.45);
}

.neon-table thead .sticky-col {
  z-index: 4;
  background: #171033;
}

.table-empty {
  text-align: center !important;
  padding: 22px 12px !important;
  color: var(--text-muted);
}

/* ==========================================================================
   Tab 3: Model Center, Factor Health & Failure Attribution
   ========================================================================== */
.model-summary-card,
.section-card {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.title-pills {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.archived-models-drawer {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.model-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}

.mini-stat {
  background: rgba(10, 7, 22, 0.65);
  border: 1px solid rgba(157, 78, 221, 0.18);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.mini-label {
  font-size: 10.5px;
  color: var(--text-muted);
}

.mini-stat strong {
  font-size: 13.5px;
}

.mini-time {
  font-size: 11px !important;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.model-snapshots-strip {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.active-model-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 9px;
  border-radius: var(--radius-sm);
  background: rgba(0, 230, 118, 0.07);
  border: 1px solid rgba(0, 230, 118, 0.24);
  font-size: 11px;
  min-width: 0;
}

.active-model-left {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

.active-model-tf {
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(0, 245, 212, 0.14);
  color: var(--neon-cyan);
  flex-shrink: 0;
}

.active-model-ver {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10.5px;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}

.active-model-right {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10.5px;
  font-weight: 700;
  flex-shrink: 0;
}

.sched-strip {
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 10px;
}

.cusum-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  font-size: 10px;
}

.sched-chip {
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(157, 78, 221, 0.1);
  border: 1px solid rgba(157, 78, 221, 0.22);
  color: var(--text-muted);
}

.cusum-pill {
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  min-width: 0;
}

.cusum-pill.cusum-span-all {
  grid-column: 1 / -1;
}

.cusum-pill.ok {
  background: rgba(0, 230, 118, 0.1);
  border: 1px solid rgba(0, 230, 118, 0.28);
  color: var(--color-up);
}

.cusum-pill.warn,
.count-pill.warn {
  background: rgba(255, 209, 102, 0.14);
  border: 1px solid rgba(255, 209, 102, 0.4);
  color: var(--color-gold);
}

.cusum-pill.danger,
.count-pill.danger {
  background: rgba(255, 59, 107, 0.16);
  border: 1px solid rgba(255, 59, 107, 0.45);
  color: var(--color-down);
}

.model-toolbar {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 7px 8px;
  border-radius: var(--radius-sm);
  background: rgba(10, 7, 22, 0.55);
  border: 1px solid rgba(157, 78, 221, 0.16);
}

.model-filter-row {
  gap: 5px;
}

.model-sort-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: wrap;
}

.model-legend-hint {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.3;
}

.racing-list,
.lifecycle-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.racing-card,
.lifecycle-row {
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  background: rgba(11, 8, 24, 0.78);
  border: 1px solid rgba(157, 78, 221, 0.2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.lifecycle-row.is-champion {
  border-color: rgba(0, 230, 118, 0.36);
  background: rgba(12, 18, 28, 0.82);
}

.racing-card {
  border-color: rgba(0, 245, 212, 0.35);
}

.lifecycle-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.lifecycle-tags {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  min-width: 0;
}

.lifecycle-time {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.lifecycle-ver-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
}

.lifecycle-ver {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 11.5px;
  font-weight: 700;
  color: #f5f3ff;
  letter-spacing: 0.1px;
  word-break: break-all;
  line-height: 1.3;
}

.stage-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

.stage-badge.champion {
  background: rgba(0, 230, 118, 0.16);
  color: var(--color-up);
  border: 1px solid rgba(0, 230, 118, 0.4);
}

.stage-badge.challenger {
  background: rgba(0, 245, 212, 0.15);
  color: var(--neon-cyan);
  border: 1px solid rgba(0, 245, 212, 0.4);
}

.stage-badge.candidate,
.stage-badge.archived {
  background: rgba(157, 78, 221, 0.14);
  color: #c4b5fd;
  border: 1px solid rgba(157, 78, 221, 0.28);
}

.stage-badge.rolled-back {
  background: rgba(255, 59, 107, 0.16);
  color: var(--color-down);
  border: 1px solid rgba(255, 59, 107, 0.4);
}

.gate-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1.5px 6px;
  border-radius: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.gate-badge.pass {
  background: rgba(0, 230, 118, 0.14);
  border: 1px solid rgba(0, 230, 118, 0.35);
  color: var(--color-up);
}

.gate-badge.base-pass {
  background: rgba(0, 245, 212, 0.12);
  border: 1px solid rgba(0, 245, 212, 0.35);
  color: var(--neon-cyan);
}

.gate-badge.fail {
  background: rgba(255, 59, 107, 0.12);
  border: 1px solid rgba(255, 59, 107, 0.3);
  color: #ff8aa6;
}

.gate-badge.unknown {
  background: rgba(154, 146, 184, 0.12);
  border: 1px solid rgba(154, 146, 184, 0.25);
  color: var(--text-muted);
}

.quality-badge {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1.5px 6px;
  border-radius: 5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.quality-badge.beats {
  background: rgba(255, 209, 102, 0.16);
  border: 1px solid rgba(255, 209, 102, 0.48);
  color: var(--color-gold);
}

.quality-badge.potential {
  background: rgba(0, 245, 212, 0.1);
  border: 1px solid rgba(0, 245, 212, 0.3);
  color: var(--neon-cyan);
}

.quality-badge.stale {
  background: rgba(154, 146, 184, 0.1);
  border: 1px solid rgba(154, 146, 184, 0.24);
  color: var(--text-muted);
  font-weight: 600;
}

.archived-models-toggle-meta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.archived-hint-pill {
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 999px;
  background: rgba(255, 209, 102, 0.14);
  border: 1px solid rgba(255, 209, 102, 0.38);
  color: var(--color-gold);
}

.archived-hint-pill.pass {
  background: rgba(0, 230, 118, 0.12);
  border-color: rgba(0, 230, 118, 0.35);
  color: var(--color-up);
}

.lifecycle-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 5px;
}

.lm-cell {
  background: rgba(18, 13, 36, 0.72);
  border: 1px solid rgba(157, 78, 221, 0.14);
  border-radius: 7px;
  padding: 5px 6px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.lm-k {
  font-size: 9.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.lm-v {
  font-size: 11px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lm-sub {
  font-size: 9px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.lifecycle-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 10.5px;
  color: var(--text-muted);
}

.lifecycle-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  padding-top: 2px;
  border-top: 1px solid rgba(157, 78, 221, 0.1);
}

.lifecycle-reason {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.35;
  flex: 1;
  min-width: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.lifecycle-actions {
  display: flex;
  gap: 5px;
  flex-shrink: 0;
}

.lifecycle-btn {
  border-radius: 7px;
  padding: 3px 8px;
  font-size: 10.5px;
  font-weight: 700;
  cursor: pointer;
}

.lifecycle-btn.primary {
  border: 1px solid rgba(0, 245, 212, 0.4);
  background: rgba(0, 245, 212, 0.14);
  color: var(--neon-cyan);
}

.lifecycle-btn.warn {
  border: 1px solid rgba(255, 209, 102, 0.45);
  background: rgba(255, 209, 102, 0.14);
  color: var(--color-gold);
}

.lifecycle-btn.subtle {
  border: 1px solid rgba(157, 78, 221, 0.3);
  background: rgba(157, 78, 221, 0.12);
  color: #d8b4fe;
}

.lifecycle-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.archived-models-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 11px;
  margin-top: 2px;
  border-radius: var(--radius-sm);
  border: 1px dashed rgba(157, 78, 221, 0.34);
  background: rgba(157, 78, 221, 0.08);
  color: #d8b4fe;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
}

.archived-models-toggle:active {
  transform: scale(0.99);
}

.archived-models-toggle-arrow {
  font-size: 10px;
  color: var(--neon-cyan);
  flex-shrink: 0;
}

.archived-models-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  padding-top: 2px;
}

.psi-legend {
  font-size: 10.5px;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.lamp {
  display: inline-block;
  width: 7.5px;
  height: 7.5px;
  border-radius: 50%;
}

.lamp.green {
  background: var(--color-up);
  box-shadow: 0 0 6px var(--color-up);
}

.lamp.yellow {
  background: var(--color-gold);
  box-shadow: 0 0 6px var(--color-gold);
}

.lamp.red {
  background: var(--color-down);
  box-shadow: 0 0 6px var(--color-down);
}

.factor-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.factor-row {
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: rgba(11, 8, 24, 0.7);
  border: 1px solid rgba(157, 78, 221, 0.16);
}

.factor-row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.factor-name-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: 12px;
  min-width: 0;
}

.factor-row-metrics {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 10.5px;
  color: var(--text-muted);
}

.attrib-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.attrib-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.attrib-head {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  min-width: 0;
  font-size: 11.5px;
}

.attrib-bar-bg {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.attrib-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--color-down), var(--neon-purple));
}

/* ==========================================================================
   Tab 4: Daily Review & 3 Dimensional Tables
   ========================================================================== */
.date-bar-card {
  padding: 9px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.nav-day-btn {
  border: 1px solid rgba(157, 78, 221, 0.35);
  background: rgba(157, 78, 221, 0.14);
  color: #e9d5ff;
  font-size: 11px;
  font-weight: 700;
  padding: 5px 9px;
  border-radius: 8px;
  cursor: pointer;
}

.nav-day-btn.subtle {
  border-color: rgba(0, 245, 212, 0.35);
  background: rgba(0, 245, 212, 0.12);
  color: var(--neon-cyan);
}

.date-input {
  flex: 1;
  min-width: 115px;
  background: #0d091d;
  border: 1px solid rgba(157, 78, 221, 0.32);
  color: #fff;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12px;
  text-align: center;
}

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

.trio-item {
  padding: 10px 8px;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.trio-label {
  font-size: 10.5px;
  color: var(--text-muted);
}

.trio-val {
  font-size: 15.5px;
  font-weight: 800;
}

.dim-table-title {
  font-size: 12.5px;
  font-weight: 800;
  color: #e9d5ff;
}

.dim-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.dim-table th,
.dim-table td {
  padding: 7.5px 6px;
  border-bottom: 1px solid rgba(157, 78, 221, 0.14);
  text-align: right;
}

.dim-table th:first-child,
.dim-table td:first-child {
  text-align: left;
  font-weight: 700;
}

.dim-table th {
  font-size: 10.5px;
  color: var(--text-muted);
}

/* ==========================================================================
   Tab 6: Settings — Capital Reconciliation & Dynamic Parameter Center
   ========================================================================== */
.settings-card {
  gap: 11px;
}

.recon-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.recon-stat-box {
  background: rgba(10, 7, 22, 0.72);
  border: 1px solid rgba(157, 78, 221, 0.2);
  border-radius: var(--radius-sm);
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.recon-val {
  font-size: 14.5px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.recon-sub {
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.28;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recon-action-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.compact-primary-btn {
  flex: 1;
  padding: 9px 12px;
  font-size: 12.5px;
  border-radius: 10px;
}

.compact-primary-btn:disabled,
.neon-primary-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.ghost-action-btn {
  border: 1px solid rgba(0, 245, 212, 0.38);
  background: rgba(0, 245, 212, 0.1);
  color: var(--neon-cyan);
  font-size: 11.5px;
  font-weight: 700;
  padding: 9px 12px;
  border-radius: 10px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.ghost-action-btn:active {
  transform: scale(0.97);
}

.param-field-block {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.param-label-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.param-title {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #f3e8ff;
  line-height: 1.3;
}

.param-range-hint {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  line-height: 1.25;
}

.mini-input-caption {
  display: block;
  font-size: 10px;
  color: var(--text-muted);
  margin-bottom: 3px;
}

.param-dual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.param-trio-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.param-input {
  width: 100%;
  padding: 7.5px 9px;
  border-radius: 9px;
  border: 1px solid rgba(157, 78, 221, 0.34);
  background: rgba(9, 6, 20, 0.88);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.param-input:focus {
  outline: none;
  border-color: var(--neon-cyan);
  box-shadow: 0 0 0 2px rgba(0, 245, 212, 0.18);
}

.rec-badge {
  border: 1px solid rgba(0, 245, 212, 0.38);
  background: rgba(0, 245, 212, 0.1);
  color: var(--neon-cyan);
  font-size: 10px;
  font-weight: 700;
  padding: 2.5px 7px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.rec-badge:active {
  transform: scale(0.95);
  background: rgba(0, 245, 212, 0.24);
}

.mini-rec-all-btn {
  border: 1px solid rgba(0, 245, 212, 0.45);
  background: rgba(0, 245, 212, 0.13);
  color: var(--neon-cyan);
  font-size: 10.5px;
  font-weight: 800;
  padding: 3.5px 9px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.policy-seg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.policy-pill {
  border: 1px solid rgba(157, 78, 221, 0.26);
  background: rgba(11, 8, 24, 0.78);
  color: var(--text-muted);
  border-radius: 9px;
  padding: 7px 6px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.policy-pill strong {
  font-size: 10.8px;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
}

.policy-pill span {
  font-size: 9.5px;
  color: var(--text-muted);
  line-height: 1.22;
}

.policy-pill.active {
  border-color: var(--neon-cyan);
  background: linear-gradient(145deg, rgba(0, 245, 212, 0.14), rgba(157, 78, 221, 0.16));
  box-shadow: 0 0 12px rgba(0, 245, 212, 0.16);
}

.policy-pill.active strong {
  color: var(--neon-cyan);
}

.preset-capsules-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.preset-capsule {
  border: 1px solid rgba(157, 78, 221, 0.28);
  background: rgba(11, 8, 24, 0.8);
  border-radius: 10px;
  padding: 8px 9px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-align: left;
  cursor: pointer;
  min-width: 0;
}

.preset-name {
  font-size: 12px;
  font-weight: 800;
  color: #f3e8ff;
}

.preset-meta {
  font-size: 10px;
  color: var(--text-muted);
}

.preset-capsule.active {
  border-color: var(--neon-cyan);
  background: linear-gradient(135deg, rgba(0, 245, 212, 0.16), rgba(157, 78, 221, 0.2));
  box-shadow: 0 0 14px rgba(0, 245, 212, 0.18);
}

.preset-capsule.active .preset-name {
  color: var(--neon-cyan);
}

.five-shares-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 7px 10px;
  padding: 8.5px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 245, 212, 0.38);
  background: rgba(0, 245, 212, 0.09);
}

.five-shares-preview.preview-amber {
  border-color: rgba(255, 209, 102, 0.52);
  background: rgba(255, 209, 102, 0.11);
}

.five-sh-main {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 180px;
}

.five-sh-badge {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--neon-cyan);
}

.five-shares-preview.preview-amber .five-sh-badge {
  color: var(--color-gold);
}

.five-sh-text {
  font-size: 11px;
  color: var(--text-main);
  line-height: 1.34;
}

.five-sh-fix-btn {
  border: 1px solid var(--color-gold);
  background: rgba(255, 209, 102, 0.2);
  color: var(--color-gold);
  font-size: 10.5px;
  font-weight: 800;
  padding: 5px 9px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.settings-accordion {
  width: 100%;
}

.accordion-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  cursor: pointer;
  padding: 2px 0;
}

.accordion-summary::-webkit-details-marker {
  display: none;
}

.accordion-sub {
  display: block;
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 2px;
}

.accordion-chevron {
  font-size: 13px;
  color: var(--neon-cyan);
  transition: transform 0.18s ease;
  flex-shrink: 0;
}

.settings-accordion[open] .accordion-chevron {
  transform: rotate(180deg);
}

.accordion-body {
  display: flex;
  flex-direction: column;
  gap: 11px;
  padding-top: 10px;
  margin-top: 8px;
  border-top: 1px solid rgba(157, 78, 221, 0.18);
}

.accordion-divider {
  height: 1px;
  background: rgba(157, 78, 221, 0.18);
  margin: 2px 0;
}

.tf-multi-group {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.tf-check-pill {
  border: 1px solid rgba(157, 78, 221, 0.28);
  background: rgba(11, 8, 24, 0.8);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  padding: 7px 0;
  border-radius: 9px;
  cursor: pointer;
}

.tf-check-pill.active {
  border-color: var(--neon-cyan);
  background: rgba(0, 245, 212, 0.16);
  color: var(--neon-cyan);
  box-shadow: 0 0 10px rgba(0, 245, 212, 0.16);
}

.switch-pill {
  width: 100%;
  padding: 7.5px 10px;
  border-radius: 9px;
  border: 1px solid rgba(157, 78, 221, 0.3);
  background: rgba(11, 8, 24, 0.82);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.switch-pill.active {
  border-color: rgba(0, 230, 118, 0.55);
  background: rgba(0, 230, 118, 0.15);
  color: var(--color-up);
}

.adj-history-wrap {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-top: 6px;
  border-top: 1px solid rgba(157, 78, 221, 0.16);
}

.adj-history-title {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
}

.adj-history-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.adj-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 8px;
  border-radius: 7px;
  background: rgba(10, 7, 22, 0.65);
  border: 1px solid rgba(157, 78, 221, 0.14);
  font-size: 10.5px;
}

.adj-row-left {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}

.adj-row-reason {
  font-weight: 700;
  color: #e9d5ff;
}

.adj-row-time {
  font-size: 9.8px;
  color: var(--text-muted);
}

.adj-row-right {
  text-align: right;
  flex-shrink: 0;
}

.settings-action-bar {
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.settings-persist-status {
  font-size: 10.8px;
  color: var(--text-muted);
  text-align: center;
}

.settings-btn-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-btn-row .neon-primary-btn {
  flex: 1;
  padding: 10.5px 12px;
  font-size: 13px;
}

.ghost-danger-btn {
  border: 1px solid rgba(255, 59, 107, 0.45);
  background: rgba(255, 59, 107, 0.11);
  color: #ff8aa6;
  font-size: 11.5px;
  font-weight: 700;
  padding: 10.5px 11px;
  border-radius: var(--radius-md);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.ghost-danger-btn:active {
  transform: scale(0.97);
}

/* ==========================================================================
   Bottom Glass Tabbar (6 Columns, Narrow Mobile Safe 360px~430px)
   ========================================================================== */
.bottom-tabbar {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: 0;
  width: 100%;
  max-width: 540px;
  z-index: 50;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 6px 4px calc(7px + env(safe-area-inset-bottom, 0px));
  background: rgba(10, 7, 22, 0.94);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-top: 1px solid rgba(157, 78, 221, 0.3);
}

@media (max-width: 410px) {
  .bottom-tabbar {
    padding-left: 2px;
    padding-right: 2px;
  }

  .bottom-tabbar .tab-text {
    font-size: 9.5px;
    letter-spacing: -0.2px;
  }

  .policy-seg-grid {
    grid-template-columns: 1fr;
  }
}

.tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 3px 0;
  cursor: pointer;
  min-width: 0;
}

.tab-icon {
  font-size: 16px;
  line-height: 1.1;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.tab-text {
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

.tab-btn.active {
  color: var(--neon-cyan);
  text-shadow: 0 0 10px rgba(0, 245, 212, 0.45);
}

/* ==========================================================================
   PIN Unlock Modal
   ========================================================================== */
.pin-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(5, 3, 12, 0.92);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow-y: auto;
}

.pin-card {
  width: 100%;
  max-width: 350px;
  padding: 24px 20px;
  text-align: center;
}

.pin-logo-ring {
  width: 54px;
  height: 54px;
  margin: 0 auto 12px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--neon-purple), var(--neon-cyan));
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 22px rgba(157, 78, 221, 0.6);
}

.pin-logo-glyph {
  font-size: 26px;
  font-weight: 900;
  color: #080612;
}

.pin-title {
  font-size: 17px;
  font-weight: 800;
  margin-bottom: 5px;
}

.pin-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  margin-bottom: 15px;
}

.pin-input {
  width: 100%;
  padding: 11px 14px;
  font-size: 19px;
  letter-spacing: 5px;
  text-align: center;
  border-radius: var(--radius-md);
  border: 1px solid rgba(0, 245, 212, 0.45);
  background: #0b0818;
  color: #fff;
  margin-bottom: 10px;
}

.pin-input:focus:not(:focus-visible) {
  outline: none;
}

.pin-error {
  font-size: 12px;
  color: var(--color-down);
  margin-bottom: 10px;
}

.pin-keypad {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.key-btn {
  padding: 11px 0;
  border-radius: 10px;
  border: 1px solid rgba(157, 78, 221, 0.28);
  background: rgba(24, 17, 48, 0.85);
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
}

.key-btn:active {
  background: rgba(157, 78, 221, 0.45);
}

.key-btn.key-fn {
  font-size: 12.5px;
  color: var(--neon-cyan);
}

.neon-primary-btn {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--neon-purple), #00bfa5);
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 4px 18px rgba(157, 78, 221, 0.5);
}

@media (prefers-reduced-motion: reduce) {
  .breath-dot {
    animation: none;
  }

  .progress-fill {
    transition: none;
  }
}
