/* ============================================================
   ОБЩИЕ СТИЛИ КУРСА
   Единый файл для всех страниц
   ============================================================ */

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

/* ============================================================
   🎛️ ГЛАВНЫЙ БЛОК УПРАВЛЕНИЯ
   ============================================================ */
:root {
    /* Цвета */
    --bg: #f5f7fc;
    --bg-card: #ffffff;
    --bg-card-2: #f8fafc;
    --border: #e2e8f0;
    --text: #1e293b;
    --text-dim: #64748b;

    --primary: #10b981;
    --accent: #059669;
    --primary-dark: #047857;
    --tint: #d1fae5;
    --shadow-color: rgba(16,185,129,0.4);

    /* Три уровня шрифтов — работают и в body, и в SVG */
    --fs: 1em;      /* мелкий    */
    --fm: 1.2em;    /* основной  */
    --fl: 1.5em;    /* крупный   */
}

/* ============ 10 ТЕМ БЛОКОВ ============ */
[data-block="1"]  { --primary: #10b981; --accent: #059669; --primary-dark: #047857; --tint: #d1fae5; --shadow-color: rgba(16,185,129,0.4); }
[data-block="2"]  { --primary: #3b82f6; --accent: #2563eb; --primary-dark: #1d4ed8; --tint: #dbeafe; --shadow-color: rgba(59,130,246,0.4); }
[data-block="3"]  { --primary: #8b5cf6; --accent: #7c3aed; --primary-dark: #6d28d9; --tint: #ede9fe; --shadow-color: rgba(139,92,246,0.4); }
[data-block="4"]  { --primary: #f59e0b; --accent: #d97706; --primary-dark: #b45309; --tint: #fef3c7; --shadow-color: rgba(245,158,11,0.4); }
[data-block="5"]  { --primary: #ec4899; --accent: #db2777; --primary-dark: #be185d; --tint: #fce7f3; --shadow-color: rgba(236,72,153,0.4); }
[data-block="6"]  { --primary: #ef4444; --accent: #dc2626; --primary-dark: #b91c1c; --tint: #fee2e2; --shadow-color: rgba(239,68,68,0.4); }
[data-block="7"]  { --primary: #6366f1; --accent: #4f46e5; --primary-dark: #4338ca; --tint: #e0e7ff; --shadow-color: rgba(99,102,241,0.4); }
[data-block="8"]  { --primary: #eab308; --accent: #ca8a04; --primary-dark: #a16207; --tint: #fef9c3; --shadow-color: rgba(234,179,8,0.4); }
[data-block="9"]  { --primary: #14b8a6; --accent: #0d9488; --primary-dark: #0f766e; --tint: #ccfbf1; --shadow-color: rgba(20,184,166,0.4); }
[data-block="10"] { --primary: #a855f7; --accent: #9333ea; --primary-dark: #7e22ce; --tint: #f3e8ff; --shadow-color: rgba(168,85,247,0.4); }

html, body {
    overflow-x: hidden;
    max-width: 100%;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.4;
    padding: 24px;
    font-size: 16px;
}

.container { max-width: 1150px; margin: 0 auto; position: relative; z-index: 1; }

/* ============ ФОН ============ */
.bg-particles {
    position: fixed; inset: 0;
    pointer-events: none; z-index: 0; overflow: hidden;
}
.bg-particles span {
    position: absolute;
    font-size: 1.5rem;
    opacity: 0.05;
    animation: floatUp linear infinite;
}
@keyframes floatUp {
    0% { transform: translateY(100vh) rotate(0deg); opacity: 0; }
    10% { opacity: 0.08; }
    90% { opacity: 0.08; }
    100% { transform: translateY(-100px) rotate(360deg); opacity: 0; }
}

/* ============================================================
   ГЛАВНАЯ — HERO
   ============================================================ */
.hero {
    background: linear-gradient(135deg, #0f172a 0%, #7c3aed 40%, #ec4899 100%);
    color: white;
    padding: 64px 56px;
    border-radius: 40px;
    margin-bottom: 40px;
    position: relative;
    overflow: hidden;
    min-height: 420px;
    box-shadow: 0 24px 48px -12px rgba(124, 58, 237, 0.35);
}
.hero::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(236,72,153,0.35) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(59,130,246,0.25) 0%, transparent 40%);
    pointer-events: none;
}
.hero::after {
    content: '';
    position: absolute; inset: 0;
    background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 100% 40px;
    mask-image: radial-gradient(circle at 70% 50%, black 20%, transparent 80%);
    -webkit-mask-image: radial-gradient(circle at 70% 50%, black 20%, transparent 80%);
    pointer-events: none;
}
.hero-content { position: relative; z-index: 5; max-width: 800px; }
.hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(12px);
    padding: 8px 20px;
    border-radius: 100px;
    font-size: var(--fs);
    font-weight: 700;
    margin-bottom: 24px;
    border: 1px solid rgba(255,255,255,0.2);
    letter-spacing: 0.5px;
}
.hero h1 {
    font-size: var(--fl);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 16px;
    background: linear-gradient(180deg, #ffffff 0%, #f9a8d4 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1.05;
}
.hero p {
    font-size: var(--fm);
    color: #fbcfe8;
    margin-bottom: 32px;
    line-height: 1.55;
    max-width: 640px;
}
.hero-stats {
    display: flex;
    gap: 40px;
    flex-wrap: wrap;
    align-items: flex-start;
    row-gap: 20px;
    position: relative;
    z-index: 2;
    margin-top: 24px;
}
.hero-stat {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}
.hero-stat .value {
    font-size: var(--fl);
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.02em;
    color: #ffffff;
    white-space: nowrap;
    background: linear-gradient(180deg, #ffffff 0%, #fbcfe8 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.hero-stat .label {
    font-size: var(--fs);
    color: #fbcfe8;
    margin-top: 4px;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    opacity: 0.85;
    white-space: nowrap;
}

/* ---------- ЛЕТАЮЩИЕ ЭМОДЗИ ---------- */
.hero-notes {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 1;
    perspective: 1000px;
}
.hero-note-emoji {
    position: absolute;
    bottom: -160px;
    opacity: 0;
    animation: emojiFloat linear infinite;
    will-change: transform, opacity, filter;
    user-select: none;
    line-height: 1;
}
.hero-note-emoji.far { font-size: 3rem; filter: blur(5px) drop-shadow(0 6px 20px rgba(236,72,153,0.15)); }
.hero-note-emoji.far-1 { font-size: 2.8rem; filter: blur(6px) drop-shadow(0 4px 12px rgba(236,72,153,0.1)); }
.hero-note-emoji.far-2 { font-size: 3.2rem; filter: blur(5px) drop-shadow(0 6px 18px rgba(236,72,153,0.12)); }
.hero-note-emoji.far-3 { font-size: 3.5rem; filter: blur(4.5px) drop-shadow(0 6px 20px rgba(236,72,153,0.15)); }
.hero-note-emoji.mid { font-size: 7rem; filter: blur(2px) drop-shadow(0 8px 25px rgba(236,72,153,0.3)); }
.hero-note-emoji.mid-1 { font-size: 6rem; filter: blur(2.5px) drop-shadow(0 8px 25px rgba(236,72,153,0.25)); }
.hero-note-emoji.mid-2 { font-size: 7.5rem; filter: blur(1.8px) drop-shadow(0 8px 25px rgba(236,72,153,0.32)); }
.hero-note-emoji.mid-3 { font-size: 8rem; filter: blur(1.5px) drop-shadow(0 8px 25px rgba(236,72,153,0.35)); }
.hero-note-emoji.near { font-size: 20rem; filter: blur(0px) drop-shadow(0 12px 40px rgba(236,72,153,0.55)); }
.hero-note-emoji.near-1 { font-size: 18rem; filter: blur(0.5px) drop-shadow(0 12px 40px rgba(236,72,153,0.5)); }
.hero-note-emoji.near-2 { font-size: 24rem; filter: blur(0px) drop-shadow(0 14px 50px rgba(236,72,153,0.6)); }
.hero-note-emoji.near-3 { font-size: 30rem; filter: blur(0px) drop-shadow(0 16px 60px rgba(236,72,153,0.65)); }
.hero-note-emoji.near-4 { font-size: 33rem; filter: blur(0px) drop-shadow(0 18px 70px rgba(236,72,153,0.7)); }

.hero-note-emoji.e1  { left: 50%; animation-duration: 26s; animation-delay: 0s;    --max-opacity: 0.14; }
.hero-note-emoji.e2  { left: 62%; animation-duration: 30s; animation-delay: -4s;   --max-opacity: 0.10; }
.hero-note-emoji.e3  { left: 74%; animation-duration: 24s; animation-delay: -8s;   --max-opacity: 0.32; }
.hero-note-emoji.e4  { left: 84%; animation-duration: 32s; animation-delay: -12s;  --max-opacity: 0.08; }
.hero-note-emoji.e5  { left: 56%; animation-duration: 22s; animation-delay: -16s;  --max-opacity: 0.55; }
.hero-note-emoji.e6  { left: 70%; animation-duration: 28s; animation-delay: -6s;   --max-opacity: 0.28; }
.hero-note-emoji.e7  { left: 90%; animation-duration: 25s; animation-delay: -18s;  --max-opacity: 0.20; }
.hero-note-emoji.e8  { left: 46%; animation-duration: 34s; animation-delay: -10s;  --max-opacity: 0.07; }
.hero-note-emoji.e9  { left: 80%; animation-duration: 20s; animation-delay: -2s;   --max-opacity: 0.65; }
.hero-note-emoji.e10 { left: 96%; animation-duration: 29s; animation-delay: -14s;  --max-opacity: 0.42; }

@keyframes emojiFloat {
    0%   { transform: translateY(0) translateX(0) rotate(-15deg) scale(0.9); opacity: 0; }
    15%  { opacity: calc(var(--max-opacity, 0.2) * 0.7); }
    50%  { transform: translateY(-380px) translateX(30px) rotate(12deg) scale(1.05); opacity: var(--max-opacity, 0.2); }
    85%  { opacity: calc(var(--max-opacity, 0.2) * 0.8); }
    100% { transform: translateY(-820px) translateX(-20px) rotate(-8deg) scale(0.95); opacity: 0; }
}

.hero-glow {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(50px);
    opacity: 0.5;
    z-index: 0;
}
.hero-glow.g1 {
    width: 320px; height: 320px;
    background: radial-gradient(circle, rgba(236,72,153,0.5), transparent 70%);
    top: -60px; right: 8%;
    animation: glowPulse 8s ease-in-out infinite;
}
.hero-glow.g2 {
    width: 260px; height: 260px;
    background: radial-gradient(circle, rgba(124,58,237,0.5), transparent 70%);
    bottom: -70px; right: 28%;
    animation: glowPulse 10s ease-in-out infinite 2s;
}
@keyframes glowPulse {
    0%, 100% { transform: scale(1); opacity: 0.4; }
    50%      { transform: scale(1.15); opacity: 0.65; }
}

/* ============================================================
   ДАШБОРД
   ============================================================ */
.dashboard {
    background: var(--bg-card);
    border-radius: 32px;
    padding: 40px 48px;
    margin-bottom: 40px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.dashboard h2 {
    font-size: var(--fl);
    font-weight: 900;
    margin-bottom: 24px;
    display: flex; align-items: center; gap: 12px;
}
.dashboard-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 32px;
    align-items: center;
    min-width: 0;
    width: 100%;
}
.dashboard-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
}
.dash-stat {
    background: var(--bg-card-2);
    border-radius: 20px;
    padding: 18px 20px;
    border: 1px solid var(--border);
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.dash-stat .value {
    font-size: var(--fl);
    font-weight: 900;
    background: linear-gradient(135deg, #10b981, #8b5cf6, #ec4899);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dash-stat .label {
    font-size: var(--fs);
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    font-weight: 700;
    margin-top: 6px;
    line-height: 1.3;
    overflow-wrap: anywhere;
    hyphens: auto;
}

.chart-container {
    position: relative;
    height: 280px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
}
.chart-container canvas {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 100% !important;
    box-sizing: border-box;
}

.dash-actions {
    display: flex;
    gap: 10px;
    margin-top: 24px;
    flex-wrap: wrap;
}
.btn-danger {
    background: #fee2e2;
    color: #dc2626;
    border: 2px solid #fca5a5;
}
.btn-danger:hover { background: #fecaca; transform: translateY(-3px); }

/* ---------- СЕТКА БЛОКОВ ---------- */
.blocks-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}
.block-card {
    background: var(--bg-card);
    border-radius: 28px;
    overflow: hidden;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    transition: all 0.4s;
    position: relative;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    min-width: 0;
    box-sizing: border-box;
}
.block-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 24px 48px -12px var(--shadow-color, rgba(0,0,0,0.2));
    border-color: var(--primary);
}
.block-card-header {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    padding: 28px 28px 24px;
    position: relative;
    overflow: hidden;
    color: white;
    min-height: 150px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}
.block-card-header::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        radial-gradient(circle at 80% 20%, rgba(255,255,255,0.2) 0%, transparent 40%),
        radial-gradient(circle at 20% 80%, rgba(0,0,0,0.1) 0%, transparent 40%);
    pointer-events: none;
}
.block-card-emoji-bg {
    position: absolute;
    right: -10px; bottom: -20px;
    font-size: 8rem;
    opacity: 0.18;
    transform: rotate(-12deg);
    pointer-events: none;
}
.block-card-num {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(10px);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: var(--fs);
    font-weight: 800;
    letter-spacing: 1px;
    width: fit-content;
    position: relative;
    z-index: 2;
    border: 1px solid rgba(255,255,255,0.25);
}
.block-card-title {
    font-size: var(--fl);
    font-weight: 800;
    line-height: 1.15;
    position: relative;
    z-index: 2;
    margin-top: 20px;
    text-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.block-card-body {
    padding: 22px 28px 26px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.block-card-desc {
    font-size: var(--fm);
    color: var(--text-dim);
    line-height: 1.5;
    flex: 1;
}
.block-card-progress {
    display: flex;
    align-items: center;
    gap: 10px;
}
.mini-bar {
    flex: 1;
    height: 6px;
    background: var(--border);
    border-radius: 100px;
    overflow: hidden;
}
.mini-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 100px;
    transition: width 0.8s;
    width: 0%;
}
.mini-percent {
    font-size: var(--fs);
    font-weight: 800;
    color: var(--primary);
    min-width: 36px;
    text-align: right;
}
.test-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: var(--fs);
    font-weight: 800;
    padding: 4px 10px;
    border-radius: 100px;
    background: #dcfce7;
    color: #15803d;
}
.test-badge.empty  { background: #f1f5f9; color: #64748b; }
.test-badge.medium { background: #fef3c7; color: #a16207; }
.test-badge.low    { background: #fee2e2; color: #b91c1c; }
.block-card.completed .block-card-header::after {
    content: '✓';
    position: absolute;
    top: 16px; right: 16px;
    width: 32px; height: 32px;
    background: rgba(255,255,255,0.95);
    color: var(--primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 900;
    z-index: 3;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* ============================================================
   ЭЛЕМЕНТЫ СТРАНИЦ БЛОКОВ
   ============================================================ */

.top-progress {
    position: fixed; top: 0; left: 0;
    width: 100%; height: 4px;
    background: rgba(226,232,240,0.6);
    z-index: 1000;
    backdrop-filter: blur(10px);
}
.top-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    width: 0%;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 0 100px 100px 0;
    box-shadow: 0 0 12px var(--shadow-color);
}

.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
    font-size: var(--fs);
    color: var(--text-dim);
    flex-wrap: wrap;
}
.breadcrumbs a {
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
    padding: 4px 8px;
    border-radius: 6px;
}
.breadcrumbs a:hover { color: var(--primary); background: var(--tint); }
.breadcrumbs .sep { opacity: 0.5; }
.breadcrumbs .current {
    color: var(--primary-dark);
    font-weight: 700;
    background: var(--tint);
    padding: 4px 10px;
    border-radius: 6px;
}

/* ---------- ШАПКА БЛОКА ---------- */
.block-hero {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 50%, var(--primary-dark) 100%);
    color: white;
    padding: 56px 48px;
    border-radius: 40px;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
    min-height: 320px;
    box-shadow: 0 24px 48px -12px var(--shadow-color);
}
.block-hero::before {
    content: '';
    position: absolute; inset: 0;
    background-image:
        radial-gradient(circle at 20% 30%, rgba(255,255,255,0.2) 0%, transparent 40%),
        radial-gradient(circle at 80% 70%, rgba(255,255,255,0.1) 0%, transparent 40%);
    pointer-events: none;
}
.block-hero::after {
    content: '';
    position: absolute; inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: radial-gradient(circle at 50% 50%, black 30%, transparent 85%);
    -webkit-mask-image: radial-gradient(circle at 50% 50%, black 30%, transparent 85%);
    pointer-events: none;
}

.hero-emoji-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
}
.hero-emoji-bg span {
    position: absolute;
    font-size: 4rem;
    opacity: 0.12;
    animation: heroFloat 8s ease-in-out infinite;
}
.hero-emoji-bg span:nth-child(1) { top: 10%; right: 8%; animation-delay: 0s; }
.hero-emoji-bg span:nth-child(2) { top: 55%; right: 22%; animation-delay: 1.5s; font-size: 5rem; }
.hero-emoji-bg span:nth-child(3) { bottom: 12%; right: 5%; animation-delay: 3s; font-size: 3.5rem; }
.hero-emoji-bg span:nth-child(4) { top: 25%; right: 40%; animation-delay: 2s; opacity: 0.08; }
@keyframes heroFloat {
    0%, 100% { transform: translateY(0) rotate(-5deg); opacity: 0.12; }
    50% { transform: translateY(-16px) rotate(5deg); opacity: 0.22; }
}

.block-hero-content { position: relative; z-index: 2; }
.block-hero-badge {
    display: inline-block;
    background: rgba(255,255,255,0.18);
    backdrop-filter: blur(12px);
    padding: 8px 20px;
    border-radius: 100px;
    font-size: var(--fs);
    font-weight: 800;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.25);
    letter-spacing: 1px;
    text-transform: uppercase;
}
.block-hero h1 {
    font-size: var(--fl);
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 12px;
    line-height: 1.1;
    text-shadow: 0 4px 16px rgba(0,0,0,0.15);
}
.block-hero p {
    font-size: var(--fm);
    max-width: 640px;
    position: relative;
    z-index: 2;
    margin-bottom: 24px;
    line-height: 1.55;
    color: rgba(255,255,255,0.92);
}
.block-hero .hero-stats {
    position: relative;
    z-index: 2;
}
.block-hero .hero-stat .value {
    color: #ffffff;
    -webkit-text-fill-color: #ffffff;
    background: none;
}
.block-hero .hero-stat .label {
    color: #ffffff;
    opacity: 0.85;
}

/* ---------- БЫСТРАЯ НАВИГАЦИЯ ---------- */
.quick-nav {
    background: rgba(255,255,255,0.92);
    border-radius: 24px;
    padding: 18px 24px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    position: sticky;
    top: 12px;
    z-index: 100;
    backdrop-filter: blur(12px);
}
.quick-nav-label {
    font-size: var(--fs);
    font-weight: 800;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-right: 4px;
}
.quick-nav a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 12px;
    border-radius: 100px;
    background: var(--bg-card-2);
    color: var(--text-dim);
    text-decoration: none;
    font-size: var(--fs);
    font-weight: 700;
    transition: all 0.25s;
    border: 1px solid transparent;
}
.quick-nav a:hover {
    background: var(--tint);
    color: var(--primary-dark);
    border-color: var(--primary);
    transform: translateY(-2px);
}
.quick-nav a.home { background: var(--primary); color: white; }
.quick-nav a.home:hover { background: var(--accent); }

/* ---------- СОДЕРЖАНИЕ ---------- */
.toc {
    background: var(--bg-card);
    border-radius: 28px;
    padding: 28px 32px;
    margin-bottom: 32px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.toc h3 {
    font-size: var(--fl);
    font-weight: 800;
    margin-bottom: 20px;
    display: flex; align-items: center; gap: 10px;
}
.toc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 8px;
}
.toc-item {
    display: flex; align-items: center; gap: 8px;
    padding: 8px 14px;
    background: var(--bg-card-2);
    border-radius: 100px;
    font-size: var(--fs);
    color: var(--text-dim);
    text-decoration: none;
    transition: all 0.25s;
    border-left: 4px solid transparent;
    line-height: 1.2;
}
.toc-item:hover {
    background: var(--tint);
    border-left-color: var(--primary);
    transform: translateX(6px);
    color: var(--primary-dark);
    box-shadow: 0 4px 12px var(--shadow-color);
}
.toc-item .num {
    font-weight: 700;
    color: var(--primary);
    font-size: var(--fs);
    min-width: 20px;
}
.toc-item.done {
    background: var(--tint);
    border-left-color: var(--primary);
}
.toc-item.done::after {
    content: '✓';
    color: var(--primary);
    font-weight: 900;
    margin-left: auto;
}

/* ---------- УРОК ---------- */
.lesson {
    background: var(--bg-card);
    border-radius: 32px;
    padding: 36px 40px;
    margin-bottom: 24px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s;
    scroll-margin-top: 100px;
}
.lesson.visible { opacity: 1; transform: translateY(0); }
.lesson:hover {
    box-shadow: 0 12px 40px rgba(0,0,0,0.08), 0 0 0 1px var(--shadow-color);
}
.lesson::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent), var(--primary));
    background-size: 200% 100%;
    animation: gradientShift 4s ease infinite;
}
@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}
.lesson-header {
    display: flex; align-items: center; gap: 18px;
    margin-bottom: 20px; padding-bottom: 16px;
    border-bottom: 1px solid var(--border);
}
.lesson-num {
    display: flex; align-items: center; justify-content: center;
    min-width: 60px; height: 60px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    border-radius: 100px;
    font-weight: 900;
    font-size: var(--fl);
    box-shadow: 0 8px 20px var(--shadow-color), inset 0 1px 0 rgba(255,255,255,0.2);
    flex-shrink: 0;
}
.lesson-title-block { flex: 1; min-width: 0; }
.lesson-title-block h2 {
    font-size: var(--fl);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    line-height: 1.25;
}
.lesson-title-block .subtitle {
    font-size: var(--fm);
    color: var(--text-dim);
    font-weight: 500;
}
.lesson-content p {
    font-size: var(--fm);
    color: #334155;
    margin-bottom: 12px;
    line-height: 1.6;
}
.lesson-content strong { color: var(--text); font-weight: 700; }

/* ---------- HIGHLIGHT BOXES ---------- */
.highlight-box {
    padding: 20px 24px;
    border-radius: 10px;
    margin: 18px 0;
    border-left: 10px solid;
    line-height: 1.5;
    transition: transform 0.25s;
}
.highlight-box:hover { transform: translateX(4px); }
.highlight-box .icon {
    font-size: var(--fl);
    margin-bottom: 6px; display: block;
}
.highlight-box h4 {
    font-size: var(--fl);
    font-weight: 700; margin-bottom: 6px;
}
.highlight-box p {
    font-size: var(--fm);
    margin-bottom: 0;
}
.hb-primary { background: var(--tint); border-color: var(--primary); color: var(--primary-dark); }
.hb-blue { background: #eff6ff; border-color: #2563eb; color: #1e40af; }
.hb-yellow { background: #fefce8; border-color: #ca8a04; color: #854d0e; }
.hb-red { background: #fef2f2; border-color: #dc2626; color: #991b1b; }
.hb-purple { background: #faf5ff; border-color: #8b5cf6; color: #6b21a8; }

/* ---------- QUOTE ---------- */
.quote {
    background: linear-gradient(135deg, #f8fafc, var(--tint));
    border-left: 10px solid var(--primary);
    padding: 20px 28px;
    border-radius: 10px;
    margin: 18px 0;
    position: relative;
    font-style: italic;
    font-size: var(--fm);
    color: var(--primary-dark);
    line-height: 1.5;
}
.quote::before {
    content: '"';
    position: absolute; top: -18px; left: 14px;
    font-size: 4rem; color: var(--primary); opacity: 0.25;
    font-family: Georgia, serif; line-height: 1;
}
.quote-author {
    display: block; margin-top: 8px;
    font-style: normal;
    font-size: var(--fs);
    font-weight: 600;
}

/* ---------- FACT GRID ---------- */
.fact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 12px; margin: 18px 0;
}
.fact-card {
    background: linear-gradient(135deg, #f8fafc, var(--tint));
    border-radius: 20px;
    padding: 18px;
    border: 1px solid var(--border);
    transition: all 0.35s;
    line-height: 1.4;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}
.fact-card:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: 0 16px 32px rgba(0,0,0,0.1), 0 0 0 1px var(--primary);
}
.fact-card .fact-icon { font-size: var(--fl); margin-bottom: 8px; display: block; }
.fact-card .fact-title {
    font-size: var(--fs);
    color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 0.5px;
    font-weight: 700; margin-bottom: 4px;
}
.fact-card .fact-value { font-size: var(--fl); font-weight: 800; margin-bottom: 4px; }
.fact-card .fact-desc { font-size: var(--fm); color: var(--text-dim); flex: 1; }

/* ---------- TABLE ---------- */
.notes-table {
    width: 100%; border-collapse: collapse;
    margin: 16px 0;
    border-radius: 12px;
    overflow: hidden;
    table-layout: auto;
}
.notes-table th {
    padding: 10px 14px;
    background: linear-gradient(135deg, var(--tint), #ffffff);
    color: var(--primary-dark);
    font-weight: 700;
    text-align: left;
    border-bottom: 2px solid var(--primary);
    font-size: var(--fs);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1.25;
    overflow-wrap: anywhere;
    max-width: 240px;
    vertical-align: middle;
}
.notes-table td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: #334155;
    font-size: var(--fm);
    line-height: 1.45;
    overflow-wrap: anywhere;
    max-width: 240px;
    vertical-align: top;
}
.notes-table tr:hover td { background: var(--tint); }

/* ---------- LESSON NAV ---------- */
.lesson-nav {
    display: flex; justify-content: space-between; align-items: center;
    margin-top: 22px; padding-top: 18px;
    border-top: 1px solid var(--border);
    gap: 12px; flex-wrap: wrap;
}
.lesson-nav .status {
    font-size: var(--fm);
    color: var(--text-dim); font-weight: 600;
}
.lesson-nav .status.done { color: var(--primary); }

/* ---------- КНОПКИ ---------- */
.btn {
    padding: 10px 22px;
    border: none;
    border-radius: 100px;
    font-weight: 700;
    font-size: var(--fm);
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    white-space: normal;
    text-align: center;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--accent));
    color: white;
    box-shadow: 0 6px 16px var(--shadow-color);
}
.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 28px var(--shadow-color);
}
.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}
.btn-outline:hover { background: var(--tint); transform: translateY(-3px); }
.btn-large { padding: 14px 28px; }

/* ---------- ПРОГРЕСС КРУГ ---------- */
.progress-circle-wrap {
    display: flex; align-items: center; gap: 20px;
    padding: 24px;
    background: var(--bg-card);
    border-radius: 24px;
    border: 1px solid var(--border);
    margin: 24px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.progress-circle {
    position: relative; width: 110px; height: 110px; flex-shrink: 0;
}
.progress-circle svg { transform: rotate(-90deg); }
.progress-circle .circle-bg { fill: none; stroke: #e2e8f0; stroke-width: 8; }
.progress-circle .circle-fill {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    stroke-dasharray: 283;
    stroke-dashoffset: 283;
    transition: stroke-dashoffset 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}
.progress-circle .circle-text {
    position: absolute; inset: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: var(--fl);
    font-weight: 900; color: var(--primary);
}
.progress-info h5 {
    font-size: var(--fl);
    font-weight: 700; margin-bottom: 6px;
}
.progress-info p {
    font-size: var(--fm);
    color: var(--text-dim); line-height: 1.4;
}

/* ---------- ТЕСТ ---------- */
.test-block {
    background: linear-gradient(135deg, var(--tint), #ffffff);
    border-radius: 32px;
    padding: 36px 40px;
    margin: 32px 0;
    border: 2px solid var(--primary);
    box-shadow: 0 12px 32px var(--shadow-color);
    position: relative;
    overflow: hidden;
}
.test-block::before {
    content: '📝';
    position: absolute;
    top: -20px; right: -20px;
    font-size: 8rem;
    opacity: 0.08;
    transform: rotate(-15deg);
}
.test-block h3 {
    font-size: var(--fl);
    font-weight: 900;
    margin-bottom: 8px;
    color: var(--primary-dark);
    position: relative;
    z-index: 1;
}
.test-block .subtitle {
    font-size: var(--fm);
    color: var(--text-dim);
    margin-bottom: 20px;
    position: relative;
    z-index: 1;
}
.test-question {
    background: white;
    border-radius: 16px;
    padding: 20px 24px;
    margin-bottom: 16px;
    border: 1px solid var(--border);
    position: relative;
    z-index: 1;
    transition: all 0.3s;
}
.test-question.correct { border-color: #16a34a; background: #ecfdf5; }
.test-question.wrong { border-color: #dc2626; background: #fef2f2; }
.test-question .q-num {
    display: inline-block;
    background: var(--primary);
    color: white;
    padding: 2px 10px;
    border-radius: 100px;
    font-size: var(--fs);
    font-weight: 800;
    margin-bottom: 10px;
    letter-spacing: 0.5px;
}
.test-question .q-text {
    font-size: var(--fm);
    font-weight: 700;
    margin-bottom: 14px;
    line-height: 1.4;
}
.test-options { display: flex; flex-direction: column; gap: 8px; }
.test-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    background: var(--bg-card-2);
    border-radius: 10px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-size: var(--fm);
    line-height: 1.3;
    min-width: 0;
}
.test-option:hover { background: var(--tint); border-color: var(--primary); }
.test-option input { display: none; }
.test-option .marker {
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 2px solid var(--border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--fs);
    font-weight: 800;
    color: white;
    transition: all 0.2s;
}
.test-option > span:not(.marker) {
    min-width: 0;
    overflow-wrap: anywhere;
}
.test-option.selected .marker {
    background: var(--primary);
    border-color: var(--primary);
}
.test-option.selected { background: var(--tint); border-color: var(--primary); }
.test-option.correct-answer { background: #dcfce7; border-color: #16a34a; }
.test-option.wrong-answer { background: #fee2e2; border-color: #dc2626; }
.test-option.correct-answer .marker { background: #16a34a; border-color: #16a34a; }
.test-option.wrong-answer .marker { background: #dc2626; border-color: #dc2626; }

.test-result {
    display: none;
    background: white;
    border-radius: 20px;
    padding: 28px;
    margin-top: 20px;
    text-align: center;
    border: 2px solid var(--primary);
    position: relative;
    z-index: 1;
}
.test-result.show { display: block; }
.test-result .score {
    font-size: var(--fl);
    font-weight: 900;
    line-height: 1;
    margin-bottom: 8px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.test-result .verdict {
    font-size: var(--fl);
    font-weight: 800;
    margin-bottom: 16px;
}
.test-result .msg {
    font-size: var(--fm);
    color: var(--text-dim);
    margin-bottom: 20px;
    line-height: 1.5;
}

/* ---------- НАВИГАЦИЯ МЕЖДУ БЛОКАМИ ---------- */
.block-nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 16px;
    margin: 40px 0 24px;
}
.block-nav-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    background: var(--bg-card);
    border-radius: 24px;
    text-decoration: none;
    color: var(--text);
    border: 1px solid var(--border);
    transition: all 0.3s;
    box-shadow: 0 4px 16px rgba(0,0,0,0.04);
    position: relative;
    overflow: hidden;
    min-width: 0;
    box-sizing: border-box;
}
.block-nav-item::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: var(--nav-color, var(--primary));
}
.block-nav-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 32px rgba(0,0,0,0.1);
    border-color: var(--nav-color, var(--primary));
}
.block-nav-item .arrow {
    font-size: var(--fl);
    color: var(--nav-color, var(--primary));
    font-weight: 800;
    flex-shrink: 0;
}
.block-nav-item .info { flex: 1; min-width: 0; }
.block-nav-item .info .label {
    font-size: var(--fs);
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    font-weight: 800;
    margin-bottom: 4px;
}
.block-nav-item .info .title {
    font-size: var(--fl);
    font-weight: 800;
    line-height: 1.2;
}
.block-nav-item.next { text-align: right; flex-direction: row-reverse; }

/* ---------- НАВИГАЦИЯ ПО ВСЕМ БЛОКАМ ---------- */
.footer-nav {
    background: var(--bg-card);
    border-radius: 24px;
    padding: 28px;
    margin-top: 24px;
    border: 1px solid var(--border);
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
}
.footer-nav h4 {
    font-size: var(--fs);
    font-weight: 800;
    margin-bottom: 16px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 1px;
}
.footer-nav-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}
.footer-nav-grid a {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 8px 14px;
    background: var(--bg-card-2);
    border-radius: 100px;
    font-size: var(--fs);
    color: var(--text-dim);
    text-decoration: none;
    font-weight: 700;
    transition: all 0.25s;
    border: 1px solid var(--border);
}
.footer-nav-grid a:hover {
    background: var(--nav-color, var(--primary));
    color: white;
    transform: translateY(-2px);
    border-color: var(--nav-color, var(--primary));
}
.footer-nav-grid a.current {
    background: var(--nav-color, var(--primary));
    color: white;
    border-color: var(--nav-color, var(--primary));
}

/* ============================================================
   ФУТЕР САЙТА
   ============================================================ */
.site-footer {
    margin: 56px 0 24px;
    padding: 48px 40px 32px;
    background:
        radial-gradient(circle at 50% 0%, var(--tint) 0%, transparent 60%),
        var(--bg-card);
    border-radius: 32px;
    border: 1px solid var(--border);
    box-shadow: 0 4px 24px rgba(0,0,0,0.05);
    text-align: center;
    position: relative;
    overflow: hidden;
}
.site-footer::before {
    content: '';
    position: absolute;
    top: 0; left: 50%;
    transform: translateX(-50%);
    width: 120px; height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--accent));
    border-radius: 0 0 4px 4px;
}
.site-footer-inner { max-width: 900px; margin: 0 auto; }
.site-footer-brand { margin-bottom: 32px; }
.site-footer-logo {
    display: inline-block;
    font-size: var(--fl);
    margin-bottom: 12px;
    filter: drop-shadow(0 6px 16px var(--shadow-color));
    animation: footerLogoPulse 3s ease-in-out infinite;
}
@keyframes footerLogoPulse {
    0%, 100% { transform: scale(1); }
    50%      { transform: scale(1.08); }
}
.site-footer-title {
    font-size: var(--fl);
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}
.site-footer-tagline {
    font-size: var(--fm);
    color: var(--text-dim);
    max-width: 520px;
    margin: 0 auto;
    line-height: 1.55;
}
.site-footer-divider {
    width: 60px; height: 2px;
    background: var(--border);
    margin: 0 auto 28px;
    border-radius: 2px;
}
.site-footer-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    margin-bottom: 32px;
    text-align: left;
}
.site-footer-col {
    padding: 20px 22px;
    background: var(--bg-card-2);
    border-radius: 18px;
    border: 1px solid var(--border);
    transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
    min-width: 0;
    box-sizing: border-box;
}
.site-footer-col:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.06);
    border-color: var(--primary);
}
.site-footer-col h5 {
    font-size: var(--fs);
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--primary-dark);
    font-weight: 800;
    margin-bottom: 12px;
}
.site-footer-col p {
    color: var(--text-dim);
    line-height: 1.6;
    margin-bottom: 6px;
    font-size: var(--fm);
    overflow-wrap: anywhere;
}
.site-footer-col p:last-child { margin-bottom: 0; }
.site-footer-col p strong { color: var(--text); }
.site-footer-col a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}
.site-footer-col a:hover {
    color: var(--accent);
    text-decoration: underline;
}
.site-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: var(--fs);
    color: var(--text-dim);
    font-weight: 600;
    letter-spacing: 0.3px;
}
.site-footer-dot {
    width: 5px; height: 5px;
    background: var(--primary);
    border-radius: 50%;
    opacity: 0.6;
}

/* ============================================================
   COOKIE-БАННЕР
   ============================================================ */
.cookie-banner {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 32px);
    max-width: 640px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    color: #f1f5f9;
    padding: 20px 24px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 18px;
    z-index: 9999;
    box-shadow: 0 20px 48px rgba(0,0,0,0.35), 0 0 0 1px rgba(255,255,255,0.06);
    font-size: var(--fm);
    animation: cookieSlideUp 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes cookieSlideUp {
    from { transform: translate(-50%, 140%); opacity: 0; }
    to   { transform: translate(-50%, 0);    opacity: 1; }
}
.cookie-banner-hide {
    animation: cookieSlideDown 0.35s cubic-bezier(0.4, 0, 1, 1) forwards;
}
@keyframes cookieSlideDown {
    from { transform: translate(-50%, 0);    opacity: 1; }
    to   { transform: translate(-50%, 140%); opacity: 0; }
}
.cookie-banner-icon {
    font-size: var(--fl);
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(251, 191, 36, 0.4));
    animation: cookieWiggle 3s ease-in-out infinite;
}
@keyframes cookieWiggle {
    0%, 100% { transform: rotate(-8deg); }
    50%      { transform: rotate(8deg); }
}
.cookie-banner-text {
    flex: 1;
    line-height: 1.5;
    color: #cbd5e1;
    font-size: var(--fm);
}
.cookie-banner-text strong { color: #ffffff; font-weight: 700; }
.cookie-banner-btn {
    background: linear-gradient(135deg, var(--primary, #a855f7), var(--accent, #9333ea));
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 100px;
    font-weight: 800;
    font-size: var(--fm);
    font-family: inherit;
    cursor: pointer;
    transition: all 0.25s;
    flex-shrink: 0;
    letter-spacing: 0.3px;
    box-shadow: 0 6px 16px var(--shadow-color, rgba(168,85,247,0.4));
    white-space: nowrap;
}
.cookie-banner-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 24px var(--shadow-color, rgba(168,85,247,0.55));
    filter: brightness(1.1);
}
.cookie-banner-btn:active { transform: translateY(0) scale(0.97); }

/* ============================================================
   ЗАЩИТА КОНТЕНТА
   ============================================================ */
body.protect-content,
body.protect-content * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
body.protect-content input,
body.protect-content textarea,
body.protect-content select,
body.protect-content [contenteditable="true"],
body.protect-content .allow-select,
body.protect-content .allow-select * {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}
body.protect-content img,
body.protect-content a {
    -webkit-user-drag: none;
    user-drag: none;
}
body.protect-content img { pointer-events: none; }

.copy-toast {
    position: fixed;
    left: 50%;
    bottom: 32px;
    transform: translate(-50%, 20px);
    background: rgba(20, 20, 30, 0.95);
    color: #fff;
    padding: 12px 22px;
    border-radius: 12px;
    font-size: var(--fm);
    font-weight: 500;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(168, 85, 247, 0.4);
    z-index: 100000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, transform 0.25s ease;
    max-width: 90vw;
    text-align: center;
}
.copy-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media print {
    body.protect-content::before {
        content: "Печать и копирование контента запрещены.";
        display: block;
        font-size: var(--fl);
        text-align: center;
        padding: 40px;
        color: #000;
    }
    body.protect-content > *:not(::before) { display: none !important; }
}

/* ============================================================
   ИНТЕРАКТИВНАЯ КЛАВИАТУРА
   ============================================================ */
#interactiveKeyboard g[onclick] { cursor: pointer; }
#interactiveKeyboard g[onclick] rect {
    transition: filter 0.15s ease, fill 0.15s ease, transform 0.1s ease;
}
#interactiveKeyboard g[onclick]:hover rect { filter: brightness(0.92); }
#interactiveKeyboard g[onclick]:active rect { filter: brightness(0.75); }
#interactiveKeyboard g[onclick]:hover rect[fill="#ffffff"] { fill: #ecfdf5; }
#interactiveKeyboard g[onclick]:hover rect[fill="#1e293b"] { fill: #334155; }
#interactiveKeyboard g[onclick] text { pointer-events: none; user-select: none; }
#interactiveKeyboard {
    user-select: none;
    -webkit-user-select: none;
    -webkit-tap-highlight-color: transparent;
}

/* ============================================================
   КНОПКА «НАВЕРХ»
   ============================================================ */
.scroll-top {
    position: fixed;
    bottom: 24px;
    right: 24px;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: #2563eb;
    border: 3px solid #000000;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    font-size: 0;
    line-height: 0;
    color: transparent;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
    transition: opacity 0.35s ease,
                transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                background 0.25s ease,
                box-shadow 0.25s ease;
    z-index: 999;
    -webkit-tap-highlight-color: transparent;
}
.scroll-top.visible {
    opacity: 1;
    transform: translateY(0) scale(1);
}
.scroll-top:hover {
    background: #1d4ed8;
    transform: translateY(-4px) scale(1.06);
    box-shadow: 0 14px 28px rgba(0, 0, 0, 0.3);
}
.scroll-top:active {
    transform: translateY(-2px) scale(1.02);
}
.scroll-top::before {
    content: '';
    display: block;
    width: 22px;
    height: 22px;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><path d='M12 19V5'/><path d='M5 12l7-7 7 7'/></svg>");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    transition: transform 0.25s ease;
}
.scroll-top:hover::before { transform: translateY(-2px); }
@media (prefers-reduced-motion: reduce) {
    .scroll-top, .scroll-top::before { transition: none; }
}

/* ============================================================
   УПРАВЛЕНИЕ ШРИФТАМИ В SVG — ЕДИНЫЙ БЛОК
   ============================================================ */
.visual-scheme svg text[font-size="9"],
.visual-scheme svg text[font-size="10"],
.visual-scheme svg text[font-size="11"],
.visual-scheme svg text[font-size="12"],
.visual-scheme svg text[font-size="13"] {
    font-size: var(--fs) !important;
}
.visual-scheme svg text,
.visual-scheme svg text[font-size] {
    font-size: var(--fm) !important;
}
.visual-scheme svg text[font-size="14"],
.visual-scheme svg text[font-size="15"],
.visual-scheme svg text[font-size="16"] {
    font-size: var(--fl) !important;
}
.visual-scheme svg text[font-size="18"],
.visual-scheme svg text[font-size="20"],
.visual-scheme svg text[font-size="22"],
.visual-scheme svg text[font-size="24"] {
    font-size: calc(var(--fl) * 1.2) !important;
}
.visual-scheme svg tspan { font-size: inherit !important; }
.visual-scheme svg text[style*="font-size"] { font-size: var(--fm) !important; }

/* ============================================================
   📐 VISUAL SCHEME — УНИВЕРСАЛЬНАЯ ВЕРСИЯ
   ============================================================
   Работает и со старыми SVG (с фоновым <rect>),
   и с новыми (без фона). Ничего не ломает.
   ============================================================ */

.visual-scheme {
    background: #ffffff;
    border-radius: 20px;
    padding: 16px;
    margin: 24px 0;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.04);
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    overflow: visible;
    position: relative;
    transition: box-shadow 0.3s;
}

.visual-scheme:hover {
    box-shadow: 0 12px 32px rgba(0,0,0,0.08);
}

/* Мягкий цветной оттенок фона под тему блока.
   Если внутри SVG есть непрозрачный <rect> — он перекроет.
   Если нет — покажется этот оттенок. */
.visual-scheme::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 20px;
    background: var(--tint, #f1f5f9);
    opacity: 0.35;
    z-index: 0;
    pointer-events: none;
}

.visual-scheme svg {
    position: relative;
    z-index: 1;
    display: block;
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    margin: 0 auto;
    padding: 0;
    font-family: 'Inter', sans-serif;
    overflow: visible;
    border-radius: 12px;
    background: transparent;
}

/* Скругление внутреннего <rect> у старых SVG */
.visual-scheme svg > rect:first-child {
    rx: 12;
}

/* ---------- Подпись под схемой ---------- */
.scheme-caption {
    position: relative;
    z-index: 1;
    text-align: center;
    font-size: var(--fm);
    color: var(--text-dim);
    margin-top: 12px;
    padding: 0 8px;
    font-weight: 600;
    overflow-wrap: anywhere;
    word-break: break-word;
}

/* ============================================================
   АВТО-ПОДГОНКА ТЕКСТА — ЗАЩИТА ОТ ПЕРЕПОЛНЕНИЯ
   ============================================================ */

.lesson-content,
.lesson-content *,
.highlight-box,
.highlight-box *,
.fact-card,
.fact-card *,
.quote,
.quote *,
.notes-table td,
.notes-table th,
.toc-item,
.breadcrumbs,
.btn,
.test-option,
.test-question .q-text,
.block-card-desc,
.block-card-title,
.hero p,
.block-hero p,
.lesson-title-block h2,
.lesson-title-block .subtitle,
.dash-stat .label,
.test-badge,
.mini-percent,
.site-footer-col p,
.quick-nav a,
.quick-nav-label,
.site-footer-col h5,
.hero-badge,
.block-hero-badge,
.quote-author {
    max-width: 100%;
    overflow-wrap: anywhere;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
    -webkit-hyphens: auto;
    -ms-hyphens: auto;
    min-width: 0;
}

/* ---------- Размеры через clamp() ---------- */
.lesson-content p,
.lesson-content li {
    font-size: clamp(0.85rem, 2vw, var(--fm));
    line-height: 1.55;
}

.fact-card { padding: clamp(12px, 2.5vw, 20px); }
.fact-card .fact-icon  { font-size: clamp(1.3rem, 4vw, var(--fl)); line-height: 1; flex-shrink: 0; }
.fact-card .fact-title { font-size: clamp(0.6rem, 1.6vw, var(--fs)); line-height: 1.25; }
.fact-card .fact-value { font-size: clamp(0.85rem, 3vw, var(--fl)); line-height: 1.15; margin-bottom: 6px; }
.fact-card .fact-desc  { font-size: clamp(0.7rem, 2vw, var(--fm)); line-height: 1.4; }

.highlight-box h4 { font-size: clamp(0.9rem, 2.5vw, var(--fl)); line-height: 1.25; }
.highlight-box p  { font-size: clamp(0.8rem, 2vw, var(--fm)); line-height: 1.5; }

.btn       { font-size: clamp(0.75rem, 1.8vw, var(--fm)); }
.btn-large { font-size: clamp(0.85rem, 2vw, var(--fm)); }

.test-question .q-text { font-size: clamp(0.85rem, 2vw, var(--fm)); line-height: 1.4; }
.test-option           { font-size: clamp(0.8rem, 1.8vw, var(--fm)); line-height: 1.4; }

.block-card-title { font-size: clamp(1rem, 2.5vw, var(--fl)); line-height: 1.2; }
.block-card-desc  { font-size: clamp(0.78rem, 2vw, var(--fm)); line-height: 1.45; }

.notes-table { table-layout: fixed; width: 100%; }
.notes-table th { font-size: clamp(0.65rem, 1.5vw, var(--fs)); }
.notes-table td { font-size: clamp(0.72rem, 1.8vw, var(--fm)); }

.toc-item      { font-size: clamp(0.72rem, 1.8vw, var(--fs)); line-height: 1.3; }
.toc-item > *  { min-width: 0; }

.breadcrumbs,
.breadcrumbs a,
.breadcrumbs .current { font-size: clamp(0.7rem, 1.8vw, var(--fs)); }

.quick-nav a,
.quick-nav-label { font-size: clamp(0.7rem, 1.8vw, var(--fs)); }

.site-footer-col h5 { font-size: clamp(0.68rem, 1.6vw, var(--fs)); line-height: 1.3; }
.site-footer-col p  { font-size: clamp(0.72rem, 1.8vw, var(--fm)); line-height: 1.5; }

.dash-stat .value { font-size: clamp(1.1rem, 3.5vw, var(--fl)); }
.dash-stat .label { font-size: clamp(0.6rem, 1.6vw, var(--fs)); line-height: 1.3; }

.hero h1,
.block-hero h1 { font-size: clamp(1.6rem, 5vw, var(--fl)); line-height: 1.1; }
.hero p,
.block-hero p { font-size: clamp(0.85rem, 2vw, var(--fm)); line-height: 1.55; }
.hero-badge,
.block-hero-badge { font-size: clamp(0.65rem, 1.6vw, var(--fs)); }

.quote        { font-size: clamp(0.85rem, 2vw, var(--fm)); line-height: 1.5; }
.quote-author { font-size: clamp(0.72rem, 1.7vw, var(--fs)); }

.lesson-title-block h2 { font-size: clamp(1rem, 2.5vw, var(--fl)); line-height: 1.25; }
.lesson-title-block .subtitle { font-size: clamp(0.72rem, 1.8vw, var(--fm)); line-height: 1.35; }

/* ============================================================
   АДАПТИВ
   ============================================================ */
@media (max-width: 900px) {
    body { padding: 14px; line-height: 1.5; }

    .lesson, .toc, .test-block, .block-hero, .quick-nav,
    .progress-circle-wrap, .block-nav, .footer-nav, .site-footer,
    .fact-card, .highlight-box, .quote, .visual-scheme,
    .dashboard, .block-card, .hero {
        max-width: 100%;
        box-sizing: border-box;
    }

    .hero { padding: 36px 22px; border-radius: 24px; min-height: auto; margin-bottom: 28px; }
    .hero-note-emoji.e8,
    .hero-note-emoji.e10,
    .hero-note-emoji.e4 { display: none; }
    .hero-stats { gap: 24px; row-gap: 16px; }
    .hero-stat { gap: 2px; }

    .dashboard { padding: 24px 18px; border-radius: 24px; margin-bottom: 28px; }
    .dashboard-grid { display: block; width: 100%; max-width: 100%; }
    .dashboard-stats {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 20px;
    }
    .dash-stat { padding: 12px 10px; border-radius: 14px; }
    .chart-container { display: none; }
    .dash-actions { flex-direction: column; gap: 8px; margin-top: 20px; }
    .dash-actions .btn { width: 100%; justify-content: center; padding: 12px 18px; }

    .blocks-grid { display: block; width: 100%; max-width: 100%; }
    .blocks-grid > .block-card { display: block; width: 100%; margin-bottom: 16px; }
    .block-card-header { padding: 22px 20px; min-height: 120px; }
    .block-card-emoji-bg { font-size: 6rem; }

    .block-hero { padding: 32px 22px; border-radius: 24px; min-height: auto; }
    .hero-emoji-bg span { font-size: 2.5rem; }
    .hero-stats { gap: 18px; row-gap: 12px; }
    .breadcrumbs { gap: 6px; }
    .breadcrumbs a, .breadcrumbs .current { padding: 4px 8px; }

    .quick-nav { position: static; padding: 14px 16px; gap: 8px; }
    .quick-nav-label { width: 100%; margin-bottom: 4px; }
    .quick-nav a { padding: 8px 14px; }

    .toc { padding: 22px 18px; border-radius: 22px; }
    .toc h3 { margin-bottom: 16px; }
    .toc-grid { grid-template-columns: 1fr; gap: 8px; }
    .toc-item { padding: 12px 16px; line-height: 1.4; }

    .lesson { padding: 24px 18px; border-radius: 22px; }
    .lesson-header { flex-direction: row; align-items: center; gap: 14px; }
    .lesson-num { min-width: 46px; height: 46px; }

    .highlight-box { padding: 18px 20px; border-left-width: 6px; }
    .quote { padding: 18px 20px; border-left-width: 6px; line-height: 1.6; }

    .fact-grid { grid-template-columns: 1fr; gap: 10px; }
    .fact-card { padding: 16px 18px; }

    .visual-scheme { padding: 12px; border-radius: 16px; margin: 18px 0; }
    .visual-scheme::before { border-radius: 16px; }
    .visual-scheme svg { width: 100%; max-width: 100%; min-width: 0; border-radius: 10px; }
    .scheme-caption { line-height: 1.45; padding: 0 6px; font-size: var(--fs); margin-top: 8px; }

    .notes-table { border-radius: 14px; overflow: visible; display: block; border: none; width: 100%; }
    .notes-table thead { display: none; }
    .notes-table tbody,
    .notes-table tr,
    .notes-table td { display: block; width: 100%; box-sizing: border-box; }
    .notes-table tr {
        background: var(--bg-card-2);
        border: 1px solid var(--border);
        border-radius: 16px;
        padding: 14px 16px;
        margin-bottom: 12px;
    }
    .notes-table tr:hover { border-color: var(--primary); }
    .notes-table tr:hover td { background: transparent; }
    .notes-table td {
        padding: 8px 0;
        border: none;
        border-bottom: 1px dashed var(--border);
        line-height: 1.5;
        text-align: left;
        max-width: none;
    }
    .notes-table td:last-child { border-bottom: none; padding-bottom: 0; }
    .notes-table td:first-child {
        padding-top: 0;
        font-weight: 800;
        color: var(--primary-dark);
    }
    .notes-table td::before {
        content: attr(data-label);
        display: block;
        font-weight: 700;
        font-size: var(--fs);
        text-transform: uppercase;
        letter-spacing: 0.5px;
        color: var(--text-dim);
        margin-bottom: 2px;
    }
    .notes-table td:not([data-label])::before,
    .notes-table td[data-label=""]::before { display: none; }

    .lesson-nav { gap: 10px; }
    .btn { padding: 12px 20px; }
    .btn-large { padding: 14px 24px; }

    .progress-circle-wrap { flex-direction: column; text-align: center; padding: 20px; gap: 16px; }

    .test-block { padding: 24px 18px; border-radius: 22px; }
    .test-question { padding: 18px 16px; border-radius: 14px; }
    .test-option { padding: 12px 14px; gap: 12px; }
    .test-option .marker { width: 22px; height: 22px; }
    .test-result { padding: 24px 18px; }

    .block-nav { grid-template-columns: 1fr; gap: 12px; }
    .block-nav-item { padding: 16px 18px; border-radius: 20px; }
    .block-nav-item.next { flex-direction: row; text-align: left; }

    .footer-nav { padding: 20px 16px; }
    .footer-nav-grid { gap: 6px; }
    .footer-nav-grid a { padding: 8px 12px; }

    .scroll-top { width: 46px; height: 46px; border-width: 2.5px; bottom: 16px; right: 16px; }
    .scroll-top::before { width: 20px; height: 20px; }

    .site-footer { padding: 32px 18px 24px; border-radius: 24px; margin: 40px 0 20px; }
    .site-footer-inner { max-width: 100%; padding: 0; }
    .site-footer-brand { margin-bottom: 24px; }
    .site-footer-divider { margin: 0 auto 22px; }
    .site-footer-grid {
        display: grid;
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 24px;
        text-align: left;
    }
    .site-footer-col { padding: 16px 18px; border-radius: 16px; }
    .site-footer-col p { line-height: 1.55; margin-bottom: 6px; }
    .site-footer-bottom { flex-wrap: wrap; gap: 8px; text-align: center; }
}

@media (max-width: 600px) {
    .cookie-banner {
        flex-direction: column;
        text-align: center;
        padding: 20px;
        gap: 14px;
    }
    .cookie-banner-btn { width: 100%; padding: 12px 20px; }
}

@media (max-width: 400px) {
    body { padding: 10px; }

    .hero { padding: 28px 18px; }
    .dashboard { padding: 18px 12px; }
    .dash-stat { padding: 10px 8px; }
    .block-card-header { padding: 18px 16px; min-height: 110px; }
    .block-card-body { padding: 14px 16px 18px; }
    .block-hero { padding: 26px 18px; }
    .lesson { padding: 20px 14px; }
    .toc { padding: 18px 14px; }
    .toc-item { padding: 10px 12px; }

    .site-footer { padding: 26px 14px 20px; }
    .site-footer-col { padding: 14px 14px; }
    .site-footer-grid { gap: 10px; }

    .hero-stats { gap: 18px; row-gap: 12px; }

    .visual-scheme { padding: 8px; border-radius: 14px; margin: 14px 0; }
    .visual-scheme::before { border-radius: 14px; }
    .visual-scheme svg { border-radius: 8px; }
    .scheme-caption { font-size: var(--fs); margin-top: 6px; }
}

@media (max-width: 900px) {
    html {
        font-size: 20px; 
    }
}