:root {
  /* Комфортная длина строки для сплошного чтения. Держим её в одной
     переменной, потому что от неё зависят два размера сразу: сам абзац и
     ширина карточки, в которой он лежит. Разъедутся — внутри карточки снова
     появится пустая половина. Единица `ch` считается от размера шрифта
     элемента; у абзаца разбора и у карточки он одинаковый (16 px), поэтому
     значения совпадают. */
  --reading-measure: 68ch;
  --bg: #070915;
  --bg-soft: #101528;
  /* Чуть плотнее, чем было при backdrop-filter: карточки больше не размывают
     фон под собой (см. комментарий у .glass-card), и эта разница в альфе
     возвращает им прежнюю глубину. */
  --panel: rgba(18, 24, 46, 0.78);
  --panel-strong: rgba(13, 18, 35, 0.94);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(167, 131, 255, 0.32);
  --text: #f3f5ff;
  --muted: #b6bfd8;
  --accent: #a783ff;
  --accent-2: #6ae0ff;
  --accent-3: #ffb86a;
  --success: #7de6a3;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --max-width: 1240px;
  --tab-panel-offset: 112px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--tab-panel-offset);
}

html.is-viewport-zoomed {
  scroll-behavior: auto;
  scroll-padding-top: 0;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI", Inter, "Noto Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top, rgba(105, 84, 205, 0.26), transparent 34%),
    radial-gradient(circle at 80% 20%, rgba(70, 182, 220, 0.18), transparent 24%),
    linear-gradient(180deg, #090c1a 0%, #06070f 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 18%),
    radial-gradient(circle at center, rgba(255, 255, 255, 0.04) 1px, transparent 1px);
  background-size: auto, 38px 38px;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.86), transparent 82%);
  pointer-events: none;
  opacity: 0.18;
  /* Тот же приём, что и у .bg-grid: сетка из точек с маской неподвижна,
     держим её отдельным слоем, а не перерисовываем при прокрутке. */
  transform: translateZ(0);
}

html.is-viewport-zoomed body::before {
  display: none;
}

[hidden] {
  display: none !important;
}

/* transform: translateZ(0) выносит эти слои на отдельный слой композитора.
   Они прибиты к вьюпорту и никогда не меняются, поэтому растрируются один раз
   и дальше просто лежат на месте — иначе браузер перерисовывал бы их (включая
   blur(70px) у .bg-blur) на каждом кадре прокрутки. */
.bg-grid,
.bg-blur {
  position: fixed;
  pointer-events: none;
  inset: auto;
  z-index: -1;
  transform: translateZ(0);
}

.bg-grid {
  inset: 0;
}

html.is-viewport-zoomed .bg-grid,
html.is-viewport-zoomed .bg-blur {
  display: none;
}

.bg-blur {
  width: 420px;
  height: 420px;
  border-radius: 50%;
  filter: blur(70px);
  opacity: 0.28;
}

.bg-blur-1 {
  top: 4%;
  right: 6%;
  background: rgba(111, 95, 246, 0.42);
}

.bg-blur-2 {
  bottom: 10%;
  left: 4%;
  background: rgba(80, 208, 255, 0.22);
}

img,
svg {
  display: block;
  max-width: 100%;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

main,
.site-header,
.site-footer {
  width: min(calc(100% - 32px), var(--max-width));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-top: 18px;
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 13, 25, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
}

html.is-viewport-zoomed .site-header {
  position: static;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand strong {
  display: block;
  line-height: 1.1;
  letter-spacing: 0.01em;
}

.brand small {
  display: block;
  color: var(--muted);
  line-height: 1.1;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #1b1631;
  font-size: 1.25rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 28px rgba(122, 101, 255, 0.36);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.site-nav a {
  color: var(--muted);
  transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--text);
}

.section {
  padding: 92px 0 0;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 28px;
  align-items: center;
  padding-top: 58px;
}

.hero-copy h1,
.section-heading h2 {
  margin: 0;
  letter-spacing: -0.03em;
  line-height: 1.02;
}

.hero-copy h1 {
  font-size: clamp(2.6rem, 5vw, 5rem);
}

.hero-text,
.section-heading p,
.info-card p,
.sphere-card p,
.faq-item p,
.footer-note,
.result-empty p,
.helper-text,
.muted {
  color: var(--muted);
}

.hero-text {
  max-width: 62ch;
  font-size: 1.08rem;
  margin: 18px 0 0;
}


.hero-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 24px;
}

.step-card {
  display: grid;
  gap: 10px;
  padding: 18px;
  border-radius: var(--radius-lg);
}

.step-card strong {
  font-size: 1rem;
}

.step-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.step-number {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  color: #1a1730;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.eyebrow,
.panel-badge,
.result-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  color: #d5c9ff;
  font-size: 0.84rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow::before,
.panel-badge::before,
.result-kicker::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 6px rgba(167, 131, 255, 0.14);
}

.hero-actions,
.form-actions,
.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-actions {
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  color: #13172c;
  font-weight: 700;
  background: linear-gradient(135deg, #fff1cc, #a7dfff);
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}

.btn:hover,
.btn:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 20px 42px rgba(0, 0, 0, 0.24);
}

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

.btn-secondary {
  color: var(--text);
  background: linear-gradient(135deg, rgba(122, 101, 255, 0.2), rgba(106, 224, 255, 0.12));
  border: 1px solid rgba(167, 131, 255, 0.36);
}

.btn-ghost {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--line);
  box-shadow: none;
}

.btn-small {
  min-height: 42px;
  padding: 0 18px;
  font-size: 0.95rem;
}

.hero-stats,
.mini-grid,
.info-grid,
.tool-grid,
.matrix-layout,
.sphere-grid,
.preview-grid {
  display: grid;
  gap: 18px;
}

.hero-stats {
  margin-top: 28px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* Здесь НЕ должно быть backdrop-filter. Правило раскрывается примерно в
   полсотни элементов на странице, и каждый такой элемент заставляет браузер
   на КАЖДОМ кадре прокрутки заново снимать и размывать участок фона под собой.
   Именно это и превращало скролл в рывки.
   Терять при этом нечего: под карточками лежит только мягкий градиент body и
   пара размытых пятен .bg-blur — размывать размытое нечем, картинка выходит
   та же. Blur остался там, где под ним реально едет текст: шапка, модалка,
   выпадающий список языков, тост, подсказка на матрице. */
.stat-card,
.mini-card,
.info-card,
.sphere-card,
.glass-card,
.glass-panel,
.code-card,
.faq-item {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.stat-card,
.mini-card {
  padding: 18px;
  border-radius: var(--radius-lg);
}

.stat-card strong {
  display: block;
  font-size: 1.65rem;
  letter-spacing: -0.04em;
}

.stat-card span,
.mini-card span {
  color: var(--muted);
}

.hero-panel,
.info-card,
.form-card,
.result-card,
.code-card,
.faq-item,
.sphere-card {
  padding: 24px;
  border-radius: var(--radius-xl);
}

.hero-panel {
  position: relative;
  overflow: hidden;
}

.hero-panel::after {
  content: "";
  position: absolute;
  inset: auto -40px -90px auto;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 131, 255, 0.36), transparent 70%);
}

.feature-list,
.steps-list {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
}

.feature-list li + li,
.steps-list li + li {
  margin-top: 10px;
}

.compact li + li {
  margin-top: 8px;
}

.mini-grid {
  margin-top: 18px;
  grid-template-columns: 1fr;
}

.mini-card {
  background: rgba(255, 255, 255, 0.03);
}

.mini-card strong {
  display: block;
  margin-top: 6px;
  font-size: 1rem;
}


.preview-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.preview-card {
  display: grid;
  gap: 14px;
  padding: 24px;
  border-radius: var(--radius-xl);
}

.preview-card h3,
.summary-card h4 {
  margin: 0;
}

.preview-card p,
.summary-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.preview-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d8ceff;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.preview-label::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 5px rgba(167, 131, 255, 0.12);
}

.preview-callout {
  margin-top: 20px;
}

.summary-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.summary-grid--compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-card {
  position: relative;
  display: grid;
  gap: 12px;
  min-height: 100%;
  padding: 22px 20px 20px;
  border-radius: 22px;
  text-decoration: none;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(106, 224, 255, 0.14), transparent 38%),
    linear-gradient(180deg, rgba(19, 24, 46, 0.96), rgba(12, 15, 30, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 18px 36px rgba(4, 8, 20, 0.24);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.summary-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(106, 224, 255, 0.72), rgba(167, 131, 255, 0.46), transparent 80%);
  pointer-events: none;
}

.summary-card::after {
  content: "";
  position: absolute;
  right: -36px;
  bottom: -42px;
  width: 132px;
  height: 132px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 131, 255, 0.16), transparent 70%);
  pointer-events: none;
}

.summary-card:hover,
.summary-card:focus-visible {
  transform: translateY(-4px);
  border-color: rgba(167, 131, 255, 0.26);
  box-shadow: 0 24px 50px rgba(4, 8, 20, 0.34);
}

.summary-card:focus-visible {
  outline: none;
}

.summary-card h4 {
  position: relative;
  z-index: 1;
  font-size: clamp(1.04rem, 1.8vw, 1.18rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  margin-top: 0;
  max-width: 14ch;
}

.summary-card:hover h4,
.summary-card:focus-visible h4 {
  color: #ffffff;
}

.summary-card p {
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  max-width: 28ch;
}

.guides-wave {
  position: relative;
  margin-top: 22px;
  padding: 30px;
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top left, rgba(110, 92, 255, 0.2), transparent 34%),
    radial-gradient(circle at bottom right, rgba(78, 214, 255, 0.14), transparent 36%),
    linear-gradient(180deg, rgba(16, 21, 42, 0.98), rgba(9, 12, 27, 0.98));
  box-shadow: 0 26px 54px rgba(3, 7, 18, 0.28);
}

.guides-wave::before {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: 29px;
  border: 1px solid rgba(255, 255, 255, 0.04);
  pointer-events: none;
}

.guides-wave::after {
  content: "";
  position: absolute;
  inset: auto auto -82px -70px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(167, 131, 255, 0.14), transparent 68%);
  pointer-events: none;
}

.guides-wave--deep {
  background:
    radial-gradient(circle at top right, rgba(106, 224, 255, 0.18), transparent 32%),
    radial-gradient(circle at bottom left, rgba(167, 131, 255, 0.14), transparent 34%),
    linear-gradient(180deg, rgba(14, 20, 39, 0.98), rgba(8, 11, 25, 0.98));
}

.guides-wave-heading {
  position: relative;
  z-index: 1;
  margin-bottom: 22px;
}

.guides-wave-heading .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(167, 131, 255, 0.18);
}

.guides-wave-grid {
  position: relative;
  z-index: 1;
  gap: 18px;
  margin-top: 0;
}

.guides-wave-card {
  min-height: 220px;
  align-content: space-between;
  padding: 24px 22px 22px;
  background:
    linear-gradient(180deg, rgba(18, 24, 46, 0.98), rgba(10, 14, 30, 0.98));
  border-color: rgba(255, 255, 255, 0.07);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), 0 20px 40px rgba(3, 7, 18, 0.2);
}

.guides-wave-card::before {
  height: 2px;
  background: linear-gradient(90deg, rgba(106, 224, 255, 0.9), rgba(167, 131, 255, 0.7), transparent 86%);
}

.guides-wave-card::after {
  content: "↗";
  right: 18px;
  bottom: 18px;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: rgba(255, 255, 255, 0.92);
  font-size: 1rem;
  font-weight: 700;
  background:
    linear-gradient(135deg, rgba(106, 224, 255, 0.18), rgba(167, 131, 255, 0.22));
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 12px 24px rgba(4, 8, 20, 0.24);
}

.guides-wave-card h4 {
  max-width: 12ch;
  margin-bottom: 4px;
}

.guides-wave-card p {
  max-width: none;
  padding-right: 44px;
  color: rgba(223, 226, 244, 0.82);
  line-height: 1.62;
}

.guides-wave-card:hover,
.guides-wave-card:focus-visible {
  transform: translateY(-6px);
  border-color: rgba(106, 224, 255, 0.28);
  box-shadow: 0 26px 54px rgba(3, 7, 18, 0.32);
}

.guides-wave-card:hover::after,
.guides-wave-card:focus-visible::after {
  background:
    linear-gradient(135deg, rgba(106, 224, 255, 0.28), rgba(167, 131, 255, 0.34));
}

.section-heading {
  max-width: 760px;
  margin-bottom: 28px;
}

.section-heading.narrow {
  max-width: 680px;
}

.spheres-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(300px, 0.88fr);
  gap: 24px;
  align-items: start;
  margin-bottom: 28px;
}

.spheres-intro .section-heading {
  max-width: none;
  margin-bottom: 0;
}

.spheres-matrix-card {
  display: grid;
  gap: 16px;
  align-content: start;
  min-height: 100%;
  padding: 18px;
}

.spheres-matrix-card h3 {
  margin: 8px 0 0;
  font-size: 1.08rem;
  line-height: 1.3;
}

.spheres-matrix-card-copy p {
  margin: 0;
}

.spheres-matrix-title {
  color: #d8ceff;
}

.spheres-matrix-frame {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 320px;
  padding: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 24px;
  background:
    radial-gradient(circle at top, rgba(130, 102, 255, 0.18), transparent 58%),
    radial-gradient(circle at bottom, rgba(87, 205, 255, 0.12), transparent 48%),
    rgba(6, 10, 24, 0.72);
}

.spheres-matrix-frame::before {
  content: '';
  position: absolute;
  inset: 18px;
  border-radius: 22px;
  border: 1px solid rgba(167, 131, 255, 0.08);
  pointer-events: none;
}

.spheres-matrix-frame svg {
  width: min(100%, 390px);
  height: auto;
  aspect-ratio: 1 / 1;
  max-width: 390px;
  overflow: visible;
  flex: 0 0 auto;
  filter: drop-shadow(0 20px 28px rgba(0, 0, 0, 0.24));
}

.spheres-matrix-empty {
  display: grid;
  gap: 8px;
  max-width: 28ch;
  color: var(--muted);
  line-height: 1.55;
}

.spheres-matrix-empty strong {
  color: var(--text);
  font-size: 1rem;
  line-height: 1.3;
}

.section-heading h2 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.section-heading p {
  margin: 16px 0 0;
  max-width: 62ch;
}

.info-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.info-card h3,
.sphere-card h3,
.form-card h3,
.result-card h3,
.matrix-points h4,
.faq-item summary,
.code-card .code-header,
.tarot-reading h4 {
  margin: 0 0 10px;
}

.info-card p,
.sphere-card p,
.result-empty p,
.helper-text,
.faq-item p {
  margin: 0;
  line-height: 1.65;
}

.tool-grid {
  grid-template-columns: minmax(320px, 390px) minmax(0, 1fr);
  align-items: start;
}

.form-card {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 10px;
  font-weight: 600;
}

input,
select,
textarea {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md);
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

select {
  color-scheme: dark;
  background-color: rgba(255, 255, 255, 0.03);
}

select option {
  background-color: #1a1730;
  color: var(--text);
}

select option:disabled {
  color: #93a0c7;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: rgba(182, 191, 216, 0.64);
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: rgba(167, 131, 255, 0.56);
  box-shadow: 0 0 0 4px rgba(167, 131, 255, 0.16);
}

.checkbox-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  font-weight: 500;
}

.checkbox-row input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  padding: 0;
  accent-color: var(--accent);
}

.helper-text {
  font-size: 0.94rem;
}

.result-card {
  min-height: 560px;
}

.result-empty {
  display: grid;
  place-items: center;
  text-align: center;
  gap: 14px;
  min-height: 510px;
}

.empty-icon {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  font-size: 2rem;
  background: linear-gradient(135deg, rgba(167, 131, 255, 0.3), rgba(106, 224, 255, 0.16));
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.result-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.result-header h3 {
  font-size: clamp(1.6rem, 3vw, 2.4rem);
}

.muted {
  margin: 0;
  line-height: 1.6;
}

.chip-stack {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid rgba(167, 131, 255, 0.26);
  border-radius: 999px;
  color: #e5dcff;
  font-size: 0.9rem;
  background: rgba(167, 131, 255, 0.08);
}

.matrix-layout {
  grid-template-columns: minmax(0, 1fr);
  margin-top: 22px;
}

.glass-panel {
  padding: 20px;
  border-radius: var(--radius-lg);
}

.matrix-visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  min-height: 0;
  height: 100%;
}

.matrix-visual svg {
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
  flex-shrink: 0;
  overflow: visible;
}

.matrix-points {
  width: 100%;
  max-width: 960px;
  margin-inline: auto;
}

.matrix-post-accordion {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 960px;
  margin: 18px auto 0;
}

.matrix-post-accordion-item {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  box-shadow: var(--shadow);
}

.matrix-post-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 18px;
  cursor: pointer;
  list-style: none;
}

.matrix-post-accordion-summary::-webkit-details-marker {
  display: none;
}

.matrix-post-accordion-title {
  font-size: 0.98rem;
  font-weight: 700;
}

.matrix-post-accordion-summary::after {
  content: "+";
  flex-shrink: 0;
  color: #d8ceff;
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.16s ease;
}

.matrix-post-accordion-item[open] .matrix-post-accordion-summary::after {
  transform: rotate(45deg);
}

.matrix-post-accordion-item[open] .matrix-post-accordion-summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

.matrix-post-accordion-content {
  padding: 18px;
}

.matrix-post-accordion-content .matrix-insights {
  max-width: none;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.matrix-post-accordion-content .summary-grid {
  margin-top: 0;
}

.matrix-post-points {
  display: grid;
  gap: 0;
}

.matrix-insights {
  display: grid;
  gap: 16px;
  width: 100%;
  max-width: 960px;
  margin-top: auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.matrix-insights-head {
  display: grid;
  gap: 6px;
}

.matrix-insights-head strong {
  font-size: 1.02rem;
}

.matrix-insights-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.94rem;
}

.matrix-insights-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d5c9ff;
  font-size: 0.76rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.matrix-insights-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 0 5px rgba(167, 131, 255, 0.14);
}

.matrix-insights-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.matrix-insight-card {
  display: grid;
  gap: 10px;
  min-height: 100%;
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.matrix-insight-top {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.matrix-insight-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  width: auto;
  height: 42px;
  padding: 0 10px;
  border-radius: 14px;
  flex-shrink: 0;
  color: #13172c;
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  background: linear-gradient(135deg, #fff1cc, #a7dfff);
}

.matrix-insight-label {
  display: inline-flex;
  color: #d9d1ff;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.matrix-insight-card strong,
.matrix-insight-card small {
  display: block;
}

.matrix-insight-card strong {
  margin-top: 4px;
  font-size: 0.96rem;
  line-height: 1.35;
}

.matrix-insight-card small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.45;
}

.matrix-insight-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.92rem;
}

.matrix-points h4 {
  font-size: 1rem;
}

.points-list {
  display: grid;
  gap: 10px;
}

.point-item {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.point-item:last-child {
  border-bottom: 0;
}

.point-meta {
  min-width: 0;
}

.point-meta strong,
.point-value strong {
  display: block;
}

.point-meta span,
.point-value span {
  color: var(--muted);
  font-size: 0.92rem;
}

.point-value {
  flex-shrink: 0;
  text-align: right;
}

.action-row {
  margin-top: 18px;
}

.result-output {
  margin-top: 18px;
  padding: 18px 20px;
  border-radius: var(--radius-lg);
  line-height: 1.7;
  white-space: pre-wrap;
}


.pair-inputs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.compatibility-card {
  min-height: 760px;
}

.compatibility-layout {
  align-items: stretch;
}

.compatibility-visual {
  min-height: 860px;
}

.compatibility-score {
  display: grid;
  width: 100%;
  gap: 16px;
  margin-top: auto;
  padding-top: 20px;
  padding-bottom: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.compatibility-score-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.compatibility-score-hero {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-top: 6px;
  flex-wrap: wrap;
}

.compatibility-score-max {
  font-size: 0.42em;
  color: var(--muted);
  font-weight: 500;
  margin-left: 2px;
}

.compatibility-score-desc {
  margin: 10px 0 0;
  color: #e5e7eb;
  font-size: 0.94rem;
  line-height: 1.55;
}

.compatibility-score-top p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.6;
}

.compatibility-score-number {
  display: inline-block;
  margin-top: 0;
  font-size: clamp(2.8rem, 5.5vw, 4.2rem);
  line-height: 0.92;
  letter-spacing: -0.05em;
}

.compatibility-submeters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed rgba(255, 255, 255, 0.08);
}

.submeter-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  padding: 8px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.submeter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.83rem;
  gap: 8px;
}

.submeter-title {
  color: #d1d5db;
  font-weight: 500;
}

.submeter-value {
  color: #c4b5fd;
  font-weight: 600;
  font-size: 0.82rem;
}

.submeter-bar {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  overflow: hidden;
}

.submeter-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #818cf8, #c084fc);
}

.submeter-bar--friction span {
  background: linear-gradient(90deg, #34d399, #f59e0b);
}

.compatibility-visual svg,
.matrix-visual svg {
  user-select: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  -ms-user-select: none;
}

.compatibility-score-tag,
.compatibility-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.compatibility-score-tag--high,
.compatibility-pill--positive {
  color: #d4ffe5;
  border-color: rgba(125, 230, 163, 0.42);
  background: rgba(125, 230, 163, 0.12);
}

.compatibility-score-tag--good {
  color: #eef6ff;
  border-color: rgba(106, 224, 255, 0.42);
  background: rgba(106, 224, 255, 0.12);
}

.compatibility-score-tag--medium,
.compatibility-pill--neutral {
  color: #ffe9bd;
  border-color: rgba(255, 214, 131, 0.4);
  background: rgba(255, 214, 131, 0.12);
}

.compatibility-score-tag--lessons {
  color: #fed7aa;
  border-color: rgba(251, 146, 60, 0.4);
  background: rgba(251, 146, 60, 0.12);
}

.compatibility-score-tag--challenge,
.compatibility-score-tag--low,
.compatibility-pill--negative {
  color: #ffd6d6;
  border-color: rgba(255, 129, 129, 0.4);
  background: rgba(255, 129, 129, 0.12);
}

.compatibility-progress {
  overflow: hidden;
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.compatibility-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow: 0 10px 24px rgba(106, 224, 255, 0.18);
}

.compatibility-score-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.compatibility-breakdown-panel {
  height: 100%;
}

.compatibility-breakdown-panel h4 {
  margin: 0 0 8px;
}

.compatibility-breakdown-panel p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.compatibility-post-accordion {
  margin-top: 20px;
}

.compatibility-post-accordion .compatibility-summary,
.compatibility-post-accordion .compatibility-ai-card {
  margin-top: 0;
}

.compatibility-post-accordion .compatibility-summary-grid,
.compatibility-post-accordion .compatibility-grid {
  margin-top: 16px;
}

.compatibility-post-accordion .compatibility-position-card {
  padding: 20px;
}

.compatibility-post-accordion .compatibility-ai-head p {
  max-width: none;
}

.compatibility-breakdown-item {
  align-items: center;
}

.compatibility-breakdown-item .point-meta span {
  line-height: 1.6;
}

.compatibility-breakdown-item--positive .point-value strong {
  color: var(--success);
}

.compatibility-breakdown-item--negative .point-value strong {
  color: #ffb6b6;
}

.compatibility-breakdown-item--neutral .point-value strong {
  color: #ffe9bd;
}

.compatibility-summary {
  margin-top: 20px;
}

.compatibility-summary-head {
  display: grid;
  gap: 8px;
}

.compatibility-summary-head strong {
  font-size: 1.06rem;
}

.compatibility-summary-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.compatibility-summary-grid,
.compatibility-grid {
  display: grid;
  gap: 18px;
}

.compatibility-summary-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

.compatibility-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 20px;
}

.compatibility-position-card {
  display: grid;
  gap: 16px;
  padding: 24px;
  border-radius: var(--radius-xl);
}

.compatibility-position-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.compatibility-position-head h4 {
  margin: 10px 0 8px;
  font-size: 1.18rem;
}

.compatibility-position-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.compatibility-formula-list {
  display: grid;
  gap: 10px;
}

.compatibility-formula {
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.compatibility-formula strong {
  display: block;
  margin-bottom: 4px;
}

.compatibility-formula span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.compatibility-formula--result {
  background: rgba(167, 131, 255, 0.08);
  border-color: rgba(167, 131, 255, 0.24);
}

.compatibility-copy {
  display: grid;
  gap: 12px;
}

.compatibility-copy p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.compatibility-ai-card {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.compatibility-ai-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.compatibility-ai-head h4 {
  margin: 8px 0 8px;
  font-size: 1.12rem;
}

.compatibility-ai-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  max-width: 760px;
}

.compatibility-ai-status {
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  line-height: 1.6;
}

.compatibility-ai-status--loading {
  border: none;
  background: transparent;
  padding: 0;
}

.compatibility-ai-status--ready {
  border-color: rgba(106, 224, 255, 0.32);
  color: rgba(220, 245, 255, 0.95);
}

.compatibility-ai-status--error {
  border-color: rgba(255, 124, 141, 0.45);
  color: #ffd2db;
}

.compatibility-ai-answer {
  display: grid;
  gap: 14px;
}

.compatibility-ai-overview {
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.compatibility-ai-overview h4 {
  margin: 0 0 10px;
  font-size: 1.03rem;
}

.compatibility-ai-overview p {
  margin: 0;
  color: var(--muted);
  line-height: 1.72;
}

.compatibility-ai-overview p + p {
  margin-top: 10px;
}

.compatibility-ai-sections {
  display: grid;
  gap: 12px;
}

.compatibility-ai-section {
  display: grid;
  gap: 10px;
}

.compatibility-ai-section h4 {
  margin: 0;
  font-size: 1rem;
}

.compatibility-ai-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.compatibility-ai-section p + p {
  margin-top: 8px;
}

/* Разбор здоровья: те же карточки, что у совместимости. Раньше он приходил
   сплошным текстом на тысячу слов, и чтобы найти «что делать», надо было
   дочитать до конца. Рамка у каждого раздела своя — так видно, где он
   кончается, а глазу есть за что зацепиться при перелистывании. */
.health-ai-sections {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

/* Рамку, фон и внутренний отступ даёт `.reading-item` — тот же класс, что у
   карточек совместимости. Дублировать их здесь бессмысленно: правило
   `.reading-item` идёт ниже по файлу и всё равно выигрывает. */
.health-ai-section {
  display: grid;
  gap: 10px;
}

.health-ai-section h5 {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
}

.health-ai-section p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.health-ai-section p + p {
  margin-top: 8px;
}

.sphere-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.matrix-ask-card {
  display: grid;
  gap: 14px;
  margin: 0 0 16px;
  padding: 18px 20px;
}

.matrix-ask-card h3 {
  margin: 0;
  font-size: 1.12rem;
  line-height: 1.25;
}

.matrix-ask-card label {
  gap: 8px;
}

.matrix-ask-card textarea {
  min-height: 108px;
}

.matrix-ask-card .form-actions {
  margin-top: 2px;
}

.matrix-question-answer {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.matrix-question-answer h4 {
  margin: 0;
  font-size: 0.96rem;
}

.matrix-question-answer p {
  margin: 0;
  line-height: 1.6;
  color: var(--muted);
}

.matrix-question-answer--loading {
  border-color: rgba(167, 131, 255, 0.36);
}

.matrix-question-answer--error {
  border-color: rgba(255, 124, 141, 0.45);
}

.sphere-card {
  display: grid;
  gap: 14px;
}

.sphere-icon {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  color: #19152e;
  font-size: 1.2rem;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
}

.sphere-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.sphere-energy {
  flex-shrink: 0;
  min-width: 94px;
  padding: 10px 12px;
  border-radius: 16px;
  text-align: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.sphere-energy strong {
  display: block;
  font-size: 1.6rem;
  line-height: 1;
}

.sphere-energy span {
  color: var(--muted);
  font-size: 0.8rem;
}

.sphere-pillars {
  display: grid;
  gap: 12px;
}

.pillar {
  padding: 12px 14px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.pillar strong {
  display: block;
  margin-bottom: 4px;
}

.pillar p {
  margin: 0;
  line-height: 1.6;
}

.placeholder-card {
  opacity: 0.88;
}

.matrix-accordion {
  grid-template-columns: 1fr;
  gap: 12px;
}

.matrix-accordion-item {
  padding: 0;
  overflow: hidden;
}

.matrix-accordion-item[data-section-id="grand_matrix_summary"] {
  border-color: rgba(226, 178, 93, 0.35);
  background: linear-gradient(135deg, rgba(226, 178, 93, 0.08) 0%, rgba(20, 18, 28, 0.85) 100%);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
}

.matrix-accordion-item[data-section-id="grand_matrix_summary"] .matrix-accordion-title {
  color: var(--accent);
  text-shadow: 0 0 12px rgba(226, 178, 93, 0.25);
}

.matrix-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.matrix-accordion-summary::-webkit-details-marker {
  display: none;
}

.matrix-accordion-title {
  font-weight: 700;
  letter-spacing: 0.01em;
}

.matrix-accordion-summary-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
  flex: 1;
}

/* Строка-подсказка под заголовком темы: первая фраза разбора.
 *
 * Держим ровно одну строку с многоточием — иначе тринадцать полос разъезжаются
 * по высоте и список перестаёт читаться как список. Обрезание работает только
 * потому, что у родителя (`.matrix-accordion-summary-copy`) стоит `min-width: 0`:
 * без него флекс-элемент отказывается сжиматься и текст выдавливает статус.
 *
 * У открытой темы подсказку прячем — под ней уже лежит тот же самый текст. */
.matrix-accordion-combo-line {
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.matrix-accordion-combo-line:empty {
  display: none;
}

.matrix-accordion-item[open] .matrix-accordion-combo-line {
  display: none;
}

.matrix-topic-meta {
  display: grid;
  gap: 10px;
  margin: 0 0 16px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
}

.matrix-topic-meta-head {
  display: grid;
  gap: 4px;
}

.matrix-topic-meta-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #d9ccff;
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.matrix-topic-node-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.matrix-topic-node {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(167, 131, 255, 0.24);
  background: rgba(167, 131, 255, 0.08);
  color: #e7e0ff;
  font-size: 0.82rem;
  line-height: 1.35;
}

.matrix-accordion-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
}

.matrix-accordion-status--loading {
  color: #ffe9bd;
  border-color: rgba(255, 214, 131, 0.4);
  background: rgba(255, 214, 131, 0.12);
}


.matrix-accordion-status--preview {
  color: #d9ccff;
  border-color: rgba(167, 131, 255, 0.34);
  background: rgba(167, 131, 255, 0.1);
}

.matrix-accordion-status--ready {
  color: #d4ffe5;
  border-color: rgba(125, 230, 163, 0.42);
  background: rgba(125, 230, 163, 0.12);
}

.matrix-accordion-status--error {
  color: #ffd5d5;
  border-color: rgba(255, 129, 129, 0.4);
  background: rgba(255, 129, 129, 0.12);
}

.matrix-accordion-body {
  padding: 0 20px 20px;
}

.matrix-accordion-body p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.matrix-accordion-body p + p {
  margin-top: 14px;
}

.matrix-accordion-body strong {
  color: var(--text);
}

.matrix-accordion-item[open] .matrix-accordion-summary {
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}

/* Длина строки в прозе модели.
 *
 * Замер на живом сайте: абзац темы занимал 1198 px, то есть около 150 знаков.
 * Комфортный предел для сплошного чтения — 50–75; после примерно 90 глаз
 * перестаёт надёжно находить начало следующей строки, и усталость копится к
 * третьему абзацу. Здесь это важнее, чем обычно: разбор читают по три-пять
 * минут подряд.
 *
 * Класс ставит `renderAiParagraphs` — единственная точка вывода для всех
 * ответов модели, поэтому правило накрывает 13 тем, здоровье, совместимость и
 * Таро разом. `max-width` только ограничивает: там, где колонка и так узкая
 * (телефон, ячейки таблицы здоровья), ничего не меняется.
 *
 * Заголовки, схема и таблицы намеренно остаются во всю ширину — сужается
 * только проза. */
.ai-paragraph {
  max-width: var(--reading-measure, 68ch);
}

/* Тема: колонка чтения и панель арканов рядом.
 *
 * История правки, чтобы не пойти по кругу. Сначала был ограничен только абзац:
 * текст стал 587 px, а карточка осталась 1238 — 652 px, то есть 53 % карточки,
 * пустовали справа, и блок читался как сломанный. Тогда карточку сузили до
 * ширины текста; выровнялось, но пустота переехала на страницу — при окне
 * 1650 px по бокам оставалось по 510 px, шире самого текста.
 *
 * Поэтому карточка снова во всю ширину, а место справа занято делом: позициями
 * матрицы, на которых построен разбор. Комфортная мера сохранена, пустоты нет,
 * и панель отвечает на вопрос «откуда это взято», не заставляя листать к схеме.
 *
 * Колонка панели — `1fr`, то есть она забирает остаток; на широком экране это
 * около 570 px, и содержимое там намеренно редкое, а не растянутое. */
.topic-layout {
  display: grid;
  grid-template-columns: minmax(0, calc(var(--reading-measure, 68ch) + 1px)) minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

/* Ниже 1000 px панель уходит под текст: две колонки на планшете дали бы либо
   нечитаемо узкую прозу, либо панель в один столбец шириной с ноготь. */
@media (max-width: 1000px) {
  .topic-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }
}

/* Глубокий аудит здоровья — ширина используется целиком, строка остаётся узкой.
 *
 * Путь сюда занял две попытки, обе стоит помнить.
 *
 * Сначала внутри одного документа было две разных ширины: карточки чакр во всю
 * ширину (около 140 знаков в строке), а нумерованные разделы — 540 px с 608 px
 * пустоты справа. Разница потому, что через меру проходит только проза модели,
 * а карточки чакр собираются другой веткой кода.
 *
 * Потом контейнер сузили целиком. Рассогласование ушло, но пустота переехала на
 * страницу: колонка 631 px с полями по 259 px с каждой стороны, и владелец
 * сказал, что так хуже.
 *
 * Теперь ширина занята делом, а не полями. Аудит — это три раздела, из которых
 * два прозаических и независимых друг от друга, поэтому они встают колонками
 * рядом: каждая около 65 знаков в строке, читаются сверху вниз каждая своя, как
 * в журнале. Карточки чакр короткие, их сетка тоже раскладывается надвое.
 * Заголовок и блок чакр занимают всю строку.
 *
 * Порог 1000 px, а не 768: на планшете две колонки прозы дали бы по 40 знаков —
 * это уже хуже, чем одна широкая.
 *
 * Селекторы из двух классов не для красоты: родные правила аудита
 * (`.health-full-container { display: flex }` и такое же у сетки чакр) лежат в
 * этом файле НИЖЕ, и при равной специфичности побеждали они. Первая попытка
 * прошла молча — `grid-column` проставился, но контейнер остался флексом, и на
 * экране ничего не изменилось. */
@media (min-width: 1000px) {
  .matrix-health-ai .health-full-container {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }

  .matrix-health-ai .health-full-hero-header,
  .matrix-health-ai .health-full-section-card--chakras {
    grid-column: 1 / -1;
  }

  .matrix-health-ai .health-full-chakras-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

/* Обзорную часть карты здоровья трогать не надо — проверено и откачено.
 *
 * Замер показывал 650 px пустоты справа от вводного абзаца (55 % контейнера), и
 * по числу это выглядело тем же дефектом, что у тем. Попытка сузить и
 * центрировать вводный абзац и блок «на что обратить внимание» сделала хуже:
 * центрированный блок повис в пустоте под полосами показателей, а карточка
 * действия стала уже двух карточек над ней и выбилась из сетки.
 *
 * Разница с темами в том, что там длинный текст лежал в очерченной рамкой
 * карточке, и пустота читалась как обрыв вёрстки. Здесь текст короткий и
 * выровнен по левому краю под полосами — то есть начинается там же, где они,
 * как подпись под графиком. Процент пустоты одинаковый, ситуация разная:
 * судить надо по виду, а не по числу. */

/* Совместимость: разбор и панель арканов пары рядом.
 *
 * Карточка результата 832 px — она уже, чем у тем, потому что слева от неё в
 * той же сетке стоит форма на 390 px. Поэтому панель здесь 220 px, а не 570:
 * при более широкой на текст осталось бы меньше 55 знаков в строке.
 *
 * Панель липкая: разделы совместимости — это аккордеон, который разворачивается
 * на несколько экранов, и список позиций полезен всё это время, а не только у
 * первого абзаца.
 *
 * Порог 1100 px, а не 1000: карточка результата и так узкая, и на планшете
 * панель сбоку оставила бы прозе меньше 45 знаков. Ниже порога она просто
 * уходит под текст. */
@media (min-width: 1100px) {
  .compatibility-ai-layout,
  .tarot-reading-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 220px);
    gap: 24px;
    align-items: start;
  }

  .compatibility-arcana,
  .tarot-arcana {
    position: sticky;
    top: 96px;
  }
}

/* Пара «число (аркан)» в строке показателей у чакр не должна разрываться.
   Word joiner в разметке запрещает перенос в точке, но когда связка не влезает
   в остаток строки, браузер ломает её всё равно — на живой странице так
   разъезжались две пары из двадцати одной. `nowrap` убирает это совсем: связка
   целиком уходит на следующую строку. Она короткая и помещается даже в колонку
   телефона. */
.health-metric-pair {
  white-space: nowrap;
}

/* В кружке Таро стоит символ карты, а не число: символы бывают шире цифры
   (масти, знаки арканов), поэтому шрифт мельче и без табличных цифр. */
.topic-arcana-value--glyph {
  font-size: 0.86rem;
  font-variant-numeric: normal;
}

.topic-arcana {
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

/* Воздуха под заголовком было 12 px, и он читался как подпись к первой строке,
   а не как шапка всего списка. Строки внутри списка разделены 24 px (по 12 сверху
   и снизу), поэтому заголовку нужно заметно больше, иначе он визуально
   прилипает к первому аркану.
   Селектор из двух классов не для красоты: `.matrix-accordion-body p` задаёт
   `margin: 0`, и одноклассовое правило проигрывало ему по специфичности —
   отступ молча не применялся, хотя рамка и внутренние поля из того же правила
   работали. */
.topic-arcana .topic-arcana-heading {
  margin: 0 0 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.topic-arcana-list {
  display: grid;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Волосяная линия между строками, а не просто отступ: строк стало по три, и без
   разделителя соседние арканы читались как один длинный абзац. */
.topic-arcana-row {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}

/* У первой строки убираем только линию: отступ сверху нужен, иначе она
   прижимается к линии под заголовком. */
.topic-arcana-row:first-child {
  border-top: 0;
}

.topic-arcana-row:last-child {
  padding-bottom: 0;
}

/* Число в кружке — та же форма и тот же цвет, что у узла на схеме матрицы.
 *
 * Цвет приходит из разметки как `--arcana-color`, и берётся он не из копии
 * палитры, а из фактического `fill` кружка на схеме (см. `matrixNodeColor`).
 * Поэтому панель раскрашена ровно как диаграмма: фиолетовые главные арканы,
 * красные социальные, жёлтый центр — и взгляд связывает строку списка с точкой
 * на схеме без подписей.
 *
 * Значение по умолчанию оставлено на случай, если узел не нашёлся: тогда кружок
 * просто акцентного цвета, как было. */
.topic-arcana-value {
  --arcana-color: #a783ff;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--arcana-color);
  /* Запасной фон для браузеров без color-mix — объявлен первым. */
  background: rgba(255, 255, 255, 0.04);
  background: color-mix(in srgb, var(--arcana-color) 20%, transparent);
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--arcana-color);
  font-variant-numeric: tabular-nums;
}

.topic-arcana-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.topic-arcana-name {
  font-weight: 600;
  line-height: 1.3;
}

.topic-arcana-label {
  font-size: 0.74rem;
  line-height: 1.3;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(182, 191, 216, 0.75);
}

/* Короткое значение аркана. Ширину не ограничиваем: колонка панели и так узкая,
   а именно эта строка наполняет её по высоте и делает список осмысленным. */
.topic-arcana-meaning {
  margin-top: 2px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: var(--muted);
}

.tarot-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.tarot-card {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  padding: 18px;
  border-radius: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(circle at top, rgba(167, 131, 255, 0.22), transparent 42%),
    linear-gradient(180deg, rgba(13, 18, 35, 0.96), rgba(7, 10, 21, 0.96));
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.3);
}

.tarot-card::before,
.tarot-card::after {
  content: "";
  position: absolute;
  inset: 14px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tarot-card::after {
  inset: 24px;
  border-style: dashed;
  opacity: 0.34;
}

.tarot-card.reversed {
  transform: rotate(180deg);
}

.tarot-card-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  gap: 12px;
}

.tarot-top,
.tarot-bottom {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.tarot-top {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.tarot-top span:first-child {
  max-width: none;
  min-width: 0;
  overflow-wrap: break-word;
}

.tarot-top span:last-child {
  max-width: 130px;
  text-align: center;
  align-self: center;
}

.tarot-bottom {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  text-transform: none;
  letter-spacing: 0.02em;
  font-size: 0.78rem;
  line-height: 1.35;
}

.tarot-bottom span:first-child {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
}

.tarot-bottom span:last-child {
  text-align: left;
  overflow-wrap: anywhere;
}

.tarot-core {
  display: grid;
  gap: 10px;
  justify-items: center;
  text-align: center;
}

.tarot-symbol {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  font-size: 2rem;
  color: #1b1631;
  background: linear-gradient(135deg, #ffefc3, #a7dfff);
}

.tarot-card h4 {
  margin: 0;
  font-size: 1.15rem;
}

.tarot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
  line-height: 1.2;
  white-space: normal;
}

.tarot-reading {
  margin-top: 20px;
}

.tarot-reading-grid {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.reading-item {
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.reading-item h4 {
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.reading-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 0.95rem;
}

.reading-item p + p,
.matrix-accordion-body p + p,
.matrix-question-answer p + p,
.compatibility-ai-section p + p,
.compatibility-ai-overview p + p {
  margin-top: 14px;
}

.ai-reading-subheading {
  margin: 22px 0 10px;
  font-size: 0.98rem;
  font-weight: 600;
  color: #f1f5f9;
  letter-spacing: 0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}

.ai-reading-subheading::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #a78bfa;
  box-shadow: 0 0 8px rgba(167, 139, 250, 0.6);
  flex-shrink: 0;
}

.ai-reading-subheading:first-child {
  margin-top: 4px;
}

.reading-item .ai-reading-subheading + p,
.matrix-accordion-body .ai-reading-subheading + p,
.matrix-question-answer .ai-reading-subheading + p {
  margin-top: 8px;
}

.code-card {
  margin-top: 20px;
}

.code-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.code-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  color: #13172c;
  font-size: 0.85rem;
  font-weight: 700;
  background: linear-gradient(135deg, var(--accent-3), #fff3ce);
}

pre {
  margin: 18px 0 0;
  padding: 18px;
  overflow: auto;
  border-radius: var(--radius-lg);
  color: #eaf2ff;
  background: rgba(5, 7, 16, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

code {
  font-family: "SFMono-Regular", ui-monospace, Menlo, Consolas, monospace;
}

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

.faq-item summary {
  list-style: none;
  cursor: pointer;
  padding-right: 28px;
  position: relative;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::after {
  content: "+";
  position: absolute;
  top: 0;
  right: 0;
  color: var(--accent-2);
  font-size: 1.2rem;
}

.faq-item[open] summary::after {
  content: "-";
}

.faq-item p {
  margin-top: 12px;
}

.site-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding: 72px 0 40px;
}

.site-footer p {
  margin: 8px 0 0;
}

/* Ссылка на карту сайта в подвале. Раньше здесь лежали все 25 ссылок сразу —
   это вытолкнуло разметку главной за 12 КБ, на которых российские сети рвут
   соединение, и сайт перестал открываться. Вес разметки на `.ru` — ограничение
   не меньшее, чем вёрстка. */
.footer-sitemap a {
  color: var(--muted);
  font-size: 0.82rem;
  transition: color 0.16s ease;
}

.footer-sitemap a:hover,
.footer-sitemap a:focus-visible {
  color: var(--text);
  text-decoration: underline;
}

.footer-note {
  max-width: 540px;
  text-align: right;
  line-height: 1.6;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 40;
  max-width: min(360px, calc(100vw - 32px));
  padding: 14px 16px;
  border-radius: 16px;
  color: var(--text);
  background: rgba(9, 12, 24, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 50px rgba(0, 0, 0, 0.36);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.matrix-line {
  stroke: rgba(167, 131, 255, 0.4);
  stroke-width: 2.2;
}

.matrix-line--muted {
  stroke: rgba(106, 224, 255, 0.26);
}

.matrix-node {
  fill: rgba(9, 12, 24, 0.96);
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 2;
}

.matrix-node--core {
  fill: rgba(25, 20, 48, 0.98);
  stroke: rgba(167, 131, 255, 0.56);
}

.matrix-node--accent {
  fill: rgba(15, 20, 38, 0.96);
  stroke: rgba(106, 224, 255, 0.4);
}

.matrix-value {
  fill: var(--text);
  font-size: 18px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
}

.matrix-label {
  fill: rgba(182, 191, 216, 0.84);
  font-size: 11px;
  font-family: "Segoe UI", "Noto Sans", sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-anchor: middle;
}

.matrix-bubble {
  fill: rgba(255, 255, 255, 0.05);
  stroke: rgba(255, 255, 255, 0.08);
}

.matrix-bubble-text {
  fill: rgba(243, 245, 255, 0.92);
  font-size: 13px;
  text-anchor: middle;
  dominant-baseline: middle;
}


.matrix-advanced-scene {
  isolation: isolate;
}

.matrix-orbit {
  fill: none;
}

.matrix-orbit--outer {
  stroke: rgba(123, 162, 255, 0.36);
  stroke-width: 2.4;
}

.matrix-orbit--inner {
  stroke: rgba(168, 139, 255, 0.16);
  stroke-width: 1.2;
}

.matrix-age-tick {
  stroke: rgba(224, 232, 255, 0.28);
  stroke-width: 1;
}

.matrix-age-tick--mid {
  stroke: rgba(224, 232, 255, 0.44);
  stroke-width: 1.25;
}

.matrix-age-tick--major {
  stroke: rgba(236, 243, 255, 0.78);
  stroke-width: 1.65;
}

.matrix-age-label,
.matrix-age-value,
.matrix-node-caption,
.matrix-line-label,
.matrix-icon {
  font-family: "Segoe UI", "Noto Sans", sans-serif;
  text-anchor: middle;
}

.matrix-age-label {
  fill: rgba(236, 241, 255, 0.86);
  font-size: 8.2px;
  letter-spacing: 0.04em;
  dominant-baseline: middle;
}

.matrix-age-label--major {
  fill: rgba(245, 248, 255, 0.98);
  font-size: 9px;
  font-weight: 700;
}

.matrix-age-value {
  fill: rgba(210, 220, 255, 0.82);
  font-size: 6.4px;
  dominant-baseline: middle;
}

.matrix-shell-line {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.matrix-shell-line--diamond {
  stroke: rgba(115, 156, 255, 0.44);
  stroke-width: 2.6;
}

.matrix-shell-line--square {
  stroke: rgba(210, 232, 255, 0.58);
  stroke-width: 2.2;
}

.matrix-shell-line--axis {
  stroke: rgba(255, 255, 255, 0.16);
  stroke-width: 1.5;
}

.matrix-shell-line--soft {
  stroke: rgba(167, 131, 255, 0.18);
  stroke-width: 1.4;
}

.matrix-shell-line--guide {
  stroke: rgba(255, 255, 255, 0.12);
  stroke-width: 1.2;
}

.matrix-shell-line--relation {
  stroke: rgba(255, 255, 255, 0.28);
  stroke-width: 1.2;
  stroke-dasharray: 4 6;
}

.matrix-arrow-line {
  fill: none;
  stroke-width: 2.3;
  stroke-linecap: round;
  opacity: 0.92;
}

.matrix-arrow-line--male {
  stroke: rgba(188, 134, 255, 0.95);
  marker-end: url(#matrixArrowMale);
}

.matrix-arrow-line--female {
  stroke: rgba(255, 104, 125, 0.95);
  marker-end: url(#matrixArrowFemale);
}

.matrix-node-wrap {
  pointer-events: none;
}

.matrix-node-caption {
  fill: rgba(217, 227, 255, 0.76);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.08em;
}

.matrix-node-caption--center {
  fill: rgba(244, 248, 255, 0.9);
  font-size: 7.6px;
  letter-spacing: 0.12em;
}

.matrix-value--bold {
  font-weight: 800;
}

.matrix-line-label {
  fill: rgba(221, 228, 255, 0.78);
  font-size: 6.7px;
  font-weight: 600;
  letter-spacing: 0.02em;
  dominant-baseline: middle;
}

.matrix-line-label--female {
  fill: rgba(255, 206, 214, 0.82);
}

.matrix-icon {
  dominant-baseline: middle;
}

.matrix-icon--money {
  fill: #9cdc5b;
  font-size: 19px;
  font-weight: 700;
}

.matrix-icon--love {
  fill: #ff657c;
  font-size: 16px;
}

@media (max-width: 1120px) {
  .hero,
  .tool-grid,
  .matrix-layout,
  .info-grid,
  .sphere-grid,
  .summary-grid,
  .summary-grid--compact,
  .preview-grid,
  .compatibility-summary-grid,
  .compatibility-grid,
  .site-footer {
    grid-template-columns: 1fr;
  }

  .info-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer {
    display: grid;
  }

  .footer-note {
    text-align: left;
  }

  .site-header {
    border-radius: 28px;
  }

  .guides-wave-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  :root {
    --tab-panel-offset: 168px;
  }

  .site-header {
    position: sticky;
    top: 0;
    align-items: flex-start;
    flex-direction: column;
    margin-top: 12px;
  }

  .site-nav {
    gap: 12px;
  }

  .guides-wave {
    padding: 24px 20px;
    border-radius: 24px;
  }

  .hero-stats,
  .hero-steps,
  .info-grid,
  .spheres-intro,
  .sphere-grid,
  .preview-grid,
  .summary-grid,
  .summary-grid--compact,
  .matrix-post-accordion-content .summary-grid,
  .matrix-insights-grid,
  .pair-inputs,
  .compatibility-summary-grid,
  .compatibility-grid {
    grid-template-columns: 1fr;
  }

  .guides-wave-grid {
    grid-template-columns: 1fr;
  }

  .guides-wave-card {
    min-height: auto;
  }

  .result-header,
  .sphere-head,
  .site-footer,
  .compatibility-position-head,
  .compatibility-score-top,
  .compatibility-ai-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .chip-stack {
    justify-content: flex-start;
  }

  .matrix-visual {
    min-height: 0;
  }

  .matrix-visual svg {
    max-width: 720px;
  }

  .spheres-matrix-frame {
    min-height: 280px;
  }

  .spheres-matrix-frame svg {
    width: min(100%, 340px);
    height: auto;
    max-width: 340px;
  }

  .matrix-post-accordion-summary {
    padding: 14px 16px;
  }

  .matrix-post-accordion-content {
    padding: 16px;
  }
}

@media (max-width: 560px) {
  main,
  .site-header,
  .site-footer {
    width: min(calc(100% - 24px), var(--max-width));
  }

  .section {
    padding-top: 72px;
  }

  .hero {
    padding-top: 36px;
  }

  .hero-copy h1 {
    font-size: 2.3rem;
  }

  .section-heading h2 {
    font-size: 1.85rem;
  }

  .hero-panel,
  .info-card,
  .form-card,
  .result-card,
  .code-card,
  .faq-item,
  .sphere-card,
  .glass-panel {
    padding: 18px;
  }

  .btn {
    width: 100%;
  }

  .hero-actions,
  .form-actions,
  .action-row {
    flex-direction: column;
  }

  .tarot-cards {
    grid-template-columns: 1fr;
  }

  .step-card,
  .preview-card,
  .summary-card {
    padding: 18px;
  }

  .matrix-post-accordion-title {
    font-size: 0.94rem;
  }

  .tarot-card {
    min-height: 240px;
  }
}


.matrix-visual {
  position: relative;
}

.matrix-hover-tip {
  position: absolute;
  z-index: 15;
  min-width: 260px;
  max-width: min(320px, calc(100% - 24px));
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid rgba(167, 131, 255, 0.28);
  background: rgba(7, 10, 22, 0.96);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(16px);
  pointer-events: none;
  transition: opacity 0.15s ease;
}

.matrix-hover-tip.is-touch-dismissible {
  pointer-events: auto;
}

.matrix-hover-tip-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.matrix-hover-tip-copy {
  min-width: 0;
  flex: 1;
}

.matrix-hover-tip strong,
.matrix-hover-tip span,
.matrix-hover-tip small {
  display: block;
}

.matrix-hover-tip span {
  margin-bottom: 6px;
  color: #d7cbff;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.matrix-hover-tip strong {
  margin-bottom: 8px;
  font-size: 0.98rem;
  line-height: 1.35;
}

.matrix-hover-tip p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
  font-size: 0.91rem;
}

.matrix-hover-tip p + p {
  margin-top: 8px;
}

.matrix-hover-tip small {
  margin-top: 10px;
  color: #c6cff2;
  line-height: 1.45;
}

.matrix-hover-tip-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  color: #ffffff;
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1;
  background: rgba(255, 255, 255, 0.1);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
  flex-shrink: 0;
  appearance: none;
  cursor: pointer;
  touch-action: manipulation;
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.matrix-hover-tip-close:hover,
.matrix-hover-tip-close:focus-visible {
  border-color: rgba(167, 131, 255, 0.5);
  background: rgba(167, 131, 255, 0.22);
}

.matrix-hover-tip-close:active {
  transform: scale(0.92);
  background: rgba(167, 131, 255, 0.3);
}

.matrix-hover-tip-close:focus-visible {
  outline: none;
}

.matrix-node-wrap.matrix-node-interactive {
  pointer-events: auto;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.matrix-node-wrap.matrix-node-interactive:hover,
.matrix-node-wrap.matrix-node-interactive:focus-visible,
.matrix-node-wrap.matrix-node-interactive.is-active {
  filter: drop-shadow(0 0 12px rgba(167, 131, 255, 0.34));
}

.matrix-node-wrap.matrix-node-interactive:focus-visible {
  outline: none;
}

.matrix-point-group + .matrix-point-group {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.matrix-point-group h5 {
  margin: 0 0 12px;
  color: #ddd2ff;
  font-size: 0.88rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.matrix-point-group .point-item {
  align-items: flex-start;
}

.matrix-point-group .point-value strong {
  font-size: 0.92rem;
}

.matrix-point-group .point-value span {
  display: block;
  margin-top: 4px;
  max-width: 180px;
  line-height: 1.4;
}

.matrix-health-head,
.matrix-years-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.matrix-years-controls {
  margin-bottom: 16px;
}

.matrix-years-embedded {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

.matrix-years-disclosure {
  display: block;
}

.matrix-years-summary {
  list-style: none;
  cursor: pointer;
}

.matrix-years-summary::-webkit-details-marker {
  display: none;
}

.matrix-years-summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  color: #ddd2ff;
  font-size: 1.2rem;
  line-height: 1;
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.matrix-years-disclosure > summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.matrix-years-disclosure > summary .matrix-years-head {
  flex: 1;
  margin-bottom: 0;
}

.matrix-years-disclosure[open] .matrix-years-summary::after {
  content: "−";
  transform: rotate(180deg);
  background: rgba(167, 131, 255, 0.12);
  border-color: rgba(167, 131, 255, 0.26);
}

.matrix-years-content {
  margin-top: 18px;
}

.matrix-years-select-label {
  max-width: 360px;
}

.matrix-years-select-label span {
  color: #ddd2ff;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.matrix-health-table-wrap {
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.matrix-health-table {
  width: 100%;
  border-collapse: collapse;
}

.matrix-health-table th,
.matrix-health-table td {
  padding: 16px 14px;
  text-align: center;
  border-right: 2px solid rgba(255, 255, 255, 0.06);
  border-bottom: 2px solid rgba(255, 255, 255, 0.06);
}

.matrix-health-table th:last-child,
.matrix-health-table td:last-child {
  border-right: 0;
}

.matrix-health-table tbody tr:last-child td {
  border-bottom: 0;
}

.matrix-health-table thead th {
  font-size: 0.84rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.04);
}

.matrix-health-table td:first-child,
.matrix-health-table th:first-child {
  text-align: left;
}
.matrix-health-table td:first-child {
  color: #1d1d18;
}

.matrix-health-table .matrix-health-label {
  font-weight: 700;
}

.matrix-health-table .matrix-health-sub {
  display: block;
  margin-top: 4px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.84rem;
  font-weight: 500;
}

.matrix-health-table .matrix-health-total td {
  background: rgba(255, 255, 255, 0.06);
  font-weight: 700;
}

/* Числа итога обёрнуты в <strong> ради колонки на телефоне: без обёртки они были
   голым текстом и вставали не по центру, а по левому краю своей колонки. Строка
   и так набрана полужирным, поэтому дополнительный вес тега здесь снимается. */
.matrix-health-table .matrix-health-total td strong {
  font-weight: inherit;
}

.matrix-health-row--violet td:first-child { background: rgba(142, 85, 255, 0.9); }
.matrix-health-row--indigo td:first-child { background: rgba(71, 108, 255, 0.92); }
.matrix-health-row--cyan td:first-child { background: rgba(61, 210, 255, 0.92); }
.matrix-health-row--green td:first-child { background: rgba(97, 217, 79, 0.92); }
.matrix-health-row--lime td:first-child { background: rgba(225, 230, 130, 0.96); }
.matrix-health-row--orange td:first-child { background: rgba(255, 171, 61, 0.94); }
.matrix-health-row--red td:first-child { background: rgba(255, 77, 121, 0.94); }
.matrix-health-total td:first-child { background: rgba(196, 196, 196, 0.28); }

/* ==========================================================================
   Карта здоровья на телефоне
   Таблица шириной 640 px не помещается в экран 375 и прокручивается вбок внутри
   обёртки: четыре колонки на семь строк читаются кусками, и половина данных
   всегда за краем. На узком экране строки разворачиваются в карточки — по чакре
   на карточку, подписи колонок берутся из data-label, который проставляет
   buildHealthTableMarkup.
   ========================================================================== */

@media (max-width: 560px) {
  .matrix-health-table-wrap {
    overflow-x: visible;
  }

  .matrix-health-table,
  .matrix-health-table tbody,
  .matrix-health-table tr,
  .matrix-health-table td {
    display: block;
    width: 100%;
  }

  .matrix-health-table thead {
    display: none;
  }

  .matrix-health-table tr {
    margin-bottom: 12px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .matrix-health-table td {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    padding: 11px 14px;
    text-align: right;
    border-right: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  }

  /* Три колонки вместо «прижать к краям».
     Было `justify-content: space-between`, и число с названием аркана уезжали
     вправо одним блоком: у «Отшельника» и у «Справедливости» разная длина, из-за
     чего числа вставали на разной высоте строки каждое по-своему — колонка
     цифр читалась как рассыпанная. Теперь под число отведена своя полоса
     фиксированной ширины, и все числа стоят друг под другом. */
  .matrix-health-table td[data-label] {
    display: grid;
    /* Ширина первой колонки задана жёстко, и это не придирка: каждая ячейка —
       свой грид, поэтому при `auto` колонка подписи мерилась по своему тексту.
       «ФИЗИКА» короче «ЭНЕРГИИ», и число за ней вставало на несколько пикселей
       правее — колонка цифр шла лесенкой. 6.5rem хватает самой длинной подписи
       из восьми языков («Emotionen», «Emociones», «エネルギー»). */
    grid-template-columns: 6.5rem 2.6rem 1fr;
    align-items: baseline;
    column-gap: 10px;
    text-align: left;
  }

  .matrix-health-table td[data-label]::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.78rem;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-align: left;
  }

  .matrix-health-table td[data-label] strong {
    text-align: center;
  }

  /* Первая ячейка — шапка карточки: цветная полоса с названием чакры. */
  .matrix-health-table td:first-child {
    padding: 12px 14px;
    text-align: left;
    font-size: 0.95rem;
  }

  .matrix-health-table tr:last-child td:last-child,
  .matrix-health-table td:last-child {
    border-bottom: 0;
  }

  .matrix-health-table .matrix-health-sub {
    display: block;
    margin: 0;
    font-size: 0.82rem;
    text-align: right;
  }

  .matrix-health-table td strong {
    font-size: 1.05rem;
  }
}

.matrix-health-summary {
  margin-top: 18px;
}

.matrix-health-summary-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.matrix-health-summary-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.matrix-health-summary-card strong,
.matrix-health-summary-card small {
  display: block;
}

.matrix-health-summary-card strong {
  margin-bottom: 6px;
  font-size: 0.96rem;
}

.matrix-health-summary-card small {
  color: var(--muted);
  line-height: 1.5;
}

.matrix-years-focus-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 18px;
}

.matrix-years-selected {
  margin-bottom: 18px;
}

.matrix-years-selected-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.matrix-years-selected-head h4 {
  margin: 6px 0 4px;
  font-size: 1.16rem;
}

.matrix-years-selected-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.matrix-years-selected-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.matrix-years-detail-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 16px;
}

.matrix-years-detail-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.matrix-years-detail-card--primary {
  background: linear-gradient(135deg, rgba(122, 101, 255, 0.12), rgba(106, 224, 255, 0.08));
  border-color: rgba(167, 131, 255, 0.28);
}

.matrix-years-detail-card h5 {
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.matrix-years-detail-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.68;
}

.matrix-years-selected-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.matrix-years-selected-card {
  padding: 16px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.matrix-years-selected-card--primary {
  background: linear-gradient(135deg, rgba(122, 101, 255, 0.12), rgba(106, 224, 255, 0.08));
  border-color: rgba(167, 131, 255, 0.28);
}

.matrix-years-selected-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 0.96rem;
}

.matrix-years-selected-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.matrix-year-focus-card,
.matrix-year-card {
  padding: 16px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.matrix-year-focus-card strong,
.matrix-year-focus-card small,
.matrix-year-card strong,
.matrix-year-card small,
.matrix-year-card span {
  display: block;
}

.matrix-year-focus-card span,
.matrix-year-card span {
  color: #ddd2ff;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.matrix-year-focus-card strong,
.matrix-year-card strong {
  margin: 6px 0 4px;
  font-size: 0.98rem;
  line-height: 1.3;
}

.matrix-year-focus-card p,
.matrix-year-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.matrix-year-focus-card small,
.matrix-year-card small {
  margin-top: 6px;
  color: #c9d1f0;
  line-height: 1.38;
}

.matrix-year-focus-card--current,
.matrix-year-card--current {
  border-color: rgba(167, 131, 255, 0.34);
  background: linear-gradient(135deg, rgba(122, 101, 255, 0.14), rgba(106, 224, 255, 0.08));
}

.matrix-years-timeline {
  display: grid;
  gap: 16px;
}

.matrix-years-decade {
  overflow: hidden;
}

.matrix-years-decade > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  cursor: pointer;
  list-style: none;
}

.matrix-years-decade > summary::-webkit-details-marker {
  display: none;
}

.matrix-years-decade h4 {
  margin: 0;
  font-size: 1.06rem;
}

.matrix-years-decade p {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.matrix-years-decade-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
}

.matrix-year-card small.code-like {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, monospace;
}

@media (max-width: 1024px) {
  .matrix-health-summary-grid,
  .matrix-years-detail-grid,
  .matrix-years-selected-grid,
  .matrix-years-focus-grid,
  .matrix-years-decade-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .matrix-hover-tip {
    left: 12px !important;
    right: 12px;
    top: auto !important;
    bottom: 12px;
    max-width: none;
    max-height: calc(100% - 24px);
    overflow-y: auto;
    pointer-events: auto !important;
    z-index: 25;
  }

  /* Боковая прокрутка таблицы остаётся только для планшетов и широких
     телефонов: до 560 px строки разворачиваются в карточки (см. раздел «Карта
     здоровья на телефоне»), и min-width там всё ломал бы. */
  @media (min-width: 561px) {
    .matrix-health-table-wrap {
      overflow-x: auto;
    }

    .matrix-health-table {
      min-width: 640px;
    }
  }

  .matrix-years-selected-head {
    flex-direction: column;
    align-items: stretch;
  }

  .matrix-years-select-label {
    max-width: none;
  }

  .matrix-health-summary-grid,
  .matrix-years-detail-grid,
  .matrix-years-selected-grid,
  .matrix-years-focus-grid,
  .matrix-years-decade-grid {
    grid-template-columns: 1fr;
  }
}


/* === Tabbed navigation workspace === */
.site-nav {
  flex: 1;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 10px;
  overflow-x: auto;
  padding-top: 2px;
  padding-bottom: 6px;
  scrollbar-width: thin;
}

.site-nav::-webkit-scrollbar {
  height: 6px;
}

.site-nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(167, 131, 255, 0.32);
}

.site-nav a,
.site-nav-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.site-nav a:hover,
.site-nav a:focus-visible,
.site-nav-link:hover,
.site-nav-link:focus-visible {
  color: var(--text);
  border-color: rgba(167, 131, 255, 0.28);
  background: rgba(167, 131, 255, 0.1);
}

.site-nav a[aria-selected="true"],
.site-nav-link[aria-selected="true"],
.site-nav-link.is-active {
  color: var(--text);
  border-color: rgba(167, 131, 255, 0.42);
  background: linear-gradient(135deg, rgba(122, 101, 255, 0.2), rgba(106, 224, 255, 0.12));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.tab-panel {
  scroll-margin-top: var(--tab-panel-offset);
  outline: none;
  border: 0;
}

.tab-panel:focus,
.tab-panel:focus-visible {
  outline: none;
  box-shadow: none;
}

html.is-viewport-zoomed .tab-panel {
  scroll-margin-top: 0;
}

.tab-panel[hidden] {
  display: none !important;
}

@media (max-width: 860px) {
  .site-nav {
    width: 100%;
    justify-content: flex-start;
    padding-bottom: 6px;
  }
}

@media (max-width: 560px) {
  :root {
    --tab-panel-offset: 156px;
  }

  .site-nav a,
  .site-nav-link {
    min-height: 40px;
    padding: 0 14px;
    font-size: 0.95rem;
  }

  .tab-panel {
    scroll-margin-top: var(--tab-panel-offset);
  }
}

.reading-item-main {
  border-color: rgba(167, 131, 255, 0.28);
  background: rgba(167, 131, 255, 0.08);
}

.page-links-section {
  position: relative;
  margin-top: clamp(52px, 7vw, 92px);
  padding: clamp(28px, 4vw, 40px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 32px;
  background:
    radial-gradient(circle at top left, rgba(167, 131, 255, 0.12), transparent 34%),
    radial-gradient(circle at 88% 18%, rgba(106, 224, 255, 0.1), transparent 26%),
    linear-gradient(180deg, rgba(14, 18, 36, 0.96), rgba(8, 10, 21, 0.98));
  box-shadow: 0 24px 60px rgba(2, 6, 18, 0.34);
  overflow: hidden;
  isolation: isolate;
}

.landing-links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 26px;
  align-items: stretch;
}

.landing-link-card {
  position: relative;
  display: grid;
  gap: 14px;
  min-height: 100%;
  padding: 26px 24px 28px;
  border-radius: 24px;
  text-decoration: none;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(102, 216, 255, 0.18), transparent 42%),
    linear-gradient(180deg, rgba(21, 26, 49, 0.96), rgba(11, 14, 28, 0.98));
  border: 1px solid rgba(255, 255, 255, 0.09);
  box-shadow: 0 20px 40px rgba(3, 6, 18, 0.3);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.landing-link-card::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, rgba(106, 224, 255, 0.65), rgba(167, 131, 255, 0.45), transparent 82%);
  pointer-events: none;
}

.landing-link-card::after {
  content: "\2197";
  position: absolute;
  right: 20px;
  bottom: 18px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  color: rgba(243, 245, 255, 0.92);
  font-size: 1rem;
  background: linear-gradient(135deg, rgba(167, 131, 255, 0.2), rgba(106, 224, 255, 0.18));
  border: 1px solid rgba(255, 255, 255, 0.08);
  pointer-events: none;
}

.landing-link-card:hover,
.landing-link-card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(167, 131, 255, 0.34);
  box-shadow: 0 28px 60px rgba(3, 6, 18, 0.4);
}

.landing-link-card:focus-visible {
  outline: none;
}

.landing-link-card span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  color: #dcd3ff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.landing-link-card strong {
  display: block;
  font-size: clamp(1.12rem, 2vw, 1.34rem);
  line-height: 1.12;
  letter-spacing: -0.03em;
  max-width: 14ch;
}

.landing-link-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
  font-size: 0.96rem;
  max-width: 30ch;
}

@media (max-width: 980px) {
  .page-links-section {
    padding: 26px 22px;
  }
}

@media (max-width: 680px) {
  .landing-links-grid {
    grid-template-columns: 1fr;
  }

  .landing-link-card {
    padding: 20px 20px 24px;
    border-radius: 20px;
  }

  .page-links-section {
    border-radius: 24px;
    padding: 22px 18px;
  }

  .landing-link-card strong,
  .landing-link-card p {
    max-width: none;
  }
}

/* VIP Monetization Banner & Modal */
.vip-promo-banner {
  margin-top: 24px;
  padding: 24px;
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(255, 215, 0, 0.08), rgba(167, 131, 255, 0.12));
  border: 1px solid rgba(255, 215, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

.vip-promo-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: linear-gradient(90deg, #ffd700, #ffaa00);
  color: #0d0c1d;
  margin-bottom: 8px;
}

.vip-promo-content h4 {
  margin: 0 0 6px;
  font-size: 1.15rem;
  color: #fff;
}

.vip-promo-content p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
  max-width: 580px;
}

.btn-gold {
  background: linear-gradient(135deg, #ffd700, #ff9900) !important;
  color: #0d0c1d !important;
  font-weight: 700 !important;
  border: none !important;
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.3) !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease !important;
}

.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(255, 215, 0, 0.45) !important;
}

/* Modal Overlay & Dialog */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(8, 7, 20, 0.78);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 32px;
  border-radius: 28px;
  background: #14122b;
  border: 1px solid rgba(255, 215, 0, 0.2);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.05);
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}

.modal-close-btn:hover {
  background: rgba(255, 255, 255, 0.15);
}

.modal-header {
  text-align: center;
  margin-bottom: 24px;
}

.modal-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 215, 0, 0.15);
  color: #ffd700;
  border: 1px solid rgba(255, 215, 0, 0.3);
  margin-bottom: 10px;
}

.modal-header h3 {
  margin: 0 0 8px;
  font-size: 1.45rem;
}

.vip-tariffs-grid {
  display: grid;
  /* auto-fit, а не «1fr 1fr»: тариф сейчас один, и жёсткие две колонки оставили
     бы карточку в левой половине с пустотой справа. Появится второй — колонки
     вернутся сами. */
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

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

.vip-tariff-card {
  position: relative;
  padding: 20px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.vip-tariff-card.highlight {
  background: linear-gradient(145deg, rgba(255, 215, 0, 0.08), rgba(167, 131, 255, 0.08));
  border-color: rgba(255, 215, 0, 0.35);
}

.tariff-tag {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}

.highlight-tag {
  color: #ffd700;
}

.vip-tariff-card h4 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}

.tariff-price {
  font-size: 1.5rem;
  font-weight: 800;
  color: #ffd700;
  margin-bottom: 12px;
}

.tariff-features {
  list-style: none;
  padding: 0;
  margin: 0 0 16px;
  font-size: 0.84rem;
  color: rgba(255, 255, 255, 0.85);
}

.tariff-features li {
  margin-bottom: 6px;
  line-height: 1.4;
}

.btn-tariff {
  width: 100%;
  padding: 10px;
  font-size: 0.88rem;
}

.vip-order-form {
  display: grid;
  gap: 14px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

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

@media (max-width: 500px) {
  .form-row {
    grid-template-columns: 1fr;
  }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-group label {
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.form-group input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 0.92rem;
}

.form-group input:focus {
  outline: none;
  border-color: #ffd700;
}

.btn-block {
  width: 100%;
  padding: 14px;
  font-size: 1rem;
}

.form-disclaimer {
  font-size: 0.76rem;
  text-align: center;
  margin: 4px 0 0;
}

/* ==========================================================================
   Упоминания карт в тексте разбора
   Названия карт и арканов внутри ответа нейросети подсвечиваются, чтобы по
   длинному тексту можно было скользить взглядом. Намеренно сдержанно: без
   эмодзи и ярких плашек — разбор продаётся как серьёзная работа, а не как
   пост в ленте. Подсветка не должна ломать выделение и копирование текста.
   ========================================================================== */

/* ==========================================================================
   Общие правки под телефон
   ========================================================================== */

@media (max-width: 560px) {
  /* ------------------------------------------------------------------------
     Шапка на телефоне
     Была липкой карточкой в три яруса: логотип, шесть вкладок в две строки и
     отдельная строка с языком — около четверти экрана постоянно, да ещё и
     полупрозрачной, сквозь неё просвечивал текст. Теперь логотип и язык стоят
     в одной строке, фон непрозрачный, а при прокрутке верхний ярус убирается
     и остаются только вкладки.
     ------------------------------------------------------------------------ */
  .site-header {
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    padding: 8px 10px;
    border-radius: 18px;
    background: rgba(8, 11, 22, 0.97);
  }

  .site-header .brand-mark {
    width: 34px;
    height: 34px;
    font-size: 1rem;
  }

  .site-header .brand strong {
    font-size: 0.95rem;
  }

  .lang-toggle {
    height: 34px;
    min-height: 0;
  }

  .site-header .brand {
    flex: 1 1 auto;
    min-width: 0;
  }

  .site-header .brand small {
    display: none;
  }

  .lang-switcher {
    order: 2;
    margin-left: auto;
  }

  .site-nav {
    order: 3;
    flex: 1 0 100%;
    flex-wrap: wrap;
    justify-content: center;
    overflow-x: visible;
    gap: 6px;
    margin: 0;
  }

  .site-nav-link {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 8px 13px;
    font-size: 0.83rem;
  }

  /* Свёрнутое состояние: шапка уезжает вверх ровно настолько, чтобы строка с
     логотипом и переключателем языка ушла за край экрана, а вкладки встали в
     самый верх.

     Двигаем именно `transform`, и на то две причины. Первая: анимация высоты
     заставляла браузер пересчитывать раскладку всей страницы каждый кадр — на
     телефоне это читалось как проседание кадров при возврате наверх. Transform
     считает композитор, раскладка не трогается вовсе. Вторая: прошлый вариант
     схлопывал `.lang-switcher` через `overflow: hidden`, а список языков лежит
     внутри него — и выпадающее меню обрезалось начисто, язык нельзя было
     выбрать.

     Насколько поднимать — знает только раскладка, поэтому величину меряет
     `attachCompactHeaderOnScroll()` и кладёт в `--header-collapse`. */
  .site-header {
    transition: transform 0.24s ease;
    will-change: transform;
    /* Размытие — самая дорогая часть шапки: пока она едет, браузер заново
       снимает и размывает участок фона под ней на каждом кадре. Радиус 18 px
       телефон на этом и не тянул. Уменьшаем вдвое, а потерю плотности
       возвращаем непрозрачностью фона — на глаз разницы нет, под шапкой всё
       равно только градиент и пара размытых пятен. */
    backdrop-filter: blur(9px);
    -webkit-backdrop-filter: blur(9px);
    background: rgba(10, 13, 25, 0.88);
  }

  .site-header.is-compact {
    transform: translateY(calc(-1 * var(--header-collapse, 93px)));
  }

  .site-header.is-compact .brand,
  .site-header.is-compact .lang-switcher {
    opacity: 0;
    pointer-events: none;
  }

  .site-header .brand,
  .site-header .lang-switcher {
    transition: opacity 0.18s ease;
  }

  /* Кто просил не анимировать — тому мгновенно, как было. */
  @media (prefers-reduced-motion: reduce) {
    .site-header,
    .site-header .brand,
    .site-header .lang-switcher {
      transition: none;
    }
  }

  /* Меню языков открывалось влево от кнопки, а кнопка стояла у левого края —
     список уезжал за экран. Теперь он прижат к правому краю шапки и не шире
     самого экрана. */
  .lang-list {
    right: 0;
    left: auto;
    min-width: 0;
    width: max-content;
    max-width: calc(100vw - 28px);
  }

  /* Схема матрицы: каждый пиксель ширины здесь — это размер точки, по которой
     надо попасть пальцем. Рамка съедала 36 px на отступы, из-за чего схема
     ужималась до 312 px при экране 412. */
  .spheres-matrix-frame,
  .matrix-figure {
    padding: 8px;
    border-radius: 18px;
  }

  /* Два вложенных отступа по 18 px забирали у схемы 72 px ширины — при экране
     412 она ужималась до 312. Отрицательные поля возвращают часть отступа
     карточки: чем шире схема, тем крупнее точки, по которым надо попасть. */
  .matrix-visual {
    margin-left: -12px;
    margin-right: -12px;
    padding: 6px;
  }

  /* Карты Таро: вертикальная раскладка давала ~290 px на карту, и расклад из
     пяти карт превращался в полтора экрана прокрутки до самого ответа. Символ
     уезжает влево, название встаёт рядом — высота карты падает примерно вдвое. */
  .tarot-card {
    min-height: 0;
    padding: 14px;
    border-radius: 18px;
  }

  .tarot-card-content {
    gap: 10px;
  }

  .tarot-core {
    grid-template-columns: auto minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    gap: 12px;
    text-align: left;
  }

  .tarot-symbol {
    width: 52px;
    height: 52px;
    font-size: 1.5rem;
  }

  .tarot-core h4 {
    font-size: 1.05rem;
  }

  .tarot-top {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  /* Модалка занимала 64 px из 375 только под внутренние отступы — это шестая
     часть экрана впустую. */
  .modal-card {
    padding: 18px;
    border-radius: 20px;
  }

  .modal-card--large {
    padding: 18px;
  }

  /* Пятна размытия шире экрана: прокрутку не вызывают, но удваивают площадь
     заливки и на слабых телефонах съедают кадры впустую. */
  .bg-blur {
    width: min(420px, 92vw);
    height: min(420px, 92vw);
    filter: blur(70px);
  }

  /* 12 px — нижняя граница читаемости, а такими подписаны чипы схемы и
     заголовки блоков. Поднимаю до 13, не трогая настольную версию. */
  .chip,
  .result-kicker,
  .matrix-node-label,
  .summary-grid .muted,
  .matrix-health-sub {
    font-size: 0.82rem;
  }
}

/* Постоянный значок перед заголовком раздела. Наследует акцентный цвет и
   намеренно приглушён: он размечает страницу, а не спорит с заголовком. */
.section-glyph {
  display: inline-block;
  margin-right: 8px;
  color: var(--accent);
  font-size: 0.92em;
  opacity: 0.75;
  transform: translateY(-1px);
}

.ai-mention {
  position: relative;
  display: inline-block;
  padding: 1px 6px;
  margin: 0 2px;
  line-height: 1.25;
  border-radius: 6px;
  background: rgba(154, 122, 255, 0.14);
  box-shadow: inset 0 0 0 1px rgba(154, 122, 255, 0.25);
  color: inherit;
  white-space: nowrap;
  vertical-align: baseline;
  font-size: 0.92em;
  font-weight: 500;
  box-sizing: border-box;
}

.ai-mention__glyph {
  margin-right: 3px;
  color: var(--accent);
  font-size: 0.82em;
  line-height: 1;
  opacity: 0.9;
  vertical-align: baseline;
  display: inline-block;
}

/* Подсказка со значением аркана. Открывается по наведению, по фокусу с
   клавиатуры и по касанию на телефоне — там hover не существует. */
.ai-mention[data-meaning] {
  cursor: help;
}

/* Подсказка со значением аркана. Отдельный элемент на <body>, а не ::after на
   плашке: разбор лежит внутри карточек, которые обрезают содержимое по краю,
   и подсказка из плашки была бы срезана. Позицию считает скрипт. */
.ai-tooltip {
  position: fixed;
  z-index: 1200;
  max-width: min(280px, 70vw);
  padding: 9px 11px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--panel-strong);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
  color: var(--text);
  font-size: 0.8rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
  pointer-events: none;
}

.ai-tooltip--visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .ai-tooltip {
    transition: none;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .ai-mention {
    background: none;
  }
}

/* ==========================================================================
   Выравнивание текста разбора

   Было выравнивание по ширине: на широком экране строка вмещала полтораста
   знаков, слов в ней было много, и лишнее место распределялось по пробелам
   незаметно. После того как строку ограничили комфортной мерой (см.
   `--reading-measure`), слов в строке стало вдвое меньше — и тот же остаток
   теперь приходится на вдвое меньшее число пробелов. На экране это видно
   сразу: «созиданию   материальному   достатку   красоте».

   То есть два решения связаны: узкая колонка и выравнивание по ширине вместе
   не работают, и выбирать надо длину строки — она важнее для чтения. Поэтому
   левый край.

   Переносы убраны следом, и по той же причине. Они были нужны выравниванию:
   без них оно растягивало пробелы в «реки». На левом крае они ничего не
   держат, а на узкой колонке срабатывают куда чаще — на скриншоте владельца
   пять переносов подряд в одном абзаце («привыч-ные», «на-строй»,
   «зало-женные», «потреб-ности», «бес-компромиссно»). Типографская норма —
   не больше двух-трёх подряд.

   ВНИМАНИЕ при проверке: в headless-Chromium нет словаря переносов для
   русского, поэтому `hyphens: auto` там не срабатывает вовсе — переключение
   режима не меняет ни высоту абзаца, ни число строк (замерено: 20 строк и
   190/163/190 px в обоих режимах). Судить о переносах по автоматическому
   браузеру нельзя, нужен настоящий Chrome на машине с языковыми словарями.
   ========================================================================== */

@media (min-width: 768px) {
  .reading-item p,
  .matrix-accordion-body p,
  .compatibility-ai-overview p,
  .compatibility-ai-section p,
  #healthAiResult p,
  .matrix-question-answer p {
    text-align: left;
    hyphens: manual;
    -webkit-hyphens: manual;
  }
}

/* ==========================================================================
   Виджет поддержки
   Живёт на всех страницах, включая статьи, где нет ни одного скрипта кроме
   него самого. Поэтому опирается только на переменные темы и ничего не ждёт
   от остальной разметки.
   ========================================================================== */

.support-widget {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 900;
  display: flex;
  /* Reverse, so the panel opens upward and the button stays pinned to the
     corner. In normal order the panel pushes the button hundreds of pixels up
     the screen the moment it opens. */
  flex-direction: column-reverse;
  align-items: flex-end;
  gap: 10px;
  font-size: 0.9rem;
}

.support-widget__button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--panel-strong);
  color: var(--text);
  font: inherit;
  cursor: pointer;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.support-widget__button:hover {
  border-color: var(--accent);
}

.support-widget__icon {
  color: var(--accent);
}

.support-widget__panel {
  width: min(340px, calc(100vw - 32px));
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel-strong);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.45);
}

.support-widget__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.support-widget__head strong {
  font-size: 1rem;
}

.support-widget__close {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.support-widget__close:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
}

/* Системные радиокнопки и галочки скрыты, но остаются в потоке фокуса:
   глобальное правило проекта задаёт всем полям ввода min-height 52px и
   отступы 14×16, из-за чего они превращались в огромные круги и квадраты. */
.support-widget__topics {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.support-widget__topics label {
  display: inline-flex;
  margin: 0;
  cursor: pointer;
}

.support-widget__topics input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.support-widget__topics span {
  display: inline-block;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.2;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.support-widget__topics input:checked + span {
  border-color: var(--accent);
  background: rgba(154, 122, 255, 0.16);
  color: var(--text);
}

.support-widget__topics input:focus-visible + span {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.support-widget__field {
  display: block;
  margin-bottom: 12px;
}

.support-widget__field > span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 0.76rem;
}

.support-widget__field textarea,
.support-widget__field input {
  width: 100%;
  min-height: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  color: var(--text);
  font: inherit;
  font-size: 0.86rem;
}

.support-widget__field textarea {
  min-height: 96px;
  resize: vertical;
}

.support-widget__field input {
  height: 42px;
}

.support-widget__field textarea:focus,
.support-widget__field input:focus {
  border-color: var(--accent);
  outline: none;
}

/* Своя галочка вместо системной — по той же причине, что и у радиокнопок. */
.support-widget__consent {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
  cursor: pointer;
}

.support-widget__consent input {
  position: absolute;
  width: 1px;
  height: 1px;
  min-height: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.support-widget__consent span {
  position: relative;
  padding-left: 26px;
}

.support-widget__consent span::before {
  content: '';
  position: absolute;
  top: 1px;
  left: 0;
  width: 17px;
  height: 17px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--bg-soft);
  transition: border-color 0.15s ease, background 0.15s ease;
}

.support-widget__consent span::after {
  content: '';
  position: absolute;
  top: 5px;
  left: 5px;
  width: 7px;
  height: 4px;
  border-left: 2px solid #12081f;
  border-bottom: 2px solid #12081f;
  transform: rotate(-45deg) scale(0.6);
  opacity: 0;
  transition: opacity 0.12s ease, transform 0.12s ease;
}

.support-widget__consent input:checked + span::before {
  border-color: var(--accent);
  background: var(--accent);
}

.support-widget__consent input:checked + span::after {
  opacity: 1;
  transform: rotate(-45deg) scale(1);
}

.support-widget__consent input:focus-visible + span::before {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.support-widget__error {
  margin: 0 0 10px;
  color: #ff9d9d;
  font-size: 0.78rem;
}

.support-widget__send {
  width: 100%;
  min-height: 44px;
  padding: 11px 16px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #12081f;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.support-widget__send:hover {
  filter: brightness(1.06);
}

.support-widget__send:disabled {
  opacity: 0.65;
  cursor: default;
}

.support-widget__done strong {
  display: block;
  margin-bottom: 6px;
}

.support-widget__done p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

/* Ловушка для ботов: убрана из потока и с глаз, но остаётся в форме. */
.support-widget__trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

@media (max-width: 560px) {
  .support-widget {
    right: 12px;
    bottom: 12px;
  }

  .support-widget__button-text {
    display: none;
  }

  .support-widget__button {
    padding: 12px 14px;
  }
}

.form-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 4px 0 12px;
  font-size: 0.8rem;
  line-height: 1.45;
  color: var(--muted);
  cursor: pointer;
}

/* Галочка обязана отменить всё, что общее правило полей ввода (input, select,
   textarea) навешивает на неё как на «поле»: min-height 52px, свой фон, рамку и
   внутренние отступы. Одного `height: 16px` мало — min-height не проигрывает
   высоте по специфичности, он зажимает её сверху, и галочка сидела в белесой
   полосе 16x52 с фоном текстового поля. Те же грабли, что были у радиокнопок
   виджета поддержки. */
.form-consent input {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  margin-top: 2px;
  accent-color: var(--accent);
  cursor: pointer;
}

/* Общее `input:focus` рисует кольцо в 4px вокруг рамки поля — вокруг галочки
   оно выглядит кляксой. Кольцо здесь своё, по размеру галочки, и только для
   клавиатуры: при щелчке мышью человек и так знает, куда попал. */
.form-consent input:focus {
  border: 0;
  box-shadow: none;
}

.form-consent input:focus-visible {
  outline: 2px solid rgba(167, 131, 255, 0.85);
  outline-offset: 2px;
}

/* ==========================================================================
   Движение и переходы
   Появление результата, раскрытие тем, подмена текста на ответ нейросети.
   Всё внутри @media (prefers-reduced-motion: no-preference): при системной
   настройке «уменьшить движение» интерфейс остаётся полностью статичным.
   ========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  @keyframes ms-rise {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

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

  @keyframes ms-unfold {
    from {
      opacity: 0;
      transform: translateY(-6px);
    }
    to {
      opacity: 1;
      transform: none;
    }
  }

  @keyframes ms-pulse {
    0%,
    100% {
      opacity: 1;
    }
    50% {
      opacity: 0.45;
    }
  }

  /* Результат расчёта появляется целиком, а не возникает рывком. */
  #matrixResult:not([hidden]),
  #compatibilityResult:not([hidden]),
  #tarotResult:not([hidden]) {
    animation: ms-rise 0.42s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }

  /* Темы въезжают лесенкой — глаз успевает пройти по списку сверху вниз.
     Задержка только на первых восьми: дальше она была бы уже заметной паузой. */
  .matrix-accordion .matrix-accordion-item {
    animation: ms-rise 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }

  .matrix-accordion .matrix-accordion-item:nth-child(1) { animation-delay: 0.02s; }
  .matrix-accordion .matrix-accordion-item:nth-child(2) { animation-delay: 0.05s; }
  .matrix-accordion .matrix-accordion-item:nth-child(3) { animation-delay: 0.08s; }
  .matrix-accordion .matrix-accordion-item:nth-child(4) { animation-delay: 0.11s; }
  .matrix-accordion .matrix-accordion-item:nth-child(5) { animation-delay: 0.14s; }
  .matrix-accordion .matrix-accordion-item:nth-child(6) { animation-delay: 0.17s; }
  .matrix-accordion .matrix-accordion-item:nth-child(7) { animation-delay: 0.2s; }
  .matrix-accordion .matrix-accordion-item:nth-child(n + 8) { animation-delay: 0.23s; }

  /* Раскрытие темы. Анимируется только открытие: у <details> нет состояния
     «закрывается», и попытка это подделать даёт рывок в конце. */
  .matrix-accordion-item[open] > .matrix-accordion-body {
    animation: ms-unfold 0.3s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }

  /* Подмена шаблонного текста ответом нейросети. Класс снимается в app.js
     по окончании анимации, иначе повторная подмена не проигралась бы. */
  .matrix-accordion-body--refreshed {
    animation: ms-fade 0.45s ease both;
  }

  /* Пока раздел готовится — метка мягко пульсирует. */
  .matrix-accordion-status--loading {
    animation: ms-pulse 1.5s ease-in-out infinite;
  }

  .matrix-accordion-summary,
  .matrix-accordion-status {
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
  }

  .matrix-accordion-item {
    transition: border-color 0.24s ease, transform 0.24s ease;
  }

  .matrix-accordion-item:hover {
    transform: translateY(-1px);
  }

  .btn {
    transition: transform 0.16s ease, box-shadow 0.2s ease, background-color 0.2s ease, opacity 0.2s ease;
  }

  .btn:hover:not(:disabled) {
    transform: translateY(-1px);
  }

  .btn:active:not(:disabled) {
    transform: translateY(0);
  }

  .chip {
    animation: ms-fade 0.35s ease both;
  }

  .toast {
    transition: opacity 0.25s ease, transform 0.25s ease;
  }
}

/* AI Loading Skeleton Loader */
.matrix-skeleton-loader {
  /* Внутри раскрытой темы блок ожидания упирался в верхнюю рамку карточки —
     между заголовком темы и рамкой ожидания не было ни пикселя. */
  margin-top: 12px;
  padding: 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.06);
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.skeleton-shimmer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(167, 131, 255, 0.16) 45%,
    rgba(106, 224, 255, 0.14) 55%,
    transparent 100%
  );
  /* Блик едет через transform, а не через left. Left пересчитывает раскладку
     на каждом кадре, а крутится этот блик все 20–30 секунд, пока думает
     нейросеть, — то есть ровно тогда, когда посетитель листает страницу.
     Transform обрабатывается композитором и раскладку не трогает. */
  transform: translateX(-100%);
  will-change: transform;
}

@media (prefers-reduced-motion: no-preference) {
  .skeleton-shimmer {
    animation: skeletonShimmer 1.8s infinite;
  }
}

@keyframes skeletonShimmer {
  from {
    transform: translateX(-100%);
  }
  to {
    transform: translateX(100%);
  }
}

.skeleton-text-line {
  height: 12px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  width: 100%;
}

.skeleton-text-line.short {
  width: 60%;
}

.skeleton-hint {
  font-size: 0.84rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}



/* ==========================================================================
   Переключатель языка
   Свой выпадающий список, а не <select>: нативный не умеет показывать
   картинки, а эмодзи-флаги на Windows рисуются буквами. Оформление повторяет
   пилюли навигации, чтобы элемент не выпадал из шапки.
   ========================================================================== */

.lang-switcher {
  position: relative;
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.lang-flag {
  width: 22px;
  height: 15px;
  flex: 0 0 auto;
  display: block;
  border-radius: 3px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.16);
}

/* Та же пилюля, что у ссылок навигации. */
.lang-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 42px;
  padding: 0 14px;
  white-space: nowrap;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.lang-toggle:hover,
.lang-toggle:focus-visible,
.lang-switcher.is-open .lang-toggle {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(167, 131, 255, 0.1);
  outline: none;
}

.lang-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  opacity: 0.65;
  transition: transform 0.2s ease;
}

.lang-switcher.is-open .lang-caret {
  transform: rotate(180deg);
}

.lang-list {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  z-index: 80;
  min-width: 210px;
  margin: 0;
  padding: 8px;
  /* Обнуляем маркеры явно: без этого список показывает точки. */
  list-style: none;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--panel-strong);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.lang-list[hidden] {
  display: none;
}

.lang-option {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.9rem;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}

.lang-option:hover,
.lang-option:focus-visible {
  color: var(--text);
  background: rgba(167, 131, 255, 0.14);
  outline: none;
}

.lang-option.is-selected {
  color: var(--text);
  background: rgba(167, 131, 255, 0.2);
  font-weight: 600;
}

/* Галочка у выбранного языка — понятнее, чем только заливка. */
.lang-option.is-selected::after {
  content: '';
  margin-left: auto;
  width: 6px;
  height: 10px;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) translate(-1px, -1px);
}

@media (prefers-reduced-motion: no-preference) {
  .lang-list {
    animation: ms-unfold 0.18s ease both;
  }
}

@media (max-width: 860px) {
  .lang-toggle-label {
    display: none;
  }

  .lang-toggle {
    gap: 6px;
    padding: 0 11px;
  }
}

/* Кнопка углублённого разбора темы.
   Отделена от текста линией и прижата вправо — так она читается как действие
   по теме, а не как часть разбора. */
.matrix-topic-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.matrix-topic-detail-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.matrix-topic-detail-icon {
  font-size: 0.95em;
  line-height: 1;
}

.matrix-topic-detail-btn:disabled {
  opacity: 0.65;
  cursor: progress;
}


.matrix-health-disclaimer {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 16px 0 20px;
  padding: 12px 16px;
  border-radius: 12px;
  background: rgba(154, 122, 255, 0.07);
  border: 1px solid rgba(154, 122, 255, 0.16);
  color: var(--text-muted, rgba(255, 255, 255, 0.72));
  font-size: 0.84rem;
  line-height: 1.45;
}

.matrix-health-disclaimer-icon {
  font-size: 1rem;
  flex-shrink: 0;
  margin-top: 1px;
  opacity: 0.85;
}

.matrix-health-ai {
  margin-top: 24px;
}

.matrix-health-ai p {
  margin-bottom: 1em;
  line-height: 1.6;
}
.matrix-health-ai p:last-child {
  margin-bottom: 0;
}
/* cache buster */




/* ==========================================================================
   Health AI Redesign — 3 Functional Visual Zones (5 Focused Sections)
   ========================================================================== */

.health-ai-container {
  display: grid;
  gap: 16px;
  margin-top: 16px;
}

/* Typography & Chip Fix: clean, elegant mini-badges without underline */
.health-ai-container .ai-mention {
  position: relative;
  display: inline-block;
  padding: 1px 6px 2px;
  margin: 0 2px;
  height: auto;
  line-height: 1.35;
  border-radius: 5px;
  background: rgba(147, 112, 219, 0.15);
  box-shadow: inset 0 0 0 1px rgba(147, 112, 219, 0.24);
  color: #c4b5fd;
  font-weight: 600;
  font-size: 0.92em;
  vertical-align: baseline;
  white-space: nowrap;
  text-decoration: none;
  cursor: help;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}

.health-ai-container .ai-mention:hover,
.health-ai-container .ai-mention:focus {
  background: rgba(147, 112, 219, 0.28);
  box-shadow: inset 0 0 0 1px rgba(167, 139, 250, 0.45);
}

.health-ai-container .ai-mention__glyph {
  margin-right: 3px;
  color: var(--accent);
  font-size: 0.82em;
  line-height: 1;
  opacity: 0.9;
  vertical-align: baseline;
  display: inline-block;
}

/* Zone 1: Metrics & Overview */
.health-ai-zone--metrics {
  display: grid;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
}

.health-ai-metrics-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

@media (max-width: 640px) {
  .health-ai-metrics-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}

.health-ai-metric-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.health-ai-metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.health-ai-metric-label {
  font-size: 0.84rem;
  color: var(--muted, rgba(255, 255, 255, 0.65));
  font-weight: 500;
}

.health-ai-metric-val {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text, #fff);
  font-variant-numeric: tabular-nums;
}

.health-ai-metric-bar {
  height: 5px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.health-ai-metric-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.4s ease;
}

.health-ai-metric-fill--physical {
  background: linear-gradient(90deg, #ff4d79, #ff7a9e);
}

.health-ai-metric-fill--energy {
  background: linear-gradient(90deg, #3dd2ff, #7ae2ff);
}

.health-ai-metric-fill--emotions {
  background: linear-gradient(90deg, #9a7aff, #ba9eff);
}

.health-ai-overview-text {
  font-size: 0.92rem;
  line-height: 1.65;
  color: var(--text-muted, rgba(255, 255, 255, 0.84));
  padding-top: 6px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.health-ai-overview-text p {
  margin: 0;
}

/* Zone 2: Analysis Grid */
.health-ai-zone--analysis {
  display: grid;
  gap: 14px;
}

.health-ai-analysis-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}

@media (max-width: 720px) {
  .health-ai-analysis-row {
    grid-template-columns: 1fr;
  }
}

.health-ai-card {
  padding: 16px 18px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.07);
  display: grid;
  gap: 10px;
}

.health-ai-card h5 {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text, #fff);
}

.health-ai-card p {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--text-muted, rgba(255, 255, 255, 0.78));
}

.health-ai-card p + p {
  margin-top: 6px;
}

.health-ai-card--strong {
  background: linear-gradient(145deg, rgba(154, 122, 255, 0.08), rgba(255, 255, 255, 0.02));
  border-color: rgba(154, 122, 255, 0.2);
}

.health-ai-card--contrast {
  background: linear-gradient(145deg, rgba(61, 210, 255, 0.08), rgba(255, 255, 255, 0.02));
  border-color: rgba(61, 210, 255, 0.2);
}

/* Zone 3: Outcome & Action Hero Block */
.health-ai-zone--action {
  margin-top: 2px;
}

.health-ai-hero-action {
  padding: 20px 22px;
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(154, 122, 255, 0.12) 0%, rgba(61, 210, 255, 0.07) 100%);
  border: 1px solid rgba(154, 122, 255, 0.35);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.25);
  display: grid;
  gap: 16px;
}

.health-ai-action-subblock {
  display: grid;
  gap: 8px;
}

.health-ai-action-subblock--theory {
  padding-bottom: 2px;
}

/* Enhanced action card with luminous left accent border & gradient */
.health-ai-action-subblock--practice {
  background: linear-gradient(135deg, rgba(139, 92, 246, 0.22) 0%, rgba(61, 210, 255, 0.09) 100%);
  border: 1px solid rgba(139, 92, 246, 0.4);
  border-left: 3.5px solid #a78bfa;
  border-radius: 14px;
  padding: 16px 18px;
  box-shadow: 0 6px 22px rgba(139, 92, 246, 0.12);
}

.health-ai-action-header {
  display: flex;
  align-items: center;
  gap: 10px;
}

.health-ai-action-header h5 {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--text, #fff);
}

.health-ai-action-subblock--practice .health-ai-action-header h5 {
  color: #f3e8ff;
  font-size: 1.02rem;
}

.health-ai-action-glyph {
  font-size: 1rem;
}

.health-ai-action-glyph--pulse {
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #9a7aff;
  color: #fff;
  font-size: 0.82rem;
  box-shadow: 0 0 12px rgba(154, 122, 255, 0.6);
}

.health-ai-action-subblock p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.65;
  color: var(--text-muted, rgba(255, 255, 255, 0.86));
}

.health-ai-action-subblock--practice p {
  color: #f5eeff;
  font-weight: 450;
}

.health-ai-action-divider {
  height: 1px;
  background: linear-gradient(90deg, rgba(154, 122, 255, 0.3), rgba(61, 210, 255, 0.3), transparent);
  margin: 2px 0;
}

.health-ai-point {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0 0 8px;
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text-muted, rgba(255, 255, 255, 0.82));
}

.health-ai-point:last-child {
  margin-bottom: 0;
}

.health-ai-point-bullet {
  color: #a78bfa;
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
  transform: translateY(1px);
}

.health-ai-point-content {
  flex: 1;
}

.health-ai-action-subblock--practice .health-ai-point {
  font-size: 0.9rem;
  color: #f5eeff;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

.health-ai-action-subblock--practice .health-ai-point:last-child {
  margin-bottom: 0;
}

/* --- Full Health Audit Deep Dive CTA & Container --- */
/* --- Full Health Audit Results Section --- */
.health-ai-full-result {
  margin-top: 28px;
  animation: fadeIn 0.4s ease-out;
}

.health-full-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}


/* --- Health Symbolic Disclaimer Card --- */
.health-disclaimer-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 10px;
  background: rgba(147, 112, 219, 0.08);
  border: 1px solid rgba(147, 112, 219, 0.2);
  margin-bottom: 20px;
  font-size: 0.86rem;
  line-height: 1.5;
  color: #d1d5db;
}

.health-disclaimer-icon {
  font-size: 1rem;
  flex-shrink: 0;
}

.health-note-medical { display: none !important;
  font-size: 0.85rem;
  line-height: 1.5;
  color: #9ca3af;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  margin-top: 10px;
}

.health-full-hero-header {
  padding: 16px 20px;
  background: rgba(147, 112, 219, 0.08);
  border-left: 4px solid #a78bfa;
  border-radius: 10px;
  margin-bottom: 8px;
}

.health-full-hero-header h4 {
  margin: 0 0 4px 0;
  font-size: 1.18rem;
  color: #ede9fe;
}

.health-full-hero-header p {
  margin: 0;
  font-size: 0.9rem;
  color: #c4b5fd;
}

.health-full-section-card {
  padding: 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.health-full-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 16px 0;
  font-size: 1.08rem;
  font-weight: 700;
  color: #f3e8ff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding-bottom: 10px;
}

.health-full-section-title .section-glyph {
  color: #a78bfa;
}

.health-full-card-content {
  font-size: 0.92rem;
  line-height: 1.6;
  color: #e5e7eb;
}

/* Clean text inside full card content without nested gray boxes */
.health-full-card-content p {
  margin-bottom: 12px;
  line-height: 1.6;
}
.health-full-card-content p:last-child {
  margin-bottom: 0;
}


/* --- Cohesive Monolithic 7 Chakra Cards --- */
.health-full-chakras-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.health-full-chakra-card {
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.16);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.health-full-chakra-card:hover {
  border-color: rgba(167, 139, 250, 0.35);
  background: rgba(255, 255, 255, 0.05);
}

.health-full-chakra-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.health-full-chakra-glyph {
  color: #a78bfa;
  font-size: 0.95rem;
}

.health-chakra-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.health-full-chakra-name {
  font-size: 1.02rem;
  font-weight: 700;
  color: #f5f3ff;
  letter-spacing: 0.03em;
}

.health-full-chakra-center {
  font-size: 0.88rem;
  color: #c4b5fd;
  font-weight: 500;
}

.health-full-chakra-metrics {
  font-size: 0.88rem;
  color: #c4b5fd;
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-weight: 500;
  letter-spacing: 0.01em;
}

.health-full-chakra-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.health-full-chakra-line {
  font-size: 0.91rem;
  line-height: 1.5;
  color: #e5e7eb;
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.health-line-icon {
  font-size: 0.95rem;
  flex-shrink: 0;
  transform: translateY(1px);
}

.health-line-minus-label {
  color: #fca5a5;
}

.health-line-trigger-label {
  color: #fde68a;
}


/* --- Protocol Grid & Cards --- */
.health-full-protocol-grid {
  display: flex;
  flex-direction: column;
  gap: 14px;
  width: 100%;
}

.health-full-protocol-item {
  width: 100%;
  box-sizing: border-box;
  padding: 16px 20px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 4px solid #a78bfa;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
}

.health-full-protocol-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.health-full-protocol-glyph {
  font-size: 1.1rem;
}

.health-full-protocol-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #f3e8ff;
}

.health-full-protocol-body {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #e5e7eb;
}


/* Perfect baseline alignment for all mention badges across the app */
.health-full-chakra-card .ai-mention,
.health-ai-container .ai-mention,
.matrix-topic-content .ai-mention,
.ai-mention {
  vertical-align: baseline !important;
  display: inline-block !important;
  line-height: 1.25 !important;
}


.health-full-section-card--chakras {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
}


.health-full-chakra-narrative {
  font-size: 0.93rem;
  line-height: 1.6;
  color: #e5e7eb;
}

.health-full-chakra-narrative p {
  margin: 0;
  line-height: 1.6;
}

/* --- Compatibility AI Actions & Full Audit Styling --- */
.compatibility-topic-actions {
  margin-top: 16px;
  margin-bottom: 20px;
  display: flex;
  justify-content: center;
}

.matrix-topic-actions--compat-full {
  margin-top: 24px;
  margin-bottom: 16px;
  display: flex;
  justify-content: center;
}

.compatibility-ai-full-result {
  margin-top: 24px;
  animation: fadeIn 0.4s ease-out;
}

.compatibility-ai-full-container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.compatibility-ai-section--full {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 16px 20px;
}

.compatibility-ai-section--full h5 {
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 10px;
  color: #c4b5fd;
  display: flex;
  align-items: center;
  gap: 8px;
}

.compatibility-retry-btn {
  margin-top: 10px;
}



/* Compatibility Why Score & Factors */
.compatibility-why-score {
  margin-top: 18px;
  padding: 16px 18px;
  border-radius: var(--radius-md, 14px);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.compatibility-why-score-header {
  margin-bottom: 12px;
}

.compatibility-why-score-header .matrix-insights-kicker {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
}

.compatibility-factors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.compatibility-factors-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.compatibility-factors-heading {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.compatibility-factors-col--strengths .compatibility-factors-heading {
  color: #a7f3d0;
}

.compatibility-factors-col--frictions .compatibility-factors-heading {
  color: #fed7aa;
}

.compatibility-factors-dot--strength {
  color: #34d399;
  font-weight: bold;
}

.compatibility-factors-dot--friction {
  color: #fb923c;
  font-weight: bold;
}

.compatibility-factors-list {
  margin: 0;
  padding: 0 0 0 16px;
  list-style: disc;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.compatibility-factors-list li {
  font-size: 0.86rem;
  line-height: 1.5;
  color: #d1d5db;
}

.compatibility-factors-list strong {
  color: #fff;
  font-weight: 600;
}

/* Compatibility AI Enhanced Section Cards */
.compatibility-ai-section--insight {
  border: 1px solid rgba(167, 139, 250, 0.28) !important;
  background: linear-gradient(135deg, rgba(167, 139, 250, 0.07) 0%, rgba(255, 255, 255, 0.02) 100%) !important;
  box-shadow: 0 4px 20px -2px rgba(139, 92, 246, 0.12);
  border-radius: var(--radius-md, 14px);
  position: relative;
}

.compatibility-ai-section--insight h4 {
  color: #c4b5fd !important;
}

.compatibility-ai-section--recs {
  border: 1px solid rgba(52, 211, 153, 0.25) !important;
  background: linear-gradient(135deg, rgba(52, 211, 153, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%) !important;
  box-shadow: 0 4px 20px -2px rgba(16, 185, 129, 0.1);
  border-radius: var(--radius-md, 14px);
}

.compatibility-ai-section--recs h4 {
  color: #a7f3d0 !important;
}

.compatibility-ai-section--recs ol,
.compatibility-ai-section--recs ul {
  margin: 10px 0 0 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.compatibility-ai-section--recs li {
  line-height: 1.55;
  color: #e5e7eb;
}

/* Compatibility Submeters Tip */
.compatibility-submeters-tip {
  margin-top: 10px;
  font-size: 0.79rem;
  line-height: 1.45;
  color: #9ca3af;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.02);
  border-radius: 8px;
  border-left: 2px solid #8b5cf6;
}

/* Compatibility Why Score Contrast */
.compatibility-why-score-contrast {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.85rem;
  line-height: 1.5;
  color: #e2e8f0;
}

.compatibility-why-score-contrast-label {
  font-weight: 700;
  color: #fbbf24;
}

/* Compatibility AI Section Loop */
.compatibility-ai-section--loop {
  border: 1px solid rgba(245, 158, 11, 0.25) !important;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.05) 0%, rgba(255, 255, 255, 0.02) 100%) !important;
  box-shadow: 0 4px 20px -2px rgba(245, 158, 11, 0.08);
  border-radius: var(--radius-md, 14px);
}

.compatibility-ai-section--loop h4 {
  color: #fcd34d !important;
}

/* Numbered Reading List Items */
.ai-reading-list-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 6px 0;
  line-height: 1.55;
  color: #e5e7eb;
}

.ai-reading-list-num {
  font-weight: 700;
  color: #34d399;
  font-size: 0.92rem;
  flex-shrink: 0;
}

.ai-reading-list-text {
  flex: 1;
}

/* Compatibility Accordion Cards */
.compatibility-accordion-item {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-md, 14px);
  background: rgba(255, 255, 255, 0.03);
  margin-bottom: 12px;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.compatibility-accordion-item:hover {
  border-color: rgba(255, 255, 255, 0.16);
}

.compatibility-accordion-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  cursor: pointer;
  user-select: none;
  list-style: none;
}

.compatibility-accordion-summary::-webkit-details-marker {
  display: none;
}

.compatibility-accordion-summary h4 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
}

.compatibility-accordion-chevron {
  font-size: 1.15rem;
  color: rgba(255, 255, 255, 0.45);
  transition: transform 0.25s ease;
  line-height: 1;
  font-weight: 600;
}

.compatibility-accordion-item[open] .compatibility-accordion-chevron {
  transform: rotate(180deg);
}

.compatibility-accordion-content {
  padding: 2px 18px 16px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.04);
}


/* Matrix Topic Microformats & Badges */
.matrix-topic-arcana-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: rgba(147, 51, 234, 0.12);
  border: 1px solid rgba(168, 85, 247, 0.35);
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 600;
  color: #e9d5ff;
  margin-bottom: 12px;
  letter-spacing: 0.02em;
  box-shadow: 0 2px 10px rgba(147, 51, 234, 0.15);
}

.matrix-topic-insight-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 16px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.035);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-left: 3px solid #c084fc;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.matrix-topic-insight-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(168, 85, 247, 0.3);
  border-left-color: #e879f9;
}

.matrix-topic-insight-label {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #c084fc;
}

.matrix-topic-insight-val {
  font-size: 0.92rem;
  color: var(--text, #f1f5f9);
  line-height: 1.55;
}
