/* Astro Mania — bundled stylesheet. Source: css/ (ITCSS). Run: python scripts/build_css.py */

/* ===== Astro Mania - Астрологическая стилизация ===== */

/* Цветовая палитра */
:root {
  /* Космические цвета */
  --space-dark: #0f0c29;
  --space-purple: #302b63;
  --space-blue: #24243e;
  
  /* Золотые и мистические акценты */
  --gold: #ffd700;
  --gold-light: #ffe55d;
  --gold-dark: #daa520;
  
  /* Дополнительные цвета */
  --silver: #c0c0c0;
  --cosmic-purple: #9d50bb;
  --deep-purple: #6e48aa;
  --celestial-blue: #4facfe;
  --mystic-pink: #f093fb;
  
  /* Семантические цвета */
  --success-color: #4ade80;
  --warning-color: #fbbf24;
  --error-color: #f87171;
  --text-muted: rgba(255, 255, 255, 0.6);
  --border-color: rgba(255, 255, 255, 0.1);

  /* Pro / Subscription theme */
  --pro-violet: #7c3aed;
  --pro-purple: #a855f7;
  --pro-lavender: #c084fc;
  --pro-gradient: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #c084fc 100%);
  --pro-border: rgba(167, 139, 250, 0.4);
  --pro-glow: rgba(167, 139, 250, 0.25);

  /* Main-tab surface standard (cards, lists, panels) */
  --am-page-max: 800px;
  /* Отступ от последнего блока контента до legal-strip (эталон — «Небо») */
  --am-content-to-legal-gap: 12px;
  /* Подвал: единая золотая гамма на всех экранах */
  --am-footer-fg: rgba(255, 215, 120, 0.72);
  --am-footer-fg-strong: rgba(255, 232, 165, 0.88);
  --am-footer-link: rgba(255, 224, 150, 0.95);
  --am-footer-link-hover: var(--gold-light);
  --am-footer-border: rgba(212, 175, 55, 0.28);
  --am-surface-bg: linear-gradient(
    135deg,
    rgba(157, 80, 187, 0.15) 0%,
    rgba(110, 72, 170, 0.1) 50%,
    rgba(79, 172, 254, 0.15) 100%
  );
  --am-surface-border: rgba(157, 80, 187, 0.3);
  --am-surface-blur: 12px;
  --am-surface-radius: 16px;
  --am-surface-shadow: 0 4px 20px rgba(15, 12, 41, 0.4);
  --am-inner-bg: rgba(0, 0, 0, 0.2);
  --am-inner-border: rgba(255, 255, 255, 0.08);
  --am-inner-blur: 8px;
  --am-inner-radius: 12px;
}

@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(12px); }
  to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}

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

html {
  background: #000;
}

/* Page shell: background, body, main */
#page-bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: var(--app-bg-height, 100vh);
  min-height: var(--app-bg-height, 100vh);
  background: #000 url('/static/logo/background.webp') center center / cover no-repeat;
  z-index: -1;
  pointer-events: none;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  isolation: isolate;
  background: transparent;
  color: #ffffff;
  margin: 0;
  padding: max(12px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right)) max(12px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
  min-height: 100vh;
  width: 100%;
  overflow-x: hidden;
}

main {
  max-width: 1400px;
  margin: 0 auto;
  padding-bottom: calc(80px + env(safe-area-inset-bottom));
}

/* Telegram WebApp fullscreen */
body.fullscreen-mode {
  padding: 0 !important;
  padding-top: max(0px, env(safe-area-inset-top)) !important;
  padding-bottom: max(0px, env(safe-area-inset-bottom)) !important;
  padding-left: max(0px, env(safe-area-inset-left)) !important;
  padding-right: max(0px, env(safe-area-inset-right)) !important;
}

body.fullscreen-mode main {
  padding: 12px;
  padding-top: 24px;
  padding-bottom: calc(80px + max(8px, env(safe-area-inset-bottom)));
  padding-left: max(12px, env(safe-area-inset-left));
  padding-right: max(12px, env(safe-area-inset-right));
}

body.fullscreen-mode .app-header {
  padding-top: 24px;
  margin-bottom: 12px;
}

@media (max-width: 600px) {
  body {
    padding: 10px;
    padding-top: max(10px, env(safe-area-inset-top));
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  main {
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
  }

  body.fullscreen-mode main {
    padding: 10px;
    padding-top: 22px;
    padding-bottom: calc(70px + env(safe-area-inset-bottom));
    padding-left: max(10px, env(safe-area-inset-left));
    padding-right: max(10px, env(safe-area-inset-right));
  }

  body.fullscreen-mode .app-header {
    padding-top: 22px;
  }
}

/* ===== Заголовок приложения ===== */
.app-header {
  text-align: center;
  margin-bottom: 12px;
  padding: 8px 0;
  padding-top: max(12px, calc(env(safe-area-inset-top) * 0.3 + 10px));
}

.app-title {
  font-size: 24px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 4px;
  text-shadow: 0 0 30px rgba(255, 215, 0, 0.3);
  letter-spacing: 0.5px;
}

.app-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 300;
  letter-spacing: 0.3px;
}

.brand {
  margin-bottom: 8px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.app-logo-wordmark {
  width: min(280px, 72vw);
  height: auto;
  max-height: 80px;
  object-fit: contain;
}

@media (max-width: 600px) {
  .app-logo-wordmark {
    max-height: 72px;
  }
}

@media (max-width: 600px) {
  .app-header {
    margin-bottom: 10px;
    padding: 12px 0;
    padding-top: max(12px, calc(env(safe-area-inset-top) * 0.3 + 6px));
  }

  .app-title {
    font-size: 20px;
  }

  .app-subtitle {
    font-size: 11px;
  }
}

/* ===== Content Container & Tabs ===== */
.content-container {
  position: relative;
  margin-top: 8px;
}

.tab-content {
  display: none;
  animation: fadeIn 0.3s ease-in-out;
}

.tab-content.active {
  display: block;
}

/* ===== Bottom Navigation ===== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(
    180deg,
    rgba(15, 12, 41, 0.9) 0%,
    rgba(15, 12, 41, 0.95) 100%
  );
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  will-change: backdrop-filter;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px env(safe-area-inset-right) max(8px, env(safe-area-inset-bottom)) env(safe-area-inset-left);
  z-index: 1000;
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.3);
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  color: rgba(255, 255, 255, 0.5);
  position: relative;
  z-index: 1001;
  pointer-events: auto;
  -webkit-tap-highlight-color: rgba(255, 215, 0, 0.2);
  -webkit-user-select: none;
  user-select: none;
}

.nav-item:active {
  transform: scale(0.95);
  background: rgba(255, 215, 0, 0.05);
}

.nav-item.active {
  color: var(--gold);
}

/* Центральная кнопка (Главная) - 3-я кнопка, больше остальных */
.nav-item:nth-child(3) {
  position: relative;
}

.nav-item:nth-child(3) {
  position: relative;
}

.nav-item:nth-child(3) .nav-icon {
  font-size: 32px;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--cosmic-purple) 0%, var(--deep-purple) 100%);
  border-radius: 50%;
  border: 3px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 4px 20px rgba(157, 80, 187, 0.5);
  margin-top: -20px;
}

.nav-item:nth-child(3).active .nav-icon {
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
  border-color: var(--gold);
  box-shadow: 0 6px 25px rgba(255, 215, 0, 0.6);
}

.nav-icon {
  font-size: 20px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(79, 172, 254, 0.2) 0%, rgba(0, 242, 254, 0.15) 100%);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  filter: grayscale(100%);
  overflow: hidden;
}

.nav-icon-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.nav-icon--heart {
  filter: none;
}

.nav-icon--heart .nav-heart-glyph {
  width: 26px;
  height: 26px;
  fill: rgba(255, 255, 255, 0.55);
  display: block;
}

.nav-item.active .nav-icon--heart .nav-heart-glyph {
  fill: var(--gold-light);
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.35));
}

.nav-item.active .nav-icon {
  filter: grayscale(0%);
  background: linear-gradient(135deg, var(--cosmic-purple) 0%, var(--deep-purple) 100%);
  border-color: rgba(255, 215, 0, 0.4);
  box-shadow: 0 4px 15px rgba(157, 80, 187, 0.4);
  transform: scale(1.05);
}

/* Отменяем scale для центральной кнопки, так как у неё свой стиль */
.nav-item:nth-child(3).active .nav-icon {
  transform: none;
}

.nav-label {
  font-size: 11px;
  font-weight: 500;
  transition: all 0.3s ease;
}

.nav-item.active .nav-label {
  font-weight: 600;
}

.nav-item.nav-item--has-update .nav-icon {
  position: relative;
}

.nav-item.nav-item--has-update .nav-icon::after {
  content: '';
  position: absolute;
  top: 2px;
  right: 2px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--gold);
  border: 1.5px solid rgba(15, 12, 41, 0.85);
  box-shadow: 0 0 6px rgba(255, 215, 0, 0.45);
  pointer-events: none;
}

@media (max-width: 600px) {
  .bottom-nav {
    padding: 6px 0;
  }

  .nav-icon {
    font-size: 18px;
    width: 44px;
    height: 44px;
  }

  .nav-item:nth-child(3) .nav-icon {
    font-size: 28px;
    width: 56px;
    height: 56px;
    margin-top: -18px;
  }

  .nav-label {
    font-size: 10px;
  }
}

/* ===== Карточки ===== */
.card {
  background: var(--am-surface-bg);
  backdrop-filter: blur(var(--am-surface-blur));
  -webkit-backdrop-filter: blur(var(--am-surface-blur));
  will-change: backdrop-filter;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  border: 1px solid var(--am-surface-border);
  border-radius: var(--am-surface-radius);
  padding: 16px;
  margin-bottom: 0;
  box-shadow: var(--am-surface-shadow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 12px 40px rgba(0, 0, 0, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.15);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 6px;
}

.card-title {
  font-size: 17px;
  font-weight: 600;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 6px;
}

.card-date {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 400;
  text-transform: capitalize;
}

@media (max-width: 600px) {
  .card {
    padding: 14px;
    border-radius: 12px;
  }

  .card-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }
}

/* ===== Unified surfaces (standard = home / daily forecast) ===== */

.home-content,
.planets-page,
.chart-page,
.transits-page,
.compat-page {
  max-width: var(--am-page-max);
  margin: 0 auto;
}

.page-header-center {
  flex: 1;
  text-align: center;
  min-width: 0;
}

.page-kicker {
  margin: 4px 0 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
}

.am-surface {
  background: var(--am-surface-bg);
  border: 1px solid var(--am-surface-border);
  border-radius: var(--am-surface-radius);
  backdrop-filter: blur(var(--am-surface-blur));
  -webkit-backdrop-filter: blur(var(--am-surface-blur));
  box-shadow: var(--am-surface-shadow);
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.am-surface-inner {
  background: var(--am-inner-bg);
  border: 1px solid var(--am-inner-border);
  border-radius: var(--am-inner-radius);
  backdrop-filter: blur(var(--am-inner-blur));
  -webkit-backdrop-filter: blur(var(--am-inner-blur));
}

/* Aspect rows (synastry + transits detail) */
.am-aspect-card,
.compat-aspect-card,
.transit-card {
  padding: 12px 14px;
  border-radius: var(--am-inner-radius);
  background: var(--am-inner-bg);
  border: 1px solid var(--am-inner-border);
  backdrop-filter: blur(var(--am-inner-blur));
  -webkit-backdrop-filter: blur(var(--am-inner-blur));
}

.am-aspect-card.harmonious,
.compat-aspect-card.harmonious,
.transit-card.harmonious {
  border-left: 3px solid var(--success-color);
}

.am-aspect-card.challenging,
.compat-aspect-card.challenging,
.transit-card.challenging {
  border-left: 3px solid var(--warning-color);
}

.am-aspect-head,
.compat-aspect-head,
.transit-card .transit-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-light);
  line-height: 1.35;
}

.am-aspect-meta,
.compat-aspect-meta {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.45);
}

.am-aspect-text,
.compat-aspect-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
}

/* ===== HOME PAGE ===== */
.date-widget {
  text-align: center;
  margin-top: 8px;
  margin-bottom: 16px;
  padding: 12px;
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.1) 0%,
    rgba(255, 215, 0, 0.05) 100%
  );
  border-radius: 12px;
  border: 1px solid rgba(255, 215, 0, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

/* Moon Phase in Daily Forecast */
.moon-phase-item .forecast-icon-main {
  animation: moonGlow 3s ease-in-out infinite;
}

button.moon-phase-item {
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

@keyframes moonGlow {
  0%, 100% {
    filter: drop-shadow(0 0 8px rgba(157, 80, 187, 0.4));
  }
  50% {
    filter: drop-shadow(0 0 15px rgba(157, 80, 187, 0.6));
  }
}

.moon-phase-item #moon-phase-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #fff;
  text-shadow: none;
}

#forecast-transit-title {
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(255, 220, 140, 0.9);
}

.moon-phase-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.moon-phase-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.72);
  padding: 4px 9px;
  margin-top: 0;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* Лунный ряд: золото точечно, не заливкой всего блока */
.daily-forecast-main .moon-phase-badges .moon-phase-badge {
  color: rgba(255, 236, 195, 0.8);
  border-color: rgba(255, 215, 0, 0.14);
  background: rgba(255, 215, 0, 0.05);
}

.daily-forecast-main .moon-phase-badges .moon-phase-badge:first-child {
  color: rgba(255, 232, 165, 0.98);
  font-weight: 600;
  border-color: rgba(255, 215, 0, 0.32);
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.16) 0%,
    rgba(255, 215, 0, 0.07) 100%
  );
}

/* Мета «Общего настроя» — снова золотой акцент, компактная пилюля */
.forecast-meta-badge {
  position: relative;
  margin-top: 14px;
  padding-top: 0;
  width: auto;
  max-width: 100%;
  font-weight: 600;
  color: rgba(255, 232, 165, 0.98);
  border-color: rgba(255, 215, 0, 0.3);
  background: linear-gradient(
    135deg,
    rgba(255, 215, 0, 0.15) 0%,
    rgba(255, 215, 0, 0.06) 100%
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
}

.forecast-meta-badge::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -12px;
  height: 1px;
  background: linear-gradient(
    90deg,
    rgba(255, 215, 0, 0.2) 0%,
    rgba(255, 255, 255, 0.08) 55%,
    transparent 100%
  );
}

.current-date {
  font-size: 15px;
  font-weight: 600;
  color: var(--gold-light);
  text-transform: capitalize;
}

/* Внешняя оболочка — стекло с фиолетово-золотой гаммой (как в проде раньше) */
.daily-forecast-main {
  opacity: 1 !important;
  padding: 16px;
  background: linear-gradient(
    135deg,
    rgba(157, 80, 187, 0.35) 0%,
    rgba(110, 72, 170, 0.25) 50%,
    rgba(79, 172, 254, 0.35) 100%
  );
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(157, 80, 187, 0.3);
  box-shadow: var(--am-surface-shadow);
}

.daily-forecast-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}

.daily-forecast-title {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-transform: none;
  color: var(--gold);
}

.daily-forecast-head__mark {
  font-size: 18px;
  line-height: 1;
  opacity: 0.85;
  filter: drop-shadow(0 0 12px rgba(157, 80, 187, 0.45));
}

.daily-forecast-blocks {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.forecast-content-main {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-radius: 12px;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.forecast-content-main--mood:has(#forecast-transit-item.hidden) {
  display: none;
}

.forecast-text-main {
  flex: 1;
  min-width: 0;
}

.daily-forecast-main .forecast-item-main {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 16px 16px 14px;
  transition: background 0.25s ease;
  background: transparent;
  border: none;
  border-radius: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.daily-forecast-main button.moon-phase-item:active {
  background: rgba(255, 255, 255, 0.04);
}

.daily-forecast-main .forecast-item-main:not(.locked):hover {
  background: rgba(255, 255, 255, 0.03);
  transform: none;
}

.forecast-item-main--mood {
  position: relative;
  padding-left: 19px;
}

.forecast-item-main--mood::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(255, 215, 120, 0.7), rgba(157, 80, 187, 0.35));
  opacity: 0.85;
}

/* «Общий настрой» не куплен — явный CTA вместо скрытого блока */
.forecast-item-main.locked {
  cursor: pointer;
  border-style: dashed;
  border-color: rgba(255, 215, 0, 0.35);
}

.forecast-item-main.locked .forecast-icon-main {
  opacity: 0.6;
  filter: none;
}

.forecast-item-main.locked #forecast-transit-period {
  background: rgba(255, 215, 0, 0.25);
  color: var(--gold);
  font-weight: 700;
}

.daily-forecast-main .forecast-icon-main {
  font-size: 22px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(155deg, rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.25));
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
  filter: none;
}

.moon-phase-item .forecast-icon-main {
  animation: none;
}

.forecast-text-main h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--gold-light);
  margin: 0 0 10px;
}

.daily-forecast-main .forecast-text-main p,
.daily-forecast-main .forecast-transit-desc {
  font-size: 14px;
  line-height: 1.72;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 400;
  letter-spacing: 0.01em;
  margin: 0;
  text-wrap: pretty;
}

.daily-forecast-main .forecast-transit-desc {
  max-width: 42em;
}

/* Загрузка «Общего настроя» — та же колонка, что и готовый текст: слева звёзды + фраза */
#forecast-transit-item.forecast-item-main--loading .forecast-text-main {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.forecast-transit-desc--loading .am-loader {
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
  padding: 2px 0 6px;
  text-align: left;
  width: 100%;
  max-width: 100%;
}

.forecast-transit-desc--loading .am-loader-text {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  line-height: 1.5;
  text-align: left;
  animation: none;
  text-shadow: none;
  color: rgba(255, 255, 255, 0.75);
}

#forecast-transit-item #forecast-transit-period {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.forecast-unlock-lead {
  margin: 0 0 6px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.92);
}

.forecast-unlock-sub {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.55);
}

.forecast-item-main--gate {
  cursor: pointer;
}

.forecast-item-main--gate.locked {
  background: linear-gradient(120deg, rgba(255, 215, 0, 0.06) 0%, rgba(124, 58, 237, 0.08) 55%, transparent 100%);
}

.forecast-item-main--empty {
  border-style: solid;
  border-color: rgba(255, 255, 255, 0.1);
}

.forecast-icon-main--planet {
  font-size: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.forecast-icon-main--planet .transit-symbol--img img {
  width: 32px;
  height: 32px;
}

.forecast-icon-main--planet .natal-transit-glyph {
  font-size: 28px;
}

@media (max-width: 600px) {
  .forecast-item-main {
    padding: 12px;
    gap: 12px;
  }

  .forecast-icon-main {
    font-size: 28px;
  }

  .forecast-text-main h3 {
    font-size: 15px;
  }

  .forecast-text-main p {
    font-size: 13px;
  }

  .current-date {
    font-size: 14px;
  }

  .moon-phase-badge {
    font-size: 10px;
    padding: 3px 8px;
  }
}

/* ===== PLANETS PAGE ===== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 4px;
  margin-bottom: 12px;
  position: relative;
  z-index: 100;
}

.page-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--gold);
}

.btn-refresh-small {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
  border: none;
  border-radius: 10px;
  color: var(--space-dark);
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.btn-refresh-small:hover:not(:disabled) {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.btn-refresh-small:disabled .btn-icon {
  animation: rotate 1s linear infinite;
}

.timestamp {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 300;
  margin-bottom: 16px;
  display: block;
}

.planets-grid-page {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.planet-card-page {
  background: var(--am-surface-bg);
  backdrop-filter: blur(var(--am-surface-blur));
  -webkit-backdrop-filter: blur(var(--am-surface-blur));
  will-change: backdrop-filter;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  border: 1px solid var(--am-surface-border);
  border-radius: var(--am-surface-radius);
  padding: 16px 12px;
  transition: all 0.3s ease;
  animation: fadeIn 0.3s ease-out;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 280px;
  opacity: 1 !important;
}


/* Стили для дополнительных точек (узлы, Лилит, Хирон) */
.planet-card-page.category-point {
  border-color: rgba(157, 80, 187, 0.45);
}

.planet-card-page.category-asteroid {
  border-color: rgba(255, 215, 0, 0.35);
}


.planet-card-image-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 16px;
  flex-shrink: 0;
}

.planet-card-image {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  border: 2px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 4px 20px rgba(255, 215, 0, 0.3);
}

.planet-card-emoji {
  font-size: 64px;
  filter: drop-shadow(0 0 10px rgba(255, 215, 0, 0.4));
}

.planet-card-info {
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.planet-card-name {
  font-size: 16px;
  font-weight: 600;
  color: #ffffff;
  text-align: center;
  margin-bottom: 12px;
}

.planet-card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  flex: 1;
}

.planet-info-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.info-label {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 500;
}

.info-value {
  font-size: 14px;
  color: #ffffff;
  font-weight: 600;
}

.info-value.direct {
  color: var(--success-color);
}

.info-value.retrograde {
  color: var(--warning-color);
  animation: pulse 2s ease-in-out infinite;
}

@media (max-width: 768px) {
  .planets-grid-page {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 600px) {
  .page-title {
    font-size: 18px;
  }

  .planet-card-page {
    padding: 14px;
  }

  .planet-emoji-page {
    font-size: 28px;
  }

  .planet-name-page {
    font-size: 16px;
  }
}

/* ===== PLACEHOLDER PAGES ===== */
.placeholder-page {
  text-align: center;
  max-width: 600px;
  margin: 20px auto;
  padding: 20px;
}

.placeholder-icon {
  font-size: 80px;
  margin-bottom: 16px;
  filter: drop-shadow(0 0 20px rgba(255, 215, 0, 0.3));
  animation: float 3s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-10px); }
}

.placeholder-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold);
  margin-bottom: 12px;
}

.placeholder-text {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 24px;
}

.placeholder-page .btn-primary {
  flex: none !important;
  width: fit-content !important;
  max-width: 280px;
  margin-left: auto !important;
  margin-right: auto !important;
}

.placeholder-features {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 400px;
  margin: 0 auto;
}

.feature-item {
  padding: 12px 20px;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.2);
  border-radius: 10px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  text-align: left;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

@media (max-width: 600px) {
  .placeholder-icon {
    font-size: 60px;
  }

  .placeholder-title {
    font-size: 24px;
  }
}

/* ===== COMPATIBILITY (SYNASTRY) PAGE ===== */
.compat-page {
  padding: 0 2px;
}

.compat-setup {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.compat-sheet {
  background: var(--am-surface-bg);
  backdrop-filter: blur(var(--am-surface-blur));
  -webkit-backdrop-filter: blur(var(--am-surface-blur));
  border: 1px solid var(--am-surface-border);
  border-radius: var(--am-surface-radius);
  box-shadow: var(--am-surface-shadow);
  padding: 16px;
}

.compat-block {
  padding: 2px 0 4px;
}

.compat-chart-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 48px;
}

.compat-chart-choice {
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: 12px 14px;
  min-height: 48px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(0, 0, 0, 0.28);
  color: #fff;
  font: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.compat-chart-choice:active {
  transform: scale(0.99);
}

.compat-chart-choice.is-active {
  border-color: rgba(232, 195, 106, 0.75);
  background: rgba(232, 195, 106, 0.1);
  box-shadow: 0 0 0 1px rgba(232, 195, 106, 0.15);
}

.compat-chart-choice-name {
  display: block;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
}

.compat-chart-choice-meta {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
  color: rgba(255, 255, 255, 0.52);
}

.compat-block-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: 10px;
}

.compat-divider {
  height: 1px;
  margin: 12px 0 10px;
  background: rgba(255, 255, 255, 0.08);
}

.compat-picker-empty {
  margin: 8px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.5);
}

.compat-picker-loading {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  padding: 4px 0 8px;
}

.compat-hub-view {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.compat-form-view {
  padding-bottom: 8px;
}

.compat-form-price-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: -2px 0 12px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.5);
}

.compat-form-price-tag {
  background: rgba(255, 215, 0, 0.13);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 20px;
  padding: 3px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #ffd700;
}

.compat-form-sub-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: -2px 0 12px;
}

.compat-form-sub-banner.hidden {
  display: none;
}

.compat-form-sub-tag {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(168, 85, 247, 0.25));
  border: 1px solid rgba(167, 139, 250, 0.45);
  border-radius: 20px;
  padding: 4px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #c084fc;
}

.compat-form-toolbar {
  margin-bottom: 10px;
}

.compat-reports-section {
  margin-top: 4px;
}

.compat-reports-empty {
  margin: 0 0 8px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.45);
  text-align: center;
  padding: 12px 8px;
}

.compat-hub-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.compat-hub-pro-link {
  display: block;
  width: 100%;
  margin: 0;
  padding: 4px 8px 0;
  border: none;
  background: none;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  color: rgba(192, 132, 252, 0.9);
  text-align: center;
  cursor: pointer;
  line-height: 1.4;
}

.compat-hub-pro-link:active {
  color: #c084fc;
}

.compat-reports-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 4px;
}

.compat-reports-list .chart-card.is-new {
  border-color: rgba(255, 215, 0, 0.45);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.12);
}

.compat-cat {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
}

.compat-cat::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(120px 88px at 10% 50%, rgba(229, 57, 53, 0.12), transparent 72%);
}

.compat-cat-glyph {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  color: #ff4d6d;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 77, 109, 0.34), rgba(110, 72, 170, 0.22) 58%, rgba(15, 12, 41, 0.4) 100%);
  border: 1px solid rgba(255, 77, 109, 0.45);
  box-shadow:
    0 0 16px rgba(229, 57, 53, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.compat-cat-glyph .compat-cat-heart {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 0 6px rgba(229, 57, 53, 0.55));
}

.compat-cat-body {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.compat-cat-title {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.compat-cat-name {
  min-width: 0;
  max-width: 46%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
}

.compat-cat-title > .compat-cat-heart {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  color: #e53935;
  filter: drop-shadow(0 0 5px rgba(229, 57, 53, 0.55));
}

.compat-cat-desc {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.62);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compat-cat-aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  min-width: 48px;
}

.compat-cat-score {
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
}

.compat-cat-new {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
  padding: 3px 7px;
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 6px;
  line-height: 1;
}

.compat-detail-view {
  padding-bottom: 0;
}

.compat-detail-toolbar {
  margin-bottom: 12px;
}

.compat-back-btn {
  border: none;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.85);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: 10px;
  cursor: pointer;
}

.compat-field-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 6px;
}

.compat-page .compat-input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px;
  min-height: 48px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font: inherit;
  font-size: 16px;
  margin-bottom: 12px;
  -webkit-appearance: none;
  appearance: none;
  color-scheme: dark;
}

.compat-page .compat-input[type="date"]::-webkit-calendar-picker-indicator,
.compat-page .compat-input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  opacity: 0.75;
}

.compat-page .compat-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
}

.compat-mode-toggle {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}

.compat-mode-btn {
  flex: 1;
  padding: 8px 6px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  color: rgba(255, 255, 255, 0.65);
  font: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.compat-mode-btn.is-active {
  color: var(--space-dark);
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
  box-shadow: 0 2px 10px rgba(255, 215, 0, 0.25);
}

.compat-suggestions {
  margin: -6px 0 10px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(15, 12, 41, 0.98);
  overflow: hidden;
  max-height: 160px;
  overflow-y: auto;
}

.compat-suggestions .suggestion-item {
  padding: 10px 12px;
  font-size: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  cursor: pointer;
}

.compat-suggestions .suggestion-item:hover {
  background: rgba(157, 80, 187, 0.2);
}

.compat-coords {
  font-size: 11px;
  color: rgba(74, 222, 128, 0.85);
  margin: 0 0 8px;
}

.compat-calc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  min-height: 50px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
  color: var(--space-dark);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
}

.compat-calc-btn-price {
  background: rgba(26, 26, 46, 0.35);
  border-radius: 20px;
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 800;
  opacity: 0.85;
}

.compat-calc-btn-price.hidden {
  display: none;
}

.compat-calc-btn:active {
  transform: scale(0.98);
}

.compat-calc-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.compat-result {
  margin-top: 8px;
}

.compat-hero-card {
  padding: 16px 14px 8px;
  border-radius: var(--am-surface-radius);
  background: var(--am-surface-bg);
  border: 1px solid var(--am-surface-border);
  backdrop-filter: blur(var(--am-surface-blur));
  -webkit-backdrop-filter: blur(var(--am-surface-blur));
  margin-bottom: 18px;
  box-shadow: var(--am-surface-shadow);
}

.compat-hero-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 4px;
  padding: 0 6px;
}

.compat-hero-kicker {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.compat-hero-pct {
  font-size: 32px;
  font-weight: 800;
  color: var(--gold-light);
  line-height: 1;
}

.compat-radar {
  width: 100%;
  max-width: 360px;
  margin: 0 auto;
}

.compat-radar-svg {
  width: 100%;
  height: auto;
  display: block;
}

.compat-section-label--spaced {
  text-align: center;
  letter-spacing: 0.2em;
  margin-bottom: 14px;
}

.compat-sphere-cards {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 22px;
}

/* Frosted panels (spheres, report, aspects) — readable over starfield */
.compat-sphere-card,
.compat-report {
  background: var(--am-surface-bg);
  border: 1px solid var(--am-surface-border);
  backdrop-filter: blur(var(--am-surface-blur));
  -webkit-backdrop-filter: blur(var(--am-surface-blur));
  box-shadow: var(--am-surface-shadow);
}

.compat-sphere-card {
  padding: 14px 14px 12px;
  border-radius: 16px;
}

.compat-sphere-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.compat-sphere-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  color: var(--gold);
}

.compat-sphere-name {
  flex: 1;
  font-size: 15px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.92);
}

.compat-sphere-pct {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-light);
}

.compat-sphere-bar {
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin-bottom: 10px;
}

.compat-sphere-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
}

.compat-sphere-bar.high span {
  background: linear-gradient(90deg, #c4a574, var(--gold));
}

.compat-sphere-bar.low span {
  background: linear-gradient(90deg, #b86b7a, #e8a0a8);
}

.compat-sphere-text {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.72);
}

.compat-report {
  padding: 18px 16px;
  border-radius: 16px;
  margin-bottom: 18px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.compat-report-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.compat-report-title {
  margin: 0;
  flex: 1;
  font-size: 20px;
  font-weight: 700;
  color: var(--gold-light);
  font-family: Georgia, "Times New Roman", serif;
}

.compat-report-score-ten {
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.85);
}

.compat-report-intro,
.compat-report-body {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.82);
  margin: 0 0 14px;
}

.compat-report-h {
  margin: 16px 0 8px;
  font-size: 16px;
  font-weight: 700;
  color: var(--gold-light);
  font-family: Georgia, "Times New Roman", serif;
}

.compat-report-list {
  margin: 0 0 8px;
  padding-left: 0;
  list-style: none;
}

.compat-report-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 10px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.82);
}

.compat-report-list li::before {
  content: "✦";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gold);
  font-size: 11px;
}

.compat-aspects-section {
  margin-top: 8px;
  margin-bottom: 20px;
  padding: 16px 14px 18px;
  border-radius: var(--am-surface-radius);
  background: var(--am-surface-bg);
  border: 1px solid var(--am-surface-border);
  backdrop-filter: blur(var(--am-surface-blur));
  -webkit-backdrop-filter: blur(var(--am-surface-blur));
  box-shadow: var(--am-surface-shadow);
}

.compat-aspects-heading {
  margin: 0 0 14px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-align: center;
  color: rgba(255, 255, 255, 0.45);
}

.compat-score-card {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 18px 16px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(36, 32, 80, 0.85) 0%, rgba(20, 16, 48, 0.9) 100%);
  border: 1px solid rgba(192, 132, 252, 0.35);
  margin-bottom: 20px;
}

.compat-score-ring {
  flex-shrink: 0;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: conic-gradient(
    var(--gold) calc(var(--score, 0) * 1%),
    rgba(255, 255, 255, 0.08) 0
  );
  position: relative;
}

.compat-score-ring::after {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: rgba(15, 12, 41, 0.92);
}

.compat-score-value,
.compat-score-label {
  position: relative;
  z-index: 1;
}

.compat-score-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--gold-light);
  line-height: 1;
}

.compat-score-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.5);
  margin-top: 4px;
}

.compat-score-copy h3 {
  margin: 0 0 8px;
  font-size: 17px;
  color: var(--gold-light);
}

.compat-score-copy p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.78);
}

.compat-section-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 10px;
}

.compat-dimensions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 22px;
}

.compat-dim-row {
  display: grid;
  grid-template-columns: 72px 1fr 36px;
  gap: 10px;
  align-items: center;
}

.compat-dim-label {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.85);
}

.compat-dim-bar {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.compat-dim-bar span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #c084fc, var(--gold));
}

.compat-dim-score {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-light);
  text-align: right;
}

.compat-highlights {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 18px;
}

.compat-highlight {
  padding: 14px;
  border-radius: var(--am-inner-radius);
  background: var(--am-inner-bg);
  border: 1px solid var(--am-inner-border);
  backdrop-filter: blur(var(--am-inner-blur));
  -webkit-backdrop-filter: blur(var(--am-inner-blur));
}

.compat-highlight.harmonious {
  border-left: 3px solid var(--success-color);
}

.compat-highlight.challenging {
  border-left: 3px solid var(--warning-color);
}

.compat-highlight-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--gold-light);
  margin-bottom: 6px;
}

.compat-highlight-text {
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.82);
  margin: 0;
}

.compat-aspect-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.compat-aspect-tab {
  flex: 1;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid var(--am-inner-border);
  background: var(--am-inner-bg);
  color: rgba(255, 255, 255, 0.65);
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.compat-aspect-tab.is-active {
  border-color: rgba(192, 132, 252, 0.5);
  color: #e9d5ff;
  background: rgba(192, 132, 252, 0.12);
}

.compat-aspects-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 0;
}

.compat-aspects-empty {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.5);
  text-align: center;
  padding: 8px 4px;
}

.compat-sub-slot {
  margin-top: 8px;
}

.compat-sub-slot .feature-card {
  margin-top: 12px;
}

/* ===== Состояния загрузки и ошибок ===== */
.hidden {
  display: none !important;
}

.loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-top: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.loading-text {
  font-size: 10px;
  color: var(--text-muted);
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  flex-shrink: 0;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.error {
  background: linear-gradient(
    135deg,
    rgba(248, 113, 113, 0.2) 0%,
    rgba(220, 38, 38, 0.15) 100%
  );
  color: #fca5a5;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(248, 113, 113, 0.3);
  margin-top: 8px;
  font-size: 10px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
  line-height: 1.3;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.error::before {
  content: '⚠️';
  font-size: 14px;
  flex-shrink: 0;
}

.no-data {
  text-align: center;
  padding: 30px 16px;
  color: var(--text-muted);
  font-style: italic;
  font-size: 12px;
}

/* ── Cosmic loader (AmLoader) ─────────────────────────────────────────────
   Общий компонент ожидания для мест, где идёт настоящая генерация (расчёт
   карты/транзитов/совместимости + LLM-разбор): три золотые звезды вращаются
   по орбите вокруг мерцающего ядра, под ними — переключающийся текст стадии
   загрузки. Приходит на смену голому border-spin «бублику».
   Разметка — через JS: window.AmLoader.markup() (core/am-loader.js). */

.am-loader {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  padding: 32px 16px;
  text-align: center;
}

.am-loader--inline {
  flex-direction: row;
  gap: 10px;
  padding: 10px;
}

.am-loader-orbit {
  position: relative;
  width: 56px;
  height: 56px;
  flex-shrink: 0;
  animation: am-loader-spin 2.6s linear infinite;
}

.am-loader--inline .am-loader-orbit {
  width: 22px;
  height: 22px;
}

.am-loader-core {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 10px;
  height: 10px;
  margin: -5px 0 0 -5px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.95) 0%, rgba(255, 215, 0, 0) 72%);
  animation: am-loader-pulse 2.6s ease-in-out infinite;
}

.am-loader--inline .am-loader-core {
  width: 6px;
  height: 6px;
  margin: -3px 0 0 -3px;
}

.am-loader-star-slot {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
}

.am-loader-star-slot--1 { transform: rotate(0deg) translate(26px); }
.am-loader-star-slot--2 { transform: rotate(120deg) translate(26px); }
.am-loader-star-slot--3 { transform: rotate(240deg) translate(26px); }

.am-loader--inline .am-loader-star-slot--1 { transform: rotate(0deg) translate(10px); }
.am-loader--inline .am-loader-star-slot--2 { transform: rotate(120deg) translate(10px); }
.am-loader--inline .am-loader-star-slot--3 { transform: rotate(240deg) translate(10px); }

/* Контр-вращение держит глиф звезды «вертикально», пока вся орбита крутится */
.am-loader-star-counter {
  display: block;
  animation: am-loader-spin-reverse 2.6s linear infinite;
}

.am-loader-star {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  margin: -8px 0 0 -8px;
  font-size: 13px;
  line-height: 1;
  color: var(--gold);
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.6));
  animation: am-loader-twinkle 1.3s ease-in-out infinite;
  transform-origin: center;
}

.am-loader-star-svg {
  display: block;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
}

.am-loader-star-slot--2 .am-loader-star {
  color: var(--gold-light);
  animation-delay: 0.35s;
}

.am-loader-star-slot--2 .am-loader-star-svg {
  width: 12px;
  height: 12px;
}

.am-loader-star-slot--3 .am-loader-star {
  color: var(--pro-lavender, #c084fc);
  animation-delay: 0.7s;
  filter: drop-shadow(0 0 6px rgba(192, 132, 252, 0.55));
}

.am-loader-star-slot--3 .am-loader-star-svg {
  width: 13px;
  height: 13px;
}

/* Совместимость («Пара»): те же орбиты, но сердечки вместо звёзд */
.am-loader--hearts .am-loader-core {
  background: radial-gradient(circle, rgba(244, 114, 182, 0.9) 0%, rgba(244, 114, 182, 0) 72%);
}

.am-loader--hearts .am-loader-star {
  font-size: 14px;
  color: #f472b6;
  filter: drop-shadow(0 0 7px rgba(244, 114, 182, 0.65));
}

.am-loader--hearts .am-loader-star-slot--2 .am-loader-star {
  font-size: 11px;
  color: var(--gold-light);
  filter: drop-shadow(0 0 6px rgba(255, 229, 93, 0.55));
}

.am-loader--hearts .am-loader-star-slot--3 .am-loader-star {
  font-size: 12px;
  color: var(--pro-lavender, #c084fc);
  filter: drop-shadow(0 0 6px rgba(192, 132, 252, 0.55));
}

.am-loader--inline .am-loader-star { font-size: 8px; }
.am-loader--inline .am-loader-star-svg,
.am-loader--inline .am-loader-star-slot--2 .am-loader-star-svg,
.am-loader--inline .am-loader-star-slot--3 .am-loader-star-svg {
  width: 9px;
  height: 9px;
}

.am-loader-text {
  margin: 0;
  max-width: min(100%, 300px);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: 0.03em;
  font-feature-settings: "kern" 1;
  color: rgba(255, 248, 235, 0.94);
  text-shadow:
    0 0 22px rgba(255, 215, 0, 0.22),
    0 0 40px rgba(192, 132, 252, 0.12),
    0 1px 3px rgba(15, 12, 41, 0.55);
  min-height: 21px;
  transition: opacity 0.26s ease, transform 0.26s ease, filter 0.26s ease;
  animation: am-loader-text-glow 3.2s ease-in-out infinite;
}

.am-loader--inline .am-loader-text {
  max-width: none;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-align: left;
  animation: none;
}

.am-loader--hearts .am-loader-text {
  color: rgba(255, 240, 248, 0.95);
  text-shadow:
    0 0 20px rgba(244, 114, 182, 0.35),
    0 0 36px rgba(255, 215, 0, 0.14),
    0 1px 3px rgba(15, 12, 41, 0.55);
  animation: am-loader-text-glow-hearts 3.2s ease-in-out infinite;
}

.am-loader-text.is-swapping {
  opacity: 0;
  transform: translateY(5px);
  filter: blur(2px);
}

@keyframes am-loader-text-glow {
  0%, 100% {
    text-shadow:
      0 0 18px rgba(255, 215, 0, 0.18),
      0 0 32px rgba(192, 132, 252, 0.1),
      0 1px 3px rgba(15, 12, 41, 0.55);
  }
  50% {
    text-shadow:
      0 0 26px rgba(255, 215, 0, 0.32),
      0 0 44px rgba(192, 132, 252, 0.18),
      0 1px 3px rgba(15, 12, 41, 0.55);
  }
}

@keyframes am-loader-text-glow-hearts {
  0%, 100% {
    text-shadow:
      0 0 16px rgba(244, 114, 182, 0.28),
      0 0 30px rgba(255, 215, 0, 0.1),
      0 1px 3px rgba(15, 12, 41, 0.55);
  }
  50% {
    text-shadow:
      0 0 24px rgba(244, 114, 182, 0.42),
      0 0 38px rgba(255, 215, 0, 0.16),
      0 1px 3px rgba(15, 12, 41, 0.55);
  }
}

@keyframes am-loader-spin { to { transform: rotate(360deg); } }
@keyframes am-loader-spin-reverse { to { transform: rotate(-360deg); } }

@keyframes am-loader-pulse {
  0%, 100% { transform: scale(0.75); opacity: 0.55; }
  50%      { transform: scale(1.35); opacity: 1; }
}

@keyframes am-loader-twinkle {
  0%, 100% { opacity: 0.35; transform: scale(0.75); }
  50%      { opacity: 1; transform: scale(1.1); }
}

@media (prefers-reduced-motion: reduce) {
  .am-loader-orbit,
  .am-loader-star-counter,
  .am-loader-core,
  .am-loader-star,
  .am-loader-text {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
  .am-loader-text.is-swapping { filter: none; }
}

/* ===== Анимации при загрузке ===== */
@keyframes fadeIn {
  from {
    opacity: 1;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card {
  animation: fadeIn 0.3s ease-out;
  opacity: 1 !important;
}

.planet-card-page:nth-child(1) { animation-delay: 0s; }
.planet-card-page:nth-child(2) { animation-delay: 0.03s; }
.planet-card-page:nth-child(3) { animation-delay: 0.06s; }
.planet-card-page:nth-child(4) { animation-delay: 0.09s; }
.planet-card-page:nth-child(5) { animation-delay: 0.12s; }
.planet-card-page:nth-child(6) { animation-delay: 0.15s; }
.planet-card-page:nth-child(7) { animation-delay: 0.18s; }
.planet-card-page:nth-child(8) { animation-delay: 0.21s; }
.planet-card-page:nth-child(9) { animation-delay: 0.24s; }
.planet-card-page:nth-child(10) { animation-delay: 0.27s; }

.feature-card {
  animation: fadeIn 0.3s ease-out;
}

.feature-card:nth-child(1) { animation-delay: 0s; }
.feature-card:nth-child(2) { animation-delay: 0.05s; }
.feature-card:nth-child(3) { animation-delay: 0.1s; }
.feature-card:nth-child(4) { animation-delay: 0.15s; }

/* ===== Особые эффекты ===== */
/* Звёздный фон */
/* ВРЕМЕННО ОТКЛЮЧЕНО: Эффект звезд (для просмотра чистого фона)
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: 
    radial-gradient(2px 2px at 20px 30px, white, transparent),
    radial-gradient(2px 2px at 60px 70px, white, transparent),
    radial-gradient(1px 1px at 50px 50px, white, transparent),
    radial-gradient(1px 1px at 130px 80px, white, transparent),
    radial-gradient(2px 2px at 90px 10px, white, transparent);
  background-size: 200px 200px;
  background-repeat: repeat;
  opacity: 0.4;
  pointer-events: none;
  z-index: -1;
  animation: twinkle 3s ease-in-out infinite;
}
*/

/* ВРЕМЕННО ОТКЛЮЧЕНО: Анимация звезд
@keyframes twinkle {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.6; }
}
*/

/* Плавное мерцание для заголовка */
@keyframes shimmer {
  0% {
    background-position: -1000px 0;
  }
  100% {
    background-position: 1000px 0;
  }
}

.app-title {
  background-size: 2000px 100%;
  animation: shimmer 3s ease-in-out infinite;
}

/* ===== NATAL CHART PAGE ===== */
.app-branding {
  text-align: center;
  margin-bottom: 24px;
  padding: 16px 0;
}

.brand-title {
  font-size: 28px;
  font-weight: 700;
  background: linear-gradient(135deg, var(--gold) 0%, var(--gold-light) 50%, var(--gold) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.brand-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.header-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  margin-top: 8px;
  margin-bottom: 4px;
  width: 100%;
  min-height: 60px; /* Минимальная высота для размещения кнопки */
}

.user-info {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  position: relative;
  z-index: 1;
  margin: 0 auto;
  text-align: center;
}

.user-profile-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--am-surface-bg);
  backdrop-filter: blur(var(--am-surface-blur));
  -webkit-backdrop-filter: blur(var(--am-surface-blur));
  will-change: backdrop-filter;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: var(--am-surface-radius);
  padding: 10px 12px;
  max-width: fit-content;
  width: auto;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  transition: all 0.3s ease;
}

.user-profile-container:hover {
  border-color: rgba(255, 215, 0, 0.4);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.2);
  transform: translateY(-2px);
}

.user-profile-container.demo-mode {
  border-color: rgba(251, 191, 36, 0.3);
}

.user-balance-badge {
  display: flex;
  align-items: center;
  gap: 4px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.18) 0%, rgba(218, 165, 32, 0.12) 100%);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 20px;
  padding: 4px 10px;
  white-space: nowrap;
  flex-shrink: 0;
}

.balance-icon {
  color: var(--gold, #ffd700);
  font-size: 12px;
  line-height: 1;
}

.balance-amount {
  color: var(--gold, #ffd700);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.user-balance-badge {
  cursor: pointer;
}

.user-balance-badge:hover {
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.28) 0%, rgba(218, 165, 32, 0.2) 100%);
  border-color: rgba(255, 215, 0, 0.6);
  transform: translateY(-1px);
}

.user-balance-badge:active {
  transform: scale(0.96);
}

.user-balance-badge.balance-error {
  opacity: 0.4;
}

.user-profile-photo {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
}

.user-profile-placeholder {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cosmic-purple) 0%, var(--deep-purple) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  border: 2px solid rgba(255, 215, 0, 0.3);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  text-transform: uppercase;
}

.user-profile-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex-shrink: 1;
}

.user-profile-username {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  line-height: 1.2;
}

.user-profile-name {
  font-size: 12px;
  font-weight: 500;
  color: #ffffff;
  text-overflow: ellipsis;
  overflow: hidden;
  white-space: nowrap;
  line-height: 1.2;
}

.user-profile-id {
  font-size: 10px;
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.2;
}

.user-profile-info-btn {
  width: 32px;
  height: 32px;
  min-width: 32px;
  min-height: 32px;
  font-size: 14px;
  flex-shrink: 0;
  margin-left: 4px;
}

@media (max-width: 480px) {
  .user-profile-container {
    padding: 8px 10px;
    gap: 8px;
  }
  
  .user-profile-photo,
  .user-profile-placeholder {
    width: 40px;
    height: 40px;
    font-size: 16px;
  }
  
  .user-profile-username {
    font-size: 12px;
  }
  
  .user-profile-name {
    font-size: 11px;
  }
  
  .user-profile-id {
    font-size: 9px;
  }
  
  .user-profile-info-btn {
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    font-size: 12px;
  }
}

/* ===== NATAL CHART FORM ===== */

/* Предотвращаем автоматическую прокрутку и зум при фокусе на input полях */
.chart-page input,
.chart-page textarea,
.chart-page select {
  scroll-margin-top: 0 !important;
  scroll-margin-bottom: 0 !important;
  -webkit-overflow-scrolling: touch;
}

/* Отключаем автоматическую прокрутку при фокусе */
html {
  scroll-behavior: auto;
  height: 100%;
  width: 100%;
  overflow-x: hidden;
}

/* Предотвращаем зум на iOS Safari при фокусе */
@media screen and (max-width: 768px) {
  .chart-page input[type="text"],
  .chart-page input[type="date"],
  .chart-page input[type="time"],
  .chart-page input[type="email"],
  .chart-page input[type="tel"],
  .chart-page textarea,
  .chart-page select {
    font-size: 16px !important; /* Минимум 16px предотвращает зум на iOS */
    transform: none !important;
    zoom: 1 !important;
    -webkit-transform: none !important;
  }
}

.form-section {
  background: rgba(48, 43, 99, 0.35);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  will-change: backdrop-filter;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  border: 1px solid rgba(157, 80, 187, 0.3);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 16px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.section-icon {
  font-size: 20px;
}

.section-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-light);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-group {
  margin-bottom: 16px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
}

.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 14px 12px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  color: #ffffff;
  font-size: 16px; /* Минимум 16px для предотвращения зума на iOS */
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  height: 48px;
  box-sizing: border-box;
  transform: none !important;
  zoom: 1 !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
  /* Предотвращаем автоматическую прокрутку и зум на мобильных */
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Специфичные стили для полей date и time */
.form-input[type="date"],
.form-input[type="time"] {
  padding: 12px;
  line-height: 1.2;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Цвет для date/time пикеров */
.form-input[type="date"]::-webkit-calendar-picker-indicator,
.form-input[type="time"]::-webkit-calendar-picker-indicator {
  filter: invert(1);
  cursor: pointer;
}

.form-input:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 10px rgba(255, 215, 0, 0.2);
  transform: none !important;
  zoom: 1 !important;
  -webkit-transform: none !important;
  -moz-transform: none !important;
}

.form-input::placeholder {
  color: rgba(255, 255, 255, 0.3);
}

.form-hint {
  display: block;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
}

.suggestions {
  position: relative;
  max-height: 200px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.7);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  margin-top: 4px;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.suggestion-item {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  transition: background 0.2s ease;
}

.suggestion-item:hover {
  background: rgba(255, 215, 0, 0.1);
}

.suggestion-item:last-child {
  border-bottom: none;
}

.coords-info {
  font-size: 12px;
  color: var(--success-color);
  margin-top: 6px;
}

.btn-primary {
  flex: 1;
  padding: 14px 24px;
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
  border: none;
  border-radius: 12px;
  color: var(--space-dark);
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(255, 215, 0, 0.3);
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.5);
}

.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  flex: 1;
  padding: 14px 24px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  color: #ffffff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 255, 255, 0.3);
}

.btn-new-chart {
  width: 100%;
  padding: 14px 20px;
  background: var(--am-surface-bg);
  border: 2px dashed var(--gold);
  border-radius: var(--am-surface-radius);
  color: var(--gold);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  margin: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  backdrop-filter: blur(var(--am-surface-blur));
  -webkit-backdrop-filter: blur(var(--am-surface-blur));
  box-shadow: var(--am-surface-shadow);
}

.btn-new-chart-label {
  min-width: 0;
  text-align: left;
}

.btn-new-chart-badge {
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  color: #ffd700;
  white-space: nowrap;
  flex-shrink: 0;
}

.btn-new-chart-badge--pro {
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.35), rgba(168, 85, 247, 0.25));
  border-color: rgba(167, 139, 250, 0.45);
  color: #c084fc;
}

.btn-new-chart:active {
  transform: scale(0.98);
  background: rgba(255, 215, 0, 0.2);
}

.btn-new-chart:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: var(--text-primary);
  font-size: 20px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

/* Charts list */
.charts-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

/* ===== Просмотр открытой натальной карты (первичный вид) ===== */

.natal-detail-view {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 8px;
}

.natal-detail-name {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--gold-light);
  letter-spacing: 0.01em;
}

.natal-meta-card {
  padding: 4px 14px;
  background:
    linear-gradient(135deg, rgba(88, 28, 135, 0.14) 0%, rgba(30, 27, 75, 0.1) 100%),
    rgba(16, 13, 36, 0.78);
}

.natal-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 0;
  border-bottom: 1px solid var(--am-inner-border);
}

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

.natal-meta-label {
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.42);
}

.natal-meta-value {
  text-align: right;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.9);
}

.natal-detail-block {
  margin-top: 20px;
}

.natal-detail-data > .natal-detail-block:first-child {
  margin-top: 8px;
}

.natal-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px 0;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 215, 0, 0.12);
}

.natal-section-head::before {
  content: '';
  width: 3px;
  height: 20px;
  border-radius: 2px;
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--gold-light) 0%, var(--gold-dark) 100%);
  box-shadow: 0 0 12px rgba(255, 215, 0, 0.35);
}

.natal-section-label {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  color: var(--gold-light);
  text-shadow: 0 0 18px rgba(255, 215, 0, 0.15);
}

.natal-pos-list,
.natal-aspects-list {
  margin-top: 0;
}

.natal-pos-list {
  display: grid;
  gap: 14px;
}

.natal-pos {
  display: flex;
  align-items: flex-start;
  gap: 16px;
}

.natal-pos-card {
  border-left: 3px solid rgba(255, 215, 0, 0.35);
}

.natal-pos-glyph {
  width: 52px;
  height: 52px;
  margin-top: 2px;
  border-radius: 50%;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-size: 22px;
  line-height: 1;
  color: var(--gold);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 215, 0, 0.32), rgba(110, 72, 170, 0.22) 58%, rgba(15, 12, 41, 0.4) 100%);
  border: 1px solid rgba(255, 215, 0, 0.42);
  box-shadow:
    0 0 16px rgba(255, 215, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.natal-pos-glyph img {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.natal-pos-glyph--sym span {
  font-size: 22px;
  line-height: 1;
  font-family: 'Segoe UI Symbol', 'Noto Sans Symbols2', serif;
  color: var(--gold-light);
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.45));
}

.natal-pos-glyph--angle span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold);
}

.natal-transit-glyph {
  font-family: 'Segoe UI Symbol', 'Noto Sans Symbols2', serif;
  font-size: 18px;
  line-height: 1;
  color: var(--gold-light);
}

.natal-pos-body {
  flex: 1;
  min-width: 0;
}

.natal-pos-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold-light);
  line-height: 1.3;
  margin-bottom: 7px;
}

/* Компактные пилюли — как бейдж «Pro» на кнопке новой карты */
.natal-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
}

.natal-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 10px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.natal-pill--position {
  color: var(--gold);
  background: rgba(255, 215, 0, 0.12);
  border-color: rgba(255, 215, 0, 0.38);
}

/* Знак зодиака — цвет по стихии (огонь / земля / воздух / вода) */
.natal-pill--el-fire {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.13);
  border-color: rgba(248, 113, 113, 0.42);
}

.natal-pill--el-earth {
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(74, 222, 128, 0.38);
}

.natal-pill--el-air {
  color: #fde68a;
  background: rgba(250, 204, 21, 0.1);
  border-color: rgba(253, 224, 71, 0.38);
}

.natal-pill--el-water {
  color: #7dd3fc;
  background: rgba(59, 130, 246, 0.13);
  border-color: rgba(125, 211, 252, 0.4);
}

.natal-pill--house {
  color: var(--pro-lavender);
  background: rgba(124, 58, 237, 0.18);
  border-color: rgba(167, 139, 250, 0.42);
}

.natal-pill--retro {
  color: #fdba74;
  min-width: auto;
  padding: 2px 7px;
  font-size: 10px;
  background: rgba(249, 115, 22, 0.14);
  border-color: rgba(251, 146, 60, 0.45);
}

.natal-pos-card .chart-card-inner {
  padding: 13px 14px;
  background: linear-gradient(120deg, rgba(255, 255, 255, 0.04) 0%, transparent 58%);
}

.natal-pos-card.clickable:active .chart-card-inner {
  background: rgba(0, 0, 0, 0.12);
}

.transit-symbol--img {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
}

.transit-symbol--img img {
  width: 22px;
  height: 22px;
  object-fit: contain;
}

.chart-page .chart-visualization {
  margin-bottom: 0;
  padding: 14px;
  background:
    linear-gradient(135deg, rgba(88, 28, 135, 0.12) 0%, rgba(30, 27, 75, 0.08) 100%),
    rgba(16, 13, 36, 0.8);
  border: 1px solid var(--am-surface-border);
  box-shadow: var(--am-surface-shadow);
}

.chart-viz-kicker {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.38);
  margin-bottom: 2px;
}

.chart-page .chart-viz-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
}

.chart-viz-title-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.chart-page .chart-svg-container {
  margin-top: 4px;
  padding: 12px 8px;
  background: rgba(10, 8, 24, 0.65);
  border: 1px solid var(--am-inner-border);
  border-radius: var(--am-inner-radius);
}

/* ===== Swipe-to-delete ===== */

/* Внешняя обёртка — только для анимации collapse при удалении */
.chart-card-swipe-wrapper {
  /* намеренно пустая — overflow/clip на самой карточке */
}

.chart-card {
  position: relative;
  overflow: hidden;            /* клипает sliding-inner и delete-bg */
  background: var(--am-surface-bg);
  border: 1px solid var(--am-surface-border);
  border-radius: var(--am-surface-radius);
  backdrop-filter: blur(var(--am-surface-blur));
  -webkit-backdrop-filter: blur(var(--am-surface-blur));
  box-shadow: var(--am-surface-shadow);
  opacity: 1 !important;
  cursor: pointer;
  /* НЕТ transform здесь — transform только на chart-card-inner */
}

/* Внутренний контент — именно он сдвигается при свайпе */
.chart-card-inner {
  padding: 16px;
  will-change: transform;
  transform: translateX(0);
  position: relative;
  z-index: 1;
  /* Непрозрачный фон — полностью перекрывает delete-bg в исходном положении */
  background: transparent;
  border-radius: var(--am-surface-radius);
}

.chart-card-inner:active:not(.chart-card-inner--swiped) {
  background: rgba(0, 0, 0, 0.12);
}

/* Красная шторка — абсолютно внутри .chart-card, z-index ниже inner */
.chart-card-delete-bg {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 80px;
  background: linear-gradient(135deg, #c0392b 0%, #e53e3e 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  z-index: 0;
  user-select: none;
  -webkit-user-select: none;
}

.chart-card-delete-bg svg {
  width: 22px;
  height: 22px;
  color: #fff;
  flex-shrink: 0;
}

.chart-card-delete-bg span {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.85);
  letter-spacing: 0.04em;
}

.natal-cat {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
}

.natal-cat::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(120px 88px at 10% 50%, rgba(255, 215, 0, 0.1), transparent 72%);
}

.natal-cat-glyph {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  color: var(--gold);
  font-size: 22px;
  line-height: 1;
  font-variant-emoji: text;
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 215, 0, 0.32), rgba(110, 72, 170, 0.22) 58%, rgba(15, 12, 41, 0.4) 100%);
  border: 1px solid rgba(255, 215, 0, 0.42);
  box-shadow:
    0 0 16px rgba(255, 215, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.natal-cat-glyph svg {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.45));
}

.natal-cat-body {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.natal-cat-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.natal-cat-desc {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.62);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.natal-cat-aside {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  min-width: 52px;
  line-height: 1.15;
}

.natal-cat-day {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
}

.natal-cat-month {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 600;
  color: var(--gold-light);
  text-transform: lowercase;
}

.natal-cat-year {
  margin-top: 1px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.42);
  font-variant-numeric: tabular-nums;
}

/* ========================== */

.chart-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.chart-card-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
}

.chart-card-date {
  font-size: 14px;
  color: var(--text-secondary);
}

.chart-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-top: 8px;
}

.chart-card-detail {
  font-size: 13px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.chart-card-detail span:first-child {
  opacity: 0.7;
}

/* Chart display */
.chart-info {
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  margin-bottom: 16px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.chart-info p {
  margin: 6px 0;
  font-size: 14px;
}

.key-points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.key-point {
  padding: 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.key-point .label {
  font-size: 13px;
  color: var(--text-muted);
}

.key-point .value {
  font-size: 14px;
  font-weight: 600;
  color: var(--gold-light);
}

.planets-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.planet-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  transition: all 0.2s ease;
  cursor: pointer;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.planet-item:hover {
  background: rgba(0, 0, 0, 0.3);
  transform: translateX(4px);
}

.planet-symbol {
  font-size: 20px;
  width: 28px;
  text-align: center;
}

.planet-name {
  font-size: 14px;
  font-weight: 600;
  min-width: 80px;
}

.planet-position {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: auto;
}

.aspects-list {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.aspect-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  font-size: 13px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.aspect-item.harmonious {
  border-left: 3px solid var(--success-color);
}

.aspect-item.hard {
  border-left: 3px solid var(--error-color);
}

.aspect-item.neutral {
  border-left: 3px solid var(--warning-color);
}

.aspect-item .orb {
  font-size: 12px;
  color: var(--text-muted);
}

@media (max-width: 600px) {
  .key-points {
    grid-template-columns: 1fr;
  }
}

/* ===== TRANSITS PAGE ===== */
.section-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--gold-light);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.transits-list {
  display: grid;
  gap: 12px;
}

.transit-card {
  position: relative;
  padding: 14px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  overflow: hidden;
}

.transit-card.important-tone,
.transit-card:not(.harmonious):not(.challenging) {
  border-left: 3px solid var(--gold);
}

.transit-card:hover {
  transform: translateX(3px);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
}

.transit-card:active {
  transform: translateX(1px);
}

.transit-header {
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 10px;
}

.transit-planets {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.transit-symbol,
.natal-symbol {
  font-size: 20px;
}

.transit-planet-name,
.natal-planet-name {
  font-size: 14px;
  font-weight: 600;
}

.transit-aspect {
  font-size: 13px;
  color: var(--gold-light);
  padding: 2px 8px;
  background: rgba(255, 215, 0, 0.1);
  border-radius: 4px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.transit-importance {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.transit-new-corner {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--space-dark);
  padding: 4px 9px 4px 7px;
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 55%, var(--gold-light) 100%);
  border: none;
  border-radius: 999px;
  line-height: 1;
  pointer-events: none;
  box-shadow: 0 2px 10px rgba(255, 215, 0, 0.35);
}

.transit-new-corner-glyph {
  font-size: 9px;
  transform: translateY(-0.5px);
}

.transit-card--locked .transit-new-corner {
  z-index: 5;
}

.transit-card--new {
  box-shadow:
    var(--am-surface-shadow, 0 4px 20px rgba(15, 12, 41, 0.4)),
    inset 0 0 0 1px rgba(255, 215, 0, 0.12);
}

.importance-badge {
  font-size: 14px;
  color: var(--gold);
}

.character-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
  margin: 8px 0;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.character-badge.harmonious-badge {
  background: rgba(74, 222, 128, 0.15);
  color: var(--success-color);
  border: 1px solid rgba(74, 222, 128, 0.3);
}

.character-badge.challenging-badge {
  background: rgba(251, 191, 36, 0.15);
  color: var(--warning-color);
  border: 1px solid rgba(251, 191, 36, 0.3);
}

.transit-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.transit-details .detail {
  padding: 4px 8px;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 4px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

/* Paywall CTA / Pro nudge / locked item — built in transits/ui.js */

.sub-nudge {
  display: flex;
  align-items: center;
  gap: 10px;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.2), rgba(168, 85, 247, 0.12));
  border: 1px solid rgba(167, 139, 250, 0.35);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.sub-nudge-icon {
  font-size: 20px;
}
.sub-nudge-text {
  flex: 1;
  min-width: 0;
}
.sub-nudge-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
}
.sub-nudge-desc {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.5);
}
.sub-nudge-more {
  background: rgba(167, 139, 250, 0.2);
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: #c084fc;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  white-space: nowrap;
}
.sub-nudge-close {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.35);
  font-size: 16px;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
}

.transit-pack-cta {
  background: linear-gradient(135deg, rgba(157, 80, 187, 0.25) 0%, rgba(79, 172, 254, 0.2) 100%);
  border: 1px solid rgba(157, 80, 187, 0.4);
  border-radius: 16px;
  padding: 24px 16px;
  margin-bottom: 14px;
  text-align: center;
}
.transit-pack-cta-emoji {
  font-size: 36px;
  margin-bottom: 10px;
}
.transit-pack-cta-title {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 6px;
}
.transit-pack-cta-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
  margin-bottom: 18px;
  line-height: 1.5;
}
.transit-pack-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #b8860b 0%, #ffd700 100%);
  color: #1a1a2e;
  font-size: 15px;
  font-weight: 700;
  padding: 13px 28px;
  border-radius: 14px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(255, 215, 0, 0.28);
}
.transit-pack-cta-sub {
  margin-top: 14px;
}
.transit-pack-cta-sub-btn {
  background: none;
  border: 1px solid rgba(167, 139, 250, 0.4);
  color: rgba(167, 139, 250, 0.8);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 8px;
  cursor: pointer;
}

.transit-card--locked {
  position: relative;
  overflow: hidden;
  cursor: pointer;
  isolation: isolate;
}
.transit-card-locked-blur {
  filter: blur(3px);
  pointer-events: none;
  user-select: none;
  position: relative;
  z-index: 0;
}
.transit-card-unlock {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(10, 8, 30, 0.5);
  border-radius: inherit;
  pointer-events: none;
}
.transit-card--locked .transit-card-unlock-badge {
  pointer-events: auto;
}
.transit-card-unlock-badge {
  background: linear-gradient(135deg, #b8860b 0%, #ffd700 100%);
  color: #1a1a2e;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 14px;
  border-radius: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 2px 10px rgba(255, 215, 0, 0.3);
}

@media (max-width: 600px) {
  .transit-header {
    flex-direction: column;
    align-items: flex-start;
  }
  
  .transit-planets {
    font-size: 13px;
  }
  
  .transit-symbol,
  .natal-symbol {
    font-size: 18px;
  }
}

/* ===== FULLSCREEN CHART OVERLAY ===== */
.fullscreen-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(15, 12, 41, 0.95);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  will-change: backdrop-filter;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.3s ease-in-out;
  overflow: hidden;
}

.fullscreen-overlay.hidden {
  display: none;
}

.fullscreen-content {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  position: relative;
  z-index: 1;
  background: transparent;
}

.fullscreen-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: rgba(0, 0, 0, 0.3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: max(16px, calc(env(safe-area-inset-top) + 16px));
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.btn-close-fullscreen {
  width: 44px;
  height: 44px;
  padding: 0;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: var(--gold);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-close-fullscreen:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: scale(1.1);
}

.fullscreen-chart-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  text-align: center;
  flex: 1;
}

.fullscreen-chart-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  overflow: auto;
  min-height: 0; /* Важно для flex контейнеров */
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
  background: transparent;
}

.fullscreen-chart-svg-container {
  width: 100%;
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  min-height: 0;
}

.fullscreen-chart-svg-container svg {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
}

/* ===== CHART VISUALIZATION ===== */
.chart-visualization {
  margin-bottom: 20px;
  background: linear-gradient(
    135deg,
    rgba(15, 12, 41, 0.5) 0%,
    rgba(48, 43, 99, 0.35) 100%
  );
  border-radius: 16px;
  padding: 16px;
  border: 1px solid rgba(255, 215, 0, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  will-change: backdrop-filter;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.chart-viz-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.chart-viz-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  font-weight: 600;
  color: var(--gold-light);
}

.btn-fullscreen-chart {
  width: 36px;
  height: 36px;
  padding: 0;
  background: rgba(255, 215, 0, 0.1);
  border: 1px solid rgba(255, 215, 0, 0.3);
  border-radius: 8px;
  color: var(--gold);
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-fullscreen-chart:hover {
  background: rgba(255, 215, 0, 0.2);
  border-color: var(--gold);
  transform: scale(1.1);
}

.chart-svg-container {
  width: 100%;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.chart-svg {
  width: 100%;
  height: auto;
  max-width: 500px;
}

/* SVG Chart Elements */
.chart-planet {
  cursor: pointer;
  transition: opacity 0.2s ease;
}

.chart-planet:hover {
  opacity: 0.8;
}

.planet-glyph {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  dominant-baseline: middle;
  user-select: none;
}

.aspect-line {
  stroke-width: 1;
  opacity: 0.4;
  transition: opacity 0.2s ease;
}

.aspect-line.harmonious {
  stroke: var(--success-color);
}

.aspect-line.hard {
  stroke: var(--error-color);
}

.aspect-line.neutral {
  stroke: var(--warning-color);
}

.aspect-line:hover {
  opacity: 0.8;
  stroke-width: 1.5;
}

.chart-center-info {
  pointer-events: none;
  user-select: none;
}

/* Info Button */
.info-button {
  width: 36px;
  height: 36px;
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  background: rgba(255, 215, 0, 0.15);
  border: 2px solid rgba(255, 215, 0, 0.4);
  border-radius: 50%;
  color: var(--gold);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 1000;
  pointer-events: auto !important;
  -webkit-tap-highlight-color: rgba(255, 215, 0, 0.3);
  touch-action: manipulation;
  flex-shrink: 0;
}

.info-button:hover {
  background: rgba(255, 215, 0, 0.25);
  border-color: var(--gold);
  transform: scale(1.15);
  box-shadow: 0 0 15px rgba(255, 215, 0, 0.4);
}

.info-button:active {
  transform: scale(0.9);
  background: rgba(255, 215, 0, 0.4);
  border-color: var(--gold);
}

.page-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
  z-index: 1000;
  flex-shrink: 0;
}

/* Responsive adjustments for fullscreen */
@media (max-width: 768px) {
  .fullscreen-chart-title {
    font-size: 18px;
  }
  
  .fullscreen-chart-wrapper {
    padding: 10px;
  }
  
  .chart-svg {
    max-width: 100%;
  }
}

/* User info - дублирующее определение удалено, используется выше */

/* Transit categories grid */

/* ===== Transit chart selector ===== */
.transit-chart-selector {
  margin-bottom: 16px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 12px 14px 10px;
}

.transit-chart-selector-label {
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
  margin-bottom: 10px;
}

/* Обёртка с fade-эффектом справа при наличии скролла */
.transit-chart-pills-wrap {
  position: relative;
  --fade-opacity: 1;
}

.transit-chart-pills-wrap::after {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 100%;
  background: linear-gradient(to right, transparent, rgba(15, 12, 41, 0.9));
  pointer-events: none;
  opacity: var(--fade-opacity);
  transition: opacity 0.2s;
}

.transit-chart-pills {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 2px;
  padding-right: 32px; /* место под fade */
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.transit-chart-pills::-webkit-scrollbar {
  display: none;
}

.transit-chart-pill {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 5px 13px;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.55);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  -webkit-tap-highlight-color: transparent;
}

.transit-chart-pill:active {
  transform: scale(0.95);
}

.transit-chart-pill.active {
  border-color: rgba(157, 80, 187, 0.65);
  background: linear-gradient(135deg, rgba(157, 80, 187, 0.22) 0%, rgba(79, 172, 254, 0.18) 100%);
  color: #fff;
  box-shadow: 0 0 10px rgba(157, 80, 187, 0.25);
}

/* ===================================== */

.transit-categories-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
  margin-bottom: 16px;
  position: relative;
  z-index: 1;
}

.transit-cat {
  display: flex;
  align-items: center;
  gap: 14px;
  overflow: hidden;
}

.transit-cat::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-radius: inherit;
  background: radial-gradient(120px 88px at 10% 50%, rgba(255, 215, 0, 0.1), transparent 72%);
}

.transit-category-card[data-category="harmonious"] .transit-cat::before {
  background: radial-gradient(120px 88px at 10% 50%, rgba(74, 222, 128, 0.1), transparent 72%);
}

.transit-category-card[data-category="challenging"] .transit-cat::before {
  background: radial-gradient(120px 88px at 10% 50%, rgba(251, 191, 36, 0.1), transparent 72%);
}

.transit-cat-glyph {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  color: var(--gold);
  background:
    radial-gradient(circle at 32% 28%, rgba(255, 215, 0, 0.32), rgba(110, 72, 170, 0.22) 58%, rgba(15, 12, 41, 0.4) 100%);
  border: 1px solid rgba(255, 215, 0, 0.42);
  box-shadow:
    0 0 16px rgba(255, 215, 0, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.transit-category-card[data-category="harmonious"] .transit-cat-glyph {
  background:
    radial-gradient(circle at 32% 28%, rgba(74, 222, 128, 0.28), rgba(110, 72, 170, 0.2) 58%, rgba(15, 12, 41, 0.4) 100%);
  border-color: rgba(74, 222, 128, 0.42);
  box-shadow:
    0 0 16px rgba(74, 222, 128, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.transit-category-card[data-category="challenging"] .transit-cat-glyph {
  background:
    radial-gradient(circle at 32% 28%, rgba(251, 191, 36, 0.3), rgba(110, 72, 170, 0.2) 58%, rgba(15, 12, 41, 0.4) 100%);
  border-color: rgba(251, 191, 36, 0.45);
  box-shadow:
    0 0 16px rgba(251, 191, 36, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.transit-cat-glyph svg {
  width: 22px;
  height: 22px;
  filter: drop-shadow(0 0 6px rgba(255, 215, 0, 0.45));
}

.transit-cat-body {
  flex: 1;
  min-width: 0;
  position: relative;
  z-index: 1;
}

.transit-cat-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.2;
}

.transit-cat-desc {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.62);
}

.transit-cat-aside {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
  min-width: 40px;
}

.transit-cat-count {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 0 10px rgba(255, 215, 0, 0.35);
}

.transit-cat-new {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-light);
  padding: 3px 7px;
  background: rgba(255, 215, 0, 0.12);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 6px;
  line-height: 1;
}

.transit-category-card.has-new-transits {
  border-color: rgba(255, 215, 0, 0.45);
  box-shadow: 0 0 14px rgba(255, 215, 0, 0.12);
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  color: var(--gold);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.btn-back:hover {
  background: rgba(255, 255, 255, 0.15);
  border-color: rgba(255, 215, 0, 0.4);
  transform: translateX(-2px);
}

.btn-back:active {
  transform: translateX(-2px) scale(0.98);
}

.btn-back-round {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--am-surface-bg);
  backdrop-filter: blur(var(--am-surface-blur));
  -webkit-backdrop-filter: blur(var(--am-surface-blur));
  border: 1px solid rgba(255, 215, 0, 0.25);
  border-radius: 50%;
  color: var(--gold);
  font-size: 20px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  flex-shrink: 0;
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  margin: 0;
}

.btn-back-round:hover {
  border-color: rgba(255, 215, 0, 0.4);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.2);
  transform: translateY(-50%) scale(1.05);
}

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

.btn-back-round.hidden {
  display: none;
}

#transits-detail-page .page-header {
  margin-bottom: 16px;
}

/* Отступы для полноэкранного overlay с круговой картой */

/* ===== PLANET MODAL ===== */
.planet-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.planet-modal.hidden {
  display: none;
}

.planet-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.25); /* Минимальное затемнение - видна палитра! */
  backdrop-filter: blur(2px); /* Минимальное размытие */
  -webkit-backdrop-filter: blur(2px);
}

.planet-modal-content {
  position: relative;
  /* Полупрозрачный стиль как у карточек */
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 24px;
  max-width: 520px;
  width: 100%;
  /* Ограничиваем высоту и разрешаем прокрутку */
  max-height: 82svh;
  max-height: 82vh; /* fallback для старых браузеров */
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 10001;
  will-change: backdrop-filter;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
}

.planet-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
  color: var(--gold);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  z-index: 10002;
}

.planet-modal-close:hover {
  background: rgba(255, 215, 0, 0.2);
  transform: scale(1.1);
}

.planet-modal-header {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.planet-modal-header-content {
  display: flex;
  align-items: center;
  gap: 16px;
}

.planet-modal-icon {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border: 1px solid rgba(255, 255, 255, 0.2);
  /* Убрали тяжелую тень */
}

.planet-modal-icon.planet-icon-large {
  width: 80px;
  height: 80px;
}

.planet-modal-icon img {
  display: none;
}

.planet-modal-header-text {
  flex: 1;
}

.planet-modal-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 8px 0;
  letter-spacing: 0.3px;
  line-height: 1.3;
}

.planet-modal-subtitle {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  font-weight: 500;
}

.planet-modal-interpretation {
  margin-top: 16px;
  padding-top: 0;
}

.planet-modal-section-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--gold);
  margin: 0 0 12px 0;
}

.planet-modal-text {
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.9);
}

.planet-modal-text p {
  margin: 0 0 8px 0;
}

.planet-modal-text p:last-child {
  margin-bottom: 0;
}

.transits-detail-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 8px 0;
  letter-spacing: 0.5px;
}

.transits-detail-date {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
  font-weight: 500;
}

.muted {
  color: var(--text-muted);
  font-size: 13px;
}

/* Clickable elements hover effects */
.key-point.clickable:hover,
.aspect-item.clickable:hover {
  background: rgba(0, 0, 0, 0.5) !important;
  transform: translateX(4px);
  transition: all 0.3s ease;
}

.key-point.clickable:active,
.aspect-item.clickable:active {
  transform: translateX(2px);
}

/* ===== TRANSIT INTERPRETATION MODAL ===== */
.transit-interpretation-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: fadeIn 0.3s ease-in-out;
  overflow: hidden; /* Предотвращаем прокрутку самого модального окна */
}

.transit-interpretation-modal.hidden {
  display: none;
}

.transit-interpretation-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.25); /* Минимальное затемнение - видна палитра! */
  backdrop-filter: blur(2px); /* Минимальное размытие */
  -webkit-backdrop-filter: blur(2px);
  will-change: backdrop-filter;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  overflow: hidden;
  touch-action: none;
}

.transit-interpretation-content {
  position: relative;
  /* Полупрозрачный стиль как у карточек транзитов */
  background: rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-left: 3px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  padding: 24px;
  max-width: 520px;
  width: 100%;
  max-height: 82svh;
  max-height: 82vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  z-index: 100001;
  will-change: backdrop-filter;
  transform: translateZ(0);
  -webkit-transform: translateZ(0);
  animation: slideUp 0.4s ease-out;
}

/* Скроллбар тонкий */
.transit-interpretation-content::-webkit-scrollbar,
.planet-modal-content::-webkit-scrollbar {
  width: 3px;
}
.transit-interpretation-content::-webkit-scrollbar-track,
.planet-modal-content::-webkit-scrollbar-track {
  background: transparent;
}
.transit-interpretation-content::-webkit-scrollbar-thumb,
.planet-modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 215, 0, 0.3);
  border-radius: 2px;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.transit-interpretation-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  /* Glassmorphism effect */
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 50%;
  color: var(--gold);
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  z-index: 100002;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.transit-interpretation-close:hover {
  background: rgba(255, 215, 0, 0.15);
  border-color: rgba(255, 215, 0, 0.5);
  transform: rotate(90deg) scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 215, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

/* Header with transit info */
.transit-interpretation-header {
  display: none; /* Скрываем шапку с дублированием */
}

.transit-interpretation-planets {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ti-transit-symbol,
.ti-natal-symbol {
  font-size: 26px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.3));
}

.ti-transit-planet,
.ti-natal-planet {
  font-size: 16px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: 0.5px;
}

.ti-aspect {
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
}

.transit-interpretation-importance {
  display: flex;
  align-items: center;
}

.ti-importance-badge {
  font-size: 18px;
  color: var(--gold);
  filter: drop-shadow(0 2px 6px rgba(255, 215, 0, 0.5));
}

/* Transit details cards */
.transit-interpretation-details {
  display: none; /* Скрываем карточки с деталями */
}

.ti-detail-card {
  /* Очень темные карточки с синим оттенком как на скриншоте */
  background: rgba(15, 12, 35, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.ti-detail-card:hover {
  background: rgba(20, 16, 45, 0.9);
  border-color: rgba(255, 215, 0, 0.3);
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(255, 215, 0, 0.15);
}

.ti-detail-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(255, 255, 255, 0.6);
  font-weight: 600;
}

.ti-detail-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--gold);
}

/* Interpretation body */
.transit-interpretation-body {
  margin-bottom: 16px;
}

.ti-section-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0.5px;
}

.ti-title-icon {
  font-size: 24px;
  filter: drop-shadow(0 2px 8px rgba(255, 215, 0, 0.5));
}

.ti-loading.hidden {
  display: none;
}

.ti-text {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  padding: 0;
}

.ti-text.hidden {
  display: none;
}

.ti-text p {
  margin: 0 0 10px 0;
}

.ti-text p:last-child {
  margin-bottom: 0;
}

.ti-empty-hint {
  color: var(--text-secondary, rgba(255, 255, 255, 0.65));
  font-style: italic;
  margin: 0;
}

.ti-retry-wrap {
  margin-top: 16px;
  text-align: center;
}

.ti-retry-wrap.hidden {
  display: none;
}

.ti-retry-btn {
  padding: 10px 20px;
  border-radius: 999px;
  border: 1px solid rgba(255, 215, 0, 0.35);
  background: rgba(255, 215, 0, 0.12);
  color: var(--gold, #ffd700);
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
}

.ti-retry-btn:hover {
  background: rgba(255, 215, 0, 0.2);
}

.ti-retry-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Footer with period info */
.transit-interpretation-footer {
  padding-top: 12px;
  margin-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.ti-period-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(0, 0, 0, 0.15);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(74, 222, 128, 0.25);
  border-radius: 10px;
  padding: 12px 16px;
}

.ti-period-icon {
  font-size: 28px;
  filter: drop-shadow(0 2px 6px rgba(74, 222, 128, 0.4));
}

.ti-period-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
}

.ti-period-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: rgba(74, 222, 128, 0.8);
  font-weight: 600;
}

.ti-period-value {
  font-size: 15px;
  font-weight: 700;
  color: var(--success-color);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .transit-interpretation-content {
    padding: 20px;
    max-height: 80vh;
  }

  .ti-section-title {
    font-size: 18px;
  }

  .ti-text {
    font-size: 14px;
  }
}

/* ── Legal / compliance UI (cookie-notice, offer-consent, legal-strip) ──────
   Разметка для этих трёх компонентов подключается на всех app-страницах
   (index, profile, create-chart, модалки подписки/покупки), но верстка была
   только в legal/_styles.html для страниц /legal — здесь баннер cookie,
   чекбокс оферты и подвал с реквизитами показывались вообще без стилей
   (см. code-audit-and-refactor-plan.md §11.3 F8). */

.cookie-notice {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(20, 16, 48, 0.96);
  border: 1px solid var(--pro-border, rgba(167, 139, 250, 0.25));
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
  z-index: 9999;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.45);
}
.cookie-notice[hidden] { display: none !important; }
.cookie-notice a { color: var(--pro-lavender, #c084fc); }
.cookie-notice button {
  flex-shrink: 0;
  border: none;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  background: var(--pro-violet, #7c3aed);
  color: #fff;
}

.offer-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
  margin: 12px 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-muted, rgba(255, 255, 255, 0.6));
  user-select: none;
}
.offer-consent-input {
  flex-shrink: 0;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--pro-violet, #7c3aed);
  cursor: pointer;
}
.offer-consent-text a {
  color: var(--pro-lavender, #c084fc);
  text-decoration: none;
}
.offer-consent-text a:hover { text-decoration: underline; }

.legal-strip {
  margin-top: 18px;
  padding: 10px 4px calc(10px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--am-footer-border);
  font-size: 10px;
  line-height: 1.5;
  color: var(--am-footer-fg);
}
.legal-strip--above-nav {
  margin-top: var(--am-content-to-legal-gap, 12px);
  margin-bottom: var(--am-content-to-legal-gap, 12px);
}
.legal-strip-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.legal-strip-meta { color: var(--am-footer-fg); }
.legal-strip-contact,
.legal-strip-link {
  color: var(--am-footer-link);
  text-decoration: none;
  font-weight: 600;
}
.legal-strip-contact:hover,
.legal-strip-link:hover { color: var(--am-footer-link-hover); text-decoration: underline; }

/* Bottom-sheet paywall modals: subscription, purchase confirm, balance history.
   Opened with .is-open (JS must not set style.display — it would override this). */

.sheet-modal {
  display: none;
  position: fixed;
  inset: 0;
  align-items: flex-end;
  justify-content: center;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.sheet-modal.is-open {
  display: flex;
}

.sheet-modal--sub {
  z-index: 3500;
  background: rgba(6, 4, 20, 0.82);
}
.sheet-modal--pcm {
  z-index: 3000;
  background: rgba(6, 4, 20, 0.82);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.sheet-modal--bh {
  z-index: 3000;
  background: rgba(10, 8, 30, 0.75);
}

.sheet-panel {
  width: 100%;
  max-width: 480px;
  position: relative;
}

.sheet-panel--sub {
  background: linear-gradient(180deg, rgba(28, 14, 62, 0.99) 0%, rgba(12, 8, 35, 0.99) 100%);
  border: 1px solid rgba(157, 80, 187, 0.45);
  border-radius: 24px 24px 0 0;
  padding: 24px 20px calc(env(safe-area-inset-bottom, 0px) + 24px);
  box-shadow: 0 -12px 60px rgba(130, 60, 200, 0.25);
}
.sheet-panel--purchase {
  /* Uses sheet-panel--sub visuals; alias for purchase flows */
}
.sheet-panel--bh {
  background: linear-gradient(180deg, rgba(36, 32, 80, 0.98) 0%, rgba(26, 22, 60, 0.98) 100%);
  border: 1px solid rgba(157, 80, 187, 0.3);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 0 0 32px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
}

.sheet-close {
  background: rgba(255, 255, 255, 0.07);
  border: none;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
}
.sheet-close--round {
  position: absolute;
  top: 16px;
  right: 16px;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  padding: 0;
  font-size: 16px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sheet-close--square {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  font-size: 18px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sheet-pay-btn {
  display: block;
  width: 100%;
  padding: 14px;
  border-radius: 14px;
  border: none;
  background: linear-gradient(135deg, #7c3aed 0%, #a855f7 50%, #c084fc 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 6px 24px rgba(167, 139, 250, 0.35);
  margin-bottom: 10px;
  cursor: pointer;
}
.sheet-pay-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Subscription ─────────────────────────────────────────────────────────── */

.sub-head {
  text-align: center;
  margin-bottom: 20px;
}
.sub-head-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 8px;
}
.sub-head-logo {
  width: min(240px, 68vw);
  max-height: 64px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 0 16px rgba(255, 215, 0, 0.28));
}
.sub-head-pro-label {
  margin-top: 6px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #c084fc;
}
.sub-head p {
  font-size: 13px;
  color: rgba(255, 255, 255, 0.5);
  margin: 0;
}

.sub-features {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sub-feat {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.8);
}
.sub-feat-mark {
  color: #a78bfa;
  font-size: 15px;
}

.sub-price-box {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  text-align: center;
}
.sub-price {
  font-size: 28px;
  font-weight: 800;
  color: #c084fc;
  margin-bottom: 2px;
}
.sub-price-note {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.4);
}
.sub-legal {
  text-align: center;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.3);
  margin: 0;
}

/* ── Purchase sheet (shared with Pro subscription layout) ───────────────── */

.purchase-sheet-upsell {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 0 0 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
}
.purchase-sheet-upsell.hidden {
  display: none;
}
.purchase-sheet-upsell-link {
  background: none;
  border: none;
  color: #c084fc;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
  font: inherit;
}

.purchase-sheet-insufficient {
  background: rgba(224, 90, 90, 0.12);
  border: 1px solid rgba(224, 90, 90, 0.35);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
  font-size: 12px;
  color: #f87171;
  line-height: 1.4;
  text-align: center;
}
.purchase-sheet-insufficient.hidden {
  display: none;
}

/* ── Balance history ──────────────────────────────────────────────────────── */

.bh-handle-wrap {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
}
.bh-handle {
  width: 36px;
  height: 4px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 2px;
}
.bh-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px 16px;
}
.bh-header-kicker {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.45);
  margin-bottom: 3px;
}
.bh-header-note {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.55);
  line-height: 1.4;
  max-width: 220px;
}
.bh-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}
.bh-section-label {
  padding: 0 20px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.35);
}
.bh-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 12px 4px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.bh-state {
  text-align: center;
  padding: 30px 0;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.35);
}
.bh-state--empty {
  padding: 40px 0;
  color: rgba(255, 255, 255, 0.3);
}
.bh-state--error {
  color: rgba(224, 90, 90, 0.7);
}
.bh-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.bh-row-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
}
.bh-row-icon--in {
  background: rgba(74, 222, 128, 0.12);
}
.bh-row-icon--out {
  background: rgba(251, 146, 60, 0.12);
}
.bh-row-body {
  flex: 1;
  min-width: 0;
}
.bh-row-label {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bh-row-date {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.35);
  margin-top: 2px;
}
.bh-row-amount {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
}
.bh-row-amount--in {
  color: #4ade80;
}
.bh-row-amount--out {
  color: #fb923c;
}

/* ── Lunar calendar sheet ─────────────────────────────────────────────────── */

.sheet-modal--lunar {
  z-index: 3000;
  background: rgba(10, 8, 30, 0.75);
}

.sheet-panel--lunar {
  background: linear-gradient(180deg, rgba(36, 32, 80, 0.98) 0%, rgba(26, 22, 60, 0.98) 100%);
  border: 1px solid rgba(157, 80, 187, 0.3);
  border-bottom: none;
  border-radius: 24px 24px 0 0;
  padding: 0 0 calc(env(safe-area-inset-bottom, 0px) + 20px);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 480px;
}

.lunar-sheet-hero {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 4px 20px 16px;
}

.lunar-sheet-emoji {
  font-size: 40px;
  line-height: 1;
  flex-shrink: 0;
  filter: drop-shadow(0 0 12px rgba(255, 215, 0, 0.35));
}

.lunar-sheet-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--gold);
  margin: 0 0 8px;
}

.lunar-sheet-text {
  font-size: 14px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  margin: 0 0 10px;
}

.lunar-day-strip {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 16px 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.lunar-day-strip::-webkit-scrollbar {
  display: none;
}

.lunar-day-chip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  min-width: 48px;
  padding: 8px 6px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.25);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font: inherit;
}

.lunar-day-chip-n {
  font-size: 11px;
  font-weight: 700;
  color: var(--gold-light);
}

.lunar-day-chip-e {
  font-size: 18px;
  line-height: 1.2;
}

.lunar-day-chip.is-today {
  border-color: rgba(255, 215, 0, 0.45);
  background: rgba(255, 215, 0, 0.12);
}

.lunar-day-chip.is-active {
  border-color: rgba(192, 132, 252, 0.7);
  box-shadow: 0 0 0 1px rgba(192, 132, 252, 0.35);
}

/* ── Standalone /legal/* pages (оферта, ПДн, возврат, контакты, услуги) ────
   Раньше у этих страниц была своя плоская тёмная тема (инлайновый <style> в
   partials/legal/_styles.html) — без космического фона, золотых акцентов и
   стеклянных карточек, которыми выглядит весь остальной Mini App. Теперь эти
   страницы используют общий бандл styles.css и те же переменные/паттерны
   (--am-surface-*, --gold), чтобы быть неотличимыми по стилю от вкладок
   приложения. */

html, body.legal-body {
  /* Длинные ссылки/реквизиты в документах не должны выталкивать страницу за
     экран по горизонтали. */
  max-width: 100%;
  overflow-x: hidden;
}

body.legal-body {
  min-height: 100vh;
}

.legal-page {
  max-width: 680px;
  width: 100%;
  margin: 0 auto;
  padding: 0 0 calc(28px + env(safe-area-inset-bottom));
}

.legal-page * {
  box-sizing: border-box;
  max-width: 100%;
}

/* ===== Topbar + header (переиспользует .app-header/.brand из core bundle) == */
.legal-topbar {
  padding: max(10px, calc(env(safe-area-inset-top) * 0.3 + 8px)) 2px 0;
}

.legal-back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gold);
  text-decoration: none;
  letter-spacing: 0.02em;
}
.legal-back-link:hover { color: var(--gold-light); text-decoration: underline; }

.legal-back-link--tg {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.legal-app-header.app-header {
  margin-bottom: 6px;
  padding-top: 2px;
}

/* ===== Nav: золотые капсулы-табы, как compat-mode-btn / nav-item =========== */
/* flex-nowrap + горизонтальный скролл — на узких экранах 5 вкладок иначе
   переносят последнюю («Контакты») на вторую строку одну; лента с скроллом
   всегда остаётся в одну строку независимо от ширины экрана. */
.legal-nav {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  margin: 4px 0 20px;
  padding: 0 2px 4px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.legal-nav::-webkit-scrollbar { display: none; }

.legal-nav-link {
  flex: 0 0 auto;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  white-space: nowrap;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
}

.legal-nav-link:hover {
  color: #fff;
  border-color: rgba(255, 215, 0, 0.3);
  background: rgba(255, 255, 255, 0.08);
}

.legal-nav-link.is-active {
  color: var(--space-dark);
  border-color: transparent;
  background: linear-gradient(135deg, var(--gold-dark) 0%, var(--gold) 100%);
  box-shadow: 0 2px 10px rgba(255, 215, 0, 0.25);
}

/* ===== Headings / lead text ================================================ */
.legal-main h1 {
  margin: 0 0 10px;
  font-size: 20px;
  font-weight: 600;
  color: var(--gold);
}

.legal-lead {
  margin: 0 0 18px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
}

/* ===== Glass cards (услуги, контакты) — язык chart-card, но плотнее ========
   Стандартный --am-surface-bg (альфа 0.1-0.15) хорош поверх плотных списков
   карточек в приложении, но на /legal текста много и фон яркий — читать было
   тяжело. Добавляем непрозрачную тёмно-фиолетовую подложку под тем же
   золотистым градиентом, чтобы текст не терялся на фоне звёзд/туманности. */
.legal-card {
  background:
    linear-gradient(135deg, rgba(157, 80, 187, 0.16) 0%, rgba(110, 72, 170, 0.1) 50%, rgba(79, 172, 254, 0.14) 100%),
    rgba(16, 13, 36, 0.82);
  border: 1px solid var(--am-surface-border);
  border-radius: var(--am-surface-radius);
  backdrop-filter: blur(var(--am-surface-blur));
  -webkit-backdrop-filter: blur(var(--am-surface-blur));
  box-shadow: var(--am-surface-shadow);
  padding: 14px 16px;
  margin-bottom: 10px;
}

.legal-card-title {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 4px;
}

.legal-card-meta {
  font-size: 12px;
  color: var(--text-muted);
  margin: 0 0 8px;
  line-height: 1.4;
}

.legal-price {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 215, 0, 0.15);
  border: 1px solid rgba(255, 215, 0, 0.35);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
}

.legal-contact-line {
  margin: 0 0 7px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.85);
}
.legal-contact-line:last-child { margin-bottom: 0; }
.legal-contact-line a { color: var(--pro-lavender); text-decoration: none; font-weight: 600; }
.legal-contact-line a:hover { text-decoration: underline; }
.legal-contact-line code {
  font-size: 12px;
  color: var(--gold-light);
  background: rgba(0, 0, 0, 0.25);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ===== Document body (оферта, ПДн, возврат) ================================ */
.legal-doc-version {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.legal-doc {
  white-space: pre-wrap;
  /* Только break-word (ломать слово, если оно само по себе шире контейнера),
     без word-break/anywhere — та комбинация рвала обычные слова посередине
     на одну-две буквы даже когда они прекрасно помещались по пробелам. */
  overflow-wrap: break-word;
  font-size: 13px;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(10, 8, 24, 0.72);
  border: 1px solid var(--am-inner-border);
  border-radius: var(--am-surface-radius);
  padding: 16px;
}

.legal-doc-rule {
  margin: 14px 0;
  border: none;
  border-top: 1px solid rgba(255, 215, 0, 0.25);
}

/* ===== Link rows (список документов внизу страницы услуг) ================= */
.legal-links {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 14px;
  background:
    linear-gradient(135deg, rgba(157, 80, 187, 0.16) 0%, rgba(110, 72, 170, 0.1) 50%, rgba(79, 172, 254, 0.14) 100%),
    rgba(16, 13, 36, 0.82);
  border: 1px solid var(--am-surface-border);
  border-radius: var(--am-surface-radius);
  backdrop-filter: blur(var(--am-surface-blur));
  -webkit-backdrop-filter: blur(var(--am-surface-blur));
  box-shadow: var(--am-surface-shadow);
  overflow: hidden;
}

.legal-links a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  color: #fff;
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 0.15s ease;
}
.legal-links a:last-child { border-bottom: none; }
.legal-links a:hover,
.legal-links a:active { background: rgba(255, 255, 255, 0.05); color: var(--gold-light); }

.legal-note {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 16px;
}
.legal-note a { color: var(--pro-lavender); text-decoration: none; font-weight: 600; }
.legal-note a:hover { text-decoration: underline; }

/* ===== Footer (реквизиты продавца) ========================================= */
.legal-footer {
  margin-top: 24px;
  padding-top: 14px;
  border-top: 1px solid var(--am-footer-border);
  font-size: 10px;
  line-height: 1.6;
  letter-spacing: 0.02em;
  color: var(--am-footer-fg);
  overflow-wrap: anywhere;
}
.legal-footer a { color: var(--am-footer-link); text-decoration: none; font-weight: 600; }
.legal-footer a:hover { color: var(--am-footer-link-hover); text-decoration: underline; }
.legal-footer-row { margin-bottom: 5px; }
.legal-footer-row:last-child { margin-bottom: 0; }

@media (max-width: 600px) {
  .legal-main h1 { font-size: 18px; }
  .legal-card, .legal-doc { padding: 13px 14px; }
}
