:root {
  --cream: #f5f0e8;
  --mist: #b8b0a0;
  --gold: #c9923a;
  --gold-soft: rgba(201, 146, 58, 0.15);
  --midnight: #1a1625;
  --panel: #241f30;
  --panel-elevated: #2d2740;
  --ink: #0e0c0a;
  --radius: 2px;
  --page-pad: clamp(1rem, 4vw, 2.5rem);
  --content-max: 42rem;
  --touch-min: 44px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', sans-serif;
  font-weight: 400;
  background: var(--midnight);
  color: var(--cream);
  min-height: 100vh;
  min-height: 100dvh;
  line-height: 1.7;
  font-size: clamp(16px, 2.5vw, 17px);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 60% 50% at 10% 20%, rgba(42, 31, 61, 0.5) 0%, transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 80%, rgba(31, 46, 26, 0.35) 0%, transparent 50%);
  z-index: 0;
}

.hidden { display: none !important; }

.report-header,
.report-page,
.report-footer {
  position: relative;
  z-index: 1;
}

/* ─── Header ─── */
.report-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: max(0.85rem, env(safe-area-inset-top)) var(--page-pad) 0.85rem;
  border-bottom: 1px solid rgba(201, 146, 58, 0.12);
  background: rgba(26, 22, 37, 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.35rem;
  color: var(--gold);
  text-decoration: none;
}
.logo span { color: var(--cream); opacity: 0.5; font-style: italic; }

.header-link {
  color: var(--mist);
  text-decoration: none;
  font-size: clamp(0.75rem, 2vw, 0.85rem);
  letter-spacing: 0.04em;
  transition: color 0.2s;
  white-space: nowrap;
  min-height: var(--touch-min);
  display: inline-flex;
  align-items: center;
}
.header-link:hover { color: var(--gold); }

/* ─── Page shell ─── */
.report-page {
  width: 100%;
  max-width: var(--content-max);
  margin: 0 auto;
  padding: clamp(1.5rem, 4vw, 2.75rem) var(--page-pad) clamp(2.5rem, 6vw, 4rem);
}

.eyebrow {
  font-size: 0.68rem;
  font-weight: 400;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.75rem;
}

.report-panel > h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2rem, 5vw, 2.6rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin-bottom: 1rem;
}

.lead, .hint {
  color: var(--mist);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.report-meta {
  margin: 1.5rem 0 2.5rem;
  padding: 1.1rem 1.25rem;
  background: linear-gradient(135deg, rgba(201, 146, 58, 0.12) 0%, rgba(36, 31, 48, 0.8) 100%);
  border: 1px solid rgba(201, 146, 58, 0.25);
  border-radius: var(--radius);
  font-size: 0.88rem;
  line-height: 1.6;
  color: rgba(245, 240, 232, 0.85);
}

.loading-bar-wrap {
  height: 2px;
  background: rgba(201, 146, 58, 0.15);
  margin: 1.75rem 0;
  overflow: hidden;
}
.loading-bar {
  height: 100%;
  width: 30%;
  background: linear-gradient(90deg, var(--gold), #e8c97a);
  transition: width 0.5s ease;
}

/* ─── Report body grid ─── */
.report-body {
  display: flex;
  flex-direction: column;
  gap: clamp(1rem, 2.5vw, 1.35rem);
  width: 100%;
}

/* ─── Section cards ─── */
.report-block {
  background: var(--panel);
  border: 1px solid rgba(184, 176, 160, 0.1);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
  transition: border-color 0.25s;
}
.report-block:hover {
  border-color: rgba(201, 146, 58, 0.28);
}

.report-block-head {
  display: grid;
  grid-template-columns: auto auto 1fr;
  align-items: center;
  gap: 0.75rem 1rem;
  padding: 1.1rem 1.35rem;
  background: rgba(0, 0, 0, 0.15);
  border-bottom: 1px solid rgba(184, 176, 160, 0.08);
}

.report-block-num {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--mist);
  opacity: 0.55;
  min-width: 1.5rem;
}

.report-block-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
  color: var(--gold);
  background: var(--gold-soft);
  border-radius: 50%;
  flex-shrink: 0;
}

.report-block-title {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.05rem, 3.5vw, 1.25rem);
  font-weight: 400;
  color: var(--cream);
  line-height: 1.35;
  letter-spacing: -0.01em;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: none;
}

.report-block-body {
  padding: 1.5rem 1.6rem 1.65rem;
}

.report-block-body p {
  max-width: 65ch;
  font-size: clamp(1rem, 2.8vw, 1.0625rem);
  line-height: 1.82;
  color: rgba(245, 240, 232, 0.96);
  margin-bottom: 1.15em;
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
  -webkit-hyphens: auto;
}
.report-block-body p:last-child { margin-bottom: 0; }

.report-lead-text {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem !important;
  line-height: 1.75 !important;
  color: var(--cream) !important;
}

/* Hero — суть сна */
.report-block--hero {
  border-color: rgba(201, 146, 58, 0.35);
  background: linear-gradient(160deg, #2f2845 0%, var(--panel) 45%);
}
.report-block--hero .report-block-head {
  background: rgba(201, 146, 58, 0.08);
  border-bottom-color: rgba(201, 146, 58, 0.2);
}
.report-block--hero .report-block-body {
  padding: 1.5rem 1.6rem 1.75rem;
}
.report-block--hero .report-lead-text {
  font-size: 1.35rem !important;
  line-height: 1.7 !important;
}

/* Карта символов */
.report-symbol-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.report-symbol-list li {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
  padding: 0.85rem 1rem;
  background: rgba(245, 240, 232, 0.03);
  border-left: 2px solid rgba(201, 146, 58, 0.45);
}
.report-symbol-list .sym-name {
  font-weight: 500;
  color: var(--gold);
  font-size: 0.92rem;
  letter-spacing: 0.02em;
}
.report-symbol-list li span:last-child {
  color: rgba(245, 240, 232, 0.88);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* Шаги */
.report-steps {
  list-style: none;
  counter-reset: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.report-steps li {
  display: grid;
  grid-template-columns: 2.25rem 1fr;
  gap: 1rem;
  align-items: start;
  padding: 1rem 1.1rem;
  background: rgba(201, 146, 58, 0.06);
  border: 1px solid rgba(201, 146, 58, 0.12);
}
.report-steps .step-num {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--midnight);
  background: var(--gold);
  border-radius: 50%;
}
.report-steps .step-text {
  font-size: 0.95rem;
  line-height: 1.75;
  padding-top: 0.2rem;
}

/* Прогноз */
.report-block--forecast .report-block-body {
  border-top: none;
}
.report-block--forecast .report-block-body p {
  font-style: italic;
  color: rgba(245, 240, 232, 0.9);
  line-height: 1.78;
}

/* Внутренний конфликт */
.report-block--depth .report-block-icon {
  background: rgba(139, 69, 19, 0.2);
  color: #d4a574;
}

/* Лунный */
.report-block--lunar .report-block-icon {
  background: rgba(180, 190, 220, 0.12);
  color: #c8d4e8;
}

/* Теги символов */
.report-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.35rem 1.5rem 1.5rem;
}
.report-tag {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  color: var(--gold);
  background: rgba(201, 146, 58, 0.1);
  border: 1px solid rgba(201, 146, 58, 0.3);
  border-radius: 100px;
}

/* Рекомендации */
.report-block--recs .report-rec-list {
  list-style: none;
  padding: 1.25rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}
.report-rec-list li {
  display: grid;
  grid-template-columns: 1.75rem 1fr;
  gap: 0.85rem;
  align-items: start;
  padding: 0.9rem 1rem;
  background: rgba(245, 240, 232, 0.02);
  border: 1px solid rgba(184, 176, 160, 0.08);
}
.report-rec-list .rec-mark {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--midnight);
  background: rgba(201, 146, 58, 0.85);
  width: 1.75rem;
  height: 1.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  flex-shrink: 0;
}
.report-rec-list li > span:last-child {
  font-size: 0.94rem;
  line-height: 1.7;
  padding-top: 0.15rem;
}

.report-empty {
  color: var(--mist);
  text-align: center;
  padding: 2rem;
}

/* ─── Actions & footer ─── */
.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: clamp(1.75rem, 4vw, 2.5rem);
  padding-top: clamp(1.5rem, 3vw, 2rem);
  border-top: 1px solid rgba(184, 176, 160, 0.1);
}

/* .btn — /static/buttons.css */

.disclaimer {
  margin-top: 2rem;
  font-size: 0.72rem;
  line-height: 1.6;
  color: var(--mist);
  opacity: 0.55;
  max-width: 52ch;
}

.report-footer {
  text-align: center;
  padding: 1.5rem var(--page-pad) max(1.5rem, env(safe-area-inset-bottom));
  font-size: clamp(0.62rem, 2vw, 0.68rem);
  letter-spacing: 0.04em;
  color: var(--mist);
  opacity: 0.45;
  border-top: 1px solid rgba(184, 176, 160, 0.08);
  line-height: 1.5;
}

/* ─── Планшет ─── */
@media (min-width: 600px) {
  .report-actions .btn {
    flex: 0 1 auto;
  }
  .report-steps li {
    padding: 1.1rem 1.25rem;
  }
}

/* ─── Десктоп: чуть шире поле чтения ─── */
@media (min-width: 900px) {
  :root {
    --content-max: 46rem;
  }
  .report-page {
    padding-top: 3rem;
  }
  .report-body {
    gap: 1.5rem;
  }
  .report-block-body {
    padding: 1.5rem 1.75rem 1.65rem;
  }
  .report-block--hero .report-block-body {
    padding: 1.75rem 2rem 2rem;
  }
}

/* ─── Большие экраны ─── */
@media (min-width: 1200px) {
  :root {
    --content-max: 48rem;
    --page-pad: 2.5rem;
  }
}

/* ─── Мобильный ─── */
@media (max-width: 599px) {
  .logo {
    font-size: 1.15rem;
    max-width: 55%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .report-meta {
    margin: 1.25rem 0 1.75rem;
    padding: 1rem;
    font-size: 0.84rem;
  }

  .report-block-head {
    grid-template-columns: auto auto 1fr;
    gap: 0.5rem 0.65rem;
    padding: 0.95rem 1rem;
  }

  .report-block-num {
    font-size: 0.6rem;
    min-width: 1.25rem;
  }

  .report-block-icon {
    width: 1.75rem;
    height: 1.75rem;
    font-size: 0.9rem;
  }

  .report-block-body {
    padding: 1rem 1.05rem 1.15rem;
  }

  .report-block--hero .report-lead-text {
    font-size: 1.12rem !important;
    line-height: 1.65 !important;
  }

  .report-symbol-list li {
    padding: 0.75rem 0.85rem;
  }

  .report-steps li {
    grid-template-columns: 2rem 1fr;
    gap: 0.75rem;
    padding: 0.85rem 0.9rem;
  }

  .report-steps .step-num {
    width: 2rem;
    height: 2rem;
    font-size: 0.8rem;
  }

  .report-tags {
    padding: 1rem 1.05rem 1.15rem;
    gap: 0.4rem;
  }

  .report-tag {
    font-size: 0.78rem;
    padding: 0.4rem 0.75rem;
  }

  .report-block--recs .report-rec-list {
    padding: 1rem 1.05rem 1.15rem;
  }

  .report-rec-list li {
    grid-template-columns: 1.6rem 1fr;
    gap: 0.65rem;
    padding: 0.8rem 0.85rem;
  }

  .report-actions {
    flex-direction: column;
  }

  .report-actions .btn {
    width: 100%;
  }

  #btn-force-report {
    width: 100%;
  }
}

/* ─── Узкие телефоны ─── */
@media (max-width: 380px) {
  .report-block-head {
    grid-template-columns: auto 1fr;
    grid-template-areas:
      "num title"
      "icon title";
  }
  .report-block-num { grid-area: num; }
  .report-block-icon { grid-area: icon; }
  .report-block-title { grid-area: title; align-self: center; }
}

/* ─── Ландшафт на телефоне ─── */
@media (max-height: 500px) and (orientation: landscape) {
  .report-header {
    position: static;
  }
  .report-page {
    padding-top: 1rem;
  }
}

@media (hover: none) {
  .report-block:hover {
    border-color: rgba(184, 176, 160, 0.1);
  }
  .btn:hover {
    transform: none;
  }
}

/* ─── Inline section images ─── */
.report-block-body .report-figure {
  margin: 0 0 1.25rem;
  max-width: 320px;
}

.report-block-body .report-figure img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
}

.report-figure figcaption {
  padding: 0.45rem 0 0;
  font-size: 0.78rem;
  color: var(--mist);
  text-align: left;
}

.report-figure--loading .image-skeleton {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  aspect-ratio: 3 / 4;
  border-radius: 6px;
  border: 1px dashed rgba(201, 146, 58, 0.35);
  background: rgba(0, 0, 0, 0.2);
  overflow: hidden;
}

.image-skeleton__pulse {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    110deg,
    transparent 30%,
    rgba(201, 146, 58, 0.12) 50%,
    transparent 70%
  );
  animation: skeleton-shimmer 1.8s ease-in-out infinite;
}

.image-skeleton__icon {
  font-size: 1.75rem;
  opacity: 0.85;
  z-index: 1;
}

.image-skeleton__text {
  font-size: 0.82rem;
  color: var(--gold);
  z-index: 1;
}

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

/* ─── Progress banner while images generate ─── */
.report-progress {
  margin: 0 0 1.25rem;
  padding: 0.85rem 1rem;
  background: rgba(201, 146, 58, 0.08);
  border: 1px solid rgba(201, 146, 58, 0.25);
  border-radius: var(--radius);
}

.report-progress__head {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.9rem;
  color: var(--gold);
  margin-bottom: 0.55rem;
}

.report-progress__spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(201, 146, 58, 0.25);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

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

.report-progress__bar-wrap {
  height: 3px;
  background: rgba(201, 146, 58, 0.15);
  overflow: hidden;
}

.report-progress__bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--gold), #e8c97a);
  transition: width 0.4s ease;
}

/* Натал / Таро — вводные блоки */
.report-natal-chart,
.report-tarot-intro {
  margin-bottom: 2rem;
  padding: 1rem 1.25rem;
  background: var(--panel);
  border: 1px solid rgba(184, 176, 160, 0.12);
  border-radius: 8px;
}

.report-natal-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--gold);
  margin: 0 0 0.75rem;
  font-weight: 400;
}

.report-natal-place {
  font-size: 0.85rem;
  color: var(--mist);
  margin-bottom: 0.75rem;
}

.report-natal-planets,
.report-tarot-cards {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.4rem;
  font-size: 0.9rem;
}

.report-natal-deg { opacity: 0.75; font-size: 0.85em; }

.report-tarot-question {
  font-size: 0.95rem;
  line-height: 1.55;
  margin-bottom: 0.85rem;
  color: var(--cream);
}

.report-tarot-question span {
  color: var(--gold);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  display: block;
  margin-bottom: 0.25rem;
}

.report-tarot-pos {
  display: inline-block;
  min-width: 6.5rem;
  color: var(--mist);
  font-size: 0.8rem;
}

.report-tarot-rev {
  font-size: 0.78rem;
  color: var(--gold);
  opacity: 0.9;
}

.report-catalog {
  margin: 2rem 0 0;
  padding: 1.25rem 1rem;
  max-width: var(--content-max);
  text-align: center;
  border-top: 1px solid rgba(184, 176, 160, 0.12);
}

.report-catalog.hidden {
  display: none;
}

.report-catalog-lead {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--mist);
  margin-bottom: 0.85rem;
}

.report-catalog-lead a {
  color: var(--gold);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.report-hide-btn {
  background: none;
  border: none;
  color: rgba(184, 176, 160, 0.55);
  font-size: 0.8125rem;
  line-height: 1.5;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  padding: 0.35rem 0.5rem;
  font-family: inherit;
}

.report-hide-btn:hover {
  color: rgba(184, 176, 160, 0.85);
}

.report-hide-btn:disabled {
  opacity: 0.5;
  cursor: wait;
}

.report-hide-hint {
  display: block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  line-height: 1.55;
  color: rgba(184, 176, 160, 0.45);
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
}

.report-catalog-done {
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(184, 176, 160, 0.5);
}

@media print {
  body::before { display: none; }
  .report-header { position: static; }
  .report-block { break-inside: avoid; border: 1px solid #ccc; }
  .report-actions { display: none; }
  .report-progress { display: none; }
  .report-catalog { display: none; }
  .report-figure--loading { display: none; }
  .report-block-body .report-figure img { max-height: 280px; }
}

/* Превью полного отчёта в модалке тизера (та же структура, что /report) */
.report-preview-wrap .report-block-head {
  grid-template-columns: auto auto 1fr auto;
}

.report-preview-wrap .report-block {
  margin-bottom: 1rem;
  border: 1px solid rgba(201, 146, 58, 0.15);
  border-radius: var(--radius, 2px);
  background: rgba(36, 31, 48, 0.55);
}

.report-preview-badge {
  margin-left: auto;
  font-size: 0.68rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #fb7185;
  white-space: nowrap;
}

.report-preview-badge--free { color: #34d399; }
.report-preview-badge--partial { color: #fbbf24; }

.report-block-locked {
  position: relative;
  margin-top: 0.75rem;
  max-height: 5.5rem;
  overflow: hidden;
}

.report-block-locked-blur {
  filter: blur(5px);
  opacity: 0.45;
  user-select: none;
  pointer-events: none;
}

.report-lock-hint,
.report-lock-teaser {
  margin-top: 0.65rem;
  font-size: 0.82rem;
  color: rgba(184, 176, 160, 0.75);
}

.report-tag--locked {
  opacity: 0.45;
}
