/* quiet-moment ("רגע שקט"), design v2 (24 November 2026).
   Anchor: Headspace (headspace.com, Webby Health & Fitness 2019). Its system, not its look: one friendly sans in two
   weights, big short headlines, a soft gradient field with one large circle as the hero, centred section heads over a
   row of soft cards, pill buttons, 8 px rhythm, no shadows. Adapted: Rubik (Hebrew/Latin/Cyrillic, one variable file
   per script), the site's own sea green as the one accent (red reads as alarm), an analogous mint-to-mist field, and a
   "night" palette. Motion only in the breathing guide and the slow hero circle; none with reduced motion.
   Mobile first, logical properties for RTL/LTR. Colour pairs checked for WCAG AA in both themes (design/NOTES.md). */

/* ---------- fonts (self-hosted, SIL OFL 1.1, licence in /fonts/OFL-Rubik.txt) ---------- */
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(/fonts/rubik-hebrew.woff2) format("woff2");
  unicode-range: U+0307-0308, U+0590-05FF, U+200C-2010, U+20AA, U+25CC, U+FB1D-FB4F;
}
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(/fonts/rubik-latin.woff2) format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Rubik";
  font-style: normal;
  font-weight: 300 900;
  font-display: swap;
  src: url(/fonts/rubik-cyrillic.woff2) format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
/* metric-matched fallback, so the swap to Rubik moves nothing (Rubik: ascent 935, descent 250, wide letters) */
@font-face {
  font-family: "Rubik Fallback";
  src: local("Arial"), local("Helvetica"), local("Liberation Sans");
  size-adjust: 104%;
  ascent-override: 90%;
  descent-override: 24%;
  line-gap-override: 0%;
}

/* ---------- tokens ----------
   Round 3 (Chen's accepted principles, 24.11): real colour and warmth, a coloured header band, a deep-teal night,
   colour carried by the content. One saturated accent (sea teal); content hues from a small analogous family
   (teal, sea blue, violet) plus one warm amber (the candle); never red. Every pair checked for AA (design/NOTES.md). */
:root {
  color-scheme: light;
  --bg: #fbfaf6;           /* warm cream, not gray */
  --surface: #eef6f3;      /* soft mint */
  --surface-2: #dcefe8;
  --text: #14211f;         /* 15.9:1 on --bg */
  --text-2: #33433f;
  --muted: #4f5f5a;        /* 6.4:1 on --bg, 6.1:1 on --surface */
  --line: #d3e3dd;
  --line-strong: #8fb3a8;  /* decorative rings only */
  --rule: #14211f;
  --axis: #6f857e;
  --accent: #0f766b;       /* sea teal: primary action, current page; white text 5.5:1 */
  --accent-hover: #0b5f56;
  --accent-deep: #0b5f56;  /* accent as text on coloured fields */
  --accent-ink: #ffffff;
  --accent-soft: #cdeee5;  /* the breathing circle */
  --accent-ring: #0f766b;
  --band: #0f5c54;         /* header band and the home help band: white text 7.8:1 */
  --band-2: #0b4a44;
  --band-ink: #ffffff;
  --band-soft: #cdeee5;    /* secondary text on the band: 6.3:1 */
  --cur-bg: #fbfaf6;       /* current page pill on the band */
  --cur-ink: #0f5c54;
  --chip: rgba(255, 255, 255, 0.12);
  --chip-hover: rgba(255, 255, 255, 0.22);
  /* content hues: solid (icons, numbers, titles; white glyphs >= 5:1) and tint (card fills; hue text >= 4.5:1) */
  --h1: #0f766b; --t1: #dff2ec;   /* teal */
  --h2: #2763a3; --t2: #e1ecf8;   /* sea blue */
  --h3: #5b4fb0; --t3: #ebe8f8;   /* violet */
  --h4: #a4570f; --t4: #fbecd9;   /* warm amber (candle) */
  --on-hue: #ffffff;
  --field-a: #b3e5d3;      /* hero field: mint ... */
  --field-b: #c3d9f5;      /* ... to sky */
  --field-c: #d9efe7;
  --kids-a: #fbecd9;       /* kids game: warm candle light ... */
  --kids-b: #ebe8f8;       /* ... and violet dusk */
  --flame: #c0661f;        /* kids candles only; decorative */
  --bad: #8a4a0c;          /* form error text only, always with words; amber, never red */
  --focus: #0f766b;
  --gy-accent: var(--accent);
  --r-s: 16px;             /* one radius family: 16 / 32 + pill */
  --r-l: 32px;
  --pill: 999px;
  --gutter: 16px;
  --sans: "Rubik", "Rubik Fallback", system-ui, -apple-system, "Segoe UI", Arial, "Noto Sans Hebrew", sans-serif;
  --serif: var(--sans);    /* kept for print rules */
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #112c33;           /* deep teal night, visibly coloured */
    --surface: #183c44;
    --surface-2: #1e474f;
    --text: #e5f1ee;
    --text-2: #c0d3ce;
    --muted: #a6bcb6;
    --line: #285058;
    --line-strong: #4f7d78;
    --rule: #e5f1ee;
    --axis: #6a8a85;
    --accent: #4fd1bd;
    --accent-hover: #7adfcf;
    --accent-deep: #6fdcca;
    --accent-ink: #06201d;
    --accent-soft: #17463f;
    --accent-ring: #4fd1bd;
    --band: #0b3a45;
    --band-2: #083039;
    --band-ink: #ffffff;
    --band-soft: #b5e6dc;
    --cur-bg: #4fd1bd;
    --cur-ink: #06201d;
    --chip: rgba(255, 255, 255, 0.08);
    --chip-hover: rgba(255, 255, 255, 0.16);
    --h1: #4fd1bd; --t1: #18463f;
    --h2: #7fb2ec; --t2: #1b3762;
    --h3: #a99cf0; --t3: #2e2858;
    --h4: #f0a95e; --t4: #45301a;
    --on-hue: #0a1a1d;
    --field-a: #155249;
    --field-b: #1b3a6b;
    --field-c: #143a41;
    --kids-a: #2e2858;
    --kids-b: #1b3762;
    --flame: #f0a95e;
    --bad: #f0b77a;
    --focus: #4fd1bd;
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #112c33;
  --surface: #183c44;
  --surface-2: #1e474f;
  --text: #e5f1ee;
  --text-2: #c0d3ce;
  --muted: #a6bcb6;
  --line: #285058;
  --line-strong: #4f7d78;
  --rule: #e5f1ee;
  --axis: #6a8a85;
  --accent: #4fd1bd;
  --accent-hover: #7adfcf;
  --accent-deep: #6fdcca;
  --accent-ink: #06201d;
  --accent-soft: #17463f;
  --accent-ring: #4fd1bd;
  --band: #0b3a45;
  --band-2: #083039;
  --band-ink: #ffffff;
  --band-soft: #b5e6dc;
  --cur-bg: #4fd1bd;
  --cur-ink: #06201d;
  --chip: rgba(255, 255, 255, 0.08);
  --chip-hover: rgba(255, 255, 255, 0.16);
  --h1: #4fd1bd; --t1: #18463f;
  --h2: #7fb2ec; --t2: #1b3762;
  --h3: #a99cf0; --t3: #2e2858;
  --h4: #f0a95e; --t4: #45301a;
  --on-hue: #0a1a1d;
  --field-a: #155249;
  --field-b: #1b3a6b;
  --field-c: #143a41;
  --kids-a: #2e2858;
  --kids-b: #1b3762;
  --flame: #f0a95e;
  --bad: #f0b77a;
  --focus: #4fd1bd;
}

/* ---------- base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.125rem;
  line-height: 1.65;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-wrap: break-word;
}

main {
  flex: 1 0 auto;
}

main:focus {
  outline: none;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--text);
  text-decoration-line: underline;
  text-decoration-color: var(--line-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
}

a:hover {
  color: var(--accent);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

h1,
h2,
h3 {
  margin: 0 0 0.5em;
  color: var(--text);
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.5rem, 1.75rem + 2.6vw, 4rem); /* 40 px phone, 64 px desktop */
  line-height: 1.12;
}

h2 {
  font-size: clamp(1.625rem, 1.35rem + 0.9vw, 2.25rem); /* 26 to 36 px */
  line-height: 1.22;
}

h3 {
  font-size: 1.375rem;
  line-height: 1.35;
}

p {
  margin: 0 0 1em;
}

strong {
  font-weight: 600;
}

[hidden] {
  display: none !important;
}

.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.wrap {
  width: 100%;
  max-width: 1160px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

@media (min-width: 768px) {
  :root { --gutter: 40px; }
}

/* hidden above the page by its own height, so a longer label (Russian, or text at 200%) never peeks out */
.skip {
  position: absolute;
  inset-inline-start: 16px;
  top: 0;
  transform: translateY(-110%);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: var(--pill);
  z-index: 100;
  text-decoration: none;
}

.skip:focus {
  top: 8px;
  transform: none;
}

/* ---------- masthead ---------- */
/* the header is a coloured band (deep sea teal), the site's own brand colour */
.site-header {
  background: var(--band);
  color: var(--band-ink);
}

.site-header :focus-visible {
  outline-color: var(--band-ink);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
  padding-block: 12px 8px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1;
  color: var(--band-ink);
  text-decoration: none;
  margin-inline-end: auto;
  min-height: 44px;
}

.brand:hover {
  color: var(--band-ink);
}

.brand svg {
  width: 30px;
  height: 30px;
  flex: none;
}

.mark-ring {
  fill: none;
  stroke: var(--band-soft);
  stroke-width: 5;
}

.mark-core {
  fill: var(--band-ink);
}

.site-header .icon-btn {
  color: var(--band-ink);
  border-color: rgba(255, 255, 255, 0.35);
}

.site-header .icon-btn:hover {
  background: var(--chip-hover);
  color: var(--band-ink);
}

.controls {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  order: 2;
  margin-inline-start: auto; /* if the buttons ever wrap under the site name, they stay at the end of the row */
}

/* language: one button for each of the two other languages, named in its own language (no flags) */
.lang-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.lang-switch .icon-btn {
  padding-inline: 14px;
}

.nav {
  order: 3;
  flex-basis: 100%;
  min-width: 0; /* the chip row scrolls inside the header instead of widening it */
}

/* phones: one row of soft chips that scrolls sideways, so the masthead stays short in every language */
.nav ul {
  list-style: none;
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 0 calc(-1 * var(--gutter));
  padding: 4px var(--gutter);
  scroll-padding-inline: var(--gutter);
}

.nav ul::-webkit-scrollbar {
  display: none;
}

.nav li {
  flex: none;
}

.nav a {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 44px;
  padding: 6px 10px;
  border-radius: var(--pill);
  background: var(--chip);
  color: var(--band-ink);
  text-decoration: none;
  font-size: 0.9375rem;
  line-height: 1.25;
  white-space: nowrap;
}

.nav a:hover {
  color: var(--band-ink);
  background: var(--chip-hover);
}

/* current page: a cream pill on the band */
.nav a[aria-current="page"] {
  color: var(--cur-ink);
  background: var(--cur-bg);
  font-weight: 600;
}


@media (min-width: 960px) {
  .site-header .wrap {
    padding-block: 18px;
  }

  .nav {
    order: 1;
    flex-basis: auto;
    margin-inline-end: auto;
  }

  .nav ul {
    gap: 4px;
    margin: 0;
    padding: 4px 0;
  }

  .nav a {
    background: transparent;
    padding: 8px 16px;
    font-size: 1rem;
  }

  .brand {
    margin-inline-end: 20px;
  }

  /* English and Russian menu words are longer: the menu gets a row of its own under the name and the buttons */
  html:not(:lang(he)) .brand {
    margin-inline-end: auto;
  }

  html:not(:lang(he)) .nav {
    order: 3;
    flex-basis: 100%;
    margin-inline-end: 0;
  }

  html:not(:lang(he)) .nav li:first-child a {
    margin-inline-start: -16px;
  }
}

/* phones with enlarged text (e.g. 200%): two columns instead of three, so long words (Russian) are not cut in the
   middle; the query is in em of the menu's own text, so at normal size phones keep the 3 x 2 grid */




/* ---------- buttons: one primary pill, one quiet pill ---------- */
.icon-btn,
.btn {
  font: inherit;
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--pill);
  min-height: 44px;
  min-width: 44px;
  padding: 8px 22px;
  border: 1.5px solid var(--line-strong);
  background: transparent;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-decoration: none;
  line-height: 1.25;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.icon-btn {
  padding-inline: 12px;
  font-size: 0.9375rem;
  font-weight: 400;
  border-color: var(--line);
}

.icon-btn[data-theme-toggle] {
  font-size: 1.125rem;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}

.btn:hover,
.icon-btn:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: var(--accent-ink);
}

.btn.big {
  min-height: 64px;
  font-size: 1.25rem;
  padding: 14px 36px;
  width: 100%;
}

@media (min-width: 600px) {
  .btn.big { width: auto; min-width: 18rem; }
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-block: 16px;
}

/* ---------- page head, lead, notices ---------- */
.page-head {
  padding-block: 32px 8px;
}

@media (min-width: 768px) {
  .page-head { padding-block: 64px 16px; }
}

.page-head p,
.lead {
  color: var(--text-2);
  max-width: 40rem;
  font-size: clamp(1.1875rem, 1.1rem + 0.35vw, 1.375rem); /* 19 to 22 px */
  line-height: 1.6;
}

/* the Home Front Command line: a soft note with a green dot, never an alarm colour */
.notice {
  position: relative;
  color: var(--text-2);
  background: var(--surface);
  border-radius: var(--r-s);
  padding: 14px 20px;
  padding-inline-start: 44px;
  margin-block: 16px 24px;
  font-size: 1rem;
  line-height: 1.6;
  max-width: 46rem;
}

.notice::before {
  content: "";
  position: absolute;
  inset-inline-start: 20px;
  top: 1.35em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
}

.notice a {
  color: var(--text);
  font-weight: 500;
}

.meta {
  color: var(--muted);
  font-size: 0.9375rem;
  margin-block: 4px 16px;
}

/* a number sequence that must not break across lines, e.g. "5-4-3-2-1" */
.nowrap {
  white-space: nowrap;
}

/* "works without internet" line: quiet, under the main button on the home page */
.page-head p.offline-hint,
.offline-hint {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
  margin-block: 4px 12px;
  max-width: 34rem;
}

/* ---------- sections ---------- */
.section {
  margin-block: 48px;
  max-width: 48rem;
}

@media (min-width: 768px) {
  .section { margin-block: 80px; }
}

.section > h2:first-child {
  margin-top: 0;
}

/* section heads over a card row: centred, like the anchor */
.sec-head {
  text-align: center;
  margin: 56px auto 24px;
  max-width: 40rem;
}

@media (min-width: 768px) {
  .sec-head { margin-block: 96px 32px; }
}

/* ---------- home: hero field with the breathing circle ---------- */
.page-head.start {
  position: relative;
  display: grid;
  align-items: center;
  gap: 8px 48px;
  margin-top: 8px;
  padding: 40px 24px 32px;
  border-radius: var(--r-l);
  background:
    radial-gradient(120% 90% at 85% 10%, var(--field-a), transparent 60%),
    radial-gradient(90% 90% at 10% 100%, var(--field-b), transparent 65%),
    var(--field-c);
  overflow: hidden;
  text-align: center;
  justify-items: center;
}

.page-head.start > * {
  position: relative;
}

.page-head.start h1 {
  margin-bottom: 0.3em;
}

.page-head.start p {
  margin-inline: auto;
}

.page-head.start .btn-row {
  justify-content: center;
  width: 100%;
}

@media (min-width: 900px) {
  .page-head.start {
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    padding: 88px 72px;
    text-align: start;
    justify-items: start;
    min-height: 520px;
  }

  .page-head.start > :not(.hero-orb) {
    grid-column: 1;
  }

  .page-head.start p {
    margin-inline: 0;
  }

  .page-head.start .btn-row {
    justify-content: flex-start;
  }
}

/* the big circle: the site's ring-and-dot mark as a slow breathing orb (decorative, aria-hidden) */
.hero-orb {
  width: min(64vw, 260px);
  aspect-ratio: 1;
  border-radius: 50%;
  margin-block: 24px 4px;
  order: 5;
  display: grid;
  place-items: center;
  /* three soft concentric discs (sea blue, mint) around the solid teal core */
  background:
    radial-gradient(circle at 50% 50%, var(--field-a) 0 49%, transparent 50%),
    radial-gradient(circle at 50% 50%, var(--field-b) 0 70%, transparent 71%);
  animation: orb 12s ease-in-out infinite;
}

.hero-orb::after {
  content: "";
  width: 30%;
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--accent);
}

@keyframes orb {
  0%, 100% { transform: scale(0.88); }
  45%, 55% { transform: scale(1); }
}

@media (min-width: 900px) {
  .hero-orb {
    grid-column: 2;
    grid-row: 1 / span 4;
    justify-self: center;
    width: min(30vw, 380px);
    margin: 0;
    order: 0;
  }
}

/* the six screens: soft cards with an icon, title and one line */
.paths {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}

@media (min-width: 640px) {
  .paths { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
}

@media (min-width: 1000px) {
  .paths { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* colour carried by the content: each screen has its own hue (tint card, solid icon) */
.paths li { --hue: var(--h1); --tint: var(--t1); }
.paths a[href="/after"] { --hue: var(--h2); --tint: var(--t2); }
.paths a[href="/kids"] { --hue: var(--h4); --tint: var(--t4); }
.paths a[href="/talk"] { --hue: var(--h3); --tint: var(--t3); }
.paths a[href="/card"] { --hue: var(--h2); --tint: var(--t2); }

.paths a {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  align-items: start;
  column-gap: 16px;
  height: 100%;
  padding: 20px;
  border-radius: var(--r-s);
  background: var(--tint, var(--t1));
  text-decoration: none;
  min-height: 44px;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.paths a:hover {
  color: var(--text);
  box-shadow: inset 0 0 0 2px var(--hue, var(--h1));
}

.paths a strong {
  color: var(--text);
}

.paths .ic {
  grid-row: 1 / span 2;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--hue, var(--h1));
  color: var(--on-hue);
  display: grid;
  place-items: center;
}

/* the help lines card stands out: the band colour, one tap away */
.paths a[href="/help"] {
  background: var(--band);
  color: var(--band-ink);
}

.paths a[href="/help"] strong,
.paths a[href="/help"]:hover {
  color: var(--band-ink);
}

.paths a[href="/help"] > span:not(.ic) {
  color: var(--band-soft) !important;
}

.paths a[href="/help"] .ic {
  background: var(--cur-bg);
  color: var(--cur-ink);
}

.paths a[href="/help"]:hover {
  box-shadow: inset 0 0 0 2px var(--band-soft);
}

.paths .ic svg {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.paths a strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.3;
  margin-block: 2px 4px;
}

/* only the line under the title is a block: a span inside it (e.g. the unbreakable "5-4-3-2-1") stays inline */
.paths a > span:not(.ic) {
  display: block;
  grid-column: 2;
  color: var(--text-2);
  font-size: 1rem;
  line-height: 1.5;
}

@media (min-width: 1000px) {
  .paths a {
    grid-template-columns: 1fr;
    padding: 28px;
  }

  .paths .ic {
    grid-row: auto;
    margin-bottom: 16px;
  }

  .paths a > span:not(.ic) {
    grid-column: 1;
  }
}

body[data-page="home"] main > div > .notice {
  margin-inline: auto;
  margin-block: 24px 0;
}

body[data-page="home"] main > div > .meta {
  text-align: center;
  margin-top: 24px;
}

/* ---------- breathing guide: the exercise is the hero, in a soft field ---------- */
.section:has(> [data-breath]),
.section:has(> .breath) {
  max-width: none;
  margin-top: 16px;
  padding: 32px 20px 28px;
  border-radius: var(--r-l);
  background:
    radial-gradient(110% 80% at 50% 0%, var(--field-a), transparent 70%),
    radial-gradient(80% 70% at 50% 100%, var(--field-b), transparent 70%),
    var(--field-c);
  text-align: center;
}

@media (min-width: 768px) {
  .section:has(> [data-breath]),
  .section:has(> .breath) {
    padding: 56px 40px 48px;
  }
}

.section:has(> [data-breath]) > h2,
.section:has(> .breath) > h2 {
  margin-inline: auto;
}

.breath {
  display: grid;
  justify-items: center;
  gap: 8px;
  padding-block: 8px 4px;
  margin-inline: auto;
  max-width: 46rem;
}

.breath-visual {
  position: relative;
  width: min(80vw, 380px);
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}

/* the full-size ring: how far one breath in goes */
.breath-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
}

.breath-circle {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 35%, var(--field-a) 0%, var(--accent-soft) 75%);
  border: 3px solid var(--accent-ring);
  transform: scale(0.55);
  transition-property: transform;
  transition-timing-function: ease-in-out;
  transition-duration: 0s;
}

.breath-readout {
  position: relative;
  text-align: center;
  display: grid;
  gap: 2px;
}

.breath-phase {
  text-wrap: balance;
  font-size: 1.75rem;
  font-weight: 600;
  line-height: 1.25;
  min-height: 1.25em;
}

/* the words stay inside the circle at its smallest (idle) size: they wrap instead of spilling over the edge */
.breath-visual .breath-readout {
  max-width: 50%;
}

.breath-visual .breath-phase {
  font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.75rem);
}

/* before the start there is no count: keep the words in the middle of the circle, where it is widest */
.breath-visual .breath-count:empty {
  display: none;
}

.breath-count {
  font-size: 4.5rem;
  font-weight: 500;
  line-height: 1;
  color: var(--accent-deep);
  font-variant-numeric: tabular-nums;
  min-height: 1em;
}

.breath-meta {
  color: var(--muted);
  font-size: 1rem;
  min-height: 1.6em;
  margin: 0;
}

.breath .btn-row {
  justify-content: center;
}

.breath-text {
  max-width: 36rem;
  margin-inline: auto;
  color: var(--text-2);
  text-align: center;
  margin-top: 8px;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--text-2);
}

.check input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--accent);
}

/* ---------- lists of small steps and the grounding stepper ---------- */
.steps {
  padding-inline-start: 22px;
  margin: 0;
}

.steps li {
  font-size: 1.125rem;
  margin-bottom: 10px;
}

/* "more small things": soft rows, one idea each */
ul.steps {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 10px;
}

ul.steps li {
  margin: 0;
  padding: 14px 20px;
  padding-inline-start: 44px;
  position: relative;
  border-radius: var(--r-s);
  background: var(--tint);
}

ul.steps li::before {
  content: "";
  position: absolute;
  inset-inline-start: 20px;
  top: 1.2em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--hue);
}

/* grounding 5-4-3-2-1: each sense its own hue */
ol.steps > li { --hue: var(--h1); --tint: var(--t1); }
ol.steps > li:nth-child(2) { --hue: var(--h2); --tint: var(--t2); }
ol.steps > li:nth-child(3) { --hue: var(--h3); --tint: var(--t3); }
ol.steps > li:nth-child(4) { --hue: var(--h4); --tint: var(--t4); }
ol.steps > li:nth-child(5) { --hue: var(--h2); --tint: var(--t2); }

.stepper {
  padding: 28px 24px;
  border-radius: var(--r-l);
  background: var(--surface);
}

.stepper .steps {
  list-style: none;
  padding: 0;
}

.stepper .steps li {
  font-size: clamp(1.375rem, 1.2rem + 0.8vw, 1.75rem);
  font-weight: 500;
  line-height: 1.45;
  min-height: 6.5em;
}

.step-num {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--hue, var(--accent));
  font-size: 2.5rem;
  font-weight: 600;
  line-height: 1;
  color: var(--on-hue);
  margin-bottom: 16px;
}

.steps:not(.stepper .steps) .step-num {
  width: 48px;
  height: 48px;
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.step-pos {
  color: var(--muted);
  font-size: 1rem;
  margin: 0;
}

/* colour carried by the content: cards and steps cycle through the hue family */
.prose ul:has(> li > strong:first-child) > li,
.kids-list li,
.prose ol:has(> li > strong:first-child) > li,
ul.steps li,
.cards > .card,
.lines > li,
.apps-list li { --hue: var(--h1); --tint: var(--t1); }
.prose ul:has(> li > strong:first-child) > li:nth-child(4n+2),
.kids-list li:nth-child(4n+2),
.prose ol:has(> li > strong:first-child) > li:nth-child(4n+2),
ul.steps li:nth-child(4n+2),
.cards > .card:nth-child(3n+2),
.lines > li:nth-child(4n+2),
.apps-list li:nth-child(4n+2) { --hue: var(--h2); --tint: var(--t2); }
.prose ul:has(> li > strong:first-child) > li:nth-child(4n+3),
.kids-list li:nth-child(4n+3),
.prose ol:has(> li > strong:first-child) > li:nth-child(4n+3),
ul.steps li:nth-child(4n+3),
.cards > .card:nth-child(3n+3),
.lines > li:nth-child(4n+3),
.apps-list li:nth-child(4n+3) { --hue: var(--h3); --tint: var(--t3); }
.prose ul:has(> li > strong:first-child) > li:nth-child(4n+4),
.kids-list li:nth-child(4n+4),
.prose ol:has(> li > strong:first-child) > li:nth-child(4n+4),
ul.steps li:nth-child(4n+4),
.lines > li:nth-child(4n+4),
.apps-list li:nth-child(4n+4) { --hue: var(--h4); --tint: var(--t4); }

/* ---------- prose pages: a narrow reading column broken into components ---------- */
.prose {
  padding-block: 16px 48px;
}

/* the reading column sits in the middle of the page; cards and help lines may be wider */
.prose > div > *,
.prose > :not(div) {
  max-width: 48rem;
  margin-inline: auto;
}

.prose .cards,
.prose .lines {
  max-width: 72rem;
}

.prose > div > h1:first-child,
.prose > h1:first-child {
  margin-top: 32px;
  margin-bottom: 16px;
}

@media (min-width: 768px) {
  .prose > div > h1:first-child,
  .prose > h1:first-child { margin-top: 72px; }
}

.prose h2 {
  margin-top: 2.2em;
}

.prose h3 {
  margin-top: 1.6em;
}

.prose p,
.prose li,
.prose dd {
  font-size: 1.125rem;
  line-height: 1.7;
}

.prose p {
  max-width: 68ch;
}

.prose ul,
.prose ol {
  padding-inline-start: 24px;
}

.prose li {
  margin-bottom: 8px;
}

.prose li::marker {
  color: var(--accent);
}

.prose a {
  overflow-wrap: anywhere;
}

/* a list whose items open with a bold lead ("<strong>Ask first.</strong> ..."): soft cards, two columns on wide screens */
.prose ul:has(> li > strong:first-child),
.kids-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 12px;
  margin-block: 16px 24px;
}

@media (min-width: 768px) {
  .prose ul:has(> li > strong:first-child),
  .kids-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.prose ul:has(> li > strong:first-child) > li,
.kids-list li {
  margin: 0;
  padding: 18px 20px;
  border-radius: var(--r-s);
  background: var(--tint);
  font-size: 1.0625rem;
  line-height: 1.6;
}

.prose ul:has(> li > strong:first-child) > li > strong:first-child,
.kids-list li > strong:first-child {
  display: block;
  color: var(--hue);
  font-size: 1.1875rem;
  margin-bottom: 4px;
}

/* a numbered list of calm steps: a number in a soft circle, the bold lead as its title */
.prose ol:has(> li > strong:first-child) {
  list-style: none;
  padding: 0;
  counter-reset: step;
  display: grid;
  gap: 12px;
  margin-block: 16px 24px;
}

.prose ol:has(> li > strong:first-child) > li {
  counter-increment: step;
  position: relative;
  margin: 0;
  padding: 18px 20px;
  padding-inline-start: 76px;
  border-radius: var(--r-s);
  background: var(--tint);
  min-height: 76px;
}

.prose ol:has(> li > strong:first-child) > li::before {
  content: counter(step);
  position: absolute;
  inset-inline-start: 18px;
  top: 16px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--hue);
  color: var(--on-hue);
  font-weight: 600;
  font-size: 1.125rem;
}

.prose ol:has(> li > strong:first-child) > li > strong:first-child {
  display: block;
  font-size: 1.1875rem;
}

/* grouped cards (e.g. advice by age): a row of soft cards */
.cards {
  display: grid;
  gap: 12px;
  margin-block: 16px 24px;
}

@media (min-width: 900px) {
  .prose .cards {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.card {
  padding: 24px;
  border-radius: var(--r-s);
  background: var(--tint, var(--surface));
  border-top: 6px solid var(--hue, var(--accent));
}

.card > h3:first-child {
  margin-top: 0;
  color: var(--hue, var(--accent));
}

.card li::marker {
  color: var(--hue, var(--accent));
}

.card ul {
  margin: 0;
  padding-inline-start: 20px;
}

.card li {
  font-size: 1.0625rem;
}

/* sources at the end of every content screen: one quiet box */
.sources {
  margin-top: 56px;
  padding: 20px 24px;
  border-radius: var(--r-s);
  border: 1px solid var(--line);
  color: var(--text-2);
  font-size: 0.9375rem;
  max-width: 48rem;
}

.sources h2 {
  font-size: 1.0625rem;
  font-weight: 600;
  margin: 0 0 8px;
}

.sources ul {
  padding-inline-start: 20px;
  margin: 0 0 8px;
}

.sources li,
.prose .sources li,
.sources p,
.prose .sources p {
  font-size: 0.9375rem;
  line-height: 1.6;
  margin-bottom: 4px;
}

/* ---------- help lines: one card per line, the number as a big pill ---------- */
.lines {
  list-style: none;
  padding: 0;
  margin: 24px 0 0;
  display: grid;
  gap: 16px;
}

@media (min-width: 900px) {
  .prose .lines {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.lines > li {
  padding: 24px;
  border-radius: var(--r-s);
  background: var(--tint);
  margin: 0;
}

.lines h2 {
  margin: 0 0 6px;
  font-size: 1.375rem;
}

.lines p {
  margin-bottom: 8px;
}

.lines .btn {
  font-size: 1.375rem;
  font-weight: 600;
  min-height: 56px;
  min-width: min(9rem, 100%);
  font-variant-numeric: tabular-nums;
}

.lines .btn-row {
  margin-block: 12px 8px;
}

/* ---------- kids ---------- */
.kids .breath-phase {
  font-size: 2rem;
}

.kids .breath-count {
  font-size: 4.5rem;
}

.cake {
  width: min(62vw, 240px);
  height: auto;
}

@media (min-width: 600px) {
  .cake { width: 300px; }
}

/* before the game starts there is no count: no empty 72 px line between the words and the button */
.kids .breath-count:empty {
  display: none;
}

.cake .plate { fill: var(--line); }
.cake .tier { fill: var(--accent-soft); stroke: var(--accent-ring); stroke-width: 3; }
.cake .candle { fill: var(--bg); stroke: var(--text-2); stroke-width: 2; }
.cake .flame { fill: var(--flame); transform-box: fill-box; transform-origin: 50% 100%; transition: opacity 0.6s ease, transform 0.6s ease; }
.cake .flame.out { opacity: 0; transform: scaleY(0.2); }
.cake .smoke { fill: none; stroke: var(--axis); stroke-width: 2; stroke-linecap: round; opacity: 0; transition: opacity 0.8s ease; }
.cake .smoke.on { opacity: 1; }

@keyframes flicker {
  0%, 100% { transform: scale(1, 1); }
  50% { transform: scale(0.94, 1.06); }
}

.cake .flame:not(.out) {
  animation: flicker 2.4s ease-in-out infinite;
}

.kids-big {
  font-size: 1.3125rem;
  line-height: 1.6;
}

/* ---------- more apps ---------- */
.apps-list {
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
  display: grid;
  gap: 12px;
}

@media (min-width: 768px) {
  .apps-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.apps-list li {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px;
  border-radius: var(--r-s);
  background: var(--tint);
}

.apps-list svg {
  width: 48px;
  height: 48px;
  flex: none;
  margin-top: 2px;
  padding: 10px;
  border-radius: 50%;
  background: var(--hue);
  color: var(--on-hue);
}

.apps-list svg .mark-peak {
  fill: var(--on-hue);
  opacity: 0.7;
}

/* the text beside the icon may shrink below its longest word, so long names wrap instead of widening the page */
.apps-list li > div {
  min-width: 0;
}

.apps-list h2,
.apps-list h3 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}

.apps-list p {
  margin: 0 0 4px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-2);
}

.apps-list a {
  display: inline-block;
  padding-block: 10px;
  min-width: 44px;
  max-width: 100%;
  text-align: start; /* a long name that wraps (Russian on a phone) lines up with the text above it */
  color: var(--accent);
  font-weight: 500;
}

.mark-peak {
  fill: var(--accent);
}

/* the home page's "more apps": a quieter, wider block */
body[data-page="home"] .section:has(.apps-list) {
  max-width: none;
}

body[data-page="home"] .section:has(.apps-list) > h2 {
  text-align: center;
}

/* ---------- footer: one soft band ---------- */
.site-footer {
  margin-top: 80px;
  background: var(--surface);
  color: var(--text-2);
  font-size: 0.9375rem;
  border-radius: var(--r-l) var(--r-l) 0 0;
}

.site-footer .wrap {
  padding-block: 32px 40px;
}

/* Gladyard "more tools" block (design-playbook/FAMILY.md): first block of the footer on every page */
.gy-more {
  --gy-accent: var(--accent);
  padding-block: 0 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.gy-more-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4em;
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.gy-lockup {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  min-height: 44px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
}

.gy-lockup:hover {
  color: var(--accent);
}

.gy-mark {
  width: 20px;
  height: 20px;
  flex: none;
}

.gy-more-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 16px;
}

@media (min-width: 768px) {
  .gy-more-list { grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); }
}

.gy-more-list a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: 44px;
  color: var(--text);
  text-decoration: none;
}

.gy-more-list a:hover {
  color: var(--accent);
}

.gy-more-list a > span {
  min-width: 0;
}

.gy-more-list svg {
  width: 24px;
  height: 24px;
  flex: none;
  color: var(--text-2);
}

.gy-more-list svg .mark-peak {
  fill: var(--gy-accent);
}

/* who built it: one quiet line under the footer links, as in the sister apps */
.maker-line {
  margin: 12px 0 0;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.maker-line a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--accent);
  font-weight: 500;
}

/* footer credit, level 2 (Chen 9.11, same as tension-index): small photo + line + Facebook icon */
.maker-line {
  display: flex;
  align-items: center;
  gap: 6px 10px;
}

.maker-line .maker-who {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  min-width: 0;
}

.maker-mini {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--accent);
}

.maker-line .maker-fb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none; /* keeps the 44 x 44 touch target when the line is narrow */
  width: 44px;
  height: 44px;
  margin-inline-start: -6px;
}

.maker-line .maker-fb svg {
  width: 26px;
  height: 26px;
  border-radius: 6px;
}

/* new-tab marking: the Facebook icon says "opens in a new tab" in its label, so it gets no visible arrow;
   the who-link's arrow sits after its last word, inside the text, not after the photo-and-text box */
.maker-line .maker-fb::after,
.maker-line .maker-who::after {
  content: none !important;
}

.maker-line .maker-who[data-ext] > span:not(.ext-note)::after {
  content: "\2060\00a0\2197";
  content: "\2060\00a0\2197" / "";
  font-size: 0.8em;
}

[dir="rtl"] .maker-line .maker-who[data-ext] > span:not(.ext-note)::after {
  content: "\2060\00a0\2196";
  content: "\2060\00a0\2196" / "";
}

.site-footer .oref {
  margin-bottom: 12px;
  max-width: 46rem;
  font-size: 0.9375rem;
}

.site-footer .oref a {
  color: var(--text);
  font-weight: 500;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0 20px;
}

.footer-links a {
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
}

.footer-links a:hover {
  color: var(--accent);
}

/* long words (Russian, or any language at 200% text) wrap inside their card instead of widening the page */
.paths a,
.prose li,
.card,
.lines > li,
.apps-list li > div,
.mamad,
.gy-more-list a > span,
.notice {
  overflow-wrap: anywhere;
}

@media (max-width: 479.98px) {
  .lines > li,
  .card { padding: 18px 16px; }
  .prose ol:has(> li > strong:first-child) > li { padding-inline-start: 64px; }
  .prose ol:has(> li > strong:first-child) > li::before { inset-inline-start: 12px; }
}

/* phones: the name and the three buttons share one row, the menu chips take two rows under them */
@media (max-width: 479.98px) {
  .brand { font-size: 1.25rem; gap: 8px; }
  .brand svg { width: 26px; height: 26px; }
  .controls, .lang-switch { gap: 6px; }
  .lang-switch .icon-btn { padding-inline: 10px; font-size: 0.875rem; }
  .site-header .wrap { padding-block: 10px; column-gap: 8px; }
}

/* tool pages: everything under the exercise sits in one centred reading column */
body[data-page="now"] main > .section:not(:has(> [data-breath])),
body[data-page="now"] main > div[data-lang],
body[data-page="now"] main > .offline-hint,
body[data-page="kids"] main > .section:not(:has(> .breath)),
body[data-page="kids"] main > div[data-lang] {
  max-width: 48rem;
  margin-inline: auto;
}

body[data-page="now"] main > .offline-hint {
  margin-block: 32px;
}

body[data-page="now"] main > div[data-lang] > .notice,
body[data-page="now"] main > div[data-lang] > .sources,
body[data-page="kids"] main > div[data-lang] > .sources {
  max-width: none;
}

body[data-page="now"] .section > ul ~ p {
  margin-top: 24px;
}

/* tool pages: the start button is in the first view on a 390 x 844 phone and a 1440 x 900 screen */
body[data-page="now"] main > .page-head,
body[data-page="kids"] main > .page-head {
  padding-block: 24px 0;
}

@media (min-width: 768px) {
  body[data-page="now"] main > .page-head,
  body[data-page="kids"] main > .page-head {
    padding-block: 40px 0;
  }
}

body[data-page="now"] .section:has(> [data-breath]),
body[data-page="kids"] .section:has(> .breath) {
  margin-top: 24px;
}

@media (max-width: 599.98px) {
  body[data-page="now"] .breath-visual {
    width: min(68vw, 260px);
  }

  body[data-page="now"] .section:has(> [data-breath]),
  body[data-page="kids"] .section:has(> .breath) {
    padding-block: 20px 24px;
  }

  .kids .breath-phase {
    font-size: 1.625rem;
  }
}

/* the kids game sits in a warm candle field */
body[data-page="kids"] .section:has(> .breath) {
  background:
    radial-gradient(110% 80% at 50% 0%, var(--kids-a), transparent 70%),
    radial-gradient(80% 70% at 50% 100%, var(--kids-b), transparent 70%),
    var(--kids-a);
}

/* /now on wide screens: the circle a little smaller so the start button is in the first view */
@media (min-width: 960px) {
  body[data-page="now"] .section:has(> [data-breath]),
  body[data-page="kids"] .section:has(> .breath) {
    padding-block: 32px 40px;
  }

  body[data-page="now"] .breath-visual {
    width: 330px;
  }
}

/* ---------- motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* Without JavaScript the toggles and the breathing buttons cannot work, so they are not shown.
   The inline script in <head> adds .js to <html>; the written instructions stay. */
html:not(.js) .controls,
html:not(.js) [data-breath] .btn-row,
html:not(.js) [data-breath] .breath-visual,
html:not(.js) [data-breath] .breath-readout,
html:not(.js) [data-breath] .breath-meta {
  display: none !important;
}

/* JS adds .still when the system asks for reduced motion: the circle keeps one size, the count carries the pace */
.still .breath-circle {
  transform: scale(0.85) !important;
  transition: none !important;
}

html:not(.js) [data-print],
html:not(.js) .fb-form {
  display: none !important;
}

html.js .fb-nojs {
  display: none !important;
}

/* ---------- links that open in a new tab: a small arrow (mirrored in Hebrew), as in the sister apps ---------- */
/* inline, after a word joiner and a no-break space: the arrow never sits alone on a line */
a[data-ext]:not(.btn)::after {
  content: "\2060\00a0\2197";
  content: "\2060\00a0\2197" / "";
  font-size: 0.8em;
}

[dir="rtl"] a[data-ext]:not(.btn)::after {
  content: "\2060\00a0\2196";
  content: "\2060\00a0\2196" / "";
}

/* ---------- ideas and bug reports (/feedback) ---------- */
.fb-form {
  padding: 24px;
  border-radius: var(--r-s);
  background: var(--surface);
  margin-block: 16px 24px;
  max-width: 44rem;
}

.fb-form fieldset {
  border: 0;
  padding: 0;
  margin: 0 0 14px;
  min-width: 0;
}

.fb-form legend {
  font-weight: 600;
  padding: 0;
  margin-bottom: 4px;
}

.fb-kinds label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  cursor: pointer;
}

.fb-kinds input {
  width: 22px;
  height: 22px;
  margin: 0;
  flex: none;
  accent-color: var(--accent);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-block: 12px;
}

.field label {
  font-weight: 600;
}

.field .hint {
  color: var(--muted);
  font-size: 0.9375rem;
  margin: 0;
}

.fb-form textarea,
.fb-form input[type="text"] {
  font: inherit;
  color: var(--text);
  background: var(--bg);
  border: 1.5px solid var(--muted); /* 5:1 and more against the field, light and dark */
  border-radius: 12px;
  padding: 10px 14px;
  min-height: 48px;
  width: 100%;
  max-width: 38rem;
}

.fb-form textarea {
  min-height: 160px;
  resize: vertical;
  line-height: 1.55;
}

.fb-form textarea:hover,
.fb-form input[type="text"]:hover {
  border-color: var(--text-2);
}

.btn[aria-disabled="true"] {
  opacity: 0.7;
  cursor: progress;
}

/* honeypot for bots: off-screen, never focusable */
.fb-hp {
  position: absolute;
  inset-inline-start: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.status {
  min-height: 1.5em;
  color: var(--text-2);
  margin-block: 8px;
  font-weight: 600;
}

.status.ok {
  color: var(--accent);
}

.status.error {
  color: var(--bad);
}

/* ---------- safe-room card (/card): one page to print and hang ---------- */
.mamad {
  padding: 16px;
  border-radius: var(--r-l);
  background: var(--surface);
  margin-block: 16px 32px;
  max-width: 56rem;
}

@media (min-width: 480px) {
  .mamad { padding: 24px; }
}

@media (min-width: 768px) {
  .mamad { padding: 40px; }
}

.mamad h2 {
  font-size: 1.375rem;
  margin: 0 0 8px;
}

.mamad-oref {
  font-weight: 500;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.mamad-grid {
  display: grid;
  gap: 8px 40px;
}

@media (min-width: 768px) {
  .mamad-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.mamad-sec {
  margin-bottom: 16px;
}

.mamad ol,
.mamad ul {
  margin: 0 0 8px;
  padding-inline-start: 22px;
}

.mamad li {
  margin-bottom: 4px;
}

.mamad .ground {
  list-style: none;
  padding: 0;
}

.mamad .ground li {
  display: flex;
  gap: 12px;
  align-items: baseline;
}

.mamad .gn {
  font-weight: 600;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--accent);
  min-width: 1.1em;
  flex: none;
}

.mamad-lines {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.mamad .lines-list {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
}

.mamad .lines-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 14px;
  border-bottom: 1px solid var(--line);
  padding-block: 6px;
  margin: 0;
}

.mamad .lines-list .num {
  font-size: 1.3125rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: none; /* never narrower than the number itself */
}

.mamad .lines-list a.num {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  color: var(--accent);
}

.mamad .urgent {
  font-size: 1.0625rem;
}

.mamad .urgent a {
  font-size: 1.375rem;
  font-weight: 600;
}

/* ---------- print: black on white, no controls, a footer with a QR code to the home page ---------- */
.print-foot {
  display: none;
}

@media print {
  @page {
    margin: 14mm 12mm;
  }

  :root,
  :root[data-theme] {
    color-scheme: light;
    --bg: #fff !important;
    --surface: #fff !important;
    --surface-2: #fff !important;
    --text: #000 !important;
    --text-2: #000 !important;
    --muted: #333 !important;
    --line: #888 !important;
    --line-strong: #555 !important;
    --rule: #000 !important;
    --axis: #555 !important;
    --accent: #000 !important;
    --accent-soft: #fff !important;
    --accent-ring: #000 !important;
    --field-a: #fff !important;
    --field-b: #fff !important;
    --field-c: #fff !important;
  }

  html,
  body {
    background: #fff !important;
    color: #000 !important;
  }

  body {
    display: block;
    min-height: 0;
    font-size: 11pt;
    line-height: 1.45;
  }

  .skip,
  .site-header .controls,
  .nav,
  .btn-row,
  button,
  .footer-links,
  .maker-line,
  .gy-more,
  .hero-orb,
  .offline-hint,
  .fb-form,
  .breath-visual,
  .breath-meta,
  label.check,
  .step-pos {
    display: none !important;
  }

  .site-header {
    border-bottom: 1px solid #000;
  }

  .brand {
    min-height: 0;
    padding-block: 0 4px;
  }

  h1 {
    font-size: 22pt;
  }

  h2 {
    font-size: 15pt;
  }

  .page-head.start,
  .section:has(> [data-breath]),
  .section:has(> .breath),
  .stepper,
  .notice,
  .card,
  .lines > li,
  .paths a,
  .apps-list li,
  ul.steps li,
  .prose ul:has(> li > strong:first-child) > li,
  .prose ol:has(> li > strong:first-child) > li,
  .kids-list li,
  .sources {
    background: none !important;
    border-radius: 0;
    padding-block: 1mm;
    padding-inline-end: 0;
    min-height: 0;
  }

  .page-head.start {
    display: block;
    text-align: start;
  }

  .notice::before {
    display: none;
  }

  .notice {
    padding-inline-start: 0;
    border-block: 1px solid #000;
  }

  .site-footer {
    margin-top: 6mm;
    border-top: 1px solid #000;
    border-radius: 0;
    background: none;
  }

  .site-footer .wrap {
    padding-block: 3mm 0;
  }

  a {
    color: #000 !important;
  }

  a[data-ext]::after {
    content: none !important;
  }

  h1,
  h2,
  h3 {
    break-after: avoid;
    page-break-after: avoid;
  }

  li,
  tr,
  .lines > li,
  .paths li,
  .apps-list li {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  p {
    orphans: 3;
    widows: 3;
  }

  /* /help: the numbers are the point on paper, so the dial buttons print as plain text */
  .lines .btn-row {
    display: flex !important;
    margin-block: 2px 4px;
  }

  .lines .btn {
    border: 0;
    background: none !important;
    color: #000 !important;
    padding: 0;
    min-height: 0;
    min-width: 0;
    font-weight: 600;
  }

  /* the grounding stepper shows one step at a time on screen; on paper all five */
  .stepper .steps li[hidden] {
    display: list-item !important;
  }

  .stepper .steps li {
    min-height: 0;
    font-size: 12pt;
  }

  .step-num {
    display: inline;
    width: auto;
    height: auto;
    background: none;
    font-size: 14pt;
    margin-inline-end: 2mm;
  }

  /* safe-room card: one sheet, with the QR footer under the frame */
  body[data-page="card"] .site-header,
  body[data-page="card"] .site-footer,
  body[data-page="card"] .page-head p {
    display: none !important;
  }

  body[data-page="card"] .page-head {
    padding: 0;
  }

  body[data-page="card"] h1 {
    font-size: 20pt;
    margin: 0 0 2mm;
  }

  .mamad {
    border: 1.5pt solid #000;
    border-radius: 0;
    background: none;
    padding: 4mm 5mm;
    margin: 0;
    max-width: none;
    font-size: 10.5pt;
    line-height: 1.35;
  }

  /* Russian runs about a fifth longer than Hebrew: a half point smaller keeps the card on one sheet */
  html:lang(ru) .mamad {
    font-size: 10pt;
  }

  .mamad p {
    margin-bottom: 1.5mm;
  }

  .mamad-oref {
    padding-bottom: 2mm;
    margin-bottom: 3mm;
  }

  .mamad-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0 8mm;
  }

  .mamad h2 {
    font-size: 13pt;
    border: 0;
    padding: 0;
    margin: 0 0 1.5mm;
  }

  .mamad-sec {
    margin-bottom: 2mm;
  }

  .mamad li {
    margin-bottom: 1mm;
  }

  .mamad .gn {
    font-size: 14pt;
  }

  .mamad-lines {
    padding-top: 2mm;
  }

  .mamad .lines-list li {
    flex-wrap: nowrap;
    align-items: baseline;
    padding-block: 0.7mm;
    margin: 0;
  }

  .mamad .lines-list .num,
  .mamad .urgent a {
    font-size: 13pt;
  }

  .mamad .lines-list a.num {
    min-height: 0;
  }

  .mamad .meta {
    font-size: 9pt;
    margin: 1mm 0 0;
  }

  .print-foot {
    display: flex !important;
    align-items: center;
    gap: 6mm;
    margin-top: 4mm;
    padding-top: 3mm;
    border-top: 1px solid #000;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .pf-qr svg {
    display: block;
    width: 3cm;
    height: 3cm;
  }

  .print-foot p {
    margin: 0 0 1mm;
    color: #000;
  }

  .pf-name {
    font-size: 15pt;
    font-weight: 700;
  }

  .pf-url {
    font-size: 11pt;
    text-align: start;
  }

  .pf-scan,
  .pf-date {
    font-size: 9.5pt;
  }
}

/* reading text: no single orphan word on the last line */
p,
li {
  text-wrap: pretty;
}

/* /help: the two practical notes sit under the line cards as small soft cards */
.help-notes {
  display: grid;
  gap: 12px;
  margin-block: 32px 24px;
}

@media (min-width: 768px) {
  .help-notes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.prose > div > .help-notes {
  max-width: 72rem;
}

.help-notes > p {
  margin: 0;
  padding: 16px 20px;
  border-radius: var(--r-s);
  background: var(--surface);
  color: var(--text-2);
  font-size: 1rem;
}

.lines > li {
  display: flex;
  flex-direction: column;
}

.lines > li > .meta:last-child {
  margin-top: auto;
  padding-top: 8px;
}

/* /talk: bold-lead card grids and the age cards share one width; an odd last card spans the row */
.prose > div > ul:has(> li > strong:first-child),
.prose > ul:has(> li > strong:first-child),
.prose .cards {
  max-width: 60rem;
}

@media (min-width: 768px) {
  .prose ul:has(> li > strong:first-child) > li:last-child:nth-child(odd),
  .kids-list > li:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

/* help line cards use the full column (the generic .prose ul indent does not apply) */
.prose .lines {
  padding: 0;
}

/* round 2 (critic r2) */
.prose .apps-list {
  padding: 0;
}

/* app link rows: plain gaps between the links (no text dots, so none is left at a line end) */
.apps-list .app-links a {
  margin-inline-end: 16px;
}

.nw {
  white-space: nowrap;
}

/* /help and /talk: one container; headings and text start at the card grid's edge */
body[data-page="help"] .prose > div > *,
body[data-page="talk"] .prose > div > * {
  margin-inline: 0 auto;
}

body[data-page="help"] .prose > div > :is(p, h2, h3),
body[data-page="talk"] .prose > div > :is(p, h2, h3) {
  max-width: 68ch;
}

body[data-page="talk"] .prose .cards,
body[data-page="talk"] .prose ul:has(> li > strong:first-child) {
  max-width: none;
}

/* home: the hero field does not touch the header band */
body[data-page="home"] .page-head.start {
  margin-top: 16px;
}

@media (min-width: 768px) {
  body[data-page="home"] .page-head.start { margin-top: 24px; }
}

/* text pages: a soft wash of the content hues under the header, so colour reaches the first view */
body:is([data-page="talk"], [data-page="after"], [data-page="card"], [data-page="apps"], [data-page="help"],
  [data-page="privacy"], [data-page="a11y"], [data-page="feedback"], [data-page="404"], [data-page="offline"]) {
  background:
    radial-gradient(1100px 460px at 85% 60px, var(--t1), transparent 72%),
    radial-gradient(900px 400px at 10% 40px, var(--t2), transparent 72%),
    var(--bg);
  background-repeat: no-repeat;
}

/* the card preview: each section head gets its hue disc (screen only; the printed card stays black on white) */
@media screen {
  .mamad-sec > h2 {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .mamad-sec > h2::before {
    content: "";
    flex: none;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--h1);
  }

  .mamad-grid > .mamad-sec:nth-child(2) > h2::before { background: var(--h2); }
  .mamad-lines > h2::before { background: var(--h3); }
}
