/* ==========================================================================
   Security Check — власні стилі поверх Pico CSS
   ========================================================================== */

/* ---------- Токени: світла тема ---------- */
:root {
  --accent: #4338ca;
  --accent-hover: #3730a3;
  --accent-soft: #eef0ff;
  --accent-ring: rgba(67, 56, 202, .28);
  --surface: #ffffff;
  --surface-2: #f6f7fb;
  --border: #e3e5ef;
  --text: #1b1d2a;
  --muted: #5d6275;

  --risk: #dc2626;      --risk-soft: #fdecec;
  --gaps: #d97706;      --gaps-soft: #fdf3e2;
  --good: #16a34a;      --good-soft: #e8f6ed;
  --excellent: #0d9488; --excellent-soft: #e2f5f3;

  --radius: 14px;
  --shadow: 0 1px 2px rgba(20, 22, 40, .05), 0 6px 24px rgba(20, 22, 40, .06);

  --pico-font-family: "Inter Variable", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --pico-font-family-sans-serif: var(--pico-font-family);
  --pico-border-radius: 10px;
}

/* ---------- Токени: темна тема ---------- */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --accent: #8b93ff;
    --accent-hover: #a5abff;
    --accent-soft: #23264a;
    --accent-ring: rgba(139, 147, 255, .35);
    --surface: #181a26;
    --surface-2: #11131c;
    --border: #2b2e40;
    --text: #e8e9f1;
    --muted: #a0a4b8;
    --risk: #f87171;      --risk-soft: #3a1d22;
    --gaps: #fbbf24;      --gaps-soft: #3a2e17;
    --good: #4ade80;      --good-soft: #17331f;
    --excellent: #2dd4bf; --excellent-soft: #123330;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 28px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --accent: #8b93ff; --accent-hover: #a5abff; --accent-soft: #23264a; --accent-ring: rgba(139,147,255,.35);
  --surface: #181a26; --surface-2: #11131c; --border: #2b2e40; --text: #e8e9f1; --muted: #a0a4b8;
  --risk: #f87171; --risk-soft: #3a1d22; --gaps: #fbbf24; --gaps-soft: #3a2e17;
  --good: #4ade80; --good-soft: #17331f; --excellent: #2dd4bf; --excellent-soft: #123330;
}

/* Pico: підставляємо наш акцент. Селектор сильніший за Pico-шний :root:not([data-theme=dark]). */
html:root:not([data-sc]),
html[data-theme] {
  --pico-primary: var(--accent);
  --pico-primary-background: var(--accent);
  --pico-primary-border: var(--accent);
  --pico-primary-hover: var(--accent-hover);
  --pico-primary-hover-background: var(--accent-hover);
  --pico-primary-hover-border: var(--accent-hover);
  --pico-primary-focus: var(--accent-ring);
  --pico-primary-inverse: #fff;
  --pico-background-color: var(--surface-2);
  --pico-color: var(--text);
  --pico-muted-color: var(--muted);
}
@media (prefers-color-scheme: dark) {
  html:root:not([data-theme="light"]) { --pico-primary-inverse: #11131c; }
}

body {
  background: var(--surface-2);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1; }

.container { max-width: 760px; padding-inline: 16px; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Шапка ---------- */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-block: 10px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--text); text-decoration: none; font-weight: 650; font-size: 1rem;
  min-width: 0;
}
.brand-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-icon {
  width: 30px; height: 30px; flex: none; padding: 5px; border-radius: 8px;
  background: var(--accent); fill: none; stroke: #fff; stroke-width: 2;
  stroke-linecap: round; stroke-linejoin: round;
}
.lang-picker { margin: 0; flex: none; }
.lang-picker select:not([multiple]) {
  margin: 0; padding: 6px 40px 6px 12px; font-size: .9rem; height: auto;
  min-width: 0; width: auto;
}

/* ---------- Картка ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(20px, 4vw, 36px);
  margin-block: 24px;
}

/* ---------- Вступ ---------- */
.intro { text-align: center; }
.intro-icon {
  width: 72px; height: 72px; margin: 0 auto 16px; padding: 14px; border-radius: 20px;
  background: var(--accent-soft); fill: none; stroke: var(--accent); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; display: block;
}
.intro h1 { font-size: clamp(1.6rem, 5vw, 2.2rem); margin-bottom: .4em; letter-spacing: -.01em; }
.intro .tagline { color: var(--muted); font-size: 1.08rem; max-width: 34em; margin-inline: auto; }
.facts {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  list-style: none; padding: 0; margin: 20px 0 28px;
}
.facts li {
  list-style: none; margin: 0;
  background: var(--surface-2); border: 1px solid var(--border);
  padding: 6px 14px; border-radius: 999px; font-size: .9rem; color: var(--muted);
}
.privacy-note {
  display: flex; gap: 10px; align-items: flex-start; text-align: left;
  background: var(--accent-soft); border-radius: 10px; padding: 12px 14px;
  font-size: .92rem; margin: 24px auto 0; max-width: 34em;
}
.privacy-note svg { flex: none; width: 20px; height: 20px; margin-top: 2px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.btn-lg { padding: 14px 32px; font-size: 1.05rem; font-weight: 600; }

/* ---------- Профіль ---------- */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 24px; border: 0; padding: 0; }
.chip-group legend { font-weight: 600; margin-bottom: 10px; }
.chip { position: relative; margin: 0; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 16px; border-radius: 999px; cursor: pointer; user-select: none;
  border: 1.5px solid var(--border); background: var(--surface);
  font-size: .95rem; transition: border-color .15s, background .15s;
}
.chip span::before {
  content: ""; width: 14px; height: 14px; border-radius: 4px; border: 1.5px solid var(--muted);
  transition: all .15s; flex: none;
}
.chip input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.chip input:checked + span::before {
  content: "✓"; color: #fff; background: var(--accent); border-color: var(--accent);
  display: grid; place-items: center; font-size: 11px; font-weight: 800; line-height: 1;
}
.chip input:focus-visible + span { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.form-error { color: var(--risk); font-size: .9rem; margin-top: -12px; }

/* ---------- Запитання ---------- */
.progress-wrap { margin-bottom: 18px; }
.progress-meta {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  font-size: .85rem; color: var(--muted); margin-bottom: 8px;
}
.area-chip {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent-soft); color: var(--accent);
  padding: 3px 10px; border-radius: 999px; font-weight: 600; font-size: .8rem;
}
.area-chip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.progress {
  height: 6px; background: var(--border); border-radius: 999px; overflow: hidden;
}
.progress > div {
  height: 100%; background: var(--accent); border-radius: inherit;
  transition: width .3s ease;
}

.q-head { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
.q-title { font-size: clamp(1.12rem, 3.6vw, 1.35rem); line-height: 1.4; margin: 0; flex: 1; font-weight: 650; }
.hint-btn {
  flex: none; width: 34px; height: 34px; padding: 0; margin: 0; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--accent-soft); color: var(--accent); border: 1.5px solid transparent;
  font-weight: 700; font-family: Georgia, serif; font-style: italic; font-size: 1.05rem;
  cursor: pointer; transition: border-color .15s;
}
.hint-btn:hover, .hint-btn[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.hint {
  background: var(--accent-soft); border-left: 4px solid var(--accent);
  border-radius: 8px; padding: 12px 14px; margin: -4px 0 18px; font-size: .95rem;
  animation: fade-in .2s ease;
}
.hint p { margin: 0 0 8px; }
.hint button { padding: 4px 12px; font-size: .85rem; margin: 0; }
@keyframes fade-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.options { display: grid; gap: 10px; border: 0; padding: 0; margin: 0 0 24px; }
.option { position: relative; margin: 0; display: block; width: 100%; }
.option input { position: absolute; opacity: 0; pointer-events: none; }
.option span {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; min-height: 52px;
  border: 1.5px solid var(--border); border-radius: 12px;
  background: var(--surface); cursor: pointer; line-height: 1.4;
  transition: border-color .15s, background .15s, transform .05s;
}
.option span::before {
  content: ""; flex: none; width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid var(--muted); transition: all .15s;
}
.option:hover span { border-color: var(--accent); }
.option input:checked + span { border-color: var(--accent); background: var(--accent-soft); }
.option input:checked + span::before { border-color: var(--accent); box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 10px var(--accent); }
.option input:focus-visible + span { outline: 3px solid var(--accent-ring); outline-offset: 2px; }
.option span:active { transform: scale(.995); }

.nav-row { display: flex; justify-content: space-between; gap: 12px; }
.nav-row button { margin: 0; min-width: 120px; }
.nav-row .secondary { background: transparent; color: var(--muted); border-color: var(--border); }
.nav-row .secondary:hover { color: var(--text); border-color: var(--muted); background: transparent; }

/* ---------- Результат ---------- */
.result-hero {
  display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center;
}
.score-ring { width: 150px; height: 150px; position: relative; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 12; }
.score-ring .track { stroke: var(--border); }
.score-ring .bar { stroke: var(--lvl); stroke-linecap: round; transition: stroke-dashoffset 1s ease; }
.score-num {
  position: absolute; inset: 0; display: grid; place-content: center; text-align: center;
}
.score-num strong { font-size: 2.6rem; line-height: 1; font-weight: 750; color: var(--lvl); }
.score-num small { color: var(--muted); font-size: .8rem; }
.level-badge {
  display: inline-block; background: var(--lvl-soft); color: var(--lvl);
  padding: 4px 12px; border-radius: 999px; font-weight: 700; font-size: .9rem; margin-bottom: 8px;
}
.result-hero h1 { font-size: 1.5rem; margin-bottom: .3em; }
.result-hero p { margin: 0; color: var(--muted); }

.lvl-risk      { --lvl: var(--risk);      --lvl-soft: var(--risk-soft); }
.lvl-gaps      { --lvl: var(--gaps);      --lvl-soft: var(--gaps-soft); }
.lvl-good      { --lvl: var(--good);      --lvl-soft: var(--good-soft); }
.lvl-excellent { --lvl: var(--excellent); --lvl-soft: var(--excellent-soft); }

.areas-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 24px; align-items: center; }
.radar { width: 100%; height: auto; overflow: visible; }
.radar .grid { fill: none; stroke: var(--border); stroke-width: 1; }
.radar .axis { stroke: var(--border); stroke-width: 1; }
.radar .shape { fill: var(--accent); fill-opacity: .18; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; }
.radar .dot { fill: var(--accent); }
.radar text { fill: var(--muted); font-size: 13px; font-family: var(--pico-font-family); }

.area-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.area-list li { list-style: none; margin: 0; }
.area-row { display: flex; justify-content: space-between; gap: 8px; font-size: .92rem; margin-bottom: 4px; }
.area-row b { color: var(--lvl); font-variant-numeric: tabular-nums; }
.area-bar { height: 8px; background: var(--border); border-radius: 999px; overflow: hidden; }
.area-bar > div { height: 100%; background: var(--lvl); border-radius: inherit; }

.plan h2 { font-size: 1.15rem; display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.plan h2 .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--lvl); flex: none; }
.plan .plan-hint { color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
.plan-section + .plan-section { margin-top: 28px; }
.advice {
  --pico-accordion-close-summary-color: var(--text);
  --pico-accordion-open-summary-color: var(--text);
  --pico-accordion-active-summary-color: var(--accent);
  border: 1px solid var(--border); border-left: 4px solid var(--lvl);
  border-radius: 10px; background: var(--surface); margin-bottom: 10px; padding: 0;
}
details.advice > summary {
  padding: 14px 16px; font-weight: 600; cursor: pointer; line-height: 1.4; color: var(--text);
}
.advice summary::after { margin-top: 4px; }
.advice[open] summary { margin-bottom: 0; }
.advice p { padding: 0 16px 16px; margin: 0; color: var(--text); }
.all-good { background: var(--good-soft); border-radius: 10px; padding: 14px 16px; }

.result-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; }
.result-actions button { margin: 0; }

/* ---------- Інше ---------- */
.loading { text-align: center; margin-top: 30vh; color: var(--muted); }
.site-footer { padding-block: 24px 32px; text-align: center; font-size: .82rem; color: var(--muted); }
.site-footer p { margin: 0; }

/* ---------- Телефон ---------- */
@media (max-width: 620px) {
  .result-hero { grid-template-columns: 1fr; text-align: center; justify-items: center; }
  .score-ring { width: 130px; height: 130px; }
  .areas-grid { grid-template-columns: 1fr; }
  .radar { max-width: 340px; margin-inline: auto; display: block; }
  .nav-row button { min-width: 0; flex: 1; }
  .card { margin-block: 16px; }
  .brand-name { font-size: .92rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ---------- Друк / PDF ---------- */
@media print {
  .site-header, .result-actions, .lang-picker, noscript { display: none !important; }
  body, .card { background: #fff !important; color: #000; box-shadow: none; }
  .card { border: 0; padding: 0; margin-block: 12px; }
  .advice { break-inside: avoid; }
  .advice summary::after { display: none; }
}

/* ==========================================================================
   v0.2: головна, рівні, сцени, розбір, майстер
   ========================================================================== */

.center { text-align: center; }
.muted { color: var(--muted); }
.section-title { font-size: 1.2rem; margin-bottom: 14px; }

/* Великий текст (кнопка A+) */
.header-tools { display: flex; align-items: center; gap: 8px; flex: none; }
.text-size-btn {
  margin: 0; padding: 6px 12px; font-weight: 700; font-size: .95rem; line-height: 1.2;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
}
.text-size-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--surface); }


.link-btn {
  background: none; border: 0; padding: 6px 2px; margin: 8px auto 0; display: block;
  color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-size: .95rem; width: auto;
}
.link-btn:hover, .link-btn:focus { background: none; color: var(--accent-hover); }
.link-btn.small { font-size: .82rem; margin-top: 6px; }
.link-btn.muted { color: var(--muted); }

/* ---------- Головна ---------- */
.home-hero { text-align: center; padding: 36px 0 8px; }
.home-hero h1 { font-size: clamp(1.7rem, 5.5vw, 2.4rem); letter-spacing: -.01em; margin-bottom: .4em; }
.home-hero p { color: var(--muted); font-size: 1.08rem; max-width: 34em; margin: 0 auto; }
.test-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin: 28px 0 8px;
}
.test-card {
  display: flex; flex-direction: column; align-items: flex-start; gap: 8px; text-align: left;
  background: var(--surface); color: var(--text); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 22px; margin: 0; box-shadow: var(--shadow);
  transition: border-color .15s, transform .15s; width: 100%; font-weight: 400;
}
.test-card:not(:disabled):hover { border-color: var(--accent); transform: translateY(-2px); background: var(--surface); color: var(--text); }
.test-card.is-soon { opacity: .6; box-shadow: none; cursor: default; }
.test-icon {
  width: 48px; height: 48px; border-radius: 14px; background: var(--accent-soft);
  display: grid; place-items: center;
}
.test-icon svg { width: 26px; height: 26px; fill: none; stroke: var(--accent); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.test-title { font-weight: 700; font-size: 1.15rem; }
.test-desc { color: var(--muted); font-size: .95rem; line-height: 1.45; flex: 1; }
.test-cta { color: var(--accent); font-weight: 650; margin-top: 4px; }
.test-status {
  font-size: .82rem; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--gaps-soft); color: var(--gaps);
}
.test-status.is-done { background: var(--good-soft); color: var(--good); }

/* ---------- Вступ до тесту ---------- */
.intro-icon-wrap { display: block; }
.stat {
  display: flex; gap: 12px; align-items: flex-start; text-align: left;
  margin: 22px auto 0; max-width: 36em; padding: 14px 16px; border-radius: 12px;
  background: var(--gaps-soft); border-left: 4px solid var(--gaps);
}
.stat svg { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--gaps); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; margin-top: 2px; }
.stat blockquote { margin: 0; padding: 0; border: 0; font-weight: 600; font-style: normal; color: var(--text); }
.stat cite { display: block; font-weight: 400; font-style: normal; font-size: .82rem; color: var(--muted); margin-top: 4px; }
.benefits {
  list-style: none; padding: 0; margin: 22px auto 0; max-width: 36em; text-align: left;
  display: grid; gap: 12px;
}
.benefits li { list-style: none; display: flex; gap: 12px; align-items: center; margin: 0; }
.benefit-icon {
  flex: none; width: 38px; height: 38px; border-radius: 10px; background: var(--accent-soft);
  display: grid; place-items: center;
}
.benefit-icon svg { width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.level-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.level-wrap { display: flex; flex-direction: column; }
.level-card {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center;
  background: var(--surface); color: var(--text); border: 2px solid var(--border); border-radius: var(--radius);
  padding: 20px 14px 16px; margin: 0; width: 100%; height: 100%; font-weight: 400;
  transition: border-color .15s, transform .15s;
}
.level-card:not(:disabled):hover { border-color: var(--accent); background: var(--surface); color: var(--text); transform: translateY(-2px); }
.level-card.is-soon { opacity: .55; cursor: default; }
.level-card.is-rec { border-color: var(--accent); background: var(--accent-soft); }
.level-emoji { font-size: 2rem; line-height: 1; }
.level-name { font-weight: 700; font-size: 1.1rem; }
.level-who { color: var(--muted); font-size: .88rem; line-height: 1.4; flex: 1; }
.level-time { font-size: .85rem; font-weight: 600; color: var(--accent); }
.level-cta { font-size: .85rem; font-weight: 650; color: var(--accent); }
.rec-badge {
  position: absolute; top: -11px; left: 50%; transform: translateX(-50%); white-space: nowrap;
  background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; padding: 3px 10px; border-radius: 999px;
}
.chooser {
  margin-top: 14px; padding: 16px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border);
}
.chooser p { margin-bottom: 12px; }
.chooser-btns { display: flex; gap: 10px; }
.chooser-btns button { margin: 0; min-width: 90px; }

/* ---------- Сцени: «екран телефона» ---------- */
.scene {
  margin: 0 auto 20px; max-width: 420px; border-radius: 22px; overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-2);
  box-shadow: 0 2px 14px rgba(0, 0, 0, .06);
}
.avatar, .call-avatar {
  flex: none; display: grid; place-items: center; border-radius: 50%;
  background: linear-gradient(135deg, #94a3b8, #64748b); color: #fff; font-weight: 700;
}
.avatar { width: 36px; height: 36px; font-size: .95rem; }
.msg-head {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--surface); border-bottom: 1px solid var(--border);
}
.msg-head b { flex: 1; font-size: .95rem; }
.msg-head small { color: var(--muted); font-size: .75rem; }
.msg-body { padding: 16px 14px 18px; }
.bubble {
  position: relative; max-width: 88%; padding: 10px 14px 22px; border-radius: 16px 16px 16px 4px;
  background: var(--surface); border: 1px solid var(--border); line-height: 1.45; font-size: .97rem;
  overflow-wrap: anywhere;
}
.bubble time { position: absolute; right: 12px; bottom: 5px; font-size: .7rem; color: var(--muted); }
.file-chip {
  display: block; margin-bottom: 8px; padding: 8px 10px; border-radius: 10px;
  background: var(--surface-2); border: 1px dashed var(--muted); font-weight: 600; font-size: .9rem;
}
.fake-link { color: #2563eb; text-decoration: underline; overflow-wrap: anywhere; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .fake-link { color: #60a5fa; } }

.scene-call { background: linear-gradient(180deg, #1e293b, #0f172a); color: #e2e8f0; border-color: #1e293b; }
.call-top { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 20px 16px 14px; }
.call-top small { color: #94a3b8; font-size: .8rem; letter-spacing: .02em; }
.call-avatar { width: 64px; height: 64px; font-size: 1.6rem; margin: 6px 0; }
.call-top b { font-size: 1.15rem; color: #fff; }
.call-number { color: #94a3b8; font-size: .9rem; }
.call-said { margin: 0 14px 16px; padding: 12px 14px; border-radius: 14px; background: rgba(255, 255, 255, .08); }
.call-said small { color: #94a3b8; font-size: .78rem; }
.call-said p { margin: 4px 0 0; color: #f1f5f9; font-style: italic; line-height: 1.45; }

.scene-post { background: var(--surface); padding: 14px 16px 6px; }
.post-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.post-head div { display: flex; flex-direction: column; }
.post-head small { color: var(--muted); font-size: .75rem; }
.scene-post p { line-height: 1.5; }

/* ---------- Розбір після відповіді ---------- */
.options.is-locked .option span { cursor: default; }
.options.is-locked .option:not(.chosen-good):not(.chosen-partial):not(.chosen-bad):not(.is-best) span { opacity: .55; }
.options.is-locked .option:hover span { border-color: var(--border); }
.option.chosen-good span    { border-color: var(--good);  background: var(--good-soft); }
.option.chosen-partial span { border-color: var(--gaps);  background: var(--gaps-soft); }
.option.chosen-bad span     { border-color: var(--risk);  background: var(--risk-soft); }
.option.is-best span        { border-color: var(--good);  border-style: dashed; }
.option.chosen-good input:checked + span::before    { box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 10px var(--good); border-color: var(--good); }
.option.chosen-partial input:checked + span::before { box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 10px var(--gaps); border-color: var(--gaps); }
.option.chosen-bad input:checked + span::before     { box-shadow: inset 0 0 0 4px var(--surface), inset 0 0 0 10px var(--risk); border-color: var(--risk); }

.feedback:empty { display: none; }
.feedback {
  border-radius: 12px; padding: 14px 16px; margin: -8px 0 22px; border-left: 4px solid;
}
.feedback p { margin: 0 0 8px; line-height: 1.5; }
.feedback p:last-child { margin-bottom: 0; }
.fb-title { font-weight: 700; font-size: 1.05rem; }
.fb-good    { background: var(--good-soft); border-color: var(--good); }
.fb-partial { background: var(--gaps-soft); border-color: var(--gaps); }
.fb-bad     { background: var(--risk-soft); border-color: var(--risk); }
.fb-anim { animation: fade-in .25s ease; }

/* ---------- Поради та майстер ---------- */
.wizard-cta { width: 100%; margin-bottom: 24px; }
.advice-body { padding: 0 16px 16px; }
.advice-body p { padding: 0; }
.advice-why { color: var(--muted); margin-bottom: 10px !important; }
.steps { margin: 0 0 8px; padding-left: 1.4em; }
.steps li { margin-bottom: 8px; line-height: 1.5; }
.steps-label { font-weight: 700; margin: 10px 0 6px !important; }
.steps-note { color: var(--muted); font-size: .85rem; margin-top: 6px !important; }
.done-badge {
  display: inline-block; margin-right: 8px; padding: 1px 8px; border-radius: 999px;
  background: var(--good-soft); color: var(--good); font-size: .75rem; font-weight: 700; vertical-align: middle;
}
.wizard .advice-why { font-size: 1.05rem; }
.wizard .steps { font-size: 1.02rem; }
.how-title { font-size: 1rem; margin: 18px 0 10px; }
.time-chip { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--accent); }
.time-chip svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.nav-group { display: flex; gap: 10px; }
.nav-group button { margin: 0; }
.big-emoji { font-size: 3.4rem; line-height: 1; margin-bottom: 12px; }

@media (max-width: 620px) {
  .level-grid { grid-template-columns: 1fr; }
  .level-card { flex-direction: row; flex-wrap: wrap; text-align: left; align-items: center; padding: 14px 16px; gap: 4px 12px; }
  .level-emoji { font-size: 1.7rem; }
  .level-who { flex-basis: 100%; }
  .rec-badge { left: auto; right: 12px; transform: none; }
  .home-hero { padding-top: 22px; }
  .nav-row { flex-wrap: wrap; }
  .wizard .nav-row > button { flex: 0 0 auto; }
  .nav-group { flex: 1; }
  .nav-group button { flex: 1; }
  .scene { border-radius: 18px; }
}
@media print {
  .wizard-cta, .header-tools, .link-btn { display: none !important; }
  .advice-body { display: block; }
}

/* Фікси поверх Pico: приховані інпути (Pico дає disabled opacity) і ширина варіантів */
.option input, .chip input { opacity: 0 !important; width: 1px; height: 1px; }
.options label.option { width: 100%; }
.option.chosen-good input + span    { border-color: var(--good); background: var(--good-soft); }
.option.chosen-partial input + span { border-color: var(--gaps); background: var(--gaps-soft); }
.option.chosen-bad input + span     { border-color: var(--risk); background: var(--risk-soft); }
.wizard .advice-why { margin-top: 6px; }

/* ---------- «Детальніше» ---------- */
.more-btn {
  margin: 4px 0 0; padding: 8px 14px; font-size: .92rem; font-weight: 600;
  background: var(--surface); color: var(--text); border: 1.5px solid currentColor;
}
.more-btn:hover { background: var(--surface); color: var(--accent); }
dialog.more-dialog { padding: 16px; }
dialog.more-dialog > article {
  max-width: 620px; width: 100%; max-height: calc(100vh - 32px); overflow-y: auto;
  background: var(--surface); border-radius: var(--radius); padding: 0; margin: 0 auto;
}
.more-dialog header {
  position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; margin: 0; background: var(--surface); border-bottom: 1px solid var(--border);
}
.more-dialog header h2 { margin: 0; font-size: 1.2rem; }
.more-close {
  flex: none; width: 38px; height: 38px; padding: 0; margin: 0; border-radius: 50%;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border); font-size: 1rem;
}
.more-close:hover { background: var(--accent-soft); color: var(--accent); }
.more-sec { padding: 14px 20px 0; }
.more-sec h3 { font-size: 1rem; margin-bottom: 8px; color: var(--accent); }
.more-sec p, .more-sec li { line-height: 1.55; }
.more-sec ul { padding-left: 1.2em; margin-bottom: 0; }
.more-sec li { margin-bottom: 6px; list-style: disc; }
.more-dialog footer { padding: 16px 20px 20px; margin: 0; background: none; border: 0; text-align: right; }
.more-dialog footer button { margin: 0; }

/* ---------- Підтримати проєкт ---------- */
.donate { display: flex; gap: 16px; align-items: flex-start; background: var(--accent-soft); border-color: transparent; }
.donate-emoji { font-size: 2.2rem; line-height: 1; }
.donate h2 { font-size: 1.15rem; margin-bottom: 6px; }
.donate p { margin-bottom: 12px; }
.donate-btn { display: inline-block; text-decoration: none; }
.donate-note { font-size: .82rem; color: var(--muted); margin: 10px 0 0 !important; }
@media print { .donate { display: none !important; } }
@media (max-width: 440px) {
  .brand-name { display: none; }
}

/* ---------- Надіслати план собі ---------- */
dialog.more-dialog { box-sizing: border-box; min-width: 0; width: 100%; }
.share-native { width: 100%; margin: 4px 0 14px; }
.share-apps { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.share-app {
  display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0;
  padding: 12px; border-radius: 10px; font-weight: 600; text-decoration: none; color: #fff; border: 0;
}
.share-app.tg { background: #229ed9; }
.share-app.wa { background: #1fa855; }
.share-app.vb { background: #7360f2; }
.share-app.copy { background: var(--surface-2); color: var(--text); border: 1px solid var(--border); }
.share-app:hover { filter: brightness(1.08); color: #fff; }
.share-app.copy:hover { color: var(--text); }
.plan-preview { margin-top: 16px; }
.plan-preview pre { white-space: pre-wrap; font-size: .82rem; max-height: 280px; overflow: auto; background: var(--surface-2); padding: 12px; border-radius: 8px; }
.copy-one {
  margin: 10px 0 0; padding: 6px 12px; font-size: .85rem; font-weight: 600;
  background: var(--surface-2); color: var(--text); border: 1px solid var(--border);
}
.copy-one:hover { background: var(--accent-soft); color: var(--accent); }
@media print { .copy-one { display: none !important; } }

/* ---------- Розмір тексту ---------- */
.text-size { position: relative; }
.text-size-btn { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-weight: 600; }
.ts-aa { font-weight: 800; letter-spacing: -.02em; }
.text-size-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 20; min-width: 230px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 8px;
}
.ts-title { font-size: .8rem; color: var(--muted); margin: 4px 8px 6px; font-weight: 600; }
.ts-option {
  display: flex; align-items: center; gap: 8px; width: 100%; margin: 0; text-align: left;
  padding: 8px 10px; border: 0; border-radius: 8px; background: none; color: var(--text); font-weight: 500; line-height: 1.3;
}
.ts-option span { width: 1em; color: var(--accent); font-weight: 800; }
.ts-option:hover, .ts-option:focus { background: var(--accent-soft); color: var(--text); }
.ts-option[aria-checked="true"] { background: var(--accent-soft); font-weight: 700; }
@media (max-width: 440px) {
  .ts-label { font-size: .85rem; }
  .text-size-btn { padding: 6px 10px; }
}

/* ---------- Що перевірити далі ---------- */
.next-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; }
.next-card {
  display: flex; align-items: center; gap: 12px; text-align: left; margin: 0; width: 100%;
  background: var(--surface); color: var(--text); border: 1.5px solid var(--border); border-radius: 12px; padding: 12px; font-weight: 400;
}
.next-card:not(:disabled):hover { border-color: var(--accent); background: var(--surface); color: var(--text); }
.next-card.is-soon { opacity: .55; }
.next-card .test-icon { width: 40px; height: 40px; flex: none; }
.next-text { display: flex; flex-direction: column; gap: 2px; }
.next-text small { color: var(--muted); font-size: .82rem; line-height: 1.35; }

/* Шапка не масштабується разом з «Розміром тексту» — фіксовані px */
.site-header .header-inner { padding-block: 10px; gap: 8px; }
.site-header .brand { font-size: 16px; }
.site-header .brand-icon { width: 30px; height: 30px; }
.site-header .header-tools { gap: 6px; }
.site-header .text-size-btn { font-size: 14px; padding: 7px 12px; line-height: 20px; height: 38px; border-radius: 10px; }
.site-header .lang-picker select:not([multiple]) {
  font-size: 14px; line-height: 20px; height: 38px; padding: 7px 34px 7px 12px; border-radius: 10px;
  background-position: center right 10px; background-size: 14px auto;
}
.site-header .text-size-panel { font-size: 16px; }
.site-header .ts-title { font-size: 13px; }
@media (max-width: 440px) {
  .site-header .text-size-btn { padding: 7px 10px; }
  .site-header .ts-label { font-size: 13px; }
}

/* Груповий чат у сцені */
.scene-group .msg-body { display: flex; flex-direction: column; gap: 8px; }
.group-bubble { white-space: pre-line; }
.group-bubble .sender { display: block; font-weight: 700; font-size: .85rem; margin-bottom: 2px; }
.sender-0 { color: #8b5cf6; } .sender-1 { color: #16a34a; } .sender-2 { color: #ea580c; }
.link-text { color: #2563eb; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .link-text { color: #60a5fa; } }

/* Відгуки */
.report-link { margin: 10px 0 0 !important; font-size: .82rem; }
.report-link a { color: var(--muted); }
.feedback-card a[role="button"] { margin: 0; }
@media print { .feedback-card, .report-link { display: none !important; } }
.fb-form textarea { margin-bottom: 6px; }
.fb-form button { margin: 0; }
.fb-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.fb-privacy { font-size: .8rem; color: var(--muted); margin: 0 0 10px; }
.fb-status { font-size: .9rem; margin: 8px 0 0; color: var(--muted); }
.fb-status:empty { display: none; }
.fb-thanks { color: var(--good); font-weight: 600; margin: 0; }
.brand-logo { width: 32px; height: 32px; flex: none; display: block; }
.fb-learn { background: var(--accent-soft); border-color: var(--accent); }
.option.chosen-learn input + span { border-color: var(--accent); background: var(--accent-soft); }
.fb-na { background: var(--surface-2); border-color: var(--muted); }
.option.chosen-na input + span { border-color: var(--muted); background: var(--surface-2); }
