/*
 * dividendguard.css — Unified stylesheet for DividendGuard
 * © 2026 Gavriel Partush. All rights reserved.
 */

@import url('https://fonts.googleapis.com/css2?family=DM+Serif+Display&family=Inter:wght@300;400;500;600&family=Space+Grotesk:wght@500;600;700&family=DM+Mono:wght@400;500&display=swap');

/* ══ GLOBAL TOKENS ══════════════════════════════════════════════ */
:root {
  --bg:          #080c18;
  --panel:       #0d1120;
  --border:      #1a2035;
  --navy:        #2a5298;
  --navy-dim:    #1a3560;
  --navy-bright: #4a7fc1;
  --navy-glow:   #5b8fd1;
  --green:       #2ecc71;
  --red:         #e74c3c;
  --amber:       #f5a623;
  --text:        #c8dff0;
  --muted:       #5b8fd1;
  --muted2:      #7a9ab5;
  --accent:      #4a7fc1;
  --blue:        #4a7fc1;
  --card:        #0d1120;
  --border2:     #2a3050;
  --cyan:        #5b8fd1;
  --purple:      #2a5298;
  --glow-blue:   rgba(74,127,193,0.15);
  --gradient:    linear-gradient(135deg, #4a7fc1, #2a5298);
  --gradient-subtle: linear-gradient(135deg, rgba(74,127,193,0.1), rgba(42,82,152,0.1));
  --sw:          200px;
  --gold:        #4a7fc1;
  --gold-dim:    #1a3560;
  --header-h:    60px;
  --tabbar-h:    52px;
  --ad-rail-w:   180px;
}

/* ══ LIGHT MODE TOKENS ══════════════════════════════════════════ */
body.light-mode {
  --bg:          #f8f9fa;
  --panel:       #ffffff;
  --border:      #dee2e6;
  --navy:        #0d21a1;
  --navy-dim:    #c7d2fe;
  --navy-bright: #0d21a1;
  --navy-glow:   #4338ca;
  --green:       #166534;
  --red:         #991b1b;
  --amber:       #b45309;
  --text:        #0d21a1;
  --muted:       #6c757d;
  --muted2:      #495057;
  --accent:      #0d21a1;
  --blue:        #0d21a1;
  --card:        #ffffff;
  --border2:     #ced4da;
  --cyan:        #8b5cf6;
  --purple:      #8b5cf6;
  --glow-blue:   rgba(13,33,161,0.08);
  --gradient:    linear-gradient(135deg, #0d21a1, #8b5cf6);
  --gradient-subtle: linear-gradient(135deg, rgba(13,33,161,0.07), rgba(139,92,246,0.07));
  --gold:        #0d21a1;
  --gold-dim:    #c7d2fe;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ══ SHELL: FIXED HEADER ════════════════════════════════════════ */
.dg-header {
  height: var(--header-h);
  display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 0 20px;
  border-bottom: 1px solid var(--border);
  background: var(--panel);
  backdrop-filter: blur(8px);
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
}
.dg-logo {
  display: flex; align-items: center; gap: 10px;
  font-size: 18px; font-weight: 700; letter-spacing: -0.2px; text-decoration: none;
}
.dg-logo-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: var(--navy); display: grid; place-items: center;
  font-size: 16px; box-shadow: 0 4px 14px rgba(42,82,152,0.35); flex-shrink: 0;
}
.dg-logo-name .d { color: var(--navy-bright); }
.dg-logo-name .g { color: var(--text); }
.dg-tagline {
  font-size: 12px; color: var(--muted);
  border-left: 1px solid var(--border);
  padding-left: 14px; letter-spacing: 0.2px;
}
.dg-tagline .warn { color: var(--navy-bright); font-weight: 600; }
@media (max-width: 720px) { .dg-tagline { display: none; } }

/* ══ SHELL: TAB BAR ═════════════════════════════════════════════ */
.dg-tabs {
  height: var(--tabbar-h);
  display: flex; align-items: stretch; justify-content: center; gap: 4px;
  padding: 0 12px; border-bottom: 1px solid var(--border);
  background: rgba(13,17,32,0.5);
  position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 999;
}
.dg-tab {
  display: flex; align-items: center; gap: 8px;
  padding: 0 18px; border: none; background: transparent;
  color: var(--muted); font-size: 14px; font-weight: 500;
  cursor: pointer; position: relative;
  transition: color 0.15s ease; font-family: inherit; white-space: nowrap;
}
.dg-tab:hover  { color: var(--text); }
.dg-tab.active { color: var(--text); }
.dg-tab.active::after {
  content: ""; position: absolute;
  left: 12px; right: 12px; bottom: 0;
  height: 2px; border-radius: 2px 2px 0 0; background: var(--accent);
}
.dg-tab-icon { font-size: 15px; }
.dg-tab.weapon        { color: var(--navy-bright); }
.dg-tab.weapon:hover  { color: var(--navy-bright); filter: brightness(1.15); }
.dg-tab.weapon.active { color: var(--navy-bright); }
.dg-tab.weapon.active::after { background: var(--navy-bright); }
.dg-tab-badge {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 2px 6px; border-radius: 10px;
  background: rgba(74,127,193,0.18); color: var(--navy-bright); line-height: 1;
}
@media (max-width: 720px) {
  .dg-tab { padding: 0 12px; font-size: 13px; }
  .dg-tab-label { display: none; }
  .dg-tab-icon { font-size: 18px; }
  .dg-tab-badge { display: none; }
}

/* ══ SHELL: TOOL PANELS ═════════════════════════════════════════ */
.dg-tool {
  display: none;
  position: fixed;
  top: calc(var(--header-h) + var(--tabbar-h));
  left: 0; right: 0; bottom: 0;
  overflow: auto;
  background: var(--bg);
  background-image:
    radial-gradient(ellipse at 20% 0%,   rgba(42,82,152,0.12) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 100%, rgba(74,127,193,0.07) 0%, transparent 60%);
}
.dg-tool.active { display: block; }
/* ══ TRACKER TOOL LAYOUT ════════════════════════════════════════ */
.dg-tool#tool-tracker { display: none; }
.dg-tool#tool-tracker.active { 
  display: block;
  width: 100%;
  height: calc(100vh - var(--header-h) - var(--tabbar-h));
  overflow: hidden;
}
.dg-tool#tool-tracker > .t-tracker {
  display: flex;
  width: 100%;
  height: 100%;
}
.dg-tool#tool-rebalancer { position: relative; }

/* ══ AD RAILS (left sidebar — one per public tool, independent) ═════ */
.dg-ad-rail {
  position: fixed; top: calc(var(--header-h) + var(--tabbar-h));
  left: 0; bottom: 0; width: var(--ad-rail-w);
  z-index: 998;
  display: none;                /* shown only when its tool is active */
  flex-direction: column; align-items: center;
  padding: 16px 12px;
  background: var(--panel);
  border-right: 1px solid var(--border);
}
/* Each rail shows only on its own tab, and only if not individually closed */
body.ad-on-screener   #dg-ad-rail-screener:not(.rail-closed)   { display: flex; }
body.ad-on-calculator #dg-ad-rail-calculator:not(.rail-closed) { display: flex; }

/* Push content clear of the rail — body class is toggled by JS */
body.screener-rail-open #tool-screener .main {
  padding-left: calc(var(--ad-rail-w) + 24px);
}
body.screener-rail-open #tool-screener .search-bar {
  padding-left: calc(var(--ad-rail-w) + 32px);
}
body.calculator-rail-open #tool-calculator .t-calculator {
  padding-left: calc(var(--ad-rail-w) + 24px);
}

.dg-ad-rail-label {
  font-size: 9px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--muted); margin-bottom: 8px; align-self: center;
}
.dg-ad-rail-slot {
  width: 100%; max-width: 160px; min-height: 600px;
  flex: 1;
  display: flex; align-items: center; justify-content: center;
  border: 1px dashed var(--border2); border-radius: 8px;
  background: var(--gradient-subtle);
  color: var(--muted); font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
}
.dg-ad-rail-close {
  align-self: flex-end;
  width: 20px; height: 20px; line-height: 18px; text-align: center;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--bg); color: var(--muted);
  font-size: 13px; cursor: pointer; padding: 0; margin-bottom: 6px;
  transition: color 0.15s ease, border-color 0.15s ease;
}
.dg-ad-rail-close:hover { color: var(--text); border-color: var(--border2); }
/* Hide on narrow screens — no room for a rail */
@media (max-width: 1240px) {
  .dg-ad-rail { display: none !important; }
  #tool-screener .main,
  #tool-calculator .t-calculator,
  #tool-screener .search-bar { padding-left: 20px !important; }
}


/* Tracker needs flex layout */




/* ══ SHARED FOOTER ══════════════════════════════════════════════ */
footer.dg-footer {
  text-align: center; padding: 24px 20px;
  font-family: 'Inter', sans-serif; font-size: 11px;
  color: var(--muted); letter-spacing: 2px; text-transform: uppercase;
  border-top: 1px solid var(--border);
}

/* ══════════════════════════════════════════════════
   TRACKER
══════════════════════════════════════════════════ */
.t-tracker *, .t-tracker *::before, .t-tracker *::after { box-sizing: border-box; margin: 0; padding: 0; }
.t-tracker .mono { font-family: 'DM Mono', monospace; }
.t-tracker @keyframes spin { to { transform: rotate(360deg); } }
@keyframes fadeSlideUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes gradientShift {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}
@keyframes toastIn {
  from { transform: translateX(120%) scale(0.9); opacity: 0; }
  to   { transform: translateX(0) scale(1); opacity: 1; }
}
@keyframes shrinkBar {
  from { width: 100%; }
  to   { width: 0%; }
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(0.93) translateY(8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes rowFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
.t-tracker .sidebar {
  width: var(--sw);
  background: rgba(8,12,24,0.85);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-right: 1px solid var(--border); display: flex;
  flex-direction: column; flex-shrink: 0;
  position: sticky; top: 0; align-self: flex-start;
  height: calc(100vh - var(--header-h) - var(--tabbar-h));
  overflow-y: auto; z-index: 10;
}
.t-tracker .sidebar::before {
  content: '';
  display: block;
  height: 2px;
  background: linear-gradient(90deg, #2a5298, #4a7fc1, #2ecc71, #2a5298);
  background-size: 300% 100%;
  animation: gradientShift 4s ease infinite;
  flex-shrink: 0;
}
.t-tracker .sb-logo { padding: 20px 16px 16px; border-bottom: 1px solid var(--border); }
.t-tracker .sb-title {
  font-size: 15px; font-weight: 700; letter-spacing: -0.3px;
  background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.t-tracker .sb-sub { font-size: 10px; color: var(--muted); margin-top: 2px; letter-spacing: 0.5px; text-transform: uppercase; }
.t-tracker .nav-list { list-style: none; padding: 8px 0; flex: 1; }
.t-tracker .nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px; cursor: pointer; font-size: 13px; font-weight: 500;
  color: var(--muted2); border-left: 3px solid transparent;
  transition: all .2s ease; user-select: none;
}
.t-tracker .nav-item:hover { background: rgba(74,127,193,0.06); color: var(--text); transform: translateX(2px); }
.t-tracker .nav-item.active {
  color: var(--blue); border-left-color: var(--blue);
  background: rgba(74,127,193,0.10);
  box-shadow: inset 0 0 20px rgba(42,82,152,0.08);
}
.t-tracker .nav-item.predictor-item { color: var(--muted2); }
.t-tracker .nav-item.predictor-item.active { color: var(--blue); border-left-color: var(--blue); background: rgba(74,127,193,0.10); }
.t-tracker .nav-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.t-tracker .main { flex: 1; display: flex; flex-direction: column; height: calc(100vh - var(--header-h) - var(--tabbar-h)); overflow: hidden; min-width: 0; }
.t-tracker .topbar {
  background: rgba(8,12,24,0.7); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px; display: flex; justify-content: space-between; align-items: center;
  flex-shrink: 0; position: sticky; top: 0; z-index: 100;
}
.t-tracker .topbar-title { font-size: 15px; font-weight: 600; }
.t-tracker .topbar-meta { font-size: 12px; color: var(--muted); }
.t-tracker .content { flex: 1; overflow-y: auto; padding: 20px 24px; }
.t-tracker .tab-panel { display: none; }
.t-tracker .tab-panel.active { display: block; animation: fadeSlideUp 0.3s ease forwards; }
.t-tracker .card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 16px;
  box-shadow: 0 4px 24px rgba(0,0,0,0.3);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.t-tracker .card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.4), 0 0 0 1px rgba(74,127,193,0.15);
}
.t-tracker .card-title { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.6px; margin-bottom: 8px; }
.t-tracker .grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.t-tracker .grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.t-tracker .grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.t-tracker .grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 16px; }
.t-tracker .grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; margin-bottom: 16px; }
.t-tracker .metric-val { font-size: 22px; font-weight: 700; font-family: 'DM Mono', monospace; line-height: 1.2; }
.t-tracker .metric-sub { font-size: 11px; color: var(--muted); margin-top: 4px; }
.t-tracker .badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; font-family: 'DM Mono', monospace; }
.t-tracker .badge-green { background: rgba(46,204,113,.15); color: var(--green); }
.t-tracker .badge-red { background: rgba(231,76,60,.15); color: var(--red); }
.t-tracker .badge-amber { background: rgba(245,166,35,.15); color: var(--amber); }
.t-tracker .badge-blue { background: rgba(74,127,193,.15); color: var(--blue); }
.t-tracker .badge-muted { background: rgba(91,143,209,.12); color: var(--muted2); }
.t-tracker .progress-wrap { height: 8px; background: rgba(26,32,53,0.8); border-radius: 99px; overflow: hidden; }
.t-tracker .progress-fill {
  height: 100%; border-radius: 99px;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  box-shadow: 0 0 8px rgba(74,127,193,0.4);
  transition: width 1.2s cubic-bezier(0.4, 0, 0.2, 1);
}
.t-tracker .tbl-wrap { overflow-x: auto; }
.t-tracker table { width: 100%; border-collapse: collapse; font-size: 13px; }
.t-tracker th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; padding: 8px 10px; border-bottom: 1px solid var(--border); cursor: pointer; white-space: nowrap; user-select: none; }
.t-tracker th:hover { color: var(--text); }
.t-tracker td { padding: 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.t-tracker tr:last-child td { border-bottom: none; }
.t-tracker tr { transition: background 0.15s ease; }
.t-tracker tr:hover td { background: rgba(74,127,193,0.04); }
.t-tracker .ticker-cell { display: flex; align-items: center; gap: 10px; }
.t-tracker .ticker-avatar {
  width: 32px; height: 32px; border-radius: 8px; display: flex; align-items: center;
  justify-content: center; font-size: 10px; font-weight: 700; flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.t-tracker .ticker-name { font-size: 11px; color: var(--muted); }
.t-tracker tbody tr { animation: rowFadeIn 0.3s ease forwards; opacity: 0; }
.t-tracker .spinner-overlay { position: absolute; inset: 0; background: rgba(6,10,18,.6); display: flex; align-items: center; justify-content: center; border-radius: 14px; z-index: 10; }
.t-tracker .spinner { width: 28px; height: 28px; border: 3px solid rgba(255,255,255,.1); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; }
.t-tracker .relative { position: relative; }
.t-tracker .chart-wrap { position: relative; }
.t-tracker .search-input {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 10px 14px; color: var(--text); font-size: 14px;
  font-family: 'Inter', sans-serif; outline: none; transition: border-color .2s, box-shadow .2s;
}
.t-tracker .search-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(74,127,193,0.12); }
.t-tracker .search-input::placeholder { color: var(--muted); }
.t-tracker .sector-tag { font-size: 10px; font-weight: 500; padding: 2px 7px; border-radius: 4px; display: inline-block; }
.t-tracker .alert-card { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 10px; margin-bottom: 10px; border: 1px solid; transition: transform 0.15s ease; }
.t-tracker .alert-card:hover { transform: translateX(4px); }
.t-tracker .alert-icon { font-size: 18px; flex-shrink: 0; margin-top: 1px; }
.t-tracker .alert-title { font-size: 14px; font-weight: 600; margin-bottom: 3px; }
.t-tracker .alert-desc { font-size: 12px; color: var(--muted2); line-height: 1.5; }
.t-tracker .alert-red { background: rgba(231,76,60,.07); border-color: rgba(231,76,60,.25); }
.t-tracker .alert-amber { background: rgba(245,166,35,.07); border-color: rgba(245,166,35,.25); }
.t-tracker .alert-blue { background: rgba(74,127,193,.07); border-color: rgba(74,127,193,.25); }
.t-tracker .alert-green { background: rgba(46,204,113,.07); border-color: rgba(46,204,113,.25); }
.t-tracker .popular-tickers { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.t-tracker .pop-ticker {
  background: rgba(26,32,53,0.5); border: 1px solid var(--border);
  border-radius: 6px; padding: 5px 12px; font-size: 12px; font-weight: 600;
  cursor: pointer; color: var(--muted2); transition: all .2s ease;
}
.t-tracker .pop-ticker:hover { border-color: var(--blue); color: var(--blue); background: rgba(74,127,193,0.08); transform: translateY(-1px); }
.t-tracker .confidence-bar { height: 6px; border-radius: 99px; }
.t-tracker .legend-item { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-bottom: 6px; }
.t-tracker .legend-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.t-tracker .slider-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.t-tracker .slider-row label { font-size: 12px; color: var(--muted2); flex: 1; }
.t-tracker .slider-row input[type=range] { flex: 2; accent-color: var(--blue); }
.t-tracker .slider-val { font-family: 'DM Mono', monospace; font-size: 12px; color: var(--text); min-width: 60px; text-align: right; }
.t-tracker .cal-month {
  background: var(--panel);
  border: 1px solid var(--border); border-radius: 6px; padding: 12px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.t-tracker .cal-month:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,0.3); }
.t-tracker .cal-month-name { font-size: 12px; font-weight: 600; color: var(--muted2); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.5px; }
.t-tracker .cal-holding { font-size: 11px; padding: 3px 6px; border-radius: 4px; margin-bottom: 3px; display: flex; justify-content: space-between; }
.t-tracker .cal-empty { font-size: 11px; color: var(--muted); font-style: italic; }
.t-tracker .upcoming-item { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); transition: padding-left 0.15s ease; }
.t-tracker .upcoming-item:last-child { border-bottom: none; }
.t-tracker .upcoming-item:hover { padding-left: 6px; }
.t-tracker .section-gap { margin-bottom: 16px; }
.t-tracker .green { color: var(--green); }
.t-tracker .red { color: var(--red); }
.t-tracker .amber { color: var(--amber); }
.t-tracker .blue { color: var(--blue); }
.t-tracker .muted { color: var(--muted); }
.t-tracker .text-right { text-align: right; }
.t-tracker .mt-4 { margin-top: 4px; }
.t-tracker .mt-8 { margin-top: 8px; }
.t-tracker .mt-12 { margin-top: 12px; }
.t-tracker .mt-16 { margin-top: 16px; }
.t-tracker .mb-8 { margin-bottom: 8px; }
.t-tracker .mb-12 { margin-bottom: 12px; }
.t-tracker .font-bold { font-weight: 700; }
.t-tracker .row { display: flex; align-items: center; gap: 8px; }
.t-tracker .modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 500;
  background: rgba(0,0,0,0.5);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  align-items: center; justify-content: center;
}
.t-tracker .modal-overlay.open { display: flex; }
.t-tracker .modal-overlay.open .modal { animation: modalIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.t-tracker .modal {
  background: var(--panel);
  backdrop-filter: blur(24px); -webkit-backdrop-filter: blur(24px);
  border: 1px solid var(--border);
  border-radius: 10px; padding: 24px; width: 380px; max-width: 95vw;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6), 0 0 0 1px rgba(74,127,193,0.1);
}
.t-tracker .modal-title {
  font-size: 16px; font-weight: 700; margin-bottom: 18px;
  background: var(--gradient); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.t-tracker .modal-field { margin-bottom: 14px; }
.t-tracker .modal-label { font-size: 12px; color: var(--muted); margin-bottom: 5px; display: block; }
.t-tracker .modal-input {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 6px; padding: 9px 12px; color: var(--text); font-size: 14px;
  font-family: 'Inter', sans-serif; outline: none; transition: border-color .2s, box-shadow .2s;
}
.t-tracker .modal-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(74,127,193,0.15); }
.t-tracker .modal-input:disabled { opacity: 0.5; cursor: not-allowed; }
.t-tracker .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }
.t-tracker .btn { padding: 8px 18px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: none; transition: all 0.2s ease; }
.t-tracker .btn-blue {
  background: var(--gradient); color: var(--text);
  box-shadow: 0 4px 15px rgba(42,82,152,0.3);
}
.t-tracker .btn-blue:hover { box-shadow: 0 6px 22px rgba(74,127,193,0.5); transform: scale(1.02); }
.t-tracker .btn-ghost { background: rgba(26,32,53,0.5); color: var(--muted2); border: 1px solid var(--border); }
.t-tracker .btn-ghost:hover { background: rgba(42,82,152,0.12); color: var(--text); }
.t-tracker .icon-btn { background: none; border: none; cursor: pointer; padding: 4px 6px; border-radius: 5px; font-size: 14px; transition: background .15s; }
.t-tracker .icon-btn:hover { background: rgba(74,127,193,0.08); }
.t-tracker .toast {
  position: fixed; bottom: 24px; right: 24px; z-index: 600;
  color: #fff; padding: 12px 18px 20px; border-radius: 10px;
  font-size: 13px; font-weight: 500; opacity: 0;
  transition: opacity .25s; pointer-events: none; max-width: 340px;
  backdrop-filter: blur(12px); overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.4);
}
.t-tracker .toast.show { opacity: 1; pointer-events: auto; animation: toastIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards; }
.t-tracker .toast.toast-success { background: rgba(34,197,94,0.15);  border: 1px solid rgba(34,197,94,0.3); }
.t-tracker .toast.toast-error { background: rgba(239,68,68,0.15);  border: 1px solid rgba(239,68,68,0.3); }
.t-tracker .toast.toast-warning { background: rgba(245,158,11,0.15); border: 1px solid rgba(245,158,11,0.3); }
.t-tracker .toast-progress { position: absolute; bottom: 0; left: 0; height: 3px; width: 100%; border-radius: 0 0 10px 10px; }
.t-tracker .toast.toast-success .toast-progress { background: var(--green); animation: shrinkBar 4s linear forwards; }
.t-tracker .toast.toast-error   .toast-progress { background: var(--red);   animation: shrinkBar 4s linear forwards; }
.t-tracker .toast.toast-warning .toast-progress { background: var(--amber); animation: shrinkBar 4s linear forwards; }


/* ══════════════════════════════════════════════════
   TRAP CLASSIFIER  (rebuilt on calculator design standard)
══════════════════════════════════════════════════ */

/* ── CRITICAL: hidden must win over flex/grid ── */
.t-screener [hidden] { display: none !important; }

/* ── Search bar (sticky) ── */
.t-screener .search-bar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  background: var(--panel);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}
.t-screener .sb-brand {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
}
.t-screener .sb-icon { color: var(--amber); font-size: 14px; }
.t-screener .sb-label {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  white-space: nowrap;
}
.t-screener .sb-form {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  max-width: 420px;
}
.t-screener #ticker-input {
  flex: 1;
  height: 38px;
  padding: 0 12px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  font-family: 'Space Grotesk', 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 1px;
  outline: none;
  text-transform: uppercase;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}
.t-screener #ticker-input::placeholder {
  color: var(--muted);
  text-transform: none;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 0;
}
.t-screener #ticker-input:hover:not(:focus) {
  border-color: var(--navy-dim);
  box-shadow: 0 3px 10px rgba(42,82,152,0.15);
}
.t-screener #ticker-input:focus {
  border-color: var(--navy-dim);
  box-shadow: 0 0 0 3px rgba(42,82,152,0.18);
}
.t-screener #analyze-btn {
  height: 38px;
  padding: 0 18px;
  background: var(--navy);
  border: none;
  border-radius: 4px;
  color: #ffffff;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, transform 0.1s ease;
}
.t-screener #analyze-btn:hover { background: var(--navy-bright); }
.t-screener #analyze-btn:active { transform: scale(0.97); }
.t-screener #analyze-btn:disabled { opacity: 0.4; cursor: not-allowed; }

/* ── Main scroll area ── */
.t-screener .main {
  flex: 1;
  padding: 32px 20px 48px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* ── State panels (empty / loading / error) ── */
.t-screener .state-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 80px 20px;
  gap: 14px;
}
.t-screener .empty-icon {
  font-size: 40px;
  color: var(--amber);
  opacity: 0.65;
  margin-bottom: 4px;
}
.t-screener .empty-title {
  font-family: 'DM Serif Display', serif;
  font-size: clamp(32px, 5vw, 48px);
  color: var(--navy-bright);
  letter-spacing: 0.5px;
  font-weight: 400;
  line-height: 1;
}
.t-screener .empty-title .grad { color: var(--text); }
.t-screener .empty-desc {
  font-size: 14px;
  color: var(--muted);
  max-width: 420px;
  line-height: 1.7;
  font-weight: 300;
}
.t-screener .empty-examples {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 6px;
}
.t-screener .empty-examples > span {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 1px;
  text-transform: uppercase;
}
.t-screener .example-chip {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--muted2);
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 1px;
  padding: 5px 12px;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.t-screener .example-chip:hover { border-color: var(--amber); color: var(--amber); }

@keyframes screener-spin { to { transform: rotate(360deg); } }
.t-screener .spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--navy-bright);
  border-radius: 50%;
  animation: screener-spin 0.7s linear infinite;
}
.t-screener .loading-text { font-size: 15px; font-weight: 500; color: var(--text); }
.t-screener .loading-sub {
  font-size: 12px;
  color: var(--muted);
  max-width: 340px;
  line-height: 1.6;
  font-weight: 300;
}
.t-screener .error-icon { font-size: 34px; color: var(--red); }
.t-screener .error-title { font-size: 16px; font-weight: 600; color: var(--text); }
.t-screener .error-msg { font-size: 13px; color: var(--muted2); max-width: 360px; font-weight: 300; }
.t-screener .retry-btn {
  margin-top: 6px;
  padding: 9px 18px;
  background: rgba(231,76,60,0.1);
  border: 1px solid rgba(231,76,60,0.3);
  border-radius: 4px;
  color: var(--red);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s ease;
}
.t-screener .retry-btn:hover { background: rgba(231,76,60,0.16); }

/* ── Results header (DM Serif, like calculator h1 scale) ── */
.t-screener #results {
  animation: screener-fade 0.4s ease;
}
@keyframes screener-fade {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.t-screener .company-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.t-screener .ch-left { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.t-screener .ch-name {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  color: var(--navy-bright);
  letter-spacing: 0.3px;
  line-height: 1.1;
}
.t-screener .ch-sep { color: var(--navy-dim); }
.t-screener .ch-ticker {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 2px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 3px 9px;
}
.t-screener .ch-price {
  font-family: 'DM Serif Display', serif;
  font-size: 26px;
  color: var(--text);
  letter-spacing: 0.5px;
}

/* ── Panel system (mirrors calculator) ── */
.t-screener .panel {
  background: var(--panel);
  border: none;
  border-radius: 6px;
  padding: 24px;
  position: relative;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.t-screener .panel:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(42,82,152,0.2);
}
.t-screener .panel::before {
  content: '';
  position: absolute; inset: 0;
  border-radius: 6px;
  padding: 1px;
  background: linear-gradient(135deg, rgba(74,127,193,0.35) 0%, rgba(42,82,152,0.15) 50%, rgba(74,127,193,0.08) 100%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  transition: background 0.4s ease;
}
.t-screener .panel:hover::before {
  background: linear-gradient(135deg, rgba(91,143,209,0.6) 0%, rgba(74,127,193,0.3) 50%, rgba(42,82,152,0.2) 100%);
}
.t-screener .panel-title {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.t-screener .panel-label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 3px;
  color: var(--navy-bright);
  text-transform: uppercase;
  opacity: 0.8;
}
.t-screener .panel-heading {
  font-family: 'DM Serif Display', serif;
  font-size: 22px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: 0.3px;
  line-height: 1.1;
}

/* ── Verdict grid: 2 panels side by side ── */
.t-screener .verdict-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}
@media (max-width: 780px) {
  .t-screener .verdict-grid { grid-template-columns: 1fr; }
}

/* big score (DM Serif, like calculator stat-value) */
.t-screener .vc-value {
  font-family: 'DM Serif Display', serif;
  font-size: 32px;
  letter-spacing: 0.5px;
  line-height: 1;
  margin-bottom: 6px;
}
.t-screener .score-row { display: flex; align-items: baseline; gap: 4px; margin-bottom: 10px; }
.t-screener .score-num { font-family: 'DM Serif Display', serif; font-size: 24px; line-height: 1; }
.t-screener .score-den { font-size: 12px; color: var(--muted); }
.t-screener .score-track {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 16px;
}
.t-screener .score-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s ease;
}

/* component mini-stats — use the calculator .stat look */
.t-screener .vc-components {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}
.t-screener .vc-comp-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 9px 11px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.t-screener .vc-comp-item:hover {
  transform: translateY(-2px);
  border-color: var(--navy-dim);
}
.t-screener .vc-comp-name {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 500;
}
.t-screener .vc-comp-score {
  font-family: 'Space Grotesk', sans-serif;
  font-size: 13px;
  font-weight: 600;
}

.t-screener .trap-confidence {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.t-screener .trap-verdict-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  border-radius: 4px;
  margin-bottom: 14px;
}
.t-screener .trap-verdict-row:empty { display: none; }
.t-screener .vc-detail {
  font-size: 12px;
  color: #8a9bb5;
  line-height: 1.65;
  font-weight: 300;
}

/* ── Section headers ── */
.t-screener .section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
}
.t-screener .section-title {
  font-family: 'DM Serif Display', serif;
  font-size: 20px;
  font-weight: 400;
  color: var(--navy-bright);
  letter-spacing: 0.3px;
}
.t-screener .section-count,
.t-screener .quality-badge {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 3px;
  font-weight: 600;
}

/* ── Risk flags ── */
.t-screener .no-flags {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--panel);
  border: 1px solid rgba(46,204,113,0.25);
  border-radius: 6px;
  padding: 16px 18px;
  font-size: 13px;
  color: var(--green);
  font-weight: 400;
}
.t-screener .no-flags > span:first-child { font-size: 16px; }

.t-screener .flag-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-left: 3px solid var(--amber);
  border-radius: 5px;
  padding: 16px 18px;
  margin-bottom: 10px;
  animation: screener-fade 0.3s ease both;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.t-screener .flag-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(42,82,152,0.15);
}
.t-screener .flag-card.severity-high { border-left-color: var(--red); }
.t-screener .flag-card-header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.t-screener .flag-badge {
  width: 20px; height: 20px;
  border-radius: 4px;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}
.t-screener .flag-badge.amber { background: rgba(245,166,35,0.15); color: var(--amber); }
.t-screener .flag-badge.red   { background: rgba(231,76,60,0.15);  color: var(--red); }
.t-screener .flag-name { font-size: 13px; font-weight: 600; }
.t-screener .flag-desc { font-size: 12px; color: #8a9bb5; line-height: 1.6; font-weight: 300; }
.t-screener .flag-raw {
  margin-top: 8px;
  font-family: 'Space Grotesk', sans-serif;
  font-size: 11px;
  color: var(--muted);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 6px 9px;
  letter-spacing: 0.3px;
}

/* ── Quality score (panel + stat grid) ── */
.t-screener .quality-card { padding: 24px; }
.t-screener .quality-headline {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 18px;
}
.t-screener .quality-score { font-family: 'DM Serif Display', serif; font-size: 36px; line-height: 1; }
.t-screener .quality-score-den { font-size: 14px; color: var(--muted); }
.t-screener .quality-label {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 3px;
  font-weight: 600;
}
.t-screener .quality-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
@media (max-width: 600px) {
  .t-screener .quality-grid { grid-template-columns: repeat(2, 1fr); }
}
.t-screener .q-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 14px 16px;
  text-align: center;
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.t-screener .q-item:hover { transform: translateY(-3px); border-color: var(--navy-dim); }
.t-screener .q-item-label {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 8px;
  font-weight: 500;
}
.t-screener .q-item-score { font-family: 'DM Serif Display', serif; font-size: 28px; line-height: 1; }
.t-screener .q-item-bar {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 10px;
  overflow: hidden;
}
.t-screener .q-item-bar-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }


/* ══════════════════════════════════════════════════
   PORTFOLIO CALCULATOR
══════════════════════════════════════════════════ */
.t-calculator * { margin: 0; padding: 0; box-sizing: border-box; }
.t-calculator body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    padding: 32px 20px;
    background-image:
      radial-gradient(ellipse at 20% 0%, rgba(42,82,152,0.12) 0%, transparent 60%),
      radial-gradient(ellipse at 80% 100%, rgba(74,127,193,0.07) 0%, transparent 60%);
  }
.t-calculator header {
    text-align: center;
    margin-bottom: 40px;
  }
.t-calculator h1 {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(42px, 8vw, 72px);
    letter-spacing: 2px;
    color: var(--navy-bright);
    line-height: 1;
    font-weight: 700;
  }
.t-calculator .subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 4px;
    text-transform: uppercase;
    margin-top: 8px;
    font-weight: 300;
  }
.t-calculator .divider {
    width: 60px;
    height: 1px;
    background: var(--navy-dim);
    margin: 16px auto;
  }
.t-calculator .grid {
    display: grid;
    grid-template-columns: 340px 1fr;
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
  }
@media (max-width: 780px) {
.t-calculator .grid { grid-template-columns: 1fr; }

}
.t-calculator .panel {
    background: var(--panel);
    border: none;
    border-radius: 6px;
    padding: 24px;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
  }
.t-calculator .panel:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 32px rgba(42,82,152,0.2);
  }
.t-calculator .panel::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: 6px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(74,127,193,0.35) 0%, rgba(42,82,152,0.15) 50%, rgba(74,127,193,0.08) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: background 0.4s ease;
  }
.t-calculator .panel:hover::before {
    background: linear-gradient(135deg, rgba(91,143,209,0.6) 0%, rgba(74,127,193,0.3) 50%, rgba(42,82,152,0.2) 100%);
  }
.t-calculator .panel-title {
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
.t-calculator .panel-label {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    letter-spacing: 3px;
    color: var(--navy-bright);
    text-transform: uppercase;
    opacity: 0.7;
  }
.t-calculator .panel-heading {
    font-family: 'DM Serif Display', serif;
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    letter-spacing: 0.2px;
    line-height: 1.1;
  }
.t-calculator .field {
    margin-bottom: 16px;
  }
.t-calculator label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
    font-weight: 500;
  }
.t-calculator input[type="number"] {
    width: 100%;
    background: #080c18;
    border: 1px solid var(--border);
    border-radius: 4px;
    color: var(--text);
    font-family: 'Space Grotesk', sans-serif;
    font-size: 18px;
    font-weight: 600;
    padding: 10px 12px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, transform 0.18s ease;
  }
.t-calculator input[type="number"]:hover:not(:focus) {
    border-color: #252d45;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(42,82,152,0.15);
  }
.t-calculator input[type="number"]:focus {
    border-color: var(--navy-dim);
    box-shadow: 0 0 0 3px rgba(42,82,152,0.18);
    background: #0a0f1e;
  }
.t-calculator .unit {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    color: var(--muted);
    margin-top: 3px;
    letter-spacing: 1px;
  }
.t-calculator .fixed-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #111827;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    transition: transform 0.2s ease, background 0.2s ease;
    border-radius: 3px;
    cursor: default;
  }
.t-calculator .fixed-row:hover {
    transform: translateY(-2px);
    background: rgba(42,82,152,0.06);
    padding-left: 6px;
    padding-right: 6px;
  }
.t-calculator .fixed-row:last-child { border-bottom: none; }
.t-calculator .fixed-row .k { color: var(--muted); }
.t-calculator .fixed-row .v { color: var(--text); font-weight: 600; }
.t-calculator .result-block {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 20px;
  }
.t-calculator .stat {
    background: #080c18;
    border: none;
    border-radius: 5px;
    padding: 16px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: default;
  }
.t-calculator .stat:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(42,82,152,0.2);
  }
.t-calculator .stat::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: 5px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(42,82,152,0.25) 0%, rgba(74,127,193,0.08) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
  }
.t-calculator .stat.highlight::before {
    background: linear-gradient(135deg, rgba(74,127,193,0.5) 0%, rgba(42,82,152,0.2) 100%);
  }
.t-calculator .stat.highlight {
    background: rgba(42,82,152,0.06);
  }
.t-calculator .stat-label {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    color: var(--muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
    font-weight: 500;
  }
.t-calculator .stat-value {
    font-family: 'DM Serif Display', serif;
    font-size: 28px;
    color: var(--text);
    letter-spacing: 0.5px;
    line-height: 1;
  }
.t-calculator .stat-value.green { color: var(--green); }
.t-calculator .stat-value.red { color: var(--red); }
.t-calculator .stat-sub {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    color: var(--muted);
    margin-top: 4px;
  }
.t-calculator .table-wrap {
    overflow-x: auto;
    margin-top: 20px;
  }
.t-calculator table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 11px;
  }
.t-calculator th {
    background: #080c18;
    color: var(--muted);
    font-size: 9px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 8px 10px;
    text-align: right;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
  }
.t-calculator th:first-child { text-align: left; }
.t-calculator td {
    padding: 7px 10px;
    text-align: right;
    border-bottom: 1px solid #0e1322;
    color: #4a7fc1;
  }
.t-calculator td:first-child { text-align: left; color: var(--muted); }
.t-calculator tr:last-child td { color: var(--text); font-weight: 600; border-bottom: none; }
.t-calculator tbody tr {
    transition: background 0.15s ease;
    cursor: default;
  }
.t-calculator tbody tr:hover td { color: #a8c8e8 !important; }
.t-calculator tbody tr:hover { background: rgba(74,127,193,0.1); }
.t-calculator tbody tr.goal-reached:hover td { color: #5fd88f !important; }
.t-calculator tr.milestone td { color: var(--text); }
.t-calculator tr.milestone td:first-child { color: var(--navy-dim); }
.t-calculator .goal-reached td { color: var(--green) !important; }
.t-calculator .goal-reached td:first-child { color: var(--green) !important; }
.t-calculator .badge {
    display: inline-block;
    background: rgba(46,204,113,0.1);
    border: 1px solid rgba(46,204,113,0.3);
    color: var(--green);
    font-size: 8px;
    letter-spacing: 2px;
    padding: 2px 6px;
    border-radius: 2px;
    margin-left: 6px;
    vertical-align: middle;
    font-family: 'Inter', sans-serif;
  }
.t-calculator .note {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    color: #5b8fd1;
    line-height: 1.7;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--border);
  }
.t-calculator .note span { color: var(--navy-glow); }
.t-calculator .progress-wrap {
    margin: 16px 0;
  }
.t-calculator .progress-label {
    display: flex;
    justify-content: space-between;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    color: var(--muted);
    margin-bottom: 6px;
  }
.t-calculator .progress-bar {
    height: 4px;
    background: #111827;
    border-radius: 2px;
    overflow: hidden;
  }
.t-calculator .progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--navy-dim), var(--navy-bright));
    border-radius: 2px;
    transition: width 0.5s ease;
  }
.t-calculator .toggle-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
  }
.t-calculator .toggle-label {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    color: var(--text);
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
  }
.t-calculator .toggle-switch {
    position: relative;
    width: 40px;
    height: 20px;
    cursor: pointer;
  }
.t-calculator .toggle-switch input { display: none; }
.t-calculator .toggle-track {
    position: absolute;
    inset: 0;
    background: #111827;
    border: 1px solid var(--border);
    border-radius: 10px;
    transition: background 0.2s, border-color 0.2s;
  }
.t-calculator .toggle-switch input:checked ~ .toggle-track {
    background: rgba(42,82,152,0.2);
    border-color: var(--navy-dim);
  }
.t-calculator .toggle-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 12px;
    height: 12px;
    background: var(--muted);
    border-radius: 50%;
    transition: transform 0.2s, background 0.2s;
  }
.t-calculator .toggle-switch input:checked ~ .toggle-track .toggle-knob {
    transform: translateX(20px);
    background: var(--navy-bright);
  }
.t-calculator .inflation-sub {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transition: max-height 0.3s ease, opacity 0.3s ease;
  }
.t-calculator .inflation-sub.active {
    max-height: 80px;
    opacity: 1;
  }
.t-calculator .real-col { color: #7a9fbf !important; }
.t-calculator .real-col-header { color: #4a7090 !important; }
.t-calculator th.real { color: #4a7090 !important; }
.t-calculator td.real { color: #7a9fbf !important; }
.t-calculator .goal-reached td.real { color: #5fbf8f !important; }
.t-calculator .stat.inflation-stat {
    border-color: #2a4a60;
    background: rgba(42,82,152,0.05);
  }
.t-calculator .stat.inflation-stat .stat-value { color: #7ab8d8; }
.t-calculator .infl-badge {
    display: inline-block;
    background: rgba(42,82,152,0.2);
    border: 1px solid rgba(74,127,193,0.3);
    color: var(--navy-bright);
    font-family: 'Inter', sans-serif;
    font-size: 8px;
    letter-spacing: 2px;
    padding: 1px 5px;
    border-radius: 2px;
    margin-left: 5px;
    vertical-align: middle;
  }
.t-calculator .breakdown-panel {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }
.t-calculator .breakdown-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
  }
.t-calculator .breakdown-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
  }
.t-calculator .breakdown-label {
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 1.5px;
    text-transform: uppercase;
    font-weight: 500;
  }
.t-calculator .breakdown-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--text);
  }
.t-calculator .breakdown-pct {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    color: var(--muted);
    margin-left: 5px;
  }
.t-calculator .breakdown-bar-bg {
    height: 4px;
    background: #111827;
    border-radius: 3px;
    overflow: hidden;
  }
.t-calculator .breakdown-bar-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s ease;
  }
.t-calculator .bar-contrib { background: linear-gradient(90deg, #1a3560, #2a5298); }
.t-calculator .bar-drip { background: linear-gradient(90deg, #2a5298, #4a7fc1); }
.t-calculator .bar-growth { background: linear-gradient(90deg, #4a7fc1, #7ab0d8); }
.t-calculator .breakdown-total {
    padding-top: 10px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
  }
.t-calculator .breakdown-total-label {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    color: var(--muted);
    letter-spacing: 2px;
    text-transform: uppercase;
  }
.t-calculator .breakdown-total-value {
    font-family: 'DM Serif Display', serif;
    font-size: 18px;
    color: var(--navy-bright);
  }
.t-calculator #particles-canvas {
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    pointer-events: none;
    z-index: 0;
  }
.t-calculator body > * { position: relative; z-index: 1; }
.t-calculator .btn-row {
    display: flex;
    gap: 10px;
    margin-top: 14px;
    align-items: stretch;
  }
.t-calculator .export-btn, .t-calculator .share-btn, .t-calculator .print-btn {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 18px;
    background: transparent;
    border: 1px solid var(--navy-dim);
    border-radius: 999px;
    color: var(--navy-bright);
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.18s ease, box-shadow 0.18s ease;
  }
.t-calculator .export-btn:hover, .t-calculator .share-btn:hover, .t-calculator .print-btn:hover {
    background: rgba(74,127,193,0.25);
    border-color: #7ab0d8;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74,127,193,0.28);
  }
.t-calculator .export-btn svg, .t-calculator .share-btn svg, .t-calculator .print-btn svg {
    width: 12px; height: 12px;
    stroke: currentColor; fill: none;
    stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  }
.t-calculator .toast {
    position: fixed;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: #0d1120;
    border: 1px solid var(--navy-dim);
    color: var(--navy-bright);
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 10px 22px;
    border-radius: 4px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
    z-index: 9999;
  }
.t-calculator .toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
@media print {
.t-calculator #particles-canvas, .t-calculator .export-btn, .t-calculator .share-btn, .t-calculator .print-btn, .t-calculator footer { display: none !important; }
.t-calculator body { background: #fff !important; color: #000 !important; padding: 0; }
.t-calculator .panel { border: 1px solid #ccc !important; background: #fff !important; }
.t-calculator .stat { background: #f5f5f5 !important; }
.t-calculator * { color: #000 !important; box-shadow: none !important; }
.t-calculator .panel::before, .t-calculator .stat::before { display: none; }

}


/* ══════════════════════════════════════════════════
   REBALANCER
══════════════════════════════════════════════════ */
.t-rebalancer * { margin: 0; padding: 0; box-sizing: border-box; }
.t-rebalancer body {
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', sans-serif;
    min-height: 100vh;
    padding: 32px 20px;
  }
.t-rebalancer header { text-align: center; margin-bottom: 32px; }
.t-rebalancer h1 {
    font-family: 'DM Serif Display', serif;
    font-size: clamp(42px, 8vw, 72px);
    letter-spacing: 2px;
    color: var(--gold);
    line-height: 1;
    font-weight: 700;
  }
.t-rebalancer .subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    color: var(--muted);
    letter-spacing: 3px;
    text-transform: uppercase;
    margin-top: 8px;
    font-weight: 300;
  }
.t-rebalancer .divider { width: 60px; height: 1px; background: var(--gold-dim); margin: 16px auto; }
.t-rebalancer .container { max-width: 1100px; margin: 0 auto; }
.t-rebalancer .panel {
    background: var(--panel);
    border: none;
    border-radius: 6px;
    padding: 24px;
    margin-bottom: 20px;
    position: relative;
  }
.t-rebalancer .panel::before {
    content: '';
    position: absolute; inset: 0;
    border-radius: 6px;
    padding: 1px;
    background: linear-gradient(135deg, rgba(74,127,193,0.35) 0%, rgba(42,82,152,0.15) 50%, rgba(74,127,193,0.08) 100%);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
    transition: background 0.4s ease;
  }
.t-rebalancer .panel:hover::before {
    background: linear-gradient(135deg, rgba(91,143,209,0.55) 0%, rgba(74,127,193,0.28) 50%, rgba(42,82,152,0.18) 100%);
  }
.t-rebalancer .panel-title {
    margin-bottom: 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
  }
.t-rebalancer .panel-title-text { display: flex; flex-direction: column; gap: 3px; }
.t-rebalancer .panel-label {
    font-family: 'Inter', sans-serif;
    font-size: 9px; letter-spacing: 3px;
    color: var(--purple); text-transform: uppercase;
  }
.t-rebalancer .panel-heading {
    font-family: 'DM Serif Display', serif;
    font-size: 18px; font-weight: 700;
    color: var(--text); letter-spacing: 0.2px;
    line-height: 1.1;
  }
.t-rebalancer .panel-title.sub {
    margin-top: 24px;
    align-items: center;
  }
.t-rebalancer .panel-title.sub .panel-heading { font-size: 13px; color: var(--gold-dim); font-weight: 400; font-family: 'Inter', sans-serif; letter-spacing: 2px; text-transform: uppercase; }
.t-rebalancer label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 10px;
    color: var(--muted);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin-bottom: 6px;
  }
.t-rebalancer input[type="number"], .t-rebalancer input[type="text"] {
    width: 100%;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 3px;
    color: var(--gold);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    padding: 9px 11px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
  }
.t-rebalancer input:focus {
    border-color: var(--gold-dim);
    box-shadow: 0 0 0 3px rgba(42,82,152,0.18);
    background: var(--panel);
  }
.t-rebalancer input[type="number"]:hover:not(:focus), .t-rebalancer input[type="text"]:hover:not(:focus) { border-color: #2a3050; }
.t-rebalancer input[type="text"] { color: var(--text); }
.t-rebalancer input[type="checkbox"] { cursor: pointer; width: 15px; height: 15px; accent-color: var(--gold); }
.t-rebalancer .cash-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
  }
@media (max-width: 600px) {
.t-rebalancer .cash-row { grid-template-columns: 1fr; }

}
.t-rebalancer button {
    --sx: 50%; --sy: 50%; --so: 0;
    position: relative; overflow: hidden;
    font-family: 'Inter', sans-serif;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: 999px;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.08s ease, box-shadow 0.18s ease;
    border: 1px solid var(--gold-dim);
    background: rgba(42,82,152,0.10);
    color: var(--gold);
    padding: 10px 20px;
  }
.t-rebalancer button:hover { background: rgba(74,127,193,0.18); transform: translateY(-1px); box-shadow: 0 2px 12px rgba(42,82,152,0.20); }
.t-rebalancer button:active { transform: translateY(0); box-shadow: none; }
.t-rebalancer button:disabled { opacity: 0.55; cursor: default; transform: none; box-shadow: none; }
.t-rebalancer button.ghost { border-color: var(--border); background: transparent; color: var(--muted); }
.t-rebalancer button.ghost:hover { color: var(--text); border-color: var(--gold-dim); box-shadow: none; }
.t-rebalancer button.small { padding: 5px 14px; font-size: 9px; }
.t-rebalancer button.danger { border-color: rgba(231,76,60,0.4); color: var(--red); background: transparent; }
.t-rebalancer button.danger:hover { background: rgba(231,76,60,0.12); box-shadow: 0 2px 8px rgba(231,76,60,0.10); }
.t-rebalancer button::after {
    content: '';
    position: absolute; inset: 0;
    background: radial-gradient(circle 70px at var(--sx) var(--sy),
      rgba(255,255,255,0.13) 0%,
      transparent 80%);
    opacity: var(--so);
    transition: opacity 0.25s ease;
    pointer-events: none;
    border-radius: inherit;
  }
.t-rebalancer table { width: 100%; border-collapse: collapse; font-family: 'Inter', sans-serif; font-size: 12px; }
.t-rebalancer th {
    background: var(--bg); color: var(--muted); font-size: 9px; letter-spacing: 2px;
    text-transform: uppercase; padding: 8px 8px; text-align: right; border-bottom: 1px solid var(--border);
  }
.t-rebalancer th:first-child, .t-rebalancer th:nth-child(2) { text-align: left; }
.t-rebalancer td { padding: 6px 8px; text-align: right; border-bottom: 1px solid var(--border); }
.t-rebalancer tbody tr { transition: background 0.15s ease, transform 0.18s ease, box-shadow 0.18s ease; }
.t-rebalancer tbody tr:hover { background: rgba(74,127,193,0.05); transform: translateX(3px); box-shadow: inset 3px 0 0 var(--gold-dim); }
.t-rebalancer td:first-child, .t-rebalancer td:nth-child(2) { text-align: left; }
.t-rebalancer tr:last-child td { border-bottom: none; }
.t-rebalancer td input { font-size: 13px; padding: 6px 8px; }
.t-rebalancer .td-center { text-align: center !important; }
.t-rebalancer .sleeve-tag {
    display: inline-block; font-size: 9px; letter-spacing: 1px; padding: 2px 7px;
    border-radius: 2px; text-transform: uppercase;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
  }
.t-rebalancer .sleeve-tag:hover {
    transform: scale(1.06);
    box-shadow: 0 0 10px currentColor;
  }
.t-rebalancer select {
    background: var(--bg); border: 1px solid var(--border); border-radius: 3px;
    color: var(--text); font-family: 'Inter', sans-serif; font-size: 12px;
    padding: 6px 8px; outline: none; cursor: pointer; width: 100%;
  }
.t-rebalancer select option:disabled { color: var(--muted); }
.t-rebalancer .stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.t-rebalancer .stat { background: var(--bg); border: 1px solid var(--border); border-radius: 4px; padding: 16px; transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease; }
.t-rebalancer .stat:hover { transform: translateY(-5px) scale(1.02); border-color: var(--gold-dim); box-shadow: 0 12px 32px rgba(0,0,0,0.5), 0 0 20px rgba(42,82,152,0.10); }
.t-rebalancer .stat.highlight { border-color: var(--gold-dim); background: rgba(42,82,152,0.06); }
.t-rebalancer .stat.fee-stat { border-color: rgba(231,76,60,0.3); background: rgba(231,76,60,0.03); }
.t-rebalancer .stat-label { font-family: 'Inter', sans-serif; font-size: 9px; color: var(--muted); letter-spacing: 2px; text-transform: uppercase; margin-bottom: 6px; }
.t-rebalancer .stat-value { font-family: 'Space Grotesk', sans-serif; font-size: 28px; font-weight: 600; color: var(--gold); letter-spacing: -0.5px; line-height: 1; }
.t-rebalancer .stat-value.green { color: var(--green); }
.t-rebalancer .stat-value.red { color: var(--red); }
.t-rebalancer .sleeve-bar-wrap { margin-bottom: 14px; }
.t-rebalancer .sleeve-bar-head { display: flex; justify-content: space-between; font-family: 'Inter', sans-serif; font-size: 11px; margin-bottom: 5px; }
.t-rebalancer .sleeve-bar-head .name { color: var(--text); }
.t-rebalancer .sleeve-bar-head .pct { color: var(--muted); }
.t-rebalancer .bar-track { height: 8px; background: var(--bg); border-radius: 4px; overflow: hidden; position: relative; border: 1px solid var(--border); }
.t-rebalancer .bar-current { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.t-rebalancer .bar-target-marker { position: absolute; top: -2px; bottom: -2px; width: 2px; background: var(--text); opacity: 0.6; }
.t-rebalancer .note {
    margin-top: 16px; padding-top: 16px;
    border-top: 1px solid var(--border);
    display: flex; flex-wrap: wrap; gap: 8px;
  }
.t-rebalancer .info-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 500;
    letter-spacing: 1px; text-transform: uppercase;
    padding: 5px 12px; border-radius: 999px;
    border: 1px solid rgba(42,82,152,0.3);
    background: rgba(42,82,152,0.06);
    color: var(--gold-dim); cursor: default;
    transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
    position: relative;
  }
.t-rebalancer .info-chip:hover {
    background: rgba(74,127,193,0.14);
    border-color: var(--gold-dim);
    color: var(--gold);
  }
.t-rebalancer .info-chip.alert { border-color: rgba(231,76,60,0.3); background: rgba(231,76,60,0.05); color: var(--red); }
.t-rebalancer .info-chip.alert:hover { background: rgba(231,76,60,0.12); border-color: var(--red); }
.t-rebalancer .info-chip.ok { border-color: rgba(46,204,113,0.3); background: rgba(46,204,113,0.05); color: var(--green); }
.t-rebalancer .info-chip.ok:hover { background: rgba(46,204,113,0.12); border-color: var(--green); }
.t-rebalancer .info-chip .chip-dot {
    width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0;
  }
.t-rebalancer .chip-tooltip {
    display: none;
    position: absolute; bottom: calc(100% + 8px); left: 50%;
    transform: translateX(-50%);
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 6px; padding: 8px 12px;
    font-family: 'Inter', sans-serif; font-size: 11px; font-weight: 400;
    color: var(--text); line-height: 1.6;
    white-space: normal; text-align: left;
    text-transform: none; letter-spacing: 0;
    z-index: 200; width: 240px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    pointer-events: none;
  }
.t-rebalancer .info-chip:hover .chip-tooltip { display: block; }
.t-rebalancer .note span { color: var(--gold-dim); }
.t-rebalancer .buy-amt { color: var(--green); font-weight: 600; }
.t-rebalancer .zero-amt { color: var(--muted); }
.t-rebalancer .units-amt { color: var(--blue); font-weight: 600; }
.t-rebalancer .up-amt { color: var(--purple); font-weight: 600; }
.t-rebalancer .target-warn { color: var(--red); font-family: 'Inter', sans-serif; font-size: 11px; margin-top: 10px; }
.t-rebalancer .api-note { font-family: 'Inter', sans-serif; font-size: 9px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.t-rebalancer .controls-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.t-rebalancer .api-status { font-family: 'Inter', sans-serif; font-size: 10px; margin-top: 8px; min-height: 14px; }
.t-rebalancer .api-grid { display: grid; grid-template-columns: 160px 1fr; gap: 10px; align-items: end; }
@media (max-width: 600px) {
.t-rebalancer .api-grid { grid-template-columns: 1fr; }

}
.t-rebalancer .sleeve-editor-row {
    display: grid;
    grid-template-columns: 1fr 90px 36px 36px;
    gap: 8px;
    align-items: center;
    margin-bottom: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
  }
.t-rebalancer .sleeve-editor-row:hover { transform: translateY(-2px) scale(1.01); background: rgba(255,255,255,0.02); box-shadow: 0 6px 18px rgba(0,0,0,0.3); }
.t-rebalancer .sleeve-editor-row input[type="text"] { font-size: 13px; padding: 6px 10px; }
.t-rebalancer .sleeve-editor-row input[type="number"] { font-size: 13px; padding: 6px 10px; }
.t-rebalancer .color-dot {
    width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border);
    cursor: pointer; display: inline-block; flex-shrink: 0;
  }
.t-rebalancer .sleeve-cash-label {
    font-family: 'Inter', sans-serif; font-size: 9px; color: var(--muted);
    letter-spacing: 1px; text-transform: uppercase; padding: 4px 0;
  }
.t-rebalancer .fee-sub-label {
    font-family: 'Inter', sans-serif; font-size: 14px; font-weight: 600;
    color: var(--text); letter-spacing: 0.2px;
    margin: 24px 0 12px; padding-top: 18px; border-top: 1px solid var(--border);
    display: flex; flex-direction: column; gap: 2px;
  }
.t-rebalancer .fee-sub-label::before {
    content: attr(data-label);
    font-family: 'Inter', sans-serif; font-size: 9px;
    color: var(--purple); letter-spacing: 3px; text-transform: uppercase; font-weight: 400;
  }
.t-rebalancer .cash-row > div {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 6px; padding: 8px;
  }
.t-rebalancer .cash-row > div:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  }
.t-rebalancer select {
    transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
  }
.t-rebalancer select:hover { border-color: #2a3050; transform: translateY(-1px); }
.t-rebalancer select:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 3px rgba(42,82,152,0.18); transform: none; }
.t-rebalancer .api-grid > div, .t-rebalancer #fee-budget-row {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 6px; padding: 4px 8px;
  }
.t-rebalancer .api-grid > div:hover, .t-rebalancer #fee-budget-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.3);
  }
.t-rebalancer .fx-table { max-width: 420px; margin-top: 8px; }
.t-rebalancer .fx-table th { font-size: 9px; letter-spacing: 1px; }
.t-rebalancer .fx-table td { padding: 5px 8px; font-size: 12px; }
.t-rebalancer .fx-base-badge {
    font-family: 'Inter', sans-serif; font-size: 9px; color: var(--gold-dim);
    letter-spacing: 1px; text-transform: uppercase; margin-left: 6px;
  }
.t-rebalancer .curr-input {
    width: 130px !important; font-size: 12px !important; padding: 5px 8px !important;
    color: var(--gold) !important;
  }
.t-rebalancer @keyframes panelIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes valuePop { 0% { opacity: 0.35; transform: translateY(3px); } 100% { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes barFill { from { transform: scaleX(0); } to { transform: scaleX(1); } }
.t-rebalancer .panel { animation: panelIn 0.4s ease both; }
.t-rebalancer .panel:nth-of-type(1) { animation-delay: 0.02s; }
.t-rebalancer .panel:nth-of-type(2) { animation-delay: 0.06s; }
.t-rebalancer .panel:nth-of-type(3) { animation-delay: 0.10s; }
.t-rebalancer .panel:nth-of-type(4) { animation-delay: 0.14s; }
.t-rebalancer .panel:nth-of-type(5) { animation-delay: 0.18s; }
.t-rebalancer .panel { transition: border-color 0.25s ease; }
.t-rebalancer .panel { transition: border-color 0.25s ease, transform 0.25s ease, box-shadow 0.25s ease; }
.t-rebalancer .panel:hover { border-color: #2a3050; transform: translateY(-3px); box-shadow: 0 10px 30px rgba(0,0,0,0.45), 0 0 25px rgba(42,82,152,0.08); }
.t-rebalancer .stat-value.value-update { animation: valuePop 0.35s ease; }
.t-rebalancer .spinner {
    display: inline-block; width: 11px; height: 11px;
    border: 2px solid rgba(42,82,152,0.25); border-top-color: var(--gold);
    border-radius: 50%; animation: spin 0.7s linear infinite;
    vertical-align: -1px; margin-right: 6px;
  }
.t-rebalancer .row-enter { animation: valuePop 0.3s ease both; }
.t-rebalancer select {
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
  }
.t-rebalancer select:hover { border-color: #2a3050; }
.t-rebalancer select:focus { border-color: var(--gold-dim); box-shadow: 0 0 0 3px rgba(42,82,152,0.18); }
.t-rebalancer header { position: relative; z-index: 1; }
.t-rebalancer .section-divider {
    display: flex; align-items: center; gap: 10px;
    margin: 8px 0 20px; opacity: 0.35;
  }
.t-rebalancer .section-divider::before, .t-rebalancer .section-divider::after {
    content: ''; flex: 1; height: 1px;
    border-top: 1px dashed var(--gold-dim);
  }
.t-rebalancer .section-divider span {
    font-family: 'Inter', sans-serif; font-size: 10px;
    color: var(--gold-dim); letter-spacing: 2px;
  }
.t-rebalancer .section-divider span::before { content: '+ '; }
.t-rebalancer .section-divider span::after { content: ' +'; }
.t-rebalancer .tol-wrap {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 6px; padding: 8px;
  }
.t-rebalancer .tol-wrap:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.35);
  }
.t-rebalancer /* ── Market Ticker Background ── */
  #ticker-bg {
    position: fixed; inset: 0; z-index: 0;
    pointer-events: none; overflow: hidden;
    opacity: 0.35;
  }
.t-rebalancer .ticker-row {
    position: absolute; white-space: nowrap;
    font-family: 'IBM Plex Mono', 'Courier New', monospace;
    font-size: 11px; letter-spacing: 1px;
    animation: tickerMove linear infinite;
  }
@keyframes tickerMove {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
  }
.t-rebalancer body.light-mode #ticker-bg { opacity: 0.3; }
.t-rebalancer * { scrollbar-width: none; }
.t-rebalancer *::-webkit-scrollbar { display: none; }
.t-rebalancer .sleeve-bar-wrap {
    cursor: default;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border-radius: 6px; padding: 4px 6px;
  }
.t-rebalancer .sleeve-bar-wrap:hover {
    transform: translateY(-3px) scale(1.01);
    box-shadow: 0 8px 20px rgba(0,0,0,0.4);
  }
.t-rebalancer .sleeve-bar-wrap:hover .bar-track {
    border-color: var(--gold-dim);
  }
.t-rebalancer .panel-heading {
    color: #e8e8f0;
  }
.t-rebalancer @keyframes revealUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
  }
.t-rebalancer .reveal {
    opacity: 0;
    animation: revealUp 0.55s cubic-bezier(0.22,1,0.36,1) forwards;
  }
.t-rebalancer @keyframes countUp {
    from { opacity: 0.3; transform: translateY(6px) scale(0.96); }
    to   { opacity: 1;   transform: translateY(0)   scale(1); }
  }
.t-rebalancer .stat-value.counting {
    animation: countUp 0.45s cubic-bezier(0.22,1,0.36,1);
  }
.t-rebalancer .sticky-bar {
    position: sticky; top: 0; left: 0; right: 0; z-index: 100;
    display: flex; align-items: center; justify-content: center;
    padding: 8px 24px;
    background: rgba(8,12,24,0.80);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid rgba(42,82,152,0.20);
    transform: translateY(-100%);
    transition: transform 0.35s cubic-bezier(0.22,1,0.36,1);
    pointer-events: none;
  }
.t-rebalancer .sticky-bar.visible { transform: translateY(0); pointer-events: auto; }
.t-rebalancer .sticky-bar-title {
    font-family: 'DM Serif Display', serif;
    font-size: 18px; color: var(--gold); letter-spacing: 1px;
  }
.t-rebalancer .sticky-bar-sub {
    font-family: 'Inter', sans-serif; font-size: 10px;
    color: var(--muted); letter-spacing: 3px; text-transform: uppercase;
    margin-left: 14px;
  }
.t-rebalancer th[data-tip] { position: relative; cursor: help; }
.t-rebalancer th[data-tip]::after {
    content: attr(data-tip);
    position: absolute; bottom: calc(100% + 6px); left: 50%;
    transform: translateX(-50%) scale(0.9);
    background: var(--panel); color: var(--text);
    font-family: 'Inter', sans-serif; font-size: 10px; font-weight: 400;
    letter-spacing: 0; text-transform: none;
    white-space: nowrap; padding: 5px 9px; border-radius: 4px;
    border: 1px solid var(--border);
    opacity: 0; pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
    z-index: 50;
  }
.t-rebalancer th[data-tip]:hover::after {
    opacity: 1; transform: translateX(-50%) scale(1);
  }
.t-rebalancer .ticker-copy { cursor: pointer; }
.t-rebalancer .ticker-copy:hover { color: var(--gold); }
.t-rebalancer .copy-tick {
    display: inline-block; margin-left: 4px;
    color: var(--green); font-size: 10px;
    opacity: 0; transform: scale(0.5);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }
.t-rebalancer .copy-tick.show { opacity: 1; transform: scale(1); }
.t-rebalancer @keyframes rowFlash { 0%{background:rgba(74,127,193,0.18);} 100%{background:transparent;} }
.t-rebalancer .row-flash { animation: rowFlash 0.8s ease; }
.t-rebalancer tbody tr[data-sleeve-color]:hover {
    background: color-mix(in srgb, var(--sleeve-bg, transparent) 8%, transparent) !important;
  }
.t-rebalancer @keyframes numTick { from{opacity:0.4;transform:translateY(4px);} to{opacity:1;transform:translateY(0);} }
.t-rebalancer .num-tick { animation: numTick 0.3s ease; }
.t-rebalancer @keyframes barPulse { 0%,100%{opacity:1;} 50%{opacity:0.55;} }
.t-rebalancer .bar-pulse { animation: barPulse 2s ease-in-out infinite; }
.t-rebalancer .last-updated {
    font-family: 'Inter', sans-serif; font-size: 10px;
    color: var(--muted); text-align: right;
    padding: 4px 0 0; letter-spacing: 1px;
  }
.t-rebalancer .holdings-search {
    width: 100%; background: var(--bg);
    border: 1px solid var(--border); border-radius: 999px;
    color: var(--text); font-family: 'Inter', sans-serif;
    font-size: 12px; padding: 7px 16px; outline: none;
    margin-bottom: 12px;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
  }
.t-rebalancer .holdings-search:focus {
    border-color: var(--gold-dim);
    box-shadow: 0 0 0 3px rgba(42,82,152,0.15);
  }
.t-rebalancer th.sortable { cursor: pointer; user-select: none; }
.t-rebalancer th.sortable:hover { color: var(--gold); }
.t-rebalancer th.sort-asc::after { content: ' ▲'; color: var(--gold); }
.t-rebalancer th.sort-desc::after { content: ' ▼'; color: var(--gold); }
.t-rebalancer .sparkline { display: inline-block; vertical-align: middle; margin-left: 4px; }
.t-rebalancer .mode-toggle {
    position: fixed; top: 14px; right: 20px; z-index: 101;
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--gold-dim);
    background: rgba(42,82,152,0.10);
    color: var(--gold); font-size: 16px;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; transition: all 0.2s ease;
  }
.t-rebalancer .mode-toggle:hover { background: rgba(74,127,193,0.20); transform: scale(1.1); }
.t-rebalancer body.light-mode {
    --bg: #f0ede6; --panel: #faf9f6; --border: #ccc8bc;
    --gold: #7a5c10; --gold-dim: #9a7a30;
    --green: #1a7a40; --red: #b83020;
    --blue: #1a4a9a; --purple: #5a3a9a;
    --text: #1a1814; --muted: #5a5450;
    background-image: none;
  }
.t-rebalancer body.light-mode .panel { background: #faf9f6; }
.t-rebalancer body.light-mode .panel::before { background: linear-gradient(135deg, rgba(122,92,16,0.2) 0%, rgba(90,58,154,0.08) 50%, rgba(122,92,16,0.05) 100%); }
.t-rebalancer body.light-mode .panel:hover { border-color: #b8b4a8; }
.t-rebalancer body.light-mode input[type="number"] { background: #ede9e0; border-color: #ccc8bc; color: #7a5c10; }
.t-rebalancer body.light-mode input[type="text"] { background: #ede9e0; border-color: #ccc8bc; color: #1a1814; }
.t-rebalancer body.light-mode input:focus { box-shadow: 0 0 0 3px rgba(122,92,16,0.12); }
.t-rebalancer body.light-mode select { background: #ede9e0; border-color: #ccc8bc; color: #1a1814; }
.t-rebalancer body.light-mode .holdings-search { background: #ede9e0; border-color: #ccc8bc; color: #1a1814; }
.t-rebalancer body.light-mode th { background: #e8e4db; color: #5a5450; }
.t-rebalancer body.light-mode td { border-bottom-color: #dedad2; }
.t-rebalancer body.light-mode tbody tr:hover { background: rgba(122,92,16,0.05) !important; }
.t-rebalancer body.light-mode .sleeve-tag { filter: brightness(0.82) saturate(1.2); }
.t-rebalancer body.light-mode .stat { background: #ede9e0; border-color: #ccc8bc; }
.t-rebalancer body.light-mode .stat.highlight { background: #e8e2d4; border-color: #9a7a30; }
.t-rebalancer body.light-mode .stat.fee-stat { background: #f0e8e6; border-color: rgba(184,48,32,0.3); }
.t-rebalancer body.light-mode .stat-label { color: #5a5450; }
.t-rebalancer body.light-mode .stat-value { color: #7a5c10; }
.t-rebalancer body.light-mode .stat-value.green { color: #1a7a40; }
.t-rebalancer body.light-mode .stat-value.red { color: #b83020; }
.t-rebalancer body.light-mode .bar-track { background: #dedad2; border-color: #ccc8bc; }
.t-rebalancer body.light-mode .bar-target-marker { background: #5a5450; }
.t-rebalancer body.light-mode .sleeve-bar-head .name { color: #1a1814; }
.t-rebalancer body.light-mode .sleeve-bar-head .pct { color: #5a5450; }
.t-rebalancer body.light-mode .sleeve-bar-wrap:hover { box-shadow: 0 8px 20px rgba(0,0,0,0.1); }
.t-rebalancer body.light-mode button { border-color: #9a7a30; background: rgba(122,92,16,0.08); color: #7a5c10; }
.t-rebalancer body.light-mode button:hover { background: rgba(122,92,16,0.16); box-shadow: 0 2px 8px rgba(122,92,16,0.15); }
.t-rebalancer body.light-mode button.ghost { border-color: #ccc8bc; color: #5a5450; background: transparent; }
.t-rebalancer body.light-mode button.ghost:hover { color: #1a1814; border-color: #9a7a30; }
.t-rebalancer body.light-mode button.danger { border-color: rgba(184,48,32,0.4); color: #b83020; background: transparent; }
.t-rebalancer body.light-mode .panel-label { color: #5a3a9a; }
.t-rebalancer body.light-mode .panel-heading { color: #1a1814; }
.t-rebalancer body.light-mode .panel-title { border-bottom-color: #ccc8bc; }
.t-rebalancer body.light-mode .fee-sub-label { color: #1a1814; border-top-color: #ccc8bc; }
.t-rebalancer body.light-mode .fee-sub-label::before { color: #5a3a9a; }
.t-rebalancer body.light-mode label { color: #5a5450; }
.t-rebalancer body.light-mode .api-note { color: #7a7470; }
.t-rebalancer body.light-mode .buy-amt { color: #1a7a40; }
.t-rebalancer body.light-mode .units-amt { color: #1a4a9a; }
.t-rebalancer body.light-mode .up-amt { color: #5a3a9a; }
.t-rebalancer body.light-mode .zero-amt { color: #8a8478; }
.t-rebalancer body.light-mode .target-warn { color: #b83020; }
.t-rebalancer body.light-mode .sticky-bar { background: rgba(240,237,230,0.88); border-bottom-color: rgba(122,92,16,0.18); }
.t-rebalancer body.light-mode .sticky-bar-title { color: #7a5c10; }
.t-rebalancer body.light-mode .sticky-bar-sub { color: #5a5450; }
.t-rebalancer body.light-mode .section-divider { opacity: 0.45; }
.t-rebalancer body.light-mode .divider { background: #9a7a30; }
.t-rebalancer body.light-mode .fx-base-badge { color: #9a7a30; }
.t-rebalancer body.light-mode .curr-input { color: #7a5c10 !important; background: #ede9e0 !important; border-color: #ccc8bc !important; }
.t-rebalancer body.light-mode .sleeve-editor-row:hover { background: rgba(122,92,16,0.04); box-shadow: 0 6px 16px rgba(0,0,0,0.08); }
.t-rebalancer body.light-mode .info-chip { background: rgba(122,92,16,0.06); border-color: rgba(122,92,16,0.2); color: #7a5c10; }
.t-rebalancer body.light-mode .info-chip:hover { background: rgba(122,92,16,0.14); }
.t-rebalancer body.light-mode .info-chip.alert { background: rgba(184,48,32,0.06); border-color: rgba(184,48,32,0.25); color: #b83020; }
.t-rebalancer body.light-mode .info-chip.ok { background: rgba(26,122,64,0.06); border-color: rgba(26,122,64,0.25); color: #1a7a40; }
.t-rebalancer body.light-mode .chip-tooltip { background: #f5f2ec; border-color: #ccc8bc; color: #1a1814; }
.t-rebalancer body.light-mode footer { border-top-color: #ccc8bc; color: #7a7470; }
.t-rebalancer body.light-mode footer a { color: #9a7a30; }
.t-rebalancer .print-btn {
    font-family: 'Inter', sans-serif; font-size: 10px;
    letter-spacing: 1px; text-transform: uppercase;
    cursor: pointer; border-radius: 999px;
    border: 1px solid var(--gold-dim);
    background: rgba(42,82,152,0.10);
    color: var(--gold); padding: 6px 14px;
    transition: all 0.18s ease;
  }
.t-rebalancer .print-btn:hover { background: rgba(74,127,193,0.18); }
@media print {
.t-rebalancer .mode-toggle, .t-rebalancer .sticky-bar, .t-rebalancer .section-divider, .t-rebalancer header, .t-rebalancer .panel:not(.print-panel) { display: none !important; }
.t-rebalancer body { background: white !important; color: black !important; padding: 8px; }
.t-rebalancer .print-panel { display: block !important; border: none !important; box-shadow: none !important; }
.t-rebalancer .print-panel::before { display: none !important; }
.t-rebalancer .stat-value { color: #333 !important; -webkit-text-fill-color: #333 !important; }
.t-rebalancer .stat { background: #f5f5f5 !important; border: 1px solid #ccc !important; }
.t-rebalancer .buy-amt { color: #1a7a40 !important; }
.t-rebalancer .zero-amt { color: #999 !important; }
.t-rebalancer .units-amt { color: #1a4a9a !important; }
.t-rebalancer table { border-collapse: collapse; width: 100%; }
.t-rebalancer th, .t-rebalancer td { border: 1px solid #ddd; padding: 5px 8px; font-size: 11px; color: black !important; }
.t-rebalancer th { background: #eee !important; }
.t-rebalancer .sleeve-tag { border: 1px solid #999 !important; background: transparent !important; color: #333 !important; }
.t-rebalancer .print-btn, .t-rebalancer .controls-row, .t-rebalancer .last-updated { display: none !important; }
.t-rebalancer .ticker-breakdown-section { page-break-before: always; break-before: page; margin-top: 0; }

}
.t-rebalancer .section-divider::before, .t-rebalancer .section-divider::after {
    background-size: 200% 1px;
    background-image: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
    animation: dividerShimmer 3s linear infinite;
    border-top: none; height: 1px;
  }
@keyframes dividerShimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
  }
.t-rebalancer .autosave-dot {
    position: fixed; bottom: 20px; right: 20px; z-index: 200;
    display: flex; align-items: center; gap: 6px;
    font-family: 'Inter', sans-serif; font-size: 10px;
    color: var(--muted); letter-spacing: 1px;
    opacity: 0; transition: opacity 0.4s ease;
    pointer-events: none;
  }
.t-rebalancer .autosave-dot.show { opacity: 1; }
.t-rebalancer .autosave-dot-circle {
    width: 7px; height: 7px; border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 6px var(--green);
    animation: dotPulse 1.2s ease-in-out infinite;
  }
@keyframes dotPulse { 0%,100%{opacity:1;} 50%{opacity:0.4;} }
.t-rebalancer .rebalance-counter {
    font-family: 'Inter', sans-serif; font-size: 10px;
    color: var(--muted); letter-spacing: 1px;
    text-align: center; margin-bottom: 6px;
    cursor: pointer; transition: color 0.2s;
  }
.t-rebalancer .rebalance-counter:hover { color: var(--gold); }
.t-rebalancer .rebalance-counter strong { color: var(--gold); font-weight: 600; }
.t-rebalancer .empty-state {
    text-align: center; padding: 40px 20px;
    font-family: 'Inter', sans-serif;
    display: none;
  }
.t-rebalancer .empty-state-icon { font-size: 40px; margin-bottom: 12px; opacity: 0.4; }
.t-rebalancer .empty-state-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.t-rebalancer .empty-state-sub { font-size: 12px; color: var(--muted); margin-bottom: 18px; line-height: 1.6; }
.t-rebalancer .drag-ghost {
    position: fixed; pointer-events: none; z-index: 9999;
    opacity: 0.88; transform: scale(1.02) rotate(0.8deg);
    box-shadow: 0 16px 40px rgba(0,0,0,0.6);
    border-radius: 6px; background: var(--panel);
    border: 1px solid var(--gold-dim);
    padding: 8px 12px; min-width: 200px;
    font-family: 'Inter', sans-serif; font-size: 13px;
    color: var(--text);
  }
.t-rebalancer .drag-src-hidden { opacity: 0.2; pointer-events: none; }
.t-rebalancer .drag-insert-above { border-top: 2px solid var(--gold) !important; }
.t-rebalancer .drag-insert-below { border-bottom: 2px solid var(--gold) !important; }
.t-rebalancer .sleeve-editor-row { transition: margin 0.15s ease, opacity 0.15s ease; }
.t-rebalancer #holdings-body tr { transition: opacity 0.15s ease; }
.t-rebalancer .h-drag-handle {
    cursor: grab; color: var(--muted); font-size: 14px;
    padding: 0 6px; user-select: none;
    transition: color 0.15s;
  }
.t-rebalancer .h-drag-handle:hover { color: var(--gold); }
.t-rebalancer .drag-handle {
    cursor: grab; color: var(--muted); font-size: 14px;
    padding: 0 4px; user-select: none; flex-shrink: 0;
    transition: color 0.2s;
  }
.t-rebalancer .drag-handle:hover { color: var(--gold); }
.t-rebalancer .tour-overlay {
    position: fixed; inset: 0; z-index: 1000;
    pointer-events: none;
  }
.t-rebalancer .tour-highlight {
    position: fixed; z-index: 1001;
    border: 2px solid var(--gold);
    border-radius: 6px;
    box-shadow: 0 0 0 4000px rgba(0,0,0,0.55), 0 0 20px rgba(42,82,152,0.4);
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.22,1,0.36,1);
  }
.t-rebalancer .tour-bubble {
    position: fixed; z-index: 1002;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 10px; padding: 16px 20px;
    max-width: 280px; box-shadow: 0 12px 40px rgba(0,0,0,0.6);
    font-family: 'Inter', sans-serif;
    transition: all 0.4s cubic-bezier(0.22,1,0.36,1);
  }
.t-rebalancer .tour-bubble-title { font-size: 13px; font-weight: 600; color: var(--gold); margin-bottom: 6px; }
.t-rebalancer .tour-bubble-text { font-size: 11px; color: var(--text); line-height: 1.6; margin-bottom: 14px; }
.t-rebalancer .tour-bubble-nav { display: flex; justify-content: space-between; align-items: center; }
.t-rebalancer .tour-step-count { font-size: 10px; color: var(--muted); }
.t-rebalancer .tour-btn-row { display: flex; gap: 8px; }
.t-rebalancer .tour-btn {
    font-family: 'Inter', sans-serif; font-size: 10px; letter-spacing: 1px;
    text-transform: uppercase; padding: 6px 14px; border-radius: 999px;
    cursor: pointer; border: 1px solid var(--gold-dim);
    background: rgba(42,82,152,0.12); color: var(--gold);
    transition: background 0.18s;
  }
.t-rebalancer .tour-btn:hover { background: rgba(74,127,193,0.20); }
.t-rebalancer .tour-btn.skip { border-color: var(--border); background: transparent; color: var(--muted); }
.t-rebalancer .tour-btn.skip:hover { color: var(--text); }
.t-rebalancer body.light-mode .tour-bubble { background: #f5f2ec; border-color: #9a7a30; }
.t-rebalancer body.light-mode .tour-highlight { box-shadow: 0 0 0 4000px rgba(0,0,0,0.4), 0 0 20px rgba(122,92,16,0.4); border-color: #7a5c10; }
.t-rebalancer .share-toast {
    position: fixed; bottom: 60px; left: 50%; transform: translateX(-50%) translateY(10px);
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 999px; padding: 8px 20px;
    font-family: 'Inter', sans-serif; font-size: 11px; color: var(--gold);
    opacity: 0; transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none; z-index: 300; white-space: nowrap;
  }
.t-rebalancer .share-toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.t-rebalancer @keyframes portfolioOut {
    from { opacity: 1; transform: translateY(0); }
    to   { opacity: 0; transform: translateY(-12px); }
  }
@keyframes portfolioIn {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
  }
.t-rebalancer .container.portfolio-out {
    animation: portfolioOut 0.2s ease forwards;
    pointer-events: none;
  }
.t-rebalancer .container.portfolio-in {
    animation: portfolioIn 0.25s ease forwards;
  }
.t-rebalancer .portfolio-bar {
    display: flex; align-items: center; gap: 8px;
    justify-content: center; flex-wrap: wrap;
    margin: 10px 0 4px;
  }
.t-rebalancer .portfolio-tab {
    font-family: 'Inter', sans-serif; font-size: 10px;
    letter-spacing: 1px; text-transform: uppercase;
    padding: 5px 14px; border-radius: 999px;
    border: 1px solid var(--border); background: transparent;
    color: var(--muted); cursor: pointer;
    transition: all 0.18s ease;
  }
.t-rebalancer .portfolio-tab:hover { border-color: var(--gold-dim); color: var(--text); }
.t-rebalancer .portfolio-tab.active { border-color: var(--gold-dim); background: rgba(42,82,152,0.14); color: var(--gold); }
.t-rebalancer .portfolio-tab.add-tab { border-style: dashed; }
.t-rebalancer .portfolio-rename { font-size: 10px; padding: 3px 8px; width: 120px; }
.t-rebalancer body.light-mode .portfolio-tab { border-color: #ccc8bc; color: #5a5450; }
.t-rebalancer body.light-mode .portfolio-tab.active { border-color: #9a7a30; background: rgba(122,92,16,0.1); color: #7a5c10; }
.t-rebalancer @media (max-width: 768px) {
    body { padding: 16px 10px; }

    h1 { font-size: clamp(32px, 10vw, 52px); letter-spacing: 2px; }
    .subtitle { font-size: 9px; letter-spacing: 2px; }

    .container { padding: 0; width: 100%; overflow-x: hidden; }
    .panel { margin-bottom: 12px; border-radius: 4px; }
    body { overflow-x: hidden; }
    h1 { font-size: clamp(28px, 8vw, 44px); letter-spacing: 1px; }
    .subtitle { font-size: 8px; letter-spacing: 1px; }
    .panel { padding: 16px 12px; }

    /* Cash row → single column on mobile */
    .cash-row { grid-template-columns: 1fr !important; }
    .api-grid  { grid-template-columns: 1fr !important; }

    /* Sleeve editor — compact */
    .sleeve-editor-row {
      grid-template-columns: 1fr 70px 28px 28px;
      gap: 6px;
    }

    /* Holdings table → horizontal scroll on mobile (cleaner than card layout) */
    #holdings-body tr { display: table-row; }
    #holdings-body td { display: table-cell; padding: 6px 5px; font-size: 11px; }
    table thead { display: table-header-group; }
    th { font-size: 8px; padding: 6px 4px; }
    #holdings-body input[type="text"],
    #holdings-body input[type="number"] { font-size: 11px; }
    #holdings-body .h-ticker   { width: 60px !important; }
    #holdings-body .h-shares   { width: 50px !important; }
    #holdings-body .h-price    { width: 65px !important; }
    #holdings-body .h-currency { width: 38px !important; }
    #holdings-body .h-maxpct   { width: 45px !important; }
    #holdings-body select      { font-size: 11px; }

    /* Ticker breakdown — compact on mobile */
    #ticker-plan-body td, #ticker-plan-body th,
    #plan-body td, #plan-body th { font-size: 10px; padding: 5px 4px; }
    .sleeve-tag { font-size: 8px; padding: 2px 5px; }
    .ticker-breakdown-section { overflow-x: auto; -webkit-overflow-scrolling: touch; }

    /* Stat grid — 2 columns on mobile */
    .stat-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
    .stat-value { font-size: 20px; }

    /* Controls row — wrap */
    .controls-row { gap: 6px; }
    .controls-row button { font-size: 9px; padding: 7px 10px; }

    /* Panel title — stack on mobile */
    .panel-title { flex-direction: column; align-items: flex-start; gap: 8px; }

    /* Mode toggle — smaller on mobile */
    .mode-toggle { width: 30px; height: 30px; font-size: 14px; top: 8px; right: 8px; }

    /* Portfolio bar — scroll horizontal */
    .portfolio-bar { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding-bottom: 4px; }

    /* Print button — hide on mobile */
    .print-btn { display: none; }

    /* Sticky bar — smaller */
    .sticky-bar-title { font-size: 14px; }
    .sticky-bar-sub   { display: none; }
  }
@media (max-width: 480px) {
.t-rebalancer .stat-grid { grid-template-columns: 1fr; }
.t-rebalancer h1 { font-size: 36px; }
.t-rebalancer .sleeve-editor-row { grid-template-columns: 1fr 60px 24px 24px; }

}


/* ══ LIGHT MODE OVERRIDES — hard-coded colors ═══════════════════ */

/* Header & tabs */
body.light-mode .dg-header { background: #ffffff; border-bottom-color: #dee2e6; }
body.light-mode .dg-tabs   { background: #f8f9fa; border-bottom-color: #dee2e6; }

/* Progress bar in tracker */
body.light-mode .dg-progress-bar { background: #dee2e6; }

/* ── Calculator ── */
body.light-mode .t-calculator input[type="number"] { background: #ffffff; border-color: #dee2e6; color: #212529; }
body.light-mode .t-calculator input[type="number"]:hover:not(:focus) { border-color: #ced4da; box-shadow: 0 4px 14px rgba(13,33,161,0.08); }
body.light-mode .t-calculator input[type="number"]:focus { background: #f8f9fa; border-color: #0d21a1; box-shadow: 0 0 0 3px rgba(13,33,161,0.12); }
body.light-mode .t-calculator .fixed-row { border-bottom-color: #dee2e6; }
body.light-mode .t-calculator .fixed-row:hover { background: rgba(13,33,161,0.04); }
body.light-mode .t-calculator .stat { background: #ffffff; border: 1px solid #dee2e6; }
body.light-mode .t-calculator .stat::before { background: linear-gradient(135deg, rgba(13,33,161,0.15) 0%, rgba(139,92,246,0.05) 100%); }
body.light-mode .t-calculator .stat.highlight { background: rgba(13,33,161,0.04); }
body.light-mode .t-calculator .stat.highlight::before { background: linear-gradient(135deg, rgba(13,33,161,0.25) 0%, rgba(139,92,246,0.1) 100%); }
body.light-mode .t-calculator th { background: #f8f9fa; color: #6c757d; }
body.light-mode .t-calculator td { border-bottom-color: #dee2e6; color: #0d21a1; }
body.light-mode .t-calculator tbody tr:hover td { color: #0d21a1 !important; }
body.light-mode .t-calculator tbody tr:hover { background: rgba(13,33,161,0.04); }
body.light-mode .t-calculator tbody tr.goal-reached:hover td { color: #166534 !important; }
body.light-mode .t-calculator .note { color: #6c757d; }
body.light-mode .t-calculator .progress-bar { background: #dee2e6; }
body.light-mode .t-calculator .toggle-track { background: #e9ecef; border-color: #dee2e6; }
body.light-mode .t-calculator .toggle-switch input:checked ~ .toggle-track { background: rgba(13,33,161,0.12); border-color: #0d21a1; }
body.light-mode .t-calculator .real-col { color: #6c757d !important; }
body.light-mode .t-calculator .real-col-header { color: #adb5bd !important; }
body.light-mode .t-calculator th.real { color: #adb5bd !important; }
body.light-mode .t-calculator td.real { color: #6c757d !important; }
body.light-mode .t-calculator .goal-reached td.real { color: #166534 !important; }
body.light-mode .t-calculator .stat.inflation-stat { border-color: #c7d2fe; background: rgba(13,33,161,0.03); }
body.light-mode .t-calculator .stat.inflation-stat .stat-value { color: #0d21a1; }
body.light-mode .t-calculator .infl-badge { background: rgba(13,33,161,0.08); border-color: rgba(13,33,161,0.2); }
body.light-mode .t-calculator .breakdown-bar-bg { background: #dee2e6; }
body.light-mode .t-calculator .bar-contrib { background: linear-gradient(90deg, #c7d2fe, #0d21a1); }
body.light-mode .t-calculator .bar-drip { background: linear-gradient(90deg, #0d21a1, #8b5cf6); }
body.light-mode .t-calculator .bar-growth { background: linear-gradient(90deg, #8b5cf6, #a78bfa); }
body.light-mode .t-calculator .panel { background: #ffffff !important; border-color: #dee2e6 !important; }

/* ── Rebalancer ── */
body.light-mode .t-rebalancer input[type="number"],
body.light-mode .t-rebalancer input[type="text"] { background: #ffffff; border-color: #dee2e6; color: #212529; }
body.light-mode .t-rebalancer input[type="number"]:hover:not(:focus),
body.light-mode .t-rebalancer input[type="text"]:hover:not(:focus) { border-color: #ced4da; }
body.light-mode .t-rebalancer input:focus { box-shadow: 0 0 0 3px rgba(13,33,161,0.1); }
body.light-mode .t-rebalancer select { background: #ffffff; border-color: #dee2e6; color: #212529; }
body.light-mode .t-rebalancer select:hover { border-color: #ced4da; }
body.light-mode .t-rebalancer .panel { background: #ffffff; border-color: #dee2e6; }
body.light-mode .t-rebalancer .panel:hover { border-color: #ced4da; box-shadow: 0 10px 30px rgba(0,0,0,0.08); }
body.light-mode .t-rebalancer th { background: #f8f9fa; color: #6c757d; }
body.light-mode .t-rebalancer td { border-bottom-color: #dee2e6; color: #212529; }
body.light-mode .t-rebalancer tbody tr:hover { background: rgba(13,33,161,0.03) !important; }
body.light-mode .t-rebalancer .stat { background: #f8f9fa; border-color: #dee2e6; }
body.light-mode .t-rebalancer .stat.highlight { background: #eef2ff; border-color: #c7d2fe; }
body.light-mode .t-rebalancer .stat-label { color: #6c757d; }
body.light-mode .t-rebalancer .stat-value { color: #212529 !important; -webkit-text-fill-color: #212529 !important; }
body.light-mode .t-rebalancer .stat-value.green { color: #166534 !important; -webkit-text-fill-color: #166534 !important; }
body.light-mode .t-rebalancer .stat-value.red { color: #991b1b !important; -webkit-text-fill-color: #991b1b !important; }
body.light-mode .t-rebalancer .bar-track { background: #dee2e6; border-color: #ced4da; }
body.light-mode .t-rebalancer .bar-target-marker { background: #6c757d; }
body.light-mode .t-rebalancer button { border-color: #c7d2fe; background: rgba(13,33,161,0.06); color: #0d21a1; }
body.light-mode .t-rebalancer button:hover { background: rgba(13,33,161,0.12); }
body.light-mode .t-rebalancer button.ghost { border-color: #dee2e6; color: #6c757d; background: transparent; }
body.light-mode .t-rebalancer button.ghost:hover { color: #212529; border-color: #c7d2fe; }
body.light-mode .t-rebalancer .holdings-search { background: #ffffff; border-color: #dee2e6; color: #212529; }
body.light-mode .t-rebalancer .buy-amt { color: #166534 !important; }
body.light-mode .t-rebalancer .zero-amt { color: #adb5bd !important; }
body.light-mode .t-rebalancer .units-amt { color: #0d21a1 !important; }
body.light-mode .t-rebalancer .sleeve-bar-head .name { color: #212529; }
body.light-mode .t-rebalancer .sleeve-bar-head .pct  { color: #6c757d; }
body.light-mode .t-rebalancer .portfolio-tab { border-color: #dee2e6; color: #6c757d; }
body.light-mode .t-rebalancer .portfolio-tab:hover { border-color: #c7d2fe; color: #212529; }
body.light-mode .t-rebalancer .portfolio-tab.active { border-color: #0d21a1; background: rgba(13,33,161,0.08); color: #0d21a1; }
body.light-mode .t-rebalancer .tour-bubble { background: #ffffff; border-color: #0d21a1; }
body.light-mode .t-rebalancer .tour-btn { border-color: #c7d2fe; background: rgba(13,33,161,0.06); color: #0d21a1; }
body.light-mode .t-rebalancer .tour-btn:hover { background: rgba(13,33,161,0.12); }
body.light-mode .t-rebalancer .tour-btn.skip { border-color: #dee2e6; color: #6c757d; background: transparent; }

/* ── Scrollbar ── */
body.light-mode ::-webkit-scrollbar-track { background: #f8f9fa; }
body.light-mode ::-webkit-scrollbar-thumb { background: #ced4da; }
body.light-mode ::-webkit-scrollbar-thumb:hover { background: #adb5bd; }

/* ── Tracker light mode ── */
body.light-mode .t-tracker .sidebar {
  background: #ffffff;
  border-right-color: #dee2e6;
}
body.light-mode .t-tracker .sidebar::before {
  background: linear-gradient(90deg, #0d21a1, #8b5cf6, #166534, #0d21a1);
}
body.light-mode .t-tracker .topbar {
  background: #ffffff;
  border-bottom-color: #dee2e6;
}
body.light-mode .t-tracker .sb-title {
  background: linear-gradient(135deg, #0d21a1, #8b5cf6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
body.light-mode .t-tracker .nav-item { color: #6c757d; }
body.light-mode .t-tracker .nav-item:hover { background: rgba(13,33,161,0.04); color: #212529; }
body.light-mode .t-tracker .nav-item.active {
  color: #0d21a1; border-left-color: #0d21a1;
  background: rgba(13,33,161,0.07);
  box-shadow: inset 0 0 20px rgba(13,33,161,0.04);
}
body.light-mode .t-tracker .nav-item.predictor-item.active { color: #0d21a1; border-left-color: #0d21a1; background: rgba(13,33,161,0.07); }
body.light-mode .t-tracker .card {
  background: #ffffff;
  border-color: #dee2e6;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06);
}
body.light-mode .t-tracker .card:hover {
  box-shadow: 0 6px 24px rgba(0,0,0,0.1), 0 0 0 1px rgba(13,33,161,0.08);
}
body.light-mode .t-tracker .progress-wrap { background: #dee2e6; }
body.light-mode .t-tracker .progress-fill { box-shadow: none; }
body.light-mode .t-tracker .badge-green { background: rgba(22,101,52,0.1); }
body.light-mode .t-tracker .badge-red   { background: rgba(153,27,27,0.1); }
body.light-mode .t-tracker .badge-amber { background: rgba(180,83,9,0.1); }
body.light-mode .t-tracker .badge-blue  { background: rgba(13,33,161,0.1); }
body.light-mode .t-tracker .badge-muted { background: rgba(108,117,125,0.1); }
body.light-mode .t-tracker tr:hover td  { background: rgba(13,33,161,0.03); }
body.light-mode .t-tracker .search-input:focus { border-color: #0d21a1; box-shadow: 0 0 0 3px rgba(13,33,161,0.1); }
body.light-mode .t-tracker .alert-red   { background: rgba(153,27,27,0.05);  border-color: rgba(153,27,27,0.2); }
body.light-mode .t-tracker .alert-amber { background: rgba(180,83,9,0.05);   border-color: rgba(180,83,9,0.2); }
body.light-mode .t-tracker .alert-blue  { background: rgba(13,33,161,0.05);  border-color: rgba(13,33,161,0.2); }
body.light-mode .t-tracker .alert-green { background: rgba(22,101,52,0.05);  border-color: rgba(22,101,52,0.2); }
body.light-mode .t-tracker .pop-ticker  { background: #f8f9fa; border-color: #dee2e6; }
body.light-mode .t-tracker .pop-ticker:hover { border-color: #0d21a1; color: #0d21a1; background: rgba(13,33,161,0.05); }
body.light-mode .t-tracker .modal-input:focus { border-color: #0d21a1; box-shadow: 0 0 0 3px rgba(13,33,161,0.1); }
body.light-mode .t-tracker .btn-ghost { background: #f8f9fa; color: #6c757d; border-color: #dee2e6; }
body.light-mode .t-tracker .btn-ghost:hover { background: rgba(13,33,161,0.06); color: #212529; }
body.light-mode .t-tracker .icon-btn:hover { background: rgba(13,33,161,0.06); }

/* ── Screener / Trap Classifier light mode ── */
body.light-mode .t-screener .ticker-chip,
body.light-mode .dg-tool #tool-screener .ticker-chip {
  background: #e9ecef; color: #212529; border-color: #dee2e6;
}
body.light-mode .t-screener .ticker-chip:hover {
  background: rgba(13,33,161,0.08); color: #0d21a1; border-color: #c7d2fe;
}

/* ── Chart border fix ── */
body.light-mode canvas { filter: none; }

/* ── Screener example chips fix ── */
body.light-mode .t-screener .example-chip {
  background: #e9ecef;
  border-color: #dee2e6;
  color: #495057;
}
body.light-mode .t-screener .example-chip:hover {
  border-color: #8b5cf6;
  color: #8b5cf6;
}
body.light-mode .t-screener .spinner {
  border-color: rgba(13,33,161,0.15);
  border-top-color: #0d21a1;
}

/* ── Panel hard-coded fix ── */
body.light-mode [style*="background:#080c18"] { background: #ffffff !important; }

/* ── Light mode typography refinements ── */

/* כותרות סקשן — royal blue */
body.light-mode .t-tracker .topbar-title { color: #0d21a1; }
body.light-mode .t-tracker .card-title   { color: #6c757d; }

/* מספרים גדולים — כמעט שחור (לא שחור מלא) */
body.light-mode .t-tracker .metric-val { color: #212529; }

/* metric-val ירוק (income) → שמור ירוק */
body.light-mode .t-tracker .metric-val.green { color: #166534; }

/* כותרת goal progress גדולה */
body.light-mode #ov-goal-panel .metric-val { color: #0d21a1; }

/* Chart axis labels */
body.light-mode .t-tracker canvas {
  color: #6c757d;
}

/* Add Holding button — gradient לwhite text */
body.light-mode .t-tracker .btn-blue {
  background: linear-gradient(135deg, #0d21a1, #8b5cf6);
  color: #ffffff;
  border: none;
}

/* topbar meta text */
body.light-mode .t-tracker .topbar-meta { color: #6c757d; }

/* sector tag text */
body.light-mode .t-tracker .sector-tag { opacity: 0.85; }

/* ticker avatar */
body.light-mode .t-tracker .ticker-avatar { opacity: 0.9; }

/* ── Analyze button light mode fix ── */
body.light-mode .t-screener #analyze-btn { color: #ffffff; }

/* ── כותרות ראשיות נשארות כהות בlight mode ── */
body.light-mode .t-calculator h1,
body.light-mode .t-calculator h2,
body.light-mode .t-rebalancer h1,
body.light-mode .t-screener h1,
body.light-mode .t-screener h2 { color: #212529; }

/* ── טקסט לבן על רקע כחול — נשאר לבן ── */
body.light-mode .t-tracker .btn-blue,
body.light-mode .t-screener #analyze-btn,
body.light-mode .dg-tab.active { color: #ffffff; }

/* ── כותרות ראשיות — כחול רויאל (override) ── */
body.light-mode .t-calculator h1,
body.light-mode .t-calculator h2,
body.light-mode .t-rebalancer h1,
body.light-mode .t-screener h1,
body.light-mode .t-screener h2 { color: #0d21a1 !important; }

/* ── טאבים — תיקון (override) ── */
body.light-mode .dg-tab { color: #6c757d !important; }
body.light-mode .dg-tab:hover { color: #0d21a1 !important; }
body.light-mode .dg-tab.active { color: #0d21a1 !important; }
body.light-mode .dg-tab.active::after { background: #0d21a1 !important; }
body.light-mode .dg-tab.weapon { color: #8b5cf6 !important; }
body.light-mode .dg-tab.weapon.active { color: #8b5cf6 !important; }
body.light-mode .dg-tab.weapon.active::after { background: #8b5cf6 !important; }

/* ── Rebalancer panel headings fix ── */
body.light-mode .t-rebalancer .panel-heading { color: #0d21a1 !important; }
body.light-mode .t-rebalancer .panel-label { color: #8b5cf6 !important; }
body.light-mode .t-rebalancer .panel-title.sub .panel-heading { color: #6c757d !important; }

/* ══ GLASS PILL BUTTONS — light mode ═══════════════════════════ */
body.light-mode .t-tracker .btn-blue,
body.light-mode .t-screener #analyze-btn,
body.light-mode .t-rebalancer button:not(.ghost):not(.danger):not(.tour-btn):not(.mode-toggle) {
  background: linear-gradient(135deg, #0d21a1, #8b5cf6) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 999px !important;
  box-shadow: 0 4px 18px rgba(13,33,161,0.3), inset 0 1px 0 rgba(255,255,255,0.2) !important;
  position: relative;
  overflow: hidden;
}
body.light-mode .t-tracker .btn-blue::before,
body.light-mode .t-screener #analyze-btn::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0; height: 50%;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0) 100%);
  pointer-events: none;
  border-radius: 999px 999px 0 0;
}
body.light-mode .t-tracker .btn-blue:hover,
body.light-mode .t-screener #analyze-btn:hover {
  box-shadow: 0 8px 28px rgba(13,33,161,0.4), inset 0 1px 0 rgba(255,255,255,0.25) !important;
  transform: translateY(-2px);
}

/* Analyze button ב-screener — pill */
body.light-mode .t-screener #analyze-btn {
  border-radius: 999px !important;
}

/* כפתור toggle בheader */
body.light-mode #mode-toggle {
  background: linear-gradient(135deg, #0d21a1, #8b5cf6) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 999px !important;
  box-shadow: 0 4px 18px rgba(13,33,161,0.25) !important;
}

/* ══ LIGHT MODE FIXES — round 3 ═══════════════════════════════ */

/* ── ADD SLEEVE button ── */
body.light-mode .t-rebalancer button.small.ghost {
  background: linear-gradient(135deg, #0d21a1, #8b5cf6) !important;
  color: #ffffff !important;
  border: none !important;
  border-radius: 999px !important;
  box-shadow: 0 4px 18px rgba(13,33,161,0.25) !important;
}
body.light-mode .t-rebalancer button.small.ghost:hover {
  box-shadow: 0 8px 28px rgba(13,33,161,0.35) !important;
  transform: translateY(-2px);
}

/* ── Rebalancer table text ── */
body.light-mode .t-rebalancer table td,
body.light-mode .t-rebalancer table th { color: #0d21a1; }
body.light-mode .t-rebalancer .h-ticker { color: #0d21a1; font-weight: 700; }
body.light-mode .t-rebalancer .buy-row td { color: #166534 !important; }
body.light-mode .t-rebalancer select { color: #0d21a1; }
body.light-mode .t-rebalancer input[type="number"],
body.light-mode .t-rebalancer input[type="text"] { color: #0d21a1; }

/* ── Trap Classifier — rebuilt panels (light mode, match calculator) ── */
body.light-mode .t-screener .panel { background: #ffffff !important; border-color: #dee2e6 !important; }
body.light-mode .t-screener .panel-heading { color: #212529 !important; }
body.light-mode .t-screener .panel-label { color: #0d21a1 !important; }
body.light-mode .t-screener .ch-name { color: #0d21a1 !important; }
body.light-mode .t-screener .ch-price { color: #212529 !important; }
body.light-mode .t-screener .ch-ticker { background: #f8f9fa !important; border-color: #dee2e6 !important; color: #6c757d !important; }
body.light-mode .t-screener .vc-comp-item { background: #ffffff !important; border-color: #dee2e6 !important; }
body.light-mode .t-screener .vc-comp-name { color: #6c757d !important; }
body.light-mode .t-screener .vc-detail,
body.light-mode .t-screener .panel .vc-detail { color: #6c757d !important; }
body.light-mode .t-screener .trap-confidence { color: #6c757d !important; }
body.light-mode .t-screener .section-title { color: #0d21a1 !important; }
body.light-mode .t-screener .flag-card { background: #ffffff !important; border-color: #dee2e6 !important; }
body.light-mode .t-screener .flag-desc,
body.light-mode .t-screener .flag-card .flag-desc { color: #6c757d !important; }
body.light-mode .t-screener .flag-raw { background: #f8f9fa !important; border-color: #dee2e6 !important; color: #6c757d !important; }
body.light-mode .t-screener .no-flags { background: #ffffff !important; }
body.light-mode .t-screener .quality-score-den { color: #6c757d !important; }
body.light-mode .t-screener .loading-text,
body.light-mode .t-screener .error-title { color: #212529 !important; }

/* ── Trap Classifier q-items (Streak/Payout/FCF/Dividends) ── */
body.light-mode .t-screener .q-item {
  background: #ffffff !important;
  border-color: #dee2e6 !important;
}
body.light-mode .t-screener .q-item:hover { border-color: #c7d2fe !important; }
body.light-mode .t-screener .q-item-label { color: #6c757d !important; }
body.light-mode .t-screener .q-item-score { color: #0d21a1; }
body.light-mode .t-screener .q-item-bar { background: #dee2e6 !important; }

/* ── Stock Deep Dive text ── */
body.light-mode .t-screener .company-name,
body.light-mode .t-screener .ticker-symbol { color: #0d21a1 !important; }
body.light-mode .t-screener .price-display { color: #212529 !important; }
body.light-mode .t-screener .section-label { color: #6c757d !important; }
body.light-mode .t-screener .verdict-text { color: #0d21a1; }
body.light-mode .t-screener td,
body.light-mode .t-screener th { color: #0d21a1; }
body.light-mode .t-screener .forward-note { color: #6c757d !important; }
body.light-mode .t-screener .stat-card { background: #ffffff !important; border-color: #dee2e6 !important; }
body.light-mode .t-screener .stat-card .stat-label { color: #6c757d !important; }
body.light-mode .t-screener .stat-card .stat-value { color: #0d21a1 !important; }
body.light-mode .t-screener .risk-flag { background: #ffffff !important; border-color: #dee2e6 !important; }
body.light-mode .t-screener .flag-bar { background: #e9ecef !important; color: #6c757d !important; }

/* ══ LIGHT MODE FIXES — round 4 ═══════════════════════════════ */

/* ── Calculator inputs — text color ── */
body.light-mode .t-calculator input[type="number"] {
  background: #ffffff !important;
  color: #0d21a1 !important;
  border-color: #dee2e6 !important;
}

/* ── Calculator stat cards — רקע אחיד לבן ── */
body.light-mode .t-calculator .stat {
  background: #ffffff !important;
  border: 1px solid #dee2e6 !important;
}
body.light-mode .t-calculator .stat.highlight {
  background: #eef2ff !important;
  border-color: #c7d2fe !important;
}
body.light-mode .t-calculator .stat-value { color: #0d21a1 !important; }
body.light-mode .t-calculator .stat-label { color: #6c757d !important; }
body.light-mode .t-calculator .stat-sub   { color: #6c757d !important; }
body.light-mode .t-calculator .stat::before { display: none; }

/* ── Tracker metric cards — מספרים כחולים + רקע אחיד ── */
body.light-mode .t-tracker .card {
  background: #ffffff !important;
  border-color: #dee2e6 !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.06) !important;
}
body.light-mode .t-tracker .metric-val { color: #0d21a1 !important; }
body.light-mode .t-tracker .metric-val.green { color: #166534 !important; }
body.light-mode .t-tracker .metric-val.red   { color: #991b1b !important; }

/* ── Stock Deep Dive — stat cards מספרים ── */
body.light-mode .t-screener .stat-value,
body.light-mode .t-screener .stat-num { color: #0d21a1 !important; }
body.light-mode .t-screener .forward-estimates .stat-value { color: #212529 !important; }
body.light-mode .t-screener .forward-note-italic { color: #6c757d !important; }
body.light-mode .t-screener .eps-card,
body.light-mode .t-screener .forward-card { 
  background: #ffffff !important; 
  border-color: #dee2e6 !important; 
}
body.light-mode .t-screener .eps-label,
body.light-mode .t-screener .forward-label { color: #6c757d !important; }
body.light-mode .t-screener .eps-value,
body.light-mode .t-screener .forward-value { color: #212529 !important; }
body.light-mode .t-screener .eps-sub { color: #6c757d !important; }

/* ── Calculator highlight stats — לבן בlight mode ── */
body.light-mode .t-calculator .stat.highlight {
  background: #ffffff !important;
  border: 1px solid #dee2e6 !important;
}
body.light-mode .t-calculator .stat.inflation-stat {
  background: #ffffff !important;
  border: 1px solid #dee2e6 !important;
}

/* ── Feedback FAB + modal ─────────────────────────────────────────────────── */
.feedback-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 900;
  background: linear-gradient(135deg, #0d21a1, #8b5cf6);
  color: #fff; border: none; border-radius: 999px;
  padding: 11px 20px; font-size: 13px; font-weight: 600;
  font-family: 'Inter', sans-serif; cursor: pointer;
  box-shadow: 0 4px 20px rgba(13,33,161,0.35);
  transition: transform 0.12s ease, box-shadow 0.18s ease;
}
.feedback-fab:hover { transform: translateY(-2px); box-shadow: 0 8px 28px rgba(13,33,161,0.45); }

.feedback-overlay {
  display: none; position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,0.5); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  align-items: flex-end; justify-content: flex-end;
  padding: 0 24px 80px 0;
}
.feedback-overlay.open { display: flex; }
.feedback-overlay.open .feedback-modal {
  animation: modalIn 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}
.feedback-modal {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: 14px; padding: 22px; width: 340px; max-width: 95vw;
  box-shadow: 0 24px 80px rgba(0,0,0,0.6);
}
.feedback-modal-title {
  font-size: 15px; font-weight: 700; margin-bottom: 14px;
  background: linear-gradient(135deg, #0d21a1, #8b5cf6);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.feedback-textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 12px; color: var(--text);
  font-size: 13px; font-family: 'Inter', sans-serif;
  resize: vertical; min-height: 90px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.feedback-textarea:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,0.15); }
.feedback-email {
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 12px; color: var(--text);
  font-size: 13px; font-family: 'Inter', sans-serif; outline: none;
  margin-top: 8px; transition: border-color .2s, box-shadow .2s;
}
.feedback-email:focus { border-color: #8b5cf6; box-shadow: 0 0 0 3px rgba(139,92,246,0.15); }
.feedback-hp { position: absolute; left: -9999px; top: -9999px; opacity: 0; pointer-events: none; }
.feedback-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 12px; }
.feedback-submit {
  background: linear-gradient(135deg, #0d21a1, #8b5cf6);
  color: #fff; border: none; border-radius: 8px;
  padding: 9px 20px; font-size: 13px; font-weight: 600;
  font-family: 'Inter', sans-serif; cursor: pointer;
  transition: box-shadow 0.18s ease, transform 0.12s ease;
}
.feedback-submit:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(13,33,161,0.4); }
.feedback-submit:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }
.feedback-cancel {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 16px; font-size: 13px; font-weight: 600; color: var(--muted2);
  font-family: 'Inter', sans-serif; cursor: pointer; transition: background 0.15s;
}
.feedback-cancel:hover { background: rgba(139,92,246,0.08); }
.feedback-msg { font-size: 12px; min-height: 16px; margin-top: 6px; }
