/* ==========================================================================
   Ruskandora — styles.css
   Palette and forms follow the approved brand board.
   No external fonts or remote assets: everything here ships in the ZIP.
   ========================================================================== */

:root {
  --sun: #FFD54F;
  --sun-deep: #F4B72A;
  --sun-soft: #FFF0BE;
  --leaf: #2E7D32;
  --leaf-mid: #43A047;
  --leaf-soft: #A5D6A7;
  --leaf-tint: #E8F5E9;
  --forest: #1B5E20;
  --sky: #26C5DA;
  --sky-soft: #D6F4F8;
  --blossom: #FF6F91;
  --blossom-soft: #FFE1E8;
  --cream: #FFF9E6;
  --stage: #FFF6E1;
  --paper: #FFFFFF;
  --ink: #21301F;
  --ink-soft: #5C6B58;
  --line: #ECE2C8;

  --r-sm: 10px;
  --r-md: 16px;
  --r-lg: 24px;
  --r-xl: 34px;

  --shadow-sm: 0 2px 6px rgba(33, 48, 31, .06);
  --shadow-md: 0 6px 18px rgba(33, 48, 31, .09);
  --shadow-lg: 0 16px 40px rgba(33, 48, 31, .13);

  --sans: "Trebuchet MS", "Segoe UI", Verdana, "DejaVu Sans", system-ui, sans-serif;
  --shell: 1180px;
}

/* ----------------------------- reset ------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  max-width: 100%;
  overflow-x: hidden;           /* hard guarantee against sideways scroll */
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--cream);
  font-size: 17px;
  line-height: 1.62;
  -webkit-text-size-adjust: 100%;
}

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

/* Grid and flex children default to min-width:auto, which lets wide content
   (long words, scrolling strips, SVGs) push a track wider than the screen. */
.hero-grid > *, .detail-grid > *, .app-layout > *, .card-grid > *,
.pillars > *, .steps > *, .stat-grid > *, .family-grid > *,
.ready-facts > *, .role > *, .age-row > *, .header-inner > * { min-width: 0; }
svg { height: auto; display: block; }

h1, h2, h3, h4 {
  margin: 0 0 .5em;
  line-height: 1.2;
  color: var(--forest);
  letter-spacing: -.015em;
  font-weight: 700;
  overflow-wrap: break-word;
}
h1 { font-size: clamp(2rem, 6.2vw, 3.3rem); letter-spacing: -.028em; }
h2 { font-size: clamp(1.45rem, 4vw, 2.1rem); }
h3 { font-size: clamp(1.12rem, 2.6vw, 1.35rem); }
p  { margin: 0 0 1em; overflow-wrap: break-word; }
a  { color: var(--leaf); }

:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--forest); color: #fff;
  padding: 12px 18px; border-radius: var(--r-sm); font-weight: 700;
  transition: top .18s ease;
}
.skip-link:focus { top: 12px; }

.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 20px;
}

/* ----------------------------- buttons ---------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: .55em;
  min-height: 52px;                 /* generous touch target */
  padding: 13px 26px;
  border: 0; border-radius: 999px;
  font: inherit; font-weight: 700; font-size: 1rem;
  text-decoration: none; cursor: pointer;
  transition: transform .16s ease, box-shadow .16s ease, background-color .16s ease;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: var(--sun); color: var(--forest);
  box-shadow: 0 4px 0 var(--sun-deep);
}
.btn-primary:hover { background: #FFDD70; }

.btn-solid {
  background: var(--leaf); color: #fff;
  box-shadow: 0 4px 0 var(--forest);
}
.btn-solid:hover { background: var(--leaf-mid); }

.btn-ghost {
  background: var(--paper); color: var(--forest);
  box-shadow: inset 0 0 0 2px var(--line);
}
.btn-ghost:hover { box-shadow: inset 0 0 0 2px var(--leaf-soft); }

.btn-quiet {
  background: transparent; color: var(--leaf);
  min-height: 44px; padding: 8px 14px; font-weight: 700;
}
.btn-quiet:hover { background: var(--leaf-tint); }

.btn-sm { min-height: 44px; padding: 9px 18px; font-size: .93rem; }
.btn[disabled] { opacity: .45; cursor: not-allowed; box-shadow: none; }
.btn-block { width: 100%; }

/* ----------------------------- site header ------------------------------ */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255, 249, 230, .96);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; min-height: 74px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; min-width: 0; }
.brand > span:last-child { min-width: 0; }
.brand svg, .brand img { width: 40px; height: 40px; flex: 0 0 auto; }
.brand-name {
  font-size: clamp(1.05rem, 4.4vw, 1.32rem); font-weight: 700;
  color: var(--forest); letter-spacing: -.02em;
  display: block; white-space: nowrap;
}
.brand-tag {
  display: block; font-size: .6rem; font-weight: 700; white-space: nowrap;
  letter-spacing: .16em; color: var(--leaf-mid); text-transform: uppercase;
}

.site-nav { display: flex; align-items: center; gap: 4px; }
.site-nav a {
  padding: 10px 14px; border-radius: var(--r-sm);
  color: var(--forest); text-decoration: none; font-weight: 600; font-size: .95rem;
}
.site-nav a:hover { background: var(--leaf-tint); }

.nav-toggle { display: none; }

/* ----------------------------- hero ------------------------------------- */
.hero { padding: 40px 0 24px; }
.hero-grid {
  display: grid; gap: 32px; align-items: center;
  grid-template-columns: 1fr;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--leaf-tint); color: var(--forest);
  padding: 7px 15px; border-radius: 999px;
  font-size: .82rem; font-weight: 700; letter-spacing: .02em;
  margin-bottom: 18px;
}
.hero h1 { margin-bottom: .35em; }
.hero h1 .accent {
  background: linear-gradient(transparent 62%, var(--sun) 62%);
}
.hero-lede { font-size: 1.12rem; color: var(--ink-soft); max-width: 46ch; }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin: 26px 0 20px; }

.age-strip {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  font-size: .92rem; color: var(--ink-soft); font-weight: 600;
}
.age-chip {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 50%; background: var(--paper);
  box-shadow: inset 0 0 0 2px var(--leaf-soft);
  font-weight: 700; color: var(--forest);
}

.hero-art {
  background: var(--stage);
  border-radius: var(--r-xl);
  padding: 14px;
  box-shadow: var(--shadow-md);
}
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper); color: var(--forest);
  border-radius: 999px; padding: 10px 18px;
  font-weight: 700; font-size: .88rem;
  box-shadow: var(--shadow-sm);
  margin-top: -26px; margin-left: 14px; position: relative;
}

/* ----------------------------- sections --------------------------------- */
.section { padding: 54px 0; }
.section-cream { background: var(--stage); }
.section-head { max-width: 60ch; margin-bottom: 34px; }
.section-head p { color: var(--ink-soft); margin: 0; }

.pillars {
  display: grid; gap: 18px;
  grid-template-columns: 1fr;
}
.pillar {
  background: var(--paper); border-radius: var(--r-lg);
  padding: 24px; box-shadow: var(--shadow-sm);
  border-top: 5px solid var(--leaf-soft);
}
.pillar:nth-child(2) { border-top-color: var(--sun); }
.pillar:nth-child(3) { border-top-color: var(--sky); }
.pillar:nth-child(4) { border-top-color: var(--blossom); }
.pillar h3 { margin-bottom: .3em; }
.pillar p { margin: 0; color: var(--ink-soft); font-size: .97rem; }

/* how it works — a real three-step sequence, so numbers are meaningful */
.steps { display: grid; gap: 20px; grid-template-columns: 1fr; counter-reset: step; }
.step {
  display: grid; grid-template-columns: 52px 1fr; gap: 18px; align-items: start;
}
.step-num {
  width: 52px; height: 52px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--sun); color: var(--forest);
  font-weight: 700; font-size: 1.25rem;
}
.step h3 { margin-bottom: .2em; }
.step p { margin: 0; color: var(--ink-soft); }

.ages-table {
  background: var(--paper); border-radius: var(--r-lg);
  padding: 8px; box-shadow: var(--shadow-sm); overflow: hidden;
}
.age-row {
  display: grid; grid-template-columns: 78px 1fr; gap: 14px;
  padding: 16px; border-bottom: 1px solid var(--line); align-items: start;
}
.age-row:last-child { border-bottom: 0; }
.age-label {
  font-weight: 700; color: var(--forest);
  background: var(--leaf-tint); border-radius: var(--r-sm);
  padding: 7px 10px; text-align: center; font-size: .9rem;
}
.age-row p { margin: 0; font-size: .97rem; color: var(--ink-soft); }

.note-card {
  background: var(--sky-soft); border-radius: var(--r-lg);
  padding: 26px; border-left: 6px solid var(--sky);
}
.note-card h3 { margin-bottom: .35em; }
.note-card p:last-child { margin: 0; }

.site-footer {
  background: var(--forest); color: #E7F0E4;
  padding: 40px 0; margin-top: 20px;
}
.site-footer a { color: var(--sun); }
.footer-inner { display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; }
.footer-note { font-size: .87rem; opacity: .82; max-width: 52ch; margin: 0; }

/* ==========================================================================
   Demo application
   ========================================================================== */
.app { display: none; min-height: 100vh; background: var(--cream); }
body.in-app .site-header,
body.in-app .site-main,
body.in-app .site-footer { display: none; }
body.in-app .app { display: block; }

.app-layout { display: grid; grid-template-columns: 1fr; min-height: 100vh; }

.app-side {
  background: var(--forest);
  color: #E7F0E4;
  padding: 16px 14px;
}
.app-side .brand-name { color: #fff; }
.app-side .brand-tag { color: var(--leaf-soft); }
.side-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.side-brand svg { width: 38px; height: 38px; }

.side-nav { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.side-nav button {
  flex: 0 0 auto;
  display: flex; align-items: center; gap: 9px;
  background: transparent; border: 0; color: #DCE9D8;
  font: inherit; font-weight: 600; font-size: .95rem;
  padding: 11px 15px; border-radius: var(--r-sm);
  cursor: pointer; min-height: 46px; white-space: nowrap;
}
.side-nav button:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.side-nav button[aria-current="page"] { background: var(--sun); color: var(--forest); }
.side-dot { width: 9px; height: 9px; border-radius: 50%; background: currentColor; opacity: .55; }
.side-nav button[aria-current="page"] .side-dot { opacity: 1; }

.side-foot { display: none; }

.app-main { padding: 22px 16px 64px; min-width: 0; }

.app-head { margin-bottom: 22px; }
.day-kicker {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 700; color: var(--leaf-mid); font-size: .88rem;
  letter-spacing: .08em; text-transform: uppercase; margin-bottom: 6px;
}
.day-sub { color: var(--ink-soft); font-weight: 600; margin: 0; }

.day-meta {
  display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px;
}
.meta-chip {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--paper); border-radius: 999px;
  padding: 8px 15px; font-size: .87rem; font-weight: 600;
  color: var(--ink-soft); box-shadow: var(--shadow-sm);
}
.meta-chip strong { color: var(--forest); }

.progress-track {
  height: 12px; border-radius: 999px; background: var(--line);
  overflow: hidden; margin: 16px 0 8px;
}
.progress-fill {
  height: 100%; background: var(--leaf-mid); border-radius: 999px;
  transition: width .45s ease;
}

.learner-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.learner {
  display: inline-flex; align-items: center; gap: 9px;
  background: var(--paper); border-radius: 999px;
  padding: 6px 16px 6px 6px; box-shadow: var(--shadow-sm);
  font-weight: 700; font-size: .92rem; color: var(--forest);
}
.learner small { font-weight: 600; color: var(--ink-soft); }

.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; flex: 0 0 auto;
  font-weight: 700; color: #fff; font-size: .95rem;
}
.avatar-lg { width: 54px; height: 54px; font-size: 1.3rem; }
.av0 { background: var(--leaf-mid); }
.av1 { background: var(--blossom); }
.av2 { background: var(--sky); }
.av3 { background: var(--sun-deep); }
.av4 { background: var(--leaf); }
.av5 { background: #9575CD; }

/* week strip */
.week-strip {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 4px 4px 14px; margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
}
.day-tab {
  flex: 0 0 auto; width: 132px; text-align: left;
  background: var(--paper); border: 2px solid transparent;
  border-radius: var(--r-md); padding: 12px 14px;
  cursor: pointer; font: inherit; box-shadow: var(--shadow-sm);
  min-height: 78px;
}
.day-tab strong { display: block; color: var(--forest); font-size: .95rem; }
.day-tab span { font-size: .78rem; color: var(--ink-soft); display: block; line-height: 1.35; }
.day-tab[aria-current="true"] { border-color: var(--leaf-mid); background: var(--leaf-tint); }
.day-tab.is-done strong::after { content: " ✓"; color: var(--leaf-mid); }
.day-tab[disabled] { opacity: .5; cursor: not-allowed; }
.day-tab .lock { font-size: .74rem; color: var(--ink-soft); font-weight: 700; }

/* activity cards */
.card-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }

.act-card {
  background: var(--paper); border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm); overflow: hidden;
  display: flex; flex-direction: column;
  border: 2px solid transparent;
}
.act-card.is-done { border-color: var(--leaf-soft); }
.act-card .rk-ill { width: 100%; border-radius: var(--r-md); }
.act-media { padding: 12px 12px 0; }
.act-body { padding: 16px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.act-body h3 { margin-bottom: .25em; }
.act-purpose { color: var(--ink-soft); font-size: .95rem; margin-bottom: 14px; }

.tag-row { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.tag {
  font-size: .76rem; font-weight: 700; letter-spacing: .03em;
  padding: 5px 11px; border-radius: 999px;
  background: var(--leaf-tint); color: var(--forest);
}
.tag-time { background: var(--sun-soft); }

.act-foot {
  margin-top: auto; display: flex; align-items: center;
  justify-content: space-between; gap: 12px; flex-wrap: wrap;
}
.done-flag { color: var(--leaf); font-weight: 700; font-size: .9rem; }

/* materials */
.materials-panel {
  background: var(--stage); border-radius: var(--r-lg);
  padding: 24px; margin-top: 30px;
}
.materials-panel h3 { margin-bottom: .2em; }
.materials-panel .hint { color: var(--ink-soft); font-size: .93rem; margin-bottom: 16px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 9px; }
.chip {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--paper); border-radius: 999px;
  padding: 8px 15px; font-size: .89rem; font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.chip-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--leaf-mid); flex: 0 0 auto; }

/* ------------------------- activity detail ------------------------------ */
.detail-top {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap; margin-bottom: 18px;
}
.detail-art {
  background: var(--stage); border-radius: var(--r-lg);
  padding: 14px; margin-bottom: 24px;
}
.detail-grid { display: grid; gap: 22px; grid-template-columns: 1fr; }

.panel {
  background: var(--paper); border-radius: var(--r-lg);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.panel h3 {
  font-size: 1.06rem; margin-bottom: .7em;
  display: flex; align-items: center; gap: 9px;
}
.panel h3::before {
  content: ""; width: 12px; height: 12px; border-radius: 4px;
  background: var(--leaf-soft); flex: 0 0 auto;
}
.panel-safety { background: var(--blossom-soft); }
.panel-safety h3::before { background: var(--blossom); }
.panel-ready h3::before { background: var(--sun); }
.panel-dialogue { background: var(--sky-soft); }
.panel-dialogue h3::before { background: var(--sky); }

.panel ul, .panel ol { margin: 0; padding-left: 1.3em; }
.panel li { margin-bottom: .55em; }
.panel li:last-child { margin-bottom: 0; }
.panel p:last-child { margin-bottom: 0; }

.ready-facts {
  display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 16px;
}
.fact {
  background: var(--stage); border-radius: var(--r-sm); padding: 10px 12px;
}
.fact dt {
  font-size: .72rem; text-transform: uppercase; letter-spacing: .09em;
  color: var(--ink-soft); font-weight: 700; margin-bottom: 2px;
}
.fact dd { margin: 0; font-weight: 700; color: var(--forest); font-size: .93rem; }

.say-list { list-style: none; margin: 0; padding: 0; }
.say-list li {
  background: var(--paper); border-radius: var(--r-md);
  padding: 13px 16px; margin-bottom: 10px;
  border-left: 4px solid var(--sky); font-size: .98rem;
}
.say-list li:last-child { margin-bottom: 0; }

.role-list { display: grid; gap: 12px; }
.role {
  display: grid; grid-template-columns: 54px 1fr; gap: 14px;
  align-items: start; background: var(--stage);
  border-radius: var(--r-md); padding: 14px;
}
.role.is-mine { background: var(--leaf-tint); box-shadow: inset 0 0 0 2px var(--leaf-soft); }
.role-who { font-weight: 700; color: var(--forest); margin: 0 0 2px; font-size: .95rem; }
.role p { margin: 0; font-size: .95rem; color: var(--ink-soft); }

.develops-row { display: flex; flex-wrap: wrap; gap: 8px; }
.develops-row .tag { background: var(--sun-soft); }

.complete-bar {
  background: var(--paper); border-radius: var(--r-lg);
  padding: 22px; margin-top: 24px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
}
.complete-bar p { margin: 0; color: var(--ink-soft); font-size: .95rem; }

/* ------------------------- drawing pad ---------------------------------- */
.pad-wrap {
  background: var(--paper); border-radius: var(--r-lg);
  padding: 16px; box-shadow: var(--shadow-sm); margin-top: 4px;
}
.pad-stage { position: relative; border-radius: var(--r-md); overflow: hidden; background: var(--paper); }
.pad-guide {
  position: absolute; inset: 0; width: 100%; height: 100%;
  pointer-events: none;
}
.pad-canvas {
  display: block; width: 100%; height: auto;
  border: 2px dashed var(--line); border-radius: var(--r-md);
  touch-action: none; background: transparent; cursor: crosshair;
}
.pad-tools {
  display: flex; flex-wrap: wrap; gap: 10px;
  align-items: center; margin-top: 14px;
}
.swatches { display: flex; gap: 8px; }
.swatch {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid transparent; cursor: pointer; padding: 0;
  box-shadow: var(--shadow-sm);
}
.swatch[aria-pressed="true"] { border-color: var(--forest); transform: scale(1.08); }
.pad-hint {
  background: var(--sun-soft); border-radius: var(--r-md);
  padding: 12px 16px; margin-top: 12px; font-size: .94rem;
}

/* ------------------------- family / settings ---------------------------- */
.family-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
.family-card {
  background: var(--paper); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--shadow-sm);
  display: flex; align-items: center; gap: 16px;
}
.family-card h3 { margin: 0 0 2px; font-size: 1.08rem; }
.family-card p { margin: 0; color: var(--ink-soft); font-size: .92rem; }

.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stat {
  background: var(--paper); border-radius: var(--r-lg);
  padding: 20px; box-shadow: var(--shadow-sm);
}
.stat b { display: block; font-size: 1.9rem; color: var(--forest); line-height: 1.1; }
.stat span { font-size: .88rem; color: var(--ink-soft); font-weight: 600; }

.skill-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

/* ------------------------- day complete --------------------------------- */
.complete-hero {
  background: var(--stage); border-radius: var(--r-xl);
  padding: 34px 24px; text-align: center; position: relative; overflow: hidden;
}
.complete-hero .rk-ill { max-width: 300px; margin: 0 auto 12px; }
.complete-hero h2 { margin-bottom: .2em; }
.complete-hero .lede { color: var(--ink-soft); font-size: 1.06rem; margin: 0; }

.tomorrow-card {
  background: var(--forest); color: #E7F0E4;
  border-radius: var(--r-lg); padding: 24px; margin-top: 22px;
}
.tomorrow-card h3 { color: var(--sun); margin-bottom: .2em; }
.tomorrow-card p { margin: 0; opacity: .9; }

/* ------------------------- dialogs -------------------------------------- */
dialog.rk-dialog {
  border: 0; padding: 0; background: transparent;
  max-width: 620px; width: calc(100% - 28px);
  max-height: calc(100dvh - 32px);
  color: var(--ink);
}
dialog.rk-dialog::backdrop { background: rgba(27, 46, 24, .55); }
.dialog-inner {
  background: var(--cream); border-radius: var(--r-lg);
  padding: 26px 22px; box-shadow: var(--shadow-lg);
  max-height: calc(100dvh - 32px); overflow-y: auto;
}
.dialog-inner h2 { margin-bottom: .18em; }
.dialog-lede { color: var(--ink-soft); margin-bottom: 22px; }

.child-row {
  display: grid; gap: 12px; grid-template-columns: 54px 1fr;
  background: var(--paper); border-radius: var(--r-md);
  padding: 14px; margin-bottom: 12px; align-items: start;
}
.child-fields { display: grid; gap: 10px; min-width: 0; }
.field label, .field-label {
  display: block; font-size: .76rem; font-weight: 700;
  letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 4px;
}
.field-label { display: block; }
.field input[type="text"] {
  width: 100%; font: inherit; padding: 11px 13px;
  border: 2px solid var(--line); border-radius: var(--r-sm);
  background: var(--cream); color: var(--ink); min-height: 48px;
}
.field input[type="text"]:focus { border-color: var(--leaf-soft); }

.age-pick { display: flex; flex-wrap: wrap; gap: 7px; }
.age-pick button {
  width: 46px; height: 46px; border-radius: 50%;
  border: 2px solid var(--line); background: var(--cream);
  font: inherit; font-weight: 700; color: var(--forest); cursor: pointer;
}
.age-pick button[aria-pressed="true"] {
  background: var(--sun); border-color: var(--sun-deep);
}
.child-remove {
  background: transparent; border: 0; cursor: pointer;
  color: var(--ink-soft); font: inherit; font-weight: 700;
  padding: 6px 10px; border-radius: var(--r-sm); min-height: 44px;
}
.child-remove:hover { background: var(--blossom-soft); color: #B03050; }

.dialog-actions {
  display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; margin-top: 20px;
}
.privacy-line {
  font-size: .86rem; color: var(--ink-soft);
  margin: 16px 0 0; display: flex; gap: 8px; align-items: flex-start;
}
.form-error {
  background: var(--blossom-soft); border-left: 4px solid var(--blossom);
  border-radius: var(--r-sm); padding: 11px 14px;
  margin-bottom: 14px; font-size: .93rem; font-weight: 600;
}

.toast {
  position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%);
  background: var(--forest); color: #fff;
  padding: 13px 22px; border-radius: 999px;
  box-shadow: var(--shadow-lg); font-weight: 700; font-size: .93rem;
  z-index: 120; max-width: calc(100% - 32px); text-align: center;
}

/* ==========================================================================
   Illustration animations
   ========================================================================== */
.rk-ill { width: 100%; height: auto; }
.rk-hero-svg { width: 100%; height: auto; }

/* Animated SVG shapes must resolve transform-origin against their own
   bounding box. Without this, Safari resolves it against the whole SVG
   viewport and shapes rotate or scale about the wrong point. */
.rk-ill [class*="ill-"],
.rk-hero-svg [class*="ill-"],
.rk-logo [class*="rk-"] { transform-box: fill-box; }

@keyframes rk-glow   { 0%,100% { opacity: .75; transform: scale(1); } 50% { opacity: 1; transform: scale(1.05); } }
@keyframes rk-sway   { 0%,100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes rk-bob    { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes rk-sink   { 0% { transform: translateY(-14px); opacity: .55; } 70%,100% { transform: translateY(24px); opacity: 1; } }
@keyframes rk-water  { 0%,100% { transform: translateX(0); } 50% { transform: translateX(-7px); } }
@keyframes rk-wave   { 0%,100% { opacity: .2; } 45% { opacity: 1; } }
@keyframes rk-brush  { 0%,100% { transform: translate(0,0) rotate(0); } 50% { transform: translate(0,10px) rotate(-9deg); } }
@keyframes rk-mix    { 0% { opacity: 0; transform: scale(.4); } 55% { opacity: 1; transform: scale(1.06); } 100% { opacity: 1; transform: scale(1); } }
@keyframes rk-pop    { 0% { opacity: 0; transform: translateY(9px) scale(.85); } 100% { opacity: 1; transform: none; } }
@keyframes rk-drop   { 0% { transform: translateY(-10px); opacity: .3; } 60%,100% { transform: translateY(0); opacity: 1; } }
@keyframes rk-wobble { 0%,100% { transform: rotate(-1.4deg); } 50% { transform: rotate(1.4deg); } }
@keyframes rk-twinkle{ 0%,100% { opacity: .35; transform: scale(.82); } 50% { opacity: 1; transform: scale(1); } }
@keyframes rk-flap-l { 0%,100% { transform: scaleX(1); } 50% { transform: scaleX(.55); } }
@keyframes rk-flap-r { 0%,100% { transform: scaleX(1); } 50% { transform: scaleX(.55); } }
@keyframes rk-scan   { 0%,100% { transform: translate(0,0); } 50% { transform: translate(16px,7px); } }
@keyframes rk-clap-l { 0%,100% { transform: translateX(0); } 50% { transform: translateX(14px); } }
@keyframes rk-clap-r { 0%,100% { transform: translateX(0); } 50% { transform: translateX(-14px); } }
@keyframes rk-rain   { 0% { transform: translateY(-6px); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(14px); opacity: 0; } }
@keyframes rk-dash   { to { stroke-dashoffset: -38; } }
@keyframes rk-trace  { 0% { stroke-dashoffset: 300; } 60%,100% { stroke-dashoffset: 0; } }
@keyframes rk-lift   { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes rk-blinkA { 0%,46% { opacity: 1; } 50%,100% { opacity: .25; } }
@keyframes rk-blinkB { 0%,46% { opacity: .25; } 50%,100% { opacity: 1; } }
@keyframes rk-conf   { 0%,100% { transform: translateY(0) rotate(0); opacity: .8; } 50% { transform: translateY(-8px) rotate(11deg); opacity: 1; } }
@keyframes rk-beat   { 0%,100% { transform: scale(1); } 50% { transform: scale(1.11); } }
@keyframes rk-bookop { 0%,100% { transform: rotate(-1deg); } 50% { transform: rotate(1deg); } }
@keyframes rk-rise   { 0% { transform: translateY(6px); opacity: 0; } 100% { transform: none; opacity: 1; } }

.ill-sun       { animation: rk-glow 7s ease-in-out infinite; transform-origin: center; }
.ill-sway      { animation: rk-sway 4.4s ease-in-out infinite; transform-origin: center bottom; }
.ill-sway-slow { animation: rk-sway 8s ease-in-out infinite; transform-origin: center; }
.ill-bob       { animation: rk-bob 3.1s ease-in-out infinite; }
.ill-sink      { animation: rk-sink 4.6s ease-in-out infinite; }
.ill-water     { animation: rk-water 5.2s ease-in-out infinite; }
.ill-wave      { animation: rk-wave 2.4s ease-in-out infinite; }
.ill-wave.w2   { animation-delay: .28s; }
.ill-wave.w3   { animation-delay: .56s; }
.ill-brush     { animation: rk-brush 4s ease-in-out infinite; transform-origin: center top; }
.ill-mix       { animation: rk-mix 4s ease-in-out infinite; transform-origin: center; }
.ill-pop       { animation: rk-pop .7s ease-out both; }
.ill-drop      { animation: rk-drop 3.4s ease-in-out infinite; }
.ill-wobble    { animation: rk-wobble 3.6s ease-in-out infinite; transform-origin: center bottom; }
.ill-twinkle   { animation: rk-twinkle 3s ease-in-out infinite; transform-origin: center; }
.ill-flutter .wing-l { animation: rk-flap-l .5s ease-in-out infinite; transform-origin: right center; }
.ill-flutter .wing-r { animation: rk-flap-r .5s ease-in-out infinite; transform-origin: left center; }
.ill-scan      { animation: rk-scan 5.5s ease-in-out infinite; }
.ill-clap-l    { animation: rk-clap-l 1.5s ease-in-out infinite; }
.ill-clap-r    { animation: rk-clap-r 1.5s ease-in-out infinite; }
.ill-rain rect { animation: rk-rain 1.9s linear infinite; }
.ill-rain rect:nth-child(2) { animation-delay: .5s; }
.ill-rain rect:nth-child(3) { animation-delay: 1s; }
.ill-dash      { animation: rk-dash 2.4s linear infinite; }
.ill-trace     { stroke-dasharray: 300; animation: rk-trace 5s ease-in-out infinite; }
.ill-crayon    { animation: rk-bob 3.4s ease-in-out infinite; }
.ill-lift      { animation: rk-lift 3.2s ease-in-out infinite; }
.ill-blink-a   { animation: rk-blinkA 3.4s steps(1) infinite; }
.ill-blink-b   { animation: rk-blinkB 3.4s steps(1) infinite; }
.ill-confetti  { animation: rk-conf 3.4s ease-in-out infinite; transform-origin: center; }
.ill-confetti.c2 { animation-delay: .5s; }
.ill-confetti.c3 { animation-delay: 1s; }
.ill-heart-beat{ animation: rk-beat 3s ease-in-out infinite; transform-origin: center; }
.ill-book-open { animation: rk-bookop 6s ease-in-out infinite; transform-origin: center; }
.ill-rise      { animation: rk-rise .8s ease-out both; }
.d1 { animation-delay: .1s; }
.d2 { animation-delay: .35s; }
.d3 { animation-delay: .6s; }

/* Logo animation — subtle signs of life only. */
.rk-logo .rk-sprout  { animation: rk-sway 6s ease-in-out infinite; transform-origin: center bottom; }
.rk-logo .rk-heart   { animation: rk-beat 4.2s ease-in-out infinite; transform-origin: center; }
.rk-logo .rk-star-a  { animation: rk-twinkle 5s ease-in-out infinite; transform-origin: center; }
.rk-logo .rk-star-b  { animation: rk-twinkle 5s ease-in-out infinite 1.4s; transform-origin: center; }
.rk-logo .rk-book    { animation: rk-bookop 8s ease-in-out infinite; transform-origin: center; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (min-width: 620px) {
  .pillars { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .family-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .ready-facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .app-main { padding: 30px 28px 72px; }
  .age-row { grid-template-columns: 92px 1fr; }
}

@media (min-width: 900px) {
  .hero { padding: 60px 0 30px; }
  .hero-grid { grid-template-columns: 1.02fr .98fr; gap: 44px; }
  .pillars { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .section { padding: 72px 0; }
  .detail-grid { grid-template-columns: 1.25fr .75fr; align-items: start; }
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  .app-layout { grid-template-columns: 246px 1fr; }
  .app-side {
    padding: 22px 16px; position: sticky; top: 0;
    height: 100vh; display: flex; flex-direction: column;
  }
  .side-brand { margin-bottom: 26px; }
  .side-nav { flex-direction: column; overflow: visible; gap: 3px; }
  .side-nav button { width: 100%; }
  .side-foot {
    display: block; margin-top: auto; padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, .16);
    font-size: .8rem; opacity: .78; line-height: 1.5;
  }
  .app-main { padding: 34px 40px 80px; }
}

/* Mobile navigation for the marketing pages */
@media (max-width: 899px) {
  .nav-toggle {
    display: inline-flex; align-items: center; gap: 8px;
    background: var(--paper); border: 0; border-radius: 999px;
    box-shadow: inset 0 0 0 2px var(--line);
    font: inherit; font-weight: 700; color: var(--forest);
    padding: 10px 18px; min-height: 46px; cursor: pointer;
  }
  .site-nav {
    display: none; position: absolute; left: 0; right: 0; top: 100%;
    flex-direction: column; align-items: stretch; gap: 2px;
    background: var(--cream); border-bottom: 1px solid var(--line);
    padding: 12px 20px 18px;
    box-shadow: var(--shadow-md);
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 13px 14px; min-height: 48px; display: flex; align-items: center; }
  .site-nav .btn { margin-top: 8px; }
  .header-inner { position: relative; }
}

/* Below this the strapline and the menu button compete for the same row. */
@media (max-width: 560px) {
  .brand-tag { display: none; }
  .header-inner { gap: 10px; }
}

@media (max-width: 419px) {
  body { font-size: 16px; }
  .app-main { padding: 18px 14px 56px; }
  .panel, .materials-panel, .dialog-inner { padding: 18px 16px; }
  .day-tab { width: 118px; }
  .btn { padding: 12px 20px; font-size: .95rem; }
  .ready-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ==========================================================================
   Reduced motion — stop everything decorative
   ========================================================================== */
/* The device setting wins by default. A visitor can override it for this
   browser from Settings, which adds .force-motion to <body>. */
@media (prefers-reduced-motion: reduce) {
  body:not(.force-motion) *,
  body:not(.force-motion) *::before,
  body:not(.force-motion) *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  body:not(.force-motion) .ill-pop, body:not(.force-motion) .ill-drop,
  body:not(.force-motion) .ill-rise, body:not(.force-motion) .ill-mix,
  body:not(.force-motion) .ill-confetti, body:not(.force-motion) .ill-twinkle,
  body:not(.force-motion) .ill-sink, body:not(.force-motion) .ill-trace {
    opacity: 1 !important; transform: none !important;
  }
}

/* A visitor can also switch motion off even when the device allows it. */
body.force-still *, body.force-still *::before, body.force-still *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
}
body.force-still .ill-pop, body.force-still .ill-drop, body.force-still .ill-rise,
body.force-still .ill-mix, body.force-still .ill-confetti, body.force-still .ill-twinkle,
body.force-still .ill-sink, body.force-still .ill-trace {
  opacity: 1 !important; transform: none !important;
}

.motion-state {
  background: var(--stage); border-radius: var(--r-md);
  padding: 12px 15px; margin-bottom: 14px; font-size: .92rem;
}
.motion-state b { color: var(--forest); }

@media print {
  .site-header, .app-side, .btn { display: none !important; }
}
