/* ============================================================
   Шри Чайтанья Рупа Сарасват Шридхар Говинда Матх — Смоленск
   Дизайн-система 2026: «тёплая редакционная минималистика»
   — крупная антиква + гротеск, шафран и золото
   — плавающая стеклянная навигация, bento-сетки
   — зерно, мягкие свечения, анимации на scroll-timeline
   ============================================================ */

/* ---------- 1. Токены ---------- */
:root {
    --bg:          #f5efe4;
    --bg-2:        #ece3d3;
    --surface:     #fbf8f2;
    --surface-2:   #ffffff;
    --ink:         #1e1813;
    --ink-2:       #574a3e;
    --ink-3:       #8c7d6e;
    --line:        rgba(30, 24, 19, 0.11);
    --line-2:      rgba(30, 24, 19, 0.2);
    --accent:      #d4621b;
    --accent-2:    #b8862b;
    --accent-soft: rgba(212, 98, 27, 0.1);
    --on-accent:   #fffaf2;
    --tulsi:       #4c7a47;
    --red:         #c2362b;
    --glass:       rgba(251, 248, 242, 0.72);
    --shadow-sm:   0 1px 2px rgba(30, 24, 19, 0.06), 0 2px 8px rgba(30, 24, 19, 0.05);
    --shadow:      0 2px 4px rgba(30, 24, 19, 0.04), 0 18px 40px -12px rgba(60, 35, 10, 0.18);
    --shadow-lg:   0 30px 80px -20px rgba(60, 35, 10, 0.3);
    --grad:        linear-gradient(120deg, #d4621b 0%, #e08a2e 45%, #c9a043 100%);
    --orb-1:       rgba(232, 138, 46, 0.35);
    --orb-2:       rgba(201, 160, 67, 0.3);
    --orb-3:       rgba(194, 54, 43, 0.16);

    --font-display: "Cormorant Garamond", "Georgia", "Times New Roman", serif;
    --font-sans:    "Manrope", "Segoe UI", system-ui, -apple-system, sans-serif;
    --font-deva:    "Noto Sans Devanagari", "Mangal", sans-serif;

    --r-sm: 12px;
    --r:    20px;
    --r-lg: 28px;
    --r-xl: 40px;
    --container: 1240px;
    --gutter: clamp(16px, 4vw, 40px);
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --nav-h: 72px;

    color-scheme: light;
}

[data-theme="dark"] {
    --bg:          #0f0c0a;
    --bg-2:        #16110d;
    --surface:     #1a1511;
    --surface-2:   #221b16;
    --ink:         #f3eadb;
    --ink-2:       #c4b5a2;
    --ink-3:       #8a7b6a;
    --line:        rgba(243, 234, 219, 0.1);
    --line-2:      rgba(243, 234, 219, 0.2);
    --accent:      #f08a3c;
    --accent-2:    #e2b656;
    --accent-soft: rgba(240, 138, 60, 0.12);
    --on-accent:   #1a0f06;
    --tulsi:       #86b77e;
    --red:         #e5574a;
    --glass:       rgba(26, 21, 17, 0.66);
    --shadow-sm:   0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow:      0 2px 4px rgba(0, 0, 0, 0.3), 0 20px 50px -15px rgba(0, 0, 0, 0.6);
    --shadow-lg:   0 30px 90px -20px rgba(0, 0, 0, 0.8);
    --grad:        linear-gradient(120deg, #f08a3c 0%, #f3a54a 45%, #e2b656 100%);
    --orb-1:       rgba(240, 138, 60, 0.22);
    --orb-2:       rgba(226, 182, 86, 0.16);
    --orb-3:       rgba(229, 87, 74, 0.14);
    color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]):not([data-theme="dark"]) {
        --bg: #0f0c0a; --bg-2: #16110d; --surface: #1a1511; --surface-2: #221b16;
        --ink: #f3eadb; --ink-2: #c4b5a2; --ink-3: #8a7b6a;
        --line: rgba(243, 234, 219, 0.1); --line-2: rgba(243, 234, 219, 0.2);
        --accent: #f08a3c; --accent-2: #e2b656; --on-accent: #1a0f06;
        --glass: rgba(26, 21, 17, 0.66);
        color-scheme: dark;
    }
}

/* ---------- 2. База ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

@view-transition { navigation: auto; }

html {
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--nav-h) + 32px);
    -webkit-text-size-adjust: 100%;
}
body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
    transition: background-color 0.4s ease, color 0.4s ease;
    min-height: 100vh;
}
/* Зерно поверх всего — едва заметная фактура бумаги */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
[data-theme="dark"] body::before { opacity: 0.07; }

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; }
::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
mark { background: var(--accent-soft); color: var(--accent); border-radius: 4px; padding: 0 2px; }

section {
    position: relative;
    max-width: var(--container);
    margin: 0 auto;
    padding: clamp(64px, 9vw, 120px) var(--gutter);
}

/* ---------- 3. Заголовки секций ---------- */
.section-header {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: end;
    gap: 8px 40px;
    margin-bottom: clamp(36px, 5vw, 60px);
}
.section-tag {
    grid-column: 1 / -1;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--accent);
}
.section-tag::before {
    content: "";
    width: 28px;
    height: 1px;
    background: currentColor;
}
.section-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2.6rem, 6vw, 4.8rem);
    line-height: 0.98;
    letter-spacing: -0.02em;
}
.section-subtitle {
    justify-self: end;
    max-width: 34ch;
    color: var(--ink-2);
    font-size: 1.02rem;
    text-align: right;
    padding-bottom: 8px;
}
.section-divider {
    grid-column: 1 / -1;
    height: 1px;
    margin-top: 20px;
    background: linear-gradient(90deg, var(--line-2), var(--line) 60%, transparent);
}
@media (max-width: 760px) {
    .section-header { grid-template-columns: 1fr; }
    .section-subtitle { justify-self: start; text-align: left; padding: 0; }
}

/* ---------- 4. Кнопки ---------- */
.btn,
.week-btn {
    --b-bg: transparent;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 50px;
    padding: 0 26px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    white-space: nowrap;
    transition: transform 0.35s var(--ease), background-color 0.3s ease,
                color 0.3s ease, border-color 0.3s ease, box-shadow 0.35s ease;
    isolation: isolate;
}
.btn-primary,
.week-btn {
    color: var(--on-accent);
    background: var(--ink);
    box-shadow: var(--shadow-sm);
}
.btn-primary::after,
.week-btn::after {
    content: "→";
    font-weight: 500;
    transition: transform 0.35s var(--ease);
}
.btn-primary:hover,
.week-btn:hover {
    background: var(--accent);
    transform: translateY(-2px);
    box-shadow: 0 14px 30px -10px color-mix(in srgb, var(--accent) 70%, transparent);
}
[data-theme="dark"] .btn-primary,
[data-theme="dark"] .week-btn { background: var(--accent); color: var(--on-accent); }
[data-theme="dark"] .btn-primary:hover,
[data-theme="dark"] .week-btn:hover { background: var(--accent-2); }
.btn-primary:hover::after,
.week-btn:hover::after { transform: translateX(4px); }
.btn-outline {
    color: var(--ink);
    border: 1px solid var(--line-2);
    background: color-mix(in srgb, var(--surface) 50%, transparent);
    backdrop-filter: blur(8px);
}
.btn-outline:hover {
    border-color: var(--ink);
    background: var(--surface-2);
    transform: translateY(-2px);
}

/* ---------- 5. Навигация (плавающая пилюля) ---------- */
.navbar {
    position: fixed;
    top: 14px;
    left: 50%;
    translate: -50% 0;
    z-index: 1000;
    width: min(calc(100% - 28px), 1320px);
    height: var(--nav-h);
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 0 10px 0 12px;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--line);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    transition: box-shadow 0.4s ease, background-color 0.4s ease, top 0.4s var(--ease);
    view-transition-name: navbar;
}
.navbar.scrolled { box-shadow: var(--shadow); top: 10px; }

.navbar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
    padding-right: 6px;
}
.navbar-brand img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 0 0 2px var(--accent-2), 0 0 0 4px color-mix(in srgb, var(--accent-2) 25%, transparent);
}
.brand-text { display: flex; flex-direction: column; line-height: 1.1; }
.brand-text b {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}
.brand-text small {
    font-size: 0.68rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
    font-weight: 600;
}

.nav-links {
    position: relative;
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0 auto;
}
.nav-links a {
    position: relative;
    z-index: 1;
    display: block;
    padding: 9px 14px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink-2);
    transition: color 0.25s ease;
}
.nav-links a:hover,
.nav-links a.active { color: var(--ink); }
.nav-indicator {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 0;
    border-radius: 999px;
    background: var(--surface-2);
    box-shadow: var(--shadow-sm), 0 0 0 1px var(--line);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.45s var(--ease), width 0.45s var(--ease),
                height 0.45s var(--ease), opacity 0.3s ease;
}

.navbar-utility { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-links + .navbar-utility { margin-left: 0; }

.theme-toggle,
.burger {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    background: var(--surface);
    transition: background-color 0.3s ease, transform 0.4s var(--ease);
}
.theme-toggle:hover { transform: rotate(-20deg); background: var(--surface-2); }
.theme-icon { width: 20px; height: 20px; grid-area: 1 / 1; transition: opacity 0.3s, transform 0.5s var(--ease); }
.theme-icon-sun  { opacity: 0; transform: scale(0.5) rotate(-90deg); }
.theme-icon-moon { opacity: 1; }
[data-theme="dark"] .theme-icon-sun  { opacity: 1; transform: none; }
[data-theme="dark"] .theme-icon-moon { opacity: 0; transform: scale(0.5) rotate(90deg); }

.burger { display: none; flex-direction: column; gap: 5px; place-items: initial; align-items: center; justify-content: center; }
.burger span {
    width: 18px;
    height: 1.5px;
    background: var(--ink);
    border-radius: 2px;
    transition: transform 0.35s var(--ease), opacity 0.2s;
}

@media (max-width: 1120px) {   /* 10 пунктов меню; в шапке только эмблема — места хватает с ~1100px */
    .burger { display: flex; }
    .nav-links {
        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        border-radius: var(--r-lg);
        background: var(--surface);
        border: 1px solid var(--line);
        backdrop-filter: blur(22px) saturate(160%);
        -webkit-backdrop-filter: blur(22px) saturate(160%);
        box-shadow: var(--shadow-lg);
        opacity: 0;
        visibility: hidden;
        transform: translateY(-10px) scale(0.98);
        transform-origin: top center;
        transition: opacity 0.3s ease, transform 0.4s var(--ease), visibility 0.3s;
    }
    .nav-links.open { opacity: 1; visibility: visible; transform: none; }
    .nav-links a { padding: 14px 18px; font-size: 1.05rem; }
    .nav-links.open ~ .navbar-utility .burger span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
    .nav-links.open ~ .navbar-utility .burger span:nth-child(2) { opacity: 0; }
    .nav-links.open ~ .navbar-utility .burger span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }
}
@media (max-width: 480px) {
    :root { --nav-h: 62px; }
    .navbar-brand img { width: 40px; height: 40px; }
    .brand-text b { font-size: 1.1rem; }
    .theme-toggle, .burger { width: 42px; height: 42px; }
}

/* ---------- 6. Hero ---------- */
.hero {
    max-width: none;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: calc(var(--nav-h) + 60px) var(--gutter) 60px;
    overflow: hidden;
}
.hero-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    will-change: translate, scale;
    animation: orb-float 18s ease-in-out infinite alternate;
}
.hero-orb-1 { width: 46vw; height: 46vw; right: -8vw; top: 4vh; background: radial-gradient(circle, var(--orb-1), transparent 65%); }
.hero-orb-2 { width: 32vw; height: 32vw; left: -10vw; bottom: -8vh; background: radial-gradient(circle, var(--orb-2), transparent 65%); animation-delay: -6s; }
.hero-orb-3 { width: 22vw; height: 22vw; left: 40%; top: 20%; background: radial-gradient(circle, var(--orb-3), transparent 65%); animation-delay: -12s; }
@keyframes orb-float {
    to { translate: 4vw -3vh; scale: 1.12; }
}

.hero-inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: var(--container);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    align-items: center;
    gap: clamp(32px, 5vw, 80px);
}
.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--glass);
    backdrop-filter: blur(10px);
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--ink-2);
    margin-bottom: 28px;
}
.hero-eyebrow .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 4px var(--accent-soft);
}
.hero-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(3rem, 7.4vw, 6.6rem);
    line-height: 0.95;
    letter-spacing: -0.035em;
}
.hero-title em {
    display: block;
    font-style: italic;
    font-weight: 400;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    padding-bottom: 0.08em;
}
/* Полное название Матха в главном блоке:
   «Шри Чайтанья» — разрядкой, «Сарасват Шридхар» — крупно, «Говинда Матх» — золотом */
.hero-welcome {
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.25rem, 2vw, 1.6rem);
    color: var(--ink-2);
    margin-bottom: 14px;
}
/* Все строки названия — одного размера, начертания и цвета */
.hero-title--math {
    font-size: clamp(2.1rem, 4.4vw, 4.2rem);
    font-weight: 600;
    line-height: 1.08;
    letter-spacing: -0.01em;
    color: var(--ink);
}
.hero-title--math > span { display: block; }
.hero-branch {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 22px;
    max-width: 520px;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: var(--accent-2);
}
.hero-branch::before,
.hero-branch::after {
    content: "";
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--accent-2) 50%, transparent);
    opacity: 0.7;
}
.hero-branch::before { flex: 0 0 34px; background: linear-gradient(90deg, transparent, var(--accent-2)); }
.hero-branch span { white-space: nowrap; }
@media (max-width: 480px) {
    .hero-branch { letter-spacing: 0.16em; font-size: 0.72rem; gap: 10px; }
    .hero-branch::before { flex-basis: 18px; }
    .hero-branch span { white-space: normal; text-align: center; }
}
.hero-lead {
    margin-top: 28px;
    max-width: 46ch;
    font-size: clamp(1.02rem, 1.4vw, 1.18rem);
    color: var(--ink-2);
}
.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 36px;
}
.hero-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 28px;
    margin-top: 48px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}
.hero-meta div { display: flex; flex-direction: column; gap: 2px; }
.hero-meta span {
    font-size: 0.7rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
    font-weight: 700;
}
.hero-meta b { font-weight: 600; font-size: 0.98rem; }

.hero-emblem {
    position: relative;
    width: 100%;
    max-width: 560px;
    aspect-ratio: 1;
    justify-self: center;
}
.hero-emblem::before {
    content: "";
    position: absolute;
    inset: 17%;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent-2) 30%, transparent), transparent 70%);
    filter: blur(20px);
}
.hero-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    animation: spin 90s linear infinite;
    overflow: visible;
}
.hero-svg .ring { stroke: var(--line-2); }
.ring-text--name {
    font-family: 'Cormorant Garamond', Georgia, serif;
    font-weight: 700;
    letter-spacing: 0.03em;
    fill: var(--accent);
}
.ring-text--mantra {
    font-family: 'Noto Sans Devanagari', 'Mangal', sans-serif;
    font-weight: 600;
    letter-spacing: 0.08em;
    fill: var(--accent-2);
}
@keyframes spin { to { rotate: 360deg; } }
/* Медальон: кремовый круг с золотыми кольцами, квадратная эмблема вписана внутрь.
   multiply растворяет белый фон картинки в креме */
.hero-medal {
    position: absolute;
    inset: 18%;
    display: grid;
    place-items: center;
    border-radius: 50%;
    isolation: isolate;
    background: radial-gradient(circle at 50% 42%, #fffaf0 0%, #f7ecd6 58%, #ecd9b4 100%);
    box-shadow:
        inset 0 0 0 3px #fff8ea,
        inset 0 0 0 5px var(--accent-2),
        inset 0 0 34px rgba(150, 100, 30, 0.28),
        0 0 0 8px color-mix(in srgb, var(--surface) 55%, transparent),
        0 0 0 9px color-mix(in srgb, var(--accent-2) 55%, transparent),
        0 24px 70px -18px rgba(0, 0, 0, 0.55),
        0 0 90px -10px color-mix(in srgb, var(--accent) 45%, transparent);
}
.hero-photo {
    width: 71%;
    height: auto;
    mix-blend-mode: multiply;
}

@media (max-width: 900px) {
    .hero-inner { grid-template-columns: 1fr; text-align: left; }
    .hero-emblem { max-width: min(300px, 80vw); order: -1; }
    .hero-orb-1 { width: 90vw; height: 90vw; }
    .hero { padding-top: calc(var(--nav-h) + 40px); }
}

/* Бегущая строка с маха-мантрой */
.marquee {
    position: relative;
    overflow: hidden;
    border-block: 1px solid var(--line);
    padding: 22px 0;
    background: var(--surface);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
    mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent);
}
.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee 50s linear infinite;
}
.marquee-track span {
    display: inline-flex;
    align-items: center;
    gap: 40px;
    padding-right: 40px;
    font-family: var(--font-display);
    font-style: italic;
    font-size: clamp(1.4rem, 2.6vw, 2.2rem);
    white-space: nowrap;
    color: var(--ink-2);
}
.marquee-track span::after { content: "✦"; font-style: normal; font-size: 0.6em; color: var(--accent); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- 7. Карусель гуру ---------- */
.gurus-section { max-width: none; padding-inline: 0; }
.gurus-section .section-header { max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }

.carousel { position: relative; }
.carousel-viewport {
    overflow: hidden;
    padding: 12px 0 28px;
    touch-action: pan-y;
    cursor: grab;
}
.carousel.is-dragging .carousel-viewport { cursor: grabbing; }
.carousel-track { display: flex; align-items: stretch; will-change: transform; }
.carousel.is-animating .carousel-track { transition: transform 0.7s var(--ease); }
.carousel.is-dragging .carousel-track { transition: none; }

.carousel-card {
    flex: 0 0 auto;
    width: var(--card-w, 280px);
    margin-right: var(--card-gap, 24px);
    border-radius: var(--r-lg);
    overflow: hidden;
    background: var(--surface);
    border: 1px solid var(--line);
    user-select: none;
    transition: transform 0.5s var(--ease), box-shadow 0.5s ease;
}
.carousel-card:last-child { margin-right: 0; }
.carousel-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.carousel-card-image {
    position: relative;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: var(--bg-2);
}
.carousel-card-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    filter: saturate(0.9);
    transition: transform 1s var(--ease), filter 0.6s ease;
    pointer-events: none;
}
.carousel-card:hover .carousel-card-image img { transform: scale(1.06); filter: saturate(1.05); }
.carousel-card-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 10, 6, 0.55), transparent 40%);
    pointer-events: none;
}
.card-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 4rem;
    color: var(--accent-2);
    font-family: var(--font-deva);
    transition: opacity 0.4s ease;
}
.card-index {
    position: absolute;
    left: 18px;
    bottom: 14px;
    z-index: 2;
    font-family: var(--font-display);
    font-style: italic;
    font-size: 2.2rem;
    line-height: 1;
    color: #fff8ee;
}
.carousel-card-body { padding: 20px 22px 24px; }
.card-name {
    font-family: var(--font-display);
    font-size: 1.32rem;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
}
.card-title { margin-top: 6px; font-size: 0.86rem; color: var(--ink-3); }
.card-title:empty { display: none; }

.carousel-arrow {
    position: absolute;
    top: calc(50% - 50px);
    z-index: 5;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--glass);
    border: 1px solid var(--line);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--shadow);
    transition: transform 0.35s var(--ease), background-color 0.3s;
}
.carousel-arrow svg { width: 22px; height: 22px; }
.carousel-arrow:hover { background: var(--ink); color: var(--bg); transform: scale(1.06); }
.carousel-arrow-prev { left: 20px; }
.carousel-arrow-next { right: 20px; }

.carousel-dots {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0 var(--gutter);
}
.carousel-dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--line-2);
    transition: width 0.4s var(--ease), background-color 0.3s;
}
.carousel-dot.is-active { width: 28px; background: var(--accent); }
.carousel-progress {
    width: min(240px, 60%);
    height: 2px;
    margin: 18px auto 0;
    background: var(--line);
    border-radius: 2px;
    overflow: hidden;
}
.carousel-progress-fill { height: 100%; width: 0; background: var(--accent); }
@media (max-width: 767px) { .carousel-arrow { display: none; } }

/* ---------- 8. Цитата дня ---------- */
.quote-card {
    position: relative;
    overflow: hidden;
    padding: clamp(36px, 6vw, 80px);
    border-radius: var(--r-xl);
    background: var(--ink);
    color: var(--bg);
    isolation: isolate;
}
[data-theme="dark"] .quote-card { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.quote-card::before {
    content: "";
    position: absolute;
    inset: auto -20% -60% 30%;
    height: 120%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 45%, transparent), transparent 65%);
    filter: blur(40px);
    z-index: -1;
}
.quote-card-bg {
    position: absolute;
    top: -0.15em;
    right: 0.1em;
    font-family: var(--font-display);
    font-size: clamp(12rem, 26vw, 22rem);
    line-height: 1;
    color: var(--accent);
    opacity: 0.22;
    z-index: -1;
    pointer-events: none;
}
.quote-body { max-width: 900px; transition: opacity 0.25s ease, translate 0.25s ease; }
.quote-sanskrit {
    font-family: var(--font-deva);
    font-size: clamp(1.05rem, 1.8vw, 1.35rem);
    color: var(--accent-2);
    margin-bottom: 10px;
}
.quote-translit {
    font-style: italic;
    opacity: 0.7;
    font-size: 0.95rem;
    margin-bottom: 22px;
}
.quote-sanskrit:empty, .quote-translit:empty { display: none; }
.quote-text {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3.4vw, 2.9rem);
    line-height: 1.18;
    letter-spacing: -0.015em;
    font-weight: 500;
}
.quote-meta {
    margin-top: 32px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    align-items: baseline;
    transition: opacity 0.25s ease;
}
.quote-author { font-weight: 700; }
.quote-source { opacity: 0.65; font-size: 0.9rem; }
.quote-card.is-switching .quote-body,
.quote-card.is-switching .quote-meta { opacity: 0; translate: 0 8px; }
.quote-nav {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid color-mix(in srgb, currentColor 18%, transparent);
}
.quote-arrow {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, currentColor 30%, transparent);
    font-size: 1.5rem;
    line-height: 1;
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.quote-arrow:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.quote-date { font-size: 0.85rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.7; }

/* ---------- 9. Новости (bento) ---------- */
.news-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
}
.news-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 28px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    transition: transform 0.45s var(--ease), box-shadow 0.45s ease, border-color 0.3s;
    overflow: hidden;
}
.news-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.news-card:first-child {
    grid-row: span 2;
    justify-content: space-between;
    min-height: 380px;
    background: var(--grad);
    color: #1d0f04;
    border: 0;
}
.news-card-top { display: flex; flex-direction: column; gap: 18px; }
.news-date-badge { display: flex; align-items: baseline; gap: 8px; }
.news-date-badge .day {
    font-family: var(--font-display);
    font-size: 3.4rem;
    line-height: 0.9;
    font-weight: 500;
}
.news-card:first-child .news-date-badge .day { font-size: clamp(5rem, 10vw, 8rem); }
.news-date-badge .month {
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}
.news-card:first-child .news-date-badge .month { color: inherit; opacity: 0.75; }
.news-card h4 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 600;
    line-height: 1.1;
}
.news-card:first-child h4 { font-size: clamp(2rem, 3.4vw, 2.8rem); }
.news-excerpt { color: var(--ink-2); font-size: 0.95rem; }
.news-excerpt b { font-weight: 500; }
.news-card:first-child .news-excerpt { color: inherit; opacity: 0.85; font-size: 1.05rem; max-width: 36ch; }
.news-link {
    margin-top: auto;
    font-weight: 700;
    font-size: 0.88rem;
    display: inline-flex;
    gap: 6px;
    align-self: flex-start;
    border-bottom: 1px solid currentColor;
    padding-bottom: 2px;
}
.news-actions,
.lectures-actions { display: flex; justify-content: center; margin-top: 40px; }
@media (max-width: 760px) {
    .news-grid { grid-template-columns: 1fr; }
    .news-card:first-child { grid-row: auto; min-height: 300px; }
}

/* ---------- 10. Галерея (bento) ---------- */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: clamp(160px, 18vw, 230px);
    gap: 16px;
}
.gallery-item {
    position: relative;
    overflow: hidden;
    border-radius: var(--r-lg);
    background: var(--bg-2);
    isolation: isolate;
}
.gallery-item:nth-child(1) { grid-column: span 2; grid-row: span 2; }
.gallery-item:nth-child(6) { grid-column: 1 / -1; }
.gallery-item:nth-child(6n+1) { background: linear-gradient(140deg, #e7a65c, #c45a1d); }
.gallery-item:nth-child(6n+2) { background: linear-gradient(160deg, #e9d2a6, #c7a15a); }
.gallery-item:nth-child(6n+3) { background: linear-gradient(140deg, #8fa97a, #4c6a45); }
.gallery-item:nth-child(6n+4) { background: linear-gradient(180deg, #f2c27a, #d4621b 70%, #7a2b12); }
.gallery-item:nth-child(6n+5) { background: linear-gradient(140deg, #b98a6a, #5e3b2a); }
.gallery-item:nth-child(6n+6) { background: linear-gradient(120deg, #e8b7a0, #c2362b); }
.gallery-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 1s var(--ease); }
.gallery-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: clamp(2.6rem, 5vw, 4.4rem);
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.2));
    transition: transform 1s var(--ease);
}
.gallery-item:hover .gallery-placeholder,
.gallery-item:hover img { transform: scale(1.1); }
.gallery-overlay {
    position: absolute;
    left: 12px;
    right: auto;
    max-width: calc(100% - 24px);
    bottom: 12px;
    padding: 12px 16px;
    border-radius: 16px;
    font-size: 0.88rem;
    font-weight: 600;
    color: #fff8ee;
    background: rgba(20, 12, 6, 0.35);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255, 255, 255, 0.15);
    transform: translateY(6px);
    opacity: 0.92;
    transition: transform 0.45s var(--ease), opacity 0.3s;
}
.gallery-item:hover .gallery-overlay { transform: none; opacity: 1; }
@media (max-width: 860px) {
    .gallery-grid { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 170px; }
}

/* ---------- 11. Лекции ---------- */
.lectures-preview,
.lectures-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
    gap: 16px;
}
.lectures-preview { grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); }
.lecture-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    transition: transform 0.45s var(--ease), box-shadow 0.45s, border-color 0.3s;
}
.lecture-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-2); }
.lecture-card-head { display: flex; gap: 14px; align-items: flex-start; }
.lecture-card-icon {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    background: var(--accent-soft);
}
.lecture-card-title {
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 600;
    line-height: 1.15;
}
.lecture-card-meta { display: flex; flex-wrap: wrap; gap: 6px; }
.lecture-card-meta-item,
.lecture-card-tag {
    font-size: 0.78rem;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--bg-2);
    color: var(--ink-2);
}
.lecture-card-tag { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.lecture-card-desc { font-size: 0.92rem; color: var(--ink-2); }
.lecture-card-actions { margin-top: auto; }
.lecture-card-play {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 42px;
    padding: 0 18px 0 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.88rem;
    background: var(--ink);
    color: var(--bg);
    transition: background-color 0.3s, transform 0.3s var(--ease);
}
.lecture-card-play:hover { background: var(--accent); color: var(--on-accent); transform: translateY(-2px); }

/* Панель инструментов на lectures.html */
.lectures-toolbar-section { padding-block: 0 24px; }
.lectures-toolbar {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    position: sticky;
}
.lectures-search { position: relative; }
.lectures-search input {
    width: 100%;
    height: 58px;
    padding: 0 54px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg);
    font-size: 1.02rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.lectures-search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.lectures-search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    width: 20px;
    height: 20px;
    translate: 0 -50%;
    color: var(--ink-3);
    pointer-events: none;
}
.lectures-search-clear {
    position: absolute;
    right: 10px;
    top: 50%;
    translate: 0 -50%;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    font-size: 1.4rem;
    color: var(--ink-2);
    background: var(--bg-2);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.lectures-search-clear.is-visible { opacity: 1; pointer-events: auto; }
.lectures-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.lectures-filter-group { display: flex; flex-direction: column; gap: 6px; flex: 1 1 160px; }
.lectures-filter-group label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding-left: 4px;
}
.lectures-filter-group select {
    appearance: none;
    height: 46px;
    padding: 0 40px 0 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--bg) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238c7d6e' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 16px center;
    cursor: pointer;
}
.lectures-filter-group select:focus { outline: none; border-color: var(--accent); }
.lectures-reset {
    height: 46px;
    padding: 0 20px;
    border-radius: 14px;
    border: 1px solid var(--line);
    font-weight: 600;
    font-size: 0.9rem;
    transition: background-color 0.3s;
}
.lectures-reset:hover { background: var(--bg-2); }
.lectures-counter { font-size: 0.85rem; color: var(--ink-3); padding-left: 4px; }
.lectures-section { padding-top: 16px; }
.lectures-empty { text-align: center; padding: 70px 20px; }
.lectures-empty-icon { font-size: 2.6rem; margin-bottom: 12px; }
.lectures-empty-title { font-family: var(--font-display); font-size: 2rem; }
.lectures-empty-desc { color: var(--ink-3); }
.lectures-preview-empty { grid-column: 1 / -1; text-align: center; padding: 24px 0; }
.lectures-loadmore-wrap { display: flex; justify-content: center; margin-top: 36px; }

/* ---------- 12. Отзывы ---------- */
.reviews-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
    gap: 16px;
}
.review-card {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 32px 28px 28px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
}
.review-quote-mark {
    position: absolute;
    top: -26px;
    right: 18px;
    font-family: var(--font-display);
    font-size: 9rem;
    line-height: 1;
    color: var(--accent);
    opacity: 0.14;
}
.review-stars { color: var(--accent-2); letter-spacing: 3px; font-size: 0.9rem; }
.review-text {
    font-family: var(--font-display);
    font-size: 1.32rem;
    line-height: 1.32;
    flex: 1;
}
.review-author {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.review-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--grad);
    color: #1d0f04;
    font-weight: 700;
}
.review-name { font-weight: 700; font-size: 0.95rem; }
.review-role { font-size: 0.82rem; color: var(--ink-3); }
img.review-avatar { object-fit: cover; background: var(--surface-2); }
.review-stars-off { opacity: 0.25; }
.review-card.is-mine { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.review-del {
    margin-left: auto;
    padding: 6px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: none;
    font-size: 0.8rem;
    color: var(--ink-3);
    cursor: pointer;
}
.review-del:hover { color: var(--red); border-color: var(--red); }
.reviews-empty { grid-column: 1 / -1; text-align: center; color: var(--ink-3); padding: 24px 0; }

/* Свой отзыв */
.review-compose { max-width: 720px; margin: 32px auto 0; }
.review-guest,
.review-form {
    padding: 28px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--line);
}
.review-guest { text-align: center; color: var(--ink-2); }
.review-guest[hidden], .review-form[hidden] { display: none; }
.review-guest-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.review-form { display: flex; flex-direction: column; gap: 16px; }
.review-form-title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; }
.review-form-foot { display: flex; align-items: center; justify-content: flex-end; gap: 16px; flex-wrap: wrap; }
.review-form-foot .form-msg { margin-right: auto; }
/* Звёзды: в разметке 5→1, row-reverse показывает 1→5, а «~» подсвечивает выбранную и меньшие */
.review-rate { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 4px; }
.review-rate input { position: absolute; opacity: 0; pointer-events: none; }
.review-rate label { font-size: 1.8rem; line-height: 1; color: var(--line-2); cursor: pointer; transition: color 0.15s; }
.review-rate input:checked ~ label,
.review-rate label:hover,
.review-rate label:hover ~ label { color: var(--accent-2); }
.review-rate input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

/* ---------- 13. Контакты ---------- */
.contacts-wrapper {
    display: grid;
    grid-template-columns: 1fr 1.1fr;
    gap: 16px;
}
.contact-info-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.contact-card {
    display: flex;
    flex-direction: column;
    gap: 22px;
    justify-content: space-between;
    padding: 24px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--line);
}
.contact-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
}
.contact-icon svg { width: 22px; height: 22px; }
.contact-card h5 {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 4px;
}
.contact-card p { font-weight: 600; font-size: 1.02rem; }
.contact-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: clamp(24px, 4vw, 40px);
    border-radius: var(--r-xl);
    background: var(--surface-2);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.82rem; font-weight: 700; color: var(--ink-2); }
.form-group input,
.form-group textarea,
.event-panel-form input,
.event-panel-form textarea {
    width: 100%;
    padding: 14px 18px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--bg);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.form-group textarea { min-height: 130px; resize: vertical; }
.form-group input:focus,
.form-group textarea:focus,
.event-panel-form input:focus,
.event-panel-form textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
::placeholder { color: var(--ink-3); }
.contact-form .btn { align-self: flex-start; margin-top: 6px; }
@media (max-width: 900px) { .contacts-wrapper { grid-template-columns: 1fr; } }
@media (max-width: 480px) { .contact-info-cards { grid-template-columns: 1fr; } }

/* ---------- 14. Футер ---------- */
.footer {
    position: relative;
    margin: 40px 14px 14px;
    padding: clamp(40px, 6vw, 72px) clamp(24px, 5vw, 64px) 32px;
    border-radius: var(--r-xl);
    background: var(--ink);
    color: var(--bg);
    overflow: hidden;
    isolation: isolate;
}
[data-theme="dark"] .footer { background: var(--surface); color: var(--ink); border: 1px solid var(--line); }
.footer::before {
    content: "";
    position: absolute;
    right: -10%;
    top: -40%;
    width: 60%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 35%, transparent), transparent 65%);
    filter: blur(30px);
    z-index: -1;
}
.footer-top {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 40px;
    padding-bottom: 40px;
    border-bottom: 1px solid color-mix(in srgb, currentColor 15%, transparent);
}
.footer-brand {
    display: block;
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 3.4vw, 2.8rem);
    line-height: 1.05;
    letter-spacing: -0.02em;
    max-width: 16ch;
}
.footer-col h6 {
    font-size: 0.72rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    opacity: 0.55;
    margin-bottom: 14px;
}
.footer-col ul { list-style: none; display: grid; gap: 8px; }
.footer-col a { opacity: 0.85; transition: opacity 0.2s, color 0.2s; }
.footer-col a:hover { opacity: 1; color: var(--accent); }
.footer-col p { opacity: 0.85; font-size: 0.95rem; }
.footer-bottom {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 8px 24px;
    padding-top: 24px;
    font-size: 0.8rem;
    opacity: 0.6;
}
.footer-mantra {
    font-family: var(--font-deva);
    color: var(--accent-2);
    margin-top: 18px;
    font-size: 0.95rem;
}
@media (max-width: 760px) { .footer-top { grid-template-columns: 1fr; gap: 28px; } }

/* ---------- 15. Внутренние страницы ---------- */
.page-head { padding-top: calc(var(--nav-h) + 90px); padding-bottom: 24px; }
.page-head::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 50%;
    height: 100%;
    background: radial-gradient(circle at 70% 30%, var(--orb-1), transparent 60%);
    filter: blur(40px);
    z-index: -1;
    pointer-events: none;
}
.page-head .section-header { margin-bottom: 0; }
.page-head .section-title { font-size: clamp(3.2rem, 9vw, 7.5rem); }
.schedule-section { padding-block: 24px; }
.schedule-heading {
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    margin-bottom: 24px;
}
.schedule-note {
    padding: clamp(28px, 5vw, 48px);
    border-radius: var(--r-xl);
    background: var(--surface);
    border: 1px solid var(--line);
}
.schedule-note h4 {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3vw, 2.3rem);
    font-weight: 500;
    margin-bottom: 12px;
}
.schedule-note p { color: var(--ink-2); max-width: 70ch; }
.note-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 28px; }

/* ---------- 16. Расписание ---------- */
.now-next-card {
    position: relative;
    display: grid;
    grid-template-columns: 1.3fr auto 1fr;
    gap: 24px;
    align-items: center;
    padding: clamp(24px, 4vw, 44px);
    border-radius: var(--r-xl);
    background: var(--ink);
    color: var(--bg);
    overflow: hidden;
    isolation: isolate;
}
[data-theme="dark"] .now-next-card { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.now-next-card::before {
    content: "";
    position: absolute;
    inset: -40% 40% -40% -20%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 40%, transparent), transparent 65%);
    filter: blur(30px);
    z-index: -1;
}
.now-next-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    background: var(--accent);
    color: var(--on-accent);
}
.now-next-badge--next { background: transparent; color: inherit; border: 1px solid color-mix(in srgb, currentColor 30%, transparent); }
.now-next-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; opacity: 0.5; }
.now-next-dot.is-live { opacity: 1; animation: pulse 1.6s ease-out infinite; }
@keyframes pulse {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, currentColor 60%, transparent); }
    100% { box-shadow: 0 0 0 10px transparent; }
}
.now-next-body { margin-top: 16px; }
.now-next-time { font-family: var(--font-display); font-size: clamp(2.6rem, 5vw, 4rem); line-height: 1; }
.now-next-col--next .now-next-time { font-size: clamp(2rem, 3.6vw, 2.8rem); opacity: 0.85; }
.now-next-title { font-weight: 700; font-size: 1.1rem; margin-top: 8px; }
.now-next-desc { opacity: 0.65; font-size: 0.92rem; }
.now-next-arrow { font-size: 2rem; opacity: 0.4; }
.now-next-progress {
    grid-column: 1 / -1;
    height: 4px;
    border-radius: 4px;
    background: color-mix(in srgb, currentColor 14%, transparent);
    overflow: hidden;
}
.now-next-progress-fill { height: 100%; width: 0; background: var(--grad); border-radius: 4px; transition: width 1s ease; }
@media (max-width: 700px) {
    .now-next-card { grid-template-columns: 1fr; }
    .now-next-arrow { display: none; }
}

.schedule-list {
    border-radius: var(--r-lg);
    border: 1px solid var(--line);
    background: var(--surface);
    overflow: hidden;
}
.schedule-row {
    position: relative;
    display: grid;
    grid-template-columns: 110px 1fr auto;
    align-items: center;
    gap: 20px;
    padding: 20px 28px;
    border-bottom: 1px solid var(--line);
    transition: background-color 0.3s;
}
.schedule-row:last-child { border-bottom: 0; }
.schedule-row:hover { background: var(--bg); }
.schedule-time { font-family: var(--font-display); font-size: 1.7rem; line-height: 1; font-variant-numeric: tabular-nums; }
.schedule-body h4 { font-size: 1.02rem; font-weight: 700; }
.schedule-body p { font-size: 0.88rem; color: var(--ink-3); }
.schedule-row.is-past { opacity: 0.45; }
.schedule-row.is-now { background: var(--accent-soft); }
.schedule-row.is-now::before {
    content: "";
    position: absolute;
    left: 0;
    top: 12px;
    bottom: 12px;
    width: 3px;
    border-radius: 3px;
    background: var(--accent);
}
.schedule-row.is-now .schedule-time { color: var(--accent); }
.schedule-row.is-next .schedule-time { color: var(--accent-2); }
.schedule-now-badge {
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}
@media (max-width: 560px) {
    .schedule-row { grid-template-columns: 70px 1fr; padding: 16px 18px; }
    .schedule-time { font-size: 1.35rem; }
    .schedule-now-badge { grid-column: 2; justify-self: start; }
}

.week-filter {
    display: flex;
    gap: 4px;
    padding: 5px;
    margin-bottom: 20px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    width: max-content;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
}
.week-filter-btn {
    flex-shrink: 0;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink-2);
    transition: background-color 0.3s, color 0.3s;
}
.week-filter-btn:hover { color: var(--ink); background: var(--bg); }
.week-filter-btn.is-active { background: var(--ink); color: var(--bg); }
.week-filter-btn--today { color: var(--accent); }
.week-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 270px), 1fr));
    gap: 16px;
}
.week-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 24px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid var(--line);
}
.week-card h4 {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    font-family: var(--font-display);
    font-size: 1.7rem;
    font-weight: 500;
}
.week-card ul { list-style: none; display: grid; gap: 10px; }
.week-card li { display: flex; gap: 14px; font-size: 0.94rem; color: var(--ink-2); }
.week-card li span { font-weight: 700; color: var(--ink); font-variant-numeric: tabular-nums; min-width: 44px; }
.week-card.highlight { border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.week-card.is-today { box-shadow: 0 0 0 1px var(--accent), var(--shadow); }
.week-card.zoom-card { background: var(--grad); color: #1d0f04; border: 0; }
.week-card.zoom-card li, .week-card.zoom-card li span { color: #1d0f04; }
.week-card .week-btn { margin-top: auto; align-self: flex-start; min-height: 44px; padding: 0 20px; }
.week-card.zoom-card .week-btn { background: #1d0f04; color: #fff4e4; }
.week-today-badge {
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 5px 10px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
}
.week-empty {
    grid-column: 1 / -1;
    padding: 48px;
    text-align: center;
    color: var(--ink-3);
    border-radius: var(--r-lg);
    border: 1px dashed var(--line-2);
}

/* ---------- 17. Календарь ---------- */
.calendar-wrapper {
    padding: clamp(14px, 2.5vw, 28px);
    border-radius: var(--r-xl);
    background: var(--surface);
    border: 1px solid var(--line);
}
.calendar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}
.calendar-nav { display: flex; gap: 6px; }
.calendar-nav button,
.calendar-today-btn {
    height: 46px;
    min-width: 46px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--bg);
    font-size: 1.3rem;
    line-height: 1;
    transition: background-color 0.3s, color 0.3s;
}
.calendar-today-btn { font-size: 0.9rem; font-weight: 700; padding: 0 20px; }
.calendar-nav button:hover,
.calendar-today-btn:hover { background: var(--ink); color: var(--bg); }
.calendar-title {
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 3.4vw, 2.6rem);
    font-weight: 500;
    letter-spacing: -0.02em;
    padding: 4px 14px;
    border-radius: 14px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.3s;
}
.calendar-title::after { content: "⌄"; font-size: 0.6em; opacity: 0.5; translate: 0 -0.2em; }
.calendar-title[data-can-zoom="false"]::after { display: none; }
.calendar-title:hover { background: var(--bg); }

.calendar-weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 6px;
    margin-bottom: 6px;
}
.calendar-weekdays span {
    text-align: center;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink-3);
    padding: 6px 0;
}
.calendar-weekdays span:nth-child(n+6) { color: var(--accent); }

.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar-day {
    position: relative;
    min-height: 118px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    padding: 10px;
    text-align: left;
    border-radius: 16px;
    background: var(--bg);
    border: 1px solid transparent;
    transition: border-color 0.25s, background-color 0.25s, transform 0.3s var(--ease);
}
.calendar-day:hover { border-color: var(--line-2); transform: translateY(-2px); }
.day-num { font-weight: 700; font-size: 0.95rem; font-variant-numeric: tabular-nums; }
.calendar-day.other-month { opacity: 0.35; background: transparent; }
.calendar-day.today { background: var(--ink); color: var(--bg); }
.calendar-day.today .day-num::after { content: " · сегодня"; font-size: 0.7rem; font-weight: 600; opacity: 0.7; }
.calendar-day.selected { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.calendar-day.type-festival { background: color-mix(in srgb, var(--red) 9%, var(--bg)); }
.calendar-day.type-kirtan   { background: color-mix(in srgb, var(--accent-2) 12%, var(--bg)); }
.calendar-day.type-lecture  { background: color-mix(in srgb, var(--accent) 10%, var(--bg)); }
.calendar-day.type-special  { background: color-mix(in srgb, var(--tulsi) 12%, var(--bg)); }
.calendar-day.today.has-events { background: var(--ink); }
.day-list { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.day-chip {
    display: block;
    padding: 3px 7px;
    border-radius: 7px;
    font-size: 0.72rem;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.day-chip.gold   { background: color-mix(in srgb, var(--accent-2) 22%, transparent); color: color-mix(in srgb, var(--accent-2) 70%, var(--ink)); }
.day-chip.orange { background: color-mix(in srgb, var(--accent) 18%, transparent);   color: color-mix(in srgb, var(--accent) 75%, var(--ink)); }
.day-chip.red    { background: color-mix(in srgb, var(--red) 15%, transparent);      color: color-mix(in srgb, var(--red) 80%, var(--ink)); }
.day-chip.green  { background: color-mix(in srgb, var(--tulsi) 18%, transparent);    color: color-mix(in srgb, var(--tulsi) 75%, var(--ink)); }
.calendar-day.today .day-chip { color: var(--bg); background: color-mix(in srgb, var(--bg) 16%, transparent); }

.calendar-months { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.calendar-years  { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.month-cell,
.year-cell {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    padding: 20px;
    min-height: 110px;
    border-radius: 18px;
    background: var(--bg);
    border: 1px solid transparent;
    text-align: left;
    font-family: var(--font-display);
    font-size: 1.5rem;
    transition: border-color 0.25s, transform 0.3s var(--ease);
}
.year-cell { justify-content: center; align-items: center; font-size: 1.8rem; }
.month-cell:hover, .year-cell:hover { border-color: var(--line-2); transform: translateY(-2px); }
.month-cell.current, .year-cell.current { background: var(--ink); color: var(--bg); }
.month-events { font-family: var(--font-sans); font-size: 0.78rem; opacity: 0.7; }
.month-type-dots { display: flex; gap: 4px; margin-top: auto; }
.month-type-dot {
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    font-family: var(--font-sans);
    font-size: 0.68rem;
    font-weight: 700;
    color: #fff;
}
.month-type-dot.festival { background: var(--red); }
.month-type-dot.kirtan   { background: var(--accent-2); }
.month-type-dot.lecture  { background: var(--accent); }
.month-type-dot.special  { background: var(--tulsi); }

.calendar-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}
.legend-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    font-size: 0.86rem;
    font-weight: 600;
    color: var(--ink-2);
    transition: background-color 0.3s, color 0.3s, border-color 0.3s;
}
.legend-btn:hover { border-color: var(--line-2); color: var(--ink); }
.legend-btn.is-active { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; }
.legend-dot.all      { background: var(--grad); }
.legend-dot.festival { background: var(--red); }
.legend-dot.lecture  { background: var(--accent); }
.legend-dot.kirtan   { background: var(--accent-2); }
.legend-dot.special  { background: var(--tulsi); }

/* Список «События месяца» — на планшетах и телефонах */
.calendar-agenda {
    display: none;
    flex-direction: column;
    gap: 6px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
}
.agenda-head {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
    margin-bottom: 4px;
}
.agenda-row {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 12px;
    border-radius: 16px;
    background: var(--bg);
    text-align: left;
    width: 100%;
}
.agenda-row.is-today { box-shadow: 0 0 0 1px var(--accent); }
.agenda-date { display: flex; flex-direction: column; align-items: center; min-width: 40px; line-height: 1; }
.agenda-date b { font-family: var(--font-display); font-size: 1.7rem; font-weight: 500; }
.agenda-date small { font-size: 0.68rem; font-weight: 700; text-transform: uppercase; color: var(--ink-3); margin-top: 4px; }
.agenda-body { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding-top: 2px; }
.agenda-item { position: relative; padding-left: 14px; font-size: 0.92rem; font-weight: 600; line-height: 1.35; }
.agenda-item::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.45em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-2);
}
.agenda-item.orange::before { background: var(--accent); }
.agenda-item.red::before    { background: var(--red); }
.agenda-item.green::before  { background: var(--tulsi); }
.agenda-empty { padding: 20px; text-align: center; color: var(--ink-3); }

@media (max-width: 860px) {
    .calendar-agenda { display: flex; }
    .calendar-day { min-height: 96px; padding: 6px; border-radius: 12px; }
    .calendar-day.today .day-num::after { content: ""; }
    .day-chip { font-size: 0.62rem; padding: 2px 4px; border-radius: 5px; }
    .calendar-months { grid-template-columns: repeat(3, 1fr); }
    .calendar-years  { grid-template-columns: repeat(3, 1fr); }
    .month-cell { font-size: 1.15rem; padding: 14px; min-height: 90px; }
}
/* На телефоне названия не помещаются в ячейку — там цветные метки,
   а сами названия выводятся в списке «События месяца» под сеткой */
@media (max-width: 600px) {
    .calendar-day { min-height: 60px; }
    .day-list { flex-direction: row; flex-wrap: wrap; gap: 3px; }
    .day-chip { font-size: 0; padding: 0; width: 14px; height: 6px; border-radius: 3px; }
    .day-chip.gold   { background: var(--accent-2); }
    .day-chip.orange { background: var(--accent); }
    .day-chip.red    { background: var(--red); }
    .day-chip.green  { background: var(--tulsi); }
}

@media (max-width: 520px) {
    .calendar-header { flex-wrap: wrap; }
    .calendar-title { order: -1; width: 100%; justify-content: center; }
    .calendar-grid, .calendar-weekdays { gap: 3px; }
    .calendar-day { min-height: 56px; }
    .calendar-months { grid-template-columns: repeat(2, 1fr); }
}

/* Выезжающая панель событий */
.event-panel-overlay {
    position: fixed;
    inset: 0;
    z-index: 1100;
    background: rgba(15, 10, 6, 0.4);
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s, visibility 0.35s;
}
.event-panel-overlay.open { opacity: 1; visibility: visible; }
.event-panel {
    position: fixed;
    top: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 1101;
    width: min(440px, calc(100vw - 24px));
    display: flex;
    flex-direction: column;
    gap: 18px;
    padding: 28px;
    border-radius: var(--r-xl);
    background: var(--surface-2);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform: translateX(calc(100% + 24px));
    transition: transform 0.5s var(--ease);
    overflow-y: auto;
}
.event-panel.open { transform: none; }
.event-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.event-panel-date { font-family: var(--font-display); font-size: 2.4rem; line-height: 1; }
.event-panel-weekday {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
    margin-top: 6px;
}
.event-panel-close {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--line);
    font-size: 1.5rem;
    transition: background-color 0.3s, rotate 0.4s var(--ease);
}
.event-panel-close:hover { background: var(--bg); rotate: 90deg; }
.event-panel-list { display: flex; flex-direction: column; gap: 8px; flex: 1; }
.event-panel-empty {
    padding: 36px 16px;
    text-align: center;
    color: var(--ink-3);
    border: 1px dashed var(--line-2);
    border-radius: var(--r);
}
.event-item {
    display: flex;
    gap: 14px;
    padding: 16px;
    border-radius: 18px;
    background: var(--bg);
}
.event-item-color { flex-shrink: 0; width: 4px; border-radius: 4px; background: var(--accent-2); }
.event-item[data-color="orange"] .event-item-color { background: var(--accent); }
.event-item[data-color="red"]    .event-item-color { background: var(--red); }
.event-item[data-color="green"]  .event-item-color { background: var(--tulsi); }
.event-item-body { flex: 1; min-width: 0; }
.event-item-title { font-weight: 700; }
.event-item-desc { font-size: 0.9rem; color: var(--ink-2); margin-top: 2px; }
.event-item-type {
    margin-top: 8px;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent-2);
}
.event-item[data-type="festival"] .event-item-type { color: var(--red); }
.event-item[data-type="lecture"]  .event-item-type { color: var(--accent); }
.event-item[data-type="special"]  .event-item-type { color: var(--tulsi); }
.event-item-actions { display: flex; gap: 4px; align-items: flex-start; }
.event-item-actions button {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    color: var(--ink-3);
    transition: background-color 0.2s, color 0.2s;
}
.event-item-actions button:hover { background: var(--surface-2); color: var(--ink); }
.event-panel-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
}
.event-panel-form textarea { resize: vertical; }
.event-color-row { display: flex; align-items: center; gap: 12px; font-size: 0.86rem; color: var(--ink-2); }
.event-colors { display: flex; gap: 8px; }
.event-color {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    transition: transform 0.25s var(--ease), box-shadow 0.25s;
}
.event-color.gold   { background: var(--accent-2); }
.event-color.orange { background: var(--accent); }
.event-color.red    { background: var(--red); }
.event-color.green  { background: var(--tulsi); }
.event-color:hover  { transform: scale(1.12); }
.event-color.active { box-shadow: 0 0 0 3px var(--surface-2), 0 0 0 5px var(--ink); }

/* ---------- 18. Плавающий аудиоплеер ---------- */
.audio-player {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 360px;
    max-width: calc(100vw - 24px);
    z-index: 950;
    pointer-events: none;
}
.audio-player > * { pointer-events: auto; }
.ap-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 8px 8px 8px;
    border-radius: 999px;
    background: var(--glass);
    border: 1px solid var(--line);
    backdrop-filter: blur(22px) saturate(160%);
    -webkit-backdrop-filter: blur(22px) saturate(160%);
    box-shadow: var(--shadow);
    transition: opacity 0.25s;
}
.ap-mini-play {
    flex-shrink: 0;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: var(--on-accent);
    transition: transform 0.3s var(--ease);
}
.ap-mini-play:hover { transform: scale(1.06); }
.ap-mini-body { flex: 1; min-width: 0; cursor: pointer; }
.ap-mini-title, .ap-title {
    font-weight: 700;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ap-mini-artist, .ap-artist {
    font-size: 0.78rem;
    color: var(--ink-3);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.ap-mini-toggle {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
}
.ap-mini-toggle svg { width: 18px; height: 18px; transition: rotate 0.35s var(--ease); }
.ap-mini-toggle:hover { background: var(--bg-2); }
.audio-player.open .ap-mini-toggle svg { rotate: 180deg; }

.ap-full {
    position: absolute;
    right: 0;
    bottom: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: 20px;
    border-radius: var(--r-lg);
    background: var(--surface-2);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform-origin: bottom right;
    transform: scale(0.92) translateY(12px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s var(--ease), opacity 0.25s;
}
.audio-player.open .ap-full { transform: none; opacity: 1; pointer-events: auto; }
.audio-player.open .ap-mini { opacity: 0; pointer-events: none; }
.ap-head { display: flex; align-items: center; gap: 14px; }
.ap-cover {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: grid;
    place-items: center;
    font-size: 1.6rem;
    background: var(--grad);
    color: #1d0f04;
}
.ap-meta { flex: 1; min-width: 0; }
.ap-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 1.4rem;
    color: var(--ink-3);
}
.ap-close:hover { background: var(--bg-2); color: var(--ink); }

.ap-progress-wrap,
.big-progress-wrap { display: flex; align-items: center; gap: 10px; }
.ap-time, .big-time { font-size: 0.75rem; color: var(--ink-3); font-variant-numeric: tabular-nums; min-width: 36px; }
.ap-time:last-child, .big-time:last-child { text-align: right; }
.ap-progress,
.big-progress {
    position: relative;
    flex: 1;
    height: 6px;
    border-radius: 6px;
    background: var(--bg-2);
    cursor: pointer;
    touch-action: none;
}
.ap-progress-fill,
.big-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    border-radius: 6px;
    background: var(--grad);
}
.ap-progress-thumb,
.big-thumb {
    position: absolute;
    top: 50%;
    left: 0;
    width: 16px;
    height: 16px;
    margin-left: -8px;
    translate: 0 -50%;
    border-radius: 50%;
    background: var(--surface-2);
    box-shadow: 0 0 0 2px var(--accent), var(--shadow-sm);
    scale: 0;
    transition: scale 0.2s var(--ease);
}
.ap-progress:hover .ap-progress-thumb,
.big-progress:hover .big-thumb,
.big-progress:focus-visible .big-thumb { scale: 1; }

.ap-controls { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.ap-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: var(--ink-2);
    transition: background-color 0.2s, color 0.2s, transform 0.3s var(--ease);
}
.ap-btn svg { width: 20px; height: 20px; }
.ap-btn:hover { background: var(--bg-2); color: var(--ink); }
.ap-btn-main { width: 52px; height: 52px; background: var(--ink); color: var(--bg); }
.ap-btn-main:hover { background: var(--accent); color: var(--on-accent); transform: scale(1.05); }
.ap-btn-sm { width: 36px; height: 36px; }
.ap-btn-sm svg { width: 18px; height: 18px; }
.ap-volume { display: flex; align-items: center; gap: 2px; }
.ap-volume-range {
    width: 70px;
    accent-color: var(--accent);
    cursor: pointer;
}
.ap-ico { width: 20px; height: 20px; }
.ap-ico-pause,
.audio-player.playing .ap-ico-play,
.big-player.playing .ap-ico-play { display: none; }
.audio-player.playing .ap-ico-pause,
.big-player.playing .ap-ico-pause { display: block; }
.ap-ico-mute,
.audio-player.muted .ap-ico-vol { display: none; }
.audio-player.muted .ap-ico-mute { display: block; }

.ap-playlist { display: none; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.ap-playlist.open { display: flex; }
.ap-playlist-head { display: flex; justify-content: space-between; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.ap-playlist-count { padding: 1px 8px; border-radius: 999px; background: var(--bg-2); }
.ap-playlist-list { list-style: none; max-height: 220px; overflow-y: auto; display: grid; gap: 2px; }
.ap-track {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.ap-track:hover { background: var(--bg); }
.ap-track.active { background: var(--accent-soft); }
.ap-track-num { width: 18px; font-size: 0.78rem; color: var(--ink-3); text-align: center; }
.ap-track.active .ap-track-num { color: var(--accent); font-weight: 700; }
.ap-track-body { min-width: 0; }
.ap-track-title { font-size: 0.88rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ap-track-artist { font-size: 0.75rem; color: var(--ink-3); }

body:has(.audio-page) .audio-player { opacity: 0.4; transition: opacity 0.3s; }
body:has(.audio-page) .audio-player:hover,
body:has(.audio-page) .audio-player.open { opacity: 1; }
@media (max-width: 560px) {
    .audio-player { right: 12px; bottom: 12px; left: 12px; width: auto; max-width: none; }
}
/* чтобы плеер не перекрывал футер */
body:has(.audio-player) .footer { margin-bottom: 96px; }

/* ---------- 19. Страница аудиотеки ---------- */
.audio-page {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    align-items: start;
    padding-top: 24px;
}
.big-player {
    position: sticky;
    top: calc(var(--nav-h) + 30px);
    display: flex;
    flex-direction: column;
    gap: 28px;
    padding: clamp(24px, 4vw, 40px);
    border-radius: var(--r-xl);
    background: var(--ink);
    color: var(--bg);
    overflow: hidden;
    isolation: isolate;
}
[data-theme="dark"] .big-player { background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); }
.big-player::before {
    content: "";
    position: absolute;
    inset: -30% -30% 30% 20%;
    background: radial-gradient(circle, color-mix(in srgb, var(--accent) 45%, transparent), transparent 65%);
    filter: blur(30px);
    z-index: -1;
    transition: opacity 0.6s;
    opacity: 0.6;
}
.big-player.playing::before { opacity: 1; animation: orb-float 8s ease-in-out infinite alternate; }
.big-top { display: flex; flex-direction: column; gap: 24px; }
.big-cover {
    width: 100%;
    aspect-ratio: 1;
    max-width: 320px;
    border-radius: var(--r-lg);
    display: grid;
    place-items: center;
    font-size: clamp(4rem, 10vw, 7rem);
    background: var(--grad);
    box-shadow: var(--shadow-lg);
    transition: transform 0.6s var(--ease);
}
.big-player.playing .big-cover { transform: scale(1.02); }
.big-title { font-family: var(--font-display); font-size: clamp(1.8rem, 3vw, 2.5rem); line-height: 1.1; font-weight: 500; }
.big-artist { opacity: 0.65; margin-top: 4px; }
.big-player .big-time { color: inherit; opacity: 0.6; }
.big-player .big-progress { background: color-mix(in srgb, currentColor 15%, transparent); }
.big-controls { display: flex; align-items: center; justify-content: center; gap: 16px; }
.big-btn {
    width: 54px;
    height: 54px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: inherit;
    border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
    transition: background-color 0.3s, transform 0.3s var(--ease);
}
.big-btn svg { width: 22px; height: 22px; }
.big-btn:hover { background: color-mix(in srgb, currentColor 12%, transparent); }
.big-btn-main { width: 78px; height: 78px; background: var(--accent); color: var(--on-accent); border: 0; }
.big-btn-main svg, .big-btn-main .ap-ico { width: 30px; height: 30px; }
.big-btn-main:hover { background: var(--accent); transform: scale(1.06); }

.big-playlist-wrap {
    padding: 20px;
    border-radius: var(--r-xl);
    background: var(--surface);
    border: 1px solid var(--line);
}
.big-playlist-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 4px 8px 16px; }
.big-playlist-title { font-family: var(--font-display); font-size: 1.8rem; }
.big-playlist-sub { font-size: 0.8rem; color: var(--ink-3); }
.big-playlist { list-style: none; display: grid; gap: 4px; }
.big-track {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px;
    border-radius: 16px;
    cursor: pointer;
    transition: background-color 0.2s;
}
.big-track:hover { background: var(--bg); }
.big-track.active { background: var(--accent-soft); }
.big-track-cover {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.3rem;
    background: var(--bg-2);
}
.big-track.active .big-track-cover { background: var(--grad); }
.big-track-body { min-width: 0; }
.big-track-title { font-weight: 700; font-size: 0.95rem; }
.big-track.active .big-track-title { color: var(--accent); }
.big-track-artist { font-size: 0.82rem; color: var(--ink-3); }
@media (max-width: 900px) {
    .audio-page { grid-template-columns: 1fr; }
    .big-player { position: relative; top: 0; }
    .big-cover { max-width: 220px; margin-inline: auto; }
    .big-top { align-items: center; text-align: center; }
}

/* ---------- 20. Появление при прокрутке (CSS scroll-driven) ---------- */
@supports (animation-timeline: view()) {
    @media (prefers-reduced-motion: no-preference) {
        .section-header,
        .news-card,
        .gallery-item,
        .review-card,
        .contact-card,
        .contact-form,
        .quote-card,
        .week-card,
        .schedule-note,
        .footer-top {
            animation: reveal linear both;
            animation-timeline: view();
            animation-range: entry 0% entry 55%;
        }
    }
}
@keyframes reveal {
    from { opacity: 0; translate: 0 40px; }
    to   { opacity: 1; translate: 0 0; }
}

/* Появление hero при загрузке */
@media (prefers-reduced-motion: no-preference) {
    .hero-copy > * { animation: rise 1s var(--ease) both; }
    .hero-copy > :nth-child(2) { animation-delay: 0.08s; }
    .hero-copy > :nth-child(3) { animation-delay: 0.16s; }
    .hero-copy > :nth-child(4) { animation-delay: 0.24s; }
    .hero-copy > :nth-child(5) { animation-delay: 0.32s; }
    .hero-copy > :nth-child(6) { animation-delay: 0.4s; }
    .hero-copy > :nth-child(7) { animation-delay: 0.48s; }
    .hero-emblem { animation: rise 1.4s var(--ease) 0.1s both; }
}
@keyframes rise {
    from { opacity: 0; translate: 0 30px; filter: blur(6px); }
    to   { opacity: 1; translate: 0 0; filter: blur(0); }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================================
   21. Мини-профиль в шапке
   ============================================================ */
.account { position: relative; }
.account-btn {
    position: relative;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 1px solid var(--line);
    background: var(--surface);
    transition: background-color 0.3s, box-shadow 0.3s;
}
.account-btn:hover { background: var(--surface-2); }
.account.open .account-btn { box-shadow: 0 0 0 3px var(--accent-soft); }
.account-ico { width: 20px; height: 20px; }
.account-btn.is-user .account-ico { display: none; }
.account-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}
.is-initials {
    display: grid;
    place-items: center;
    background: var(--grad);
    color: #1d0f04;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.02em;
}
.account-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
    font-size: 0.66rem;
    font-weight: 700;
    display: grid;
    place-items: center;
    box-shadow: 0 0 0 2px var(--bg);
}
.account-pop {
    position: absolute;
    top: calc(100% + 14px);
    right: -6px;
    z-index: 20;
    width: 300px;
    max-width: calc(100vw - 24px);
    padding: 10px;
    border-radius: var(--r-lg);
    background: var(--surface-2);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    transform-origin: top right;
    animation: pop-in 0.3s var(--ease);
}
@keyframes pop-in { from { opacity: 0; transform: translateY(-6px) scale(0.97); } }
.pop-guest { padding: 14px; }
.pop-title { font-family: var(--font-display); font-size: 1.6rem; line-height: 1.1; }
.pop-guest p { color: var(--ink-2); font-size: 0.9rem; margin: 8px 0 16px; }
.pop-actions { display: flex; gap: 8px; }
.pop-actions .btn { flex: 1; min-height: 44px; padding: 0 14px; font-size: 0.88rem; }
.pop-actions .btn::after { display: none; }
.pop-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    border-radius: 18px;
    background: var(--bg);
    transition: background-color 0.2s;
}
.pop-head:hover { background: var(--bg-2); }
.pop-avatar { width: 52px; height: 52px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.pop-who { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pop-who b { font-size: 0.98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-who small { font-size: 0.8rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pop-role, .status-chip {
    flex-shrink: 0;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    background: var(--accent-soft);
    color: var(--accent);
}
.pop-links { display: grid; padding: 6px 0; }
.pop-links a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    border-radius: 12px;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--ink-2);
    transition: background-color 0.2s, color 0.2s;
}
.pop-links a:hover { background: var(--bg); color: var(--ink); }
.pop-links svg { width: 18px; height: 18px; flex-shrink: 0; }
.pop-links span { flex: 1; }
.pop-links em {
    font-style: normal;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 1px 8px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
}
.pop-logout {
    width: 100%;
    padding: 12px 14px;
    border-top: 1px solid var(--line);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink-3);
    text-align: left;
}
.pop-logout:hover { color: var(--red); }
/* Телефон: кнопка профиля стоит слева, и всплывашка, привязанная к правому краю,
   уезжала за экран. Здесь она во всю ширину шапки (#navbar — fixed, он и есть
   точка отсчёта), фон страницы затемнён. */
@media (max-width: 640px) {
    .account { position: static; }
    .account-pop {
        top: calc(100% + 10px);
        left: 0;
        right: 0;
        width: auto;
        max-width: none;
        max-height: calc(100dvh - 100px);
        overflow-y: auto;
        border-color: var(--line-2);
        box-shadow: var(--shadow-lg), 0 0 0 100vmax rgba(0, 0, 0, 0.55);
        transform-origin: top center;
    }
    .pop-guest { padding: 10px 8px 6px; text-align: center; }
    .pop-guest p { font-size: 0.95rem; color: var(--ink); }
    .pop-actions .btn { min-height: 48px; font-size: 0.95rem; }
}
@media (max-width: 480px) {
    .account-btn { width: 42px; height: 42px; }
    .account-avatar { width: 36px; height: 36px; }
    .brand-text small { display: none; }
    .navbar-utility { gap: 4px; }
}
@media (max-width: 360px) { .brand-text { display: none; } }

/* ============================================================
   22. Страница профиля
   ============================================================ */
.profile-page {
    max-width: var(--container);
    margin: 0 auto;
    padding: calc(var(--nav-h) + 56px) var(--gutter) 40px;
    min-height: 80vh;
}
.profile-loading { padding: 120px 0; text-align: center; color: var(--ink-3); }
.profile-offline {
    max-width: 560px;
    margin: 60px auto;
    padding: 40px;
    border-radius: var(--r-xl);
    background: var(--surface);
    border: 1px solid var(--line);
    text-align: center;
}
.profile-offline h2 { font-family: var(--font-display); font-weight: 500; font-size: 2.2rem; }
.profile-offline p { color: var(--ink-2); margin: 12px 0 24px; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.88em; padding: 1px 6px; border-radius: 6px; background: var(--bg-2); }

/* ---------- Вход ---------- */
.auth-shell {
    display: grid;
    grid-template-columns: 1fr minmax(0, 460px);
    gap: clamp(32px, 6vw, 96px);
    align-items: center;
    padding: 0;
    max-width: none;
}
.auth-title {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2.8rem, 6vw, 5.2rem);
    line-height: 0.98;
    letter-spacing: -0.03em;
    margin: 14px 0 36px;
}
.auth-title em {
    display: block;
    font-style: italic;
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}
.auth-perks { list-style: none; display: grid; gap: 18px; max-width: 440px; }
.auth-perks li { display: grid; gap: 2px; padding-left: 22px; position: relative; }
.auth-perks li::before {
    content: "\2726";
    position: absolute;
    left: 0;
    top: 3px;
    color: var(--accent);
    font-size: 0.8rem;
}
.auth-perks span { color: var(--ink-2); font-size: 0.94rem; }
.auth-card {
    padding: clamp(24px, 4vw, 40px);
    border-radius: var(--r-xl);
    background: var(--surface-2);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
}
.auth-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    padding: 4px;
    margin-bottom: 24px;
    border-radius: 999px;
    background: var(--bg);
}
.auth-tabs button {
    padding: 11px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--ink-3);
    transition: background-color 0.3s, color 0.3s;
}
.auth-tabs button.is-active { background: var(--surface-2); color: var(--ink); box-shadow: var(--shadow-sm); }
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.auth-form .btn { width: 100%; }
.auth-step-title { font-family: var(--font-display); font-weight: 500; font-size: 2rem; line-height: 1.1; }
.form-group label small { font-weight: 500; color: var(--ink-3); margin-left: 6px; }
.form-msg { font-size: 0.88rem; font-weight: 600; color: var(--red); }
.form-msg:empty { display: none; }
.form-msg.is-ok { color: var(--tulsi); }
.form-note { font-size: 0.88rem; color: var(--ink-3); }
.link-btn {
    align-self: center;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--ink-2);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-color: var(--line-2);
    padding: 4px;
}
.link-btn:hover { color: var(--accent); }
.auth-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }
.code-input input {
    width: 100%;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid var(--line);
    background: var(--bg);
    text-align: center;
    font-family: var(--font-display);
    font-size: 2.4rem;
    letter-spacing: 0.4em;
    text-indent: 0.4em;
    font-variant-numeric: tabular-nums;
}
.code-input input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.btn.is-busy { opacity: 0.6; pointer-events: none; }
.btn.is-busy::after {
    content: "";
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid currentColor;
    border-right-color: transparent;
    animation: spin 0.8s linear infinite;
}
@media (max-width: 860px) {
    .auth-shell { grid-template-columns: 1fr; }
    .auth-perks { display: none; }
    .auth-title { margin-bottom: 0; }
}

/* ---------- Шапка профиля ---------- */
.profile-hero {
    position: relative;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: clamp(20px, 4vw, 44px);
    align-items: center;
    padding: clamp(24px, 4vw, 44px);
    border-radius: var(--r-xl);
    background: var(--surface);
    border: 1px solid var(--line);
    overflow: hidden;
    isolation: isolate;
}
.profile-hero::before {
    content: "";
    position: absolute;
    right: -10%;
    top: -60%;
    width: 50%;
    aspect-ratio: 1;
    background: radial-gradient(circle, var(--orb-1), transparent 65%);
    z-index: -1;
}
.profile-avatar {
    position: relative;
    width: clamp(96px, 14vw, 148px);
    aspect-ratio: 1;
    border-radius: 50%;
    cursor: pointer;
    flex-shrink: 0;
}
.profile-avatar > span:first-child { display: block; width: 100%; height: 100%; }
.profile-avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 0 0 6px var(--surface-2), var(--shadow);
    font-size: clamp(2rem, 4vw, 3rem);
    font-family: var(--font-display);
}
.profile-avatar-edit {
    position: absolute;
    right: 2px;
    bottom: 2px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--ink);
    color: var(--bg);
    box-shadow: 0 0 0 4px var(--surface);
    transition: transform 0.3s var(--ease), background-color 0.3s;
}
.profile-avatar-edit svg { width: 18px; height: 18px; }
.profile-avatar:hover .profile-avatar-edit { transform: scale(1.1); background: var(--accent); }
.profile-name {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2.2rem, 5vw, 3.8rem);
    line-height: 1;
    letter-spacing: -0.02em;
    margin-top: 8px;
}
.profile-spiritual { font-family: var(--font-display); font-style: italic; font-size: 1.35rem; color: var(--accent); margin-top: 4px; }
.profile-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.profile-chips span {
    font-size: 0.8rem;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--line);
    color: var(--ink-2);
}
.profile-about { margin-top: 14px; color: var(--ink-2); max-width: 60ch; white-space: pre-line; }
.profile-stats { display: grid; grid-auto-flow: column; gap: 6px; }
.profile-stats div { min-width: 104px; padding: 16px 18px; border-radius: 20px; background: var(--bg); }
.profile-stats dt { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-3); }
.profile-stats dd { font-family: var(--font-display); font-size: 2.4rem; line-height: 1.1; }
@media (max-width: 960px) {
    .profile-hero { grid-template-columns: auto 1fr; }
    .profile-stats { grid-column: 1 / -1; grid-auto-flow: row; grid-template-columns: repeat(3, 1fr); }
    .profile-stats div { min-width: 0; }
}
@media (max-width: 560px) {
    .profile-hero { grid-template-columns: 1fr; }
    .profile-stats dd { font-size: 1.9rem; }
    .profile-stats div { padding: 12px; }
    .profile-stats dt { font-size: 0.6rem; letter-spacing: 0.06em; }
}

/* ---------- Вкладки ---------- */
.profile-tabs {
    position: sticky;
    top: calc(var(--nav-h) + 22px);
    z-index: 5;
    display: flex;
    gap: 4px;
    margin: 20px 0;
    padding: 5px;
    width: max-content;
    max-width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
}
.profile-tabs a {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 18px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.92rem;
    color: var(--ink-2);
    transition: background-color 0.3s, color 0.3s;
}
.profile-tabs a:hover { color: var(--ink); background: var(--bg); }
.profile-tabs a.is-active { background: var(--ink); color: var(--bg); }
.profile-tabs a[hidden] { display: none; }
.profile-tabs em:empty { display: none; }
.profile-tabs em {
    font-style: normal;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 1px 7px;
    border-radius: 999px;
    background: var(--red);
    color: #fff;
}
.panel-title { font-family: var(--font-display); font-weight: 500; font-size: 1.8rem; margin: 8px 0 14px; }
.panel-title:not(:first-child) { margin-top: 36px; }

/* ---------- Списки записей ---------- */
.media-list { display: grid; gap: 8px; }
.media-row {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 16px;
    align-items: start;
    padding: 16px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--line);
    transition: border-color 0.3s;
}
.media-row:hover { border-color: var(--line-2); }
.media-play {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--ink);
    color: var(--bg);
    transition: background-color 0.3s, transform 0.3s var(--ease);
}
.media-play svg { width: 20px; height: 20px; }
.media-play:hover:not(:disabled) { background: var(--accent); color: var(--on-accent); transform: scale(1.06); }
.media-play:disabled { opacity: 0.3; cursor: not-allowed; }
.media-body { min-width: 0; padding-top: 2px; }
.media-body h4 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; line-height: 1.2; }
.media-meta { font-size: 0.82rem; color: var(--ink-3); margin-top: 3px; }
.media-desc {
    margin-top: 6px;
    font-size: 0.9rem;
    color: var(--ink-2);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.media-reason { font-size: 0.86rem; color: var(--red); margin-top: 6px; }
.media-side { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.media-actions { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.chip-btn {
    padding: 8px 14px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    font-size: 0.82rem;
    font-weight: 700;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.chip-btn:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip-btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.chip-btn.primary:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.chip-btn.danger:hover,
.btn.danger:hover { background: var(--red); border-color: var(--red); color: #fff; }
.status-chip.is-pending  { background: color-mix(in srgb, var(--accent-2) 18%, transparent); color: color-mix(in srgb, var(--accent-2) 75%, var(--ink)); }
.status-chip.is-approved { background: color-mix(in srgb, var(--tulsi) 16%, transparent); color: var(--tulsi); }
.status-chip.is-rejected { background: color-mix(in srgb, var(--red) 13%, transparent); color: var(--red); }
.media-edit {
    grid-column: 1 / -1;
    display: grid;
    gap: 12px;
    padding-top: 16px;
    margin-top: 4px;
    border-top: 1px solid var(--line);
}
.media-edit .media-actions { justify-content: flex-start; }
.media-edit input,
.media-edit textarea,
.media-edit select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: var(--bg);
}
.empty-state {
    padding: 48px 20px;
    text-align: center;
    color: var(--ink-3);
    border-radius: 20px;
    border: 1px dashed var(--line-2);
    line-height: 1.8;
}
.empty-state .btn { margin-top: 14px; }
@media (max-width: 640px) {
    .media-row { grid-template-columns: auto 1fr; }
    .media-side {
        grid-column: 1 / -1;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
        justify-content: space-between;
    }
}

/* ---------- Загрузка ---------- */
.upload-card,
.settings-card {
    display: flex;
    flex-direction: column;
    gap: 16px;
    padding: clamp(20px, 3.5vw, 36px);
    border-radius: var(--r-xl);
    background: var(--surface);
    border: 1px solid var(--line);
}
.upload-card { max-width: 860px; }
.settings-card h3 { font-family: var(--font-display); font-weight: 500; font-size: 1.7rem; }
.segmented {
    display: inline-grid;
    grid-auto-flow: column;
    align-self: flex-start;
    padding: 4px;
    border-radius: 999px;
    background: var(--bg);
}
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span {
    display: block;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--ink-3);
    cursor: pointer;
    transition: background-color 0.3s, color 0.3s;
}
.segmented input:checked + span { background: var(--ink); color: var(--bg); }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 40px 20px;
    border-radius: 24px;
    border: 2px dashed var(--line-2);
    background: var(--bg);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.3s, background-color 0.3s;
}
.dropzone svg { width: 40px; height: 40px; color: var(--accent); margin-bottom: 6px; }
.dropzone b { font-size: 1.05rem; word-break: break-word; }
.dropzone span { font-size: 0.86rem; color: var(--ink-3); }
.dropzone:hover,
.dropzone.is-drag { border-color: var(--accent); background: var(--accent-soft); }
.dropzone.has-file { border-style: solid; border-color: var(--tulsi); }
.upload-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.upload-grid .span-2 { grid-column: 1 / -1; }
.form-group input[type="date"] { min-height: 50px; }
@media (max-width: 560px) { .upload-grid { grid-template-columns: 1fr; } }
.upload-progress { display: flex; align-items: center; gap: 12px; }
.upload-progress-bar { flex: 1; height: 8px; border-radius: 8px; background: var(--bg-2); overflow: hidden; }
.upload-progress-bar i { display: block; height: 100%; width: 0; background: var(--grad); border-radius: 8px; transition: width 0.2s; }
.upload-progress span { font-size: 0.85rem; font-weight: 700; min-width: 90px; text-align: right; white-space: nowrap; }
.upload-foot { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

/* ---------- Настройки ---------- */
.settings-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 16px; align-items: start; }
.settings-side { display: grid; gap: 16px; }
.settings-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.settings-actions .btn { min-height: 44px; padding: 0 18px; font-size: 0.88rem; }
.settings-card > .btn { align-self: flex-start; }
@media (max-width: 860px) { .settings-grid { grid-template-columns: 1fr; } }

/* ---------- Модерация ---------- */
.mod-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.mod-side { display: grid; gap: 16px; position: sticky; top: calc(var(--nav-h) + 90px); }
.mod-side .settings-card { padding: 24px; }
.tg-status p,
.server-info p { font-size: 0.9rem; color: var(--ink-2); margin: 2px 0; }
.tg-status .tg-on { color: var(--tulsi); font-weight: 700; }
.tg-status .tg-off { color: var(--red); }
.server-info .ok { color: var(--tulsi); }
.server-info .bad { color: var(--red); }
.tg-help summary { cursor: pointer; font-weight: 700; font-size: 0.88rem; color: var(--accent); }
.tg-help ol { margin: 10px 0 0 18px; display: grid; gap: 6px; font-size: 0.86rem; color: var(--ink-2); }
.users-list { display: grid; gap: 6px; }
.user-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    border-radius: 16px;
    background: var(--surface);
    border: 1px solid var(--line);
}
.user-avatar { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; flex-shrink: 0; font-size: 0.8rem; }
.user-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.user-body b { font-size: 0.94rem; }
.user-body small { font-size: 0.8rem; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 960px) {
    .mod-grid { grid-template-columns: 1fr; }
    .mod-side { position: static; }
}
@media (max-width: 560px) {
    .user-row { flex-wrap: wrap; }
}

/* ---------- Уведомление ---------- */
.toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    z-index: 2000;
    max-width: calc(100vw - 32px);
    padding: 14px 22px;
    border-radius: 999px;
    background: var(--ink);
    color: var(--bg);
    font-weight: 600;
    font-size: 0.92rem;
    box-shadow: var(--shadow-lg);
    transform: translate(-50%, 20px);
    opacity: 0;
    pointer-events: none;
    transition: transform 0.4s var(--ease), opacity 0.3s;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.toast.is-error { background: var(--red); color: #fff; }

/* ---------- Избранное на карточках лекций ---------- */
.lecture-card-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Видеозапись лекции: вторичная кнопка «Слушать» рядом со «Смотреть» */
.lecture-card-play--soft { background: none !important; border: 1px solid var(--line-2) !important; color: var(--ink) !important; }
.video-modal {
    position: fixed; inset: 0; z-index: 1300;
    display: grid; place-items: center; padding: 16px;
    background: rgba(5, 3, 2, 0.82);
    animation: live-fade 0.2s ease;
}
.video-modal-card { width: min(1100px, 100%); display: grid; gap: 10px; }
.video-modal-head { display: flex; align-items: center; gap: 12px; color: #f3eadb; }
.video-modal-head b { flex: 1; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.video-modal-close { width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255,255,255,0.25); background: rgba(255,255,255,0.08); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.video-modal video { width: 100%; max-height: calc(100dvh - 110px); border-radius: var(--r); background: #000; }

/* Только для администратора: html.role-admin ставит auth.js */
.admin-only { display: none !important; }
html.role-admin .admin-only { display: inline-flex !important; }
.lecture-card-admin {
    align-items: center;
    height: 42px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line-2);
    background: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ink-2);
    cursor: pointer;
    text-decoration: none;
}
.lecture-card-admin:hover { color: var(--accent); border-color: var(--accent); }
.lecture-card-del:hover { color: var(--red); border-color: var(--red); }
.lecture-card-fav {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    border: 1px solid var(--line-2);
    color: var(--ink-3);
    transition: color 0.2s, background-color 0.2s, transform 0.3s var(--ease);
}
.lecture-card-fav:hover { color: var(--red); transform: scale(1.08); }
.lecture-card-fav.is-fav { color: var(--red); border-color: transparent; background: color-mix(in srgb, var(--red) 12%, transparent); }
.lecture-card-fav.is-fav svg { fill: currentColor; }

.profile-view { padding: 0; max-width: none; }

/* ============================================================
   ПРАВОВОЕ: баннер cookie, документы, галочки согласия
   ============================================================ */
.cookie-banner {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 1200;
    width: min(760px, calc(100% - 32px));
    display: flex;
    align-items: center;
    gap: 16px 24px;
    padding: 18px 20px;
    background: var(--surface);
    color: var(--ink);
    border: 1px solid var(--line-2);
    border-radius: var(--r);
    box-shadow: var(--shadow-lg);
    font-size: 0.9rem;
    line-height: 1.5;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner p { margin: 0; flex: 1; color: var(--ink-2); }
.cookie-banner p b { color: var(--ink); }
.cookie-banner a { color: var(--accent); text-decoration: underline; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-actions .btn { min-height: 42px; padding: 0 18px; font-size: 0.88rem; }
@media (max-width: 640px) {
    .cookie-banner { flex-direction: column; align-items: stretch; bottom: 8px; }
    .cookie-actions .btn { flex: 1; }
}

/* ---------- Админ-панель (admin.html) ---------- */
.admin-page { width: min(1000px, calc(100% - 32px)); margin: 0 auto; padding: 130px 0 80px; }
.admin-head { margin-bottom: 28px; }
.admin-gate { text-align: center; color: var(--ink-2); display: grid; gap: 16px; justify-items: center; }
.admin-gate[hidden] { display: none; }
.admin-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 20px; padding: 6px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); width: fit-content; max-width: 100%; }
.admin-tabs button { padding: 10px 18px; border-radius: 999px; border: 0; background: none; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.admin-tabs button.is-active { background: var(--accent); color: var(--on-accent, #fff); }
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin-bottom: 12px; }
.admin-input { flex: 1; min-width: 220px; min-height: 46px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: var(--surface); }
.admin-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.admin-filter { display: inline-flex; align-items: center; gap: 8px; font-size: 0.9rem; color: var(--ink-2); cursor: pointer; }
.admin-hint { font-size: 0.88rem; color: var(--ink-3); margin: 0 0 16px; }
.admin-list { display: grid; gap: 10px; }
.admin-empty { text-align: center; color: var(--ink-3); padding: 24px 0; }
.admin-row {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 14px 16px; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line);
}
.admin-row .user-avatar { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; flex-shrink: 0; display: grid; place-items: center; background: var(--grad); color: #1d0f04; font-weight: 700; }
.admin-row-body { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.admin-row-body small { color: var(--ink-3); font-size: 0.82rem; word-break: break-word; }
.admin-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.admin-chips:empty { display: none; }
.admin-row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.admin-code { font-family: ui-monospace, Consolas, monospace; font-size: 1.5rem; font-weight: 700; letter-spacing: 0.12em; color: var(--accent); min-width: 120px; }
.admin-card { padding: 24px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line); display: grid; gap: 16px; }
.admin-card[hidden] { display: none; }
.admin-done { margin-top: 16px; border-color: color-mix(in srgb, var(--tulsi, #4c8a4c) 60%, var(--line)); }
.admin-done h3 { font-family: var(--font-display); font-size: 1.6rem; }
.admin-creds { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 1.1rem; margin: 0; }
.admin-creds dt { color: var(--ink-3); }
.admin-creds dd { margin: 0; font-weight: 700; font-family: ui-monospace, Consolas, monospace; word-break: break-all; }
.admin-start { grid-template-columns: 1fr auto; align-items: center; margin-bottom: 24px; border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.admin-start h3 { font-family: var(--font-display); font-size: 1.5rem; margin-bottom: 6px; }
.admin-start .admin-hint { margin-bottom: 10px; }
.admin-link { display: inline-block; padding: 8px 12px; border-radius: 10px; background: var(--bg-2, var(--bg)); font-size: 0.95rem; word-break: break-all; }
.admin-start-actions { display: flex; flex-direction: column; gap: 8px; }
.admin-start-actions .btn { justify-content: center; }
.admin-start-actions .btn::after { display: none; }
@media (max-width: 640px) {
    .admin-start { grid-template-columns: 1fr; }
    .admin-start-actions { flex-direction: row; }
    .admin-start-actions .btn { flex: 1; }
}
.admin-pass { display: flex; gap: 8px; }
.admin-pass input { flex: 1; font-family: ui-monospace, Consolas, monospace; }
@media (max-width: 640px) {
    .admin-page { padding-top: 110px; }
    .admin-tabs { border-radius: var(--r); width: 100%; }
    .admin-tabs button { flex: 1; padding: 10px 8px; font-size: 0.85rem; }
    .admin-row-actions { width: 100%; }
    .admin-row-actions .chip-btn { flex: 1; }
}

/* ---------- Плашка «Сейчас идёт лекция» на главной (main.js) ----------
   Закреплена под шапкой — видна сразу, без прокрутки */
.live-banner {
    position: fixed;
    top: 96px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 900;
    width: min(720px, calc(100% - 24px));
    animation: live-fade 0.4s ease;
}
.live-banner[hidden] { display: none; }
.live-banner-inner {
    display: flex;
    align-items: center;
    gap: 14px 18px;
    padding: 12px 12px 12px 20px;
    border-radius: 999px;
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--accent) 55%, var(--line));
    box-shadow: var(--shadow-lg), 0 0 0 4px var(--accent-soft);
}
.live-banner-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--accent);
}
.live-banner-text { display: flex; flex-direction: column; min-width: 0; flex: 1; line-height: 1.3; }
.live-banner-text b { font-size: 1rem; color: var(--ink); }
.live-banner-text span { font-size: 0.85rem; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.live-banner-btn { flex-shrink: 0; min-height: 44px; padding: 0 20px; }
.live-banner-btn::after { display: none; }
@media (max-width: 640px) {
    .live-banner { top: 86px; }
    .live-banner-inner { flex-wrap: wrap; border-radius: var(--r-lg); padding: 14px; }
    .live-banner-text { flex-basis: calc(100% - 120px); }
    .live-banner-btn { width: 100%; justify-content: center; }
}

/* ---------- «Идёт лекция» — окно с предложением подключиться (auth.js) ---------- */
.live-modal {
    position: fixed;
    inset: 0;
    z-index: 1300;
    display: grid;
    place-items: center;
    padding: 16px;
    background: rgba(10, 6, 3, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    animation: live-fade 0.25s ease;
}
@keyframes live-fade { from { opacity: 0; } }
.live-modal-card {
    width: min(420px, 100%);
    padding: 28px 24px 22px;
    border-radius: var(--r-lg);
    background: var(--surface);
    border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--line));
    box-shadow: var(--shadow-lg);
    text-align: center;
    animation: pop-in 0.3s var(--ease);
}
.live-modal-tag {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--accent);
}
.live-modal-dot {
    width: 9px; height: 9px; border-radius: 50%;
    background: var(--red, #d33);
    animation: live-dot 1.4s ease-in-out infinite;
}
@keyframes live-dot { 50% { opacity: 0.35; transform: scale(0.8); } }
.live-modal-card h3 { font-family: var(--font-display); font-size: 2rem; font-weight: 600; margin: 10px 0 6px; }
.live-modal-name { font-size: 1.05rem; font-weight: 600; color: var(--ink); margin: 0; }
.live-modal-meta { font-size: 0.88rem; color: var(--ink-3); margin: 6px 0 20px; }
.live-modal-actions { display: flex; gap: 10px; }
.live-modal-actions .btn { flex: 1; min-height: 48px; padding: 0 14px; justify-content: center; }
.live-modal-actions .btn::after { display: none; }
@media (max-width: 380px) { .live-modal-actions { flex-direction: column-reverse; } }

.footer-legal { display: flex; flex-wrap: wrap; gap: 6px 18px; width: 100%; }
.footer-legal a, .footer-legal .link-btn { font-size: 0.8rem; color: inherit; opacity: 0.75; align-self: auto; font-weight: 500; padding: 0; }
.footer-legal a:hover, .footer-legal .link-btn:hover { opacity: 1; color: var(--accent); }

.legal-page {
    max-width: 860px;
    margin: 0 auto;
    padding: calc(var(--nav-h) + 56px) var(--gutter) 64px;
}
.legal-doc h1 { font-family: var(--font-display); font-weight: 500; font-size: clamp(2rem, 5vw, 3rem); line-height: 1.1; margin: 12px 0 8px; }
.legal-doc h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.45rem; margin: 36px 0 10px; scroll-margin-top: calc(var(--nav-h) + 16px); }
.legal-doc p, .legal-doc li { color: var(--ink-2); line-height: 1.7; margin: 0 0 10px; }
.legal-doc ul { padding-left: 1.2em; margin: 0 0 10px; }
.legal-doc a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.legal-doc .link-btn { color: var(--accent); text-decoration: underline; font-size: inherit; padding: 0; }
.legal-meta { font-size: 0.88rem; color: var(--ink-3) !important; }
.legal-table-wrap { overflow-x: auto; margin: 12px 0 16px; border: 1px solid var(--line); border-radius: var(--r-sm); }
.legal-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 560px; }
.legal-table th, .legal-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--ink-2); }
.legal-table th { color: var(--ink); background: var(--bg-2); font-weight: 700; }
.legal-table tr:last-child td { border-bottom: 0; }
/* Незаполненные данные оператора — видно сразу, что вписать */
.op-missing { background: var(--accent-soft); color: var(--red); border-radius: 4px; padding: 0 3px; }

.check { display: flex; gap: 10px; align-items: flex-start; font-size: 0.86rem; line-height: 1.45; color: var(--ink-2); cursor: pointer; text-align: left; }
.check input { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; accent-color: var(--accent); cursor: pointer; }
.check a { color: var(--accent); text-decoration: underline; }

.danger-card { border-color: color-mix(in srgb, var(--red) 35%, var(--line)); }
.danger-card h3 { color: var(--red); }

/* ---------- Новости из календаря ---------- */
.news-when {
    margin-left: 4px;
    padding: 3px 10px;
    border-radius: 999px;
    background: var(--accent);
    color: var(--on-accent);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    align-self: center;
}
.news-empty { grid-column: 1 / -1; color: var(--ink-3); text-align: center; padding: 32px 0; }
.news-empty a { color: var(--accent); text-decoration: underline; }
.news-card:first-child .news-when { background: #1d0f04; color: #fffaf2; }

/* ---------- «Я не робот» ---------- */
.captcha { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 14px; }
.captcha-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.captcha-box {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 0 18px 0 14px;
    border: 1px solid var(--line-2);
    border-radius: var(--r-sm);
    background: var(--surface-2);
    color: var(--ink);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: border-color 0.2s;
}
.captcha-box:hover:not(:disabled) { border-color: var(--accent); }
.captcha-box:disabled { cursor: default; }
.captcha-tick {
    position: relative;
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border: 2px solid var(--line-2);
    border-radius: 6px;
    background: var(--surface);
    transition: background 0.2s, border-color 0.2s;
}
.captcha[data-state="busy"] .captcha-tick {
    border-color: var(--line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: captcha-spin 0.7s linear infinite;
}
.captcha[data-state="ok"] .captcha-tick { background: var(--tulsi); border-color: var(--tulsi); }
.captcha[data-state="ok"] .captcha-tick::after {
    content: "";
    position: absolute;
    left: 7px;
    top: 2px;
    width: 6px;
    height: 12px;
    border: solid #fff;
    border-width: 0 2.5px 2.5px 0;
    transform: rotate(45deg);
}
.captcha[data-state="error"] .captcha-box { border-color: var(--red); }
.captcha[data-state="error"] .captcha-label { color: var(--red); }
.captcha-note { font-size: 0.75rem; color: var(--ink-3); }
@keyframes captcha-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .captcha[data-state="busy"] .captcha-tick { animation-duration: 2s; } }

/* ============================================================
   СТРАНИЦА ГУРУ (guru.html)
   ============================================================ */
.guru-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: calc(var(--nav-h) + 40px) var(--gutter) 72px;
}
.guru-back {
    display: inline-block;
    margin-bottom: 28px;
    color: var(--ink-3);
    text-decoration: none;
    font-size: 0.95rem;
    transition: color .2s;
}
.guru-back:hover { color: var(--accent); }

.guru-hero {
    display: grid;
    grid-template-columns: minmax(260px, 400px) 1fr;
    gap: clamp(32px, 6vw, 72px);
    align-items: start;
}

/* Портрет в арке, как окно храма */
.guru-portrait { position: sticky; top: calc(var(--nav-h) + 24px); }
.guru-portrait-frame {
    position: relative;
    aspect-ratio: 3 / 4;
    border-radius: 999px 999px 22px 22px;
    overflow: hidden;
    background: radial-gradient(circle at 50% 35%, var(--accent-soft), var(--surface-2) 70%);
    box-shadow:
        0 0 0 1px var(--line),
        0 0 0 8px var(--surface),
        0 0 0 9px color-mix(in srgb, var(--accent-2) 60%, transparent),
        0 30px 80px -24px rgba(0, 0, 0, 0.55),
        0 0 100px -20px color-mix(in srgb, var(--accent) 40%, transparent);
}
.guru-placeholder {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    font-size: 5rem;
    color: var(--accent-2);
    opacity: 0.6;
}
.guru-portrait-frame img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center top;
    opacity: 0;
    transition: opacity .5s;
}
.guru-portrait-frame img.is-loaded { opacity: 1; }
.guru-number {
    display: block;
    margin-top: 22px;
    text-align: center;
    font-family: var(--font-display);
    font-size: 1.05rem;
    letter-spacing: 0.2em;
    color: var(--accent-2);
}

.guru-name {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2.1rem, 4.6vw, 3.4rem);
    line-height: 1.08;
    margin: 14px 0 10px;
}
.guru-years {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.25rem;
    color: var(--accent-2);
    margin: 0 0 28px;
}
.guru-bio p {
    color: var(--ink-2);
    font-size: 1.08rem;
    line-height: 1.75;
    margin: 0 0 18px;
}
.guru-bio p:first-child::first-letter {
    float: left;
    font-family: var(--font-display);
    font-size: 3.6em;
    line-height: 0.85;
    padding: 6px 10px 0 0;
    color: var(--accent);
}
.guru-works {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--line);
}
.guru-works h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1.35rem;
    margin: 0 0 14px;
}
.guru-works ul {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
}
.guru-works li {
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink-2);
    font-size: 0.92rem;
    font-style: italic;
}

/* Предыдущий / следующий */
.guru-pager {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 64px;
}
.guru-pager-link {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 20px 24px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--surface-2);
    text-decoration: none;
    color: var(--ink);
    transition: border-color .2s, transform .2s;
}
.guru-pager-link:hover { border-color: var(--accent); transform: translateY(-2px); }
.guru-pager-next { text-align: right; }
.guru-pager-label { font-size: 0.85rem; color: var(--ink-3); letter-spacing: 0.04em; }
.guru-pager-name { font-family: var(--font-display); font-size: 1.2rem; line-height: 1.2; }

@media (max-width: 800px) {
    .guru-hero { grid-template-columns: 1fr; }
    .guru-portrait { position: static; max-width: 300px; margin: 0 auto; width: 100%; }
    .guru-pager { grid-template-columns: 1fr; }
    .guru-pager-next { text-align: left; }
}

/* Карточки карусели ведут на страницу гуру */
.carousel-card { cursor: pointer; }

/* ============================================================
   СТРАНИЦА ГЕРБА (emblem.html)
   ============================================================ */
.emblem-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: calc(var(--nav-h) + 48px) var(--gutter) 72px;
}
.emblem-head { max-width: 720px; margin-bottom: 40px; }
.emblem-head h1 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2rem, 4.6vw, 3.2rem);
    line-height: 1.1;
    margin: 14px 0 12px;
}
.emblem-lead { color: var(--ink-2); font-size: 1.08rem; line-height: 1.7; margin: 0; }

.emblem-layout {
    display: grid;
    grid-template-columns: minmax(280px, 440px) minmax(0, 1fr);
    gap: clamp(28px, 5vw, 64px);
    align-items: start;
}
.emblem-figure { margin: 0; position: sticky; top: calc(var(--nav-h) + 24px); }
.emblem-medal {
    padding: 6%;
    border-radius: 28px;
    isolation: isolate;
    background: radial-gradient(circle at 50% 40%, #fffaf0 0%, #f7ecd6 60%, #ecd9b4 100%);
    box-shadow:
        inset 0 0 0 3px #fff8ea,
        inset 0 0 0 5px var(--accent-2),
        0 0 0 8px color-mix(in srgb, var(--surface) 55%, transparent),
        0 0 0 9px color-mix(in srgb, var(--accent-2) 55%, transparent),
        0 30px 80px -24px rgba(0, 0, 0, 0.55),
        0 0 100px -20px color-mix(in srgb, var(--accent) 40%, transparent);
}
.emblem-canvas { position: relative; }
.emblem-canvas img { display: block; width: 100%; height: auto; mix-blend-mode: multiply; }

.emblem-pin {
    position: absolute;
    translate: -50% -50%;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 2px solid #fff;
    background: var(--accent);
    color: #fff;
    font: 700 0.8rem/1 system-ui, sans-serif;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
    transition: scale .2s, background .2s;
}
.emblem-pin::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid var(--accent);
    opacity: 0;
    animation: pin-pulse 2.4s ease-out infinite;
}
.emblem-pin:hover, .emblem-pin.is-active { scale: 1.25; background: var(--accent-2); }
.emblem-pin.is-active::after { border-color: var(--accent-2); }
@keyframes pin-pulse {
    0%   { opacity: .7; scale: .8; }
    100% { opacity: 0;  scale: 1.6; }
}

/* Медальон на главной ведёт на страницу герба */
a.hero-medal { text-decoration: none; transition: scale .35s ease; }
a.hero-medal:hover { scale: 1.03; }

/* Оглавление символов под гербом */
.emblem-index {
    list-style: none;
    margin: 28px 0 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    counter-reset: sym;
}
.emblem-index li { counter-increment: sym; }
.emblem-index button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px 6px 6px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface-2);
    color: var(--ink-2);
    font: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: border-color .2s, color .2s;
}
.emblem-index button::before {
    content: counter(sym);
    display: grid;
    place-items: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font: 700 0.72rem/1 system-ui, sans-serif;
}
.emblem-index button:hover,
.emblem-index button.is-active { border-color: var(--accent); color: var(--ink); }
.emblem-index button.is-active::before { background: var(--accent); color: #fff; }

/* Документ о гербе — лист пергамента */
.emblem-charter {
    padding: clamp(24px, 4.5vw, 56px);
    border-radius: 6px;
    background: linear-gradient(180deg, #fbf4e4, #f3e6c8);
    color: #3a2c1c;
    box-shadow:
        inset 0 0 0 1px rgba(150, 110, 40, 0.35),
        inset 0 0 0 8px #fbf4e4,
        inset 0 0 0 9px rgba(150, 110, 40, 0.45),
        inset 0 0 60px rgba(150, 100, 30, 0.18),
        0 30px 80px -30px rgba(0, 0, 0, 0.6);
    min-width: 0;
}
.emblem-charter h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.6rem, 3.2vw, 2.2rem);
    text-align: center;
    margin: 0 0 22px;
    color: #3a2c1c;
}
.emblem-charter p {
    font-family: var(--font-display);
    font-size: 1.18rem;
    line-height: 1.65;
    text-align: left;
    hyphens: auto;
    overflow-wrap: break-word;
    margin: 0 0 14px;
}
.charter-logo { text-align: center; }
.charter-kicker {
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: #9a5a1a;
}
.charter-logo h2 { text-transform: uppercase; letter-spacing: 0.04em; font-size: clamp(1.3rem, 2.6vw, 1.75rem); margin: 8px 0 22px; }
.emblem-charter .charter-mantra { text-align: center; font-style: italic; color: #7a4a14; }
.emblem-charter .charter-owner { text-align: center; font-weight: 600; }
.emblem-charter .charter-meta {
    text-align: center;
    font-style: italic;
    font-size: 1.05rem;
    margin-top: 22px;
}
.charter-ornament {
    text-align: center;
    color: #b8862b;
    font-size: 1.6rem;
    margin: 26px 0;
    display: flex;
    align-items: center;
    gap: 16px;
}
.charter-ornament::before,
.charter-ornament::after { content: ""; flex: 1; height: 1px; background: rgba(150, 110, 40, 0.4); }

/* Подсветка места в тексте */
.emblem-charter .hl {
    border-radius: 3px;
    transition: background .3s, box-shadow .3s;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
}
.emblem-charter .hl.is-active {
    background: rgba(236, 140, 40, 0.42);
    box-shadow: 0 0 0 3px rgba(236, 140, 40, 0.42);
    color: #2a1b0c;
}

/* Сноски */
.fn-ref { line-height: 0; }
.fn-ref a {
    color: #b0551a;
    font-weight: 700;
    font-size: 0.75em;
    text-decoration: none;
    padding: 0 1px;
}
.fn-ref a:hover { text-decoration: underline; }
.charter-notes {
    margin-top: 34px;
    padding-top: 18px;
    border-top: 1px solid rgba(150, 110, 40, 0.45);
}
.charter-notes h3 {
    font-family: var(--font-display);
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 10px;
}
.charter-notes ol { margin: 0; padding-left: 1.4em; }
.charter-notes li {
    font-size: 0.95rem;
    line-height: 1.55;
    color: #5a4630;
    margin-bottom: 6px;
    scroll-margin-top: calc(var(--nav-h) + 20px);
}
.charter-notes li:target { background: rgba(240, 160, 60, 0.22); border-radius: 3px; }
.fn-back { color: #b0551a; text-decoration: none; margin-left: 4px; }
.fn-ref a:target { outline: 2px solid rgba(240, 160, 60, 0.6); border-radius: 2px; }
.fn-ref a { scroll-margin-top: calc(var(--nav-h) + 80px); }

@media (max-width: 1100px) {
    .emblem-layout { grid-template-columns: minmax(240px, 330px) minmax(0, 1fr); gap: 28px; }
    .emblem-index button { font-size: 0.8rem; }
}

@media (max-width: 860px) {
    .emblem-layout { grid-template-columns: 1fr; }
    .emblem-figure { position: static; max-width: 480px; margin: 0 auto; width: 100%; }
    .emblem-pin { width: 24px; height: 24px; font-size: 0.72rem; }
    .emblem-charter p { font-size: 1.08rem; text-align: left; }
}

/* Посвящение на странице гуру: фото + шлоки на пергаменте */
.guru-dedication { margin-top: 80px; }
.dedication-head { text-align: center; margin-bottom: 40px; }
.dedication-head h2 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    margin: 12px 0 0;
}
.dedication-row {
    display: grid;
    grid-template-columns: minmax(220px, 380px) minmax(0, 1fr);
    gap: clamp(24px, 4vw, 48px);
    align-items: center;
    margin-bottom: 56px;
}
.dedication-row:nth-of-type(odd) { grid-template-columns: minmax(0, 1fr) minmax(220px, 380px); }
.dedication-row:nth-of-type(odd) .dedication-photo { order: 2; }
.dedication-photo { margin: 0; }
.dedication-photo img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 999px 999px 22px 22px;
    box-shadow:
        0 0 0 1px var(--line),
        0 0 0 8px var(--surface),
        0 0 0 9px color-mix(in srgb, var(--accent-2) 60%, transparent),
        0 30px 70px -24px rgba(0, 0, 0, 0.55);
}
.dedication-sheet {
    padding: clamp(22px, 4vw, 44px);
    border-radius: 6px;
    background: linear-gradient(180deg, #fbf4e4, #f3e6c8);
    color: #3a2c1c;
    box-shadow:
        inset 0 0 0 1px rgba(150, 110, 40, 0.35),
        inset 0 0 0 8px #fbf4e4,
        inset 0 0 0 9px rgba(150, 110, 40, 0.45),
        inset 0 0 60px rgba(150, 100, 30, 0.18),
        0 30px 80px -30px rgba(0, 0, 0, 0.6);
}
.dedication-verse {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 1.22rem;
    line-height: 1.6;
    text-align: center;
    color: #7a4a14;
    margin: 0 0 16px;
}
.dedication-text {
    font-family: var(--font-display);
    font-size: 1.15rem;
    line-height: 1.65;
    margin: 0 0 12px;
}
.dedication-sheet .charter-ornament { margin: 20px 0; }

@media (max-width: 800px) {
    .dedication-row,
    .dedication-row:nth-of-type(odd) { grid-template-columns: 1fr; }
    .dedication-row:nth-of-type(odd) .dedication-photo { order: 0; }
    .dedication-photo { max-width: 320px; margin: 0 auto; width: 100%; }
}

/* Подсказка под гербом: мышь «кликает», стрелки бегут к гербу */
.hero-emblem { margin-bottom: 64px; }
.emblem-cue {
    position: absolute;
    top: calc(100% + 4px);
    left: 50%;
    translate: -50% 0;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--ink-2);
    text-decoration: none;
    transition: color .25s;
}
.emblem-cue:hover { color: var(--accent-2); }
.cue-mouse, .cue-tap { width: 26px; height: 37px; flex: none; }
.cue-tap { display: none; width: 34px; }
.cue-mouse-btn { fill: currentColor; opacity: 0; animation: cue-click 2.4s ease-in-out infinite; }
.cue-mouse { animation: cue-press 2.4s ease-in-out infinite; }
.cue-tap-ring { transform-origin: 13px 8px; animation: cue-ring 2.4s ease-out infinite; }

.cue-arrows { display: flex; flex-direction: column-reverse; gap: 1px; }
.cue-arrows svg {
    width: 22px;
    height: 11px;
    fill: none;
    stroke: var(--accent-2);
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    opacity: .15;
    animation: cue-arrow 2.4s ease-in-out infinite;
}
.cue-arrows svg:nth-child(2) { animation-delay: .18s; }
.cue-arrows svg:nth-child(3) { animation-delay: .36s; }

@keyframes cue-click {
    0%, 55%, 100% { opacity: 0; }
    62%, 72%      { opacity: .9; }
}
@keyframes cue-press {
    0%, 58%, 100% { scale: 1; }
    65%           { scale: .92; }
}
@keyframes cue-ring {
    0%, 55%  { opacity: 0; scale: .4; }
    62%      { opacity: .9; }
    90%, 100% { opacity: 0; scale: 1.6; }
}
@keyframes cue-arrow {
    0%, 100% { opacity: .15; translate: 0 2px; }
    30%      { opacity: 1;   translate: 0 -1px; }
    50%      { opacity: .15; translate: 0 -2px; }
}

/* Когда подсказку трогают — герб откликается */
.hero-emblem:has(.emblem-cue:hover) .hero-medal { scale: 1.03; }

/* Тач-экраны: палец вместо мыши */
@media (hover: none) {
    .cue-mouse { display: none; }
    .cue-tap { display: block; }
}
@media (max-width: 900px) {
    .hero-emblem { margin-bottom: 56px; }
}
@media (prefers-reduced-motion: reduce) {
    .cue-mouse, .cue-mouse-btn, .cue-tap-ring, .cue-arrows svg { animation: none; }
    .cue-arrows svg { opacity: .7; }
}

/* ============================================================
   КНИГА (book.html)
   ============================================================ */
.book-progress {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: 3px;
    z-index: 200;
    pointer-events: none;
}
.book-progress span {
    display: block;
    height: 100%;
    width: 0;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 60%, transparent);
}

.book-page {
    display: grid;
    grid-template-columns: 290px minmax(0, 820px);
    gap: 40px;
    justify-content: center;
    max-width: 1240px;
    margin: 0 auto;
    padding: calc(var(--nav-h) + 40px) var(--gutter) 72px;
    align-items: start;
}

/* Оглавление */
.book-toc {
    position: sticky;
    top: calc(var(--nav-h) + 24px);
    max-height: calc(100vh - var(--nav-h) - 48px);
    overflow-y: auto;
    padding: 20px 14px 20px 18px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--surface-2);
    scrollbar-width: thin;
}
.book-toc-head { display: flex; align-items: center; justify-content: space-between; }
.book-toc-close { display: none; background: none; border: 0; color: var(--ink-2); font-size: 1.1rem; cursor: pointer; }
.book-toc-title {
    font-family: var(--font-display);
    font-size: 1.3rem;
    font-weight: 600;
    line-height: 1.2;
    margin: 10px 0 14px;
}
.book-toc-list { list-style: none; margin: 0; padding: 0; counter-reset: toc; }
.book-toc-list a {
    display: block;
    padding: 7px 10px;
    border-radius: 10px;
    border-left: 2px solid transparent;
    color: var(--ink-2);
    font-size: 0.8rem;
    line-height: 1.35;
    text-decoration: none;
    overflow-wrap: anywhere;
    transition: background .2s, color .2s, border-color .2s;
}
.book-toc-list a:hover { background: var(--accent-soft); color: var(--ink); }
.book-toc-list a.is-current {
    background: var(--accent-soft);
    border-left-color: var(--accent);
    color: var(--ink);
    font-weight: 600;
}

/* Текст книги — пергамент */
.book-text {
    container: booktext / inline-size;
    padding: clamp(24px, 5vw, 64px) clamp(20px, 5vw, 72px);
    border-radius: 6px;
    background: linear-gradient(180deg, #fbf4e4, #f5ead2);
    color: #33261a;
    box-shadow:
        inset 0 0 0 1px rgba(150, 110, 40, 0.35),
        inset 0 0 0 8px #fbf4e4,
        inset 0 0 0 9px rgba(150, 110, 40, 0.45),
        inset 0 0 80px rgba(150, 100, 30, 0.14),
        0 30px 80px -30px rgba(0, 0, 0, 0.6);
    /* как в печатной книге: Times New Roman, 14 pt */
    font-family: "Times New Roman", "PT Serif", "Liberation Serif", Georgia, serif;
    font-size: 1.2rem;
    line-height: 1.6;
    min-width: 0;
    font-kerning: normal;
    text-rendering: optimizeLegibility;
}
.book-text p { margin: 0 0 0.45em; overflow-wrap: break-word; }
.book-text p.j { text-align: justify; hyphens: auto; -webkit-hyphens: auto; }
.book-text p.ind { text-indent: 1.25cm; }
.book-text p.q1 { margin-left: 1.6em; }
.book-text p.q2 { margin-left: 3.2em; }
.book-text p.c { text-align: center; text-indent: 0; }
.book-text p.r { text-align: right; margin-left: 20%; text-indent: 0; }
.book-text .corsiva { font-family: "Monotype Corsiva", "Apple Chancery", "URW Chancery L", "Times New Roman", serif; font-style: italic; }
.book-gap { height: 0.7em; }
.book-chapter { scroll-margin-top: calc(var(--nav-h) + 20px); }
.book-chapter + .book-chapter,
.book-notes {
    margin-top: 3em;
    padding-top: 2.4em;
    border-top: 1px solid rgba(150, 110, 40, 0.4);
    position: relative;
}
.book-chapter + .book-chapter::before,
.book-notes::before {
    content: "❦";
    position: absolute;
    top: -0.85em;
    left: 50%;
    translate: -50% 0;
    padding: 0 14px;
    background: #f8efdb;
    color: #b8862b;
    font-size: 1.3rem;
}
.book-h2 {
    font-family: "Times New Roman", "PT Serif", Georgia, serif;
    font-weight: 700;
    font-size: clamp(1.35rem, 2.6vw, 1.85rem);
    line-height: 1.3;
    letter-spacing: 0.02em;
    text-align: center;
    color: #3a2510;
    margin: 0 0 1.2em;
}
.book-h3, .book-h4 {
    font-family: "Times New Roman", "PT Serif", Georgia, serif;
    font-weight: 700;
    text-align: center;
    color: #3a2510;
    margin: 1.6em 0 0.8em;
}
.book-h3 { font-size: 1.35rem; }
.book-h4 { font-size: 1.15rem; letter-spacing: 0.03em; }
.book-img {
    display: block;
    max-width: min(100%, 420px);
    height: auto;
    margin: 0.6em auto;
    border-radius: 14px;
    mix-blend-mode: multiply;
}
.book-text .fn-ref a { color: #b0551a; scroll-margin-top: calc(var(--nav-h) + 80px); }

/* Примечания в конце */
.book-notes { scroll-margin-top: calc(var(--nav-h) + 20px); }
.book-notes ol { padding-left: 2.2em; margin: 0; font-size: 0.98rem; line-height: 1.55; color: #4a3826; }
.book-notes li { margin-bottom: 0.5em; scroll-margin-top: calc(var(--nav-h) + 30px); }
.book-notes li:target { background: rgba(240, 160, 60, 0.25); border-radius: 4px; }
.book-notes .fn-back { color: #b0551a; text-decoration: none; }

/* Всплывающая сноска */
.fn-pop {
    position: fixed;
    z-index: 300;
    padding: 14px 16px 12px;
    border-radius: 14px;
    background: #fffaf0;
    color: #33261a;
    border: 1px solid rgba(150, 110, 40, 0.45);
    box-shadow: 0 18px 50px -12px rgba(0, 0, 0, 0.55);
    font-family: var(--font-display);
    font-size: 1.05rem;
    line-height: 1.5;
    animation: fn-in .18s ease-out;
}
@keyframes fn-in { from { opacity: 0; translate: 0 6px; } }
.fn-pop-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; color: #9a5a1a; font-size: 0.9rem; }
.fn-pop-close { background: none; border: 0; color: #7a6650; cursor: pointer; font-size: 1rem; }
.fn-pop-all { display: inline-block; margin-top: 8px; color: #b0551a; font-size: 0.88rem; text-decoration: none; }

/* Кнопка оглавления (телефон) */
.book-toc-toggle {
    display: none;
    position: fixed;
    right: 16px;
    bottom: 18px;
    z-index: 150;
    align-items: center;
    gap: 8px;
    padding: 12px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: #fff;
    font: inherit;
    font-weight: 600;
    box-shadow: 0 12px 30px -8px rgba(0, 0, 0, 0.5);
    cursor: pointer;
}

@media (max-width: 1100px) {
    .book-page { grid-template-columns: minmax(0, 1fr); }
    .book-toc {
        position: fixed;
        inset: 0 auto 0 0;
        top: 0;
        width: min(340px, 86vw);
        max-height: none;
        height: 100%;
        z-index: 250;
        border-radius: 0 20px 20px 0;
        translate: -105% 0;
        transition: translate .3s ease;
        box-shadow: 0 0 60px rgba(0, 0, 0, 0.5);
    }
    .book-toc.is-open { translate: 0 0; }
    .book-toc-close { display: block; }
    .book-toc-toggle { display: inline-flex; }
    .book-text { font-size: 1.1rem; }
    .book-text p.r { margin-left: 8%; }
}
/* узкая колонка текста: выравнивание по ширине даёт дыры — по левому краю */
@container booktext (max-width: 600px) {
    .book-text p.j { text-align: left; }
    .book-text p.ind { text-indent: 1.2em; }
    .book-text p.q1 { margin-left: 0.8em; }
    .book-text p.q2 { margin-left: 1.4em; }
    .book-text p.r { margin-left: 0; }
}
/* Невидимая увеличенная зона нажатия у цифр сносок */
.book-text .fn-ref a { position: relative; padding: 0 2px; }
.book-text .fn-ref a::after { content: ""; position: absolute; inset: -10px -8px; }
@media (max-width: 1100px) {
    body.book-toc-open::after {
        content: "";
        position: fixed;
        inset: 0;
        z-index: 240;
        background: rgba(0, 0, 0, 0.5);
    }
}

/* Ссылка «← Библиотека» в оглавлении книги */
.book-back { color: var(--accent); text-decoration: none; font-size: 0.85rem; font-weight: 600; }
.book-back:hover { text-decoration: underline; }

/* ============================================================
   БИБЛИОТЕКА (library.html)
   ============================================================ */
.library-page {
    max-width: 1120px;
    margin: 0 auto;
    padding: calc(var(--nav-h) + 48px) var(--gutter) 72px;
}
.library-head { max-width: 720px; margin-bottom: 44px; }
.library-head h1 {
    font-family: var(--font-display);
    font-weight: 500;
    font-size: clamp(2.2rem, 5vw, 3.4rem);
    line-height: 1.05;
    margin: 14px 0 12px;
}
.library-lead { color: var(--ink-2); font-size: 1.08rem; line-height: 1.7; margin: 0 0 24px; }
.library-search {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 420px;
    padding: 12px 18px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--ink-3);
    transition: border-color .2s;
}
.library-search:focus-within { border-color: var(--accent); }
.library-search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: inherit; outline: none; }

.library-grid { display: grid; gap: 28px; }
.library-card {
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: clamp(24px, 4vw, 48px);
    align-items: start;
    padding: clamp(22px, 3vw, 36px);
    border: 1px solid var(--line);
    border-radius: 26px;
    background: var(--surface-2);
}
.library-card[hidden] { display: none; }

/* Обложка: книга с корешком, слегка повёрнута, выпрямляется при наведении */
.book-cover {
    display: block;
    perspective: 900px;
    text-decoration: none;
}
.book-cover-face {
    position: relative;
    aspect-ratio: 3 / 4.2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    padding: 14% 12% 12%;
    border-radius: 4px 12px 12px 4px;
    background:
        linear-gradient(90deg, rgba(0,0,0,.28) 0, rgba(0,0,0,.08) 5%, transparent 9%),
        radial-gradient(circle at 50% 30%, #fffaf0, #f2e3c2 75%);
    box-shadow:
        inset 0 0 0 1px rgba(150, 110, 40, .4),
        inset 6px 0 0 #c99a4a,
        10px 18px 40px -12px rgba(0, 0, 0, .6);
    transform: rotateY(-14deg);
    transform-origin: left center;
    transition: transform .45s ease, box-shadow .45s ease;
}
.book-cover:hover .book-cover-face,
.book-cover:focus-visible .book-cover-face { transform: rotateY(0); box-shadow: inset 0 0 0 1px rgba(150,110,40,.4), inset 6px 0 0 #c99a4a, 0 24px 50px -14px rgba(0,0,0,.6); }
.book-cover-face img { width: 78%; height: auto; mix-blend-mode: multiply; }
.book-cover-title {
    font-family: "Times New Roman", "PT Serif", Georgia, serif;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.25;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: .03em;
    color: #4a2e10;
}

.library-info h2 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
    line-height: 1.1;
    margin: 0 0 8px;
}
.library-sub { color: var(--ink-2); font-style: italic; margin: 0 0 6px; }
.library-pub { color: var(--accent-2); font-size: .9rem; margin: 0 0 16px; }
.library-meta { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0 0 18px; }
.library-meta li {
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: .82rem;
    font-weight: 600;
}
.library-desc { color: var(--ink-2); line-height: 1.7; margin: 0 0 18px; }
.library-mark { color: var(--ink-3); font-size: .9rem; margin: 0 0 12px; }
.library-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.library-empty { color: var(--ink-3); text-align: center; padding: 40px 0; }

@media (max-width: 700px) {
    .library-card { grid-template-columns: 1fr; }
    .book-cover { max-width: 200px; margin: 0 auto; }
}

/* ============================================================
   Облегчённый режим для слабых компьютеров.
   Класс .lite на <html> ставится в <head> (мало ядер / памяти,
   «уменьшить движение» в системе) или main.js, если страница
   рисуется рывками. Убирает размытие под панелями и
   декоративные анимации; вид на обычных ПК не меняется.
   ============================================================ */
:root.lite { --glass: rgba(251, 248, 242, 0.95); }
:root.lite[data-theme="dark"] { --glass: rgba(26, 21, 17, 0.94); }
.lite *, .lite *::before, .lite *::after {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
}
.lite .hero-orb { display: none; }
.lite .hero-svg,
.lite .marquee-track,
.lite .big-player::before,
.lite .hero-copy > *,
.lite .hero-emblem,
.lite .section-header,
.lite .news-card,
.lite .gallery-item,
.lite .review-card,
.lite .contact-card,
.lite .contact-form,
.lite .quote-card,
.lite .week-card,
.lite .schedule-note,
.lite .footer-top { animation: none !important; }

/* Анимации блока, который ушёл за экран, стоят на паузе (main.js) */
.is-offscreen, .is-offscreen *, .is-offscreen *::before, .is-offscreen *::after {
    animation-play-state: paused !important;
}
