/* Основные стили. Цвета и размеры — только через токены из tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--c-bg);
  color: var(--c-text);
  font: var(--fs-text)/1.5 var(--f-ui);
  min-height: 100dvh;
}
h1, h2, h3 { font-family: var(--f-display); font-weight: 600; line-height: 1.15; margin: 0 0 var(--sp-2); }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: 20px; }
p { margin: 0 0 var(--sp-3); }
a { color: var(--c-primary); }
.muted { color: var(--c-muted); }
.small { font-size: var(--fs-small); }
:focus-visible { outline: 2px solid var(--c-primary); outline-offset: 2px; box-shadow: 0 0 0 6px var(--glow-color); }

/* ---------- Оболочка ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(env(safe-area-inset-top) + var(--sp-2)) var(--sp-4) var(--sp-2);
  background: color-mix(in srgb, var(--c-bg) 88%, transparent);
  backdrop-filter: blur(8px);
}
.brand { display: flex; align-items: center; gap: var(--sp-2); text-decoration: none; color: var(--c-text); }
.brand svg { width: 26px; height: 26px; }
.brand span { font-family: var(--f-display); font-size: 20px; letter-spacing: .28em; }
.icon-btn {
  width: var(--tap); height: var(--tap); border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--c-linen); background: var(--c-surface); color: var(--c-text);
  cursor: pointer; padding: 0;
}
.icon-btn svg { width: 22px; height: 22px; }

main {
  max-width: var(--content-max); margin: 0 auto;
  padding: var(--sp-2) var(--sp-4) calc(var(--nav-h) + env(safe-area-inset-bottom) + var(--sp-5));
}

.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: flex; justify-content: center;
  background: var(--c-surface);
  border-top: 1px solid var(--c-linen);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottom-nav .inner { display: flex; width: 100%; max-width: var(--content-max); }
.bottom-nav a {
  flex: 1; min-height: var(--nav-h);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--c-muted); text-decoration: none; font-size: 11px;
}
.bottom-nav a svg { width: 24px; height: 24px; }
.bottom-nav a[aria-current="page"] { color: var(--c-primary); font-weight: 600; }

/* ---------- Компоненты ---------- */
.card {
  position: relative;
  background: var(--c-surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
  padding: var(--sp-4);
  margin-bottom: var(--sp-3);
  overflow: hidden;
}
.card.soft { background: var(--c-linen); box-shadow: none; }
.card-title { font-family: var(--f-display); font-size: 20px; margin: 0 0 var(--sp-1); }
.eyebrow { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--c-muted); margin-bottom: var(--sp-1); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--sp-2);
  min-height: var(--tap); padding: 0 var(--sp-5);
  border-radius: var(--r-btn); border: 1px solid var(--c-primary);
  background: var(--c-primary); color: var(--c-primary-ink);
  font: 600 15px var(--f-ui); cursor: pointer; text-decoration: none;
}
.btn.secondary { background: transparent; color: var(--c-primary); }
.btn.block { display: flex; width: 100%; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
.stack > * + * { margin-top: var(--sp-3); }

.affirmation {
  font-family: var(--f-display); font-size: 24px; line-height: 1.25; margin: var(--sp-2) 0 0;
}

/* Плашка заглушки: видна всегда, чтобы заглушку нельзя было принять за готовое */
.stub-badge {
  display: inline-block; vertical-align: middle;
  font: 700 10px/1 var(--f-ui); letter-spacing: .08em;
  color: #fff; background: var(--c-stub);
  padding: 4px 6px; border-radius: 4px; margin-left: var(--sp-2);
}
.stub-banner {
  background: color-mix(in srgb, var(--c-stub) 12%, var(--c-surface));
  border: 1px dashed var(--c-stub); color: var(--c-text);
  border-radius: 12px; padding: var(--sp-3); margin-bottom: var(--sp-3); font-size: var(--fs-small);
}

.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-2) 0; border-bottom: 1px solid var(--c-linen); }
.list li:last-child { border-bottom: 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; }
.list .value { margin-left: auto; color: var(--c-muted); font-variant-numeric: tabular-nums; }

/* ---------- Колесо ---------- */
.wheel { display: block; width: 100%; max-width: 400px; margin: 0 auto; }
.wheel text { font: 13px var(--f-ui); fill: var(--c-muted); }

/* ---------- Вход ---------- */
.login { text-align: center; padding-top: var(--sp-6); }
.login .star { width: 72px; height: 72px; margin: 0 auto var(--sp-4); color: var(--c-gold); }
.login .tg-slot { min-height: 48px; display: flex; justify-content: center; }

/* ---------- «Живой свет» ---------- */
[data-glow] { position: relative; isolation: isolate; }
.glow-layer {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  opacity: 0; transition: opacity var(--glow-out) ease;
  background: radial-gradient(circle var(--glow-radius) at var(--gx, 50%) var(--gy, 50%), var(--glow-color), transparent 100%);
}
.glow-layer.on { opacity: 1; transition-duration: var(--glow-in); }
@media (prefers-reduced-motion: reduce) { .glow-layer { transition: none; } }
html.reduce-motion .glow-layer { transition: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(var(--nav-h) + env(safe-area-inset-bottom) + var(--sp-4));
  transform: translateX(-50%); z-index: 20;
  background: var(--c-text); color: #fff; padding: var(--sp-2) var(--sp-4); border-radius: 12px;
  font-size: 14px; max-width: calc(100% - 32px);
}

/* ---------- Квиз ---------- */
.link-btn {
  background: none; border: 0; padding: 0 var(--sp-1); min-height: var(--tap);
  color: var(--c-primary); font: 600 15px var(--f-ui); cursor: pointer;
}
.quiz-top { display: flex; align-items: center; justify-content: space-between; }
.progress { height: 4px; background: var(--c-linen); border-radius: 2px; overflow: hidden; margin: var(--sp-1) 0 var(--sp-5); }
.progress span { display: block; height: 100%; background: var(--c-gold); transition: width .3s ease; }
html.reduce-motion .progress span { transition: none; }
.chip {
  display: inline-flex; align-items: center; gap: var(--sp-2);
  font-size: var(--fs-small); color: var(--c-muted);
  background: var(--c-surface); border: 1px solid var(--c-linen); border-radius: var(--r-btn);
  padding: var(--sp-1) var(--sp-3); margin-bottom: var(--sp-3);
}
.chip .dot { width: 10px; height: 10px; }
.question { font-size: 26px; margin: 0 0 var(--sp-5); min-height: 3.5em; outline: none; }
.options { display: grid; gap: var(--sp-2); }
.option {
  min-height: 52px; padding: var(--sp-3) var(--sp-4);
  text-align: left; font: 500 16px var(--f-ui); color: var(--c-text);
  background: var(--c-surface); border: 1px solid var(--c-linen); border-radius: 14px;
  cursor: pointer; box-shadow: var(--shadow);
}
.option[aria-pressed="true"] { border-color: var(--c-primary); background: color-mix(in srgb, var(--c-sage) 35%, var(--c-surface)); font-weight: 700; }
.option.quiet { background: transparent; box-shadow: none; border-style: dashed; color: var(--c-muted); }
.quiz-extra { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-3); margin-top: var(--sp-3); }
.quiz-extra .option.quiet { min-height: var(--tap); padding: 0 var(--sp-4); }
.quiz-extra .link-btn:last-child { margin-left: auto; }
.disclaimer { margin-top: var(--sp-5); }

/* ---------- Баланс ---------- */
.segmented { display: flex; background: var(--c-linen); border-radius: var(--r-btn); padding: 4px; margin-bottom: var(--sp-3); }
.segmented button {
  flex: 1; min-height: 40px; border: 0; border-radius: var(--r-btn); background: transparent;
  font: 600 14px var(--f-ui); color: var(--c-muted); cursor: pointer;
}
.segmented button[aria-selected="true"] { background: var(--c-surface); color: var(--c-text); box-shadow: var(--shadow); }
.segmented button:disabled { cursor: not-allowed; }
.overall { text-align: center; margin: var(--sp-2) 0 0; }
.overall strong { font-family: var(--f-display); font-size: 26px; }
.note { padding: 0 var(--sp-2); }
.focus { border-left: 4px solid var(--sector, var(--c-gold)); }
.sector-row {
  display: flex; align-items: center; gap: var(--sp-3); width: 100%; min-height: var(--tap);
  background: none; border: 0; padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.sector-list li { padding: 0; }
.sector-row[aria-pressed="true"] { font-weight: 700; }
.themes { list-style: none; padding: 0; margin: var(--sp-2) 0 var(--sp-3); }
.themes li { margin-bottom: var(--sp-3); }
.themes p { margin: 0 0 var(--sp-1); }
.theme-head { display: flex; justify-content: space-between; align-items: baseline; }
.bar { height: 6px; background: var(--c-linen); border-radius: 3px; overflow: hidden; }
.bar span { display: block; height: 100%; background: var(--sector, var(--c-gold)); }

/* ---------- Главная ---------- */
a.card { display: block; color: inherit; text-decoration: none; }
.focus-name { display: flex; align-items: center; gap: var(--sp-2); font-family: var(--f-display); font-size: 24px; }
.focus-name .chevron { margin-left: auto; color: var(--c-muted); font-family: var(--f-ui); }
