:root {
    --bg-primary: #0a0c10;
    --bg-secondary: #10141b;
    --bg-tertiary: #171d27;
    --bg-glass: rgba(16, 20, 27, 0.88);
    --bg-glass-hover: rgba(23, 29, 39, 0.95);
    --border-subtle: rgba(255, 255, 255, 0.06);
    --border-medium: rgba(255, 255, 255, 0.10);
    --border-strong: rgba(255, 255, 255, 0.18);
    --text-primary: #e8eaf0;
    --text-secondary: #9aa2af;
    --text-muted: #e6c25a;
    --brand: #f5a524;
    --accent-blue: #4a9eff;
    --accent-purple: #9d7bff;
    --accent-green: #2ebd85;
    --accent-red: #f6465d;
    --accent-yellow: #facc15;
    --accent-orange: #fb923c;
    --accent-pink: #f472b6;
    --accent-teal: #2dd4bf;
    --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.35);
    --shadow-md: 0 4px 12px -2px rgba(0,0,0,0.35);
    --shadow-lg: 0 12px 32px -8px rgba(0,0,0,0.5);
    --shadow-glow-blue: none;
    --shadow-glow-green: none;
    --shadow-glow-red: none;
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', ui-monospace, 'Cascadia Mono', Menlo, monospace;
    --transition-fast: 120ms ease;
    --transition-base: 220ms ease;
  }
  [data-theme="light"] {
    --bg-primary: #f2f0eb;
    --bg-secondary: #ffffff;
    --bg-tertiary: #eae7df;
    --bg-glass: rgba(255,255,255,0.9);
    --bg-glass-hover: rgba(255,255,255,0.98);
    --border-subtle: rgba(25,27,32,0.08);
    --border-medium: rgba(25,27,32,0.14);
    --border-strong: rgba(25,27,32,0.22);
    --text-primary: #191b20;
    --text-secondary: #4d5361;
    --text-muted: #b8860b;
    --brand: #b97d0f;
    --accent-blue: #2563eb;
    --accent-purple: #7c5ce0;
    --accent-green: #0e9f6e;
    --accent-red: #e0314b;
    --accent-yellow: #ca8a04;
    --accent-orange: #ea580c;
    --accent-pink: #db2777;
    --accent-teal: #0d9488;
    --shadow-sm: 0 1px 2px 0 rgba(25,27,32,0.06);
    --shadow-md: 0 4px 12px -2px rgba(25,27,32,0.08);
    --shadow-lg: 0 12px 32px -8px rgba(25,27,32,0.12);
  }
  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
  html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
  body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.5;
    transition: background var(--transition-base), color var(--transition-base);
  }
  body::before {
    content: '';
    position: fixed; inset: 0; z-index: -1;
    background:
      radial-gradient(ellipse 70% 40% at 50% 0%, rgba(245,165,36,0.05), transparent),
      repeating-linear-gradient(to bottom, rgba(255,255,255,0.014) 0, rgba(255,255,255,0.014) 1px, transparent 1px, transparent 28px);
    pointer-events: none;
  }
  [data-theme="light"] body::before {
    background: radial-gradient(ellipse 70% 40% at 50% 0%, rgba(185,125,15,0.05), transparent);
  }
  ::-webkit-scrollbar { width: 5px; height: 5px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 3px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
  @keyframes slideUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
  @keyframes scaleIn { from { opacity: 0; transform: scale(0.97); } to { opacity: 1; transform: scale(1); } }
  @keyframes pulse { 0%,100% { opacity: 1; box-shadow: 0 0 0 0 rgba(46,189,133,0.4); } 50% { opacity: 0.6; box-shadow: 0 0 0 6px rgba(46,189,133,0); } }
  @keyframes shimmer { 0% { background-position: -200% 0; } 100% { background-position: 200% 0; } }
  @keyframes toastSlide { from { transform: translateX(-50%) translateY(-30px); opacity: 0; } to { transform: translateX(-50%) translateY(0); opacity: 1; } }
  @keyframes barGrow { from { transform: scaleX(0); } to { transform: scaleX(1); } }
  .animate-fade { animation: fadeIn 0.4s ease-out; }
  .animate-slide-up { animation: slideUp 0.4s cubic-bezier(0.16,1,0.3,1); }
  .animate-scale { animation: scaleIn 0.3s ease-out; }
  .dashboard { max-width: 1920px; margin: 0 auto; padding: 16px; padding-bottom: 100px; }
  @media (min-width: 768px) { .dashboard { padding: 24px; padding-bottom: 40px; } }

  /* === HEADER === */
  .header { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; padding: 16px 18px; background: var(--bg-glass); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); }
  .header-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; }
  .header-badges { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .header-actions-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  @media (min-width: 768px) { .header { flex-direction: row; flex-wrap: wrap; justify-content: space-between; align-items: center; } }
  .brand { display: flex; align-items: center; gap: 12px; }
  .brand-icon { width: 40px; height: 40px; border-radius: 9px; background: var(--brand); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .brand-icon svg { display: block; }
  .brand-text h1 { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; color: var(--text-primary); display: flex; align-items: center; gap: 10px; }
  @media (min-width: 768px) { .brand-text h1 { font-size: 24px; } }
  .brand-ver { font-family: var(--font-mono); font-size: 10px; font-weight: 700; color: var(--brand); border: 1px solid rgba(245,165,36,0.35); padding: 2px 7px; border-radius: 4px; letter-spacing: 0.5px; }
  [data-theme="light"] .brand-ver { border-color: rgba(185,125,15,0.4); }
  .brand-text p { font-size: 13px; color: var(--text-secondary); margin-top: 2px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
  .version-badge { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 4px; font-size: 10px; font-weight: 700; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.6px; background: transparent; border: 1px solid var(--border-medium); color: var(--text-secondary); }
  .version-badge.news { border-color: rgba(46,189,133,0.3); color: var(--accent-green); }
  .version-badge.fund { border-color: rgba(45,212,191,0.3); color: var(--accent-teal); }
  .version-badge.cot { border-color: rgba(157,123,255,0.3); color: var(--accent-purple); }
  .header-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

  /* === BUTTONS === */
  .btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 8px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-medium); background: transparent; color: var(--text-secondary); font-size: 13px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all var(--transition-fast); white-space: nowrap; }
  .btn:hover { background: var(--bg-tertiary); border-color: var(--border-strong); color: var(--text-primary); }
  .btn:active { transform: translateY(1px); }
  .btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; box-shadow: none; }
  .btn-primary { background: var(--brand); border-color: transparent; color: #0d0f13; font-weight: 700; }
  .btn-primary:hover { background: var(--brand); filter: brightness(1.1); color: #0d0f13; box-shadow: none; }
  .btn-icon { padding: 8px; aspect-ratio: 1; }
  .btn-sm { padding: 6px 10px; font-size: 12px; }

  /* === TABS === */
  .tabs-desktop { display: none; gap: 2px; flex-wrap: nowrap; width: 100%; border-top: 1px solid var(--border-subtle); padding-top: 10px; overflow-x: auto; scrollbar-width: none; }
  @media (min-width: 1024px) { .tabs-desktop { display: flex; } }
  .tab-btn { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; white-space: nowrap; border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent; color: var(--text-muted); font-size: 12.5px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all var(--transition-fast); position: relative; }
  .tab-btn .tic { display: inline-flex; }
  .tab-btn .tic svg { width: 15px; height: 15px; display: block; }
  .tab-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.03); }
  [data-theme="light"] .tab-btn:hover { background: rgba(25,27,32,0.04); }
  .tab-btn.active { color: var(--brand); background: rgba(245,165,36,0.07); border-color: transparent; box-shadow: none; }
  [data-theme="light"] .tab-btn.active { background: rgba(185,125,15,0.08); }
  .tab-btn.active::after { content: ''; position: absolute; bottom: -1px; left: 10px; right: 10px; height: 2px; border-radius: 2px; background: var(--brand); }

  /* === MOBILE NAV === */
  .mobile-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 100; background: var(--bg-glass); backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px); border-top: 1px solid var(--border-subtle); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); display: flex; justify-content: flex-start; align-items: center; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch; gap: 2px; }
  .mobile-nav::-webkit-scrollbar { display: none; }
  .tabs-desktop::-webkit-scrollbar { display: none; }
  @media (min-width: 1024px) { .mobile-nav { display: none; } }
  .mobile-nav-item { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 5px 6px; border-radius: var(--radius-sm); border: none; background: transparent; color: var(--text-muted); font-size: 9px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all var(--transition-fast); flex-shrink: 0; min-width: 52px; }
  .mobile-nav-item .nav-icon { display: flex; transition: transform var(--transition-fast); }
  .mobile-nav-item .nav-icon svg { width: 19px; height: 19px; display: block; }
  .mobile-nav-item:hover .nav-icon { transform: translateY(-2px); }
  .mobile-nav-item.active { color: var(--brand); }
  .mobile-nav-item.active .nav-icon { transform: translateY(-2px); }

  /* === CARDS === */
  .card { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 18px; transition: border-color var(--transition-base); animation: slideUp 0.4s cubic-bezier(0.16,1,0.3,1) both; }
  .card:hover { border-color: var(--border-medium); }
  .card-header { display: flex; justify-content: space-between; align-items: center; padding: 0 0 12px; margin: 0 0 14px; border-bottom: 1px solid var(--border-subtle); }
  .card-title { font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; display: flex; align-items: center; gap: 9px; color: var(--text-muted); }
  .card-title-accent { color: var(--brand); }
  .card-title::before { content: ''; width: 8px; height: 8px; border-radius: 2px; background: var(--brand); flex-shrink: 0; }
  .card-title .icon { display: none; }
  .grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
  @media (min-width: 640px) { .grid { grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); } }
  @media (min-width: 1024px) { .grid-2 { grid-template-columns: repeat(2, 1fr); } }
  @media (min-width: 1024px) { .grid-3 { grid-template-columns: repeat(3, 1fr); } }
  @media (min-width: 1280px) { .grid-4 { grid-template-columns: repeat(4, 1fr); } }

  /* === RATES === */
  .rate-row { display: flex; justify-content: space-between; align-items: center; padding: 5px 10px 5px 12px; border-bottom: 1px solid var(--border-subtle); transition: background var(--transition-fast); }
  .rate-row:last-child { border-bottom: none; }
  .rate-row:hover { background: rgba(255,255,255,0.02); }
  .rate-row.row-up { background: rgba(52,197,94,0.10); box-shadow: inset 3px 0 0 var(--accent-green); }
  .rate-row.row-down { background: rgba(239,68,68,0.10); box-shadow: inset 3px 0 0 var(--accent-red); }
  .rate-dir { font-size: 10px; margin-left: 5px; }
  .rate-dir.up { color: var(--accent-green); }
  .rate-dir.down { color: var(--accent-red); }
  [data-theme="light"] .rate-row:hover { background: rgba(25,27,32,0.03); }
  .rate-pair { font-weight: 700; font-size: 13px; color: var(--text-primary); display: inline-flex; align-items: center; gap: 7px; }
  .rate-value { font-weight: 700; font-size: 15px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-primary); letter-spacing: -0.01em; }
  .rate-value.stale { color: var(--accent-red); opacity: 0.7; }
  .rate-value.loading { color: var(--text-muted); }
  .rate-delta { font-size: 11px; margin-left: 6px; font-weight: 600; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

  /* === BADGES === */
  .badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 9px; border-radius: 4px; font-size: 10px; font-weight: 700; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.5px; border: 1px solid transparent; }
  .badge-green { background: rgba(46,189,133,0.09); color: var(--accent-green); border-color: rgba(46,189,133,0.22); }
  .badge-red { background: rgba(246,70,93,0.09); color: var(--accent-red); border-color: rgba(246,70,93,0.22); }
  .badge-yellow { background: rgba(250,204,21,0.09); color: var(--accent-yellow); border-color: rgba(250,204,21,0.22); }
  .badge-blue { background: rgba(74,158,255,0.09); color: var(--accent-blue); border-color: rgba(74,158,255,0.22); }
  .badge-purple { background: rgba(157,123,255,0.09); color: var(--accent-purple); border-color: rgba(157,123,255,0.22); }
  .badge-teal { background: rgba(45,212,191,0.09); color: var(--accent-teal); border-color: rgba(45,212,191,0.22); }
  .badge-pink { background: rgba(244,114,182,0.09); color: var(--accent-pink); border-color: rgba(244,114,182,0.22); }
  .live-indicator { display: inline-flex; align-items: center; gap: 8px; }
  .live-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent-green); animation: pulse 2s infinite; }
  .api-status { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: var(--radius-sm); font-size: 11px; font-weight: 700; font-family: var(--font-mono); letter-spacing: 0.3px; border: 1px solid transparent; }
  .api-status.ok { background: rgba(46,189,133,0.09); color: var(--accent-green); border-color: rgba(46,189,133,0.25); }
  .api-status.error { background: rgba(246,70,93,0.09); color: var(--accent-red); border-color: rgba(246,70,93,0.25); }
  .api-status.loading { background: rgba(74,158,255,0.09); color: var(--accent-blue); border-color: rgba(74,158,255,0.25); }
  .api-status.stale { background: rgba(250,204,21,0.09); color: var(--accent-yellow); border-color: rgba(250,204,21,0.25); }

  /* === SKELETON / INFO === */
  .skeleton { background: linear-gradient(90deg, var(--bg-tertiary) 25%, var(--border-medium) 50%, var(--bg-tertiary) 75%); background-size: 200% 100%; animation: shimmer 1.5s infinite; border-radius: var(--radius-sm); }
  .skeleton-text { height: 14px; margin-bottom: 8px; }
  .skeleton-row { height: 40px; margin-bottom: 8px; }
  .skeleton-title { height: 18px; width: 55%; margin: 0 auto 10px; }
  .info-box { padding: 12px 14px; background: var(--bg-secondary); border-radius: var(--radius-md); margin-top: 4px; border: 1px solid var(--border-subtle); }
  .info-box-title { font-size: 12px; color: var(--brand); font-weight: 700; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
  .info-box-text { font-size: 12px; color: var(--text-secondary); line-height: 1.6; }
  .info-box-text + .info-box-text { margin-top: 4px; }
  .stale-notice { background: rgba(250,204,21,0.07); border: 1px solid rgba(250,204,21,0.22); border-radius: var(--radius-md); padding: 12px 16px; margin-bottom: 16px; font-size: 13px; color: var(--accent-yellow); text-align: center; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 8px; animation: slideDown 0.3s ease; }
  .stale-notice.hidden { display: none; }

  /* === TABLES === */
  .table-wrapper { overflow-x: auto; border-radius: 0; border: none; }
  .calendar-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
  .calendar-table thead th { position: sticky; top: 0; z-index: 10; background: var(--bg-secondary); text-align: left; padding: 10px 14px; font-size: 10px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; border-bottom: 1px solid var(--border-medium); white-space: nowrap; }
  .calendar-table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border-subtle); transition: background var(--transition-fast); }
  .calendar-table tbody tr:last-child td { border-bottom: none; }
  .calendar-table tbody tr:hover td { background: rgba(245,165,36,0.03); }
  [data-theme="light"] .calendar-table tbody tr:hover td { background: rgba(185,125,15,0.05); }
  .impact-dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
  .impact-high { background: var(--accent-red); box-shadow: 0 0 8px rgba(246,70,93,0.5); }
  .impact-med { background: var(--accent-yellow); }
  .impact-low { background: var(--accent-blue); }
  .calendar-time { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-primary); font-weight: 600; font-size: 12px; }
  .calendar-currency { font-weight: 800; font-size: 12px; color: var(--text-primary); font-family: var(--font-mono); }
  .calendar-event { color: var(--text-primary); font-weight: 500; }
  .calendar-forecast { color: var(--text-muted); font-size: 12px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .calendar-actual { font-weight: 700; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .calendar-countdown { font-size: 11px; font-family: var(--font-mono); font-weight: 600; font-variant-numeric: tabular-nums; }
  .calendar-countdown.soon { color: var(--accent-red); }
  .calendar-countdown.upcoming { color: var(--accent-yellow); }
  .calendar-countdown.past { color: var(--text-muted); }

  /* === SIGNALS === */
  .signal-card { position: relative; border-radius: var(--radius-lg); padding: 18px 18px 18px 20px; background: var(--bg-secondary); border: 1px solid var(--border-subtle); overflow: hidden; transition: border-color var(--transition-base); animation: slideUp 0.4s cubic-bezier(0.16,1,0.3,1) both; }
  .signal-card::before { content: ''; position: absolute; top: 0; bottom: 0; left: 0; width: 3px; }
  .signal-card:hover { border-color: var(--border-medium); }
  .signal-card.pokupka::before { background: var(--accent-green); }
  .signal-card.prodazha::before { background: var(--accent-red); }
  .signal-card.ozhidanie::before { background: var(--accent-yellow); }
  .signal-card.uderzhanie::before { background: var(--accent-purple); }
  .signal-card.pokupka { border-color: rgba(46,189,133,0.18); }
  .signal-card.prodazha { border-color: rgba(246,70,93,0.18); }
  .signal-card.ozhidanie { border-color: rgba(250,204,21,0.15); }
  .signal-card.uderzhanie { border-color: rgba(157,123,255,0.18); }
  .signal-card.expired { opacity: 0.55; filter: grayscale(0.4); }
  .signal-card.expired .signal-badge { background: rgba(100,116,139,0.15) !important; color: var(--text-muted) !important; border-color: rgba(100,116,139,0.3) !important; }
  .signal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
  .signal-pair { font-size: 17px; font-weight: 800; letter-spacing: -0.01em; color: var(--text-primary); font-family: var(--font-mono); }
  .signal-badge { font-size: 10px; padding: 4px 12px; border-radius: 4px; font-weight: 800; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.6px; }
  .signal-card.pokupka .signal-badge { background: rgba(46,189,133,0.12); color: var(--accent-green); border: 1px solid rgba(46,189,133,0.25); }
  .signal-card.prodazha .signal-badge { background: rgba(246,70,93,0.12); color: var(--accent-red); border: 1px solid rgba(246,70,93,0.25); }
  .signal-card.ozhidanie .signal-badge { background: rgba(250,204,21,0.12); color: var(--accent-yellow); border: 1px solid rgba(250,204,21,0.25); }
  .signal-card.uderzhanie .signal-badge { background: rgba(157,123,255,0.12); color: var(--accent-purple); border: 1px solid rgba(157,123,255,0.25); }
  .signal-rate { font-size: 21px; font-weight: 700; font-family: var(--font-mono); font-variant-numeric: tabular-nums; margin-bottom: 10px; letter-spacing: -0.01em; }
  .signal-note { font-size: 13px; color: var(--text-secondary); line-height: 1.6; }
  .signal-levels { display: flex; gap: 16px; margin-top: 12px; font-size: 12px; color: var(--text-muted); font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .signal-levels strong { color: var(--text-primary); font-weight: 700; }
  .risk-indicator { display: inline-flex; align-items: center; gap: 8px; font-size: 11px; margin-top: 10px; font-weight: 600; }
  .risk-indicator.critical { color: var(--accent-red); }
  .risk-indicator.elevated { color: var(--accent-yellow); }
  .risk-indicator.normal { color: var(--accent-green); }
  .risk-bar { width: 50px; height: 4px; background: var(--bg-tertiary); border-radius: 2px; overflow: hidden; }
  .risk-bar-fill { height: 100%; border-radius: 2px; transition: width 0.5s ease; }
  .risk-bar-fill.critical { width: 100%; background: var(--accent-red); }
  .risk-bar-fill.elevated { width: 60%; background: var(--accent-yellow); }
  .risk-bar-fill.normal { width: 30%; background: var(--accent-green); }
  .confidence-badge { font-size: 9px; padding: 3px 8px; border-radius: 3px; font-weight: 700; font-family: var(--font-mono); margin-left: 8px; text-transform: uppercase; letter-spacing: 0.6px; }
  .confidence-high { background: rgba(46,189,133,0.12); color: var(--accent-green); border: 1px solid rgba(46,189,133,0.22); }
  .confidence-medium { background: rgba(74,158,255,0.12); color: var(--accent-blue); border: 1px solid rgba(74,158,255,0.22); }
  .confidence-low { background: rgba(250,204,21,0.12); color: var(--accent-yellow); border: 1px solid rgba(250,204,21,0.22); }
  .confidence-blocked { background: rgba(246,70,93,0.12); color: var(--accent-red); border: 1px solid rgba(246,70,93,0.22); }
  .sl-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 3px; font-size: 10px; font-weight: 700; font-family: var(--font-mono); margin-left: 6px; }
  .sl-badge.positive { background: rgba(46,189,133,0.1); color: var(--accent-green); border: 1px solid rgba(46,189,133,0.22); }
  .sl-badge.negative { background: rgba(246,70,93,0.1); color: var(--accent-red); border: 1px solid rgba(246,70,93,0.22); }
  .sl-badge.neutral { background: rgba(74,158,255,0.1); color: var(--accent-blue); border: 1px solid rgba(74,158,255,0.22); }
  .sl-info { margin-top: 8px; padding: 8px 12px; background: rgba(157,123,255,0.05); border-radius: var(--radius-sm); border: 1px solid rgba(157,123,255,0.15); font-size: 12px; color: var(--text-secondary); }
  .sl-info strong { color: var(--accent-purple); }
  .source-badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 3px; font-size: 9px; font-weight: 700; font-family: var(--font-mono); margin-left: 8px; text-transform: uppercase; }
  .source-badge.mt5 { background: rgba(46,189,133,0.1); color: var(--accent-green); border: 1px solid rgba(46,189,133,0.22); }
  .source-badge.ff { background: rgba(74,158,255,0.1); color: var(--accent-blue); border: 1px solid rgba(74,158,255,0.22); }
  .source-badge.mixed { background: rgba(250,204,21,0.1); color: var(--accent-yellow); border: 1px solid rgba(250,204,21,0.22); }
  .news-warning { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 10px 14px; background: rgba(246,70,93,0.05); border-radius: var(--radius-sm); border: 1px solid rgba(246,70,93,0.15); font-size: 12px; }
  .news-warning.medium { background: rgba(250,204,21,0.05); border-color: rgba(250,204,21,0.15); }
  .news-warning.recent { background: rgba(157,123,255,0.05); border-color: rgba(157,123,255,0.15); }
  .news-warning-icon { font-size: 16px; flex-shrink: 0; }
  .news-warning-text { color: var(--accent-red); font-weight: 500; }
  .news-warning.medium .news-warning-text { color: var(--accent-yellow); }
  .news-warning.recent .news-warning-text { color: var(--accent-purple); }

  /* === FUNDAMENTAL === */
  .fund-card { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 18px; transition: border-color var(--transition-base); animation: slideUp 0.4s cubic-bezier(0.16,1,0.3,1) both; }
  .fund-card:hover { border-color: var(--border-medium); }
  .fund-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
  .fund-currency { font-size: 18px; font-weight: 800; color: var(--text-primary); font-family: var(--font-mono); }
  .fund-score { font-size: 24px; font-weight: 700; font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
  .fund-score.strong { color: var(--accent-green); }
  .fund-score.moderate { color: var(--accent-blue); }
  .fund-score.weak { color: var(--accent-red); }
  .fund-metric { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border-subtle); font-size: 13px; }
  .fund-metric:last-child { border-bottom: none; }
  .fund-metric-label { color: var(--text-muted); }
  .fund-metric-value { font-weight: 700; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .fund-pair-card { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 12px; transition: border-color var(--transition-base); }
  .fund-pair-card:hover { border-color: var(--border-medium); }
  .fund-pair-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
  .fund-pair-name { font-size: 15px; font-weight: 800; font-family: var(--font-mono); }
  .fund-pair-bias { font-size: 10px; padding: 4px 12px; border-radius: 4px; font-weight: 700; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.5px; }
  .fund-pair-bias.strong_bullish { background: rgba(46,189,133,0.14); color: var(--accent-green); border: 1px solid rgba(46,189,133,0.25); }
  .fund-pair-bias.bullish { background: rgba(46,189,133,0.09); color: var(--accent-green); border: 1px solid rgba(46,189,133,0.18); }
  .fund-pair-bias.slightly_bullish { background: rgba(46,189,133,0.05); color: #6ee7b7; border: 1px solid rgba(46,189,133,0.12); }
  .fund-pair-bias.neutral { background: rgba(250,204,21,0.09); color: var(--accent-yellow); border: 1px solid rgba(250,204,21,0.16); }
  .fund-pair-bias.slightly_bearish { background: rgba(246,70,93,0.05); color: #fda4af; border: 1px solid rgba(246,70,93,0.12); }
  .fund-pair-bias.bearish { background: rgba(246,70,93,0.09); color: var(--accent-red); border: 1px solid rgba(246,70,93,0.18); }
  .fund-pair-bias.strong_bearish { background: rgba(246,70,93,0.14); color: var(--accent-red); border: 1px solid rgba(246,70,93,0.25); }
  .fund-detail-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 12px; color: var(--text-muted); }
  .fund-detail-row strong { color: var(--text-primary); font-weight: 700; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

  /* === COT === */
  .cot-card { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 12px; transition: border-color var(--transition-base); animation: slideUp 0.4s cubic-bezier(0.16,1,0.3,1) both; }
  .cot-card:hover { border-color: var(--border-medium); }
  .cot-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
  .cot-currency { font-size: 17px; font-weight: 800; color: var(--text-primary); font-family: var(--font-mono); }
  .cot-sentiment { font-size: 10px; padding: 4px 12px; border-radius: 4px; font-weight: 700; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.5px; }
  .cot-sentiment.strong_bullish { background: rgba(46,189,133,0.16); color: var(--accent-green); border: 1px solid rgba(46,189,133,0.3); }
  .cot-sentiment.bullish { background: rgba(46,189,133,0.1); color: var(--accent-green); border: 1px solid rgba(46,189,133,0.2); }
  .cot-sentiment.slightly_bullish { background: rgba(46,189,133,0.05); color: #6ee7b7; border: 1px solid rgba(46,189,133,0.12); }
  .cot-sentiment.neutral { background: rgba(250,204,21,0.09); color: var(--accent-yellow); border: 1px solid rgba(250,204,21,0.16); }
  .cot-sentiment.slightly_bearish { background: rgba(246,70,93,0.05); color: #fda4af; border: 1px solid rgba(246,70,93,0.12); }
  .cot-sentiment.bearish { background: rgba(246,70,93,0.1); color: var(--accent-red); border: 1px solid rgba(246,70,93,0.2); }
  .cot-sentiment.strong_bearish { background: rgba(246,70,93,0.16); color: var(--accent-red); border: 1px solid rgba(246,70,93,0.3); }
  .cot-bar-container { display: flex; height: 26px; border-radius: var(--radius-sm); overflow: hidden; background: var(--bg-tertiary); margin: 8px 0; position: relative; }
  .cot-bar { display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 800; font-family: var(--font-mono); color: rgba(255,255,255,0.9); transition: width 0.6s cubic-bezier(0.16,1,0.3,1); }
  .cot-bar-long { background: var(--accent-green); }
  .cot-bar-short { background: var(--accent-red); }
  .cot-metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 12px; }
  @media (min-width: 640px) { .cot-metric-grid { grid-template-columns: repeat(4, 1fr); } }
  .cot-metric { background: var(--bg-primary); padding: 10px; border-radius: var(--radius-sm); text-align: center; border: 1px solid var(--border-subtle); }
  .cot-metric-label { font-size: 9px; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.6px; font-weight: 700; }
  .cot-metric-value { font-size: 14px; font-weight: 700; margin-top: 4px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .cot-change { font-size: 11px; margin-top: 4px; font-weight: 600; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .cot-change.up { color: var(--accent-green); }
  .cot-change.down { color: var(--accent-red); }
  .cot-pair-card { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 18px; margin-bottom: 12px; transition: border-color var(--transition-base); }
  .cot-pair-card:hover { border-color: var(--border-medium); }
  .cot-pair-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
  .cot-pair-name { font-size: 15px; font-weight: 800; font-family: var(--font-mono); }
  .cot-net-bar { height: 6px; border-radius: 3px; background: var(--bg-tertiary); overflow: hidden; margin-top: 8px; position: relative; }
  .cot-net-fill { height: 100%; border-radius: 3px; transition: width 0.6s cubic-bezier(0.16,1,0.3,1); }
  .cot-net-center { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--text-muted); }

  /* === HISTORY === */
  .history-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 20px; }
  @media (min-width: 640px) { .history-stats { grid-template-columns: repeat(6, 1fr); } }
  .history-stat-card { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-md); padding: 14px 10px; text-align: center; transition: border-color var(--transition-base); }
  .history-stat-card:hover { border-color: var(--border-medium); }
  .history-stat-value { font-size: 20px; font-weight: 700; font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
  .history-stat-label { font-size: 9px; color: var(--text-muted); margin-top: 4px; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; }
  .history-stat-card.total .history-stat-value { color: var(--accent-blue); }
  .history-stat-card.buy .history-stat-value { color: var(--accent-green); }
  .history-stat-card.sell .history-stat-value { color: var(--accent-red); }
  .history-stat-card.hold .history-stat-value { color: var(--accent-purple); }
  .history-stat-card.blocked .history-stat-value { color: var(--accent-yellow); }
  .history-stat-card.recent .history-stat-value { color: var(--accent-pink); }
  .history-filters { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; align-items: center; }
  .history-filter-select, .history-search { padding: 8px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-medium); background: var(--bg-secondary); color: var(--text-primary); font-size: 13px; font-family: inherit; transition: all var(--transition-fast); }
  .history-filter-select:focus, .history-search:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 2px rgba(245,165,36,0.15); }
  .history-search { width: 200px; }
  .history-search::placeholder { color: var(--text-muted); }
  .history-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
  .history-table th { position: sticky; top: 0; z-index: 10; background: var(--bg-secondary); text-align: left; padding: 10px 12px; font-size: 10px; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.8px; border-bottom: 1px solid var(--border-medium); }
  .history-table td { padding: 10px 12px; border-bottom: 1px solid var(--border-subtle); vertical-align: middle; transition: background var(--transition-fast); }
  .history-table tbody tr:hover td { background: rgba(245,165,36,0.03); }
  [data-theme="light"] .history-table tbody tr:hover td { background: rgba(185,125,15,0.05); }
  .history-table tr.pokupka td { border-left: 2px solid var(--accent-green); }
  .history-table tr.prodazha td { border-left: 2px solid var(--accent-red); }
  .history-table tr.uderzhanie td { border-left: 2px solid var(--accent-purple); }
  .history-table tr.ozhidanie td { border-left: 2px solid var(--accent-yellow); }
  .history-time { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--text-muted); font-size: 11px; }
  .history-pair { font-weight: 800; font-size: 13px; color: var(--text-primary); font-family: var(--font-mono); }
  .history-direction { font-size: 9px; padding: 3px 10px; border-radius: 3px; font-weight: 800; font-family: var(--font-mono); display: inline-block; text-transform: uppercase; letter-spacing: 0.6px; }
  .history-direction.pokupka { background: rgba(46,189,133,0.12); color: var(--accent-green); border: 1px solid rgba(46,189,133,0.22); }
  .history-direction.prodazha { background: rgba(246,70,93,0.12); color: var(--accent-red); border: 1px solid rgba(246,70,93,0.22); }
  .history-direction.uderzhanie { background: rgba(157,123,255,0.12); color: var(--accent-purple); border: 1px solid rgba(157,123,255,0.22); }
  .history-direction.ozhidanie { background: rgba(250,204,21,0.12); color: var(--accent-yellow); border: 1px solid rgba(250,204,21,0.22); }
  .history-confidence { font-size: 9px; padding: 2px 6px; border-radius: 3px; font-weight: 700; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.4px; }
  .history-confidence.high { background: rgba(46,189,133,0.12); color: var(--accent-green); }
  .history-confidence.medium { background: rgba(74,158,255,0.12); color: var(--accent-blue); }
  .history-confidence.low { background: rgba(250,204,21,0.12); color: var(--accent-yellow); }
  .history-confidence.blocked { background: rgba(246,70,93,0.12); color: var(--accent-red); }
  .history-risk { font-size: 10px; font-weight: 700; font-family: var(--font-mono); }
  .history-risk.normal { color: var(--accent-green); }
  .history-risk.elevated { color: var(--accent-yellow); }
  .history-risk.critical { color: var(--accent-red); }
  .history-rate { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 700; }
  .history-note { font-size: 11px; color: var(--text-muted); max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .history-note:hover { white-space: normal; overflow: visible; }
  .history-fund { font-size: 10px; font-weight: 700; font-family: var(--font-mono); }
  .history-fund.bullish { color: var(--accent-green); }
  .history-fund.bearish { color: var(--accent-red); }
  .history-fund.neutral { color: var(--accent-yellow); }
  .history-cot { font-size: 10px; color: var(--text-muted); font-family: var(--font-mono); }
  .history-pagination { display: flex; justify-content: center; gap: 6px; margin-top: 16px; }
  .history-page-btn { padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-medium); background: transparent; color: var(--text-muted); font-size: 12px; font-weight: 600; font-family: var(--font-mono); cursor: pointer; transition: all var(--transition-fast); }
  .history-page-btn:hover { background: var(--bg-tertiary); color: var(--text-primary); }
  .history-page-btn.active { background: rgba(245,165,36,0.08); color: var(--brand); border-color: rgba(245,165,36,0.35); }
  .history-page-btn:disabled { opacity: 0.3; cursor: not-allowed; }
  .history-empty { text-align: center; padding: 60px 20px; color: var(--text-muted); }
  .history-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.4; }
  .history-chart-bar { display: flex; align-items: flex-end; gap: 2px; height: 60px; padding: 8px 0; }
  .history-chart-bar-item { flex: 1; min-width: 3px; border-radius: 1px 1px 0 0; transition: all var(--transition-fast); }
  .history-chart-bar-item:hover { opacity: 0.75; }
  .history-mini-chart { background: var(--bg-secondary); border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); padding: 16px; margin-bottom: 16px; }
  .history-mini-chart-title { font-size: 10px; color: var(--text-muted); margin-bottom: 8px; text-transform: uppercase; letter-spacing: 0.8px; font-weight: 700; }

  /* === CALENDAR FILTERS === */
  .calendar-filters { display: flex; gap: 6px; margin-bottom: 16px; flex-wrap: wrap; }
  .calendar-filter-btn { padding: 6px 14px; border-radius: var(--radius-sm); border: 1px solid var(--border-medium); background: transparent; color: var(--text-muted); font-size: 12px; font-weight: 600; font-family: inherit; cursor: pointer; transition: all var(--transition-fast); }
  .calendar-filter-btn:hover { border-color: var(--border-strong); color: var(--text-primary); background: var(--bg-tertiary); }
  .calendar-filter-btn.active { background: rgba(245,165,36,0.08); color: var(--brand); border-color: rgba(245,165,36,0.35); box-shadow: none; }

  /* === SECTIONS === */
  .section-header { margin-bottom: 20px; }
  .section-header h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; margin: 0; color: var(--text-primary); display: flex; align-items: center; gap: 11px; }
  .section-header h2::before { content: ''; width: 10px; height: 10px; border-radius: 2px; background: var(--brand); flex-shrink: 0; }
  @media (min-width: 768px) { .section-header h2 { font-size: 23px; } }
  .section-header p { margin: 6px 0 0; color: var(--text-secondary); font-size: 13px; }
  .tab-content { display: none; animation: fadeIn 0.25s ease; }
  .tab-content.active { display: block; }
  #fx-toast { position: fixed; top: 20px; left: 50%; z-index: 9999; transform: translateX(-50%); padding: 13px 22px; border-radius: var(--radius-md); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); border: 1px solid var(--border-medium); background: var(--bg-secondary); color: var(--text-primary); animation: toastSlide 0.3s ease; max-width: 90vw; word-break: break-word; }
  .disclaimer { margin-top: 24px; padding: 16px; background: var(--bg-secondary); border-radius: var(--radius-md); text-align: center; border: 1px solid var(--border-subtle); font-size: 12px; color: var(--text-muted); }
  .mini-event { display: flex; justify-content: space-between; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--border-subtle); transition: background var(--transition-fast); }
  .mini-event:last-child { border-bottom: none; }
  .mini-event:hover { background: rgba(255,255,255,0.02); }
  .mini-event-time { font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--accent-red); font-weight: 600; font-size: 12px; }
  .theme-toggle { position: relative; width: 40px; height: 22px; border-radius: 11px; border: 1px solid var(--border-medium); background: var(--bg-tertiary); cursor: pointer; transition: all var(--transition-fast); flex-shrink: 0; }
  .theme-toggle::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--brand); transition: all var(--transition-fast); }
  [data-theme="light"] .theme-toggle::after { left: 21px; }
  .settings-switch { position: relative; width: 40px; height: 22px; border-radius: 11px; border: 1px solid var(--border-medium); background: var(--bg-tertiary); cursor: pointer; transition: all var(--transition-fast); flex-shrink: 0; }
  .settings-switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 14px; height: 14px; border-radius: 50%; background: var(--text-muted); transition: all var(--transition-fast); }
  .settings-switch.on { background: rgba(34,197,94,0.18); border-color: rgba(34,197,94,0.55); }
  .settings-switch.on::after { left: 21px; background: var(--accent-green); }
  .sparkline-wrap { display: flex; align-items: center; gap: 6px; margin-left: auto; }
    @media (max-width: 1023px) { .dashboard { padding-bottom: 90px; } .section-header { flex-direction: column; gap: 12px; } .header-actions { width: 100%; justify-content: space-between; } .history-search { width: 100%; } }
  .kbd { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 4px; background: var(--bg-tertiary); border: 1px solid var(--border-medium); border-radius: 4px; font-size: 10px; font-family: var(--font-mono); color: var(--text-muted); font-weight: 700; }

  /* === HEATMAP / GAUGES === */
  .heatmap-grid { display: grid; grid-template-columns: minmax(190px, 250px) repeat(4, 1fr); gap: 2px; border-radius: var(--radius-sm); overflow-x: auto; overflow-y: hidden; border: 1px solid var(--border-subtle); scrollbar-width: thin; }
  .heatmap-grid::-webkit-scrollbar { height: 4px; }
  .heatmap-grid::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 2px; }
  .heatmap-cell { padding: 10px 4px; text-align: center; font-size: 13px; font-weight: 700; font-family: var(--font-mono); font-variant-numeric: tabular-nums; transition: all var(--transition-fast); cursor: default; white-space: nowrap; min-width: 70px; }
  .heatmap-cell:hover { transform: scale(1.02); z-index: 2; box-shadow: var(--shadow-md); }
  .heatmap-header { background: var(--bg-primary); color: var(--text-muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.3px; display: flex; align-items: center; justify-content: center; padding: 10px 6px; white-space: nowrap; min-width: 70px; }
  .heatmap-label { background: var(--bg-primary); color: var(--text-primary); font-weight: 700; font-size: 13px; font-family: var(--font-mono); display: flex; align-items: center; justify-content: flex-start; padding-left: 12px; gap: 6px; white-space: nowrap; }
  .gauge-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
  .gauge-svg { width: 56px; height: 32px; }
  .gauge-bg { fill: none; stroke: var(--bg-tertiary); stroke-width: 8; stroke-linecap: round; }
  .gauge-fill { fill: none; stroke-width: 8; stroke-linecap: round; transition: stroke-dasharray 0.8s cubic-bezier(0.16,1,0.3,1); }
  .gauge-text { font-size: 10px; font-weight: 700; font-family: var(--font-mono); }
  .donut-wrap { position: relative; width: 72px; height: 72px; margin: 0 auto; }
  .donut-svg { transform: rotate(-90deg); width: 72px; height: 72px; }
  .donut-bg { fill: none; stroke: var(--bg-tertiary); stroke-width: 8; }
  .donut-segment { fill: none; stroke-width: 8; transition: stroke-dasharray 0.6s cubic-bezier(0.16,1,0.3,1); }
  .donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
  .donut-label { font-size: 9px; color: var(--text-muted); font-weight: 600; }
  .donut-value { font-size: 13px; font-weight: 700; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .calendar-timeline { display: flex; gap: 6px; overflow-x: auto; padding: 10px; background: var(--bg-secondary); border-radius: var(--radius-md); margin-bottom: 16px; border: 1px solid var(--border-subtle); scrollbar-width: none; }
  .calendar-timeline::-webkit-scrollbar { display: none; }
  .timeline-item { flex-shrink: 0; min-width: 110px; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--bg-primary); border: 1px solid var(--border-subtle); transition: all var(--transition-fast); }
  .timeline-item:hover { border-color: var(--border-medium); }
  .timeline-time { font-size: 11px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; color: var(--brand); font-weight: 700; }
  .timeline-currency { font-size: 12px; font-weight: 800; font-family: var(--font-mono); margin-top: 4px; }
  .timeline-event { font-size: 11px; color: var(--text-secondary); margin-top: 2px; line-height: 1.3; max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .timeline-countdown { font-size: 10px; margin-top: 6px; font-weight: 700; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
  .signal-strength-meter { margin-top: 8px; }
  .strength-labels { display: flex; justify-content: space-between; font-size: 9px; color: var(--text-muted); margin-bottom: 3px; text-transform: uppercase; letter-spacing: 0.5px; }
  .strength-track { height: 4px; background: var(--bg-tertiary); border-radius: 2px; overflow: hidden; position: relative; }
  .strength-fill { height: 100%; border-radius: 2px; transition: width 0.6s cubic-bezier(0.16,1,0.3,1); position: relative; }
  .strength-fill::after { content: ''; position: absolute; right: 0; top: -1px; bottom: -1px; width: 2px; background: rgba(255,255,255,0.7); border-radius: 1px; opacity: 0.5; }
  .mini-donut-row { display: flex; align-items: center; justify-content: center; margin: 8px 0; }
  .signal-extra-row { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

  /* === TIME CARD === */
  .time-card { display: inline-flex; align-items: center; gap: 10px; padding: 6px 12px; background: transparent; border: 1px solid var(--border-medium); border-radius: var(--radius-sm); }
  .time-icon { display: none; }
  .time-value { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 13px; font-weight: 700; color: var(--text-primary); letter-spacing: 0.02em; }
  .time-date { color: var(--text-secondary); font-size: 12px; font-weight: 500; font-family: var(--font-mono); }
  .time-sep { width: 1px; height: 18px; background: var(--border-medium); }

  /* === SETTINGS === */
  .settings-modal { position: fixed; inset: 0; z-index: 200; background: rgba(0,0,0,0.6); backdrop-filter: blur(4px); display: none; align-items: flex-end; justify-content: center; animation: fadeIn 0.2s ease; }
  .settings-modal.active { display: flex; }
  .settings-panel { width: 100%; max-width: 400px; background: var(--bg-secondary); border: 1px solid var(--border-medium); border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 20px; margin: 0 auto; animation: slideUp 0.3s cubic-bezier(0.16,1,0.3,1); }
  .settings-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border-subtle); }
  .settings-title { font-size: 16px; font-weight: 800; letter-spacing: -0.01em; }
  .settings-body { display: block; }
  .settings-item { display: flex; align-items: center; gap: 14px; padding: 13px 14px; border-radius: var(--radius-md); background: var(--bg-primary); border: 1px solid var(--border-subtle); margin-bottom: 8px; cursor: pointer; transition: all var(--transition-fast); }
  .settings-item:hover { border-color: var(--border-medium); }
  .settings-icon { font-size: 18px; width: 28px; text-align: center; }
  .settings-info { flex: 1; display: flex; flex-direction: column; gap: 2px; }
  .settings-label { font-size: 14px; font-weight: 700; color: var(--text-primary); }
  .settings-desc { font-size: 12px; color: var(--text-muted); }
  .settings-status { font-size: 14px; }
  .settings-chevron { font-size: 18px; color: var(--text-muted); font-weight: 300; }

/* Signal chart modal responsive fixes */
#signal-chart-modal .settings-panel {
  width: min(94vw, 1100px) !important;
  height: calc(100dvh - 24px) !important;
  max-height: calc(100dvh - 24px) !important;
  margin: 12px !important;
}
#signal-chart-modal .settings-header { flex: 0 0 auto; }
#signal-chart-modal .settings-panel > div:nth-of-type(2) { flex: 0 0 auto; }
#signal-chart-modal .settings-panel > div:nth-of-type(3) { flex: 1 1 auto; min-height: 0; }
#signal-chart-modal-canvas {
  width: 100%;
  height: 100%;
  min-height: 280px;
}
@media (orientation: landscape) and (max-height: 520px) {
  #signal-chart-modal .settings-panel {
    width: calc(100vw - 16px) !important;
    height: calc(100dvh - 16px) !important;
    max-height: calc(100dvh - 16px) !important;
    margin: 8px !important;
  }
  #signal-chart-modal .settings-header { padding: 8px 12px; }
  #signal-chart-modal .settings-title { font-size: 16px; }
  #signal-chart-modal .settings-panel > div:nth-of-type(2) { padding: 6px 10px; gap: 6px; }
  #signal-chart-modal .settings-panel > div:nth-of-type(2) .btn { padding: 6px 10px; font-size: 12px; }
  #signal-chart-modal .settings-panel > div:nth-of-type(3) { padding: 6px; }
  #signal-chart-modal-canvas { min-height: 0; height: 100%; }
}
#signal-chart-modal.settings-modal { align-items: center; }
@media (orientation: landscape) and (max-height: 520px) {
  #signal-chart-modal .settings-panel { padding: 8px 10px !important; }
  #signal-chart-modal .settings-header { margin-bottom: 6px; padding-bottom: 6px; }
}

/* Chart modal scroll/background lock */
body.chart-modal-open { overflow: hidden; }
#signal-chart-modal.settings-modal {
  align-items: center !important;
  overflow: hidden;
  overscroll-behavior: contain;
}
#signal-chart-modal .settings-panel {
  overflow: hidden;
  overscroll-behavior: contain;
  box-sizing: border-box;
}
#signal-chart-modal-canvas { touch-action: pan-y; overscroll-behavior: contain; }
@media (orientation: landscape) and (max-height: 520px) {
  #signal-chart-modal .settings-panel { overflow-y: auto; -webkit-overflow-scrolling: touch; }
}

/* Settings modal scrolling */
#settings-modal.settings-modal { align-items: center; overflow: hidden; overscroll-behavior: contain; }
#settings-modal .settings-panel {
  max-height: calc(100dvh - 24px) !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
#settings-modal .settings-header {
  position: sticky;
  top: 0;
  z-index: 3;
  background: var(--bg-secondary);
}
@media (orientation: landscape) and (max-height: 520px) {
  #settings-modal .settings-panel { max-height: calc(100dvh - 16px) !important; }
}
body.settings-modal-open { overflow: hidden; }

#settings-modal .settings-panel, #settings-modal .settings-panel * { touch-action: pan-y; }
#settings-modal .settings-panel button, #settings-modal .settings-panel .settings-switch { touch-action: manipulation; }

/* Filters tab bottom spacing (компенсация nav теперь в .dashboard padding-bottom) */
#tab-filters { padding-bottom: 12px !important; }
#tab-filters .card:last-child { margin-bottom: 12px !important; }

/* Pairs tab spacing */
#tab-pairs .section-header { margin-top: 0 !important; padding-top: 0 !important; }
#tab-pairs { padding-top: 0 !important; }

/* Local flag icons */
.flag-icon { width: 18px; height: 12px; object-fit: cover; border-radius: 2px; display: inline-block; vertical-align: -1px; margin: 0 3px; box-shadow: 0 0 0 1px rgba(255,255,255,0.08); }

/* Незаметное автообновление: при фоновом рефреше входящие анимации не повторяются */
body.silent-update .card, body.silent-update .signal-card, body.silent-update .fund-card,
body.silent-update .cot-card, body.silent-update .cot-pair-card, body.silent-update .fund-pair-card,
body.silent-update .hist-card, body.silent-update .daily-card, body.silent-update tr,
body.silent-update .settings-item, body.silent-update .mini-event { animation: none !important; }

/* v6.7: подсвеченные строки — контент не налезает на цветную полосу, стрелка не вылезает за край */
.rate-row.row-up, .rate-row.row-down { padding-left: 16px; }
.rate-dir { font-size: 9px; margin-left: 3px; flex-shrink: 0; }

/* v6.13: расшифровка валют в строках курсов — одна строка, не переносится */
.rate-pair { min-width: 0; flex-wrap: nowrap; }
.rate-pair-names { font-size: 10px; color: var(--text-secondary); font-weight: 400; white-space: nowrap; }
.sparkline-wrap { flex-shrink: 0; }

/* v6.11: пары в 2 колонках с разделителем, заполнение сверху вниз (не перемешано) */
@media (min-width: 1100px) {
  #rates-container, #spread-container { columns: 2; column-gap: 34px; column-rule: 1px solid var(--border-subtle); }
  #rates-container .rate-row, #spread-container .rate-row { break-inside: avoid; }
}
@media (min-width: 1500px) {
  #rates-container, #spread-container { columns: 3; }
}

/* v6.14: компактные карточки сигналов — адекватный размер бейджей и отступов */
.signal-card { padding: 12px 14px 12px 16px; }
.signal-header { margin-bottom: 6px; }
.signal-pair { font-size: 15px; }
.signal-badge { font-size: 9px; padding: 3px 9px; border-radius: 4px; }
.signal-rate { font-size: 17px; margin-bottom: 6px; }
.signal-note { font-size: 12px; line-height: 1.45; }
.signal-levels { margin-top: 8px; font-size: 11px; gap: 12px; }

/* v6.15: единый стиль бейджей сигналов */
.sig-chips { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.sig-chip { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 5px; font-size: 11px; font-weight: 700; border: 1px solid; line-height: 1.4; }
.sig-pricerow { display: flex; justify-content: space-between; align-items: baseline; }
.sig-time { font-size: 11px; color: var(--text-muted); font-family: var(--font-mono); }

/* v6.16: на телефоне расшифровка валют скрыта — строки не вылезают за край */
@media (max-width: 900px) {
  .rate-pair-names { display: none; }
  .rate-value { font-size: 13px; }
}

/* v6.18: на телефоне колонка валюты в хитмапе сжата — там только код */
@media (max-width: 900px) {
  .heatmap-grid { grid-template-columns: minmax(60px, 76px) repeat(4, 1fr); gap: 3px; }
  .heatmap-cell { padding: 8px 2px; font-size: 11px; min-width: 58px; }
  .heatmap-header { padding: 8px 2px; font-size: 10.5px; min-width: 58px; }
  .heatmap-label { padding: 8px 4px; font-size: 13px; }
}
