/* Shared UI components — reused by every view (DRY). */

/* Top padding clears the fixed chrome (back button occupies 12–60px, the
   Аа/звук toggles 14–34px). Short screens are vertically centred so it never
   showed; a screen taller than the viewport top-aligns and would collide. */
.screen{display:flex; flex-direction:column; align-items:center; gap:28px;
  width:100%; max-width:440px;
  padding:calc(68px + env(safe-area-inset-top)) 24px calc(80px + env(safe-area-inset-bottom)) 24px;
  animation:fade .8s var(--ease) both}

/* typography blocks — sized for readability under stress (no tiny text) */
.lead{font-weight:300; font-size:1.1rem; color:var(--ink-soft); letter-spacing:.03em; text-align:center}
.title{font-weight:300; font-size:1.6rem; color:var(--ink); text-align:center; line-height:1.3}
.big{font-weight:200; font-size:2rem; color:var(--ink); text-align:center; line-height:1.2}
.logo{display:block; width:min(280px,64vw); height:auto; margin:0 auto .25rem; user-select:none; -webkit-user-drag:none}
.sub{font-weight:300; font-size:1.05rem; color:var(--ink-soft); text-align:center; max-width:340px; line-height:1.6}
.frame{font-weight:300; font-size:.92rem; color:var(--ink-soft); letter-spacing:.03em; text-align:center}
.fine{font-weight:300; font-size:.88rem; color:var(--ink-soft); text-align:center; max-width:320px; line-height:1.55}

/* progress dots */
.dots{display:flex; gap:9px; opacity:.5}
.dots i{width:7px;height:7px;border-radius:50%;background:var(--ink-soft);opacity:.55;transition:opacity .5s}
.dots i.on{opacity:1}

/* tap-to-count circles (grounding 5-4-3-2-1) — тапаєш за кожну знайдену річ */
.taps{display:flex; gap:14px; justify-content:center; flex-wrap:wrap}
.taps button{width:52px; height:52px; border-radius:50%; cursor:pointer; font-family:inherit;
  font-size:1.2rem; color:var(--ink-soft); border:1.5px solid rgba(108,118,137,.28);
  background:rgba(255,255,255,.5); transition:transform .18s var(--ease), background .3s, color .3s, border-color .3s}
.taps button:active{transform:scale(.9)}
.taps button.on{background:radial-gradient(circle at 50% 38%, rgba(172,212,207,.75), rgba(172,212,207,.35));
  border-color:transparent; color:var(--ink)}

/* tap scale 0..3 — стан через слово+колір, без цифр */
.scale{display:flex; flex-direction:column; gap:11px; width:100%}
/* options are real <button>s (keyboard/screen-reader accessible) styled as rows */
.opt{display:flex; align-items:center; gap:16px; cursor:pointer; width:100%;
  font-family:inherit; text-align:left;
  border:1px solid rgba(108,118,137,.16); background:rgba(255,255,255,.5);
  border-radius:18px; padding:16px 20px; transition:transform .18s var(--ease), background .35s}
.opt:active{transform:scale(.97)}
.opt .bead{width:16px;height:16px;border-radius:50%;flex:0 0 auto;background:var(--ink-soft)}
.opt .lab{font-weight:300; font-size:1.1rem; color:var(--ink)}
.opt[data-v="0"] .bead{background:var(--cool)}
.opt[data-v="1"] .bead{background:#cfe0d2}
.opt[data-v="2"] .bead{background:var(--warm)}
.opt[data-v="3"] .bead{background:var(--coral)}
/* WHO-5 reversed scale (5=best→cool, 0=worst→coral) */
.opt[data-v="4"] .bead{background:var(--warm)}
.opt[data-v="5"] .bead{background:var(--coral)}

/* round primary action */
.go{cursor:pointer; font-family:inherit; color:var(--ink); font-weight:300; font-size:1.1rem;
  display:flex; align-items:center; justify-content:center; text-align:center;
  border:1px solid rgba(108,118,137,.18); border-radius:50%; width:152px; height:152px;
  background:radial-gradient(circle at 50% 38%, rgba(172,212,207,.55), rgba(255,255,255,.65));
  box-shadow:0 18px 50px -16px rgba(120,150,150,.4); transition:transform .2s var(--ease)}
.go:active{transform:scale(.95)}
.go.warm{background:radial-gradient(circle at 50% 38%, rgba(240,217,190,.6), rgba(255,255,255,.65))}
.go.coral{background:radial-gradient(circle at 50% 38%, rgba(217,142,127,.45), rgba(255,255,255,.65))}
/* allow <a> to use .go styling for tel: links */
a.go{text-decoration:none; display:flex; flex-direction:column; align-items:center; justify-content:center;
  white-space:pre-line; line-height:1.35}

/* pill / link buttons */
.pill{cursor:pointer; font-family:inherit; color:var(--ink); font-weight:300; font-size:1.1rem;
  border:1px solid rgba(108,118,137,.18); border-radius:40px; padding:16px 32px;
  background:rgba(255,255,255,.5); transition:transform .2s var(--ease), background .35s}
.pill:active{transform:scale(.96)}
.pill.cta{background:radial-gradient(circle at 50% 38%, rgba(172,212,207,.5), rgba(255,255,255,.6))}
.linkish{font-size:.8rem; color:var(--ink-soft); opacity:.65; cursor:pointer;
  text-decoration:underline; text-underline-offset:3px; background:none; border:none; font-family:inherit}

.col{display:flex; flex-direction:column; gap:12px; width:100%}

/* Prose block (disclaimer). Centered text is fine for one short line, but a
   centred PARAGRAPH has a ragged left edge — the eye hunts for the start of
   every line. Multi-paragraph text is left-aligned and set at a readable size,
   not the .fine footnote size. */
.prose{display:flex; flex-direction:column; gap:15px; width:100%}
.prose > p{font-weight:300; font-size:.98rem; line-height:1.62; color:var(--ink-soft);
  text-align:left; max-width:none}
/* Crisis lines: each stays on its own line and never breaks mid-number. */
.lines{display:flex; flex-direction:column; align-items:center; gap:5px; width:100%}
.lines > span{font-weight:300; font-size:.85rem; color:var(--ink-soft); opacity:.85; white-space:nowrap}

/* guide pages — readable advice cards (delivery:'guide') */
.gstep{background:rgba(255,255,255,.55); border:1px solid rgba(108,118,137,.14);
  border-radius:14px; padding:13px 16px}
.gstep-h{font-weight:500; font-size:1rem; margin-bottom:4px}
.gstep-b{font-weight:300; font-size:.95rem; color:var(--ink-soft); line-height:1.5}

/* accessibility: font scaling + high contrast (toggled on <html>) */
html.fs-lg{font-size:120%}
html.fs-xl{font-size:145%}
html.hc{--ink:#000; --ink-soft:#2a2f38}
html.hc body{background:#fff}
html.hc .opt,html.hc .pill,html.hc .gstep{border-color:#555; background:#fff}
html.hc .go{border:2px solid #333; box-shadow:none}
html.hc .linkish{opacity:1; color:#1a3f66}
html.hc .fine,html.hc .sub{color:#2a2f38}
button:focus-visible,a:focus-visible,.opt:focus-visible{outline:3px solid #4a8a80; outline-offset:2px}

/* breathing orb (stabilize / runners) */
.orbWrap{position:relative; width:min(70vw,300px); aspect-ratio:1; display:grid; place-items:center}
.halo{position:absolute; inset:-6%; border-radius:50%; transform:scale(.6); filter:blur(4px);
  background:radial-gradient(circle, rgba(172,212,207,.45), transparent 68%);
  transition:transform var(--ease), background 1.6s linear}
.orb{position:absolute; inset:16%; border-radius:50%; transform:scale(.6);
  background:radial-gradient(circle at 50% 38%, rgba(255,255,255,.95), transparent 46%),
    radial-gradient(circle at 50% 56%, #ffffff, #d9e7e3 72%);
  box-shadow:0 18px 50px -12px rgba(120,150,150,.45), inset 0 0 30px rgba(255,255,255,.7);
  transition:transform var(--ease), background 1.6s linear}
.orb.warm{background:radial-gradient(circle at 50% 38%, rgba(255,255,255,.95), transparent 46%),
  radial-gradient(circle at 50% 56%, #fffaf3, #f0ddc4 74%)}
.halo.warm{background:radial-gradient(circle, rgba(240,217,190,.45), transparent 68%)}
.cue{position:absolute; font-weight:300; font-size:1.1rem; letter-spacing:.08em;
  color:var(--ink-soft); opacity:0; transition:opacity 1.1s var(--ease)}
.cue.show{opacity:.85}

/* back button — large enough to tap reliably */
.backbtn{position:fixed; top:calc(12px + env(safe-area-inset-top)); left:12px; z-index:6; display:none;
  width:48px; height:48px; border-radius:50%; cursor:pointer; font-size:1.2rem; color:var(--ink-soft);
  border:1px solid rgba(108,118,137,.18); background:rgba(255,255,255,.6); font-family:inherit;
  align-items:center; justify-content:center}
/* crisis-lock: hide back synchronously via class, not JS style.display (avoids
   the paint-window race between mount and first frame) */
.crisis-locked .backbtn{display:none !important}

/* crisis dot — постійний шар */
/* Crisis dot sits ON TOP of scrolling content, so it needs its own plate —
   transparent, it collided with whatever text passed underneath and both
   became unreadable. Opaque enough to always win, blurred so it still feels
   part of the calm surface. */
.help{position:fixed; bottom:calc(16px + env(safe-area-inset-bottom)); left:50%; transform:translateX(-50%);
  z-index:5; display:flex; align-items:center; gap:8px; opacity:1; cursor:pointer;
  padding:9px 18px; border-radius:22px;
  border:1px solid rgba(108,118,137,.16);
  background:rgba(255,255,255,.92);
  backdrop-filter:blur(10px) saturate(1.1); -webkit-backdrop-filter:blur(10px) saturate(1.1);
  box-shadow:0 8px 26px -10px rgba(80,100,120,.35);
  font-family:inherit; font-size:.9rem; letter-spacing:.02em; color:var(--ink-soft);
  transition:box-shadow .4s, background .4s}
.help:hover{background:rgba(255,255,255,.98); box-shadow:0 10px 30px -10px rgba(80,100,120,.45)}
.help:active{transform:translateX(-50%) scale(.97)}
html.hc .help{background:#fff; border-color:#555; color:#1a3f66; box-shadow:none}
.help .d{width:6px;height:6px;border-radius:50%;background:var(--coral)}

/* crisis overlay card */
.overlay{position:fixed; inset:0; z-index:20; display:none; align-items:center; justify-content:center;
  padding:24px; background:rgba(238,244,242,.86); backdrop-filter:blur(10px)}
.overlay.on{display:flex; animation:fade .4s var(--ease) both}
.card{background:#fff; border-radius:26px; padding:26px 24px; max-width:360px; width:100%;
  box-shadow:0 30px 70px -20px rgba(120,140,150,.4)}
.card h2{font-weight:300; font-size:1.2rem; margin-bottom:16px; color:var(--ink)}
.card a{display:flex; justify-content:space-between; align-items:center; text-decoration:none;
  background:rgba(217,142,127,.10); border:1px solid rgba(217,142,127,.3); border-radius:15px;
  padding:14px 16px; margin-bottom:10px; color:var(--ink)}
.card a b{font-weight:600} .card a span{font-size:.78rem; color:var(--ink-soft)}
.card .close{margin-top:8px; text-align:center; color:var(--ink-soft); font-size:.9rem; cursor:pointer; padding:8px}
