/* Астрокалендарь — скин «Обсерватория»: звёздный атлас.
   Полночь + золото + айвори (dark) · пергамент + сепия-золото (light).
   Парадигма: мобильный апп-шелл, нижний таб-бар, дайджест-first.
   Сигнатура: золотая дуга-астролябия скора + serif-имена + планета дня. */

:root {
  /* пергамент — светлая тема (старый звёздный атлас) */
  --bg: #f1ead9;
  --surface: #faf5ea;
  --surface-2: #ffffff;
  --ink: #23262e;
  --ink-2: #55524a;
  --ink-3: #676257;
  --line: #ddd4c0;
  --line-2: #cabfa4;
  --gold: #a87a24;
  --gold-ink: #7a5612;
  --gold-soft: #b98b2e;
  --today: #a87a24;
  --good: #1a9e63;
  --bad: #9298a6;
  --shadow: 0 10px 34px rgba(58, 44, 12, .16);
  --scrim: rgba(35, 28, 12, .42);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);   /* сильный ease-out (emil) */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0f24;            /* полночный космос */
    --surface: #141a34;
    --surface-2: #1b2242;
    --ink: #ece7d9;          /* айвори */
    --ink-2: #a5a293;
    --ink-3: #999790;
    --line: #262b44;
    --line-2: #333a58;
    --gold: #d9a441;
    --gold-ink: #e4b659;
    --gold-soft: #c79a44;
    --today: #d9a441;
    --good: #3fae7a;
    --bad: #6b7091;
    --shadow: 0 12px 40px rgba(0, 0, 0, .55);
    --scrim: rgba(2, 4, 12, .6);
  }
}
:root[data-theme="light"] {
  --bg: #f1ead9; --surface: #faf5ea; --surface-2: #ffffff;
  --ink: #23262e; --ink-2: #55524a; --ink-3: #676257;
  --line: #ddd4c0; --line-2: #cabfa4;
  --gold: #a87a24; --gold-ink: #7a5612; --gold-soft: #b98b2e; --today: #a87a24;
  --good: #1a9e63; --bad: #9298a6;
  --shadow: 0 10px 34px rgba(58, 44, 12, .16); --scrim: rgba(35, 28, 12, .42);
}
:root[data-theme="dark"] {
  --bg: #0a0f24; --surface: #141a34; --surface-2: #1b2242;
  --ink: #ece7d9; --ink-2: #a5a293; --ink-3: #999790;
  --line: #262b44; --line-2: #333a58;
  --gold: #d9a441; --gold-ink: #e4b659; --gold-soft: #c79a44; --today: #d9a441;
  --good: #3fae7a; --bad: #6b7091;
  --shadow: 0 12px 40px rgba(0, 0, 0, .55); --scrim: rgba(2, 4, 12, .6);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font: 400 15px/1.55 'Golos Text', system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
/* полночь: лёгкое золотое сияние от «планеты» сверху */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none;
  background: radial-gradient(120% 60% at 50% -10%,
    color-mix(in srgb, var(--gold) 7%, transparent) 0%, transparent 60%);
  z-index: 0;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; border-radius: 8px; }
h1, h2, h3, h4 { font-weight: 400; }
.serif { font-family: 'Prata', Georgia, serif; }
.quiet { color: var(--ink-3); }
.eyebrow {
  font-size: 11px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--gold-ink); font-weight: 500;
}

/* ── Верхний бар ──────────────────────────────────────────────────────── */
.appbar {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 11px 16px calc(11px);
  padding-top: calc(11px + env(safe-area-inset-top));
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 5;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
}
.wordmark { font-family: 'Prata', serif; font-size: 18px; white-space: nowrap; }
.wordmark .star { color: var(--gold-ink); }
.ab-sp { flex: 1; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--ink-2); flex: 0 0 auto;
}
.icon-btn:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.prof-open { display: none; }   /* десктоп-медиа поднимает специфичностью .appbar .prof-open */
.btn {
  padding: 8px 15px; border-radius: 10px; border: 1px solid var(--line-2);
  font-weight: 500; color: var(--ink-2);
  transition: transform 160ms var(--ease-out), color .2s, background .2s, border-color .2s;
}
.btn:hover { color: var(--ink); }
.btn:active { transform: scale(.97); }
.icon-btn { transition: transform 140ms var(--ease-out), background .2s, color .2s; }
.icon-btn:active { transform: scale(.92); }
.btn.ghost:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
.btn.gold {
  background: var(--gold); border-color: transparent; color: #1a1206; font-weight: 600;
}
[data-theme="dark"] .btn.gold, .btn.gold { color: #1a1206; }
.btn.gold:hover { filter: brightness(1.07); }

/* ── Экраны и таб-бар ─────────────────────────────────────────────────── */
.screens { flex: 1 1 auto; position: relative; min-height: 0; z-index: 1; }
.screen {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  -webkit-overflow-scrolling: touch;
}
.screen > .screen-in { max-width: 500px; margin: 0 auto; }

.tabbar {
  flex: 0 0 auto;
  display: flex;
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 82%, var(--bg));
  backdrop-filter: blur(10px);
  padding-bottom: env(safe-area-inset-bottom);
  position: relative; z-index: 5;
}
.tab {
  flex: 1;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 4px 8px;
  color: var(--ink-3);
  position: relative;
}
.tab { transition: color .2s, transform 140ms var(--ease-out); }
.tab:active { transform: scale(.94); }
.tab .tab-g { font-size: 19px; line-height: 1; }
.tab .tab-l { font-size: 11px; letter-spacing: .02em; }
.tab[aria-current="page"] { color: var(--gold-ink); }
.tab[aria-current="page"]::before {
  content: ""; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 26px; height: 2px; border-radius: 0 0 3px 3px; background: var(--gold);
}
.tab:hover { color: var(--ink); }

/* ── Дайджест дня ─────────────────────────────────────────────────────── */
.dg-head { text-align: center; margin-bottom: 6px; }
.dg-date { font-family: 'Prata', serif; font-size: 27px; line-height: 1.12; }
.dg-dow { color: var(--ink-3); font-size: 13px; margin-top: 2px; text-transform: capitalize; }
.dg-eye { margin-top: 9px; }
/* строка «что это» — первый экран должен отвечать за 5 секунд */
.dg-what {
  font-size: 12.5px; line-height: 1.45; color: var(--ink-3);
  max-width: 30ch; margin: 7px auto 0;
}

/* герой: дуга-астролябия + планета + скор */
.dg-hero { display: flex; flex-direction: column; align-items: center; margin: 6px 0 4px; }
.meter { position: relative; width: 208px; height: 208px; display: grid; place-items: center; }
.meter svg { position: absolute; inset: 0; width: 100%; height: 100%; }
/* Фолбэк-орб под Three.js-шаром: тон = ПЛАНЕТА ДНЯ (управитель дня недели).
   Виден при reduced-motion / без WebGL / пока грузится текстура. */
.meter .planet-mount {
  width: 118px; height: 118px; border-radius: 50%; position: relative; overflow: hidden;
  background: radial-gradient(circle at 34% 30%, #f0e2bd, #d8b878 38%, #9c7736 72%, #5c4520 100%);
  box-shadow: inset -10px -8px 26px rgba(0,0,0,.55), 0 0 30px color-mix(in srgb, var(--gold) 22%, transparent);
}
.planet-mount[data-planet="sun"] { background: radial-gradient(circle at 34% 30%, #fff3c4, #ffcb45 34%, #e08a12 70%, #8a4a06 100%); }
.planet-mount[data-planet="mars"] { background: radial-gradient(circle at 34% 30%, #f0b49a, #d1682f 38%, #92341a 72%, #4d1a0d 100%); }
.planet-mount[data-planet="mercury"] { background: radial-gradient(circle at 34% 30%, #ded6cb, #a89d92 38%, #6f665e 72%, #3a352f 100%); }
.planet-mount[data-planet="jupiter"] { background: radial-gradient(circle at 34% 30%, #f3ddc0, #d3a577 38%, #9c7245 72%, #55381f 100%); }
.planet-mount[data-planet="venus"] { background: radial-gradient(circle at 34% 30%, #fdf0d0, #e7c98a 38%, #b8944d 72%, #6a5223 100%); }
.planet-mount[data-planet="saturn"] { background: radial-gradient(circle at 34% 30%, #f2e4c2, #cdae78 38%, #90764a 72%, #4c3c23 100%); }
.meter .planet-mount canvas { display: block; width: 100% !important; height: 100% !important; }
.meter .m-score {
  position: absolute; bottom: 6px; left: 50%; transform: translateX(-50%);
  font-family: 'Prata', serif; font-size: 21px; color: var(--ink);
  font-variant-numeric: tabular-nums;
  background: color-mix(in srgb, var(--surface) 78%, transparent);
  padding: 1px 12px; border-radius: 999px; border: 1px solid var(--line);
  backdrop-filter: blur(4px);
}
.dg-band { margin-top: 10px; font-size: 15px; font-weight: 500; }
.dg-band.b-good { color: var(--good); }
.dg-band.b-bad { color: var(--ink-2); }

/* строка-синтез «Сегодня:» */
.dg-syn {
  display: flex; gap: 9px; align-items: flex-start;
  margin: 16px 0 4px; padding: 13px 15px; border-radius: 15px; font-size: 14px; line-height: 1.5;
  background: color-mix(in srgb, var(--gold) 9%, transparent);
  border: 1px solid color-mix(in srgb, var(--gold) 26%, transparent);
  color: var(--ink-2);
}
.dg-syn .lbl { color: var(--gold-ink); font-weight: 600; flex: 0 0 auto; }

/* секции дайджеста */
.dg-sec { margin-top: 22px; }
.dg-sec-h {
  font-size: 11px; letter-spacing: .1em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 11px; display: flex; align-items: center; gap: 8px;
}
.dg-sec-h::after { content: ""; flex: 1; height: 1px; background: var(--line); }
/* маркер: скоры пересчитаны под натальную карту (пейволл виден) */
.sec-mine {
  order: 1; flex: 0 0 auto; letter-spacing: .04em; text-transform: none;
  color: var(--gold-ink); font-weight: 600;
}

/* 6 сфер плитками */
.sphere-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sph-tile {
  border-radius: 13px; padding: 11px 9px 10px; text-align: left;
  border: 1px solid var(--line);
  background: var(--surface);
  position: relative; overflow: hidden;
  transition: border-color .2s, transform 140ms var(--ease-out);
}
@media (hover: hover) and (pointer: fine) { .sph-tile:hover { transform: translateY(-2px); } }
.sph-tile:active { transform: scale(.97); }
.sph-tile.active { border-color: color-mix(in srgb, var(--a) 60%, transparent); }
.sph-tile .st-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--a); display: inline-block; }
.sph-tile .st-label { font-size: 12px; color: var(--ink-2); display: block; margin-top: 6px; }
.sph-tile .st-score {
  font-family: 'Prata', serif; font-size: 22px; font-variant-numeric: tabular-nums;
  display: block; margin-top: 1px; line-height: 1.1;
}
.sph-tile .st-score.na { color: var(--ink-3); font-size: 16px; }

/* строки-факты (Луна, планетарный день, аспект) */
.dg-line { font-size: 14px; color: var(--ink-2); margin: 0 0 9px; line-height: 1.5; }
.dg-line .g { color: var(--gold-ink); }
.dg-line .lbl {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); margin-right: 7px;
}
.dg-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 4px; }
.fchip {
  font-size: 12.5px; padding: 4px 11px; border: 1px solid var(--line-2);
  border-radius: 999px; color: var(--ink-2);
}

/* малый виджет Луны: нарисованная фаза + лунный день Вронского */
.moon-w { display: flex; align-items: center; gap: 13px; margin-bottom: 4px; }
.moon-svg { width: 40px; height: 40px; flex: 0 0 auto; }
.moon-svg .moon-dark { fill: color-mix(in srgb, var(--ink) 14%, transparent); }
.moon-svg .moon-lit {
  fill: var(--gold-soft);
  filter: drop-shadow(0 0 4px color-mix(in srgb, var(--gold) 45%, transparent));
}
.moon-sign { font-size: 14px; color: var(--ink); }
.moon-day { font-size: 13px; color: var(--ink-2); margin-top: 1px; }
.moon-day b { font-weight: 600; color: var(--gold-ink); }
.moon-mood { font-size: 12.5px; color: var(--ink-3); margin-top: 1px; }
.lb-good { color: var(--good); }
.lb-mixed, .lb-bad { color: var(--ink-2); }
.lunar-line { font-size: 13.5px; color: var(--ink-2); margin: 7px 0 0; line-height: 1.5; }
.lunar-lbl {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); margin-right: 7px;
}

/* электив «старт дела» */
.el-band {
  display: inline-flex; align-items: center; gap: 8px;
  font-weight: 600; font-size: 14.5px; padding: 6px 14px; border-radius: 999px; margin-bottom: 11px;
}
.el-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.el-good { color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); }
.el-good .el-dot { background: var(--good); }
.el-mixed, .el-bad { color: var(--ink-2); background: color-mix(in srgb, var(--ink) 8%, transparent); }
.el-mixed .el-dot { background: var(--bad); }
.el-bad .el-dot { background: var(--bad); }
.el-facts { margin: 6px 0; }
.el-facts-h {
  display: inline-block; font-size: 10.5px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--ink-3); margin-bottom: 3px;
}
.el-facts ul { list-style: none; }
.el-facts li { font-size: 13.5px; color: var(--ink-2); padding-left: 17px; position: relative; margin: 2px 0; }
.el-pro li::before { content: '＋'; position: absolute; left: 0; color: var(--good); }
.el-con li::before { content: '－'; position: absolute; left: 0; color: var(--bad); }
.el-alt {
  font-size: 13.5px; margin-top: 9px; padding: 9px 12px; border-radius: 10px; color: var(--ink-2);
  background: color-mix(in srgb, var(--gold) 11%, transparent);
}
.el-hour-btn { margin-top: 13px; width: 100%; }
.el-h-hint { font-size: 12.5px; margin-top: 7px; }
.el-hours { margin-top: 12px; }
.el-loc { font-size: 12.5px; color: var(--ink-2); margin-bottom: 8px; }
.el-loc-change {
  font-size: 12.5px; color: var(--gold-ink); text-decoration: underline;
  text-underline-offset: 2px; margin-left: 4px;
}
.el-hours-lead { font-size: 12.5px; color: var(--ink-2); margin-bottom: 7px; }
.el-h-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.el-h-list li { font-size: 13.5px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.el-h-list b { color: var(--gold-ink); font-variant-numeric: tabular-nums; }
.el-h-why { color: var(--ink-2); font-size: 12.5px; }
.el-h-voc { color: var(--ink-3); font-size: 12px; }
.el-h-note, .el-hours-msg { font-size: 11.5px; margin-top: 7px; }
.el-ethics { font-size: 11.5px; margin-top: 13px; line-height: 1.45; }

/* ЛБК / события / персональный слой */
.dg-list { list-style: none; display: flex; flex-direction: column; gap: 7px; }
.dg-list li { font-size: 13.5px; color: var(--ink-2); line-height: 1.45; }
.ev-gloss { display: block; font-size: 12px; color: var(--ink-3); }
.pband {
  font-size: 11px; padding: 2px 9px; border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent);
  color: var(--gold-ink); white-space: nowrap; margin-right: 4px;
}
/* «Для тебя»: сдвиг сферы + причина */
.fy-list li { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 6px; }
.fy-cat { color: var(--ink); font-weight: 600; }
.fy-d {
  font-family: 'Prata', serif; font-size: 16px; font-variant-numeric: tabular-nums;
}
.fy-d.up { color: var(--gold-ink); }
.fy-d.down { color: var(--ink-2); }
.fy-n { font-size: 11.5px; color: var(--ink-3); }
.fy-none { font-size: 13px; line-height: 1.5; }
.fy-h2 { margin-top: 16px; }
.pnp {
  display: block; margin-top: 2px; font-size: 11px; color: var(--ink-3);
  font-style: italic; cursor: help;
}
.pnp::before { content: '⚑ '; opacity: .7; }
.gate-note {
  margin-top: 8px; font-size: 13px; color: var(--ink-2); line-height: 1.5;
  padding: 12px 14px; border-radius: 12px;
  background: color-mix(in srgb, var(--gold) 8%, transparent);
  border: 1px dashed color-mix(in srgb, var(--gold) 40%, transparent);
}
.gate-note b { color: var(--gold-ink); }
.gate-cta { width: 100%; margin-top: 12px; }
.gate-hint { font-size: 11.5px; margin-top: 8px; text-align: center; }

.dg-cta { margin-top: 20px; width: 100%; }

/* ── Календарь: контролы + месяц + год ────────────────────────────────── */
.cal-bar {
  display: flex; align-items: center; gap: 8px; margin-bottom: 14px;
}
.cal-title {
  font-family: 'Prata', serif; font-size: 22px; margin: 0 auto 0 4px;
  padding: 2px 4px; white-space: nowrap;
}
.cal-nav { display: flex; gap: 2px; }
/* Месяц | Год — явный переключатель: тап по заголовку аффордансом не читался */
.mode-toggle {
  display: flex; border: 1px solid var(--line-2); border-radius: 10px;
  overflow: hidden; flex: 0 0 auto;
}
.mode-toggle button { padding: 7px 12px; color: var(--ink-2); font-size: 13px; }
.mode-toggle button + button { border-left: 1px solid var(--line-2); }
.mode-toggle button[aria-checked="true"] {
  background: color-mix(in srgb, var(--ink) 10%, transparent);
  color: var(--ink); font-weight: 500;
}
.help-btn { font-size: 15px; font-weight: 600; border: 1px solid var(--line-2); }

/* точка входа в перс. слой + мягкая подсказка первого визита */
.natal-cta {
  display: block; width: 100%; text-align: left;
  font-size: 13px; color: var(--gold-ink); padding: 9px 12px; margin-bottom: 12px;
  border: 1px dashed color-mix(in srgb, var(--gold) 45%, transparent);
  border-radius: 10px; background: color-mix(in srgb, var(--gold) 7%, transparent);
}
.natal-cta:hover { background: color-mix(in srgb, var(--gold) 13%, transparent); }
.legend-hint {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-2); margin-bottom: 12px;
  padding: 9px 6px 9px 12px; border-radius: 10px;
  background: color-mix(in srgb, var(--ink) 6%, transparent);
}
.legend-hint .lh-open {
  color: var(--gold-ink); font-size: 12.5px; font-weight: 500;
  text-decoration: underline; text-underline-offset: 2px;
}
.legend-hint .lh-close { width: 28px; height: 28px; font-size: 13px; margin-left: auto; }

/* Легенда «как читать календарь» */
#legend-modal { max-height: 86vh; overflow-y: auto; }
#legend-modal .lg-list { list-style: none; display: flex; flex-direction: column; gap: 13px; }
#legend-modal .lg-list li {
  display: grid; grid-template-columns: 46px 1fr; gap: 10px;
  align-items: start; font-size: 13.5px; color: var(--ink-2); line-height: 1.45;
}
#legend-modal .lg-list b { color: var(--ink); font-weight: 600; }
.lg-swatch { height: 20px; border-radius: 5px; margin-top: 2px; }
.lg-ico {
  display: inline-flex; align-items: center; justify-content: center; gap: 3px;
  font-size: 13px; color: var(--ink); min-height: 20px; margin-top: 1px;
}
.lg-ico .kmark { position: static; }
.lg-ico .k-moon, .lg-ico .k-moon .moon-svg { width: 14px; height: 14px; }
.lg-ico .moon-svg { width: 14px; height: 14px; }
.lg-ico .moon-dark { fill: color-mix(in srgb, var(--ink) 20%, transparent); }
.lg-ico .moon-lit { fill: var(--ink); filter: none; }
.lg-gold { color: var(--gold); }
.lg-note { font-size: 12px; margin-top: 16px; line-height: 1.45; }

.sphere-select {
  display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px;
}
.sph-chip {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 13px; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--ink-2);
}
.sph-chip .cdot { width: 9px; height: 9px; border-radius: 50%; background: var(--a); }
.sph-chip.active {
  color: var(--ink); border-color: color-mix(in srgb, var(--a) 55%, transparent);
  background: color-mix(in srgb, var(--a) 12%, transparent); font-weight: 500;
}
.cal-opts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.scope-toggle { display: flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.scope-toggle button { padding: 7px 14px; color: var(--ink-2); font-size: 13px; }
.scope-toggle button + button { border-left: 1px solid var(--line-2); }
.scope-toggle button[aria-checked="true"] {
  background: color-mix(in srgb, var(--gold) 26%, transparent); color: var(--ink); font-weight: 500;
}

/* месяц */
.month { display: grid; grid-template-rows: auto repeat(6, 1fr); gap: 0; }
.dow-row { display: grid; grid-template-columns: repeat(7, 1fr); }
.dow-row .dow {
  text-align: center; font-size: 10.5px; color: var(--ink-3);
  padding: 2px 0 7px; text-transform: uppercase; letter-spacing: .06em;
}
.dow.wknd { color: var(--gold-ink); }
.mweek { display: grid; grid-template-columns: repeat(7, 1fr); position: relative; }
.mday {
  aspect-ratio: 1 / 1.08;
  margin: 2px; border-radius: 10px;
  padding: 6px 6px 13px; position: relative;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  min-width: 0; overflow: hidden; text-align: left;
  border: 1px solid transparent;
  transition: transform 140ms var(--ease-out), border-color .2s;
}
@media (hover: hover) and (pointer: fine) {
  .mday:hover { border-color: color-mix(in srgb, var(--gold) 45%, transparent); transform: translateY(-1px); }
}
.mday:active { transform: scale(.95); }
.mday .num { font-size: 13.5px; font-weight: 500; font-variant-numeric: tabular-nums; }
.mday.out { color: var(--ink-3); background: none; }   /* нейтральные, без заливки */
.mday.today { border-color: var(--today); box-shadow: 0 0 0 1px var(--today), 0 0 14px color-mix(in srgb, var(--gold) 40%, transparent); }
/* микро-сигналы ячейки: лунный день мелко + одна точка «яркое событие».
   Цвет точки = чернила ячейки (currentColor) — контраст гарантирован на любой
   сфере и любом уровне благоприятности, сетка читается с расстояния. */
.mday .lday {
  position: absolute; left: 7px; bottom: 8px;
  font-size: 9px; line-height: 1; font-variant-numeric: tabular-nums;
  letter-spacing: .02em; font-weight: 400;
  /* без opacity: она гасит контраст ниже 4.5:1 — тише делаем размером */
}
/* Маркеры ключевых дней — один на ячейку, редкие (затмение / фаза / станция).
   Цвет — чернила ячейки (currentColor): читаются и на графите, и на зелёном.
   База отдельно от позиционирования: те же значки показывает легенда. */
.kmark {
  display: inline-flex; align-items: center; justify-content: center;
  font-style: normal; line-height: 1; color: currentColor;
}
.k-moon, .k-moon .moon-svg { width: 12px; height: 12px; }
.k-moon .moon-dark { fill: color-mix(in srgb, currentColor 20%, transparent); }
.k-moon .moon-lit { fill: currentColor; filter: none; opacity: .85; }
.k-st { font-size: 10px; font-weight: 600; letter-spacing: 0; opacity: .9; }
/* затмение: кольцо с тёмным ядром — узнаваемо и не спутать с фазой */
.k-ecl {
  width: 11px; height: 11px; border-radius: 50%;
  border: 2px solid currentColor; background: transparent;
  box-shadow: 0 0 6px color-mix(in srgb, currentColor 55%, transparent);
}
.mday .kmark { position: absolute; right: 5px; top: 5px; cursor: help; }
.mday .pdelta {
  position: absolute; right: 5px; bottom: 7px;
  font-size: 9.5px; font-weight: 600; line-height: 1;
  font-variant-numeric: tabular-nums; opacity: .85;
}
.mday .pstar ~ .pdelta { right: 17px; }
.mday .mstar {
  position: absolute; right: 5px; bottom: 8px;
  font-size: 10px; font-style: normal; line-height: 1;
  color: var(--gold-ink); cursor: help;
  text-shadow: 0 0 3px color-mix(in srgb, var(--bg) 70%, transparent);
}

/* ── «Моя»: общий фон + персональные акценты ────────────────────────────────
   Сплошная перекраска тонула в рампе. Акцент-день обведён и светится (или
   охлаждён), ★ — лучшие дни месяца, ◦ — сложные (сдержанно, без алярма). */
/* ЗОЛОТО = ПЕРСОНАЛЬНЫЙ СЛОЙ, и только он. Рампа теперь зелёная, поэтому
   золотая обводка со свечением больше ни с чем не сливается: «твои дни —
   золотые». */
.mday.pa-up {
  border-color: var(--gold);
  box-shadow: inset 0 0 0 2px var(--gold),
              0 0 16px color-mix(in srgb, var(--gold) 60%, transparent);
}
/* минус-акцент — ТИШЕ плюсового: пунктир без свечения. Этика: «поберечься»,
   а не «беда»; глаз должен сперва находить хорошие дни, а не пугаться плохих. */
.mday.pa-down {
  border-style: dashed;
  border-color: color-mix(in srgb, currentColor 55%, transparent);
}
/* «сегодня» поверх акцента не теряется */
.mday.pa-up.today, .mday.pa-down.today {
  border-style: solid;
  box-shadow: 0 0 0 2px var(--today), 0 0 16px color-mix(in srgb, var(--gold) 50%, transparent);
}
.mday .pstar, .mday .phard {
  position: absolute; right: 5px; bottom: 7px;
  font-size: 12px; font-style: normal; line-height: 1; cursor: help;
  text-shadow: 0 0 4px color-mix(in srgb, var(--bg) 80%, transparent);
}
.mday .pstar { color: var(--gold); text-shadow: 0 0 6px color-mix(in srgb, var(--gold) 70%, transparent); }
.mday .phard { color: var(--ink-2); font-size: 13px; }
.rbar {
  position: absolute; bottom: calc(3px + var(--lane) * 5px); height: 3.5px;
  border-radius: 3px; background: color-mix(in srgb, var(--gold) 60%, transparent); pointer-events: none;
}
/* Полоса электива из ячеек УБРАНА (Владимир 2026-07-13: «сам не понял, что это»).
   Электив целиком живёт в дайджесте — блок «Старт дела» + «уточнить час».
   Сфера «Старт нового» и так несёт стартовый скор заливкой. */

/* год */
.year { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px 18px; }
.ymonth h3 { margin-bottom: 5px; }
.ym-title { font: 400 15px 'Prata', serif; padding: 2px 6px; border-radius: 6px; }
.ym-title:hover { background: color-mix(in srgb, var(--ink) 7%, transparent); }
.ygrid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.yday { aspect-ratio: 1; border-radius: 5px; font-size: 10px; position: relative;
  display: grid; place-items: center; font-variant-numeric: tabular-nums; }
.yday.void { visibility: hidden; }
.yday.today { box-shadow: inset 0 0 0 1.5px var(--today); }
.ydot { position: absolute; right: 2px; top: 2px; width: 5px; height: 5px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 1px rgba(0,0,0,.25); }
.ydot.moon { opacity: .75; width: 4px; height: 4px; }
.ystar { position: absolute; left: 1px; top: 0; font-size: 8px; font-style: normal;
  color: var(--gold); text-shadow: 0 0 2px rgba(0,0,0,.4); }

.legend { margin-top: 18px; }
#legend-bar { height: 9px; border-radius: 5px; }
.legend-lbl { display: flex; justify-content: space-between; font-size: 10.5px; color: var(--ink-3); margin-top: 4px; }

/* ── Ретро-баннер (в календаре) ───────────────────────────────────────── */
.retro-banner {
  background: color-mix(in srgb, var(--gold) 12%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--gold) 30%, transparent);
  border-radius: 12px; padding: 10px 13px; margin-bottom: 14px;
}
.retro-banner[hidden] { display: none; }
.rb-inner { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: baseline; }
.rb-item { font-size: 13px; color: var(--ink-2); }
.rb-glyph { color: var(--gold-ink); font-size: 15px; margin-right: 2px; }
.rb-item b { color: var(--ink); font-weight: 600; }
.rb-gloss { color: var(--ink-3); }

/* ── Профиль ──────────────────────────────────────────────────────────── */
.prof-close { float: right; margin: -4px -6px 0 0; }
.prof-h { font-family: 'Prata', serif; font-size: 24px; margin-bottom: 4px; }
.prof-sub { color: var(--ink-3); font-size: 13.5px; margin-bottom: 20px; }
.prof-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 17px 18px; margin-bottom: 16px;
}
.prof-card h3 { font-size: 15px; font-weight: 600; font-family: 'Golos Text'; margin-bottom: 4px; }
.prof-card p { font-size: 13.5px; color: var(--ink-2); line-height: 1.5; }
.prof-card .btn { margin-top: 13px; }
.prof-summary { font-size: 14px; color: var(--ink); margin: 8px 0 2px; }
.prof-summary b { font-weight: 600; }
.prof-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 13px; }
.gate-badge {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12px;
  padding: 4px 11px; border-radius: 999px; margin-top: 10px;
  border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); color: var(--gold-ink);
}

/* ── Диалоги (натал, локация) ─────────────────────────────────────────── */
#natal-modal, #eloc-modal, #legend-modal {
  border: 1px solid var(--line-2); border-radius: 18px;
  background: var(--surface); color: var(--ink);
  box-shadow: var(--shadow); padding: 24px; width: min(92vw, 420px);
}
#natal-modal::backdrop, #eloc-modal::backdrop, #legend-modal::backdrop { background: var(--scrim); }
#natal-modal h2, #eloc-modal h2, #legend-modal h2 { font: 400 21px 'Prata', serif; margin-bottom: 6px; }
#natal-form, #eloc-form { display: flex; flex-direction: column; gap: 11px; }
#natal-form label, #eloc-form label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--ink-2); }
#natal-form label.chk { flex-direction: row; align-items: flex-start; gap: 8px; }
#natal-form input[type="date"], #natal-form input[type="time"], #natal-form input[type="text"],
#eloc-form input[type="text"] {
  font: inherit; color: var(--ink); background: var(--bg);
  border: 1px solid var(--line-2); border-radius: 9px; padding: 9px 11px;
  font-size: 16px;   /* <16px → iOS Safari зумит страницу при фокусе на поле */
}
#natal-form input:disabled { opacity: .5; }
.suggest { display: flex; flex-direction: column; }
.suggest button {
  text-align: left; padding: 8px 11px; border: 1px solid var(--line-2); border-top: 0; font-size: 13px;
}
.suggest button:first-child { border-top: 1px solid var(--line-2); border-radius: 9px 9px 0 0; }
.suggest button:last-child { border-radius: 0 0 9px 9px; }
.suggest button:hover { background: color-mix(in srgb, var(--gold) 14%, transparent); }
.err { color: #d6564b; font-size: 13px; min-height: 1em; }
.modal-btns { display: flex; gap: 8px; justify-content: flex-end; margin-top: 8px; }

/* ── Тост, подсказка, пустое ──────────────────────────────────────────── */
#toast {
  position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom));
  transform: translate(-50%, 12px);
  background: var(--surface); border: 1px solid color-mix(in srgb, var(--gold) 55%, transparent);
  border-radius: 12px; box-shadow: var(--shadow); padding: 12px 18px;
  max-width: min(90vw, 520px); opacity: 0; pointer-events: none;
  transition: opacity .25s, transform .25s; z-index: 60; font-size: 13.5px;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#tip {
  position: fixed; z-index: 70; transform: translateX(-50%);
  max-width: min(72vw, 260px); padding: 7px 11px; border-radius: 9px;
  background: var(--ink); color: var(--bg); font-size: 12.5px; line-height: 1.4;
  text-align: center; box-shadow: var(--shadow); pointer-events: none;
}
#tip[hidden] { display: none; }
#tip::after { content: ''; position: absolute; left: 50%; transform: translateX(-50%); border: 5px solid transparent; }
#tip[data-pos="top"]::after { top: 100%; border-top-color: var(--ink); }
#tip[data-pos="bottom"]::after { bottom: 100%; border-bottom-color: var(--ink); }
.empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 8px; min-height: 60vh; text-align: center; color: var(--ink-2);
}
.empty .serif { font-size: 22px; color: var(--ink); }

/* ── Десктоп: ОДИН вид — календарь. Дайджест и профиль выезжают поверх ──────
   (Владимир 2026-07-13: две колонки = два скролла, режем.) Календарь всегда
   под оверлеем; дайджест — правая панель, профиль — центрированная карточка. */
.dg-close { display: none; }        /* мобилка: дайджест — вкладка, ✕ не нужен */

@media (min-width: 1000px) {
  #screen-calendar[hidden] { display: block; }   /* фон-вид, не прячем */
  #screen-calendar > .screen-in { max-width: 760px; }
  .month { min-height: 560px; }
  .tabbar { display: none; }
  .appbar .prof-open { display: inline-flex; }

  /* пока панель открыта — календарь ужимается влево, а не прячется под ней:
     любой день остаётся кликабельным, панель обновляется на месте */
  #screen-calendar { transition: padding-right .32s var(--ease-out); }
  body[data-tab="digest"] #screen-calendar { padding-right: 520px; }

  /* Дайджест — выезжающая панель поверх календаря. НЕ модальная: подложка
     прозрачна для кликов, поэтому соседний день тапается прямо из-под панели и
     она обновляется на месте (закрыть — ✕ или Esc). Скрим тут был бы трением:
     календарь для того и открыт, чтобы прыгать по дням. */
  /* absolute (не fixed): .screens — свой stacking-контекст (z-index:1), а аппбар
     живёт в корневом с z-index:5 и накрыл бы верх панели вместе с ✕. */
  #screen-digest:not([hidden]) {
    position: absolute; inset: 0; z-index: 55; padding: 0;
    background: none; pointer-events: none;
    display: grid; justify-items: end; overflow: hidden;
  }
  #screen-digest:not([hidden]) > .screen-in {
    pointer-events: auto;
    max-width: none; width: min(500px, 100%); height: 100%; margin: 0;
    overflow-y: auto; background: var(--bg);
    border-left: 1px solid var(--line-2); box-shadow: var(--shadow);
    padding: 22px 26px calc(26px + env(safe-area-inset-bottom));
    animation: drawer-in .32s var(--ease-out);
  }
  #screen-digest .dg-close { display: inline-flex; float: right; margin: -4px -8px 0 0; }

  /* профиль — центрированный модальный оверлей */
  #screen-profile:not([hidden]) {
    position: absolute; inset: 0; z-index: 56;
    background: var(--scrim); display: grid; place-items: start center;
    padding: 40px 16px; overflow-y: auto; animation: scrim-in .2s var(--ease-out);
  }
  #screen-profile:not([hidden]) > .screen-in {
    background: var(--surface); border: 1px solid var(--line-2); border-radius: 18px;
    padding: 26px; box-shadow: var(--shadow); max-width: 480px; width: 100%;
    animation: drawer-in .28s var(--ease-out);
  }
}
@keyframes scrim-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes drawer-in {
  from { transform: translateX(18px); opacity: 0; }
  to { transform: none; opacity: 1; }
}

/* ── Доступность ──────────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
