/* ==========================================================================
   Self-Hosted Local Fonts (DSGVO / GDPR Compliant — Zero External Requests)
   ========================================================================== */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url('/fonts/inter-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 100 800;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ==========================================================================
   Sovereign Alpha — Modern Local-First Apple-Dark Theme
   ========================================================================== */

:root {
  --bg-app: #0d1117;
  --bg-header: rgba(13, 17, 23, 0.88);
  --bg-panel: #131722;
  --bg-card: #161b26;
  --bg-card-hover: #1c2230;
  --bg-input: #161b24;
  
  --border: rgba(255, 255, 255, 0.08);
  --border-focus: rgba(212, 168, 67, 0.6);
  --border-subtle: rgba(255, 255, 255, 0.04);
  
  --text-main: #f0f6fc;
  --text-muted: #cbd5e1;
  --text-dim: #94a3b8;
  
  --accent-green: #34d399; /* Muted institutional sage green */
  --accent-green-bg: rgba(52, 211, 153, 0.12);
  --accent-red: #f87171;   /* Soft coral */
  --accent-red-bg: rgba(248, 113, 113, 0.12);
  --accent-blue: #d4a843;  /* Sovereign gold */
  --accent-blue-bg: rgba(212, 168, 67, 0.12);
  --accent-purple: #a78bfa; /* Subtle refined lavender */
  --accent-purple-bg: rgba(167, 139, 250, 0.12);
  --accent-gold: #d4a843;
  --accent-gold-light: #f5d77f;
  --accent-gold-bg: rgba(212, 168, 67, 0.12);
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-pill: 9999px;
  
  --shadow-card: 0 4px 20px rgba(0, 0, 0, 0.45);
  --shadow-popup: 0 12px 40px rgba(0, 0, 0, 0.6);
  --font-mono: 'JetBrains Mono', monospace;
  --transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Institutional Tabular Numeral Precision (Linear/Bloomberg Alignment) */
.font-mono,
.metric-val,
.chart-hero-val,
.chart-hero-number,
#chart-scrub-val,
#hero-portfolio-val,
.dd-metric-val,
.holding-cell-total,
.h-val,
.col-lt-total,
.perf-stat-val,
.cash-amount,
.fi-mini-val,
.div-stat-val,
.table-num,
.stat-value,
.milestone-num,
.holding-val {
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-feature-settings: "tnum" 1, "lnum" 1;
  font-feature-settings: "tnum" 1, "lnum" 1;
}

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

button {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: transparent;
  border: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

html {
  overflow-x: clip;
  max-width: 100vw;
  width: 100%;
}

body {
  background-color: var(--bg-app);
  color: var(--text-main);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  font-size: 14px;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
  max-width: 100vw;
  width: 100%;
}

/* Accessibility: Screen Reader & Keyboard Skip Link (WCAG 2.2 AA SC 2.4.1) */
.skip-link {
  position: fixed;
  top: -100px;
  left: 20px;
  background: #d4a843;
  color: #0b0e14;
  font-weight: 800;
  font-size: 0.88rem;
  padding: 10px 18px;
  border-radius: 8px;
  z-index: 100000;
  text-decoration: none;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.6), 0 0 15px rgba(212, 168, 67, 0.5);
  transition: top 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  outline: none;
}

.skip-link:focus,
.skip-link:focus-visible {
  top: 20px;
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}

/* Helpers */
.text-green { color: var(--accent-green) !important; }
.text-red { color: var(--accent-red) !important; }
.text-blue { color: var(--accent-blue) !important; }
.text-purple { color: var(--accent-purple) !important; }
.text-gold { color: var(--accent-gold) !important; }
.font-bold { font-weight: 700; }
.font-mono { font-family: var(--font-mono); }
.ml-auto { margin-left: auto; }
.mt-2 { margin-top: 8px; }
.w-full { width: 100%; }

/* ==========================================================================
   Cockpit HUD (Floating Bottom Sheet Drawer)
   ========================================================================== */
.cockpit-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.cockpit-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.cockpit-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(15, 18, 25, 0.96);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.75);
  padding: 12px 24px 24px;
  max-height: 82vh;
  overflow-y: auto;
  transform: translateY(105%);
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  opacity: 0.9;
}

.cockpit-drawer.open {
  transform: translateY(0);
  pointer-events: auto;
  opacity: 1;
}

.cockpit-drag-handle {
  width: 44px;
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
  margin: 0 auto 12px;
  cursor: pointer;
  transition: background 0.2s ease;
}

.cockpit-drag-handle:hover {
  background: rgba(255, 255, 255, 0.45);
}

.cockpit-inner {
  max-width: 1300px;
  margin: 0 auto;
}

.cockpit-top {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 6px;
}

.cockpit-badge-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.hud-badge {
  background: linear-gradient(135deg, #d4a843, #bf5af2);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 4px;
  letter-spacing: 0.5px;
}

.hud-caption {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cockpit-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.cockpit-close-btn:hover {
  background: var(--border);
  color: #fff;
}

.cockpit-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.cockpit-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
}

.cockpit-card-wide {
  grid-column: 1 / -1;
}

.cockpit-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.hud-icon {
  font-size: 1.1rem;
}

.hud-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.gauge-container {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.gauge-value {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  font-family: var(--font-mono);
}

.gauge-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.hud-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: auto;
}

/* Cash Grid */
.cash-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 6px;
}

.cash-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.currency-tag {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--accent-green);
  margin-bottom: 2px;
}

.cash-amount {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.cash-note {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Performance & Taxes Deep-Dive Grid */
.perf-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 8px;
}

.perf-stat-item {
  background: var(--bg-panel);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
}

.perf-stat-label {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 2px;
}

.perf-stat-val {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: var(--font-mono);
}

.perf-stat-sub {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 3px;
}

/* ==========================================================================
   Global Header & Navigation — Apple Minimalist Standard
   ========================================================================== */
.global-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: 48px;
  background: rgba(12, 15, 23, 0.82);
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
}

.header-content {
  max-width: 1300px;
  width: 100%;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand-container {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  border-radius: 6px;
  padding: 2px 4px;
  margin: 0;
  opacity: 0.92;
  transition: opacity 0.2s ease, transform 0.15s ease;
}

.brand-container:hover {
  opacity: 1;
  transform: translateY(-0.5px);
}

.brand-container:active {
  transform: scale(0.98);
}

.brand-logo-img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  background: transparent;
  border: none;
  overflow: hidden;
  transition: transform 0.2s ease;
}

.brand-container:hover .brand-logo-img {
  box-shadow: none;
  transform: scale(1.04);
}

.brand-app-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  display: inline-flex;
  align-items: center;
  color: var(--text-main);
  background: none;
  -webkit-background-clip: unset;
  -webkit-text-fill-color: initial;
  transform: translateY(1px);
}

.brand-dot {
  display: inline-block;
  font-weight: 700;
  margin: 0 -2px 0 -1px;
  color: var(--accent-gold);
}

.global-header .brand-tagline {
  display: none;
}

.brand-tagline {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  padding: 0;
  border-radius: 0;
}

.nav-tab {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0.82;
  position: relative;
  transition: color 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.nav-tab:hover {
  color: #ffffff;
  opacity: 1;
  background: rgba(255, 255, 255, 0.05);
}

.nav-tab.active {
  background: rgba(255, 255, 255, 0.08);
  border: none;
  color: #ffffff;
  font-weight: 500;
  opacity: 1;
  box-shadow: none;
}

.nav-tab.active::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 12px;
  right: 12px;
  height: 2px;
  background: var(--accent-gold);
  border-radius: 2px;
}

/* SVRGN Custom SVG Vector Icon System */
.svrgn-icon {
  display: inline-block;
  vertical-align: middle;
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), stroke 0.2s ease, filter 0.2s ease;
}

.svrgn-icon-fill {
  fill: currentColor;
}

.nav-tab .svrgn-icon {
  stroke: var(--text-muted);
}

.nav-tab:hover .svrgn-icon {
  stroke: var(--text-main);
  transform: translateY(-0.5px);
}

.nav-tab.active .svrgn-icon {
  stroke: #f5d77f;
  filter: drop-shadow(0 0 4px rgba(212, 168, 67, 0.45));
}

.mobile-nav-item .svrgn-icon,
.mobile-action-card .svrgn-icon {
  width: 20px;
  height: 20px;
  stroke: var(--accent-gold);
}

.mobile-nav-item.active .svrgn-icon {
  stroke: #f5d77f;
  filter: drop-shadow(0 0 6px rgba(212, 168, 67, 0.5));
}

.stealth-toggle-btn .svrgn-icon,
.cockpit-toggle-btn .svrgn-icon {
  width: 16px;
  height: 16px;
  stroke: currentColor;
}

.settings-toggle-btn .svrgn-icon {
  width: 18px;
  height: 18px;
  stroke: currentColor;
}

.portfolio-pill .svrgn-icon {
  width: 14px;
  height: 14px;
  stroke: currentColor;
  margin-right: 2px;
}

.legal-link .svrgn-icon {
  width: 13px;
  height: 13px;
  stroke: currentColor;
  margin-right: 4px;
  vertical-align: -2px;
}

.settings-subtab .svrgn-icon {
  width: 15px;
  height: 15px;
  stroke: currentColor;
}

.settings-hub-icon .svrgn-icon {
  width: 24px;
  height: 24px;
  stroke: var(--accent-gold);
}

.fi-title .svrgn-icon,
.holdings-title-group .svrgn-icon {
  width: 16px;
  height: 16px;
  stroke: var(--accent-gold);
  margin-right: 4px;
  vertical-align: -2px;
}

#btn-refresh-quotes .svrgn-icon {
  width: 13px;
  height: 13px;
  stroke: currentColor;
}

#btn-refresh-quotes.spinning .svrgn-icon,
#refresh-quotes-icon.spinning .svrgn-icon,
.spinning {
  animation: svrgn-spin 1s linear infinite;
}

@keyframes svrgn-spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.header-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.cockpit-toggle-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0.82;
  transition: color 0.2s ease, opacity 0.2s ease, background 0.2s ease;
  position: relative;
}

.cockpit-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  opacity: 1;
}

.cockpit-toggle-btn.active {
  background: rgba(212, 168, 67, 0.12);
  color: #f5d77f;
  opacity: 1;
}

.pulse-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent-green);
  box-shadow: 0 0 4px var(--accent-green);
}

.btn-import-header {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0.82;
  transition: color 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.btn-import-header:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  opacity: 1;
  transform: none;
  box-shadow: none;
}

.btn-import-header.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  opacity: 1;
}

.btn-support-header {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  text-decoration: none;
  opacity: 0.82;
  transition: color 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.btn-support-header:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  opacity: 1;
  transform: none;
  box-shadow: none;
}

.settings-toggle-btn {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: transparent;
  border: none;
  color: #94a3b8;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0.82;
  transition: color 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.settings-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  opacity: 1;
  transform: none;
  box-shadow: none;
}

.settings-toggle-btn.active {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  opacity: 1;
}

.ai-toggle-btn {
  background: transparent;
  border: 1px solid rgba(212, 168, 67, 0.28);
  color: var(--accent-gold);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  opacity: 0.88;
  transition: color 0.2s ease, opacity 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.ai-toggle-btn:hover {
  background: rgba(212, 168, 67, 0.1);
  border-color: var(--accent-gold);
  color: #ffffff;
  opacity: 1;
}

.ai-toggle-btn.active {
  background: rgba(212, 168, 67, 0.16);
  border-color: var(--accent-gold);
  color: var(--accent-gold-light);
  opacity: 1;
}

.ai-toggle-btn .svrgn-icon {
  width: 14px;
  height: 14px;
  stroke: var(--accent-gold);
}

.mobile-burger-btn {
  display: none;
}

/* Diagnostics Sub-Bar */
.diagnostics-bar {
  max-width: 1300px;
  margin: 0 auto;
  padding: 4px 24px 8px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 0.72rem;
  color: var(--text-dim);
}

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

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ff9f0a;
}

.dot.active {
  background: var(--accent-green);
  box-shadow: 0 0 6px var(--accent-green);
}

.status-pill {
  background: rgba(48, 209, 88, 0.1);
  color: var(--accent-green);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
}

/* ==========================================================================
   Layout & Portfolio Switcher
   ========================================================================== */
.main-wrapper {
  max-width: 1300px;
  width: 100%;
  margin: 0 auto;
  padding: 20px 24px 60px;
  overflow-x: clip;
}

.portfolio-switcher-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 16px;
  margin-bottom: 20px;
  width: 100%;
}

.portfolio-select-group {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1 1 auto;
}

.portfolio-switcher-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
  flex-shrink: 0;
}

.portfolio-pills {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  min-width: 0;
  padding: 2px 0;
}

.portfolio-pills::-webkit-scrollbar {
  display: none;
}

.portfolio-pill {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  transition: var(--transition);
}

.portfolio-pill:hover {
  background: var(--bg-card);
  color: var(--text-main);
}

.portfolio-pill.active {
  background: rgba(212, 168, 67, 0.12);
  color: #f5d77f;
  border-color: #d4a843;
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.2);
}

.portfolio-currency-switcher {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
  margin-left: auto;
}

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

.currency-switcher-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  white-space: nowrap;
  flex-shrink: 0;
}

.currency-pills-bar {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 2px;
  border-radius: 9999px;
  flex-shrink: 0;
}

/* Global Currency Switcher */
.curr-pill-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  white-space: nowrap;
  flex-shrink: 0;
}

.curr-pill-btn:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

.curr-pill-btn.active {
  background: rgba(212, 168, 67, 0.2);
  color: var(--accent-gold-light);
  border: 1px solid rgba(212, 168, 67, 0.4);
  box-shadow: 0 0 10px rgba(212, 168, 67, 0.15);
}

#btn-run-portfolio-audit {
  border: 1px solid rgba(212, 168, 67, 0.4);
  color: var(--accent-gold);
  background: rgba(212, 168, 67, 0.06);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: var(--radius-pill, 9999px);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all 0.2s ease;
}

#btn-run-portfolio-audit:hover {
  background: rgba(212, 168, 67, 0.14);
  border-color: rgba(212, 168, 67, 0.7);
  color: #fff;
}

.audit-btn-text-short {
  display: none;
}

.portfolio-pill.active .pill-dot {
  background: #d4a843;
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.8);
  opacity: 1;
}

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

/* View Panels */
.view-panel {
  display: none;
}

.view-panel.active {
  display: block;
  animation: fadeIn 0.2s ease;
}

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

/* ==========================================================================
   VIEW 2: Portfolio & Interactive Chart
   ========================================================================== */
.metric-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-card);
}

.metric-label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.metric-val {
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.6px;
  font-family: var(--font-mono);
}

.metric-sub {
  font-size: 0.74rem;
  color: var(--text-dim);
  margin-top: 4px;
}

.metric-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  margin-bottom: 6px;
}

.metric-card-top .metric-label {
  margin-bottom: 0;
}

.metric-sub strong {
  color: #fff;
  font-family: var(--font-mono);
  font-weight: 600;
}

/* FI-Progress Row */
.fi-progress-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}

.fi-progress-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fi-progress-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.fi-title {
  font-size: 0.85rem;
  font-weight: 700;
}

.fi-pct {
  font-size: 1.1rem;
  font-family: var(--font-mono);
}

.fi-bar-track {
  width: 100%;
  height: 10px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 8px;
}

.fi-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent-green), #34c759);
  border-radius: 5px;
  transition: width 0.5s ease;
}

.fi-bar-sub {
  display: flex;
  justify-content: space-between;
  font-size: 0.74rem;
  color: var(--text-muted);
}

.fi-metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fi-mini-label {
  font-size: 0.74rem;
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  margin-bottom: 4px;
}

.fi-mini-val {
  font-size: 1.3rem;
  font-weight: 800;
  font-family: var(--font-mono);
}

.fi-mini-sub {
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Interactive Chart Card */
.chart-section-card {
  background: var(--bg-card);
  border: 1px solid rgba(212, 168, 67, 0.25);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card), 0 0 24px rgba(212, 168, 67, 0.04);
}

.chart-header-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 18px;
  flex-wrap: wrap;
  gap: 16px;
}

.chart-hero-summary {
  display: flex;
  flex-direction: column;
}

.chart-hero-main {
  display: flex;
  align-items: baseline;
  gap: 4px;
}

.chart-hero-currency {
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--text-muted);
}

.chart-hero-number {
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: -1px;
  font-family: var(--font-mono);
}

.chart-hero-delta {
  font-size: 0.95rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.scrub-date {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-left: 6px;
}

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

.timeframe-buttons {
  display: flex;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: var(--radius-pill);
}

.tf-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
}

.tf-btn:hover {
  color: #fff;
}

.tf-btn.active {
  background: rgba(212, 168, 67, 0.15);
  color: #f5d77f;
  border: 1px solid rgba(212, 168, 67, 0.4);
}

.mode-toggle-group {
  display: flex;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 3px;
  border-radius: var(--radius-pill);
}

.mode-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  font-weight: 600;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: var(--transition);
}

.mode-btn.active {
  background: rgba(212, 168, 67, 0.15);
  color: #f5d77f;
  border: 1px solid rgba(212, 168, 67, 0.4);
}

.canvas-wrapper {
  position: relative;
  width: 100%;
  height: 380px;
}

#portfolio-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.canvas-tooltip {
  position: absolute;
  pointer-events: none;
  background: rgba(18, 20, 27, 0.95);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  color: #fff;
  font-size: 0.76rem;
  font-family: var(--font-mono);
  box-shadow: var(--shadow-popup);
  z-index: 10;
  transform: translate(-50%, -120%);
  white-space: nowrap;
}

/* Sovereign Pro Tools Bar (Below Chart) */
.chart-pro-tools-bar {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.pro-tools-heading {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  text-transform: uppercase;
}

.pro-tools-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-gold);
  box-shadow: 0 0 8px rgba(212, 168, 67, 0.6);
  display: inline-block;
}

.pro-tools-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.btn-pro-tool {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  font-size: 0.78rem;
  font-weight: 700;
  border-radius: var(--radius-sm, 8px);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-primary);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  white-space: nowrap;
  outline: none;
}

.btn-pro-tool:hover {
  transform: translateY(-1px);
}

.btn-pro-tool:active {
  transform: translateY(0.5px);
}

.btn-tool-crash {
  border-color: rgba(239, 68, 68, 0.35);
  color: #f87171;
  background: rgba(239, 68, 68, 0.06);
}
.btn-tool-crash:hover {
  background: rgba(239, 68, 68, 0.15);
  border-color: rgba(239, 68, 68, 0.6);
  color: #fca5a5;
  box-shadow: 0 2px 12px rgba(239, 68, 68, 0.2);
}

.btn-tool-sync {
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
  background: rgba(56, 189, 248, 0.06);
}
.btn-tool-sync:hover {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.6);
  color: #7dd3fc;
  box-shadow: 0 2px 12px rgba(56, 189, 248, 0.2);
}

.btn-tool-badge {
  border-color: rgba(212, 168, 67, 0.4);
  color: var(--accent-gold-light, #f5d77f);
  background: rgba(212, 168, 67, 0.08);
}
.btn-tool-badge:hover {
  background: rgba(212, 168, 67, 0.18);
  border-color: rgba(212, 168, 67, 0.7);
  color: #fff2be;
  box-shadow: 0 2px 14px rgba(212, 168, 67, 0.25);
}

@media (max-width: 640px) {
  .chart-pro-tools-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .pro-tools-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
    width: 100%;
  }
  .btn-pro-tool {
    justify-content: center;
    padding: 8px 12px;
  }
}

/* Holdings Card & Table */
.holdings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
}

.holdings-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
  margin-bottom: 24px;
}

.holdings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 18px;
}

.holdings-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.holdings-title-group h3 {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.holdings-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.holdings-search-box .search-lens {
  position: absolute;
  left: 11px;
  font-size: 0.8rem;
  opacity: 0.6;
  pointer-events: none;
}

.holdings-search-input {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 7px 14px 7px 32px;
  font-size: 0.8rem;
  color: #fff;
  outline: none;
  transition: all 0.2s ease;
  width: 190px;
}

.holdings-search-input:focus {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 214, 10, 0.4);
  box-shadow: 0 0 12px rgba(255, 214, 10, 0.18);
  width: 230px;
}

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

.holdings-sort-box {
  position: relative;
  display: flex;
  align-items: center;
}

.holdings-sort-select {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 6.5px 28px 6.5px 14px;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-main);
  outline: none;
  cursor: pointer;
  transition: all 0.2s ease;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238e9bb0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.holdings-sort-select:hover,
.holdings-sort-select:focus {
  background-color: rgba(255, 255, 255, 0.09);
  border-color: rgba(212, 168, 67, 0.45);
  box-shadow: 0 0 10px rgba(212, 168, 67, 0.18);
  color: #fff;
}

.holdings-sort-select option {
  background: #141822;
  color: #fff;
}

/* ==========================================================================
   Holdings Table — Apple Minimalist Professional Grid
   ========================================================================== */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  background: rgba(13, 16, 23, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.holdings-table {
  width: 100%;
  min-width: 960px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.82rem;
  letter-spacing: -0.01em;
}

.holdings-table th {
  background: rgba(16, 20, 29, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  color: #7d8a9e;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  position: sticky;
  top: 0;
  z-index: 2;
  text-align: left;
  white-space: nowrap;
}

.holdings-table th.sortable-th {
  cursor: pointer;
  user-select: none;
  transition: color 0.15s ease, background 0.15s ease;
}

.holdings-table th.sortable-th:hover {
  color: #f0f6fc;
  background: rgba(255, 255, 255, 0.04);
}

.holdings-table th.sortable-th:focus-visible {
  outline: 2px solid var(--accent-gold);
  outline-offset: -2px;
}

.holdings-table th.sortable-th .sort-icon {
  display: inline-block;
  font-size: 0.68rem;
  margin-left: 3px;
  opacity: 0.3;
  transition: opacity 0.15s ease, transform 0.15s ease, color 0.15s ease;
  vertical-align: middle;
}

.holdings-table th.sortable-th:hover .sort-icon {
  opacity: 0.75;
}

.holdings-table th.sortable-th.active-sort {
  color: var(--accent-gold);
}

.holdings-table th.sortable-th.active-sort .sort-icon {
  opacity: 1;
  color: var(--accent-gold);
}

.holdings-table th.th-num {
  text-align: right;
}

.holdings-table td {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  vertical-align: middle;
  color: #e2e8f0;
  transition: background 0.15s ease;
}

.holdings-table tbody tr {
  cursor: pointer;
  transition: background 0.15s ease;
}

.holdings-table tbody tr:hover td {
  background: rgba(255, 255, 255, 0.03);
}

.holdings-table tbody tr:last-child td {
  border-bottom: none;
}

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

/* 1. Asset & Symbol Column */
.asset-cell {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 280px;
}

.asset-header-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.asset-symbol {
  font-weight: 700;
  font-size: 0.92rem;
  color: #ffffff;
  letter-spacing: 0.02em;
}

.asset-name {
  font-size: 0.73rem;
  color: #8b9bb4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 260px;
}

/* 2. Broker Column & Chips */
.broker-chips-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  align-items: center;
}

.broker-chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.68rem;
  font-weight: 500;
  padding: 2.5px 7px;
  border-radius: 4px;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.05);
  color: #cbd5e1;
  border: 1px solid rgba(255, 255, 255, 0.08);
  white-space: nowrap;
  line-height: 1.25;
}

.broker-chip.broker-fidelity,
.broker-chip.broker-fidelityinternational {
  background: rgba(48, 209, 88, 0.08);
  color: #4ade80;
  border-color: rgba(48, 209, 88, 0.18);
}

.broker-chip.broker-scalable,
.broker-chip.broker-scalablecapital {
  background: rgba(56, 189, 248, 0.08);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.18);
}

.broker-chip.broker-charlesschwab {
  background: rgba(251, 191, 36, 0.08);
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.18);
}

.broker-chip.broker-traderepublic {
  background: rgba(248, 250, 252, 0.08);
  color: #f1f5f9;
  border-color: rgba(248, 250, 252, 0.18);
}

.broker-chip.broker-trading212 {
  background: rgba(14, 165, 233, 0.08);
  color: #38bdf8;
  border-color: rgba(14, 165, 233, 0.18);
}

.broker-chip.broker-smartbroker {
  background: rgba(251, 146, 60, 0.08);
  color: #fb923c;
  border-color: rgba(251, 146, 60, 0.18);
}

.broker-chip.broker-realestate {
  background: rgba(192, 132, 252, 0.08);
  color: #c084fc;
  border-color: rgba(192, 132, 252, 0.18);
}

/* 3. Shares, Avg Buy, Price */
.col-shares .shares-val,
.col-avgbuy .price-val,
.col-price .price-val {
  color: #cbd5e1;
  font-size: 0.82rem;
  letter-spacing: -0.01em;
}

/* 4. Market Value */
.value-cell {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.holding-value {
  color: #ffffff;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* 5. Allocation Cell with Mini Bar */
.alloc-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.alloc-mini-bar {
  width: 40px;
  height: 4px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.alloc-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #d4a843, #30d158);
  border-radius: 999px;
}

/* 6. Unrealized P&L Pill */
.col-pl {
  text-align: right;
}

.pl-pill {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  padding: 4px 9px;
  border-radius: 6px;
  border: 1px solid transparent;
  min-width: 104px;
  text-align: right;
  line-height: 1.25;
  transition: transform 0.15s ease, background 0.15s ease;
}

.pl-top-row {
  display: flex;
  align-items: center;
  gap: 3px;
  justify-content: flex-end;
}

.pl-arrow {
  font-size: 0.72rem;
  line-height: 1;
  font-weight: 700;
}

.pl-abs {
  font-size: 0.78rem;
  letter-spacing: -0.01em;
}

.pl-pct {
  font-size: 0.68rem;
  font-weight: 500;
  opacity: 0.85;
  letter-spacing: 0.01em;
}

.pl-pill.text-green {
  background: rgba(34, 197, 94, 0.08);
  color: #22c55e;
  border-color: rgba(34, 197, 94, 0.2);
}

.pl-pill.text-red {
  background: rgba(239, 68, 68, 0.08);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.2);
}

.mobile-pl {
  display: none;
}

.mobile-only,
.mobile-only-inline {
  display: none !important;
}

/* ==========================================================================
   MOBILE & TABLET HOLDINGS CARDS VIEW (<= 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .holdings-card {
    padding: 16px;
    border-radius: var(--radius-lg);
  }

  .table-responsive {
    border: none;
    background: transparent;
    overflow-x: visible;
  }

  .holdings-table {
    display: block;
    min-width: 0 !important;
    width: 100%;
  }

  .holdings-table thead {
    display: none; /* Cleanly eliminate crushed 8-column header on tablets & phones */
  }

  .holdings-table tbody {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
  }

  /* On tablet screens (769px - 1024px), use an ultra-crisp 2-column card grid */
  @media (min-width: 769px) {
    .holdings-table tbody {
      display: grid !important;
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 12px !important;
    }
  }

  .holding-row {
    display: grid !important;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
    gap: 4px 10px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(22, 27, 38, 0.95), rgba(15, 18, 25, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
    transition: transform 0.15s ease, border-color 0.15s ease;
  }

  .holding-row:active {
    transform: scale(0.99);
    border-color: rgba(255, 214, 10, 0.35);
  }

  .desktop-only {
    display: none !important;
  }

  .mobile-only {
    display: block !important;
  }

  /* Grid Area 1 (Top Left): Symbol & Broker */
  .col-asset {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    padding: 0 !important;
    border: none !important;
  }

  .asset-cell {
    max-width: 100%;
  }

  .asset-header-line .broker-chips-wrapper {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 3px;
  }

  .asset-name {
    max-width: 52vw;
    font-size: 0.73rem;
    margin-top: 2px;
  }

  /* Grid Area 2 (Top Right): Market Value & P&L */
  .col-value {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    padding: 0 !important;
    border: none !important;
    text-align: right;
  }

  .holding-value {
    font-size: 0.95rem;
    color: #fff;
  }

  .mobile-pl {
    display: block;
    font-size: 0.72rem;
    font-weight: 700;
    margin-top: 1px;
  }

  /* Grid Area 3 (Bottom Left): Micro Meta Strip */
  .col-mobile-meta {
    grid-column: 1 / 2;
    grid-row: 3 / 4;
    padding: 0 !important;
    border: none !important;
    margin-top: 6px;
    padding-top: 6px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.04) !important;
  }

  .mobile-meta-strip {
    font-size: 0.71rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 5px;
    flex-wrap: wrap;
  }

  .mobile-meta-strip strong {
    color: var(--text-dim);
  }

  .meta-dot {
    opacity: 0.4;
  }

  /* Grid Area 4 (Bottom Right): Allocation */
  .col-alloc {
    grid-column: 2 / 3;
    grid-row: 3 / 4;
    padding: 0 !important;
    border: none !important;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 6px;
    padding-top: 6px !important;
    border-top: 1px solid rgba(255, 255, 255, 0.04) !important;
  }

  .alloc-mini-bar {
    width: 32px;
    height: 4px;
  }

  .holdings-search-input {
    width: 140px;
  }

  .holdings-search-input:focus {
    width: 170px;
  }
}

/* ==========================================================================
   VIEW 3: FI-Planner
   ========================================================================== */
/* ==========================================================================
   VIEW 3: FI-Planner Dual Phase Switcher (Apple Minimalist Segmented Control)
   ========================================================================== */
.fi-phase-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.fi-mode-switch-bar {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 9999px;
  padding: 3px;
  gap: 4px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  width: fit-content;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.fi-mode-btn {
  appearance: none;
  -webkit-appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 9999px;
  color: #94a3b8;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  cursor: pointer;
  outline: none;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  white-space: nowrap;
}

.fi-mode-btn .svrgn-icon {
  width: 14px;
  height: 14px;
  opacity: 0.75;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.fi-mode-btn:hover {
  color: #f1f5f9;
  background: rgba(255, 255, 255, 0.04);
}

.fi-mode-btn.active {
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35) !important;
}

.fi-mode-btn.active .svrgn-icon {
  opacity: 1;
  stroke: var(--accent-gold);
}

.fi-phase-hint {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 9px 14px;
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.45;
}

.fi-phase-hint .shield-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(212, 168, 67, 0.1);
  flex-shrink: 0;
}

.fi-phase-panel {
  display: none;
}

.fi-phase-panel.active {
  display: block;
}

@media (max-width: 640px) {
  .fi-mode-switch-bar {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 12px;
    padding: 3px;
  }
  .fi-mode-btn {
    width: 100%;
    border-radius: 9px;
    padding: 9px 6px;
    font-size: 0.74rem;
    gap: 5px;
    text-align: center;
  }
}

.planner-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.planner-card {
  background: rgba(18, 22, 32, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.planner-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.planner-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0;
}

/* Apple Sleek Micro-Action Pill Button */
.fi-autofill-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.08) !important;
  color: #cbd5e1 !important;
  border-radius: 9999px !important;
  padding: 5px 12px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
  flex-shrink: 0;
}

.fi-autofill-btn:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: #ffffff !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  transform: translateY(-1px);
}

.fi-autofill-btn .svrgn-icon {
  stroke: var(--accent-gold);
}

.planner-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.73rem;
  font-weight: 600;
  color: #94a3b8;
  letter-spacing: 0.02em;
}

.form-input {
  background: rgba(10, 14, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 0.95rem;
  font-family: var(--font-mono);
  outline: none;
  transition: all 0.2s ease;
}

.form-input:focus {
  border-color: rgba(212, 168, 67, 0.5);
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.12);
  background: rgba(13, 18, 28, 0.9);
}

.form-select {
  background: rgba(10, 14, 22, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 10px 14px;
  color: #ffffff;
  font-size: 0.88rem;
  outline: none;
  transition: all 0.2s ease;
}

.form-select:focus {
  border-color: rgba(212, 168, 67, 0.5);
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.12);
}

.range-with-val {
  display: flex;
  align-items: center;
  gap: 14px;
}

.form-range {
  flex: 1;
  accent-color: var(--accent-gold);
  cursor: pointer;
}

.range-indicator {
  min-width: 54px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--accent-gold);
  text-align: right;
}

/* FIRE Tiers */
.fire-tiers-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.tier-card {
  display: flex;
  gap: 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 14px;
  transition: var(--transition);
}

.tier-card.active {
  border-color: rgba(48, 209, 88, 0.25);
  background: rgba(48, 209, 88, 0.02);
}

.tier-card.current {
  border-color: rgba(212, 168, 67, 0.35);
  background: rgba(212, 168, 67, 0.04);
}

.tier-icon {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.tier-icon .svrgn-icon {
  width: 18px;
  height: 18px;
  stroke: var(--accent-gold);
}

.tier-card.active .tier-icon {
  background: rgba(34, 197, 94, 0.08);
  border-color: rgba(34, 197, 94, 0.25);
}

.tier-card.active .tier-icon .svrgn-icon {
  stroke: #22c55e;
}

.tier-card.current .tier-icon {
  background: rgba(212, 168, 67, 0.12);
  border-color: rgba(212, 168, 67, 0.35);
}

.tier-card.current .tier-icon .svrgn-icon {
  stroke: #f5d77f;
}

.fi-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
}

.fi-dot-bull {
  background: #22c55e;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.4);
}

.fi-dot-median {
  background: #f59e0b;
  box-shadow: 0 0 6px rgba(245, 158, 11, 0.4);
}

.fi-dot-bear {
  background: #ef4444;
  box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.tier-details {
  flex: 1;
  min-width: 0;
}

.tier-name {
  font-size: 0.85rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.tier-value {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: #fff;
  margin: 2px 0;
}

.tier-desc {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* German FIFO Tax Order Blueprint Card */
.fi-fifo-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(212, 168, 67, 0.2);
  border-radius: 14px;
  padding: 16px;
}

.fi-fifo-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.fi-fifo-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f5d77f;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.deacc-steps-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fi-step-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 0.76rem;
  line-height: 1.45;
  color: #cbd5e1;
}

.fi-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  min-width: 22px;
  border-radius: 50%;
  background: rgba(212, 168, 67, 0.12);
  border: 1px solid rgba(212, 168, 67, 0.35);
  color: #f5d77f;
  font-size: 0.7rem;
  font-weight: 700;
  font-family: var(--font-mono);
  margin-top: 1px;
}

.fi-step-content {
  flex: 1;
}

.fi-step-content strong {
  color: #ffffff;
}

/* Decumulation KPI Grid */
.fi-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-bottom: 16px;
}

.fi-kpi-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  padding: 12px 14px;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.fi-kpi-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}

.fi-kpi-val {
  font-size: 1.15rem;
  font-weight: 800;
  font-family: var(--font-mono);
  line-height: 1.25;
}

.fi-kpi-sub {
  font-size: 0.68rem;
  color: var(--text-dim);
}

/* Trajectory Box & Responsive Header */
.fi-trajectory-box {
  background: #090c12;
  border: 1px solid rgba(212, 168, 67, 0.2);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 16px;
}

.fi-trajectory-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.fi-trajectory-title {
  font-size: 0.75rem;
  font-weight: 700;
  color: #cbd5e1;
}

.fi-trajectory-median {
  font-size: 0.72rem;
  color: var(--accent-gold);
  font-family: var(--font-mono);
  font-weight: 600;
}

.fi-trajectory-legend {
  display: flex;
  justify-content: space-between;
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 6px;
  flex-wrap: wrap;
  gap: 4px;
}

@media (max-width: 480px) {
  .fi-kpi-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .fi-trajectory-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* ==========================================================================
   VIEW 4: Deep-Dive Analytics
   ========================================================================== */
.deep-dive-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  min-width: 0;
  max-width: 100%;
  width: 100%;
}

.deep-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-card);
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
}

.deep-card-full {
  grid-column: 1 / -1;
  min-width: 0;
  max-width: 100%;
}

.deep-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
  min-width: 0;
  max-width: 100%;
}

.deep-card-header h3 {
  font-size: 1rem;
  font-weight: 700;
}

.deep-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.deep-bars-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.deep-bar-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
}

.deep-bar-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 4px;
  overflow: hidden;
}

.deep-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.4s ease;
}

/* ==========================================================================
   LOOK-THROUGH STYLING (Deep Dive)
   ========================================================================== */
.lookthrough-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.lookthrough-title-row h3 {
  margin: 0;
  font-size: 1.05rem;
}

.lookthrough-search-wrapper {
  margin-top: 4px;
}

.lookthrough-table {
  width: 100%;
  min-width: 800px;
}

.lt-company-cell {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lt-rank {
  font-size: 0.74rem;
  color: var(--text-muted);
  width: 26px;
  text-align: right;
  flex-shrink: 0;
}

.lt-top-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lt-company-name {
  font-size: 0.88rem;
  color: #fff;
}

.lt-symbol-badge {
  font-size: 0.68rem;
  padding: 1px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.1);
  white-space: nowrap;
}

.lt-pct-cell {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.lt-mini-bar {
  width: 44px;
  height: 5px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
}

.lt-mini-fill {
  height: 100%;
  background: linear-gradient(90deg, #22c55e, #10b981);
  border-radius: 3px;
}

/* Cluster Risk Indicator & Highlighting */
.lookthrough-row.is-cluster-risk {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(239, 68, 68, 0.04)) !important;
  border-left: 3px solid #f59e0b !important;
  box-shadow: inset 0 0 12px rgba(245, 158, 11, 0.04);
}

.lookthrough-row.is-cluster-risk:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.15), rgba(239, 68, 68, 0.08)) !important;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.15), inset 0 0 16px rgba(245, 158, 11, 0.06);
}

.badge-cluster {
  background: rgba(245, 158, 11, 0.18);
  border: 1px solid rgba(245, 158, 11, 0.5);
  color: #fbbf24;
  font-size: 0.65rem;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.lt-pct-val.cluster-risk-text {
  color: #fbbf24 !important;
  text-shadow: 0 0 8px rgba(245, 158, 11, 0.3);
}

.lt-mini-fill.cluster-fill {
  background: linear-gradient(90deg, #f59e0b, #ef4444) !important;
}

.cluster-risk-banner {
  transition: all 0.3s ease;
}

.btn-subtle {
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: #f1f5f9;
}

.btn-subtle:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.3);
  color: #ffffff;
}

#btn-filter-cluster-risk,
.btn-cluster-filter {
  appearance: none !important;
  -webkit-appearance: none !important;
  background: #181d28 !important;
  background-color: #181d28 !important;
  border: 1px solid #d97706 !important;
  color: #fbbf24 !important;
  font-weight: 700 !important;
  padding: 6px 14px !important;
  border-radius: 8px !important;
  cursor: pointer !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
  transition: all 0.2s ease !important;
}

#btn-filter-cluster-risk:hover,
.btn-cluster-filter:hover {
  background: #242c3d !important;
  background-color: #242c3d !important;
  color: #ffffff !important;
  border-color: #fbbf24 !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35) !important;
}

#btn-filter-cluster-risk.active,
.btn-cluster-filter.active {
  background: #f59e0b !important;
  background-color: #f59e0b !important;
  border-color: #d97706 !important;
  color: #0b0e14 !important;
  font-weight: 800 !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.5) !important;
}

#btn-toggle-cluster-focus {
  appearance: none !important;
  -webkit-appearance: none !important;
  background: #181d28 !important;
  background-color: #181d28 !important;
  border: 1px solid #d97706 !important;
  color: #fbbf24 !important;
  font-weight: 700 !important;
  padding: 6px 14px !important;
  border-radius: 6px !important;
  cursor: pointer !important;
  white-space: nowrap !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4) !important;
  transition: all 0.2s ease !important;
}

#btn-toggle-cluster-focus:hover {
  background: #242c3d !important;
  background-color: #242c3d !important;
  color: #ffffff !important;
  border-color: #fbbf24 !important;
  box-shadow: 0 0 14px rgba(245, 158, 11, 0.35) !important;
}

#btn-toggle-cluster-focus.active {
  background: #f59e0b !important;
  background-color: #f59e0b !important;
  border-color: #d97706 !important;
  color: #0b0e14 !important;
  font-weight: 800 !important;
  box-shadow: 0 0 16px rgba(245, 158, 11, 0.5) !important;
}

.lookthrough-footer,
.dividend-footer {
  display: flex;
  justify-content: center;
  padding: 16px 0 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
  margin-top: 14px;
}

.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 24px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.load-more-btn:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 214, 10, 0.4);
  transform: translateY(-1px);
}

.load-more-btn:active {
  transform: translateY(0);
}

.load-more-btn .btn-arrow {
  font-size: 0.95rem;
}

/* Mobile & Tablet Look-Through View (<= 1024px) */
@media (max-width: 1024px) {
  .deep-card {
    padding: 14px;
  }

  .lookthrough-table {
    display: block;
    min-width: 0 !important;
    width: 100%;
  }

  .lookthrough-table thead {
    display: none;
  }

  .lookthrough-table tbody {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  @media (min-width: 769px) {
    .lookthrough-table tbody {
      display: grid !important;
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 12px !important;
    }
  }

  .lookthrough-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 6px 12px;
    padding: 11px 12px;
    background: linear-gradient(135deg, rgba(22, 27, 38, 0.95), rgba(15, 18, 25, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .col-lt-company {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    padding: 0 !important;
    border: none !important;
    min-width: 0;
    overflow: hidden;
  }

  .lt-company-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
  }

  .lt-rank {
    font-size: 0.74rem;
    color: var(--text-muted);
    width: 22px;
    text-align: right;
    flex-shrink: 0;
  }

  .lt-company-info {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
  }

  .lt-top-line {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    width: 100%;
  }

  .lt-company-name {
    font-size: 0.85rem;
    min-width: 0;
    flex: 0 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .lt-symbol-badge {
    font-size: 0.65rem;
    padding: 1px 5px;
    flex-shrink: 0;
  }

  .col-lt-total {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    padding: 0 !important;
    border: none !important;
    text-align: right;
    font-size: 0.95rem;
    color: #fff;
    white-space: nowrap;
    flex-shrink: 0;
    justify-self: end;
  }

  .col-lt-direct,
  .col-lt-etf {
    display: none !important;
  }

  .col-lt-mobile-meta {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    padding: 0 !important;
    border: none !important;
    min-width: 0;
    overflow: hidden;
    margin-top: 2px;
  }

  .lt-mobile-strip {
    font-size: 0.72rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  .col-lt-pct {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    padding: 0 !important;
    border: none !important;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
    justify-self: end;
    margin-top: 2px;
  }

  .lt-pct-cell {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex-shrink: 0;
  }

  .lt-mini-bar {
    width: 28px;
    height: 4px;
    flex-shrink: 0;
  }
}

/* ==========================================================================
   VIEW 5: Dividends
   ========================================================================== */
.dividend-summary-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.dividend-chart-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.dividend-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.dividend-card-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
}

.dividend-bars-container {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 12px;
  align-items: end;
  height: 200px;
  padding-top: 20px;
}

.div-bar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.div-bar-val {
  font-size: 0.72rem;
  font-family: var(--font-mono);
  color: var(--text-muted);
  margin-bottom: 6px;
}

.div-bar-fill {
  width: 100%;
  max-width: 44px;
  background: linear-gradient(180deg, var(--accent-gold), #e5b800);
  border-radius: 6px 6px 0 0;
  transition: height 0.4s ease;
}

.div-bar-month {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 8px;
}

/* ==========================================================================
   Dividend Ranking Table (Desktop & Global)
   ========================================================================== */
.dividend-table {
  width: 100%;
}

.div-holding-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.div-holding-name {
  color: #fff;
  font-size: 0.88rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 280px;
}

/* ==========================================================================
   Buttons & Badges — SVRGN·W Signature System
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  font-family: inherit;
  outline: none;
  user-select: none;
  -webkit-user-select: none;
}

.btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 168, 67, 0.35) !important;
}

.btn-sm {
  padding: 6px 14px;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

.btn-primary {
  background: linear-gradient(135deg, #f5d77f 0%, #d4a843 100%);
  color: #0b0e14 !important;
  font-weight: 700;
  border: 1px solid transparent;
  box-shadow: 0 2px 14px rgba(212, 168, 67, 0.35);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #fff2be 0%, #e2b33e 100%);
  color: #0b0e14 !important;
  box-shadow: 0 4px 22px rgba(212, 168, 67, 0.55);
  transform: translateY(-1.5px);
}

.btn-primary:active {
  transform: translateY(0.5px);
  box-shadow: 0 1px 8px rgba(212, 168, 67, 0.3);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
  color: #ffffff;
  transform: translateY(-1px);
}

.btn-secondary:active {
  transform: translateY(0.5px);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-muted);
}

.badge-subtle {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-dim);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.badge-success {
  background: rgba(52, 211, 153, 0.1);
  color: #34d399;
  border: 1px solid rgba(52, 211, 153, 0.2);
}

.badge-blue {
  background: rgba(212, 168, 67, 0.08);
  color: #f5d77f;
  border: 1px solid rgba(212, 168, 67, 0.18);
}

.badge-purple {
  background: rgba(167, 139, 250, 0.08);
  color: #c4b5fd;
  border: 1px solid rgba(167, 139, 250, 0.18);
}

.badge-gold {
  background: rgba(212, 168, 67, 0.1);
  color: #f5d77f;
  border: 1px solid rgba(212, 168, 67, 0.25);
}

/* SVRGN·W Quote Staleness & Offline Protection Badge */
.svrgn-quote-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 3px 8px;
  border-radius: 6px;
  letter-spacing: 0.02em;
  transition: opacity 0.2s ease, border-color 0.2s ease;
  user-select: none;
}

.svrgn-quote-badge.stale {
  background: rgba(229, 169, 60, 0.09);
  color: var(--accent-amber, #e5a93c);
  border: 1px solid rgba(229, 169, 60, 0.25);
}

.svrgn-quote-badge.offline {
  background: rgba(239, 68, 68, 0.09);
  color: #f87171;
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.svrgn-quote-badge svg {
  flex-shrink: 0;
}

/* ==========================================================================
/* ==========================================================================
   Responsive Breakpoints & Container Queries (Mobile, Foldables, Tablets, Desktop)
   ========================================================================== */

/* Modern Container Queries for truly modular responsive components */
.planner-card,
.chart-section-card,
.holdings-card,
.cockpit-card,
.feed-stream-container,
.dos-comas-banner {
  container-type: inline-size;
}

/* Base safe-area support for iOS notch & home bar */
body {
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}

/* Tablet, Foldables & Medium Screens (<= 1180px) */
@media (max-width: 1180px) {
  .cockpit-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .metric-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .fi-progress-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .planner-grid,
  .deep-dive-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  /* 2-tier responsive control bar for Foldables & Tablets */
  .portfolio-switcher-section {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 0;
  }

  .portfolio-select-group {
    width: 100%;
    justify-content: flex-start;
  }

  .portfolio-pills {
    flex: 1 1 auto;
    min-width: 0;
    overflow-x: auto;
  }

  .portfolio-currency-switcher {
    width: 100%;
    margin-left: 0;
    justify-content: space-between;
  }
}

/* Mobile & Small Tablets (<= 860px) */
@media (max-width: 860px) {
  .global-header {
    height: 44px;
    padding: 0 14px;
    position: sticky;
    top: 0;
    z-index: 1000;
  }

  /* Clean single-row mobile header */
  .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    padding: 0;
    gap: 12px;
  }

  .brand-container {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex-shrink: 1;
  }

  .brand-logo-img {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    flex-shrink: 0;
  }

  .brand-name {
    font-size: 0.95rem;
    font-weight: 700;
    white-space: nowrap;
    letter-spacing: 0.04em;
  }

  .brand-tagline {
    display: none;
  }

  /* Secondary actions and navigation tabs moved into mobile drawer */
  .nav-links {
    display: none;
  }

  .btn-import-header,
  .btn-support-header,
  .settings-toggle-btn {
    display: none;
  }

  .diagnostics-bar {
    display: none;
  }

  .header-right {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
  }

  /* Cockpit toggle transformed into sleek icon button on mobile */
  .cockpit-toggle-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    border-radius: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #94a3b8;
  }

  .cockpit-toggle-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
  }

  .cockpit-toggle-btn .label {
    display: none !important;
  }

  .cockpit-toggle-btn .pulse-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 5px;
    height: 5px;
    margin: 0;
  }

  /* AI Copilot toggle transformed into sleek icon button on mobile */
  .ai-toggle-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: transparent;
    border: none;
    cursor: pointer;
    color: #94a3b8;
  }

  .ai-toggle-btn:hover,
  .ai-toggle-btn:active {
    background: rgba(255, 255, 255, 0.05);
    color: var(--accent-gold);
  }

  .ai-toggle-btn .label {
    display: none !important;
  }

  .ai-toggle-btn .svrgn-icon {
    width: 16px;
    height: 16px;
    stroke: var(--accent-gold);
  }

  /* Mobile Burger Menu Button on far right */
  .mobile-burger-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 6px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease, opacity 0.2s ease, background 0.2s ease;
  }

  .mobile-burger-btn .svrgn-icon {
    width: 18px;
    height: 18px;
  }

  .mobile-burger-btn:hover,
  .mobile-burger-btn:active {
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
  }

  /* Portfolio switcher pills swipeable */
  .portfolio-switcher-section {
    padding: 0 0 4px;
    overflow-x: visible;
    gap: 10px;
    margin-bottom: 16px;
  }

  .portfolio-select-group {
    width: 100%;
    min-width: 0;
  }

  .portfolio-pills {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex: 1 1 auto;
    min-width: 0;
  }

  .portfolio-pills::-webkit-scrollbar {
    display: none;
  }

  .portfolio-pill {
    flex-shrink: 0;
    scroll-snap-align: start;
    white-space: nowrap;
    padding: 6px 12px;
    font-size: 0.76rem;
  }

  .portfolio-currency-switcher {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
  }

  /* Cockpit Drawer full width */
  .cockpit-drawer {
    padding: 12px 16px env(safe-area-inset-bottom, 24px);
    max-height: 88vh;
  }

  .cockpit-grid {
    grid-template-columns: 1fr;
  }

  .cash-grid,
  .perf-stats-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Chart controls */
  .chart-header-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .chart-controls-group {
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  .timeframe-buttons {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }

  .tf-btn {
    flex: 1;
    text-align: center;
    padding: 6px 2px;
    font-size: 0.72rem;
  }

  .mode-toggle-group {
    width: 100%;
    display: flex;
  }

  .mode-btn {
    flex: 1;
    text-align: center;
    font-size: 0.72rem;
  }

  .canvas-wrapper {
    height: 250px;
  }
}

@media (max-width: 540px) {
  .portfolio-switcher-section {
    gap: 8px;
    margin-bottom: 14px;
  }

  .portfolio-currency-switcher {
    flex-wrap: wrap;
    gap: 8px;
  }

  .curr-pill-btn {
    padding: 4px 7px;
    font-size: 0.70rem;
  }

  .audit-btn-text-full {
    display: none;
  }

  .audit-btn-text-short {
    display: inline;
  }

  #btn-run-portfolio-audit {
    padding: 4px 8px;
    font-size: 0.74rem;
  }
}

/* Phones & Narrow Foldables (<= 640px) */
@media (max-width: 640px) {
  .main-wrapper {
    padding: 12px 10px 40px;
  }

  .metric-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }

  .metric-card {
    padding: 12px 10px;
  }

  .metric-val {
    font-size: 1.12rem;
  }

  .metric-sub {
    font-size: 0.68rem;
  }

  .brand-tagline {
    display: none;
  }

  /* Modals as bottom-sheet on mobile */
  .modal-dialog {
    width: 100%;
    max-width: 100%;
    height: auto;
    max-height: 92vh;
    top: auto;
    bottom: 0;
    left: 0;
    transform: translateY(105%);
    border-radius: 22px 22px 0 0;
    border-bottom: none;
    border-left: none;
    border-right: none;
    padding-bottom: env(safe-area-inset-bottom, 16px);
    margin: 0;
  }

  .modal-dialog.open {
    transform: translateY(0);
  }

  .modal-header {
    padding: 16px 18px 12px;
  }

  .modal-body {
    padding: 14px 18px;
  }

  .import-tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .import-tab-btn {
    flex-shrink: 0;
    white-space: nowrap;
    font-size: 0.76rem;
    padding: 6px 10px;
  }

  /* Dividends */
  .dividend-summary-cards {
    grid-template-columns: 1fr;
  }

  .dividend-bars-container {
    gap: 3px;
  }

  .div-bar-val {
    font-size: 0.55rem;
  }

  .div-bar-month {
    font-size: 0.6rem;
  }

  /* Mobile Dividend Table Cards (<= 768px) */
  .dividend-table {
    display: block;
    min-width: 0;
    width: 100%;
  }

  .dividend-table thead {
    display: none;
  }

  .dividend-table tbody {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  .dividend-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: auto auto;
    gap: 6px 12px;
    padding: 12px 14px;
    background: linear-gradient(135deg, rgba(22, 27, 38, 0.95), rgba(15, 18, 25, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--radius-md);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.15s ease, border-color 0.15s ease;
  }

  .dividend-row:hover {
    border-color: rgba(255, 214, 10, 0.35) !important;
  }

  .dividend-row:active {
    transform: scale(0.985);
  }

  /* Row 1, Col 1: Holding Badge & Truncated Name */
  .col-div-holding {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    padding: 0 !important;
    border: none !important;
    min-width: 0;
    overflow: hidden;
  }

  .col-div-holding .div-holding-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    width: 100%;
  }

  .col-div-holding .div-holding-name {
    font-size: 0.86rem;
    min-width: 0;
    flex: 0 1 auto;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
  }

  /* Row 1, Col 2: Annual Dividend Amount in Gold */
  .col-div-amount {
    grid-column: 2 / 3;
    grid-row: 1 / 2;
    padding: 0 !important;
    border: none !important;
    text-align: right;
    font-size: 0.98rem;
    color: #ffd60a !important;
    white-space: nowrap;
    flex-shrink: 0;
    justify-self: end;
  }

  /* Hide individual desktop columns that are merged into the mobile strip */
  .col-div-yield,
  .col-div-freq,
  .col-div-date {
    display: none !important;
  }

  /* Row 2, Col 1: Yield · Frequency · Next Ex-Date */
  .col-div-mobile-meta {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    padding: 0 !important;
    border: none !important;
    min-width: 0;
    overflow: hidden;
    margin-top: 2px;
  }

  .div-mobile-strip {
    font-size: 0.74rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    min-width: 0;
  }

  /* Row 2, Col 2: Reinvestment Badge */
  .col-div-reinvest {
    grid-column: 2 / 3;
    grid-row: 2 / 3;
    padding: 0 !important;
    border: none !important;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    white-space: nowrap;
    flex-shrink: 0;
    justify-self: end;
    margin-top: 2px;
  }
}

/* Extra-Narrow Screens & Foldables Closed Cover Screen (<= 380px) */
@media (max-width: 380px) {
  .metric-row {
    grid-template-columns: 1fr;
  }

  .cash-grid,
  .perf-stats-grid {
    grid-template-columns: 1fr;
  }

  .canvas-wrapper {
    height: 200px;
  }

  .chart-hero-number {
    font-size: 1.6rem;
  }
}

/* ==========================================================================
   Modals (Import CSV & Settings Dialogs)
   ========================================================================== */
/* ==========================================================================
   Full-Page Import & Broker Sync Hub (Zero-Layer Native View)
   ========================================================================== */
.import-hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.import-hub-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
}

.import-hub-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.import-hub-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(48, 209, 88, 0.1);
  border: 1px solid rgba(48, 209, 88, 0.25);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

.import-hub-icon .svrgn-icon {
  width: 22px;
  height: 22px;
  stroke: var(--accent-green);
}

.import-hub-heading h2 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #fff;
  margin: 0;
}

.import-hub-sub {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.import-hub-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.import-actions-bar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  margin-top: 10px;
}

.import-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
}

/* Import Tabs */
.import-tabs {
  display: flex;
  gap: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  padding: 5px;
  border-radius: var(--radius-pill);
  flex-wrap: wrap;
}

.import-tab-btn {
  flex: 1;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: var(--radius-pill);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: var(--transition);
}

.import-tab-btn:hover {
  color: #fff;
}

.import-tab-btn.active {
  background: rgba(212, 168, 67, 0.14);
  border-color: #d4a843;
  color: #f5d77f;
  box-shadow: 0 0 12px rgba(212, 168, 67, 0.25);
}

.import-tab-pane {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Request File Support Tab */
.request-support-box {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.request-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.request-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(212, 168, 67, 0.12);
  border: 1px solid rgba(212, 168, 67, 0.3);
  color: var(--accent-gold);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 3px 8px;
  border-radius: var(--radius-pill);
  align-self: flex-start;
}

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

.request-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 640px) {
  .request-grid {
    grid-template-columns: 1fr;
  }
}

.request-dropzone {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  transition: var(--transition);
}

.request-dropzone.dragover {
  border-color: var(--accent-gold);
  background: rgba(212, 168, 67, 0.06);
}

.request-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  flex-wrap: wrap;
}

.request-quick-info {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 0.78rem;
}

.chip-mini {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--text-main);
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.chip-mini.chip-planned {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.25);
  color: #38bdf8;
}

.form-textarea {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  color: #fff;
  font-size: 0.8rem;
  font-family: var(--font-mono);
  resize: vertical;
  outline: none;
  transition: var(--transition);
}

.form-textarea:focus {
  border-color: var(--border-focus);
}

.import-actions-bar {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  padding: 20px 0 0;
  border-top: 1px solid var(--border);
}

/* Privacy Notice */
.privacy-notice {
  background: rgba(48, 209, 88, 0.08);
  border: 1px solid rgba(48, 209, 88, 0.25);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  font-size: 0.8rem;
  color: var(--text-main);
  line-height: 1.45;
}

.shield-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
}

/* Form Grid */
.import-form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
}

.form-select {
  width: 100%;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  color: #fff;
  font-size: 0.86rem;
  font-family: inherit;
  outline: none;
  cursor: pointer;
  transition: var(--transition);
}

.form-select:focus {
  border-color: var(--border-focus);
}

/* Drag & Drop Zone */
.csv-dropzone {
  border: 2px dashed rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-lg);
  padding: 30px 20px;
  text-align: center;
  background: rgba(255, 255, 255, 0.02);
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.csv-dropzone:hover,
.csv-dropzone.dragover {
  border-color: var(--accent-green);
  background: rgba(48, 209, 88, 0.05);
}

.drop-icon {
  font-size: 2rem;
}

.drop-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #fff;
}

.drop-sub {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.drop-browse-btn {
  background: none;
  border: none;
  color: var(--accent-blue);
  font-weight: 700;
  text-decoration: underline;
  cursor: pointer;
  font-size: inherit;
}

.drop-file-name {
  margin-top: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-green);
  font-family: var(--font-mono);
}

.demo-csv-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* Import Preview Section */
.import-preview-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
}

.preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.preview-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
}

/* Settings Sections */
.settings-section {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.settings-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.settings-sec-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}

.settings-sec-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.key-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.key-status-text {
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.key-status-text.valid {
  color: var(--accent-green);
}

.key-status-text.error {
  color: var(--accent-red);
}

.key-status-text.loading {
  color: var(--accent-blue);
}

.form-help {
  font-size: 0.72rem;
  color: var(--text-dim);
  margin-top: 4px;
  display: block;
}

.settings-actions-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.storage-info-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
}

/* ==========================================================================
   SOVEREIGN FREEDOM MILESTONE & TURBO MODE HUD
   ========================================================================== */
.dos-comas-banner {
  background: linear-gradient(135deg, rgba(20, 24, 35, 0.95), rgba(10, 14, 22, 0.98));
  border: 1px solid rgba(255, 214, 10, 0.3);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5), inset 0 0 24px rgba(255, 214, 10, 0.04);
  border-radius: var(--radius-lg);
  padding: 18px 22px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
  contain: paint;
  transform: translateZ(0);
}

.cockpit-drawer .dos-comas-banner {
  margin-bottom: 0;
  border-color: rgba(255, 214, 10, 0.35);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.6), inset 0 0 24px rgba(255, 214, 10, 0.05);
}

.dos-comas-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255, 214, 10, 0.06) 0%, transparent 60%);
  pointer-events: none;
  animation: rotateGlow 24s linear infinite;
  will-change: transform;
  transform: translateZ(0);
}

@keyframes rotateGlow {
  0% { transform: translateZ(0) rotate(0deg); }
  100% { transform: translateZ(0) rotate(360deg); }
}

.dos-comas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}

.dos-comas-title-group {
  display: flex;
  align-items: center;
  gap: 10px;
}

.dos-comas-crown {
  font-size: 1.8rem;
  filter: drop-shadow(0 0 8px rgba(255, 214, 10, 0.5));
  animation: crownBounce 2.8s ease-in-out infinite;
  will-change: transform;
  transform: translateZ(0);
}

@keyframes crownBounce {
  0%, 100% { transform: translateZ(0) translateY(0); }
  50% { transform: translateZ(0) translateY(-3px) scale(1.04); }
}

.dos-comas-title {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  background: linear-gradient(90deg, #ffd60a, #ff9f0a, #30d158);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
}

.dos-comas-subtitle {
  font-size: 0.78rem;
  color: var(--text-dim);
  font-weight: 500;
}

/* Turbo Mode Badge */
.turbo-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #ff007a;
  overflow: hidden;
  isolation: isolate;
  animation: turboPulse 2.2s ease-in-out infinite;
  color: #fff;
  font-size: 0.76rem;
  font-weight: 800;
  padding: 6px 14px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 0 16px rgba(255, 0, 122, 0.5), 0 0 28px rgba(121, 40, 202, 0.35);
  will-change: transform;
  transform: translateZ(0);
  max-width: 100%;
  box-sizing: border-box;
  text-align: center;
}

.turbo-badge > * {
  position: relative;
  z-index: 2;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

/* Base vibrant gradient physically streaming from LEFT to RIGHT */
.turbo-badge::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 200%;
  height: 100%;
  background: linear-gradient(90deg, #ff007a, #7928ca, #ff453a, #ff007a, #7928ca, #ff453a);
  background-size: 50% 100%;
  z-index: 0;
  animation: turboFlowRight 3.5s linear infinite;
  will-change: transform;
}

/* Glowing energy sheen sweeping visibly across from LEFT to RIGHT */
.turbo-badge::after {
  content: '';
  position: absolute;
  top: 0;
  left: -40%;
  width: 40%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.55), transparent);
  transform: skewX(-22deg);
  z-index: 1;
  animation: turboSweepRight 2.4s ease-in-out infinite;
  pointer-events: none;
  will-change: transform;
}

@media (max-width: 420px) {
  .turbo-badge {
    font-size: 0.70rem;
    padding: 5px 10px;
    letter-spacing: 0.02em;
  }
}

@keyframes turboFlowRight {
  0% { transform: translateX(0); }
  100% { transform: translateX(50%); }
}

@keyframes turboSweepRight {
  0% { transform: translateX(0); opacity: 0; }
  15% { opacity: 0.9; }
  65% { opacity: 0.9; }
  85%, 100% { transform: translateX(420%); opacity: 0; }
}

@keyframes turboPulse {
  0%, 100% { transform: translateZ(0) scale(1); opacity: 0.95; }
  50% { transform: translateZ(0) scale(1.03); opacity: 1; }
}

/* Pause animations during touch gestures & scrolling for 120fps buttery scrolling */
body.is-touching .turbo-badge,
body.is-touching .turbo-badge::before,
body.is-touching .turbo-badge::after,
body.is-touching .dos-comas-banner::before,
body.is-touching .dos-comas-crown,
body.is-touching .comma-tracker-fill,
body.is-scrolling .turbo-badge,
body.is-scrolling .turbo-badge::before,
body.is-scrolling .turbo-badge::after,
body.is-scrolling .dos-comas-banner::before,
body.is-scrolling .dos-comas-crown,
body.is-scrolling .comma-tracker-fill {
  animation-play-state: paused !important;
  will-change: auto !important;
}

/* User preference to completely disable Turbo animations */
body.no-turbo-anim .turbo-badge,
body.no-turbo-anim .turbo-badge::before,
body.no-turbo-anim .turbo-badge::after,
body.no-turbo-anim .dos-comas-banner::before,
body.no-turbo-anim .dos-comas-crown,
body.no-turbo-anim .comma-tracker-fill {
  animation: none !important;
}

@media (prefers-reduced-motion: reduce) {
  .turbo-badge,
  .turbo-badge::before,
  .turbo-badge::after,
  .dos-comas-banner::before,
  .dos-comas-crown,
  .comma-tracker-fill {
    animation: none !important;
  }
}

/* Commas Visualization Grid */
.commas-progress-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  align-items: center;
}

@media (max-width: 768px) {
  .commas-progress-grid {
    grid-template-columns: 1fr;
  }
}

.comma-tracker-track {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  height: 22px;
  position: relative;
  overflow: hidden;
  margin-bottom: 8px;
}

.comma-tracker-fill {
  height: 100%;
  background: linear-gradient(90deg, #ffd60a, #30d158, #0a84ff);
  background-size: 200% 100%;
  animation: gradientFlow 5s linear infinite;
  border-radius: 999px;
  transition: width 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 0 12px rgba(48, 209, 88, 0.5);
  transform: translateZ(0);
}

@keyframes gradientFlow {
  0% { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.comma-milestones-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  margin-top: 14px;
}

.comma-milestone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-size: 0.74rem;
  line-height: 1.35;
  transition: all 0.2s ease;
}

.comma-milestone .milestone-name {
  font-size: 0.75rem;
  color: var(--text-dim);
  margin-bottom: 2px;
}

.comma-milestone .milestone-status {
  font-size: 0.72rem;
  font-weight: 600;
}

.comma-milestone.achieved {
  background: rgba(48, 209, 88, 0.08);
  border-color: rgba(48, 209, 88, 0.3);
  color: var(--accent-green);
}

.comma-milestone.achieved .milestone-name {
  color: var(--accent-green);
  font-weight: 700;
}

.comma-milestone.achieved .milestone-status {
  color: var(--accent-green);
}

.comma-milestone.current-target {
  background: rgba(255, 214, 10, 0.12);
  border-color: rgba(255, 214, 10, 0.5);
  color: var(--accent-gold);
  font-weight: 800;
  box-shadow: 0 0 14px rgba(255, 214, 10, 0.2);
}

.comma-milestone.current-target .milestone-name {
  color: #fff;
  font-weight: 800;
}

@media (max-width: 768px) {
  .comma-milestones-row {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-top: 12px;
  }

  .comma-milestone {
    padding: 8px 6px;
    min-height: 52px;
  }

  .comma-milestone .milestone-name {
    font-size: 0.72rem;
  }

  .comma-milestone .milestone-status {
    font-size: 0.70rem;
  }
}

@media (max-width: 380px) {
  .comma-milestones-row {
    grid-template-columns: repeat(2, 1fr);
    gap: 6px;
  }
}

/* Child-friendly explanation pill */
.child-friendly-box {
  background: rgba(48, 209, 88, 0.08);
  border: 1px dashed rgba(48, 209, 88, 0.3);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  font-size: 0.82rem;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}

.child-friendly-icon {
  font-size: 1.4rem;
  flex-shrink: 0;
}

.child-friendly-text {
  color: #c7eed2;
  line-height: 1.4;
}

.child-friendly-text strong {
  color: #fff;
}

/* Advanced Settings Accordion */
.settings-advanced-details {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.02);
  margin-top: 16px;
  overflow: hidden;
}

.settings-advanced-summary {
  padding: 12px 16px;
  font-size: 0.84rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: space-between;
  user-select: none;
  background: rgba(255, 255, 255, 0.03);
  transition: background 0.2s, color 0.2s;
}

.settings-advanced-summary:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
}

.settings-advanced-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   Mobile Burger Menu & Navigation Drawer
   ========================================================================== */
.mobile-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(5, 8, 15, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 1050;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}

.mobile-drawer-backdrop.open {
  opacity: 1;
  pointer-events: auto;
}

.mobile-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 86%;
  max-width: 350px;
  height: 100%;
  height: 100dvh;
  background: rgba(14, 18, 26, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.85);
  z-index: 1051;
  transform: translateX(105%);
  transition: transform 0.32s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.32s;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
}

.mobile-drawer.open {
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.mobile-drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.02);
}

.mobile-drawer-close {
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.mobile-drawer-close:hover {
  color: #fff;
  background: rgba(255, 69, 58, 0.2);
  border-color: rgba(255, 69, 58, 0.4);
}

.mobile-drawer-body {
  flex: 1;
  padding: 16px 18px 32px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.drawer-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-muted);
  margin-top: 4px;
}

.mobile-nav-list,
.mobile-actions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.mobile-nav-item,
.mobile-action-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-main);
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
  font-family: inherit;
  width: 100%;
}

.mobile-nav-item:hover,
.mobile-action-card:hover {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
}

.mobile-nav-item.active {
  background: rgba(212, 168, 67, 0.12);
  border-color: #d4a843;
  color: #f5d77f;
}

.mobile-nav-item .item-icon,
.mobile-action-card .action-icon {
  font-size: 1.3rem;
  flex-shrink: 0;
}

.mobile-nav-item .item-meta,
.mobile-action-card .action-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-nav-item .item-title,
.mobile-action-card .action-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
}

.mobile-nav-item .item-sub,
.mobile-action-card .action-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.pwa-install-card {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.12) 0%, rgba(48, 209, 88, 0.12) 100%);
  border: 1px solid rgba(255, 215, 0, 0.35);
}

.pwa-install-card:hover {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.2) 0%, rgba(48, 209, 88, 0.2) 100%);
  border-color: var(--accent-gold);
}

.drawer-status-box {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.drawer-status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* ==========================================================================
   VIEW 6: Settings Hub & System Center
   ========================================================================== */
.settings-hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
}

.settings-hub-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  border-bottom: 1px solid var(--border);
  padding-bottom: 20px;
  margin-bottom: 24px;
}

.settings-hub-heading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.settings-hub-icon {
  font-size: 2rem;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px;
  line-height: 1;
}

.settings-hub-heading h2 {
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.4px;
  color: #fff;
  margin-bottom: 4px;
}

.settings-hub-sub {
  font-size: 0.84rem;
  color: var(--text-muted);
}

.settings-hub-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Settings Sub-Menu Navigation */
.settings-subtabs-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  margin-bottom: 24px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.settings-subtabs-bar::-webkit-scrollbar {
  display: none;
}

.settings-subtab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  font-family: inherit;
}

.settings-subtab:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-main);
  border-color: rgba(255, 255, 255, 0.18);
}

.settings-subtab.active {
  background: rgba(212, 168, 67, 0.12);
  border-color: #d4a843;
  color: #f5d77f;
  box-shadow: 0 0 16px rgba(212, 168, 67, 0.25);
}

.settings-subtab-content {
  display: none;
}

.settings-subtab-content.active {
  display: flex;
  flex-direction: column;
  gap: 24px;
  animation: fadeIn 0.25s ease-in-out;
}

/* System Diagnostics Grid */
.system-diag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.diag-card {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.diag-card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.diag-card-header .icon {
  font-size: 1.25rem;
}

.diag-card-header .title {
  font-size: 0.86rem;
  font-weight: 700;
  color: #fff;
}

.diag-stat {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.diag-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Data Actions Grid */
.settings-data-actions-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.data-action-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  gap: 16px;
}

.data-action-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.data-action-info .action-icon {
  font-size: 1.5rem;
  flex-shrink: 0;
}

.data-action-info h5 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
}

.data-action-info p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Preference Rows */
.pref-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin-bottom: 12px;
}

.pref-row h5 {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 3px;
}

.pref-row p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.form-checkbox {
  width: 20px;
  height: 20px;
  cursor: pointer;
  accent-color: var(--accent-blue);
}

@media (max-width: 768px) {
  .settings-hub-card {
    padding: 16px 14px;
  }

  .data-action-card {
    flex-direction: column;
    align-items: stretch;
  }

  .import-hub-card {
    padding: 18px 14px;
    gap: 18px;
  }

  .import-hub-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .import-hub-top-actions {
    width: 100%;
  }

  .import-hub-top-actions button {
    width: 100%;
    justify-content: center;
    padding: 10px;
  }

  .import-tabs {
    flex-direction: column;
    border-radius: var(--radius-md);
    padding: 4px;
  }

  .import-tab-btn {
    min-width: unset;
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 0.8rem;
    justify-content: center;
  }

  .import-form-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .import-actions-bar {
    flex-direction: column-reverse;
    gap: 10px;
  }

  .import-actions-bar button {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }

  .csv-dropzone {
    padding: 28px 16px;
  }

  .demo-csv-banner {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .sample-btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
  }

  .sample-btn-group button {
    flex: 1 1 auto;
    font-size: 0.72rem;
  }
}

/* ==========================================================================
   FEATURE 1: Privacy Stealth Mode ("Train Mode")
   ========================================================================== */
.stealth-toggle-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 0.8rem;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  opacity: 0.82;
  transition: color 0.2s ease, opacity 0.2s ease, background 0.2s ease;
  position: relative;
}

.stealth-toggle-btn:hover {
  background: rgba(255, 255, 255, 0.05);
  color: #ffffff;
  opacity: 1;
}

.stealth-toggle-btn.active {
  background: rgba(255, 214, 10, 0.12);
  color: #ffd60a;
  opacity: 1;
  box-shadow: none;
}

body.stealth-mode .metric-val,
body.stealth-mode .chart-hero-val,
body.stealth-mode #chart-scrub-val,
body.stealth-mode #hero-portfolio-val,
body.stealth-mode .cash-amount,
body.stealth-mode .col-lt-total,
body.stealth-mode .col-lt-direct,
body.stealth-mode .col-lt-etf,
body.stealth-mode .perf-stat-val,
body.stealth-mode .holding-card-val,
body.stealth-mode .holding-cell-total,
body.stealth-mode .h-val,
body.stealth-mode #div-hero-val,
body.stealth-mode #fi-networth-display,
body.stealth-mode .stealth-blur {
  filter: blur(7.5px);
  user-select: none;
  cursor: pointer;
  transition: filter 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

body.stealth-mode .metric-val:hover,
body.stealth-mode .chart-hero-val:hover,
body.stealth-mode #chart-scrub-val:hover,
body.stealth-mode #hero-portfolio-val:hover,
body.stealth-mode .cash-amount:hover,
body.stealth-mode .col-lt-total:hover,
body.stealth-mode .perf-stat-val:hover,
body.stealth-mode .holding-card-val:hover,
body.stealth-mode .stealth-revealed {
  filter: blur(0) !important;
}

/* ==========================================================================
   FEATURE 2: Holding Detail & Transactions Drill-Down Drawer
   ========================================================================== */
.drilldown-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 998;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s ease, visibility 0.28s;
}

.drilldown-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.drilldown-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(15, 18, 25, 0.98);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -12px 48px rgba(0, 0, 0, 0.85);
  padding: 12px 24px 32px;
  max-height: 86vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(105%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
  box-sizing: border-box;
}

.drilldown-drawer.open {
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}

.drilldown-drag-handle {
  width: 44px;
  height: 5px;
  background: rgba(255, 255, 255, 0.25);
  border-radius: 999px;
  margin: 4px auto 14px;
  cursor: pointer;
}

.drilldown-inner {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.drilldown-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 14px;
}

.drilldown-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.drilldown-title-row h2 {
  font-size: 1.35rem;
  margin: 0;
  color: #fff;
  font-weight: 700;
}

.drilldown-price-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.dd-price-val {
  font-size: 1.15rem;
  font-weight: 700;
  color: #fff;
}

.drilldown-close-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.drilldown-close-btn:hover {
  background: rgba(255, 69, 58, 0.2);
  color: #fff;
  border-color: rgba(255, 69, 58, 0.4);
}

.dd-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.dd-metric-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.dd-metric-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-weight: 600;
}

.dd-metric-val {
  font-size: 1.15rem;
  color: #fff;
}

.dd-metric-sub {
  font-size: 0.76rem;
  color: var(--text-dim);
}

.dd-notes-card,
.dd-transactions-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
}

.dd-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.dd-section-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #fff;
}

.dd-save-indicator {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.dd-notes-textarea {
  width: 100%;
  height: 72px;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: #fff;
  font-family: inherit;
  font-size: 0.85rem;
  padding: 10px 12px;
  resize: vertical;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.2s;
}

.dd-notes-textarea:focus {
  border-color: var(--accent-blue);
}

.dd-table-container {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.dd-tx-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.dd-tx-table th {
  background: rgba(255, 255, 255, 0.04);
  padding: 10px 12px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.dd-tx-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
  color: #fff;
}

.dd-tx-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* Sample buttons styling in import modal */
.sample-btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}

.sample-btn-group .btn-xs {
  font-size: 0.75rem;
  padding: 5px 10px;
}

/* Clickable indicator on holding cards and rows */
.holding-card,
.lookthrough-row {
  cursor: pointer;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.holding-card:hover,
.lookthrough-row:hover {
  border-color: rgba(255, 255, 255, 0.2) !important;
}

@media (max-width: 768px) {
  .stealth-toggle-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: transparent;
    border: none;
  }

  .stealth-toggle-btn .label {
    display: none !important;
  }

  .stealth-toggle-btn .icon {
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
  }

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

  .drilldown-drawer {
    padding: 10px 16px 28px;
  }
}

/* ==========================================================================
   Page Bottom Legal Footer (§ 5 DDG 2-Click Compliance)
   ========================================================================== */
.view-legal-footer {
  width: 100%;
  margin-top: 40px;
  padding: 28px 16px env(safe-area-inset-bottom, 40px);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  text-align: center;
  box-sizing: border-box;
}

.view-legal-inner {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.view-legal-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.84rem;
  color: #94a3b8;
  flex-wrap: wrap;
  justify-content: center;
}

.view-legal-tagline {
  color: #94a3b8;
}

.view-legal-tagline em {
  color: #e2e8f0;
  font-style: italic;
}

.view-legal-crown {
  font-size: 1rem;
}

.view-legal-title {
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
}

.view-legal-links {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  font-size: 0.82rem;
}

.legal-link {
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.15s ease, transform 0.15s ease;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.legal-link:hover {
  color: var(--accent-gold);
  background: rgba(255, 214, 10, 0.08);
}

.legal-dot {
  color: rgba(255, 255, 255, 0.18);
}

.view-legal-disclaimer {
  font-size: 0.74rem;
  color: #94a3b8;
  line-height: 1.5;
  max-width: 650px;
  margin-top: 2px;
}

/* ==========================================================================
   TABLET VIEWPORT ENHANCEMENTS (<= 1024px)
   ========================================================================== */
@media (max-width: 1024px) {
  .dividend-table {
    display: block;
    min-width: 0 !important;
    width: 100%;
  }

  .dividend-table thead {
    display: none !important;
  }

  .dividend-table tbody {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
    min-width: 0;
  }

  @media (min-width: 769px) {
    .dividend-table tbody {
      display: grid !important;
      grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
      gap: 12px !important;
    }
  }

  .dividend-row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-rows: auto auto !important;
    gap: 6px 12px !important;
    padding: 12px 14px !important;
    background: linear-gradient(135deg, rgba(22, 27, 38, 0.95), rgba(15, 18, 25, 0.95)) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    border-radius: var(--radius-md) !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25) !important;
    box-sizing: border-box !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  /* Safe padding on tablet so bottom items aren't clipped by system gesture bars */
  .view-panel {
    padding-bottom: env(safe-area-inset-bottom, 36px);
  }
}

/* ==========================================================================
   Demo Mode Banner & Empty State Styling
   ========================================================================== */
.demo-mode-banner {
  background: rgba(212, 168, 67, 0.08);
  border: 1px solid rgba(212, 168, 67, 0.25);
  border-radius: 8px;
  padding: 8px 14px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  box-shadow: none;
}

.demo-banner-content {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 240px;
}

.demo-badge {
  background: var(--accent-gold, #d4a843);
  color: #0c0f17;
  font-weight: 700;
  font-size: 0.68rem;
  padding: 2px 7px;
  border-radius: 4px;
  letter-spacing: 0.04em;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
}

.demo-text {
  font-size: 0.8rem;
  color: #94a3b8;
}

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

.portfolio-empty-card {
  padding: 48px 20px;
  text-align: center;
  background: linear-gradient(135deg, rgba(22, 27, 38, 0.5), rgba(15, 18, 25, 0.7));
  border: 1px dashed rgba(212, 168, 67, 0.3);
  border-radius: var(--radius-lg, 16px);
  margin-bottom: 24px;
}

.empty-state-shield {
  font-size: 2.6rem;
  margin-bottom: 12px;
}

.empty-state-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main, #e6edf3);
  margin-bottom: 8px;
}

.empty-state-desc {
  font-size: 0.88rem;
  color: var(--text-muted, #8b949e);
  max-width: 480px;
  margin: 0 auto 20px auto;
  line-height: 1.5;
}

.empty-state-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

@keyframes svrgnwSpin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.spinning {
  display: inline-block;
  animation: svrgnwSpin 0.75s linear infinite;
}

/* ==========================================================================
   Turbo Mode Badge & Animations (Migrated from inline HTML)
   ========================================================================== */
.turbo-badge {
  position: relative !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  background: #ff007a !important;
  overflow: hidden !important;
  isolation: isolate !important;
  box-shadow: 0 0 16px rgba(255, 0, 122, 0.5), 0 0 28px rgba(121, 40, 202, 0.35) !important;
  will-change: transform !important;
  transform: translateZ(0) !important;
  animation: turboPulse 2.2s ease-in-out infinite !important;
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  color: #fff;
}

.turbo-badge > * {
  position: relative !important;
  z-index: 2 !important;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35) !important;
}

.turbo-badge::before {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: -100% !important;
  width: 200% !important;
  height: 100% !important;
  background: linear-gradient(90deg, #ff007a, #7928ca, #ff453a, #ff007a, #7928ca, #ff453a) !important;
  background-size: 50% 100% !important;
  z-index: 0 !important;
  animation: turboFlowRight 3.2s linear infinite !important;
  will-change: transform !important;
}

.turbo-badge::after {
  content: '' !important;
  position: absolute !important;
  top: 0 !important;
  left: -40% !important;
  width: 40% !important;
  height: 100% !important;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.65), transparent) !important;
  transform: skewX(-22deg) !important;
  z-index: 1 !important;
  animation: turboSweepRight 2.2s ease-in-out infinite !important;
  pointer-events: none !important;
  will-change: transform !important;
}

@keyframes turboFlowRight {
  0% { transform: translateX(0); }
  100% { transform: translateX(50%); }
}

@keyframes turboSweepRight {
  0% { transform: translateX(0); opacity: 0; }
  15% { opacity: 0.95; }
  65% { opacity: 0.95; }
  85%, 100% { transform: translateX(420%); opacity: 0; }
}

@keyframes turboPulse {
  0%, 100% { transform: translateZ(0) scale(1); opacity: 0.95; }
  50% { transform: translateZ(0) scale(1.03); opacity: 1; }
}

/* ==============================================================================
   Crisis Simulator, Proof Badge & P2P Sync Modals
   ============================================================================== */
.stress-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(10, 13, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.18s ease;
}

.stress-modal-window {
  background: #131722;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.7);
  animation: scaleUp 0.18s ease;
}

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

.stress-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  color: #f87171;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.stress-close-btn {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1.4rem;
  cursor: pointer;
  line-height: 1;
  padding: 4px;
  transition: color 0.15s ease;
}
.stress-close-btn:hover { color: #ffffff; }

.stress-scenarios-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 6px;
  margin-bottom: 14px;
}

.stress-scenario-chip {
  padding: 6px 14px;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}
.stress-scenario-chip:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}
.stress-scenario-chip.active {
  background: rgba(212, 168, 67, 0.15);
  border-color: rgba(212, 168, 67, 0.45);
  color: var(--accent-gold-light);
}

.stress-scenario-info {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 16px;
}
.stress-scenario-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: #ffffff;
}
.stress-scenario-desc {
  font-size: 0.78rem;
  color: #94a3b8;
  margin-top: 3px;
}

.stress-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}
.stress-kpi-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px;
}
.stress-kpi-card.danger {
  border-color: rgba(239, 68, 68, 0.35);
  background: rgba(239, 68, 68, 0.06);
}
.stress-kpi-card.danger .stress-kpi-val { color: #f87171; }
.stress-kpi-card.success {
  border-color: rgba(34, 197, 94, 0.35);
  background: rgba(34, 197, 94, 0.06);
}
.stress-kpi-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #94a3b8;
}
.stress-kpi-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: #f8fafc;
  margin: 4px 0 2px;
}
.stress-kpi-sub {
  font-size: 0.72rem;
  color: #64748b;
}

.stress-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  margin-bottom: 16px;
}
.stress-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  text-align: left;
}
.stress-table th, .stress-table td {
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.stress-table th {
  background: rgba(255, 255, 255, 0.03);
  color: #94a3b8;
  font-weight: 600;
}

.stress-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

/* Proof Badge Card */
.proof-card-preview {
  background: linear-gradient(135deg, #131722 0%, #1a2030 100%);
  border: 1px solid rgba(212, 168, 67, 0.35);
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.5), 0 0 25px rgba(212, 168, 67, 0.12);
  position: relative;
  overflow: hidden;
}
.proof-card-inner { position: relative; z-index: 2; }
.proof-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.proof-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}
.proof-badge-pill {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: 9999px;
  background: rgba(212, 168, 67, 0.15);
  border: 1px solid rgba(212, 168, 67, 0.45);
  color: var(--accent-gold-light);
}
.proof-tier-sub {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
}
.proof-tier-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: #ffffff;
  margin: 2px 0 16px;
}
.proof-metrics-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.proof-metric-box {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 8px;
  padding: 10px 12px;
}
.proof-metric-lbl {
  font-size: 0.68rem;
  color: #64748b;
  text-transform: uppercase;
  font-weight: 700;
}
.proof-metric-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: #f1f5f9;
  margin-top: 2px;
}
.proof-footer-stamp {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.68rem;
  color: #64748b;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
}

/* Local Sync Bridge Banner */
.svrgnw-bridge-banner {
  background: linear-gradient(135deg, rgba(20, 26, 38, 0.95) 0%, rgba(15, 19, 29, 0.98) 100%);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(212, 168, 67, 0.4);
  border-radius: 14px;
  padding: 12px 18px;
  margin: 0 auto 32px;
  max-width: 680px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), 0 0 20px rgba(212, 168, 67, 0.12);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}
.svrgnw-bridge-banner::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(212, 168, 67, 0.6), transparent);
}
.bridge-banner-content {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.86rem;
  color: #f1f5f9;
  flex: 1;
  min-width: 0;
}
.bridge-banner-icon {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(212, 168, 67, 0.15);
  border: 1px solid rgba(212, 168, 67, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent-gold);
}
.bridge-banner-text {
  line-height: 1.4;
  color: #cbd5e1;
}
.bridge-banner-text strong {
  color: #f8fafc;
  font-weight: 700;
  margin-right: 4px;
}
.bridge-banner-val {
  color: var(--accent-gold-light);
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-weight: 700;
}
.bridge-banner-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}
.btn-bridge-apply {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  border-radius: 9999px;
  background: linear-gradient(135deg, #f5d77f 0%, #d4a843 100%);
  color: #0c0f17;
  border: 1px solid rgba(255, 240, 179, 0.4);
  box-shadow: 0 2px 10px rgba(212, 168, 67, 0.35);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  font-family: inherit;
  white-space: nowrap;
}
.btn-bridge-apply:hover {
  background: linear-gradient(135deg, #fff2be 0%, #e2b33e 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212, 168, 67, 0.55);
}
.btn-bridge-close {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  color: #94a3b8;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}
.btn-bridge-close:hover {
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

@media (max-width: 640px) {
  .svrgnw-bridge-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px;
  }
  .bridge-banner-actions {
    justify-content: space-between;
  }
  .btn-bridge-apply {
    flex: 1;
    justify-content: center;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes scaleUp {
  from { opacity: 0; transform: scale(0.96); }
  to { opacity: 1; transform: scale(1); }
}

/* ==============================================================================
   DRIP Freedom Waterfall & Country Living Standard Styles
   ============================================================================== */
.drip-waterfall-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-card);
}

.drip-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 22px;
}

.drip-header-left {
  flex: 1;
  min-width: 280px;
}

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

.drip-title-row h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-main);
}

.drip-location-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.drip-loc-label {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.drip-pills-group {
  display: flex;
  gap: 4px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  padding: 3px;
  border-radius: 9999px;
  flex-wrap: wrap;
}

.drip-pill-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  border-radius: 9999px;
  cursor: pointer;
  transition: all 0.15s ease;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.drip-pill-btn:hover {
  color: var(--text-main);
  background: rgba(255, 255, 255, 0.06);
}

.drip-pill-btn.active {
  background: var(--accent-gold);
  color: #0c0f17;
  font-weight: 700;
  box-shadow: 0 1px 6px rgba(212, 168, 67, 0.35);
}

.drip-tiers-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.drip-tier-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.drip-tier-item:hover {
  background: rgba(255, 255, 255, 0.035);
  border-color: rgba(255, 255, 255, 0.12);
  transform: translateY(-1px);
}

.drip-tier-item.unlocked {
  border-color: rgba(34, 197, 94, 0.28);
  background: linear-gradient(90deg, rgba(34, 197, 94, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%);
}

.drip-tier-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.drip-tier-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 240px;
}

.drip-tier-icon {
  font-size: 1.35rem;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  flex-shrink: 0;
}

.drip-tier-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.drip-tier-title {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.drip-tier-desc {
  font-size: 0.74rem;
  color: var(--text-muted);
}

.drip-tier-target {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--text-dim);
}

.drip-tier-status {
  display: flex;
  align-items: center;
  gap: 8px;
}

.badge-unlocked {
  background: rgba(34, 197, 94, 0.15);
  color: var(--accent-green);
  border: 1px solid rgba(34, 197, 94, 0.35);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.74rem;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.badge-gap {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 9999px;
  font-size: 0.74rem;
  font-family: var(--font-mono);
}

.drip-bar-track {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.drip-bar-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.drip-bar-fill.fill-green {
  background: linear-gradient(90deg, #10b981 0%, #22c55e 100%);
  box-shadow: 0 0 10px rgba(34, 197, 94, 0.45);
}

.drip-bar-fill.fill-gold {
  background: linear-gradient(90deg, #d97706 0%, #f59e0b 100%);
}

.drip-milestone-footer {
  margin-top: 18px;
  padding: 12px 16px;
  border-radius: var(--radius-md);
  background: rgba(212, 168, 67, 0.06);
  border: 1px solid rgba(212, 168, 67, 0.2);
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.45;
}

.drip-milestone-text strong {
  color: var(--accent-gold);
}

@media (max-width: 640px) {
  .drip-card-header {
    flex-direction: column;
    align-items: stretch;
  }
  .drip-location-bar {
    justify-content: space-between;
  }
  .drip-pills-group {
    width: 100%;
    justify-content: flex-start;
  }
  .drip-tier-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .drip-tier-status {
    width: 100%;
    justify-content: space-between;
  }
}

/* Subtle Calculator Cross-Reference Links */
.subtle-calc-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--accent-gold-light, #f5d77f);
  text-decoration: none;
  padding: 3px 8px;
  border-radius: 6px;
  background: rgba(212, 168, 67, 0.08);
  border: 1px solid rgba(212, 168, 67, 0.25);
  transition: all 0.15s ease;
  line-height: 1;
}

.subtle-calc-link:hover {
  background: rgba(212, 168, 67, 0.18);
  border-color: rgba(212, 168, 67, 0.5);
  color: #ffffff;
  transform: translateY(-1px);
}

.feed-calc-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.15s ease;
}

.feed-calc-chip:hover {
  background: rgba(212, 168, 67, 0.1);
  border-color: rgba(212, 168, 67, 0.35);
  color: var(--accent-gold-light);
  transform: translateY(-1px);
}

.feed-calc-links-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}

/* ==========================================================================
   SVRGNW Local AI Intelligence Engine (Copilot Drawer & Smart Parser)
   ========================================================================== */
.local-ai-backdrop {
  position: fixed;
  inset: 0;
  z-index: 998;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s;
}

.local-ai-backdrop.open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.local-ai-drawer {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: rgba(14, 18, 26, 0.98);
  backdrop-filter: blur(32px);
  -webkit-backdrop-filter: blur(32px);
  border-top: 1px solid rgba(212, 168, 67, 0.35);
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -16px 54px rgba(0, 0, 0, 0.9);
  padding: 12px 24px 32px;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(105%);
  visibility: hidden;
  pointer-events: none;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
  box-sizing: border-box;
}

.local-ai-drawer.open {
  transform: translateY(0);
  visibility: visible;
  pointer-events: auto;
}

.local-ai-inner {
  max-width: 860px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.local-ai-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.local-ai-badge-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.local-ai-chips-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0;
  -webkit-overflow-scrolling: touch;
}

.ai-chip-btn {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  padding: 6px 14px;
  color: #cbd5e1;
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.ai-chip-btn:hover {
  background: rgba(212, 168, 67, 0.12);
  border-color: rgba(212, 168, 67, 0.4);
  color: var(--accent-gold-light);
  transform: translateY(-1px);
}

.ai-chip-btn.active {
  background: rgba(212, 168, 67, 0.2);
  border-color: var(--accent-gold);
  color: #fff;
}

.local-ai-chat-body {
  min-height: 240px;
  max-height: 48vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 8px 4px;
}

.ai-msg {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  animation: fadeIn 0.2s ease;
}

.ai-msg-user {
  flex-direction: row-reverse;
}

.ai-msg-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(212, 168, 67, 0.15);
  border: 1px solid rgba(212, 168, 67, 0.4);
  color: var(--accent-gold);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.ai-msg-user .ai-msg-avatar {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

.ai-msg-content {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 14px 18px;
  max-width: 90%;
  font-size: 0.84rem;
  line-height: 1.6;
  color: #e2e8f0;
}

.ai-msg-user .ai-msg-content {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.25);
  color: #f8fafc;
}

.ai-audit-card {
  background: rgba(18, 23, 34, 0.9);
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: 12px;
  padding: 16px;
  margin-top: 8px;
}

.ai-audit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.ai-audit-score {
  font-size: 1.6rem;
  font-weight: 800;
  font-family: var(--font-mono);
  color: var(--accent-gold);
}

.finding-item {
  padding: 10px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: rgba(255, 255, 255, 0.02);
  border-left: 3px solid #64748b;
}

.finding-item.level-warning {
  border-left-color: #f59e0b;
  background: rgba(245, 158, 11, 0.05);
}

.finding-item.level-caution {
  border-left-color: #38bdf8;
  background: rgba(56, 189, 248, 0.05);
}

.finding-item.level-good {
  border-left-color: #22c55e;
  background: rgba(34, 197, 94, 0.05);
}

.finding-title {
  font-weight: 700;
  color: #fff;
  font-size: 0.82rem;
  margin-bottom: 4px;
}

.finding-desc {
  font-size: 0.77rem;
  color: #cbd5e1;
  margin-bottom: 4px;
}

.finding-rec {
  font-size: 0.74rem;
  color: var(--accent-gold-light);
  font-style: italic;
}

.local-ai-input-wrap {
  display: flex;
  gap: 8px;
  align-items: center;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 12px;
}

.local-ai-input-wrap input {
  flex: 1;
}

@media (max-width: 768px) {
  .local-ai-drawer {
    padding: 12px 16px 28px;
    max-height: 94vh;
  }
}

/* Floating Action Bubble (FAB) replaced by integrated header icon */
.local-ai-fab {
  display: none !important;
}

/* ==========================================================================
   Modern Sequenced Upload & Multi-Broker Import Flow
   ========================================================================== */
.upload-stepper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(15, 19, 28, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 12px 20px;
  margin-bottom: 20px;
  gap: 12px;
}

.upload-step {
  display: flex;
  align-items: center;
  gap: 10px;
  opacity: 0.5;
  transition: opacity 0.2s ease;
}

.upload-step.active {
  opacity: 1;
}

.upload-step.completed {
  opacity: 0.85;
}

.step-number {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 700;
  color: #94a3b8;
  font-family: var(--font-mono);
}

.upload-step.active .step-number {
  background: var(--accent-gold);
  border-color: var(--accent-gold);
  color: #0c0f17;
  box-shadow: 0 0 14px rgba(212, 168, 67, 0.35);
}

.upload-step.completed .step-number {
  background: rgba(48, 209, 88, 0.18);
  border-color: rgba(48, 209, 88, 0.5);
  color: var(--accent-green);
}

.step-meta {
  display: flex;
  flex-direction: column;
}

.step-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.step-desc {
  font-size: 0.7rem;
  color: var(--text-dim);
}

.step-divider {
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.08);
  min-width: 20px;
}

@media (max-width: 680px) {
  .upload-stepper {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px 14px;
  }
  .step-divider {
    display: none;
  }
}

/* Portfolio Destination Card Selection */
.portfolio-dest-section {
  background: rgba(18, 23, 34, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-lg);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.dest-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.dest-section-title {
  font-size: 0.88rem;
  font-weight: 700;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}

.dest-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.dest-card {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  background: rgba(12, 16, 24, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  text-align: left;
}

.dest-card:hover {
  background: rgba(25, 32, 48, 0.8);
  border-color: rgba(212, 168, 67, 0.4);
}

.dest-card.selected {
  background: rgba(212, 168, 67, 0.08);
  border-color: var(--accent-gold);
  box-shadow: 0 0 16px rgba(212, 168, 67, 0.15);
}

.dest-card input[type="radio"] {
  position: absolute;
  top: 12px;
  right: 12px;
  margin: 0;
  accent-color: var(--accent-gold);
}

.dest-card-title {
  font-size: 0.84rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
  padding-right: 20px;
}

.dest-card-desc {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.35;
}

.dest-custom-name-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 12px 14px;
  background: rgba(12, 16, 24, 0.8);
  border: 1px solid rgba(212, 168, 67, 0.3);
  border-radius: var(--radius-md);
  margin-top: 4px;
}

.dest-custom-name-box label {
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--accent-gold);
}

.dest-custom-name-box input {
  background: rgba(18, 23, 34, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 6px;
  padding: 8px 12px;
  color: #fff;
  font-size: 0.84rem;
  font-family: inherit;
  outline: none;
}

.dest-custom-name-box input:focus {
  border-color: var(--accent-gold);
}

/* Clean Import Preview Stats Summary */
.import-summary-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 4px;
}

.import-summary-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 0.74rem;
  font-family: var(--font-mono);
  color: #cbd5e1;
}

.import-summary-chip.highlight {
  border-color: rgba(212, 168, 67, 0.35);
  color: var(--accent-gold);
  background: rgba(212, 168, 67, 0.08);
}




