/* ==========================================================================
   Луна — design tokens (§1 DESIGN_SPEC.md v3.0 «Альманах»)
   ========================================================================== */
:root {
  --ink: #12233A;          /* база фона — не "почти чёрный", в нём зелёный подтон */
  --ink-2: #182B45;        /* приподнятая поверхность (карточки) */
  --ink-3: #1F3552;        /* ещё выше (активные/наведённые состояния) */
  --line: rgba(143, 180, 206, 0.22);   /* линии/границы — из cotton-cyan, не белые */
  --line-strong: rgba(143, 180, 206, 0.4);
  --paper: #EDE6D6;        /* основной текст — тёплая кость, НЕ фон экрана */
  --cyan: #8FB4CE;         /* хлопковый циан — вторичный текст, данные, линии шкал */
  --cyan-dim: #5E7C90;     /* третичный текст */
  --copper: #9C6B4A;       /* патинированная медь — CTA, индекс-штрихи, активное */
  --copper-bright: #C08658;/* hover/яркий вариант меди */
  --red: #C7402C;          /* астрономический красный — ТОЛЬКО функциональный:
                               ошибки, ночной режим, важные метки. Не декор. */
  --paper-inset: #D8CBAA;  /* бумага смотрового окна — ТОЛЬКО в узких инсетах
                               (число/шкала/чип), НИКОГДА фон экрана. */
  --radius-chamfer: 10px;  /* размер среза угла (не border-radius!) */
  --font-display: 'Space Grotesk', 'Arial Narrow', sans-serif;
  --font-body: 'IBM Plex Sans', -apple-system, "SF Pro Text", sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, "SF Mono", monospace;
  --ease-standard: cubic-bezier(.4,0,.2,1);
  --ease-spring: cubic-bezier(.34,1.56,.64,1);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--ink);
  color: var(--paper);
  font-family: var(--font-body);
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  -webkit-tap-highlight-color: transparent;
}

::selection {
  background: var(--copper);
  color: var(--ink);
}

/* ==========================================================================
   Звёздный фон — canvas, лёгкий (§5)
   ========================================================================== */
.stars-canvas {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  display: block;
  width: 100%;
  height: 100%;
}

/* ==========================================================================
   Layout shell
   ========================================================================== */
.page {
  position: relative;
  z-index: 1;
  max-width: 640px;
  margin: 0 auto;
  padding: 0 20px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.page-header {
  margin-bottom: 18px;
}

/* .app-header — фикс.(sticky) шапка (§4) */
header.app-header {
  position: sticky;
  top: 0;
  z-index: 5;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px 0 14px;
  margin: 0 0 18px;
  background: linear-gradient(to bottom, var(--ink) 78%, rgba(18, 35, 58, 0));
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.header-title,
.page-header h1 {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--paper);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#screen-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  color: var(--paper);
}

.subtitle {
  margin: 0 0 4px;
  font-size: 14.5px;
  letter-spacing: 0.02em;
  color: var(--cyan);
  opacity: 0.95;
}

/* .status — новое имя, .status-msg — легаси-алиас (§9, referral.js) */
.status,
.status-msg {
  margin: 28px 0;
  font-size: 14.5px;
  line-height: 1.55;
  letter-spacing: 0.01em;
  color: var(--cyan-dim);
}

.status--error,
.status-msg.error-msg {
  color: var(--red);
}

.status--loading {
  color: var(--cyan-dim);
}

.status--loading::after {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  margin-left: 4px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse-dot 1.1s ease-in-out infinite;
  vertical-align: middle;
}

@keyframes pulse-dot {
  0%, 100% { opacity: .25; }
  50% { opacity: 1; }
}

.chart-wrap {
  width: 100%;
  max-width: 560px;
  margin: 8px auto 4px;
}

.wheel {
  width: 100%;
  height: auto;
  display: block;
}

.wheel .sign-glyph {
  fill: var(--cyan);
  font-size: 22px;
  text-anchor: middle;
  dominant-baseline: middle;
}

.wheel .planet-glyph {
  fill: var(--copper-bright);
  font-size: 20px;
  text-anchor: middle;
  dominant-baseline: middle;
}

.wheel .asc-label {
  fill: var(--copper-bright);
  font-size: 13px;
  letter-spacing: 0.05em;
  text-anchor: middle;
  dominant-baseline: middle;
}

/* Переопределяем инлайновые presentation-атрибуты SVG (CSS всегда сильнее
   presentation-атрибутов), приводим кольца/линии/планеты к новым токенам. */
.wheel circle {
  fill: none;
  stroke: var(--line-strong);
}

.wheel circle:nth-of-type(n+3) {
  fill: var(--ink-2);
  stroke: var(--copper);
  stroke-width: 1;
}

.wheel line {
  stroke: var(--line);
}

.wheel polygon {
  fill: var(--copper-bright);
}

.footnote {
  max-width: 480px;
  margin: 14px auto 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--cyan-dim);
}

.legend {
  width: 100%;
  max-width: 480px;
  margin: 26px auto 10px;
  text-align: left;
}

.legend-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
  letter-spacing: 0.01em;
  animation: legend-row-in 340ms var(--ease-standard) both;
}

.legend-row:last-child {
  border-bottom: none;
}

.legend-glyph {
  color: var(--copper-bright);
  font-size: 16px;
  margin-right: 10px;
  width: 22px;
  flex: none;
  display: inline-block;
  text-align: center;
}

.legend-name {
  flex: 1;
  color: var(--paper);
}

.legend-value {
  color: var(--cyan-dim);
  font-family: var(--font-mono);
  font-size: 12.5px;
  white-space: nowrap;
}

@keyframes legend-row-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

.watermark {
  margin-top: 30px;
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--cyan-dim);
  opacity: 0.85;
}

@media (min-width: 640px) {
  .header-title,
  .page-header h1,
  #screen-title {
    font-size: 24px;
  }
}

/* --- Навигация (shell) --- */

.screen-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.back-btn {
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  width: 34px;
  height: 34px;
  color: var(--paper);
  cursor: pointer;
  transition: border-color 160ms var(--ease-standard), background 160ms var(--ease-standard);
}

.back-btn:active {
  transform: translateY(-50%) scale(0.94);
}

.back-btn svg,
.back-btn .icon {
  width: 16px;
  height: 16px;
}

.back-btn[hidden] {
  display: none;
}

#view-root {
  width: 100%;
  padding-bottom: 84px;
}

/* .tabbar — новое имя, .bottom-nav — легаси-алиас */
.tabbar,
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 6;
  display: flex;
  justify-content: space-around;
  align-items: center;
  gap: 4px;
  max-width: 640px;
  margin: 0 auto;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  background: rgba(18, 35, 58, 0.92);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.tab-item,
.nav-item {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  color: var(--cyan-dim);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  padding: 6px 2px;
  transition: color 160ms var(--ease-standard);
}

.tab-icon {
  width: 21px;
  height: 21px;
  display: block;
  stroke: currentColor;
  fill: none;
  transition: transform 220ms var(--ease-spring);
}

.nav-item-emoji {
  font-size: 20px;
}

.tab-label,
.nav-item-label {
  font-size: 9.5px;
  letter-spacing: 0.04em;
}

.tab-item.is-active,
.nav-item.active {
  color: var(--copper-bright);
}

.tab-item.is-active .tab-icon {
  transform: translateY(-1px);
}

.tab-item.is-active::after,
.nav-item.active::after {
  content: "";
  position: absolute;
  top: 27px;
  left: 50%;
  transform: translateX(-50%);
  width: 14px;
  height: 2px;
  background: var(--copper-bright);
}

/* ==========================================================================
   .moon-chip — виджет фазы Луны (§3). Визуал строится целиком на псевдо-
   элементах — экранные скрипты только выставляют --illum инлайн-стилем.
   Анимация clip-path на ::after не требует @property на --illum.
   ========================================================================== */
.moon-chip {
  --illum: 0;
  position: relative;
  flex: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--ink);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  overflow: hidden;
}

.moon-chip::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: var(--copper-bright);
  clip-path: inset(0 calc((1 - var(--illum)) * 100%) 0 0);
  transition: clip-path 700ms var(--ease-standard);
}

.app-header .moon-chip {
  width: 19px;
  height: 19px;
  flex: none;
}

/* ==========================================================================
   Иконки
   ========================================================================== */
.icon {
  width: 20px;
  height: 20px;
  display: inline-block;
  vertical-align: middle;
  stroke: currentColor;
  fill: none;
  flex: none;
}

/* ==========================================================================
   .panel — асимметричная приборная панель (замена .bento) (§4, §5)
   ========================================================================== */
/* .panel — вертикальный контейнер-обёртка (hero + строки карточек +
   широкая плитка), каждая строка сама по себе — отдельная grid-сетка
   (.panel-row--2 / .panel-row--3), см. реальную разметку home.js. */
.panel {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 10px;
}

.panel-row {
  display: grid;
  gap: 10px;
}

.panel-row--2 {
  grid-template-columns: repeat(2, 1fr);
}

.panel-row--3 {
  grid-template-columns: repeat(3, 1fr);
}

.panel-hero {
  position: relative;
  width: 100%;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 16px;
  margin: 4px 0 10px;
  background: linear-gradient(155deg, var(--ink-3), var(--ink-2) 70%);
  border: 1px solid var(--line-strong);
  box-shadow: 0 1px 0 rgba(143, 180, 206, 0.1) inset, 0 10px 20px -12px rgba(0, 0, 0, 0.6);
  clip-path: polygon(var(--radius-chamfer) 0, 100% 0, 100% calc(100% - var(--radius-chamfer)), calc(100% - var(--radius-chamfer)) 100%, 0 100%, 0 var(--radius-chamfer));
  text-align: left;
  animation: tile-in 460ms var(--ease-standard) both;
}

.panel-hero-limb {
  flex-shrink: 0;
}

.panel-hero-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.panel-hero-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--paper);
  margin: 0;
}

.panel-hero-sub {
  font-size: 12.5px;
  color: var(--cyan-dim);
  letter-spacing: 0.01em;
}

@keyframes tile-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   .card / .section-title (§4)
   ========================================================================== */
.card {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 104px;
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  /* Приподнятая "машинная пластина": мягкая тень снизу-справа даёт объём,
     тонкий верхний внутренний блик — эффект гравированного металла вместо
     плоской заливки (это и было главной причиной "плоского вайрфрейма"). */
  box-shadow: 0 1px 0 rgba(143, 180, 206, 0.08) inset, 0 8px 16px -10px rgba(0, 0, 0, 0.55);
  clip-path: polygon(var(--radius-chamfer) 0, 100% 0, 100% calc(100% - var(--radius-chamfer)), calc(100% - var(--radius-chamfer)) 100%, 0 100%, 0 var(--radius-chamfer));
  padding: 14px;
  margin: 0 0 12px;
  text-align: left;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 4px;
  color: var(--paper);
  font: inherit;
  cursor: pointer;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 180ms var(--ease-standard), transform 160ms var(--ease-standard), background 180ms var(--ease-standard);
  animation: tile-in 460ms var(--ease-standard) both;
}

.card:active {
  transform: scale(0.97);
  border-color: var(--line-strong);
}

.card--bordered {
  border-color: var(--line-strong);
}

/* referral / полноширинная плитка ряда — grid-column: 1 / -1 внутри
   3-колоночного .panel (см. §5), горизонтальная раскладка иконка+текст. */
.card--wide {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  min-height: 64px;
}

.card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 2px;
  color: var(--copper-bright);
}

.card--wide .card-icon {
  margin-bottom: 0;
}

.card-icon svg,
.card-icon .icon,
.card > .icon {
  width: 22px;
  height: 22px;
  color: var(--copper-bright);
}

.card-title {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.25;
  color: var(--paper);
  /* hyphens:auto — реальная слоговая перенос (браузер знает русские
     правила через lang="ru" на <html>), а не произвольный разрыв
     посреди слова (это был баг v2). overflow-wrap — подстраховка,
     если словарь переноса недоступен. */
  hyphens: auto;
  -webkit-hyphens: auto;
  overflow-wrap: break-word;
  word-break: normal;
  width: 100%;
}

.card--wide .card-title {
  width: auto;
}

.card-sub {
  font-size: 12px;
  color: var(--cyan-dim);
  letter-spacing: 0.01em;
}

/* Ряд из 3 узких карточек на 360px — короткие подписи ("Натальная карта")
   могут всё равно не влезать без переноса середины слова, тогда используем
   уменьшенный титул (§5). */
.card--compact .card-title {
  font-size: 13px;
}

.card--compact {
  padding: 12px 10px;
}

/* .card-corner — опциональный угловой SVG-акцент (§4), точечно на
   hero-подобных карточках. 4 засечки по углам одним псевдоэлементом. */
.card-corner::before {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  background:
    linear-gradient(var(--copper), var(--copper)) top left / 8px 1px no-repeat,
    linear-gradient(var(--copper), var(--copper)) top left / 1px 8px no-repeat,
    linear-gradient(var(--copper), var(--copper)) top right / 8px 1px no-repeat,
    linear-gradient(var(--copper), var(--copper)) top right / 1px 8px no-repeat,
    linear-gradient(var(--copper), var(--copper)) bottom left / 8px 1px no-repeat,
    linear-gradient(var(--copper), var(--copper)) bottom left / 1px 8px no-repeat,
    linear-gradient(var(--copper), var(--copper)) bottom right / 8px 1px no-repeat,
    linear-gradient(var(--copper), var(--copper)) bottom right / 1px 8px no-repeat;
}

.section-title {
  margin: 0 0 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--cyan-dim);
}

/* ==========================================================================
   .limb — сигнатурный компонент (§3), DOM строит js/limb.js
   ========================================================================== */
.limb {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
}

.limb-svg {
  display: block;
}

/* Циферблат — залитая пластина прибора (radial-эффект через 2 стопа
   имитируется линейным тоном, т.к. SVG-градиент здесь избыточен). */
.limb-face {
  fill: var(--ink-3);
  stroke: var(--line-strong);
  stroke-width: 0.6;
}

.limb-numeral {
  font-family: var(--font-mono);
  font-size: 5.6px;
  font-weight: 500;
  fill: var(--cyan-dim);
  letter-spacing: 0.02em;
}

.limb-rivet {
  fill: var(--copper-bright);
}

.limb-track {
  fill: none;
  stroke: var(--line);
  stroke-width: 3;
}

.limb-progress {
  fill: none;
  stroke: var(--copper-bright);
  stroke-width: 3;
  stroke-linecap: round;
  transition: stroke-dashoffset 620ms var(--ease-standard);
}

.limb-tick {
  stroke: var(--cyan-dim);
  stroke-width: 1;
}

.limb-tick--major {
  stroke: var(--cyan);
  stroke-width: 1.4;
}

.limb-needle {
  transition: transform 620ms var(--ease-standard);
}

.limb-needle-mark {
  stroke: var(--copper-bright);
  stroke-width: 2.5;
  stroke-linecap: round;
}

.limb-text {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 72%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: none;
  text-align: center;
}

.limb-value {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
  color: var(--paper);
  white-space: nowrap;
}

.limb-caption {
  font-family: var(--font-mono);
  font-size: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--cyan-dim);
  line-height: 1.25;
  /* Ширина .limb-text ограничена (72% диаметра дуги) — длинные подписи
     ("ОСВЕЩЁННОСТЬ") при необходимости переносятся на 2 строки вместо
     обрезки, обрезка текста здесь недопустима ни при каких условиях. */
}

@media (prefers-reduced-motion: reduce) {
  .limb-progress,
  .limb-needle {
    transition: none !important;
  }
}

/* ==========================================================================
   .almanac — лента ближайших дней с мини-лимбами (js/almanac-strip.js)
   ========================================================================== */
.almanac {
  width: 100%;
  margin: 4px 0 12px;
}

.almanac-head {
  margin: 0 2px 8px;
}

.almanac-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
  padding: 10px 6px;
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  box-shadow: 0 1px 0 rgba(143, 180, 206, 0.08) inset, 0 8px 16px -10px rgba(0, 0, 0, 0.55);
  clip-path: polygon(var(--radius-chamfer) 0, 100% 0, 100% calc(100% - var(--radius-chamfer)), calc(100% - var(--radius-chamfer)) 100%, 0 100%, 0 var(--radius-chamfer));
}

.almanac-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 5px 0;
  border-radius: 2px;
}

.almanac-day--today {
  background: rgba(192, 134, 88, 0.14);
  border: 1px solid rgba(192, 134, 88, 0.4);
}

.almanac-day-name {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--cyan-dim);
}

.almanac-day--today .almanac-day-name {
  color: var(--copper-bright);
}

.almanac-day-limb {
  width: 28px;
  height: 28px;
}

.almanac-day-num {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 600;
  color: var(--paper);
}

/* ==========================================================================
   .btn (§4)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 18px;
  margin: 4px 0;
  clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px);
  border: 1px solid transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms var(--ease-standard), background 160ms var(--ease-standard),
    border-color 160ms var(--ease-standard), opacity 160ms var(--ease-standard);
}

.btn:active {
  transform: scale(0.97);
}

.btn--primary {
  background: var(--copper);
  color: var(--ink);
}

.btn--primary:hover {
  background: var(--copper-bright);
}

.btn--secondary {
  background: transparent;
  color: var(--paper);
  border-color: var(--line-strong);
}

.btn--ghost {
  background: transparent;
  color: var(--cyan);
  border-color: var(--line);
}

.btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn:focus-visible {
  outline: 2px solid var(--copper-bright);
  outline-offset: 2px;
}

/* ==========================================================================
   .field — обёртка label + input/select (§4)
   ========================================================================== */
.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  margin: 0 0 14px;
  text-align: left;
}

.field label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cyan-dim);
}

.field input,
.field select,
input,
select {
  width: 100%;
  background: var(--ink);
  border: 1px solid var(--line);
  border-radius: 0;
  color: var(--paper);
  padding: 11px 12px;
  font: inherit;
  font-size: 15px;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 160ms var(--ease-standard);
}

.field select,
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--cyan-dim) 50%),
    linear-gradient(135deg, var(--cyan-dim) 50%, transparent 50%);
  background-position: calc(100% - 16px) center, calc(100% - 11px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 30px;
}

.field input:focus,
.field select:focus,
input:focus,
select:focus {
  border-color: var(--copper);
}

input[type="date"] {
  color-scheme: dark;
}

input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.75) sepia(1) saturate(2) hue-rotate(340deg) opacity(0.75);
  cursor: pointer;
}

.field input[readonly] {
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

/* ==========================================================================
   .skeleton — shimmer-плейсхолдер (§4)
   ========================================================================== */
.skeleton {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 20px 0;
}

.skeleton-line,
.skeleton-block {
  position: relative;
  overflow: hidden;
  background: var(--ink-2);
  border-radius: 0;
}

.skeleton-line {
  height: 13px;
}

.skeleton-line:nth-child(2) { width: 92%; }
.skeleton-line:nth-child(3) { width: 76%; }

.skeleton-block {
  height: 130px;
}

.skeleton-line::after,
.skeleton-block::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--ink-3), transparent);
  animation: skeleton-shimmer 1.6s ease-in-out infinite;
}

@keyframes skeleton-shimmer {
  100% { transform: translateX(100%); }
}

/* ==========================================================================
   .chip (§4)
   ========================================================================== */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  margin: 0 6px 0 0;
  border-radius: 0;
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  color: var(--cyan);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.chip .icon {
  width: 12px;
  height: 12px;
  color: var(--copper-bright);
  flex-shrink: 0;
}

/* ==========================================================================
   .toast (§4)
   ========================================================================== */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  transform: translate(-50%, 10px);
  z-index: 20;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 16px;
  border-radius: 0;
  background: var(--ink-2);
  border: 1px solid var(--line-strong);
  color: var(--paper);
  font-size: 13.5px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 220ms var(--ease-standard), transform 220ms var(--ease-standard);
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
  pointer-events: auto;
}

.toast .icon {
  width: 16px;
  height: 16px;
  color: var(--copper-bright);
}

/* ==========================================================================
   .tarot-card — 3D flip (§4)
   ========================================================================== */
.tarot-card {
  width: min(220px, 62vw);
  aspect-ratio: 2 / 3;
  margin: 8px auto 18px;
  perspective: 1200px;
}

.tarot-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 620ms var(--ease-spring);
}

.tarot-card.is-flipped .tarot-card-inner {
  transform: rotateY(180deg);
}

.tarot-card-face {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 18px;
  clip-path: polygon(var(--radius-chamfer) 0, 100% 0, 100% calc(100% - var(--radius-chamfer)), calc(100% - var(--radius-chamfer)) 100%, 0 100%, 0 var(--radius-chamfer));
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  text-align: center;
  overflow-y: auto;
}

.tarot-card-face--front {
  background: linear-gradient(155deg, var(--ink-3), var(--ink-2));
  border: 1px solid var(--line-strong);
  color: var(--copper-bright);
}

.tarot-card-face--front svg,
.tarot-card-face--front .icon {
  width: 44px;
  height: 44px;
}

.tarot-card.is-loading .tarot-card-face--front .icon {
  animation: pulse-dot 1.1s ease-in-out infinite;
}

.tarot-card-face--back {
  background:
    repeating-linear-gradient(
      55deg,
      var(--line) 0,
      var(--line) 1px,
      transparent 1px,
      transparent 12px
    ),
    var(--ink-2);
  border: 1px solid var(--line-strong);
  transform: rotateY(180deg);
  color: var(--paper);
  font-size: 13.5px;
  line-height: 1.5;
}

.tarot-card-face--back .subtitle {
  font-size: 16px;
}

/* ==========================================================================
   wheel-animate-in — обводка колец + последовательное появление планет (§4, §7)
   ========================================================================== */
svg.wheel.wheel-animate-in circle:nth-of-type(1) {
  stroke-dasharray: 1885;
  stroke-dashoffset: 1885;
  opacity: 0;
  animation: ring-draw 950ms var(--ease-standard) forwards;
}

svg.wheel.wheel-animate-in circle:nth-of-type(2) {
  stroke-dasharray: 1558;
  stroke-dashoffset: 1558;
  opacity: 0;
  animation: ring-draw 950ms var(--ease-standard) forwards;
  animation-delay: 140ms;
}

svg.wheel.wheel-animate-in line {
  opacity: 0;
  animation: line-fade 500ms var(--ease-standard) forwards;
  animation-delay: 520ms;
}

svg.wheel.wheel-animate-in text {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: glyph-in 420ms var(--ease-spring) forwards;
}

svg.wheel.wheel-animate-in text.sign-glyph { animation-delay: 640ms; }

svg.wheel.wheel-animate-in circle:nth-of-type(n+3) {
  opacity: 0;
  transform-box: fill-box;
  transform-origin: center;
  animation: glyph-in 420ms var(--ease-spring) forwards;
  animation-delay: 760ms;
}

svg.wheel.wheel-animate-in circle:nth-of-type(4) { animation-delay: 800ms; }
svg.wheel.wheel-animate-in circle:nth-of-type(5) { animation-delay: 840ms; }
svg.wheel.wheel-animate-in circle:nth-of-type(6) { animation-delay: 880ms; }
svg.wheel.wheel-animate-in circle:nth-of-type(7) { animation-delay: 920ms; }
svg.wheel.wheel-animate-in circle:nth-of-type(8) { animation-delay: 960ms; }
svg.wheel.wheel-animate-in circle:nth-of-type(9) { animation-delay: 1000ms; }
svg.wheel.wheel-animate-in circle:nth-of-type(10) { animation-delay: 1040ms; }
svg.wheel.wheel-animate-in circle:nth-of-type(11) { animation-delay: 1080ms; }
svg.wheel.wheel-animate-in circle:nth-of-type(12) { animation-delay: 1120ms; }
svg.wheel.wheel-animate-in circle:nth-of-type(13) { animation-delay: 1160ms; }
svg.wheel.wheel-animate-in circle:nth-of-type(14) { animation-delay: 1200ms; }
svg.wheel.wheel-animate-in circle:nth-of-type(15) { animation-delay: 1240ms; }
svg.wheel.wheel-animate-in circle:nth-of-type(16) { animation-delay: 1280ms; }

svg.wheel.wheel-animate-in text.planet-glyph:nth-of-type(n+13) { animation-delay: 800ms; }
svg.wheel.wheel-animate-in text.planet-glyph:nth-of-type(14) { animation-delay: 840ms; }
svg.wheel.wheel-animate-in text.planet-glyph:nth-of-type(15) { animation-delay: 880ms; }
svg.wheel.wheel-animate-in text.planet-glyph:nth-of-type(16) { animation-delay: 920ms; }
svg.wheel.wheel-animate-in text.planet-glyph:nth-of-type(17) { animation-delay: 960ms; }
svg.wheel.wheel-animate-in text.planet-glyph:nth-of-type(18) { animation-delay: 1000ms; }
svg.wheel.wheel-animate-in text.planet-glyph:nth-of-type(19) { animation-delay: 1040ms; }
svg.wheel.wheel-animate-in text.planet-glyph:nth-of-type(20) { animation-delay: 1080ms; }
svg.wheel.wheel-animate-in text.planet-glyph:nth-of-type(21) { animation-delay: 1120ms; }
svg.wheel.wheel-animate-in text.planet-glyph:nth-of-type(22) { animation-delay: 1160ms; }
svg.wheel.wheel-animate-in text.planet-glyph:nth-of-type(23) { animation-delay: 1200ms; }
svg.wheel.wheel-animate-in text.planet-glyph:nth-of-type(24) { animation-delay: 1240ms; }

svg.wheel.wheel-animate-in text.asc-label {
  animation-delay: 1300ms;
}

svg.wheel.wheel-animate-in polygon {
  opacity: 0;
  animation: line-fade 400ms var(--ease-standard) forwards;
  animation-delay: 1260ms;
}

@keyframes ring-draw {
  from { opacity: 0; }
  to { stroke-dashoffset: 0; opacity: 1; }
}

@keyframes line-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes glyph-in {
  from { opacity: 0; transform: scale(0.5); }
  to { opacity: 1; transform: scale(1); }
}

/* ==========================================================================
   Переходы между экранами — View Transitions API (§6)
   ========================================================================== */
::view-transition-old(root) {
  animation: 160ms var(--ease-standard) both vt-fade-out;
}

::view-transition-new(root) {
  animation: 220ms var(--ease-standard) both vt-fade-in-up;
}

@keyframes vt-fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes vt-fade-in-up {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   prefers-reduced-motion — обязательное глушение анимаций (§8)
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .tarot-card-inner {
    transition-duration: 120ms !important;
  }

  ::view-transition-old(root),
  ::view-transition-new(root) {
    animation: none !important;
  }
}

/* ==========================================================================
   Узкий вьюпорт — не переполняться на 360px (§8)
   ========================================================================== */
@media (max-width: 360px) {
  .panel {
    gap: 8px;
  }

  .card {
    padding: 12px;
    min-height: 96px;
  }

  .panel-hero {
    padding: 12px;
    gap: 10px;
  }
}
