/* Family dashboard, the child's sign-in screen, and the privacy notices.
 *
 * Monochrome, like the rest of the app: hairlines are color-mix of --fg, and the
 * only colour is the one that carries meaning (a profile is active or it is
 * waiting). No new colour is introduced anywhere in this file.
 *
 * Why the child screen is styled separately
 * -----------------------------------------
 * A six-year-old's sign-in page is the only page in this product built for a
 * small hand: 64px keys, a fixed 3x4 grid, no scrolling, no text input. That is
 * not decoration — it is the difference between a child who can start unaided and
 * one who needs a parent to type for them, which is the whole point of the
 * shared-device model.
 */

/* ------------------------------------------------------------------ notices */

.note {
  margin: var(--space-5) 0 0;
  padding: var(--space-4);
  border: 1px solid var(--faint);
  border-color: color-mix(in srgb, var(--fg) 18%, transparent);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--fg) 4%, transparent);
  font-size: var(--step--1);
  line-height: 1.5;
}

.note-warn {
  border-color: color-mix(in srgb, var(--fg) 46%, transparent);
  background: transparent;
}

.plain-list {
  margin: var(--space-4) 0 0;
  padding-left: 1.25em;
  line-height: 1.55;
}

/* The hub's list of notices: one row per notice, each with its title and a sentence
   saying what the page is for. A visitor arriving from the footer does not know which
   of eight notices they want, so each row says. */
.notice-list {
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: var(--space-4);
}

.notice-list li {
  border-top: 1px solid var(--hair);
  padding-top: var(--space-4);
}

.notice-list li:first-child { border-top: 0; padding-top: 0; }
.notice-list .chip { margin-left: var(--space-2); }

.plain-list li + li { margin-top: var(--space-2); }

/* A LINKED TEEN'S SHARED PROGRESS, on the parent's dashboard.
 *
 * Four facts and nothing else, in a two-column definition list that becomes one
 * column on a phone. Monochrome and unornamented like everything else: this is a
 * parent checking that a teenager is working, so the figures should be the only
 * thing that reads.
 *
 * It is deliberately NOT a table: a table at this width forces a horizontal
 * scroll on a phone, and the `dl`/`div`/`dt`+`dd` shape is the one the notices
 * already use for "label: value" pairs (see `.notice-terms` in this file). */
.teen-progress { margin-top: var(--space-3); }
.teen-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2) var(--space-4);
  margin: 0;
}
@media (min-width: 34rem) {
  .teen-facts { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.teen-facts > div { min-width: 0; }
.teen-facts dt {
  font-size: var(--step--1);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: color-mix(in srgb, var(--fg) 62%, transparent);
}
.teen-facts dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-size: var(--step-1);
}

/* The notices themselves, and the acceptance screen.
 *
 * `.notice-terms` is the definition list a notice uses for "what / why" pairs — it
 * is the shape most of the text is in, because a notice answering "what do you
 * collect and why" is a list of pairs and a table would make a long sentence wrap
 * out of its own column on a phone. The `div` wrapper is what lets a `dt`/`dd` pair
 * be one grid row: a `<dl>` cannot be a grid on its own without breaking the pairs.
 *
 * `.legal-check` is the acceptance checkbox. It is deliberately NOT a small box in a
 * corner: the label is the sentence the person is agreeing to, set at body size with
 * the two document links inside it, because a control whose label is a footnote is a
 * control nobody reads. */
.notice-terms {
  margin: var(--space-4) 0 0;
  display: grid;
  gap: var(--space-4);
}

.notice-terms dt {
  font-weight: 600;
  margin: 0 0 var(--space-1);
}

.notice-terms dd {
  margin: 0;
  line-height: 1.55;
}

.legal-docs {
  margin-top: var(--space-4);
}

.legal-docs li + li { margin-top: var(--space-3); }

.legal-docs .hint {
  display: block;
  margin-top: var(--space-1);
}

.legal-check {
  display: block;
  margin: var(--space-5) 0 0;
  line-height: 1.6;
  padding: var(--space-4);
  border: 1px solid color-mix(in srgb, var(--fg) 24%, transparent);
  border-radius: var(--radius);
}

.legal-check input[type="checkbox"] {
  /* 24px rather than the 13px a browser draws: a 44px tap target is the floor, and
     the box is the smallest part of the label. */
  width: 1.5rem;
  height: 1.5rem;
  margin-right: var(--space-2);
  vertical-align: -0.35em;
}

/* A disabled primary button must LOOK disabled, or the clickwrap's "you cannot press
   this until you tick the box" is a rule the eye cannot see. */
.legal-check + .form-error + .actions .btn[disabled],
.btn.primary[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
}

.h2-small {
  font-size: var(--step-0);
  margin: 0 0 var(--space-3);
}

.break { word-break: break-all; }

/* ------------------------------------------------------------------ family */

.family-list {
  list-style: none;
  margin: var(--space-4) 0 0;
  padding: 0;
}

.family-child {
  border-top: 1px solid var(--hair);
  padding: var(--space-4) 0;
}

.family-child:first-child { border-top: 0; }

.family-child-head {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.family-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  border: 1px solid var(--faint);
  border-color: color-mix(in srgb, var(--fg) 22%, transparent);
  border-radius: 50%;
  font-size: 1.1rem;
}

.family-name {
  margin: 0;
  font-weight: 600;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.family-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: var(--space-3);
}

.family-actions .btn { font-size: var(--step--1); }

.family-child-detail {
  margin-top: var(--space-3);
}

.family-detail {
  padding: var(--space-3);
  border: 1px dashed color-mix(in srgb, var(--fg) 24%, transparent);
  border-radius: var(--radius);
}

/* THE PARENT'S GAP SUMMARY (DX4). A short ordered plan inside the child's detail panel:
   the order is the teaching order, so it is numbered; the holes are marked in words rather
   than with a chip, because a chip here would read as a badge on the child. */
.family-plan {
  margin: var(--space-2) 0 var(--space-3);
  padding-left: var(--space-5);
  line-height: 1.55;
}

.family-plan li {
  margin-bottom: var(--space-1);
}

.family-tiles {
  display: flex;
  gap: var(--space-2);
  margin: var(--space-3) 0;
}

.family-tile {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid color-mix(in srgb, var(--fg) 30%, transparent);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: var(--step-1);
}

.pill {
  display: inline-block;
  padding: 0.1em 0.5em;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--fg) 26%, transparent);
  font-size: var(--step--2);
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}

.pill.is-ok { border-color: var(--fg); }

.pill.is-waiting {
  border-style: dashed;
  color: var(--muted);
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: flex-end;
}

.inline-form label { font-size: var(--step--1); color: var(--muted); }
.inline-form input { max-width: 12rem; }

.inline-form fieldset,
.report-kinds {
  border: 0;
  margin: 0 0 var(--space-3);
  padding: 0;
  display: grid;
  gap: var(--space-2);
  width: 100%;
}

.inline-form legend { font-size: var(--step--1); color: var(--muted); margin-bottom: var(--space-2); }

.check {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  min-height: var(--tap);
  font-size: var(--step--1);
  line-height: 1.45;
  cursor: pointer;
}

.check input { margin-top: 0.35em; flex: none; }

/* ------------------------------------------------------------ the child door */

.kid-page {
  max-width: 24rem;
  margin: 0 auto;
  padding-top: var(--space-6);
}

.kid-code {
  width: 100%;
  font-family: var(--font-mono);
  font-size: var(--step-2);
  letter-spacing: 0.24em;
  text-align: center;
  min-height: calc(var(--tap) + var(--space-3));
  padding: var(--space-2);
  border: 1px solid color-mix(in srgb, var(--fg) 26%, transparent);
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg);
  /* A readonly input still shows a caret on some browsers; this page is tapped,
     not typed, and a blinking cursor in a code box invites a child to poke at it. */
  caret-color: transparent;
}

.kid-pad {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
  margin: var(--space-4) 0 0;
}

.kid-key {
  min-height: 64px;
  font-family: var(--font-mono);
  font-size: var(--step-2);
  border: 1px solid color-mix(in srgb, var(--fg) 22%, transparent);
  border-radius: var(--radius);
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.kid-key:active {
  background: color-mix(in srgb, var(--fg) 12%, transparent);
}

.kid-key:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 2px;
}

.kid-key--action {
  font-family: var(--font-text);
  font-size: var(--step-0);
  color: var(--muted);
}

/* ------------------------------------------------------- beta access request */

.beta-family { margin: var(--space-4) 0; }
.beta-family summary { cursor: pointer; color: var(--muted); }
.beta-family .check { display: flex; gap: var(--space-2); align-items: flex-start; margin-top: var(--space-3); }
.beta-follow { margin: var(--space-5) 0; }
.beta-follow .follow-list { margin-top: var(--space-2); }
.signin-other { margin-top: var(--space-3); }
.start-rule { border: 0; border-top: 1px solid var(--hair); margin: var(--space-6) 0 var(--space-5); }
.beta-page h2 { font-size: var(--step-2); line-height: 1.2; margin: 0 0 var(--space-3); }

/* Sign in | Request access: one panel at a time, and the switch picks it. Each
   link is a full 44px tap target (the floor every control in this app meets) and
   the current one is both coloured and marked, so the state is not carried by
   colour alone. */
.start-switch {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  margin: 0 0 var(--space-5);
  border-radius: 10px;
  background: color-mix(in srgb, var(--fg) 7%, transparent);
  font-family: var(--font-ui);
}
.start-switch a {
  display: inline-flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0 var(--space-4);
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}
.start-switch a:hover { color: var(--fg); }
.start-switch a[aria-current="page"] {
  color: var(--fg);
  background: var(--surface);
  box-shadow: 0 1px 2px color-mix(in srgb, var(--fg) 18%, transparent);
  font-weight: 600;
}

/* ------------------------------------------------------------------- footer */

/* THE COLOPHON, NOT A SECOND NAVIGATION.
 *
 * Three rows of small grey text under a full-width rule is what a 2009 site did;
 * on this product the footer is a colophon — who made it, how to reach them, and
 * the two legal doors — so it is set as one quiet column on the right, at a smaller
 * size than any body text on the page, with the only interactive thing in it (the
 * report control) drawn as text rather than as a button. The founder's X mark keeps
 * its 44px target because it is the one link a thumb aims at. */
.foot {
  margin: var(--space-7) auto var(--space-6);
  padding: var(--space-5) max(var(--space-4), env(safe-area-inset-right))
    calc(var(--space-7) + env(safe-area-inset-bottom)) max(var(--space-4), env(safe-area-inset-left));
  max-width: 72rem;
  border-top: 1px solid var(--hair);
  font-size: var(--step--1);
  color: var(--muted);
  line-height: 1.55;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-5) var(--space-6);
}

/* Right side: the report control, the notices, how to reach us, the copyright.
   One column, so the eye reads them in the order they matter rather than scanning
   three right-aligned rows for the one it wants. */
.foot-legal {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-2);
  text-align: right;
  max-width: 34rem;
}

/* The report control is text with a hairline under it, not a bordered button: at
   the foot of a page, a 44px rectangle is the loudest object on the screen and it
   is the least important. */
.foot-feedback {
  appearance: none;
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: var(--step--1);
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--muted) 45%, transparent);
  text-underline-offset: 0.2em;
  cursor: pointer;
}
.foot-feedback:hover { color: var(--fg); }

.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-1) var(--space-3);
}
.foot-links a { color: var(--muted); text-decoration: none; }
.foot-links a:hover { color: var(--fg); text-decoration: underline; }

@media (max-width: 640px) {
  .foot { gap: var(--space-4); }
  .foot-legal { margin-left: 0; align-items: flex-start; text-align: left; }
  .foot-links { justify-content: flex-start; }
}

.foot p { margin: 0; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--fg); }

/* The contact line and the copyright are the smallest print on the page — they exist
   so a person can find them, not so they read them — and they wrap on a phone
   instead of overflowing. */
.foot-contact {
  font-size: var(--step--2);
  color: var(--faint);
  overflow-wrap: anywhere;
}
.foot-copy {
  font-size: var(--step--2);
  color: var(--faint);
  letter-spacing: 0.02em;
}

/* One link, small, and quiet. It is the legal floor (16 CFR 312.4(d), CCPA), not a
   navigation item: it must be present and clearly labelled on every screen, and it
   must not compete with the page. The notices themselves live behind #/privacy. */
.foot-privacy { font-size: var(--step--1); }
.foot-privacy a { text-decoration-color: color-mix(in srgb, var(--muted) 50%, transparent); }

/* "Follow the build": four monochrome marks that take the text colour, so they
   follow the light and dark themes. The row is absent from a child's session. */
.follow { margin-top: var(--space-3); display: flex; align-items: center; gap: var(--space-3); flex-wrap: wrap; }
.follow-h { margin: 0; }
.follow-list { display: flex; gap: var(--space-1); margin: 0; padding: 0; list-style: none; }
.follow-link {
  display: inline-flex; align-items: center; justify-content: center;
  width: 2.75rem; height: 2.75rem; border-radius: 50%; color: var(--muted);
}
.follow-link:hover { color: var(--fg); }
.follow-link:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
body[data-kid="1"] [data-follow] { display: none; }

/* A child's session hides the report link that opens a free-text box. The
   dialog itself refuses to render one (report.js), and this is the second guard:
   the link is not offered at all. */
body[data-kid="1"] .report-link { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .kid-key { transition: background-color 80ms linear; }
}

/* ---------------------------------------------------------------------------
   THE WEEKLY CARD (VERDICT §1.11a). Four figures and one question, above the
   data-rights section. Monochrome, tabular numerals, and no bar: a bar invites
   "how much is left", which is not a question this card answers.
--------------------------------------------------------------------------- */

.week-card {
  margin-top: 0.75rem;
}

.week-line {
  font-variant-numeric: tabular-nums;
  margin: 0 0 0.875rem;
}

.week-figures {
  display: grid;
  gap: 0.5rem;
  margin: 0 0 0.875rem;
}

.week-figures > div {
  display: grid;
  grid-template-columns: 12rem 1fr;
  gap: 0.75rem;
  align-items: baseline;
}

.week-figures dt {
  font-size: 0.875rem;
  color: var(--muted);
}

.week-figures dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.week-question {
  color: var(--muted);
  font-size: 0.875rem;
  margin: 0.75rem 0 0.2rem;
}

.week-ask {
  border-left: 3px solid var(--line);
  margin: 0;
  padding: 0.1rem 0 0.1rem 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  max-width: 34rem;
}

@media (max-width: 640px) {
  .week-figures > div {
    grid-template-columns: 1fr;
    gap: 0.1rem;
  }
}
