/* ═══════════════════════════════════════════
   Telegram Forensics — Theme Pack
   Applied via html[data-theme="…"]
   ═══════════════════════════════════════════ */

:root {
    --accent: #2AABEE;
    --accent-soft: rgba(42, 171, 238, 0.12);
    --radius-sm: 8px;
    --font-ui: 'Plus Jakarta Sans', system-ui, sans-serif;
    --bg-pattern: none;
    --card-border-width: 1px;
    --btn-radius: 8px;
}

html[data-theme="dark"],
html[data-theme="default"] {
    --tg-blue: #2AABEE;
    --tg-blue-dark: #229ED9;
    --tg-blue-light: #E8F4FD;
    --bg: #0f1419;
    --bg-card: #1a2332;
    --bg-card-hover: #1f2a3d;
    --bg-input: #0d1117;
    --text: #e7ecf3;
    --text-muted: #8b9cb3;
    --border: #2a3548;
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
    --accent: #2AABEE;
    --accent-soft: rgba(42, 171, 238, 0.12);
    --text-color: #e7ecf3;
    --font-ui: 'Plus Jakarta Sans', system-ui, sans-serif;
}

html[data-theme="light"] {
    --tg-blue: #2AABEE;
    --tg-blue-dark: #1a8bc7;
    --tg-blue-light: rgba(42, 171, 238, 0.1);
    --bg: #f8fafc;
    --bg-card: #ffffff;
    --bg-card-hover: #f1f5f9;
    --bg-input: #ffffff;
    --text: #0f172a;
    --text-muted: #64748b;
    --border: #e2e8f0;
    --shadow: 0 4px 24px rgba(15, 23, 42, 0.05);
    --accent: #2AABEE;
    --accent-soft: rgba(42, 171, 238, 0.1);
    --text-color: #0f172a;
    --radius: 12px;
}

html[data-theme="light"] .navbar {
    background: rgba(255, 255, 255, 0.95);
}

/* ── Cyber Deck UI ── */
html[data-theme="cyber-deck"] {
    --tg-blue: #00ff9c;
    --tg-blue-dark: #00cc7a;
    --tg-blue-light: rgba(0, 255, 156, 0.12);
    --bg: #050805;
    --bg-card: #0a120e;
    --bg-card-hover: #0f1a14;
    --bg-input: #030604;
    --text: #b8ffd4;
    --text-muted: #4d8a66;
    --border: #1a3d2a;
    --success: #39ff14;
    --error: #ff3355;
    --warning: #ffe600;
    --radius: 2px;
    --shadow: 0 0 20px rgba(0, 255, 156, 0.08);
    --accent: #00ff9c;
    --accent-soft: rgba(0, 255, 156, 0.1);
    --text-color: #b8ffd4;
    --font-ui: 'Courier New', 'Consolas', monospace;
    --btn-radius: 2px;
    --card-border-width: 1px;
}

html[data-theme="cyber-deck"] body {
    background-image:
        linear-gradient(rgba(0, 255, 156, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 255, 156, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
}

html[data-theme="cyber-deck"] .card,
html[data-theme="cyber-deck"] .navbar,
html[data-theme="cyber-deck"] .sidebar {
    border-color: #00ff9c44;
    box-shadow: inset 0 0 0 1px #00ff9c22, 0 0 24px rgba(0, 255, 156, 0.06);
}

html[data-theme="cyber-deck"] .btn-primary {
    background: #00ff9c;
    color: #001a0d;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-size: 0.8rem;
}

/* ── Cyber (neon punk) ── */
html[data-theme="cyber"] {
    --tg-blue: #00f0ff;
    --tg-blue-dark: #ff2bd6;
    --tg-blue-light: rgba(0, 240, 255, 0.15);
    --bg: #0b0614;
    --bg-card: #160b28;
    --bg-card-hover: #1e1035;
    --bg-input: #0e0618;
    --text: #f2e9ff;
    --text-muted: #9b7fc4;
    --border: #3d1f6b;
    --success: #39ff14;
    --error: #ff2d55;
    --warning: #ffea00;
    --radius: 10px;
    --shadow: 0 0 32px rgba(255, 43, 214, 0.15);
    --accent: #00f0ff;
    --accent-soft: rgba(0, 240, 255, 0.12);
    --text-color: #f2e9ff;
}

html[data-theme="cyber"] body {
    background:
        radial-gradient(ellipse at 20% 0%, rgba(255, 43, 214, 0.18), transparent 50%),
        radial-gradient(ellipse at 80% 100%, rgba(0, 240, 255, 0.14), transparent 45%),
        var(--bg);
}

html[data-theme="cyber"] .btn-primary {
    background: linear-gradient(135deg, #00f0ff, #ff2bd6);
    color: #0b0614;
    border: none;
    box-shadow: 0 0 18px rgba(0, 240, 255, 0.35);
}

html[data-theme="cyber"] .navbar {
    background: rgba(22, 11, 40, 0.85);
    border-bottom-color: #ff2bd655;
}

/* ── Windows XP ── */
html[data-theme="windows-xp"] {
    --tg-blue: #245edb;
    --tg-blue-dark: #1941a5;
    --tg-blue-light: #d4e4fc;
    --bg: #3a6ea5;
    --bg-card: #ece9d8;
    --bg-card-hover: #f5f4ec;
    --bg-input: #ffffff;
    --text: #000000;
    --text-muted: #555555;
    --border: #919b9c;
    --success: #008000;
    --error: #c00;
    --warning: #c60;
    --radius: 0;
    --shadow: 2px 2px 0 #00000033;
    --accent: #245edb;
    --accent-soft: #d4e4fc;
    --text-color: #000000;
    --font-ui: Tahoma, 'Segoe UI', sans-serif;
    --btn-radius: 3px;
}

html[data-theme="windows-xp"] body {
    background:
        linear-gradient(180deg, #245edb 0%, #3a6ea5 35%, #7db0e8 70%, #99c468 100%);
    background-attachment: fixed;
}

html[data-theme="windows-xp"] .navbar {
    background: linear-gradient(180deg, #3c8ae8 0%, #245edb 45%, #1a4cb5 100%);
    border-bottom: 2px solid #0831d9;
    color: #fff;
}

html[data-theme="windows-xp"] .navbar a,
html[data-theme="windows-xp"] .logo,
html[data-theme="windows-xp"] .nav-links a {
    color: #fff !important;
}

html[data-theme="windows-xp"] .card {
    border: 2px solid;
    border-color: #fff #716f64 #716f64 #fff;
    box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.25);
    background: #ece9d8;
}

html[data-theme="windows-xp"] .btn-primary {
    background: linear-gradient(180deg, #fff 0%, #ece9d8 40%, #d4d0c8 100%);
    color: #000;
    border: 2px solid;
    border-color: #fff #716f64 #716f64 #fff;
    font-weight: 600;
}

html[data-theme="windows-xp"] .btn-primary:hover {
    background: linear-gradient(180deg, #fff 0%, #d4e4fc 100%);
    color: #000;
}

html[data-theme="windows-xp"] .form-control {
    border: 2px solid;
    border-color: #716f64 #fff #fff #716f64;
    border-radius: 0;
}

html[data-theme="windows-xp"] .sidebar {
    background: #ece9d8;
    border-right: 2px solid #716f64;
}

/* ── Aero Glass ── */
html[data-theme="aero"] {
    --tg-blue: #1e90ff;
    --tg-blue-dark: #0078d7;
    --tg-blue-light: rgba(30, 144, 255, 0.15);
    --bg: #6a9bd8;
    --bg-card: rgba(255, 255, 255, 0.55);
    --bg-card-hover: rgba(255, 255, 255, 0.7);
    --bg-input: rgba(255, 255, 255, 0.75);
    --text: #1a2332;
    --text-muted: #3d4f66;
    --border: rgba(255, 255, 255, 0.55);
    --success: #107c10;
    --error: #e81123;
    --warning: #ff8c00;
    --radius: 8px;
    --shadow: 0 8px 32px rgba(0, 40, 80, 0.2);
    --accent: #1e90ff;
    --accent-soft: rgba(30, 144, 255, 0.18);
    --text-color: #1a2332;
    --font-ui: 'Segoe UI', 'Plus Jakarta Sans', sans-serif;
}

html[data-theme="aero"] body {
    background:
        linear-gradient(160deg, #7eb6e9 0%, #4a8fd4 40%, #2f6fb5 100%);
    background-attachment: fixed;
}

html[data-theme="aero"] .card,
html[data-theme="aero"] .navbar,
html[data-theme="aero"] .sidebar,
html[data-theme="aero"] .auth-card {
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(18px) saturate(160%);
    -webkit-backdrop-filter: blur(18px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.65);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.7),
        0 8px 28px rgba(0, 40, 80, 0.18);
}

html[data-theme="aero"] .btn-primary {
    background: linear-gradient(180deg, #5eb3ff, #1e90ff 50%, #0070d0);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

/* ── Swiss Deck Colorful ── */
html[data-theme="swiss-deck"] {
    --tg-blue: #e30613;
    --tg-blue-dark: #b0040f;
    --tg-blue-light: #ffe5e7;
    --bg: #f4f1ea;
    --bg-card: #ffffff;
    --bg-card-hover: #fff8e7;
    --bg-input: #ffffff;
    --text: #111111;
    --text-muted: #555555;
    --border: #111111;
    --success: #00875a;
    --error: #e30613;
    --warning: #ffb800;
    --radius: 0;
    --shadow: 6px 6px 0 #111111;
    --accent: #e30613;
    --accent-soft: #ffe5e7;
    --text-color: #111111;
    --font-ui: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --btn-radius: 0;
}

html[data-theme="swiss-deck"] body {
    background:
        linear-gradient(90deg, #e30613 0 8px, transparent 8px),
        linear-gradient(#ffb800 0 8px, transparent 8px),
        #f4f1ea;
    background-size: 100% 100%, 100% 100%, auto;
}

html[data-theme="swiss-deck"] .card {
    border: 3px solid #111;
    box-shadow: 8px 8px 0 #111;
}

html[data-theme="swiss-deck"] .navbar {
    background: #111;
    border-bottom: 4px solid #e30613;
}

html[data-theme="swiss-deck"] .navbar a,
html[data-theme="swiss-deck"] .logo {
    color: #fff !important;
}

html[data-theme="swiss-deck"] .btn-primary {
    background: #e30613;
    color: #fff;
    border: 3px solid #111;
    box-shadow: 4px 4px 0 #111;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

html[data-theme="swiss-deck"] .btn-outline {
    border: 3px solid #111;
    box-shadow: 3px 3px 0 #111;
}

html[data-theme="swiss-deck"] h1,
html[data-theme="swiss-deck"] .page-header h1 {
    font-weight: 900;
    letter-spacing: -0.03em;
    text-transform: uppercase;
}

/* ── Boxes Colorful ── */
html[data-theme="boxes"] {
    --tg-blue: #6366f1;
    --tg-blue-dark: #4f46e5;
    --tg-blue-light: #e0e7ff;
    --bg: #fef3c7;
    --bg-card: #ffffff;
    --bg-card-hover: #fff7ed;
    --bg-input: #fffbeb;
    --text: #1e1b4b;
    --text-muted: #6b7280;
    --border: #1e1b4b;
    --success: #10b981;
    --error: #f43f5e;
    --warning: #f59e0b;
    --radius: 16px;
    --shadow: 0 0 0 3px #1e1b4b, 6px 6px 0 #f43f5e;
    --accent: #6366f1;
    --accent-soft: #e0e7ff;
    --text-color: #1e1b4b;
    --btn-radius: 12px;
}

html[data-theme="boxes"] body {
    background:
        radial-gradient(circle at 10% 20%, #fca5a5 0, transparent 28%),
        radial-gradient(circle at 90% 10%, #93c5fd 0, transparent 25%),
        radial-gradient(circle at 80% 80%, #86efac 0, transparent 30%),
        radial-gradient(circle at 15% 85%, #c4b5fd 0, transparent 22%),
        #fef3c7;
}

html[data-theme="boxes"] .card {
    border: 3px solid #1e1b4b;
    box-shadow: 6px 6px 0 #1e1b4b;
}

html[data-theme="boxes"] .card:nth-child(3n+1) { box-shadow: 6px 6px 0 #f43f5e; }
html[data-theme="boxes"] .card:nth-child(3n+2) { box-shadow: 6px 6px 0 #6366f1; }
html[data-theme="boxes"] .card:nth-child(3n+3) { box-shadow: 6px 6px 0 #10b981; }

html[data-theme="boxes"] .navbar {
    background: #1e1b4b;
    border-bottom: 4px solid #f43f5e;
}

html[data-theme="boxes"] .navbar a,
html[data-theme="boxes"] .logo {
    color: #fff !important;
}

html[data-theme="boxes"] .btn-primary {
    background: #6366f1;
    border: 3px solid #1e1b4b;
    box-shadow: 4px 4px 0 #1e1b4b;
    color: #fff;
}

/* ── Matrix ── */
html[data-theme="matrix"] {
    --tg-blue: #00ff41;
    --tg-blue-dark: #008f11;
    --tg-blue-light: rgba(0, 255, 65, 0.1);
    --bg: #000000;
    --bg-card: #001a00;
    --bg-card-hover: #003300;
    --bg-input: #000a00;
    --text: #00ff41;
    --text-muted: #008f11;
    --border: #003b00;
    --success: #00ff41;
    --error: #ff0040;
    --warning: #ccff00;
    --radius: 0;
    --shadow: 0 0 12px rgba(0, 255, 65, 0.2);
    --accent: #00ff41;
    --accent-soft: rgba(0, 255, 65, 0.1);
    --text-color: #00ff41;
    --font-ui: 'Courier New', monospace;
    --btn-radius: 0;
}

html[data-theme="matrix"] body {
    background: #000;
    text-shadow: 0 0 4px rgba(0, 255, 65, 0.45);
}

html[data-theme="matrix"] .btn-primary {
    background: #00ff41;
    color: #000;
    box-shadow: 0 0 12px #00ff41;
}

/* ── Vaporwave ── */
html[data-theme="vaporwave"] {
    --tg-blue: #ff71ce;
    --tg-blue-dark: #b967ff;
    --tg-blue-light: rgba(255, 113, 206, 0.15);
    --bg: #1a0533;
    --bg-card: #2d1b4e;
    --bg-card-hover: #3a2460;
    --bg-input: #16042c;
    --text: #fffbfe;
    --text-muted: #c9a0ff;
    --border: #ff71ce55;
    --success: #01cdfe;
    --error: #ff71ce;
    --warning: #fffb96;
    --radius: 14px;
    --shadow: 0 8px 30px rgba(185, 103, 255, 0.25);
    --accent: #01cdfe;
    --accent-soft: rgba(1, 205, 254, 0.15);
    --text-color: #fffbfe;
}

html[data-theme="vaporwave"] body {
    background:
        linear-gradient(180deg, #1a0533 0%, #2d1b4e 40%, #ff71ce33 100%),
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 2px,
            rgba(255, 113, 206, 0.04) 2px,
            rgba(255, 113, 206, 0.04) 4px
        );
}

html[data-theme="vaporwave"] .btn-primary {
    background: linear-gradient(90deg, #ff71ce, #b967ff, #01cdfe);
    color: #1a0533;
}

/* ── Terminal Amber ── */
html[data-theme="terminal"] {
    --tg-blue: #ffb000;
    --tg-blue-dark: #cc8a00;
    --tg-blue-light: rgba(255, 176, 0, 0.12);
    --bg: #0c0a00;
    --bg-card: #141000;
    --bg-card-hover: #1c1600;
    --bg-input: #0a0800;
    --text: #ffb000;
    --text-muted: #996600;
    --border: #664400;
    --success: #ffcc00;
    --error: #ff4400;
    --warning: #ffdd55;
    --radius: 0;
    --shadow: none;
    --accent: #ffb000;
    --accent-soft: rgba(255, 176, 0, 0.1);
    --text-color: #ffb000;
    --font-ui: 'Courier New', Consolas, monospace;
    --btn-radius: 0;
}

html[data-theme="terminal"] .btn-primary {
    background: transparent;
    color: #ffb000;
    border: 1px solid #ffb000;
}
html[data-theme="terminal"] .btn-primary:hover {
    background: #ffc933;
}

/* ═══════════════════════════════════════════
   +30 extra themes (CSS variables)
   ═══════════════════════════════════════════ */

html[data-theme="midnight"] {
    --tg-blue: #5b8def; --tg-blue-dark: #3b6fd4; --tg-blue-light: rgba(91,141,239,0.14);
    --bg: #0a0e1a; --bg-card: #121a2e; --bg-card-hover: #1a2540; --bg-input: #080c16;
    --text: #dce6ff; --text-muted: #7e90b8; --border: #243152;
    --success: #34d399; --error: #f87171; --warning: #fbbf24;
    --radius: 12px; --shadow: 0 8px 28px rgba(0,0,0,0.35);
    --accent: #5b8def; --accent-soft: rgba(91,141,239,0.12); --text-color: #dce6ff;
}

html[data-theme="ocean"] {
    --tg-blue: #2dd4bf; --tg-blue-dark: #14b8a6; --tg-blue-light: rgba(45,212,191,0.14);
    --bg: #06161a; --bg-card: #0c242b; --bg-card-hover: #12343d; --bg-input: #041014;
    --text: #e6fffb; --text-muted: #6fadb0; --border: #1a4a52;
    --success: #4ade80; --error: #fb7185; --warning: #fbbf24;
    --radius: 14px; --shadow: 0 8px 28px rgba(0,0,0,0.35);
    --accent: #2dd4bf; --accent-soft: rgba(45,212,191,0.12); --text-color: #e6fffb;
}

html[data-theme="sunset"] {
    --tg-blue: #fb923c; --tg-blue-dark: #ea580c; --tg-blue-light: rgba(251,146,60,0.16);
    --bg: #1a0c0a; --bg-card: #2a1410; --bg-card-hover: #3a1c14; --bg-input: #140806;
    --text: #ffe8d6; --text-muted: #c49a7a; --border: #5a2e20;
    --success: #86efac; --error: #f87171; --warning: #fde047;
    --radius: 14px; --shadow: 0 8px 28px rgba(0,0,0,0.35);
    --accent: #fb923c; --accent-soft: rgba(251,146,60,0.14); --text-color: #ffe8d6;
}

html[data-theme="forest"] {
    --tg-blue: #4ade80; --tg-blue-dark: #22c55e; --tg-blue-light: rgba(74,222,128,0.14);
    --bg: #0a140c; --bg-card: #142018; --bg-card-hover: #1c2e22; --bg-input: #07100a;
    --text: #e8fcec; --text-muted: #7aaa86; --border: #2a4a34;
    --success: #86efac; --error: #f87171; --warning: #facc15;
    --radius: 12px; --shadow: 0 8px 28px rgba(0,0,0,0.35);
    --accent: #4ade80; --accent-soft: rgba(74,222,128,0.12); --text-color: #e8fcec;
}

html[data-theme="rose"] {
    --tg-blue: #fb7185; --tg-blue-dark: #e11d48; --tg-blue-light: rgba(251,113,133,0.14);
    --bg: #1a0a12; --bg-card: #2a1220; --bg-card-hover: #3a1a2c; --bg-input: #12070c;
    --text: #ffe4ec; --text-muted: #c4879a; --border: #5a2840;
    --success: #86efac; --error: #fb7185; --warning: #fbbf24;
    --radius: 16px; --shadow: 0 8px 28px rgba(0,0,0,0.35);
    --accent: #fb7185; --accent-soft: rgba(251,113,133,0.12); --text-color: #ffe4ec;
}

html[data-theme="latte"] {
    --tg-blue: #a16207; --tg-blue-dark: #854d0e; --tg-blue-light: rgba(161,98,7,0.12);
    --bg: #f5efe6; --bg-card: #fffaf3; --bg-card-hover: #f3e9da; --bg-input: #ffffff;
    --text: #3f2e1e; --text-muted: #8b7355; --border: #e5d5c0;
    --success: #16a34a; --error: #dc2626; --warning: #d97706;
    --radius: 14px; --shadow: 0 6px 20px rgba(63,46,30,0.08);
    --accent: #a16207; --accent-soft: rgba(161,98,7,0.1); --text-color: #3f2e1e;
}
html[data-theme="latte"] .navbar { background: rgba(255,250,243,0.95); }

html[data-theme="nord"] {
    --tg-blue: #88c0d0; --tg-blue-dark: #81a1c1; --tg-blue-light: rgba(136,192,208,0.16);
    --bg: #2e3440; --bg-card: #3b4252; --bg-card-hover: #434c5e; --bg-input: #292e39;
    --text: #eceff4; --text-muted: #a0a8b8; --border: #4c566a;
    --success: #a3be8c; --error: #bf616a; --warning: #ebcb8b;
    --radius: 10px; --shadow: 0 8px 24px rgba(0,0,0,0.25);
    --accent: #88c0d0; --accent-soft: rgba(136,192,208,0.14); --text-color: #eceff4;
}

html[data-theme="dracula"] {
    --tg-blue: #bd93f9; --tg-blue-dark: #9d6fe0; --tg-blue-light: rgba(189,147,249,0.16);
    --bg: #282a36; --bg-card: #44475a; --bg-card-hover: #50556b; --bg-input: #21222c;
    --text: #f8f8f2; --text-muted: #b0b3c4; --border: #6272a4;
    --success: #50fa7b; --error: #ff5555; --warning: #f1fa8c;
    --radius: 10px; --shadow: 0 8px 24px rgba(0,0,0,0.3);
    --accent: #bd93f9; --accent-soft: rgba(189,147,249,0.14); --text-color: #f8f8f2;
}

html[data-theme="monokai"] {
    --tg-blue: #a6e22e; --tg-blue-dark: #8bc41d; --tg-blue-light: rgba(166,226,46,0.14);
    --bg: #272822; --bg-card: #3e3d32; --bg-card-hover: #49483e; --bg-input: #1e1f1c;
    --text: #f8f8f2; --text-muted: #a8a89c; --border: #75715e;
    --success: #a6e22e; --error: #f92672; --warning: #e6db74;
    --radius: 8px; --shadow: 0 8px 24px rgba(0,0,0,0.3);
    --accent: #a6e22e; --accent-soft: rgba(166,226,46,0.12); --text-color: #f8f8f2;
    --font-ui: 'Consolas', 'Courier New', monospace;
}

html[data-theme="solarized-dark"] {
    --tg-blue: #268bd2; --tg-blue-dark: #1a6fa8; --tg-blue-light: rgba(38,139,210,0.16);
    --bg: #002b36; --bg-card: #073642; --bg-card-hover: #0a4654; --bg-input: #00222b;
    --text: #93a1a1; --text-muted: #657b83; --border: #586e75;
    --success: #859900; --error: #dc322f; --warning: #b58900;
    --radius: 8px; --shadow: 0 8px 24px rgba(0,0,0,0.3);
    --accent: #268bd2; --accent-soft: rgba(38,139,210,0.14); --text-color: #93a1a1;
}

html[data-theme="solarized-light"] {
    --tg-blue: #268bd2; --tg-blue-dark: #1a6fa8; --tg-blue-light: rgba(38,139,210,0.12);
    --bg: #fdf6e3; --bg-card: #eee8d5; --bg-card-hover: #e6dfc8; --bg-input: #fffdf5;
    --text: #657b83; --text-muted: #839496; --border: #d9d2c0;
    --success: #859900; --error: #dc322f; --warning: #b58900;
    --radius: 8px; --shadow: 0 6px 18px rgba(0,43,54,0.08);
    --accent: #268bd2; --accent-soft: rgba(38,139,210,0.1); --text-color: #657b83;
}
html[data-theme="solarized-light"] .navbar { background: rgba(253,246,227,0.95); }

html[data-theme="github-dark"] {
    --tg-blue: #58a6ff; --tg-blue-dark: #388bfd; --tg-blue-light: rgba(88,166,255,0.14);
    --bg: #0d1117; --bg-card: #161b22; --bg-card-hover: #1c2129; --bg-input: #010409;
    --text: #c9d1d9; --text-muted: #8b949e; --border: #30363d;
    --success: #3fb950; --error: #f85149; --warning: #d29922;
    --radius: 8px; --shadow: 0 8px 24px rgba(0,0,0,0.35);
    --accent: #58a6ff; --accent-soft: rgba(88,166,255,0.12); --text-color: #c9d1d9;
}

html[data-theme="paper"] {
    --tg-blue: #2563eb; --tg-blue-dark: #1d4ed8; --tg-blue-light: rgba(37,99,235,0.1);
    --bg: #f7f3eb; --bg-card: #ffffff; --bg-card-hover: #f3eee4; --bg-input: #ffffff;
    --text: #1e293b; --text-muted: #64748b; --border: #e7e0d4;
    --success: #16a34a; --error: #dc2626; --warning: #d97706;
    --radius: 12px; --shadow: 0 6px 18px rgba(30,41,59,0.06);
    --accent: #2563eb; --accent-soft: rgba(37,99,235,0.08); --text-color: #1e293b;
}
html[data-theme="paper"] .navbar { background: rgba(255,255,255,0.95); }

html[data-theme="indigo"] {
    --tg-blue: #818cf8; --tg-blue-dark: #6366f1; --tg-blue-light: rgba(129,140,248,0.16);
    --bg: #0f1024; --bg-card: #1a1b3a; --bg-card-hover: #242550; --bg-input: #0b0c1c;
    --text: #e0e7ff; --text-muted: #9aa3d0; --border: #2f3160;
    --success: #34d399; --error: #f87171; --warning: #fbbf24;
    --radius: 14px; --shadow: 0 8px 28px rgba(0,0,0,0.35);
    --accent: #818cf8; --accent-soft: rgba(129,140,248,0.14); --text-color: #e0e7ff;
}

html[data-theme="coral"] {
    --tg-blue: #ff6b6b; --tg-blue-dark: #ef4444; --tg-blue-light: rgba(255,107,107,0.16);
    --bg: #1a0f10; --bg-card: #2a1719; --bg-card-hover: #3a1f22; --bg-input: #120a0b;
    --text: #ffe3e3; --text-muted: #c89898; --border: #5a3034;
    --success: #4ade80; --error: #ff6b6b; --warning: #fbbf24;
    --radius: 14px; --shadow: 0 8px 28px rgba(0,0,0,0.35);
    --accent: #ff6b6b; --accent-soft: rgba(255,107,107,0.14); --text-color: #ffe3e3;
}

html[data-theme="arctic"] {
    --tg-blue: #0284c7; --tg-blue-dark: #0369a1; --tg-blue-light: rgba(2,132,199,0.12);
    --bg: #eef6ff; --bg-card: #ffffff; --bg-card-hover: #e8f2fc; --bg-input: #ffffff;
    --text: #0c4a6e; --text-muted: #64748b; --border: #cfe3f5;
    --success: #059669; --error: #dc2626; --warning: #d97706;
    --radius: 14px; --shadow: 0 6px 18px rgba(2,132,199,0.08);
    --accent: #0284c7; --accent-soft: rgba(2,132,199,0.1); --text-color: #0c4a6e;
}
html[data-theme="arctic"] .navbar { background: rgba(255,255,255,0.95); }

html[data-theme="ember"] {
    --tg-blue: #ef4444; --tg-blue-dark: #dc2626; --tg-blue-light: rgba(239,68,68,0.16);
    --bg: #140808; --bg-card: #241010; --bg-card-hover: #321616; --bg-input: #0e0505;
    --text: #fecaca; --text-muted: #c08080; --border: #5a2020;
    --success: #4ade80; --error: #ef4444; --warning: #f59e0b;
    --radius: 10px; --shadow: 0 0 24px rgba(239,68,68,0.08);
    --accent: #ef4444; --accent-soft: rgba(239,68,68,0.14); --text-color: #fecaca;
}

html[data-theme="lavender"] {
    --tg-blue: #7c3aed; --tg-blue-dark: #6d28d9; --tg-blue-light: rgba(124,58,237,0.12);
    --bg: #f5f0ff; --bg-card: #ffffff; --bg-card-hover: #efe8ff; --bg-input: #ffffff;
    --text: #3b0764; --text-muted: #6b7280; --border: #e4d8ff;
    --success: #16a34a; --error: #dc2626; --warning: #d97706;
    --radius: 16px; --shadow: 0 6px 18px rgba(124,58,237,0.08);
    --accent: #7c3aed; --accent-soft: rgba(124,58,237,0.1); --text-color: #3b0764;
}
html[data-theme="lavender"] .navbar { background: rgba(255,255,255,0.95); }

html[data-theme="slate"] {
    --tg-blue: #38bdf8; --tg-blue-dark: #0ea5e9; --tg-blue-light: rgba(56,189,248,0.14);
    --bg: #0f172a; --bg-card: #1e293b; --bg-card-hover: #273548; --bg-input: #0b1220;
    --text: #e2e8f0; --text-muted: #94a3b8; --border: #334155;
    --success: #22c55e; --error: #ef4444; --warning: #f59e0b;
    --radius: 12px; --shadow: 0 8px 28px rgba(0,0,0,0.35);
    --accent: #38bdf8; --accent-soft: rgba(56,189,248,0.12); --text-color: #e2e8f0;
}

html[data-theme="neon-lime"] {
    --tg-blue: #a3e635; --tg-blue-dark: #84cc16; --tg-blue-light: rgba(163,230,53,0.14);
    --bg: #070b02; --bg-card: #101808; --bg-card-hover: #182410; --bg-input: #040700;
    --text: #ecfccb; --text-muted: #8faf5a; --border: #2f4518;
    --success: #a3e635; --error: #fb7185; --warning: #fde047;
    --radius: 4px; --shadow: 0 0 20px rgba(163,230,53,0.08);
    --accent: #a3e635; --accent-soft: rgba(163,230,53,0.12); --text-color: #ecfccb;
    --font-ui: 'Consolas', 'Courier New', monospace; --btn-radius: 4px;
}

html[data-theme="sakura"] {
    --tg-blue: #ec4899; --tg-blue-dark: #db2777; --tg-blue-light: rgba(236,72,153,0.12);
    --bg: #fff5f8; --bg-card: #ffffff; --bg-card-hover: #ffeaf2; --bg-input: #ffffff;
    --text: #831843; --text-muted: #9f6b80; --border: #f9cfe0;
    --success: #16a34a; --error: #e11d48; --warning: #d97706;
    --radius: 16px; --shadow: 0 6px 18px rgba(236,72,153,0.08);
    --accent: #ec4899; --accent-soft: rgba(236,72,153,0.1); --text-color: #831843;
}
html[data-theme="sakura"] .navbar { background: rgba(255,255,255,0.95); }

html[data-theme="desert"] {
    --tg-blue: #d97706; --tg-blue-dark: #b45309; --tg-blue-light: rgba(217,119,6,0.16);
    --bg: #1a140c; --bg-card: #2a2014; --bg-card-hover: #3a2c1a; --bg-input: #120e08;
    --text: #ffedd5; --text-muted: #c4a574; --border: #5a4020;
    --success: #86efac; --error: #f87171; --warning: #fbbf24;
    --radius: 12px; --shadow: 0 8px 28px rgba(0,0,0,0.35);
    --accent: #d97706; --accent-soft: rgba(217,119,6,0.14); --text-color: #ffedd5;
}

html[data-theme="abyss"] {
    --tg-blue: #a78bfa; --tg-blue-dark: #8b5cf6; --tg-blue-light: rgba(167,139,250,0.16);
    --bg: #07050f; --bg-card: #120c1e; --bg-card-hover: #1a1230; --bg-input: #04030a;
    --text: #ddd6fe; --text-muted: #9080c0; --border: #2a2048;
    --success: #34d399; --error: #f472b6; --warning: #fbbf24;
    --radius: 12px; --shadow: 0 8px 28px rgba(0,0,0,0.4);
    --accent: #a78bfa; --accent-soft: rgba(167,139,250,0.14); --text-color: #ddd6fe;
}

html[data-theme="mint"] {
    --tg-blue: #10b981; --tg-blue-dark: #059669; --tg-blue-light: rgba(16,185,129,0.12);
    --bg: #f0fdf7; --bg-card: #ffffff; --bg-card-hover: #e6faf1; --bg-input: #ffffff;
    --text: #064e3b; --text-muted: #5b8a78; --border: #ccecdd;
    --success: #10b981; --error: #dc2626; --warning: #d97706;
    --radius: 14px; --shadow: 0 6px 18px rgba(16,185,129,0.08);
    --accent: #10b981; --accent-soft: rgba(16,185,129,0.1); --text-color: #064e3b;
}
html[data-theme="mint"] .navbar { background: rgba(255,255,255,0.95); }

html[data-theme="copper"] {
    --tg-blue: #d97757; --tg-blue-dark: #c45d3c; --tg-blue-light: rgba(217,119,87,0.16);
    --bg: #1a100a; --bg-card: #2a1a10; --bg-card-hover: #3a2416; --bg-input: #120a06;
    --text: #ffedd5; --text-muted: #c4a080; --border: #5a3828;
    --success: #86efac; --error: #f87171; --warning: #fbbf24;
    --radius: 10px; --shadow: 0 8px 28px rgba(0,0,0,0.35);
    --accent: #d97757; --accent-soft: rgba(217,119,87,0.14); --text-color: #ffedd5;
}

html[data-theme="cobalt"] {
    --tg-blue: #3b82f6; --tg-blue-dark: #2563eb; --tg-blue-light: rgba(59,130,246,0.16);
    --bg: #06101f; --bg-card: #0c1a33; --bg-card-hover: #142744; --bg-input: #040b16;
    --text: #dbeafe; --text-muted: #7ea0c8; --border: #1e3a5f;
    --success: #34d399; --error: #f87171; --warning: #fbbf24;
    --radius: 12px; --shadow: 0 8px 28px rgba(0,0,0,0.35);
    --accent: #3b82f6; --accent-soft: rgba(59,130,246,0.14); --text-color: #dbeafe;
}

html[data-theme="grape"] {
    --tg-blue: #c084fc; --tg-blue-dark: #a855f7; --tg-blue-light: rgba(192,132,252,0.16);
    --bg: #12081a; --bg-card: #221033; --bg-card-hover: #2e1645; --bg-input: #0c0512;
    --text: #f3e8ff; --text-muted: #b89ad0; --border: #4a2868;
    --success: #4ade80; --error: #fb7185; --warning: #fbbf24;
    --radius: 14px; --shadow: 0 8px 28px rgba(0,0,0,0.35);
    --accent: #c084fc; --accent-soft: rgba(192,132,252,0.14); --text-color: #f3e8ff;
}

html[data-theme="matcha"] {
    --tg-blue: #65a30d; --tg-blue-dark: #4d7c0f; --tg-blue-light: rgba(101,163,13,0.12);
    --bg: #f4faf0; --bg-card: #ffffff; --bg-card-hover: #ebf5e4; --bg-input: #ffffff;
    --text: #365314; --text-muted: #6b8a52; --border: #d6e8c4;
    --success: #65a30d; --error: #dc2626; --warning: #ca8a04;
    --radius: 14px; --shadow: 0 6px 18px rgba(101,163,13,0.08);
    --accent: #65a30d; --accent-soft: rgba(101,163,13,0.1); --text-color: #365314;
}
html[data-theme="matcha"] .navbar { background: rgba(255,255,255,0.95); }

html[data-theme="noir"] {
    --tg-blue: #ffffff; --tg-blue-dark: #e5e5e5; --tg-blue-light: rgba(255,255,255,0.12);
    --bg: #000000; --bg-card: #141414; --bg-card-hover: #1f1f1f; --bg-input: #0a0a0a;
    --text: #f5f5f5; --text-muted: #a3a3a3; --border: #333333;
    --success: #ffffff; --error: #ff4d4d; --warning: #ffd166;
    --radius: 2px; --shadow: none;
    --accent: #ffffff; --accent-soft: rgba(255,255,255,0.08); --text-color: #f5f5f5;
    --btn-radius: 2px; --card-border-width: 1px;
}
html[data-theme="noir"] .btn-primary {
    background: #ffffff;
    color: #000000;
}
html[data-theme="noir"] .btn-primary:hover {
    background: #e5e5e5;
    color: #000000;
}

html[data-theme="candy"] {
    --tg-blue: #f472b6; --tg-blue-dark: #ec4899; --tg-blue-light: rgba(244,114,182,0.14);
    --bg: #fff7fb; --bg-card: #ffffff; --bg-card-hover: #ffeef7; --bg-input: #ffffff;
    --text: #7c3aed; --text-muted: #9ca3af; --border: #f9d5e8;
    --success: #34d399; --error: #f43f5e; --warning: #f59e0b;
    --radius: 18px; --shadow: 0 8px 22px rgba(244,114,182,0.1);
    --accent: #f472b6; --accent-soft: rgba(244,114,182,0.12); --text-color: #7c3aed;
}
html[data-theme="candy"] .navbar { background: rgba(255,255,255,0.95); }
html[data-theme="candy"] .btn-primary {
    background: linear-gradient(135deg, #f472b6, #a78bfa);
    border: none;
}

/* ── Shared theme application ── */
body {
    font-family: var(--font-ui);
}

.btn {
    border-radius: var(--btn-radius, 8px);
}

.card {
    border-width: var(--card-border-width, 1px);
}

/* Theme picker UI */
.theme-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.85rem;
}

.theme-option {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius-sm, 8px);
    background: var(--bg-input);
    cursor: pointer;
    text-align: left;
    color: var(--text);
    transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
    font-family: inherit;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    width: 100%;
    appearance: none;
    -webkit-appearance: none;
}

.theme-option * {
    pointer-events: none;
}

.theme-option:hover {
    border-color: var(--tg-blue);
    transform: translateY(-2px);
}

.theme-option.is-active {
    border-color: var(--tg-blue);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.theme-option-swatch {
    display: grid;
    grid-template-columns: 1.4fr 1fr 0.7fr 0.7fr;
    height: 36px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.15);
}

.theme-option-swatch span {
    display: block;
}

.theme-option-name {
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1.2;
}

.theme-option-desc {
    font-size: 0.7rem;
    color: var(--text-muted);
    line-height: 1.3;
}

/* Navbar theme icons for multi-theme */
.theme-icon-palette { display: none; }
html:not([data-theme="default"]):not([data-theme="dark"]):not([data-theme="light"]) .theme-icon-dark,
html:not([data-theme="default"]):not([data-theme="dark"]):not([data-theme="light"]) .theme-icon-light {
    display: none !important;
}
html:not([data-theme="default"]):not([data-theme="dark"]):not([data-theme="light"]) .theme-icon-palette {
    display: inline-block !important;
}
html[data-theme="default"] .theme-icon-palette,
html[data-theme="dark"] .theme-icon-palette,
html[data-theme="light"] .theme-icon-palette {
    display: none;
}
html[data-theme="default"] .theme-icon-light,
html[data-theme="dark"] .theme-icon-light { display: none; }
html[data-theme="default"] .theme-icon-dark,
html[data-theme="dark"] .theme-icon-dark { display: inline-block; }
html[data-theme="light"] .theme-icon-dark { display: none; }
html[data-theme="light"] .theme-icon-light { display: inline-block; }

@media (max-width: 640px) {
    .theme-picker-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
