/* ============================================================================
   TACTICAL MARKET RADAR — Theme V9
   Design tokens: typography + text/number colors
   Light = Day / Tactical Paper (rich slate surfaces + near-black ink)
   Dark  = Obsidian Pro (deep black glass + neon / fluorescent accents)
   Native selects = light surface + black text (both themes, high contrast)
   Aurora gradient body + cards + rounded UI
   ============================================================================ */

/* ═══ SHARED TYPOGRAPHY SCALE ═══ */
:root {
  /* Font families */
  --font-sans: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Montserrat", "Exo 2", var(--font-sans);
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Code", "Consolas", "Liberation Mono", "Courier New", monospace;

  /* Type scale (px) — single source of truth for dashboard text */
  --fs-2xs: 8px;     /* micro labels, dense table headers */
  --fs-xs: 9px;      /* dense table body, fib labels, tiny captions */
  --fs-sm: 10px;     /* axis/micro badges, section micro labels */
  --fs-caption: 11px;/* secondary labels, OHLC legend, toolbar */
  --fs-body-sm: 12px;/* nav items, buttons, list body */
  --fs-body: 13px;   /* default body / form controls */
  --fs-label: 14px;  /* important labels, brand name */
  --fs-title-sm: 16px;/* section titles */
  --fs-title: 18px;  /* page titles */
  --fs-hero: 20px;   /* hero metrics / key prices */
  --fs-display: 26px;/* header clock / large KPI */

  /* Chart tick sizes (Chart.js / canvas) */
  --fs-chart-tick: 10px;
  --fs-chart-tick-sm: 9px;
  --fs-chart-title: 10px;
}

/* ═══ DARK THEME (OBSIDIAN PRO) ═══
   Premium night terminal:
   - Deep pure / near-black surfaces (low eye strain for long sessions)
   - Neon / fluorescent accents for interactive + pos/neg data
   - High-contrast light text hierarchy
   - Native selects use light surface + black text (see --select-*)
*/
:root, [data-theme="dark"] {
  --brand-primary: #00F0FF;
  --brand-dark: #00C4D4;

  /* Body — deep black (not washed charcoal) */
  --bg-body: #050506;
  --bg-body2: #000000;

  /* Cards = dense glass over pure black */
  --bg-card: rgba(12, 12, 14, 0.92);
  --bg-card-alt: rgba(18, 18, 22, 0.96);

  /* Inputs — subtle lift on black */
  --bg-input: rgba(255, 255, 255, 0.055);

  /* Borders — soft white + cyan edge on chrome */
  --border-color: rgba(255, 255, 255, 0.10);
  --border-color2: rgba(0, 240, 255, 0.22);

  /* Text hierarchy — bright primary, readable secondary */
  --text-main: #F5F7FA;
  --text-muted: rgba(245, 247, 250, 0.80);
  --text-dim: rgba(245, 247, 250, 0.58);
  --text-disabled: rgba(245, 247, 250, 0.34);
  --text-inverse: #050506;

  /* Semantic numbers (neon / fluorescent) */
  --green: #00FF66;
  --green-bg: rgba(0, 255, 102, 0.14);
  --red: #FF2D6A;
  --red-bg: rgba(255, 45, 106, 0.14);
  --num-pos: #00FF66;
  --num-neg: #FF2D6A;
  --num-neu: rgba(245, 247, 250, 0.58);

  /* Accents — neon cyan / gold / purple */
  --icon-color: #00F0FF;
  --blue: #00F0FF;
  --blue-bg: rgba(0, 240, 255, 0.12);
  --amber: #FFD60A;
  --amber-bg: rgba(255, 214, 10, 0.14);
  --purple: #BF5AF2;
  --purple-bg: rgba(191, 90, 242, 0.12);

  /* Text roles (aliases for consumers) */
  --text-primary: var(--text-main);
  --text-secondary: var(--text-muted);
  --text-axis: rgba(245, 247, 250, 0.64);
  --text-price: #F5F7FA;
  --text-badge: #FFFFFF;
  --text-legend: rgba(245, 247, 250, 0.78);
  --text-tooltip: #F0F3FA;
  --text-link: var(--blue);
  --text-countdown: #FFB020;

  /* Cards/Shadow — soft cyan bloom */
  --shadow-card: 0 10px 36px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(0, 240, 255, 0.04), inset 0 1px 0 rgba(255, 255, 255, 0.06);

  /* Chart — pure black canvas, neon candles, readable ticks */
  --candle-green: #00FF66;
  --candle-red: #FF2D6A;
  --chart-bg: #050506;
  --chart-grid: rgba(255, 255, 255, 0.055);
  --chart-text: rgba(245, 247, 250, 0.64);
  --chart-crosshair: rgba(0, 240, 255, 0.42);
  --chart-tooltip-bg: rgba(8, 10, 14, 0.96);
  --chart-tooltip-border: rgba(0, 240, 255, 0.22);

  /* Theme-aware controls (non-select) */
  --control-bg: rgba(255, 255, 255, 0.06);
  --control-text: #F5F7FA;
  --control-border: rgba(255, 255, 255, 0.14);

  /* Native <select> — always light surface + black text (both themes) */
  --select-bg: #FFFFFF;
  --select-text: #000000;
  --select-border: rgba(15, 23, 42, 0.22);
  --select-option-bg: #FFFFFF;
  --select-option-text: #000000;
  --select-hover-border: rgba(0, 240, 255, 0.55);
  --select-focus-ring: rgba(0, 240, 255, 0.28);

  /* Header / sidebar */
  --header-bg: rgba(5, 5, 6, 0.92);
  --header-border: rgba(0, 240, 255, 0.28);
  --sidebar-bg: rgba(8, 8, 10, 0.97);
  --sidebar-border: rgba(0, 240, 255, 0.14);

  /* Button primary — neon cyan on near-black ink */
  --btn-bg: #00F0FF;
  --btn-text: #050506;

  /* Nav (sidebar) */
  --nav-section-color: rgba(245, 247, 250, 0.48);
  --nav-chevron-color: rgba(245, 247, 250, 0.40);
  --nav-item-color: rgba(245, 247, 250, 0.82);
  --nav-item-hover-bg: rgba(0, 240, 255, 0.08);
  --nav-item-bright: #FFFFFF;
  --nav-active-bg: rgba(0, 240, 255, 0.14);
  --nav-active-accent: #00F0FF;
  --nav-logout-color: rgba(255, 82, 130, 0.85);
  --nav-logout-hover-bg: rgba(255, 45, 106, 0.14);
  --nav-logout-hover-color: #FF6B9D;
  --nav-collapsible-hover: rgba(255, 255, 255, 0.04);

  /* Badge surfaces */
  --badge-pos-bg: rgba(0, 255, 102, 0.14);
  --badge-pos-text: #66FF99;
  --badge-pos-border: rgba(0, 255, 102, 0.32);
  --badge-neg-bg: rgba(255, 45, 106, 0.14);
  --badge-neg-text: #FF8FB3;
  --badge-neg-border: rgba(255, 45, 106, 0.30);
}

/* ═══ LIGHT THEME (DAY / TACTICAL PAPER) ═══
   Premium TradingView-style day mode:
   - Rich cool slate surfaces (not pure white / washed gray)
   - Near-black text for long-session readability
   - Vibrant accents for numbers, candles, focus states
*/
[data-theme="light"] {
  --brand-primary: #2563EB;
  --brand-dark: #1D4ED8;

  /* Page — cooler slate, slightly darker than pure white for eye comfort */
  --bg-body: #E4E9F2;
  --bg-body2: #D5DCE8;

  /* Cards / panels — soft elevated paper */
  --bg-card: #F4F7FC;
  --bg-card-alt: #FFFFFF;

  /* Inputs — subtle inset on paper */
  --bg-input: #E8EDF6;

  /* Borders — clear but soft */
  --border-color: rgba(15, 23, 42, 0.12);
  --border-color2: rgba(15, 23, 42, 0.20);

  /* Text hierarchy — strong black / near-black */
  --text-main: #0B1220;
  --text-muted: #1E293B;
  --text-dim: #475569;
  --text-disabled: #94A3B8;
  --text-inverse: #F8FAFC;

  /* Semantic numbers — saturated for light backgrounds */
  --green: #059669;
  --green-bg: rgba(5, 150, 105, 0.12);
  --red: #DC2626;
  --red-bg: rgba(220, 38, 38, 0.10);
  --num-pos: #059669;
  --num-neg: #DC2626;
  --num-neu: #64748B;

  /* Accents */
  --icon-color: #2563EB;
  --blue: #2563EB;
  --blue-bg: rgba(37, 99, 235, 0.12);
  --amber: #D97706;
  --amber-bg: rgba(217, 119, 6, 0.12);
  --purple: #7C3AED;
  --purple-bg: rgba(124, 58, 237, 0.10);

  /* Text roles */
  --text-primary: var(--text-main);
  --text-secondary: var(--text-muted);
  --text-axis: #475569;
  --text-price: #0F172A;
  --text-badge: #0B1220;
  --text-legend: #1E293B;
  --text-tooltip: #F8FAFC;
  --text-link: var(--blue);
  --text-countdown: #B45309;

  --shadow-card: 0 8px 28px rgba(15, 23, 42, 0.08), 0 1px 3px rgba(15, 23, 42, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.85);

  /* Chart — light canvas, dark ink, vivid candles */
  --candle-green: #16A34A;
  --candle-red: #E11D48;
  --chart-bg: #FFFFFF;
  --chart-grid: rgba(15, 23, 42, 0.07);
  --chart-text: #475569;
  --chart-crosshair: rgba(15, 23, 42, 0.35);
  --chart-tooltip-bg: rgba(15, 23, 42, 0.94);
  --chart-tooltip-border: rgba(255, 255, 255, 0.12);

  --control-bg: #FFFFFF;
  --control-text: #0B1220;
  --control-border: rgba(15, 23, 42, 0.14);

  /* Native <select> — light surface + black text (same contract as dark) */
  --select-bg: #FFFFFF;
  --select-text: #000000;
  --select-border: rgba(15, 23, 42, 0.20);
  --select-option-bg: #FFFFFF;
  --select-option-text: #000000;
  --select-hover-border: rgba(37, 99, 235, 0.45);
  --select-focus-ring: rgba(37, 99, 235, 0.18);

  --header-bg: rgba(255, 255, 255, 0.92);
  --header-border: rgba(37, 99, 235, 0.18);

  --btn-bg: #2563EB;
  --btn-text: #FFFFFF;

  /* Nav — pure / near-black menu labels */
  --nav-section-color: #475569;
  --nav-chevron-color: #64748B;
  --nav-item-color: #000000;
  --nav-item-hover-bg: rgba(37, 99, 235, 0.08);
  --nav-item-bright: #000000;
  --nav-active-bg: rgba(37, 99, 235, 0.12);
  --nav-active-accent: #2563EB;
  --nav-logout-color: #B91C1C;
  --nav-logout-hover-bg: rgba(185, 28, 28, 0.08);
  --nav-logout-hover-color: #991B1B;
  --nav-collapsible-hover: rgba(15, 23, 42, 0.04);

  --sidebar-bg: #F8FAFC;
  --sidebar-border: rgba(15, 23, 42, 0.10);

  --badge-pos-bg: rgba(5, 150, 105, 0.12);
  --badge-pos-text: #047857;
  --badge-pos-border: rgba(5, 150, 105, 0.28);
  --badge-neg-bg: rgba(220, 38, 38, 0.10);
  --badge-neg-text: #B91C1C;
  --badge-neg-border: rgba(220, 38, 38, 0.26);
}

/* ═══ RESET ═══ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }

body {
  background:
    radial-gradient(1200px 700px at 20% 20%, var(--purple-bg, rgba(181,0,255,0.08)), transparent 55%),
    radial-gradient(1000px 600px at 80% 25%, var(--blue-bg, rgba(0,240,255,0.08)), transparent 55%),
    radial-gradient(1100px 700px at 50% 90%, var(--green-bg, rgba(0,255,102,0.08)), transparent 60%),
    linear-gradient(180deg, var(--bg-body), var(--bg-body2));
  background-attachment: fixed;
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.5;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Numeric data defaults — tabular + mono for scannable prices */
.tmr-num,
.tmr-price,
.pos, .neg, .vpos, .vneg, .vneu,
.lt, .d-val, .ec-val, .tmr-stat-value {
  font-variant-numeric: tabular-nums;
}
.tmr-mono,
.ohlc-info,
.tmr-price {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.tmr-pos, .pos, .vpos { color: var(--num-pos, var(--green)); }
.tmr-neg, .neg, .vneg { color: var(--num-neg, var(--red)); }
.tmr-neu, .vneu { color: var(--num-neu, var(--text-dim)); }

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ═══ SCROLLBAR ═══ */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 3px; }
[data-theme="light"] ::-webkit-scrollbar-thumb { background: rgba(15, 23, 42, 0.22); }
[data-theme="light"] ::-webkit-scrollbar-thumb:hover { background: rgba(15, 23, 42, 0.34); }

/* ═══ AURORA GLOW BLOBS — same as login page ═══ */
body::before, body::after {
  content: "";
  position: fixed;
  pointer-events: none;
  z-index: 0;
  border-radius: 999px;
  filter: blur(40px);
  opacity: 0.6;
}
body::before {
  width: 55vw; height: 55vw;
  top: -15vh; left: -10vw;
  background:
    radial-gradient(circle at 30% 30%, var(--purple-bg, rgba(181,0,255,0.12)), transparent 55%),
    radial-gradient(circle at 70% 70%, var(--blue-bg, rgba(0,240,255,0.10)), transparent 55%),
    radial-gradient(circle at 50% 50%, var(--green-bg, rgba(0,255,102,0.08)), transparent 60%);
  animation: tmrFloat 14s ease-in-out infinite;
}
body::after {
  width: 45vw; height: 45vw;
  bottom: -10vh; right: -5vw;
  opacity: 0.4;
  background:
    radial-gradient(circle at 40% 40%, var(--blue-bg, rgba(0,240,255,0.12)), transparent 55%),
    radial-gradient(circle at 60% 60%, var(--purple-bg, rgba(181,0,255,0.10)), transparent 55%);
  animation: tmrFloat 18s ease-in-out infinite reverse;
}
@keyframes tmrFloat {
  0%   { transform: translate3d(0,0,0) scale(1); }
  50%  { transform: translate3d(5vw,-3vh,0) scale(1.04); }
  100% { transform: translate3d(0,0,0) scale(1); }
}
[data-theme="light"] body::before { opacity: 0.22; filter: blur(48px); }
[data-theme="light"] body::after  { opacity: 0.16; filter: blur(48px); }

/* ═══ HEADER — liquid glass topbar ═══ */
.tmr-header {
  position: fixed;
  top: 0; left: 0; width: 100%;
  height: 48px;
  background: var(--header-bg);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--header-border);
  box-shadow: inset 0 -1px 1px rgba(255,255,255,0.05);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  z-index: 1000;
}
[data-theme="light"] .tmr-header {
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04), 0 4px 16px rgba(15, 23, 42, 0.04);
  color: #0B1220;
}

.tmr-header-left { display: flex; align-items: center; gap: 12px; }

.tmr-hamburger {
  background: transparent; border: none; color: var(--text-main);
  font-size: 18px; cursor: pointer; width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px; transition: background 0.15s;
}
.tmr-hamburger:hover { background: rgba(255,255,255,0.06); }
[data-theme="light"] .tmr-hamburger { color: #0B1220; }
[data-theme="light"] .tmr-hamburger:hover { background: rgba(15, 23, 42, 0.06); }

.tmr-brand { display: flex; align-items: center; gap: 10px; }
.tmr-brand > div { display: flex; flex-direction: column; justify-content: center; line-height: 1.05; }

.tmr-brand-icon {
  position: relative; display: inline-block; line-height: 1;
  color: var(--icon-color); font-size: 1.55rem;
}
.tmr-brand-icon .trend,
.tmr-nav-brand-icon .trend {
  position: absolute; left: 50%; top: 44%;
  transform: translate(-50%,-50%); font-size: 0.62em;
}
.tmr-nav-brand-icon { position: relative; display: inline-block; color: var(--icon-color); font-size: 1.35rem; line-height: 1; }

.tmr-brand-name { font-size: 14px; font-weight: 700; letter-spacing: 0.3px; line-height: 1; display: block; width: 100%; color: var(--text-main); }
.tmr-brand-sub { font-size: 11px; font-weight: 500; color: var(--text-dim); margin-top: 2px; letter-spacing: 0.5px; display: block; width: 100%; white-space: nowrap; }
[data-theme="light"] .tmr-brand-name { color: #000000; font-weight: 800; }
[data-theme="light"] .tmr-brand-sub { color: #475569; }

.tmr-header-right { display: flex; align-items: center; height: 100%; gap: 10px; }

.tmr-market-timer {
  display: flex; align-items: center; gap: 6px;
  background: rgba(255,255,255,0.04); padding: 4px 10px;
  border-radius: 999px; border: 1px solid var(--border-color); line-height: 1;
}
[data-theme="light"] .tmr-market-timer {
  background: rgba(15, 23, 42, 0.04);
  border-color: rgba(15, 23, 42, 0.12);
}
.tmr-market-timer .mkt-label { font-size: 8px; font-weight: 600; color: var(--text-dim); }
.tmr-market-timer .mkt-countdown { font-size: var(--fs-body); font-weight: 700; color: var(--text-countdown, #FFB020); font-variant-numeric: tabular-nums; }

.tmr-header-clock {
  display: flex; align-items: center; gap: 8px;
  border-left: 1px solid var(--border-color); padding-left: 12px;
}
.tmr-header-clock .time { font-weight: 300; font-size: 26px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--text-main); }
.tmr-header-clock .date-stack { display: flex; flex-direction: column; justify-content: center; line-height: 1.1; }
.tmr-header-clock .date-line { font-size: 10px; color: var(--text-dim); font-weight: 400; }
.tmr-header-clock .day-line { font-size: 13px; font-weight: 600; text-transform: uppercase; color: var(--text-main); }
[data-theme="light"] .tmr-header-clock .time { color: #0B1220; font-weight: 400; }
[data-theme="light"] .tmr-header-clock .day-line { color: #0B1220; }

.tmr-user-info { font-size: 12px; color: var(--text-muted); display: flex; align-items: center; gap: 5px; }
[data-theme="light"] .tmr-user-info { color: #1E293B; }

.tmr-icon-btn {
  width: 32px; height: 32px; border-radius: 10px;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.04);
  color: var(--text-main); display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px; transition: all 0.12s; text-decoration: none;
}
.tmr-icon-btn:hover {
  background: var(--blue-bg, rgba(0,240,255,0.12));
  border-color: var(--border-color2);
  color: var(--icon-color, var(--blue));
  transform: translateY(-1px);
  text-decoration: none;
}
[data-theme="light"] .tmr-icon-btn {
  background: #FFFFFF;
  border-color: rgba(15, 23, 42, 0.12);
  color: #0B1220;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
[data-theme="light"] .tmr-icon-btn:hover {
  background: #EFF4FF;
  border-color: rgba(37, 99, 235, 0.28);
  color: #1D4ED8;
}

/* ═══ SIDEBAR — liquid glass panel ═══ */
.tmr-sidebar-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5);
  z-index: 1100; opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.tmr-sidebar-overlay.open { opacity: 1; pointer-events: all; }

.tmr-sidebar {
  position: fixed; top: 0; left: -280px; width: 260px; height: 100vh;
  background: var(--sidebar-bg, var(--bg-card-alt));
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border-right: 1px solid var(--sidebar-border, var(--border-color));
  box-shadow: 8px 0 40px rgba(0,0,0,0.65), inset -1px 0 0 rgba(0, 240, 255, 0.08);
  z-index: 1200; display: flex; flex-direction: column;
  transition: left 0.3s cubic-bezier(0.4,0,0.2,1);
}
.tmr-sidebar.open { left: 0; }
[data-theme="light"] .tmr-sidebar {
  background: var(--sidebar-bg, #F8FAFC);
  border-right-color: var(--sidebar-border, rgba(0, 0, 0, 0.10));
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08), inset -1px 0 0 rgba(0, 0, 0, 0.04);
}

.tmr-sidebar-head {
  padding: 14px 16px; display: flex; align-items: center; justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  background: rgba(255,255,255,0.03);
}
[data-theme="light"] .tmr-sidebar-head {
  background: #FFFFFF;
  border-bottom-color: rgba(0, 0, 0, 0.08);
}
.tmr-sidebar-head h3 { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-main); display: flex; align-items: center; gap: 10px; }
[data-theme="light"] .tmr-sidebar-head h3 { color: #000000; }

.tmr-sidebar-close {
  background: rgba(255,255,255,0.06); border: none; color: var(--text-main);
  font-size: 13px; cursor: pointer; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center; border-radius: 8px;
}
.tmr-sidebar-close:hover { background: rgba(255,255,255,0.12); }
[data-theme="light"] .tmr-sidebar-close { color: #000000; background: rgba(0, 0, 0, 0.04); }
[data-theme="light"] .tmr-sidebar-close:hover { background: rgba(0, 0, 0, 0.08); }

.tmr-sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; }
.tmr-nav-section { padding: 0 10px; margin-bottom: 2px; }
.tmr-nav-section-label { font-size: 9px; font-weight: 700; color: var(--text-dim); text-transform: uppercase; letter-spacing: 1px; padding: 8px 12px 4px; }

.tmr-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: 10px;
  color: var(--nav-item-color, var(--text-muted)); font-size: 12px; font-weight: 600;
  cursor: pointer; transition: all 0.12s; text-decoration: none;
}
.tmr-nav-item:hover {
  background: var(--nav-item-hover-bg, rgba(255,255,255,0.05));
  color: var(--nav-item-bright, var(--text-main));
  text-decoration: none;
}
[data-theme="light"] .tmr-nav-item {
  color: #000000;
  font-weight: 700;
}
[data-theme="light"] .tmr-nav-item:hover {
  background: var(--nav-item-hover-bg);
  color: #000000;
}
.tmr-nav-item.active {
  background: var(--nav-active-bg, var(--blue-bg));
  color: var(--nav-active-accent, var(--blue));
  box-shadow: inset 3px 0 0 var(--nav-active-accent, var(--blue));
}
[data-theme="light"] .tmr-nav-item.active {
  color: #000000;
  background: var(--nav-active-bg);
  box-shadow: inset 3px 0 0 var(--nav-active-accent);
}
.tmr-nav-item i { width: 18px; text-align: center; font-size: 14px; }
.tmr-nav-item.logout-item { color: var(--red); margin-top: 6px; border-top: 1px solid var(--border-color); border-radius: 0; padding-top: 12px; }
.tmr-nav-item.logout-item:hover { background: var(--red-bg); }

/* Remove link styling inside nav/content */
.tmr-sidebar a, .tmr-main a { color: inherit; text-decoration: none; }
.tmr-sidebar a:hover, .tmr-main a:hover { text-decoration: none; }

/* ═══ MAIN CONTENT ═══ */
.tmr-main {
  margin-top: 48px;
  padding: 16px;
  min-height: calc(100vh - 48px);
  position: relative;
  z-index: 1;
}
.tmr-container { max-width: 1320px; margin: 0 auto; width: 100%; }

/* ═══ LIQUID GLASS CARDS ═══ */
.tmr-card {
  background: 
    linear-gradient(180deg, var(--bg-card), var(--bg-card-alt)) padding-box,
    linear-gradient(135deg, var(--border-color2), transparent) border-box;
  backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border: 1px solid transparent;
  border-radius: 16px;
  box-shadow: var(--shadow-card), inset 0 1px 1px rgba(255,255,255,0.15);
  overflow: hidden;
}
[data-theme="light"] .tmr-card {
  background: var(--bg-card-alt);
  border: 1px solid var(--border-color);
  box-shadow: var(--shadow-card);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}
.tmr-card-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
}
[data-theme="light"] .tmr-card-head {
  background: linear-gradient(180deg, #FFFFFF 0%, #F8FAFC 100%);
}
.tmr-card-head h3 { font-size: 13px; font-weight: 700; color: var(--text-main); text-transform: uppercase; letter-spacing: 0.3px; }
[data-theme="light"] .tmr-card-head h3 { color: #000000; font-weight: 800; }
.tmr-card-head p { font-size: 11px; color: var(--text-dim); }
.tmr-card-body { padding: 18px; }

/* ═══ INPUTS — like login inputs ═══ */
.tmr-input {
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-family: inherit; font-size: 13px; font-weight: 500;
  padding: 0 12px; border-radius: 12px; height: 44px;
  width: 100%; outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
.tmr-input::placeholder { color: var(--text-dim); }
.tmr-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(96,165,250,0.18); }
[data-theme="light"] .tmr-input:focus { box-shadow: 0 0 0 3px rgba(37,99,235,0.15); }

/* ═══ NATIVE SELECT / DROPDOWNS — light surface + BLACK text (both themes) ═══
   OS/browser option popups often use light panels; white text was unreadable.
   Contract: --select-bg light, --select-text / option text always #000000.
*/
select,
select.tmr-input,
.tmr-main select,
.tmr-card select,
.oc-sub select,
.ic-bar select,
.pa-sub select,
.fc-bar select,
.ep-controls select,
.tv-symbol-select,
.tv-exch-select,
.tv-rp-select,
.tv-interval-more,
.days-sel,
.tp-row select,
.filters select,
.toolbar select,
.ctrl-bar select,
.sync-controls-head select,
.action-buttons select {
  background-color: var(--select-bg, #FFFFFF) !important;
  color: var(--select-text, #000000) !important;
  border: 1px solid var(--select-border, rgba(15, 23, 42, 0.22));
  -webkit-text-fill-color: var(--select-text, #000000);
  color-scheme: light;
  font-weight: 700;
  cursor: pointer;
  outline: none;
  transition: border-color 0.12s, box-shadow 0.12s;
}
select:hover,
.tmr-main select:hover,
.oc-sub select:hover,
.ic-bar select:hover,
.tv-symbol-select:hover,
.tv-exch-select:hover,
.tv-rp-select:hover,
.tv-interval-more:hover,
.days-sel:hover,
.tp-row select:hover {
  border-color: var(--select-hover-border, rgba(0, 240, 255, 0.55));
}
select:focus,
.tmr-main select:focus,
.oc-sub select:focus,
.ic-bar select:focus,
.tv-symbol-select:focus,
.tv-exch-select:focus,
.tv-rp-select:focus,
.tv-interval-more:focus,
.days-sel:focus,
.tp-row select:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px var(--select-focus-ring, rgba(0, 240, 255, 0.28));
}
select:disabled,
.tmr-main select:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
/* Closed select text + every option in the popup list */
select option,
select optgroup,
.tmr-main select option,
.tmr-main select optgroup,
.oc-sub select option,
.oc-sub select optgroup,
.ic-bar select option,
.ic-bar select optgroup,
.tv-symbol-select option,
.tv-exch-select option,
.tv-rp-select option,
.tv-interval-more option,
.days-sel option,
.tp-row select option {
  background-color: var(--select-option-bg, #FFFFFF) !important;
  color: var(--select-option-text, #000000) !important;
  -webkit-text-fill-color: var(--select-option-text, #000000);
  font-weight: 600;
}
/* Transparent chrome selects (e.g. TV symbol) keep light fill for readability */
.tv-symbol-select {
  background-color: var(--select-bg, #FFFFFF) !important;
  color: var(--select-text, #000000) !important;
}

/* ═══ BUTTONS — like login buttons ═══ */
.tmr-btn {
  font-family: inherit; font-size: 13px; font-weight: 700;
  padding: 0 16px; border-radius: 12px; height: 44px;
  border: 1px solid var(--border-color);
  background: rgba(255,255,255,0.04);
  color: var(--text-main);
  cursor: pointer; transition: all 0.12s;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.tmr-btn:hover { transform: translateY(-1px); background: rgba(255,255,255,0.07); border-color: var(--border-color2); }

.tmr-btn-primary {
  background: var(--btn-bg); color: var(--btn-text);
  border: none; font-weight: 800; letter-spacing: 0.2px;
}
.tmr-btn-primary:hover { transform: translateY(-1px); opacity: 0.92; }

.tmr-btn-ghost {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
}
.tmr-btn-ghost:hover { color: var(--text-main); border-color: var(--border-color2); }
[data-theme="light"] .tmr-btn {
  background: #FFFFFF;
  border-color: rgba(15, 23, 42, 0.14);
  color: #0B1220;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
[data-theme="light"] .tmr-btn:hover {
  background: #EFF4FF;
  border-color: rgba(37, 99, 235, 0.28);
  color: #1D4ED8;
}
[data-theme="light"] .tmr-btn-primary {
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.28);
}
[data-theme="light"] .tmr-btn-primary:hover {
  background: #1D4ED8;
  opacity: 1;
  color: #FFFFFF;
}
[data-theme="light"] .tmr-btn-ghost {
  background: transparent;
  color: #1E293B;
}
[data-theme="light"] .tmr-btn-ghost:hover {
  background: rgba(15, 23, 42, 0.04);
  color: #0B1220;
}

.tmr-btn-danger { background: var(--red); color: #fff; border: none; }

/* ═══ BRAND BADGE — same as login page icon ═══ */
.tmr-brand-badge {
  width: 32px; height: 32px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, var(--purple-bg, rgba(181,0,255,0.35)), rgba(0,0,0,0.12));
  border: 1px solid var(--border-color2);
  flex-shrink: 0;
}
.tmr-brand-badge i { font-size: 16px; color: var(--icon-color); opacity: 0.9; }

.tmr-brand-badge-sm {
  width: 26px; height: 26px;
  border-radius: 8px;
  display: inline-grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, var(--purple-bg, rgba(181,0,255,0.30)), rgba(0,0,0,0.10));
  border: 1px solid var(--border-color2);
}
.tmr-brand-badge-sm i { font-size: 13px; color: var(--icon-color); opacity: 0.9; }

/* ═══ MEDIA / MEDIA HELPERS ═══ */
img, video, canvas, svg { max-width: 100%; height: auto; }
canvas { max-height: 100%; }
.tmr-scroll-x,
.table-wrap,
.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  max-width: 100%;
}
.tmr-main table { max-width: none; }
.tmr-main select,
.tmr-main input,
.tmr-main textarea,
.tmr-main button {
  max-width: 100%;
}

/* Full-height analysis pages use dynamic viewport on mobile */
.tmr-main.oc-pg,
.tmr-main.pa-pg,
.tmr-main.fc-pg,
.tmr-main.ic-pg,
.tmr-main.ep-pg {
  max-width: 100vw;
}

/* Body lock while mobile nav open (overlay drawer only) */
@media (max-width: 992px) {
  body.tmr-nav-open {
    overflow: hidden;
    touch-action: none;
  }
}

/* Touch-friendly hit targets */
.tmr-hamburger,
.tmr-sidebar-close,
.tmr-icon-btn {
  min-width: 40px;
  min-height: 40px;
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-top)) {
  .tmr-header {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
    height: calc(48px + env(safe-area-inset-top));
    padding-top: env(safe-area-inset-top);
  }
  .tmr-main {
    margin-top: calc(48px + env(safe-area-inset-top));
    min-height: calc(100vh - 48px - env(safe-area-inset-top));
    padding-bottom: max(16px, env(safe-area-inset-bottom));
  }
  .tmr-sidebar {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* ═══ RESPONSIVE — tablet ═══ */
@media (max-width: 992px) {
  .tmr-header { padding: 0 12px; gap: 8px; }
  .tmr-header-right { gap: 8px; }
  .tmr-header-clock .time { font-size: 20px; }
  .tmr-brand-sub { display: none; }
  .tmr-user-info span,
  .tmr-user-info { max-width: 90px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tmr-main { padding: 12px; }
  .tmr-card-body { padding: 14px; }
  .tmr-card-head { padding: 12px 14px; flex-wrap: wrap; gap: 8px; }
}

/* ═══ RESPONSIVE — phone ═══ */
@media (max-width: 768px) {
  /* Reduce heavy aurora cost on small screens */
  body::before, body::after { opacity: 0.35; filter: blur(28px); }
  [data-theme="light"] body::before { opacity: 0.22; }
  [data-theme="light"] body::after  { opacity: 0.16; }

  .tmr-header {
    padding: 0 10px;
    height: 52px;
  }
  .tmr-main {
    margin-top: 52px;
    min-height: calc(100vh - 52px);
    min-height: calc(100dvh - 52px);
    padding: 10px;
  }
  .tmr-header-left { gap: 8px; min-width: 0; flex: 1; }
  .tmr-brand { min-width: 0; }
  .tmr-brand-name {
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: min(46vw, 180px);
  }
  .tmr-brand-sub { display: none; }
  .tmr-header-clock { display: none; }
  .tmr-user-info { display: none; }
  .tmr-market-timer {
    padding: 4px 8px;
    gap: 4px;
  }
  .tmr-market-timer .mkt-label { font-size: 7px; }
  .tmr-market-timer .mkt-countdown { font-size: 11px; }
  .tmr-header-right { gap: 6px; flex-shrink: 0; }

  .tmr-sidebar {
    width: min(86vw, 300px);
    left: calc(-1 * min(86vw, 300px) - 8px);
    box-shadow: 8px 0 40px rgba(0,0,0,0.45);
  }
  .tmr-sidebar.open { left: 0; }
  .tmr-sidebar-nav { padding-bottom: 24px; }

  .tmr-card { border-radius: 14px; }
  .tmr-card-head h3 { font-size: 12px; }
  .tmr-card-body { padding: 12px; }
  .tmr-btn, .tmr-input { height: 42px; font-size: 13px; }
  .tmr-btn { width: auto; min-width: 0; padding: 0 12px; }
  .tmr-btn-block { width: 100%; }

  /* Generic toolbars / control rows used across pages */
  .oc-sub, .pa-sub, .fc-bar, .ic-bar, .ep-controls,
  .sync-controls-head, .action-buttons,
  .dp-bar, .filters, .toolbar, .ctrl-bar {
    flex-wrap: wrap !important;
    row-gap: 6px;
  }
  .oc-st, .pa-stat { margin-left: 0 !important; width: 100%; }
  .oc-sep, .pa-sep { display: none; }

  /* Full-page modules */
  .tmr-main.oc-pg,
  .tmr-main.pa-pg,
  .tmr-main.fc-pg,
  .tmr-main.ic-pg {
    height: calc(100vh - 52px) !important;
    height: calc(100dvh - 52px) !important;
  }

  /* Option chain / chart grids → single column */
  .oc-g, .pa-grid { grid-template-columns: 1fr !important; }
  /* RES/SUP (.oc-r) stays visible on Live OC; hide only generic right panels */
  .pa-right { display: none !important; }

  /* Wide OC tables scroll horizontally */
  .oc-tw, .oc-ts {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }
  .oc-cg {
    grid-template-columns: 1fr !important;
    grid-template-rows: none !important;
    min-height: 420px;
  }
  .oc-c { min-height: 180px; }

  /* Sync / import action buttons full width */
  .action-buttons button {
    flex: 1 1 100% !important;
    justify-content: center;
  }

  /* Participant / cards */
  .ep-cols, .ep-grid { grid-template-columns: 1fr !important; }

  /* Prevent page-level horizontal bleed */
  .tmr-main > * { max-width: 100%; }
  .tmr-container { padding: 0; }
}

/* ═══ RESPONSIVE — small phone ═══ */
@media (max-width: 480px) {
  .tmr-header { padding: 0 8px; }
  .tmr-brand-badge { width: 28px; height: 28px; border-radius: 8px; }
  .tmr-brand-badge i { font-size: 14px; }
  .tmr-brand-name { font-size: 11px; max-width: min(40vw, 140px); }
  .tmr-market-timer .mkt-label { display: none; }
  .tmr-main { padding: 8px; }
  .tmr-icon-btn { width: 36px; height: 36px; min-width: 36px; min-height: 36px; border-radius: 9px; }

  .oc-sub, .pa-sub, .fc-bar, .ic-bar {
    padding: 6px 8px !important;
    gap: 6px !important;
  }
  .oc-sub select, .pa-sub select, .fc-bar select, .ic-bar select {
    font-size: 11px !important;
    max-width: 100%;
  }
  .sp, .sp-box, .oi-bx { min-width: 48px !important; padding: 2px 6px !important; }
  .sp .sv, .sp-box .sv { font-size: 11px !important; }

  .oc-cg { min-height: 360px; gap: 4px; }
  .oc-c { min-height: 150px; }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
  body::before, body::after { animation: none !important; }
  .tmr-sidebar { transition: none; }
  .tmr-sidebar-overlay { transition: none; }
}
