/* Design Tokens — ege-check («Бланк ответов № 2 + протокол ФИПИ») */
:root {
  color-scheme: light;

  /* 60 / 30 / 10 Palette */
  --desk-canvas: #f5f7fa;
  --blank-sheet: #ffffff;
  --kim-panel: #edf0f5;
  --input-well: #eaeef4;

  /* Ink Hierarchy (4 tiers) */
  --ink-primary: #11141c;
  --ink-secondary: #3d4556;
  --ink-tertiary: #525b6e;
  --ink-muted: #6c768a;

  /* Primary Action (Cobalt) */
  --cobalt-action: #183bb5;
  --cobalt-hover: #122e91;
  --cobalt-link: #183bb5;
  --cobalt-wash: rgba(24, 59, 181, 0.08);
  --on-cobalt: #ffffff;

  /* Semantic Commission Colors */
  --expert-red: #c81e2b;
  --expert-red-wash: rgba(200, 30, 43, 0.08);
  --warn-amber: #a15c07;
  --warn-amber-wash: rgba(161, 92, 7, 0.09);
  --reclaim-emerald: #0d7a43;
  --reclaim-emerald-wash: rgba(13, 122, 67, 0.09);

  /* Borders & Depth */
  --border-subtle: rgba(17, 20, 28, 0.08);
  --border-crisp: rgba(17, 20, 28, 0.16);
  --border-focus: #183bb5;
  --sheet-shadow: 0 1px 2px rgba(17, 20, 28, 0.04), 0 0 0 1px var(--border-subtle);

  /* Architectural Editorial Frame & Banding */
  --band-surface: #ffffff;
  --band-alt: #f5f7fa;
  --frame-rule: rgba(17, 20, 28, 0.11);
  --pill-surface: #ebeff6;
  --featured-tint: rgba(24, 59, 181, 0.035);
  --closing-ground: #0b1536;
  --closing-glow: rgba(37, 99, 235, 0.28);
  --closing-ring: rgba(255, 255, 255, 0.08);
  --closing-ink: #ffffff;
  --closing-copy: rgba(241, 245, 249, 0.84);
  --closing-btn-bg: #ffffff;
  --closing-btn-ink: #0b1536;
  --closing-btn-hover: #eef2ff;
  --overlay-backdrop: rgba(11, 16, 27, 0.56);
  --overlay-inset-ring: inset 0 0 0 1px rgba(255, 255, 255, 0.14);

  /* Premium Surfaces, Glass & Gradients */
  --glass-bg: rgba(245, 247, 250, 0.78);
  --glass-border: rgba(255, 255, 255, 0.65);
  --surface-elevated-grad: linear-gradient(180deg, #ffffff 0%, #fbfcfe 100%);
  --kim-grad: linear-gradient(180deg, #eff3fa 0%, #e9eef7 100%);
  --cobalt-grad: linear-gradient(135deg, #2149d6 0%, #1534a3 100%);
  --cobalt-grad-hover: linear-gradient(135deg, #1b3fc2 0%, #102a87 100%);
  --score-hero-grad: linear-gradient(135deg, #1a3fc4 0%, #102982 65%, #0d2169 100%);
  --score-hero-emerald: linear-gradient(135deg, #0f8a4b 0%, #096134 100%);
  --spotlight-tint: rgba(24, 59, 181, 0.06);
  --shadow-card: 0 1px 2px rgba(15, 23, 42, 0.04), 0 8px 24px -8px rgba(15, 23, 42, 0.07), 0 0 0 1px var(--border-subtle);
  --shadow-elevated: 0 4px 12px rgba(15, 23, 42, 0.06), 0 18px 40px -12px rgba(24, 59, 181, 0.14), 0 0 0 1px var(--border-crisp);
  --shadow-cobalt: 0 1px 2px rgba(16, 41, 130, 0.2), 0 8px 20px -6px rgba(24, 59, 181, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.24);
  --halo-cobalt: 0 0 0 4px rgba(24, 59, 181, 0.22);
  --border-grad-cobalt: linear-gradient(135deg, rgba(24, 59, 181, 0.42) 0%, rgba(14, 165, 233, 0.32) 50%, rgba(13, 122, 67, 0.32) 100%);
  --border-grad-featured: linear-gradient(135deg, #2563eb 0%, #0ea5e9 52%, #10b981 100%);
  --border-grad-dark-card: linear-gradient(135deg, rgba(56, 189, 248, 0.42) 0%, rgba(37, 99, 235, 0.24) 50%, rgba(52, 211, 153, 0.42) 100%);
  --headline-grad: linear-gradient(180deg, #11141c 0%, #2d3a5c 100%);
  --mesh-banner-bg:
    radial-gradient(58% 70% at 18% 0%, rgba(37, 99, 235, 0.20) 0%, transparent 65%),
    radial-gradient(46% 60% at 86% 100%, rgba(16, 185, 129, 0.11) 0%, transparent 62%),
    #0b101b;
  --grain-url: url("data:image/svg+xml,%3Csvg viewBox='0 0 160 160' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.82' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.55'/%3E%3C/svg%3E");

  /* Typography */
  --font-display: 'Unbounded Variable', 'Golos Text Variable', sans-serif;
  --font-sans: 'Golos Text Variable', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'JetBrains Mono Variable', ui-monospace, monospace;

  /* Architectural Sharp Radii & Spacing */
  --radius-sheet: 2px;
  --radius-control: 4px;
  --radius-badge: 3px;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;

  /* Motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-spring: cubic-bezier(0.22, 1.15, 0.36, 1);

  /* Telegram Safe Areas (fallbacks when running outside TG) */
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

[data-theme="dark"] {
  color-scheme: dark;

  --desk-canvas: #060911;
  --blank-sheet: #0b101b;
  --kim-panel: #0e1524;
  --input-well: #070b14;

  --ink-primary: #f1f5f9;
  --ink-secondary: #cbd5e1;
  --ink-tertiary: #94a3b8;
  --ink-muted: #64748b;

  --cobalt-action: #2563eb;
  --cobalt-hover: #1d4ed8;
  --cobalt-link: #60a5fa;
  --cobalt-wash: rgba(37, 99, 235, 0.14);
  --on-cobalt: #ffffff;

  --expert-red: #fb7185;
  --expert-red-wash: rgba(244, 63, 94, 0.14);
  --warn-amber: #fbbf24;
  --warn-amber-wash: rgba(245, 158, 11, 0.14);
  --reclaim-emerald: #34d399;
  --reclaim-emerald-wash: rgba(16, 185, 129, 0.14);

  --border-subtle: rgba(148, 163, 184, 0.13);
  --border-crisp: rgba(148, 163, 184, 0.24);
  --border-focus: #3b82f6;
  --sheet-shadow: 0 0 0 1px var(--border-subtle);

  /* Architectural Editorial Frame & Banding (Dark) */
  --band-surface: #0b101b;
  --band-alt: #060911;
  --frame-rule: rgba(148, 163, 184, 0.16);
  --pill-surface: #141c2e;
  --featured-tint: rgba(37, 99, 235, 0.09);
  --closing-ground: #0e1a3d;
  --closing-glow: rgba(59, 130, 246, 0.26);
  --closing-ring: rgba(255, 255, 255, 0.08);
  --closing-ink: #f8fafc;
  --closing-copy: rgba(203, 213, 225, 0.86);
  --closing-btn-bg: #ffffff;
  --closing-btn-ink: #0b1536;
  --closing-btn-hover: #eef2ff;
  --overlay-backdrop: rgba(0, 0, 0, 0.68);
  --overlay-inset-ring: inset 0 0 0 1px rgba(255, 255, 255, 0.14);

  /* Premium Surfaces, Glass & Gradients (Dark) */
  --glass-bg: rgba(6, 9, 17, 0.82);
  --glass-border: rgba(255, 255, 255, 0.06);
  --surface-elevated-grad: linear-gradient(180deg, #0d1320 0%, #0b101b 100%);
  --kim-grad: linear-gradient(180deg, #0f1727 0%, #0b101b 100%);
  --cobalt-grad: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  --cobalt-grad-hover: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --score-hero-grad: linear-gradient(135deg, #1d4ed8 0%, #112a78 65%, #0c1d54 100%);
  --score-hero-emerald: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --spotlight-tint: rgba(37, 99, 235, 0.09);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.35), 0 0 0 1px var(--border-subtle);
  --shadow-elevated: 0 8px 20px rgba(0, 0, 0, 0.45), 0 0 0 1px var(--border-crisp);
  --shadow-cobalt: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 20px -6px rgba(37, 99, 235, 0.45), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  --halo-cobalt: 0 0 0 4px rgba(59, 130, 246, 0.28);
  --border-grad-cobalt: linear-gradient(135deg, rgba(59, 130, 246, 0.36) 0%, rgba(37, 99, 235, 0.22) 50%, rgba(16, 185, 129, 0.30) 100%);
  --border-grad-featured: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #10b981 100%);
  --headline-grad: linear-gradient(180deg, #ffffff 0%, #cbd5e1 100%);
}
