/* Заголовки: Philosopher 700 (OFL, Ярослав Захаров), раздаём сами – без Google Fonts.
   Варианты, из которых выбирали, – docs/fonts-preview.html */
@font-face {
    font-family: "Philosopher";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/fonts/philosopher-cyrillic-700-32371bda7c761975fc264485e275b909.woff2") format("woff2");
    unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
    font-family: "Philosopher";
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url("/fonts/philosopher-latin-700-7b006f20321940dcb07f3baccb4ae0e3.woff2") format("woff2");
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --font-display: "Philosopher", "Segoe UI", Roboto, sans-serif;
    --bg: #fbfaf7;
    --surface: #ffffff;
    --text: #1f1d2b;
    --muted: #6b6878;
    --accent: #5b3fd1;
    /* цвет свечения значков: тем же оттенком в обоих состояниях, иначе переход тени идёт через чёрный */
    --glow: rgba(91, 63, 209, 0.45);
    --glow-off: rgba(91, 63, 209, 0);
    --accent-soft: #efeafe;
    --border: #e6e3ec;
    --warn-bg: #fff6dc;
    --warn-border: #ecd38a;

    /* «Ночное небо» шапки – одинаковое в обеих темах */
    --night-1: #1d1747;
    --night-2: #120f2b;
    --night-3: #0b0a1a;
    --night-text: #f1eefc;
    --night-muted: #c4bde6;
    --star: #f5e3a6;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    --space-6: 40px;

    --radius: 12px;
    --max: 760px;
    --tap: 44px;

    color-scheme: light;
}

/*
 * Тёмная тема: по системной настройке, если посетитель не выбрал светлую явно,
 * и всегда – если выбрал тёмную (data-theme на <html> ставит js/theme.js).
 * Значения в двух блоках должны совпадать.
 */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #14131b;
        --surface: #1d1b26;
        --text: #ece9f5;
        --muted: #a29fb2;
        --accent: #b3a1ff;
        --glow: rgba(179, 161, 255, 0.55);
        --glow-off: rgba(179, 161, 255, 0);
        --accent-soft: #2a2540;
        --border: #2f2c3c;
        --warn-bg: #3a3220;
        --warn-border: #6b5a2a;
        color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #14131b;
    --surface: #1d1b26;
    --text: #ece9f5;
    --muted: #a29fb2;
    --accent: #b3a1ff;
    --glow: rgba(179, 161, 255, 0.55);
    --glow-off: rgba(179, 161, 255, 0);
    --accent-soft: #2a2540;
    --border: #2f2c3c;
    --warn-bg: #3a3220;
    --warn-border: #6b5a2a;
    color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font: 17px/1.65 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

/*
 * Ссылки – три вида, у каждого свой понятный сигнал «сюда можно нажать»:
 * 1) в тексте – тонкое полупрозрачное подчёркивание с отступом, при наведении яркое;
 * 2) заголовок-ссылка в карточке – без подчёркивания, но со стрелкой «→», кликабельна вся карточка (.card-link);
 * 3) короткие ссылки-метки – плашками (.tag-link).
 */
a {
    color: var(--accent);
    text-decoration-line: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 0.22em;
    text-decoration-color: color-mix(in srgb, currentColor 40%, transparent);
    transition: text-decoration-color 0.15s, color 0.15s;
}
a:hover { text-decoration-color: currentColor; }

.container {
    max-width: var(--max);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

main.container { padding-top: var(--space-5); padding-bottom: var(--space-6); }

h1, h2 { font-family: var(--font-display); font-weight: 700; letter-spacing: 0.005em; }
h1 { font-size: clamp(1.8rem, 1.2rem + 2.6vw, 2.6rem); line-height: 1.15; margin: 0 0 var(--space-3); }
h2 { font-size: 1.5rem; line-height: 1.3; margin: 1.8em 0 0.6em; scroll-margin-top: var(--space-4); }
h3 { font-size: 1.15rem; margin: 1.4em 0 0.4em; }

/* Шапка сайта */
.site-header { background: var(--night-3); color: var(--night-text); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); min-height: 56px; }

.logo { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); color: var(--night-text); text-decoration: none; }
.logo__mark { width: 30px; height: 30px; color: #b3a1ff; flex: none; }
.logo__text { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; letter-spacing: 0.02em; }
.site-nav { display: flex; gap: var(--space-4); overflow-x: auto; }
.site-nav a { color: var(--night-muted); text-decoration: none; display: inline-flex; align-items: center; min-height: var(--tap); white-space: nowrap; }
.site-nav a:hover { color: var(--night-text); }
.site-nav { margin-left: auto; }

/* Переключатель темы: иконка текущего режима (система / светлая / тёмная) */
.theme-toggle {
    flex: none;
    display: grid;
    place-items: center;
    width: var(--tap);
    height: var(--tap);
    margin-right: calc(-1 * var(--space-2));
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--night-muted);
    cursor: pointer;
}
.theme-toggle[hidden] { display: none; }
.theme-toggle:hover { color: var(--night-text); background: rgba(255, 255, 255, 0.08); }
.theme-toggle:focus-visible { outline: 2px solid var(--star); outline-offset: 0; }
.theme-toggle svg { width: 22px; height: 22px; display: none; }
.theme-toggle[data-choice="system"] .theme-toggle__system,
.theme-toggle[data-choice="light"] .theme-toggle__light,
.theme-toggle[data-choice="dark"] .theme-toggle__dark { display: block; }

.nav-short { display: none; }

/* На телефоне: логотип и кнопка темы в первой строке, разделы – во второй */
@media (max-width: 600px) {
    .nav-long { display: none; }
    .nav-short { display: inline; }
    .site-header__inner { flex-wrap: wrap; row-gap: 0; }
    .theme-toggle { margin-left: auto; }
    .site-nav {
        order: 3;
        width: 100%;
        margin: calc(-1 * var(--space-2)) 0 0;
        gap: var(--space-4);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        scrollbar-width: none;
    }
    .site-nav::-webkit-scrollbar { display: none; }
}
@media (max-width: 360px) {
    .site-nav { gap: var(--space-3); font-size: 0.9rem; }
}

/* Hero: ночное небо из CSS-градиентов, без картинок */
.hero {
    position: relative;
    overflow: hidden;
    color: var(--night-text);
    background:
        radial-gradient(ellipse 70% 90% at 85% -10%, rgba(140, 110, 255, 0.45), transparent 60%),
        radial-gradient(ellipse 60% 70% at 0% 110%, rgba(84, 60, 190, 0.35), transparent 60%),
        linear-gradient(165deg, var(--night-1) 0%, var(--night-2) 55%, var(--night-3) 100%);
    padding: var(--space-3) 0 var(--space-6);
}
.hero::before,
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background-repeat: repeat;
}
.hero::before {
    background-image:
        radial-gradient(1px 1px at 12% 18%, var(--star) 50%, transparent 51%),
        radial-gradient(1px 1px at 37% 72%, #fff 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 64% 33%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 81% 81%, var(--star) 50%, transparent 51%),
        radial-gradient(1px 1px at 92% 12%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 52% 54%, #fff 50%, transparent 51%);
    background-size: 230px 230px;
    opacity: 0.75;
}
.hero::after {
    background-image:
        radial-gradient(2px 2px at 22% 44%, var(--star) 50%, transparent 51%),
        radial-gradient(1px 1px at 71% 63%, #fff 50%, transparent 51%),
        radial-gradient(1.5px 1.5px at 46% 9%, #fff 50%, transparent 51%),
        radial-gradient(1px 1px at 88% 47%, var(--star) 50%, transparent 51%);
    background-size: 370px 370px;
    background-position: 60px 90px;
    opacity: 0.6;
}
.hero > .container { position: relative; z-index: 1; }
.hero h1 { color: var(--night-text); margin-top: var(--space-3); }
.hero__lead { color: var(--night-muted); font-size: 1.1rem; margin: 0; max-width: 34em; }
.hero--home { padding-top: var(--space-6); }

.hero__sign { display: flex; align-items: center; gap: var(--space-4); margin-top: var(--space-3); }
.hero__sign h1 { margin-top: 0; }
.hero__glyph {
    flex: none;
    display: grid;
    place-items: center;
    width: 72px;
    height: 72px;
    border-radius: 50%;
    color: var(--star);
    border: 1px solid rgba(245, 227, 166, 0.45);
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 32px rgba(245, 227, 166, 0.18);
}
.hero__glyph svg { width: 55%; height: 55%; }

.chips { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; margin: 0; }
.chips li {
    padding: 2px var(--space-3);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.1);
    color: var(--night-muted);
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Хлебные крошки */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    column-gap: 0.7em;
    font-size: 0.85rem;
    letter-spacing: 0.03em;
    color: var(--night-muted);
}
.breadcrumbs a {
    color: var(--night-muted);
    text-decoration: none;
    display: inline-block;
    padding: var(--space-3) 0;
    transition: color 0.15s;
}
.breadcrumbs a:hover { color: var(--night-text); }
/* «Падающая звезда». Сдвиг вниз: глаз центрирует по строчным буквам, а не по высоте строки. */
.breadcrumbs__sep {
    display: inline-flex;
    color: rgba(245, 227, 166, 0.8);
    transform: translateY(1px);
}
.breadcrumbs__sep svg { display: block; }

/* Сводка «Главное в …» */
.summary {
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    border-radius: var(--radius);
    padding: var(--space-4) var(--space-5);
    margin: 0 0 var(--space-5);
    box-shadow: 0 6px 24px rgba(30, 20, 80, 0.06);
}
.hero + main > .summary:first-child { margin-top: calc(-1 * var(--space-6) + var(--space-3)); position: relative; }
.summary__title { margin: 0 0 var(--space-2); font-size: 1.15rem; }
.summary__body ul { list-style: none; margin: 0; padding: 0; }
.summary__body li { position: relative; padding: var(--space-2) 0 var(--space-2) 1.6em; border-top: 1px solid var(--border); }
.summary__body li:first-child { border-top: 0; }
.summary__body li::before { content: "✦"; position: absolute; left: 0; color: var(--accent); }

/* Оглавление */
.toc ul { list-style: none; display: flex; flex-wrap: wrap; gap: var(--space-2); padding: 0; margin: 0 0 var(--space-4); }
.toc a {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    padding: 0 var(--space-4);
    border-radius: 999px;
    background: var(--accent-soft);
    text-decoration: none;
    font-size: 0.95rem;
}

/* Сетка знаков */
.sign-grid {
    list-style: none;
    padding: 0;
    margin: var(--space-4) 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
}
.sign-grid a {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-3) 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    height: 100%;
}
.sign-grid a:hover { border-color: var(--accent); }
.sign-grid .is-current a { background: var(--accent-soft); border-color: var(--accent); }
.sign-grid__icon { width: 28px; height: 28px; color: var(--accent); }
.sign-grid__name { font-weight: 600; margin-top: 6px; }
.sign-grid__dates { font-size: 0.85rem; color: var(--muted); }

/* Тексты из Markdown */
.content table { border-collapse: collapse; width: 100%; margin: 1em 0; font-size: 0.95rem; }
.content th, .content td { border: 1px solid var(--border); padding: var(--space-2) 10px; text-align: left; vertical-align: top; }
.content th { background: var(--accent-soft); }
.content td:first-child { white-space: nowrap; font-weight: 600; }
/* Цитата-акцент: одна ёмкая мысль текста крупно – разбивает «полотно» */
.content blockquote {
    margin: 1.6em 0;
    padding: var(--space-1) 0 var(--space-1) 18px;
    border-left: 3px solid var(--accent);
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.3rem;
    line-height: 1.4;
}
.content blockquote p { margin: 0; }

/* Текст пары знаков: разделы с собственной вёрсткой (PairLayout) */
.pair-text > section, .pair-text > .spheres, .pair-text > .duo { margin-top: 2.4em; }
.pair-text h2 { margin-top: 0; }
.lead { display: block; margin-bottom: var(--space-1); font-family: var(--font-display); font-weight: 700; font-size: 1.08rem; }

.aspect__head { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: var(--space-5); align-items: center; margin-bottom: var(--space-3); }
.aspect__name { margin: 0 0 var(--space-2); font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; line-height: 1.35; }
.aspect__facts { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.aspect__facts li { padding: 2px 12px; border-radius: 999px; background: var(--accent-soft); font-size: 0.88rem; }

.wheel-mini { --tone: var(--accent); width: 190px; height: 190px; display: block; }
.wheel-mini--harmony { --tone: #c9962c; }
.wheel-mini--tension { --tone: #d8653a; }
.wheel-mini__ring { fill: none; stroke: var(--border); stroke-width: 1.2; }
.wheel-mini__spoke { stroke: var(--border); stroke-width: 0.8; }
.wheel-mini__sign { color: var(--muted); opacity: 0.55; }
.wheel-mini__aspect { stroke: var(--tone); stroke-width: 2; stroke-linecap: round; }
.wheel-mini--neutral .wheel-mini__aspect { stroke-dasharray: 5 4; }
.wheel-mini__dot { fill: var(--surface); stroke: var(--tone); stroke-width: 1.6; }
.wheel-mini__pair { color: var(--tone); }
.wheel-mini__deg { fill: var(--muted); font-size: 15px; font-weight: 600; }

.spheres { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.sphere { --c: var(--accent); padding: var(--space-4) 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.sphere:nth-child(4n+1) { --c: #d4537e; }
.sphere:nth-child(4n+2) { --c: #d8853a; }
.sphere:nth-child(4n+3) { --c: #1d9e75; }
.sphere:nth-child(4n+4) { --c: #378add; }
.sphere__head { display: flex; align-items: center; gap: 10px; }
.sphere__head h2 { flex: 1; margin: 0; font-size: 1.15rem; }
.sphere__icon { width: 24px; height: 24px; flex: none; color: var(--c); }
.sphere__score { font-weight: 700; font-size: 1.05rem; }
.sphere .bar { display: block; height: 6px; margin: 10px 0 var(--space-3); background: var(--accent-soft); }
.sphere .bar span { background: var(--c); }
.sphere p { font-size: 0.97rem; }
.sphere p:last-child, .duo__card p:last-child { margin-bottom: 0; }

.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.duo--single { grid-template-columns: 1fr; }
.duo__card { padding: var(--space-4) 18px; background: var(--accent-soft); border-radius: var(--radius); }
.duo__card h2 { font-size: 1.15rem; margin-bottom: var(--space-2); }
.duo__card p { font-size: 0.97rem; }

.helps ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.helps li {
    position: relative;
    padding: 10px 14px 10px 44px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.97rem;
    line-height: 1.5;
}
.helps li::before {
    content: "✓";
    position: absolute;
    left: 12px;
    top: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
}

/* Страница знака: профиль и карточки пар (SignLayout) */
.profile__head { display: flex; align-items: center; gap: var(--space-5); margin-bottom: var(--space-3); }
.profile__glyph {
    flex: none;
    width: 88px;
    height: 88px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
}
.profile__glyph svg { width: 48px; height: 48px; }
.profile__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2) var(--space-4); margin: 0; flex: 1; }
.profile__facts dt { font-size: 0.8rem; color: var(--muted); }
.profile__facts dd { margin: 0; font-weight: 600; }

.pair-cards__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.pair-card {
    display: flex;
    flex-direction: column;
    padding: var(--space-4) 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.pair-cards--best .pair-card { border-color: color-mix(in srgb, #c9962c 55%, var(--border)); }
.pair-card__head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-2); }
.pair-card__glyphs { display: flex; gap: 4px; color: var(--accent); }
.pair-cards--best .pair-card__glyphs { color: #c9962c; }
.pair-card__glyphs svg { width: 26px; height: 26px; }
.pair-card__title { margin: 0; font-family: var(--font-display); font-size: 1.15rem; }
.pair-card p { font-size: 0.97rem; margin: 0 0 var(--space-3); }
.pair-card__links { list-style: none; padding: 0; margin: auto 0 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pair-card__links a, .pair-card__links li > span {
    display: inline-flex;
    gap: 6px;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    font-size: 0.88rem;
    text-decoration: none;
}
.pair-card__score { font-weight: 700; }

/* Хаб совместимости: факторы расчёта и стихии (HubLayout) */
.factors ul { list-style: none; counter-reset: factor; padding: 0; display: grid; gap: var(--space-3); }
.factors li {
    counter-increment: factor;
    position: relative;
    padding: var(--space-4) 18px var(--space-4) 64px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
}
.factors li::before {
    content: counter(factor);
    position: absolute;
    left: 18px;
    top: var(--space-4);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent);
    font-family: var(--font-display);
    font-weight: 700;
    line-height: 32px;
    text-align: center;
}

.element-cards { list-style: none; padding: 0; margin: var(--space-4) 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.element-card {
    --c: var(--accent);
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: var(--space-4) 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-top: 3px solid var(--c);
    border-radius: var(--radius);
    font-size: 0.97rem;
}
.element-card--fire { --c: #d8653a; }
.element-card--earth { --c: #7a9a3a; }
.element-card--air { --c: #2a9fb8; }
.element-card--water { --c: #378add; }
.element-card__glyphs { display: flex; gap: 6px; color: var(--c); }
.element-card__glyphs svg { width: 26px; height: 26px; }
.element-card__title { font-family: var(--font-display); font-size: 1.15rem; }

@media (max-width: 600px) {
    .profile__head { flex-direction: column; align-items: flex-start; }
    .pair-cards__grid, .element-cards { grid-template-columns: 1fr; }
}

/* Годовой гороскоп знака: периоды, темы, лента дат (HoroscopeLayout) */
.year-text > section { margin-top: 2.4em; }
.year-text h2 { margin-top: 0; }

.year-track { margin: var(--space-2) 0 var(--space-4); }
.year-track__line {
    position: relative;
    height: 8px;
    border-radius: 999px;
    /* Деления по месяцам */
    background:
        repeating-linear-gradient(90deg, transparent 0 calc(100% / 12 - 1px), var(--bg) calc(100% / 12 - 1px) calc(100% / 12)),
        var(--accent-soft);
}
.year-track__fill {
    position: absolute;
    top: 0;
    bottom: 0;
    min-width: 8px;
    border-radius: 999px;
    background: var(--accent);
}
.year-track__fill.is-point {
    top: -3px;
    bottom: auto;
    width: 14px !important;
    height: 14px;
    margin-left: -7px;
    background: var(--star);
    border: 2px solid var(--accent);
}
.year-track__months { display: grid; grid-template-columns: repeat(12, 1fr); margin-top: 4px; font-size: 0.75rem; color: var(--muted); text-align: center; }

.theme-card { --c: var(--accent); padding: var(--space-4) 20px var(--space-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.theme-card--love { --c: #d4537e; }
.theme-card--work { --c: #378add; }
.theme-card--money { --c: #c9962c; }
.theme-card--home { --c: #d8853a; }
.theme-card--friends { --c: #1d9e75; }
.theme-card--talk { --c: #2a9fb8; }
.theme-card--self { --c: #8a6cf0; }
.theme-card--beauty { --c: #c75fa0; }
.theme-card__head { display: flex; align-items: center; gap: var(--space-3); margin-bottom: var(--space-3); }
.theme-card__head h2 { margin: 0; font-size: 1.3rem; }
.theme-card__icon {
    width: 40px;
    height: 40px;
    flex: none;
    padding: 8px;
    border-radius: 50%;
    color: var(--c);
    background: color-mix(in srgb, var(--c) 14%, transparent);
}

.key-dates__months { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--space-4); }
.key-dates__scale { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); font-size: 0.72rem; color: var(--muted); text-align: center; }
.key-dates__list { list-style: none; padding: 0; margin: var(--space-1) 0 0; }
.key-date {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    gap: var(--space-4);
    align-items: center;
    padding: var(--space-3) 0;
    border-top: 1px solid var(--border);
}
.key-date__text { display: flex; flex-direction: column; line-height: 1.4; }
.key-date__when { font-size: 0.85rem; font-weight: 600; color: var(--accent); }
.key-date__event { font-weight: 600; }
.key-date__event::first-letter, .key-date__meaning::first-letter { text-transform: uppercase; }
.key-date__meaning { font-size: 0.92rem; color: var(--muted); }
.key-date .year-track { margin: 0; }

@media (max-width: 600px) {
    .key-dates__months { grid-template-columns: 1fr; }
    .key-dates__months > span { display: none; }
    .key-date { grid-template-columns: 1fr; gap: var(--space-2); }
}

@media (max-width: 600px) {
    .aspect__head { grid-template-columns: 1fr; justify-items: center; text-align: center; }
    .aspect__facts { justify-content: center; }
    .spheres, .duo, .helps ul { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
    /* Символ знака над заголовком, чтобы не сжимать H1 */
    .hero__sign { flex-direction: column; align-items: flex-start; gap: var(--space-3); }
    .hero__glyph { width: 56px; height: 56px; }

    /* Оглавление – горизонтальная лента с прокруткой */
    .toc { margin: 0 calc(-1 * var(--space-4)); }
    .toc ul { flex-wrap: nowrap; overflow-x: auto; padding: 0 var(--space-4); scrollbar-width: none; }
    .toc li { flex: none; }
}

/* На телефоне строки таблицы – карточки: дата сверху, событие и трактовка ниже */
@media (max-width: 600px) {
    .content table, .content tbody, .content tr, .content td { display: block; width: 100%; }
    .content thead { display: none; }
    .content tr {
        background: var(--surface);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: var(--space-3) var(--space-4);
        margin-bottom: var(--space-2);
    }
    .content td { border: 0; padding: 0; }
    .content td:first-child { color: var(--accent); white-space: normal; }
    .content td:nth-child(2) { font-weight: 600; }
    .content td:nth-child(3) { color: var(--muted); }
}

[x-cloak] { display: none !important; }

/* Промо-блок на главной */
.promo {
    display: grid;
    gap: var(--space-1);
    padding: var(--space-4) var(--space-5);
    border-radius: var(--radius);
    background: var(--surface);
    border: 1px solid var(--border);
    border-left: 4px solid var(--accent);
    color: var(--text);
    text-decoration: none;
    box-shadow: 0 6px 24px rgba(30, 20, 80, 0.06);
}
.hero + main > .promo:first-child { margin-top: calc(-1 * var(--space-6) + var(--space-3)); position: relative; }
.promo:hover { border-color: var(--accent); }
.promo__title { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; }
.promo__text { color: var(--muted); }
.promo__cta { color: var(--accent); font-weight: 600; }

/* Калькулятор */
.calc {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-5);
    box-shadow: 0 6px 24px rgba(30, 20, 80, 0.06);
    margin-bottom: var(--space-6);
}
.hero + main > .calc:first-child { margin-top: calc(-1 * var(--space-6) + var(--space-3)); position: relative; }
.calc__form { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4) var(--space-5); }
.calc__form > :not(.calc__person) { grid-column: 1 / -1; }
.calc__person { border: 0; margin: 0; padding: 0; display: grid; gap: var(--space-3); min-width: 0; }
.calc__person legend { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; margin-bottom: var(--space-2); }
.field { display: grid; gap: var(--space-1); }
.field__label { font-size: 0.9rem; font-weight: 600; }
.field__hint { font-weight: 400; color: var(--muted); }
.field input {
    font: inherit;
    min-height: var(--tap);
    padding: 0 var(--space-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    width: 100%;
}
.field input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.button {
    font: inherit;
    font-weight: 600;
    min-height: 52px;
    padding: 0 var(--space-5);
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #6a4ce6, #4a2fbf);
    color: #fff;
    cursor: pointer;
    justify-self: start;
    box-shadow: 0 6px 18px rgba(91, 63, 209, 0.35);
}
.button:hover { filter: brightness(1.08); }
.button:focus-visible { outline: 3px solid var(--star); outline-offset: 2px; }
.calc__error { color: #b42318; margin: 0; }
.calc__privacy { color: var(--muted); font-size: 0.85rem; margin: 0; }

@media (max-width: 600px) {
    .calc { padding: var(--space-4); }
    .calc__form { grid-template-columns: 1fr; }
    .button { justify-self: stretch; }
}

/* Результат */
.result { border-top: 1px solid var(--border); margin-top: var(--space-5); padding-top: var(--space-5); scroll-margin-top: var(--space-4); }
.result h3 { font-family: var(--font-display); font-size: 1.2rem; margin: 1.6em 0 0.5em; }
.result__head { display: flex; align-items: center; gap: var(--space-5); }
.result__title { margin: 0 0 var(--space-1); }
.result__head p { margin: 0; }
.score-ring {
    --p: 0;
    flex: none;
    width: 112px;
    height: 112px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(closest-side, var(--surface) 78%, transparent 79%),
        conic-gradient(var(--accent) calc(var(--p) * 1%), var(--accent-soft) 0);
}
.score-ring__value { font-family: var(--font-display); font-weight: 700; font-size: 1.9rem; }

.partners { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-4); margin-top: var(--space-5); }
.partner { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius); padding: var(--space-3) var(--space-4); }
.partner h3 { margin: 0 0 var(--space-2); font-size: 1.05rem; }
.planet-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-1); font-size: 0.95rem; }
.planet-list li { display: flex; align-items: center; gap: var(--space-2); }
.planet-list__icon { width: 18px; height: 18px; color: var(--accent); flex: none; }
.planet-list__q { color: var(--muted); cursor: help; }
.result__note { background: var(--accent-soft); border-radius: 8px; padding: var(--space-2) var(--space-3); font-size: 0.9rem; }

.spheres { display: grid; gap: var(--space-4); }
.sphere__head { display: flex; justify-content: space-between; font-weight: 600; }
.sphere__score { color: var(--accent); }
.sphere p { margin: var(--space-2) 0 0; font-size: 0.95rem; }
.bar { height: 8px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; margin-top: var(--space-1); }
.bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #8a6cf0, var(--accent)); transition: width 0.6s ease; }

.aspect-list { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.aspect-list__item {
    display: flex;
    justify-content: space-between;
    gap: var(--space-3);
    padding: var(--space-2) var(--space-3);
    border-radius: 8px;
    background: var(--bg);
    border-left: 3px solid var(--border);
    font-size: 0.95rem;
}
.aspect-list__item.is-harm, .aspect-list__item.is-conj { border-left-color: var(--accent); }
.aspect-list__item.is-tens { border-left-color: #d9a441; }
.aspect-list__kind { color: var(--muted); white-space: nowrap; }
.result__disclaimer { color: var(--muted); font-size: 0.85rem; margin-top: var(--space-5); }

@media (max-width: 600px) {
    .result__head { flex-direction: column; align-items: flex-start; gap: var(--space-3); }
    .partners { grid-template-columns: 1fr; }
    .aspect-list__item { flex-direction: column; gap: 0; }
}

.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* Совместимость знаков: шапка пары */
.hero__pair { display: flex; align-items: center; gap: var(--space-3); margin-top: var(--space-3); }
.hero__plus { color: var(--night-muted); font-size: 1.5rem; }

/* Карточки с оценками (пара, рейтинг знака, таблица хаба) */
.scores-card, .ranking, .matrix-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: var(--space-4) var(--space-5);
    margin: 0 0 var(--space-5);
    box-shadow: 0 6px 24px rgba(30, 20, 80, 0.06);
}
.hero + main > .scores-card:first-child,
.hero + main > .ranking:first-child,
.hero + main > .matrix-card:first-child { margin-top: calc(-1 * var(--space-6) + var(--space-3)); position: relative; }
.scores-card__total { display: flex; align-items: center; gap: var(--space-4); }
.scores-card__title, .ranking__title, .matrix-card__title { margin: 0 0 var(--space-1); font-size: 1.2rem; }
.scores-card__hint { margin: 0; color: var(--muted); font-size: 0.95rem; }
.scores-card__list { margin: var(--space-4) 0 0; display: grid; gap: var(--space-2); }
.score-row { display: grid; grid-template-columns: 7.5em 1fr; align-items: center; gap: var(--space-3); }
.score-row dt { font-weight: 600; }
.score-row dd { margin: 0; display: flex; align-items: center; gap: var(--space-3); }
.score-row .bar { flex: 1; margin: 0; }
.score-row__value { width: 3em; text-align: right; color: var(--accent); font-weight: 600; }
.scores-card__note { color: var(--muted); font-size: 0.85rem; margin: var(--space-3) 0 0; }

.ranking__list { list-style: none; margin: var(--space-3) 0 0; padding: 0; display: grid; gap: var(--space-1); }
.ranking__item { display: grid; grid-template-columns: 22px minmax(9em, 1.2fr) 2fr 3em; align-items: center; gap: var(--space-3); min-height: 40px; }
.ranking__icon { width: 22px; height: 22px; color: var(--accent); }
.ranking__name { white-space: nowrap; }
.ranking__bar { margin: 0; }
.ranking__score { text-align: right; font-weight: 600; color: var(--accent); }

.partner-chips { list-style: none; margin: 0 0 var(--space-3); padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }
.partner-chips a, .partner-chips__plain {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    min-height: var(--tap);
    padding: 0 var(--space-3);
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    text-decoration: none;
    color: var(--text);
    font-size: 0.95rem;
}
.partner-chips a:hover { border-color: var(--accent); }
.partner-chips__plain { color: var(--muted); }
.partner-chips .is-current .partner-chips__plain { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.partner-chips__icon { width: 18px; height: 18px; color: var(--accent); }
.partner-chips__score { color: var(--muted); font-size: 0.85rem; }

/* Таблица 12×12 */
/* position: relative – иначе абсолютно спозиционированные .visually-hidden внутри таблицы
   «выпадают» из контейнера прокрутки и растягивают всю страницу по ширине */
.matrix-scroll { position: relative; overflow-x: auto; margin: var(--space-3) calc(-1 * var(--space-5)) 0; padding: 0 var(--space-5); }
.matrix { border-collapse: separate; border-spacing: 3px; font-size: 0.85rem; min-width: 680px; }
.matrix th, .matrix td { text-align: center; padding: 0; }
.matrix thead th { padding-bottom: var(--space-1); }
.matrix tbody th {
    position: sticky;
    left: 0;
    z-index: 1;
    background: var(--surface);
    text-align: left;
    white-space: nowrap;
    padding-right: var(--space-2);
    font-weight: 600;
}
.matrix tbody th .matrix__icon { margin-right: 4px; vertical-align: -3px; }
.matrix__icon { width: 18px; height: 18px; color: var(--accent); }
.matrix td a, .matrix td span { display: flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; border-radius: 6px; text-decoration: none; color: var(--text); }
.matrix td.is-high a, .matrix td.is-high span { background: color-mix(in srgb, var(--accent) 34%, transparent); }
.matrix td.is-mid a, .matrix td.is-mid span { background: color-mix(in srgb, var(--accent) 16%, transparent); }
.matrix td.is-low a, .matrix td.is-low span { background: var(--bg); }
.matrix td a { font-weight: 700; outline: 1px solid var(--accent); }
.matrix td a:hover { background: var(--accent); color: #fff; }

@media (max-width: 600px) {
    .scores-card, .ranking, .matrix-card { padding: var(--space-4); }
    .matrix-scroll { margin: var(--space-3) calc(-1 * var(--space-4)) 0; padding: 0 var(--space-4); }
    .ranking__item { grid-template-columns: 22px 1fr 3em; }
    .ranking__bar { display: none; }
    .score-row { grid-template-columns: 6.5em 1fr; }
    .scores-card__total { gap: var(--space-3); }
    .scores-card__total > div:last-child { min-width: 0; }
    .scores-card .score-ring { width: 88px; height: 88px; }
    .scores-card .score-ring__value { font-size: 1.5rem; }
}

.promo--secondary { margin-top: var(--space-3); }

/* Натальная карта: форма */
/* Дата и время – рядом; общее правило .calc__form растягивает поля на всю ширину */
.calc__form--natal > .field { grid-column: auto; }
.calc__form--natal > .field--wide { grid-column: 1 / -1; }
.combobox { position: relative; }
.combobox input {
    font: inherit;
    min-height: var(--tap);
    padding: 0 var(--space-3);
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--bg);
    color: var(--text);
    width: 100%;
}
.combobox input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.combobox__list {
    position: absolute;
    z-index: 5;
    left: 0;
    right: 0;
    top: 100%;
    margin: 4px 0 0;
    padding: var(--space-1) 0;
    list-style: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 12px 32px rgba(20, 10, 60, 0.18);
    max-height: 320px;
    overflow-y: auto;
}
.combobox__list li { padding: var(--space-2) var(--space-3); cursor: pointer; display: grid; min-height: var(--tap); align-content: center; }
.combobox__list li.is-active { background: var(--accent-soft); }
.combobox__name { font-weight: 600; }
.combobox__label { font-size: 0.85rem; color: var(--muted); }
.combobox__empty { color: var(--muted); cursor: default; }

/* Натальная карта: круг */
.wheel-wrap { max-width: 560px; margin: var(--space-4) auto; }
.wheel { width: 100%; height: auto; display: block; }
.wheel__ring { fill: none; stroke: var(--text); stroke-opacity: 0.55; stroke-width: 1.2; }
.wheel__ring--thin { stroke-opacity: 0.25; }
.wheel__sign-line { stroke: var(--text); stroke-opacity: 0.4; stroke-width: 1; }
.wheel__tick { stroke: var(--text); stroke-opacity: 0.3; stroke-width: 1; }
.wheel__sign--fire { color: #d9643a; }
.wheel__sign--earth { color: #5f8f3a; }
.wheel__sign--air { color: #3a86c8; }
.wheel__sign--water { color: #2f9a9a; }
.wheel__cusp { stroke: var(--muted); stroke-opacity: 0.6; stroke-width: 1; }
.wheel__axis { stroke: var(--text); stroke-width: 1.8; }
.wheel__axis-label { font: 600 12px system-ui, sans-serif; fill: var(--text); }
.wheel__house-num { font: 11px system-ui, sans-serif; fill: var(--muted); text-anchor: middle; dominant-baseline: middle; }
.wheel__planet { color: var(--accent); }
.wheel__planet-tick { stroke: var(--accent); stroke-width: 1.5; }
.wheel__deg { font: 10px system-ui, sans-serif; fill: var(--muted); text-anchor: middle; dominant-baseline: middle; }
.wheel__aspect { stroke-width: 1.2; stroke-opacity: 0.75; }
.wheel__aspect--harm { stroke: var(--accent); }
.wheel__aspect--tens { stroke: #d9a441; }

/* Натальная карта: таблицы и расшифровка */
.result__meta { color: var(--muted); font-size: 0.9rem; margin: 0; }
.table-scroll { overflow-x: auto; }
.natal-table { border-collapse: collapse; width: 100%; font-size: 0.95rem; }
.natal-table th, .natal-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.natal-table th { color: var(--muted); font-weight: 600; font-size: 0.85rem; }
.natal-table__icon { width: 18px; height: 18px; color: var(--accent); vertical-align: -4px; margin-right: 4px; }
.natal-table__retro { color: #d9a441; font-weight: 700; font-size: 0.8rem; margin-left: 4px; }
.natal-table__angle td { font-weight: 600; }
.cusps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: var(--space-1) var(--space-3); font-size: 0.95rem; }
/* номер, значок, знак и градус – в одну строку: перенос «Скорпион / 26°00′» читается плохо */
.cusps li { display: flex; align-items: center; white-space: nowrap; }
.cusps li .natal-table__icon { flex: none; }
.cusps__n { display: inline-block; min-width: 1.6em; color: var(--muted); font-weight: 600; }
a.cusps__n { color: var(--accent); }
.reading__more { display: inline-block; margin-top: var(--space-1); font-size: 0.9rem; }
.reading { display: grid; gap: var(--space-3); }
.reading__item { padding: var(--space-3) var(--space-4); background: var(--bg); border-radius: var(--radius); border: 1px solid var(--border); }
.reading__item h4 { margin: 0 0 var(--space-1); font-size: 1rem; }
.reading__item p { margin: 0; font-size: 0.95rem; }
.aspect-list__title { display: inline-flex; align-items: center; gap: 4px; }
.credits { color: var(--muted); font-size: 0.8rem; margin-top: var(--space-5); }
.credits a { color: inherit; }

@media (max-width: 600px) {
    .calc__form--natal { grid-template-columns: 1fr; }
    .wheel-wrap { margin-left: calc(-1 * var(--space-2)); margin-right: calc(-1 * var(--space-2)); }
}

/* Дома натальной карты */
.hero__glyph--number { font-family: var(--font-display); font-weight: 700; font-size: 2rem; }
.house-grid { list-style: none; padding: 0; margin: var(--space-4) 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 10px; }
.house-grid a, .house-grid__plain {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: var(--space-3);
    min-height: 60px;
    padding: var(--space-2) var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--text);
    height: 100%;
}
.house-grid a:hover { border-color: var(--accent); }
.house-grid__plain { color: var(--muted); }
.house-grid .is-current .house-grid__plain { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.house-grid__n { font-family: var(--font-display); font-weight: 700; font-size: 1.5rem; color: var(--accent); min-width: 1.4em; text-align: center; }
.house-grid__theme { font-size: 0.92rem; line-height: 1.3; }

.pager { display: flex; justify-content: space-between; gap: var(--space-3); margin-top: var(--space-5); }
.pager__link { display: grid; gap: 2px; padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); text-decoration: none; max-width: 48%; }
.pager__link:hover { border-color: var(--accent); }
.pager__link--next { text-align: right; margin-left: auto; }
.pager__hint { font-size: 0.8rem; color: var(--muted); }

/* Перелинковка */
.related { margin-top: var(--space-6); }
.related__grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: var(--space-3); }
.related-card {
    display: grid;
    gap: var(--space-1);
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
}
.related-card:hover { border-color: var(--accent); }
.related-card__title { font-weight: 600; color: var(--accent); }
.related-card__text { color: var(--muted); font-size: 0.95rem; }

/* Подвал */
.site-footer { border-top: 1px solid var(--border); padding: var(--space-5) 0; color: var(--muted); font-size: 0.9rem; }
.footer-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-4) var(--space-5); margin-bottom: var(--space-5); }
.footer-nav__title { margin: 0 0 var(--space-1); font-weight: 600; color: var(--text); }
.footer-nav ul { list-style: none; margin: 0; padding: 0; }
.footer-nav a { color: var(--muted); display: inline-flex; align-items: center; min-height: var(--tap); }
.footer-nav a:hover { color: var(--accent); }
.disclaimer { margin: 0 0 var(--space-2); }
.site-footer__copy { margin: 0; }

.draft-notice {
    background: var(--warn-bg);
    border: 1px solid var(--warn-border);
    border-radius: var(--radius);
    padding: 10px 14px;
    font-size: 0.9rem;
    margin: 0 0 var(--space-4);
}

/* Планеты: сетки знаков/планет без ссылки (страница ещё не написана) и пояснение о положении планеты */
.sign-grid__plain {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-3) 14px;
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: var(--radius);
    color: var(--muted);
    height: 100%;
}
.sign-grid .is-current .sign-grid__plain { background: var(--accent-soft); border: 1px solid var(--accent); color: var(--text); }
.dignity-note {
    margin: 0 0 var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--accent-soft);
    border-radius: var(--radius);
    font-size: 0.95rem;
}
.planet-houses .house-grid { margin-bottom: 0; }

/* Обзор и страницы планет (PlanetPageLayout) */
.planet-cards, .sign-cards, .dignity-cards { list-style: none; padding: 0; margin: var(--space-4) 0; display: grid; gap: var(--space-3); }
.planet-cards { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.planet-card, .sign-card, .dignity-card {
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: var(--space-4) 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 0.95rem;
}
.planet-card__glyph { width: 32px; height: 32px; color: var(--accent); }
.planet-card__title { font-family: var(--font-display); font-size: 1.15rem; }
.planet-card__title a { text-decoration: none; }

.speed { margin: var(--space-4) 0; padding: var(--space-4) 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.speed__title { font-family: var(--font-display); font-weight: 700; margin-bottom: var(--space-3); }
.speed__row { display: grid; grid-template-columns: 22px 6.5em minmax(0, 1fr) 9.5em; align-items: center; gap: 10px; padding: 4px 0; font-size: 0.92rem; }
.speed__glyph { width: 20px; height: 20px; color: var(--accent); }
.speed__track { height: 8px; border-radius: 999px; background: var(--accent-soft); overflow: hidden; }
.speed__bar { display: block; height: 100%; border-radius: inherit; background: color-mix(in srgb, var(--accent) 45%, var(--muted)); }
.speed__bar.is-personal { background: var(--accent); }
.speed__time { color: var(--muted); font-size: 0.85rem; }

.formula { display: flex; align-items: stretch; gap: var(--space-2); margin: var(--space-4) 0; }
.formula__part {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-4) var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-align: center;
    font-size: 0.92rem;
}
.formula__part svg { width: 34px; height: 34px; color: var(--accent); }
.formula__n { font-family: var(--font-display); font-weight: 700; font-size: 1.7rem; line-height: 34px; color: var(--accent); }
.formula__q { font-weight: 700; }
.formula__plus { align-self: center; font-size: 1.4rem; color: var(--muted); }

.sign-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sign-card__head { display: flex; align-items: center; gap: 10px; }
.sign-card__glyph { width: 26px; height: 26px; color: var(--accent); flex: none; }
.sign-card__title { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; text-decoration: none; }
.sign-card__tag { margin-left: auto; padding: 1px 10px; border-radius: 999px; background: color-mix(in srgb, #c9962c 22%, transparent); font-size: 0.78rem; }

.dignity-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.dignity-card__title { font-family: var(--font-display); font-weight: 700; font-size: 1.1rem; }
.dignity-card__signs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-weight: 600; }
.dignity-card__signs svg { width: 22px; height: 22px; color: var(--accent); }
.dignity-card__text { color: var(--muted); }

.cta-card { padding: var(--space-5) 22px; border-radius: var(--radius); background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); }
.cta-card p:last-of-type { margin-bottom: var(--space-4); }
.cta-card__button {
    display: inline-flex;
    align-items: center;
    min-height: var(--tap);
    padding: 0 var(--space-5);
    border-radius: 999px;
    background: var(--accent);
    color: var(--bg);
    font-weight: 700;
    text-decoration: none;
}

@media (max-width: 600px) {
    .sign-cards, .dignity-cards { grid-template-columns: 1fr; }
    .formula { flex-direction: column; }
    .formula__plus { transform: rotate(90deg); }
    .speed__row { grid-template-columns: 22px 5.5em minmax(0, 1fr); }
    .speed__time { grid-column: 2 / -1; margin-top: -4px; }
}


/* Страница дома: планеты в доме карточками (HouseLayout) */
.house-planets { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-4); }
.house-planet {
    padding: var(--space-4) 18px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    scroll-margin-top: var(--space-5);
    transition: border-color 0.3s, box-shadow 0.3s;
}
.house-planet p { font-size: 0.95rem; margin: 0 0 var(--space-2); }
.house-planet__head { display: flex; align-items: center; gap: 10px; margin-bottom: var(--space-2); }
.house-planet__head h3 { margin: 0; font-family: var(--font-display); font-size: 1.1rem; }
.house-planet__glyph { width: 28px; height: 28px; flex: none; color: var(--accent); }
.house-planet__more { font-size: 0.9rem; text-decoration: none; }
/* Пришли по ссылке «Подробнее: Венера в 7 доме» из калькулятора – карточка подсвечена */
.house-planet:target { border-color: #c9962c; box-shadow: 0 0 0 3px color-mix(in srgb, #c9962c 30%, transparent); }
.house-planet:target .house-planet__glyph { color: #c9962c; }
.sign-cards--compact { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sign-cards--compact .sign-card { font-size: 0.9rem; padding: var(--space-3) 14px; }
.note-card { padding: var(--space-4) 20px; background: var(--accent-soft); border-radius: var(--radius); }
.note-card p:last-child { margin-bottom: 0; }

@media (max-width: 760px) {
    .sign-cards--compact { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .house-planets, .sign-cards--compact { grid-template-columns: 1fr; }
}


/* Обзор домов (HousesHubLayout) */
.house-spheres { list-style: none; padding: 0; margin: var(--space-4) 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.house-spheres a {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    height: 100%;
    padding: var(--space-3) 14px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-decoration: none;
}
.house-spheres a:hover { border-color: var(--accent); }
.house-spheres__title { display: block; font-family: var(--font-display); }
.house-spheres__text { display: block; font-size: 0.9rem; color: var(--muted); line-height: 1.4; }

.house-groups { display: grid; grid-template-columns: 300px minmax(0, 1fr); gap: var(--space-5); align-items: center; margin-bottom: var(--space-4); }
.house-wheel { width: 100%; height: auto; display: block; }
.house-wheel__sector path { stroke: var(--bg); stroke-width: 2; transition: opacity 0.15s; }
.house-wheel__sector:hover path { opacity: 0.8; }
.house-wheel__sector.is-angular path { fill: var(--accent); }
.house-wheel__sector.is-succedent path { fill: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
.house-wheel__sector.is-cadent path { fill: color-mix(in srgb, var(--accent) 22%, var(--surface)); }
.house-wheel__sector text { fill: var(--text); font-family: var(--font-display); font-weight: 700; font-size: 15px; pointer-events: none; }
.house-wheel__sector.is-angular text { fill: var(--bg); }
.house-wheel__angle { fill: var(--muted); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; }
.house-group-cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.house-group-card { display: flex; flex-direction: column; padding: var(--space-3) 16px; background: var(--surface); border: 1px solid var(--border); border-left-width: 6px; border-radius: var(--radius); font-size: 0.93rem; }
.house-group-card strong { font-family: var(--font-display); font-size: 1.05rem; }
.house-group-card--angular { border-left-color: var(--accent); }
.house-group-card--succedent { border-left-color: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
.house-group-card--cadent { border-left-color: color-mix(in srgb, var(--accent) 22%, var(--surface)); }

.example-cards { display: flex; align-items: center; gap: var(--space-3); margin: var(--space-4) 0; }
.example-card {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    text-align: center;
    text-decoration: none;
    font-size: 0.93rem;
}
.example-card:hover { border-color: var(--accent); }
.example-card svg { width: 34px; height: 34px; color: var(--accent); }
.example-card strong { font-family: var(--font-display); font-size: 1.1rem; }
.example-cards__vs { color: var(--muted); font-size: 0.9rem; }

@media (max-width: 600px) {
    .house-spheres { grid-template-columns: 1fr; }
    .house-groups { grid-template-columns: 1fr; justify-items: center; }
    .house-wheel { max-width: 280px; }
    .example-cards { flex-direction: column; }
    .example-card { width: 100%; }
}


/* Заголовок-ссылка в карточке: стрелка «→» и кликабельная карточка целиком */
.card-link { position: relative; }
.card-link__title {
    color: var(--accent);
    text-decoration: none;
}
.card-link__title::after {
    content: " →";
    display: inline-block;
    margin-left: 2px;
    transition: transform 0.15s;
}
/* Растягиваем ссылку на всю карточку – попасть пальцем проще */
.card-link__title::before { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.card-link:hover { border-color: var(--accent); }
.card-link:hover .card-link__title::after { transform: translateX(3px); }
.card-link:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.card-link__title:focus-visible { outline: none; }

/* Короткие ссылки-метки плашками */
.tag-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 12px 3px 8px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s;
}
.tag-link:hover { background: color-mix(in srgb, var(--accent) 22%, var(--accent-soft)); }
.tag-link svg { width: 18px; height: 18px; }
.tag-plain { display: inline-flex; align-items: center; gap: 6px; padding: 3px 12px 3px 8px; font-weight: 600; }
.tag-plain svg { width: 18px; height: 18px; color: var(--muted); }

/* Строка рейтинга знака – ссылка на пару целиком */
.ranking__item { padding: 0 var(--space-2); margin: 0 calc(-1 * var(--space-2)); border-radius: 8px; transition: background 0.15s; }
.ranking__item.card-link:hover { background: var(--accent-soft); }

/* Медленная планета в знаке: раздел-карточка с годами рождения */
.sign-part { margin: var(--space-5) 0; padding: var(--space-4) 20px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); scroll-margin-top: 80px; }
.sign-part:target, .sign-part:has(h2:target) { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sign-part__head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.sign-part__head h2 { margin: 0; }
.sign-part__glyph { width: 30px; height: 30px; color: var(--accent); flex: none; }
.sign-part__years { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: var(--space-3) 0; font-size: 0.88rem; }
.sign-part__label { color: var(--muted); margin-right: 4px; }
.sign-part__year { padding: 1px 9px; border-radius: 999px; background: var(--accent-soft); font-variant-numeric: tabular-nums; }
.sign-part p:last-child { margin-bottom: 0; }

/* Луна сегодня */
.moon-hero { display: flex; align-items: center; gap: var(--space-5); margin-top: var(--space-3); }
.moon-hero h1 { margin-top: 0; }
.moon-hero__date { color: var(--night-muted); margin: 0 0 var(--space-3); }
.moon-disc { width: 44px; height: 44px; flex: none; }
.moon-disc--big { width: 132px; height: 132px; filter: drop-shadow(0 0 22px rgba(255, 244, 214, 0.25)); }
.moon-disc__dark { fill: #2a2650; }
.moon-disc__lit { fill: #f4ecd2; }
.moon-now { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); margin-top: var(--space-5); }
.moon-card { display: flex; flex-direction: column; gap: 4px; padding: var(--space-4) 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.moon-card__label { color: var(--muted); font-size: 0.85rem; }
.moon-card__value { font-family: var(--font-display); font-weight: 700; font-size: 1.35rem; line-height: 1.2; }
.moon-card__sign { display: flex; align-items: center; gap: 8px; }
.moon-card__sign svg { width: 26px; height: 26px; color: var(--accent); flex: none; }
.moon-card__note { color: var(--muted); font-size: 0.88rem; }
.moon-events { margin: var(--space-4) 0 var(--space-5); }
.moon-texts { display: grid; gap: var(--space-3); }
.moon-week { margin-top: var(--space-6); }
.moon-week__list { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: var(--space-2); }
.moon-week__day { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: var(--space-3) 6px; text-align: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.85rem; }
.moon-week__day.is-today { border-color: var(--accent); }
.moon-week__date { font-weight: 600; }
.moon-week__phase { line-height: 1.2; }
.moon-week__illum { color: var(--muted); }
.moon-week__sign { display: flex; justify-content: center; align-items: center; gap: 4px; }
.moon-week__sign svg { width: 16px; height: 16px; color: var(--accent); }
@media (max-width: 860px) {
    .moon-now { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .moon-week__list { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .moon-hero { flex-direction: column; align-items: flex-start; gap: var(--space-3); }
    .moon-disc--big { width: 96px; height: 96px; }
    .moon-week__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.moon-week__change { color: var(--muted); font-size: 0.78rem; line-height: 1.25; }

/* Луна сегодня: справочная часть */
.wax-wane { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); margin: var(--space-4) 0; }
.wax-wane__card { margin: 0; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.wax-wane__pic { width: 64px; height: 64px; flex: none; }
.wax-wane__letter { font-family: var(--font-display); font-size: 3.6rem; line-height: 1; font-weight: 700; color: var(--accent); width: 0.8em; text-align: center; }
.wax-wane__card figcaption { line-height: 1.4; }
.wax-wane__card figcaption span { color: var(--muted); font-size: 0.9rem; }

.phase-track { position: relative; height: 46px; margin: var(--space-5) 12px var(--space-2); }
.phase-track__line { position: absolute; left: 0; right: 0; top: 24px; height: 4px; border-radius: 2px; background: linear-gradient(90deg, #2a2650, #f4ecd2 50%, #2a2650); }
.phase-track__tick { position: absolute; top: 32px; transform: translateX(-50%); font-size: 0.78rem; color: var(--muted); white-space: nowrap; }
.phase-track__today { position: absolute; top: 0; transform: translateX(-50%); padding: 0 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.75rem; line-height: 18px; white-space: nowrap; }
.phase-track__today::after { content: ""; position: absolute; left: 50%; top: 18px; width: 2px; height: 10px; margin-left: -1px; background: var(--accent); }
.phase-cards { list-style: none; padding: 0; margin: var(--space-3) 0 var(--space-4); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-3); }
.phase-card { display: flex; flex-direction: column; gap: 6px; padding: var(--space-4) 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); font-size: 0.93rem; }
.phase-card__title { font-family: var(--font-display); font-size: 1.05rem; }

.lunar-scheme { margin: var(--space-4) 0; padding: var(--space-4) 18px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.lunar-scheme__row, .lunar-scheme__labels { display: grid; grid-template-columns: 0.45fr 1fr 1fr 1fr 0.4fr; gap: 3px; }
.lunar-scheme__seg { padding: 6px 0; text-align: center; font-weight: 700; border-radius: 6px; background: var(--accent-soft); }
.lunar-scheme__seg--first { background: color-mix(in srgb, var(--accent) 45%, transparent); }
.lunar-scheme__more { align-self: center; text-align: center; color: var(--muted); }
.lunar-scheme__labels { margin-top: 4px; font-size: 0.75rem; color: var(--muted); }
.lunar-scheme__labels span { white-space: nowrap; }
.lunar-scheme__fig { margin: var(--space-3) 0 0; }
.lunar-scheme__fig strong { font-family: var(--font-display); font-size: 1.3rem; }

@media (max-width: 760px) {
    .phase-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .wax-wane { grid-template-columns: 1fr; }
    .lunar-scheme__labels span:nth-child(n+3) { visibility: hidden; }
}


/* ===================== Анимации =====================
 * Только transform / opacity и короткие заполнения; содержимое видно и без них.
 * .motion на <html> ставит js/motion.js (и не ставит при «уменьшить движение»).
 */
@property --p { syntax: "<number>"; inherits: false; initial-value: 0; }

/* 1. Живое небо: звёзды мерцают, изредка пролетает падающая звезда */
.hero::before { animation: twinkle 5s ease-in-out infinite alternate; }
.hero::after { animation: twinkle 7.5s ease-in-out -3s infinite alternate; }
@keyframes twinkle { from { opacity: 0.8; } to { opacity: 0.3; } }

.shooting-star {
    position: absolute;
    width: 130px;
    height: 1.5px;
    border-radius: 2px;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0), rgba(255, 246, 220, 0.95));
    /* голова справа, полёт вправо-вниз: голова впереди, хвост тянется следом */
    transform: rotate(32deg);
    transform-origin: right center;
    opacity: 0;
    pointer-events: none;
    animation: shoot 14s linear infinite;
}
.shooting-star::after {
    content: "";
    position: absolute;
    right: -2px;
    top: -1.5px;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    background: #fff6dc;
    box-shadow: 0 0 8px 2px rgba(255, 246, 220, 0.7);
}
/* видна ~5 % периода: короткий росчерк, потом долгая пауза */
@keyframes shoot {
    0% { opacity: 0; transform: rotate(32deg) translateX(0); }
    1% { opacity: 1; }
    5% { opacity: 0; transform: rotate(32deg) translateX(260px); }
    100% { opacity: 0; transform: rotate(32deg) translateX(260px); }
}

/* 2. Проценты: кольцо и полоски заполняются при появлении на экране, число отсчитывает motion.js */
.motion .score-ring { animation: ring-fill 1.1s cubic-bezier(0.2, 0.7, 0.2, 1) both paused; }
.motion .bar span,
.motion .speed__bar { animation: bar-fill 1s cubic-bezier(0.2, 0.7, 0.2, 1) both paused; transform-origin: left center; }
.motion .score-ring.is-visible,
.motion .bar.is-visible span,
.motion .speed__bar.is-visible { animation-play-state: running; }
@keyframes ring-fill { from { --p: 0; } }
@keyframes bar-fill { from { transform: scaleX(0); } }

/* 3. Натальная карта прорисовывается: круги, знаки, планеты, затем линии аспектов */
.wheel__ring { stroke-dasharray: 1; animation: draw 0.9s ease-out both; }
.wheel__sign { animation: fade-pop 0.4s ease-out both; animation-delay: calc(0.5s + var(--i, 0) * 0.04s); }
.wheel__planet { animation: fade-pop 0.45s ease-out both; animation-delay: calc(1s + var(--i, 0) * 0.07s); }
.wheel__aspect { stroke-dasharray: 1; animation: draw 0.7s ease-out 1.8s both; }
.wheel__deg, .wheel__house-num, .wheel__axis-label { animation: fade 0.5s ease-out 1.4s both; }
.wheel__sign, .wheel__planet { transform-box: fill-box; transform-origin: center; }
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fade-pop { from { opacity: 0; transform: scale(0.6); } }
@keyframes fade { from { opacity: 0; } }

/* 4. Луна сегодня: мягкое свечение, отметка «сегодня» встаёт на шкалу */
.moon-disc--big { animation: moon-glow 6s ease-in-out infinite alternate; }
@keyframes moon-glow {
    from { filter: drop-shadow(0 0 14px rgba(255, 244, 214, 0.18)); }
    to { filter: drop-shadow(0 0 30px rgba(255, 244, 214, 0.42)); }
}
.motion .phase-track .phase-track__today { animation: slide-in 1.2s cubic-bezier(0.2, 0.7, 0.2, 1) both paused; }
.motion .phase-track.is-visible .phase-track__today { animation-play-state: running; }
@keyframes slide-in { from { left: 0; opacity: 0; } }

/* 5. Отклики: карточки приподнимаются, значки «вспыхивают», тема меняется плавно */
.card-link { transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.15s, background 0.15s; }
.card-link:hover { transform: translateY(-2px); box-shadow: 0 8px 22px -12px rgba(60, 40, 160, 0.45); }
.ranking__item.card-link:hover { transform: none; box-shadow: none; }
.card-link svg { transition: transform 0.3s ease, filter 0.3s ease; filter: drop-shadow(0 0 0 var(--glow-off)); }
.card-link:hover svg:not(.card-link__title svg) { transform: scale(1.12) rotate(-6deg); filter: drop-shadow(0 0 6px var(--glow)); }
.theme-anim, .theme-anim *, .theme-anim *::before, .theme-anim *::after {
    transition: background-color 0.4s, color 0.4s, border-color 0.4s, fill 0.4s, stroke 0.4s !important;
}

/* 6. Результат калькулятора появляется мягко */
.motion .result > div > * { animation: rise 0.5s ease-out both; }
.motion .result > div > :nth-child(2) { animation-delay: 0.12s; }
.motion .result > div > :nth-child(3) { animation-delay: 0.24s; }
.motion .result > div > :nth-child(n+4) { animation-delay: 0.36s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; transition: none !important; }
    .shooting-star { display: none; }
}

/* Уведомление о cookie и политика конфиденциальности */
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 50;
    max-width: 760px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: var(--space-3) var(--space-4);
    padding: var(--space-3) var(--space-4);
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 12px 36px -12px rgba(18, 15, 43, 0.55);
    font-size: 0.92rem;
}
.cookie-banner[hidden] { display: none; }
.cookie-banner__text { margin: 0; flex: 1; }
.cookie-banner__actions { display: flex; gap: var(--space-2); flex: none; }
.button--small { min-height: 44px; padding: 0 var(--space-4); font-size: 0.92rem; box-shadow: none; }
.button--ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.button--ghost:hover { border-color: var(--accent); filter: none; }
.motion .cookie-banner:not([hidden]) { animation: rise 0.4s ease-out both; }
.link-button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 40%, transparent); text-underline-offset: 3px; min-height: var(--tap); }
.link-button:hover { color: var(--accent); }
.footer-nav .link-button { color: var(--muted); text-decoration: none; }
.footer-nav .link-button:hover { color: var(--accent); }
.privacy-operator { margin-top: var(--space-5); }
.privacy-operator p { margin: 0 0 var(--space-2); }
.privacy-operator__todo { color: #b42318; }
.privacy-updated { color: var(--muted); font-size: 0.9rem; }
@media (max-width: 600px) {
    .cookie-banner { flex-direction: column; align-items: stretch; left: 8px; right: 8px; bottom: 8px; }
    .cookie-banner__actions .button { flex: 1; justify-self: auto; }
}

/* Лунный календарь: сетка месяца, ключевые даты, периоды, знаки, таблица по дням, год */
.moon-intro { margin-top: var(--space-5); }
.moon-cal { margin-top: var(--space-5); }
.moon-grid { margin: var(--space-3) 0; }
.moon-grid__head, .moon-grid__body { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.moon-grid__head span { text-align: center; color: var(--muted); font-size: 0.8rem; padding-bottom: 4px; }
.moon-grid__day { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 2px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; min-width: 0; }
.moon-grid__day.is-new, .moon-grid__day.is-full { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.moon-grid__num { font-weight: 700; font-size: 0.9rem; }
.moon-grid__day .moon-disc { width: 26px; height: 26px; }
.moon-grid__sign svg { width: 16px; height: 16px; color: var(--accent); display: block; }
.moon-grid__lday { font-size: 0.7rem; color: var(--muted); white-space: nowrap; }
.moon-cal__legend { color: var(--muted); font-size: 0.88rem; }

.moon-events-list { list-style: none; padding: 0; margin: var(--space-3) 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-2); }
.moon-event { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.moon-event.is-new, .moon-event.is-full { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); }
.moon-event__title { font-family: var(--font-display); font-weight: 700; }
.moon-event__date { font-variant-numeric: tabular-nums; }
.moon-event__sign { display: flex; align-items: center; gap: 6px; color: var(--muted); font-size: 0.88rem; }
.moon-event__sign svg { width: 16px; height: 16px; color: var(--accent); }

.moon-periods { list-style: none; padding: 0; display: grid; gap: var(--space-2); }
.moon-period { display: flex; flex-wrap: wrap; gap: 4px 10px; padding: 10px 14px; border-radius: 10px; background: var(--surface); border-left: 4px solid #f4ecd2; }
.moon-period.is-waning { border-left-color: #2a2650; }

.moon-signs { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px var(--space-4); }
.moon-signs li { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; padding: 6px 0; border-bottom: 1px solid var(--border); font-size: 0.93rem; }
.moon-signs svg { width: 20px; height: 20px; color: var(--accent); }
.moon-signs span { color: var(--muted); }

/* Таблица по дням: зебра и подсветка строки вместо вертикальных линий; ключевые дни – акцентом; неделя – разделителем */
.moon-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.9rem; }
.moon-table th { text-align: left; padding: 8px 10px; color: var(--muted); font-weight: 600; font-size: 0.82rem; border-bottom: 1px solid var(--border); }
.moon-table td { padding: 8px 10px; vertical-align: middle; }
.moon-table tbody tr:nth-child(even) td { background: color-mix(in srgb, var(--surface) 70%, transparent); }
.moon-table tbody tr:hover td { background: var(--accent-soft); }
.moon-table tbody tr.is-week-end td { border-bottom: 1px solid var(--border); }
.moon-table tbody tr.is-key td { background: color-mix(in srgb, var(--accent) 14%, transparent); }
.moon-table tbody tr.is-key td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.moon-table td:first-child { border-radius: 8px 0 0 8px; }
.moon-table td:last-child { border-radius: 0 8px 8px 0; }
.moon-table__date { white-space: nowrap; }
.moon-table__day { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; margin-right: 6px; }
.moon-table__dow { color: var(--muted); font-size: 0.82rem; }
.moon-table__dow.is-weekend { color: var(--accent); }
.moon-table__phase { display: flex; align-items: center; gap: 10px; white-space: nowrap; }
.moon-table__phase .moon-disc { width: 22px; height: 22px; }
.moon-table__badge { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: 0.75rem; }
.moon-table__illum { white-space: nowrap; font-variant-numeric: tabular-nums; }
.moon-table__bar { display: inline-block; vertical-align: middle; width: 48px; height: 5px; margin-right: 8px; border-radius: 3px; background: var(--border); overflow: hidden; }
.moon-table__bar span { display: block; height: 100%; background: #f4ecd2; }
.moon-table__chip { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--accent-soft); font-size: 0.85rem; white-space: nowrap; }
.moon-table__arrow { color: var(--muted); margin: 0 4px 0 2px; }
.moon-table__unit { display: inline-block; white-space: nowrap; margin: 1px 0; }
.moon-table__sign { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.moon-table__sign svg { width: 16px; height: 16px; color: var(--accent); flex: none; }
.moon-table__time { color: var(--muted); font-size: 0.85rem; }

/* Телефон: строка таблицы – карточка, подпись столбца – из data-label */
@media (max-width: 640px) {
    .moon-table thead { display: none; }
    .moon-table, .moon-table tbody, .moon-table tr, .moon-table td { display: block; width: auto; }
    .moon-table tr { margin-bottom: var(--space-2); padding: 8px 4px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); }
    .moon-table tbody tr td, .moon-table tbody tr:nth-child(even) td, .moon-table tbody tr:hover td { background: none; }
    .moon-table tbody tr.is-key { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 12%, var(--surface)); }
    .moon-table tbody tr.is-key td:first-child { box-shadow: none; }
    .moon-table tbody tr.is-week-end td { border-bottom: 0; }
    .moon-table td { display: flex; align-items: center; flex-wrap: wrap; gap: 4px; padding: 4px 10px; border-radius: 0 !important; }
    .moon-table td:not(.moon-table__date)::before { content: attr(data-label); flex: 0 0 100px; color: var(--muted); font-size: 0.8rem; }
}

.moon-year { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-3); }
.moon-year__month { display: flex; flex-direction: column; gap: 6px; padding: var(--space-3) 16px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.moon-year__row { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.moon-year__row .moon-disc { width: 18px; height: 18px; }
.moon-month-nav { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: var(--space-5) 0; }
.tag-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: var(--space-2); }

@media (max-width: 760px) {
    .moon-events-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .moon-year { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .moon-signs { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
    .moon-grid__lday { display: none; }
    .moon-grid__day .moon-disc { width: 20px; height: 20px; }
    .moon-year { grid-template-columns: 1fr; }
}
