/* Family and kids mode (js/family.js). Built from the design tokens; logical properties for RTL. */
.family-page { display: grid; gap: var(--sp-4); }
.family-page h1, .family-page h2, .family-page h3 { margin: 0; }
.fam-msg { min-height: 1.4em; margin: 0; color: var(--ok); font-weight: 600; }
.fam-card { margin-block-start: var(--sp-4); }
.fam-controls { display: flex; flex-wrap: wrap; gap: var(--sp-2) var(--sp-3); align-items: center; margin-block: var(--sp-2); }
.fam-controls input, .fam-controls select, .fam-pin input, .kids-pin-row input {
  min-height: 40px; padding-inline: var(--sp-3); border: 1px solid var(--hairline-strong); border-radius: var(--r-xs);
  background: var(--surface); color: var(--ink); font: inherit;
  /* a field's own width comes from the font (Rubik's average letter is wide: 456 px for 20 letters), which made the
     whole family page wider than a phone; a set width that grows, shrinks and wraps keeps it on screen */
  inline-size: 10em; max-inline-size: 100%; flex: 1 1 10em; min-inline-size: 0;
}
.fam-controls select { inline-size: auto; flex: 0 1 auto; } /* a list is as wide as its longest choice, so none is cut */
.fam-pin { display: flex; flex-wrap: wrap; gap: var(--sp-2); align-items: center; }
.fam-kpis { grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); }
.fam-child { display: grid; gap: var(--sp-2); }
.fam-bars { display: flex; gap: var(--sp-2); align-items: flex-end; height: 96px; padding-block-end: 18px; position: relative; }
.fam-bar { flex: 1; display: grid; justify-items: center; align-items: end; height: 100%; position: relative; }
.fam-bar i { display: block; width: 70%; min-height: 3px; background: var(--grad, var(--accent)); border-radius: var(--r-xs) var(--r-xs) 0 0; }
.fam-bar b { font-size: var(--fs-xs); color: var(--ink-2); position: absolute; inset-block-end: 100%; }
.fam-bar small { position: absolute; inset-block-end: -18px; font-size: var(--fs-xs); color: var(--muted); }
.fam-code { font-size: var(--fs-h2); letter-spacing: .12em; font-weight: 700; direction: ltr; margin: 0; }
/* The time-is-up screen covers the page; only the parent's code gets the learner past it. */
.kids-timeup { position: fixed; inset: 0; z-index: 9999; display: grid; place-items: center; padding: var(--sp-4); background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(6px); }
.kids-timeup-box { max-width: 420px; text-align: center; background: var(--surface); border: 1px solid var(--hairline); border-radius: var(--r-lg); box-shadow: var(--e4); padding: var(--sp-6); display: grid; gap: var(--sp-3); }
.kids-pin-row { display: flex; gap: var(--sp-2); justify-content: center; }
.kids-err { color: var(--bad); min-height: 1.2em; margin: 0; }
/* The box fits a 360 px phone: the grid above would otherwise size it to its longest line. */
.kids-timeup { grid-template-columns: minmax(0, 420px); justify-content: center; }
.kids-timeup-box { width: 100%; box-sizing: border-box; grid-template-columns: minmax(0, 1fr); }
.kids-pin-row input { flex: 1 1 auto; min-width: 0; }
/* Kids mode: nothing that reaches strangers. The server refuses these routes too; this only hides the doors. */
html.kids:not(.kids-videos) [data-nav="videos"], html.kids a[target="_blank"], html.kids:not(.kids-videos) .vframe, html.kids [data-nav="friends"], html.kids [data-nav="league"], html.kids [data-nav="chat"], html.kids [data-nav="duel"],
html.kids .friend-code, html.kids .photo-upload, html.kids [data-act="photo"], html.kids label:has(#photo-input) { display: none !important; }
.fam-trust { margin: 0; padding: var(--sp-2) var(--sp-3); background: var(--ok-soft); color: var(--ok); border-radius: var(--r-xs); font-weight: 600; }
.fam-vid { margin-block: var(--sp-1); }
/* the older video page (quiz videos, Russian course) is not curated for children: only the kids library below it stays */
html.kids .videos > :not(.vid-hero):not(.vlib) { display: none !important; }
.fam-age-chips { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); margin-block: var(--sp-3); }
.fam-age-chips .chip { min-height: 56px; font-size: var(--fs-lg); }
/* Until the age is known, friends and chat stay closed (lessons are open). */
html.age-unknown [data-nav="friends"], html.age-unknown [data-nav="chat"], html.age-unknown [data-nav="duel"], html.age-unknown [data-nav="league"] { display: none !important; }
/* The Spanish regions guide has slang and adult notes: closed for children and until the age is known. */
html.kids [data-nav="esregions"], html.age-unknown [data-nav="esregions"] { display: none !important; }
/* The speed-reading pacer shows words per minute, which is time pressure: closed for children and until the age is known (js/pacer.js also hides its card and bounces the page). */
html.kids [data-nav="pacer"], html.age-unknown [data-nav="pacer"] { display: none !important; }
html.kids [data-nav="escompare"], html.age-unknown [data-nav="escompare"] { display: none !important; } /* same-scene comparison (es-compare.js): slang and food talk; the view also checks PolyFamily.kids() */
html.kids [data-nav="esexamchoice"], html.age-unknown [data-nav="esexamchoice"], html.kids [data-nav="esexamroutes"], html.age-unknown [data-nav="esexamroutes"] { display: none !important; } /* exam chooser and nationality route (es-exam-choice.js): adults only; the views check PolyFamily.kids() too */
html.kids [data-nav="month"], html.age-unknown [data-nav="month"] { display: none !important; } /* the monthly report is for adults (js/month-report.js) */
html.kids [data-nav="methods"], html.age-unknown [data-nav="methods"], html.kids [data-nav="study-day"], html.age-unknown [data-nav="study-day"] { display: none !important; }
html.kids [data-nav="reset"], html.age-unknown [data-nav="reset"], html.kids [data-nav="sleep"], html.age-unknown [data-nav="sleep"] { display: none !important; } /* breathing and before-sleep tips: adults (js/loop-tools.js; the views also check kids mode) */ /* the methods page and the study day carry sleep and breathing tips and timers: adults (js/learning-methods.js); #progress stays, in a short version */
html.kids [data-nav="srcmatrix"], html.age-unknown [data-nav="srcmatrix"] { display: none !important; } /* the source matrix is adult academic reading (js/source-matrix.js) */
/* Kids mode and unknown age: no prices, upgrade buttons, gift code or payment text (the page #plans bounces with a line of explanation). */
html.kids [data-nav="plans"], html.kids #subscription, html.kids .start-note, html.kids .redeem,
html.age-unknown [data-nav="plans"], html.age-unknown #subscription, html.age-unknown .start-note, html.age-unknown .redeem { display: none !important; }
/* "Books for adults" for under 16 and unknown age (the lists are filtered too). */
html.kids [data-st-kind="adult"], html.kids .bk-adult, html.age-unknown [data-st-kind="adult"], html.age-unknown .bk-adult { display: none !important; }

/* Written alternatives to sound and speech are easy to find for children: bigger, not a small link (W05-T056). */
html.kids .cant-listen, html.kids .sp-prefs .btn { min-height: 44px; padding: 8px 14px; font-size: 1rem; text-decoration: none; border: 1px solid var(--line, currentColor); border-radius: 999px; }

/* Contract for new features (W04-T048): mark the element and it is closed for children without touching this file again.
   Characters and exam cards are not for kids mode; anything that needs a voice is closed for kids and unknown ages unless a parent opened it (13-15). */
html.kids [data-character], html.kids [data-exam-card], html.kids [data-nav="exams"], html.no-voice [data-needs-voice] { display: none !important; }
html.age-unknown [data-exam-card], html.age-unknown [data-nav="exams"] { display: none !important; } /* exams wait until the age is known (js/exam-world.js says so on the pages) */
/* every link into exam practice (#prep, #xp, the exam goal), wherever a page puts it: closed for kids and until the age is known */
html.kids [data-nav="prep"], html.kids [data-nav^="prep-"], html.kids [data-nav="xp"], html.kids [data-nav^="xp-"], html.kids [data-nav="goal-exams"],
html.age-unknown [data-nav="prep"], html.age-unknown [data-nav^="prep-"], html.age-unknown [data-nav="xp"], html.age-unknown [data-nav^="xp-"], html.age-unknown [data-nav="goal-exams"] { display: none !important; }

/* Kids never see the upgrade: no Plus badges, no "open in the Plus plan" note, and the microphone pages are closed until a parent opens them (QA round 6, 61 and 64). */
html.kids .pill.plus, html.kids .pill.pro, html.kids .bk-lock-note, html.age-unknown .pill.plus, html.age-unknown .pill.pro, html.age-unknown .bk-lock-note { display: none !important; }
html.kids.no-voice [data-nav="speak"], html.kids.no-voice [data-nav="g-voice"], html.kids.no-voice [data-nav="voicebot"], html.kids.no-voice [data-ax-game="voice"] { display: none !important; }
html.age-unknown [data-nav="voicebot"], html.age-unknown [data-nav="speak"], html.age-unknown [data-nav="g-voice"], html.age-unknown [data-ax-game="voice"] { display: none !important; } /* unknown age counts as under 13 for voice; js/family.js sends the pages to #family */
html.kids [data-nav="paircards"], html.age-unknown [data-nav="paircards"] { display: none !important; } /* the pair cards are a printable adult/teen kit (js/pair-cards.js) */
html.kids [data-nav="interview"], html.age-unknown [data-nav="interview"] { display: none !important; } /* interview practice (js/interview.js) is an adult/teen tool */
/* the exam countdown (js/exam-countdown.js) is not for children: its own page also says so */
html.kids [data-nav="countdown"], html.age-unknown [data-nav="countdown"] { display: none !important; }
/* exam preparation (js/exam-prep-es.js): the hub, each exam and its run; the pages also say so when opened by link */
html.kids [data-nav="eprep"], html.kids [data-nav="eprep-"], html.kids [data-nav^="eprep-"],
html.age-unknown [data-nav="eprep"], html.age-unknown [data-nav^="eprep-"] { display: none !important; }

/* Kids see no subscription wording anywhere (i18n audit, wave 4): the footer "my subscription and payments" link, the home FAQ's payment questions
   (is-pay: free/cancel), and every other jump to the subscription panel. */
html.kids a[data-scroll="subscription"], html.kids .bx-faq details.is-pay, html.kids [data-nav="me"][data-scroll="subscription"],
html.age-unknown a[data-scroll="subscription"], html.age-unknown .bx-faq details.is-pay, html.age-unknown [data-nav="me"][data-scroll="subscription"] { display: none !important; }
/* The coach page's locked personal-practice panel names the paid plan in its hint and button; kids and unknown age see no plan text at all. */
html.kids .panel.personal.locked, html.age-unknown .panel.personal.locked { display: none !important; }
/* A focused menu for children (leo 2026-10-20; dialogues are closed too because they record the voice): Route, Review, Games, Polly, the Starling Club and the Library stay; analysis, plans, goals, topics, the English tools and Writing are for older learners. */
:is(html.kids, html.age-unknown) :is([data-nav="coach"], [data-nav="plan"], [data-nav="paths"], [data-nav="categories"], [data-nav="english"], [data-nav="write"], [data-nav="talk"]) { display: none !important; }
/* Kids: no side "Voice" tab over the picture (voice is off for children) and no purchase footer links (design room audit, rows 11 and 12). */
:is(html.kids, html.age-unknown) :is(.pv-tab, .foot-links [data-nav="withdraw"], .foot-links [data-nav="refund"]) { display: none !important; }
/* Kids version is English-only for now (leo 2026-10-20): a child, or a visitor of unknown age, gets no course picker for Spanish, French or Chinese. */
html.kids .course-pick, html.age-unknown .course-pick { display: none !important; }

/* "Kids version" button in the side menu (js/family.js kidsButton) */
.fam-kids-btn { display: flex; align-items: center; gap: 10px; width: 100%; margin: var(--sp-2) 0; justify-content: flex-start; padding: .55em 1em; border: 1px solid var(--hairline); border-radius: 999px; background: var(--surface-2); color: var(--ink); font: inherit; font-size: .95rem; cursor: pointer; }
.fam-kids-btn::before { content: "🧒"; }
.fam-kids-btn:hover, .fam-kids-btn:focus-visible { border-color: var(--accent); }
html.in-lesson .fam-kids-btn { display: none; }
