/* ============ Tokens ============ */
/* Nunito (SIL Open Font License), Latin letters, one variable file for every weight. The font list below already named it;
   now it is actually delivered, so the school looks the same on every phone. Amharic keeps Noto Sans Ethiopic / Nyala. */
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 200 1000;
  font-display: swap;
  src: url(/static/fonts/nunito-latin-wght.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;
}
:root {
  color-scheme: light;
  /* The Buqaya palette (2026): coral #FF6F61, blush #F7CAC9, periwinkle #92A8D1, leaf #88B04B, sun #F9C74F.
     The five colours are used as they are, as fills, always with dark text on them. Where a colour has to be text
     on the page, a deeper shade of the same hue is used so it reads at 4.5 : 1 or more.
     Roles: coral = what you press, leaf = the brand and progress, periwinkle = calm panels and focus,
     blush = the footer and soft highlights, sun = coins, stars and notes. */
  --bg: #fffaf7;
  --bg-2: #fdf2ee;
  --bg-3: #f7e8e4;
  --surface: #ffffff;
  --ink: #26242e;
  --muted: #57545f;
  --line: #eadbd6;
  /* Edges of boxes you type in and ghost buttons: strong enough to see (3:1 against the page). */
  --field-line: #8e7f7a;
  /* Leaf: --green-fill is the colour itself; --green and --green-dark are its text shades. */
  --green: #4a6b1f;
  --green-dark: #3b5719;
  --green-soft: #ebf3df;
  --green-fill: #88b04b;
  --green-fill-hover: #7aa03f;
  --on-green: #1b260d;
  /* Coral: every main button. */
  --action: #ff6f61;
  --action-hover: #f45d4f;
  --on-action: #2b1310;
  --coral: #b83a2f;
  --coral-soft: #ffe4e0;
  --pink: #f7cac9;
  --pink-soft: #fdedec;
  --blue: #92a8d1;
  --blue-ink: #3b5687;
  --blue-soft: #e6ecf6;
  --yellow: #f9c74f;
  --yellow-soft: #fdf1d2;
  /* Text sitting on --yellow-soft (or on the page as an amber accent). */
  --yellow-ink: #6e4f00;
  --red: #b32f2f;
  --red-soft: #ffd9dc;
  --business: #9a5200;
  --business-soft: #ffdac1;
  --creative: #b23a4c;
  --creative-soft: #fde0e5;
  --talent: #3b5719;
  --talent-soft: #e3eed3;
  --radius: 20px;
  --radius-sm: 12px;
  --shadow: 0 1px 2px rgba(38, 36, 46, 0.05), 0 8px 28px rgba(38, 36, 46, 0.07);
  --font: 'Nunito', 'Segoe UI Rounded', 'SF Pro Rounded', system-ui, -apple-system, 'Segoe UI', Roboto,
    'Noto Sans Ethiopic', 'Nyala', sans-serif;
  --rail-bg: #3b5719;
  --rail-ink: #f5f0e6;
  --input-bg: #ffffff;
  --card-bg: #f3f6fb;
  --overlay: rgba(38, 36, 46, 0.45);
  --focus: #3b5687;
  /* Coloured bands: the palette colour itself in Day mode, a deep shade of it in Night mode. */
  --band-leaf: #88b04b;
  --on-band-leaf: #17210b;
  --on-band-leaf-soft: #263516;
  --hero-hi: #5e1a12;
  --band-sky: #92a8d1;
  --on-band-sky: #121a2c;
  --band-blush: #f7cac9;
  --on-band-blush: #2a1517;
  --band-blush-head: #7e2a22;
  /* The champions and coins boards stay dark in both modes, so gold medals and coins shine. */
  --board-1: #2e3b5e;
  --board-2: #1f2840;
  --on-board-soft: #dce4f4;
}

/* Day mode is the default. Night mode is the choice kept by the Night mode button in the footer (the page is then marked data-theme="dark"); it is never taken from the phone's setting. */
:root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #14161d;
  --bg-2: #1a1d26;
  --bg-3: #252935;
  --surface: #1d2029;
  --ink: #f3f1f6;
  --muted: #b7b4c2;
  --line: #3a3e4c;
  --field-line: #8a8fa1;
  --green: #a9cd72;
  --green-dark: #bcd98f;
  --green-soft: #253020;
  --green-fill: #88b04b;
  --green-fill-hover: #97be5c;
  --on-green: #17210b;
  --action: #ff6f61;
  --action-hover: #ff8478;
  --on-action: #2b1310;
  --coral: #ff8a7e;
  --coral-soft: #3a2421;
  --pink-soft: #33242a;
  --blue-ink: #b3c3e4;
  --blue-soft: #232a3b;
  --yellow: #f9c74f;
  --yellow-soft: #393019;
  --yellow-ink: #f9c74f;
  --red: #ef6b6b;
  --red-soft: #3a1f1f;
  --business: #e09030;
  --business-soft: #3a2a14;
  --creative: #f08a9b;
  --creative-soft: #3a1f26;
  --talent: #a9cd72;
  --talent-soft: #253020;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 10px 28px rgba(0, 0, 0, 0.4);
  --rail-bg: #0f1116;
  --rail-ink: #e8edf5;
  --input-bg: #161921;
  --card-bg: #1f2330;
  --overlay: rgba(0, 0, 0, 0.55);
  --focus: #b3c3e4;
  --band-leaf: #263419;
  --on-band-leaf: #eef5e2;
  --on-band-leaf-soft: #c5d8a8;
  --hero-hi: #f7cac9;
  --band-sky: #222b3f;
  --on-band-sky: #edf1fa;
  --band-blush: #2d2226;
  --on-band-blush: #f8ebeb;
  --band-blush-head: #f7cac9;
}

/* ============ Base ============ */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main {
  flex: 1;
}
h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.4em;
  letter-spacing: -0.01em;
  font-weight: 600;
}
h1 {
  font-size: clamp(1.7rem, 4vw, 2.3rem);
}
h2 {
  font-size: 1.35rem;
}
h3 {
  font-size: 1.1rem;
}
p {
  margin: 0 0 0.8em;
}
a {
  color: var(--green-dark);
}
img {
  max-width: 100%;
}
:focus-visible {
  outline: 3px solid var(--yellow);
  outline-offset: 2px;
}
[hidden] {
  display: none !important;
}

.container {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 0.9rem;
}
.tiny {
  font-size: 0.8rem;
}
.center {
  text-align: center;
}
.inline {
  display: inline;
  margin: 0;
}
.plain {
  list-style: none;
  padding: 0;
  margin: 0;
}
.plain li {
  margin-bottom: 4px;
}
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--green);
  margin-bottom: 6px;
}
.lead {
  font-size: 1.15rem;
}

/* ============ Top bar ============ */
.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 10px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 900;
  font-size: 1.15rem;
}
.brand-mark {
  font-size: 1.6rem;
}
.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand-text small {
  font-weight: 600;
  font-size: 0.72rem;
  color: var(--muted);
}
.nav {
  display: flex;
  gap: 4px;
  flex: 1;
  overflow-x: auto;
  scrollbar-width: none;
}
.nav a,
.me > a:not(.btn) {
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  padding: 8px 9px;
  border-radius: 999px;
  white-space: nowrap;
}
.nav a:hover,
.me > a:not(.btn):hover {
  background: var(--bg);
}
.nav a.active,
.me > a.active {
  background: var(--green-soft);
  color: var(--green-dark);
}
.me {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}
.me-avatar {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}
.icon-link {
  font-size: 1.2rem;
}
.link-button {
  background: none;
  border: 0;
  padding: 8px 4px;
  font: inherit;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
}
.link-button:hover {
  color: var(--ink);
  text-decoration: underline;
}
.link-button.danger {
  color: var(--red);
  font-size: 0.85rem;
}

@media (max-width: 1100px) {
  .topbar-inner {
    gap: 8px;
  }
  .nav {
    order: 3;
    flex-basis: 100%;
    margin: 0 -16px;
    padding: 0 12px 4px;
  }
}
/* Phones: the nav becomes a six-tab bar with the emoji above each label. */
@media (max-width: 560px) {
  .nav {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 2px;
    padding: 0 8px 6px;
  }
  .nav a {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 6px 2px;
    border-radius: 12px;
    font-size: 0.72rem;
    line-height: 1.15;
    white-space: normal;
    text-align: center;
  }
  .nav-emoji {
    font-size: 1.3rem;
  }
  .me {
    gap: 2px;
  }
  .me .chip:not(.rank-chip),
  .me-name,
  .rank-chip-unit {
    display: none;
  }
  .me > a:not(.btn) {
    padding: 6px 8px;
  }
}

/* ============ Buttons, chips, tags ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--action);
  color: var(--on-action);
  border: 1px solid var(--action);
  border-radius: 12px;
  padding: 10px 18px;
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  box-shadow: none;
}
.btn:hover {
  background: var(--action-hover);
  border-color: var(--action-hover);
  color: var(--on-action);
}
.btn:active {
  transform: none;
  box-shadow: none;
}
.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.btn-big {
  padding: 12px 22px;
  font-size: 1.02rem;
}
.btn-small {
  padding: 6px 14px;
  font-size: 0.9rem;
}
.btn-ghost {
  background: var(--bg-3);
  color: var(--ink);
  border-color: var(--field-line);
  box-shadow: none;
}
.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--ink);
  color: var(--ink);
}
.btn-ghost:disabled,
.btn-ghost[disabled] {
  background: var(--bg-3);
  color: var(--muted);
  opacity: 0.7;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 10px;
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
}
.chip-big {
  font-size: 1.05rem;
  padding: 6px 14px;
  background: var(--yellow-soft);
  border-color: #f3dc8f;
}
.tag {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.82rem;
  font-weight: 800;
}
.tag-current {
  background: var(--yellow-soft);
  color: var(--yellow-ink);
  white-space: nowrap;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

/* ============ Flash ============ */
.flash {
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin-bottom: 18px;
  font-weight: 700;
  border: 1px solid transparent;
}
.flash-success {
  background: var(--green-soft);
  border-color: color-mix(in srgb, var(--green-fill) 45%, var(--line));
  color: var(--green-dark);
}
.flash-info {
  background: var(--yellow-soft);
  border-color: #f3dc8f;
  color: var(--yellow-ink);
}
.flash-error {
  background: var(--red-soft);
  border-color: #f5c2c2;
  color: #a12c2c;
}
.founding-thanks {
  border-top: 6px solid var(--yellow);
  margin-bottom: 22px;
}
.founding-thanks .lead {
  margin: 0.4em 0 0.6em;
}
.founding-thanks-actions {
  margin-top: 14px;
}
.founding-thanks-phone {
  font-weight: 800;
  font-size: 1.15rem;
  margin: 0.6em 0;
}
.founding-thanks-phone a {
  color: var(--green-dark);
  text-decoration: none;
}

/* ============ Layout ============ */
.card {
  background: var(--card-bg);
  border: 1px solid var(--line);
  border-top: 3px solid var(--talent);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: none;
  color: var(--ink);
}
/* Soft color variety on card grids — small top accents only */
.grid > .card:nth-child(3n + 2),
.earn-grid > .card:nth-child(3n + 2),
.badge-grid > .card:nth-child(3n + 2) {
  border-top-color: var(--green);
}
.grid > .card:nth-child(3n + 3),
.earn-grid > .card:nth-child(3n + 3),
.badge-grid > .card:nth-child(3n + 3) {
  border-top-color: var(--yellow);
}
.grid {
  display: grid;
  gap: 18px;
}
.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}
.grid-2-1 {
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
}
@media (max-width: 900px) {
  .grid-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .grid-3,
  .grid-2-1 {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 640px) {
  .grid-2,
  .grid-4 {
    grid-template-columns: minmax(0, 1fr);
  }
}
.section {
  margin: 40px 0;
}
.section-title {
  text-align: center;
  margin-bottom: 18px;
}
.section-title.left {
  text-align: left;
}
.page-head {
  margin-bottom: 22px;
}
.page-back-nav {
  margin: 0 0 18px;
  padding: 0;
}
.page-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px 10px 12px;
  border: 2px solid var(--green);
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  color: var(--ink);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  box-shadow: var(--shadow);
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.12s ease;
}
.page-back:hover {
  background: var(--green-soft);
  border-color: var(--green);
  color: var(--green-dark);
  text-decoration: none;
  transform: translateX(-2px);
}
.page-back:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}
.page-back-arrow {
  font-size: 1.15em;
  line-height: 1;
  font-weight: 800;
}
.crumbs {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 12px;
}
.crumbs a {
  color: var(--muted);
}
.center-block {
  max-width: none;
  margin: 0 auto;
  text-align: center;
}
.empty-state {
  text-align: center;
  color: var(--muted);
}

/* ============ Progress bars ============ */
.bar {
  height: 12px;
  background: var(--bg-3);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, var(--green-fill), var(--yellow));
  border-radius: inherit;
  min-width: 0;
  transition: width 0.4s ease;
}
.bar-xp > span {
  background: linear-gradient(90deg, var(--yellow), #ffcf3f);
}

/* ============ Home ============ */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 32px;
  align-items: center;
  padding: 24px 0 8px;
}
.hl {
  color: var(--green);
  background: linear-gradient(transparent 62%, var(--yellow-soft) 62%);
}
.hero-art {
  display: flex;
  justify-content: center;
}
.orbit {
  position: relative;
  width: 280px;
  height: 280px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--card-bg) 0 38%, var(--green-soft) 39% 62%, var(--yellow-soft) 63% 100%);
  border: 1px solid var(--line);
}
.orbit .center {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 4.5rem;
}
.orbit .o {
  position: absolute;
  font-size: 2.4rem;
  background: var(--card-bg);
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  box-shadow: var(--shadow);
  animation: bob 3s ease-in-out infinite;
}
.o1 {
  top: -8px;
  left: 108px;
}
.orbit .o2 {
  bottom: 18px;
  left: -6px;
  animation-delay: 0.6s;
}
.orbit .o3 {
  bottom: 18px;
  right: -6px;
  animation-delay: 1.2s;
}
@keyframes bob {
  50% {
    transform: translateY(-8px);
  }
}
@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
  }
  .hero-art {
    order: -1;
  }
  .orbit {
    transform: scale(0.75);
    margin: -30px 0;
  }
}

.pillar {
  border-top: 6px solid var(--line);
}
.pillar-emoji {
  font-size: 2.4rem;
}
.pillar-emoji.small {
  font-size: 1.6rem;
}
.pillar-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.pillar-head h3 {
  margin: 0;
}

.staircase {
  list-style: none;
  padding: 0;
  margin: 18px 0 0;
  display: grid;
  gap: 12px;
}
.step-card {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
  margin-left: calc((var(--step) - 1) * 4%);
}
.step-card p {
  margin: 2px 0 0;
}
.step-emoji {
  font-size: 2rem;
}
@media (max-width: 640px) {
  .step-card {
    margin-left: 0;
  }
}
.feature-emoji {
  font-size: 2.2rem;
}
.how-list {
  padding-left: 1.2em;
}
.how-list li {
  margin-bottom: 8px;
}

/* ============ Auth & profiles ============ */
.auth {
  max-width: 480px;
  margin: 12px auto;
  text-align: left;
}
.auth h1,
.auth > .muted {
  text-align: left;
}
.auth .form > .btn {
  justify-self: start;
  align-self: start;
  width: auto;
}
.form {
  display: grid;
  gap: 14px;
  justify-items: stretch;
  text-align: left;
}
.form label {
  display: grid;
  gap: 6px;
  font-weight: 500;
  text-align: left;
}
input:not([type='radio']):not([type='checkbox']),
textarea,
select {
  font: inherit;
  font-weight: 500;
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--field-line);
  border-radius: var(--radius-sm);
  background: var(--input-bg);
  color: var(--ink);
}
input::placeholder,
textarea::placeholder {
  color: #8a8a8a; /* gray, so an example is never mistaken for typed text */
  opacity: 1;
}
input:focus,
textarea:focus,
select:focus {
  border-color: var(--green);
  outline: none;
}
textarea {
  resize: vertical;
}
.avatar-picker {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.avatar-picker legend {
  font-weight: 700;
  margin-bottom: 6px;
}
.avatar-option input {
  position: absolute;
  opacity: 0;
}
.avatar-option span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  font-size: 1.8rem;
  border: 2px solid var(--line);
  border-radius: 14px;
  cursor: pointer;
  background: var(--card-bg);
}
.avatar-option input:checked + span {
  border-color: var(--green);
  background: var(--green-soft);
}
.avatar-option input:focus-visible + span {
  outline: 3px solid var(--yellow);
}
.stage-guide ul {
  padding-left: 1.2em;
  font-weight: 500;
}
.stage-guide summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--green-dark);
}
.profile-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 16px;
  margin: 24px 0;
}
.profile-grid form {
  margin: 0;
}
.profile-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.profile-edit {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
}
.family-switch {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: stretch;
}
.family-switch form {
  margin: 0;
}
.profile-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  width: 150px;
  padding: 18px 10px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-top: 3px solid var(--talent);
  border-radius: var(--radius);
  font: inherit;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.12s ease;
}
.profile-tile:hover {
  transform: translateY(-3px);
  border-color: var(--green);
}
.profile-tile.is-active {
  border-color: var(--green);
}
.profile-avatar {
  font-size: 3rem;
}
.profile-name {
  font-weight: 800;
}
.profile-add {
  border-style: dashed;
}

/* ============ Dashboard ============ */
.welcome {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 22px;
}
.welcome-hello {
  display: flex;
  gap: 16px;
  align-items: center;
  flex: 1;
  min-width: 260px;
}
.welcome-hello > div {
  flex: 1;
  max-width: 420px;
}
.welcome h1 {
  margin: 0;
}
.welcome p {
  margin: 0;
}
.big-avatar {
  font-size: 3.4rem;
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  box-shadow: var(--shadow);
  flex-shrink: 0;
}
.stat-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  text-align: center;
  min-width: 84px;
}
.stat-value {
  display: block;
  font-weight: 900;
  font-size: 1.2rem;
}
@media (max-width: 560px) {
  .stat-row {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }
  .stat {
    min-width: 0;
    padding: 8px 4px;
  }
  .stat-value {
    font-size: 1.05rem;
  }
}
.stat-label {
  font-size: 0.78rem;
  color: var(--muted);
}
.next-step {
  background: linear-gradient(135deg, var(--bg-3) 0%, var(--green-soft) 100%);
}
.next-lesson {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 12px;
}
.lesson-emoji {
  font-size: 2.8rem;
  line-height: 1;
}
.lesson-emoji.big {
  font-size: 3.6rem;
}
.track-dots {
  display: grid;
  gap: 8px;
  margin: 12px 0 16px;
}
.track-dots-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.track-dots-label {
  width: 28px;
  font-size: 1.2rem;
}
.dot {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-block;
  border: 2px solid var(--line);
  background: var(--card-bg);
}
.dot-done {
  background: var(--green);
  border-color: var(--green);
}
.dot-open {
  border-color: var(--green);
  animation: pulse 2s infinite;
}
.dot-locked {
  background: var(--bg-3);
}
@keyframes pulse {
  50% {
    box-shadow: 0 0 0 5px rgba(26, 143, 75, 0.18);
  }
}
.tool {
  display: block;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.12s ease;
}
.tool:hover {
  transform: translateY(-3px);
}
.tool-emoji {
  font-size: 2.4rem;
  display: block;
  margin-bottom: 6px;
}
.tool-big .tool-emoji {
  font-size: 3rem;
}
.badge-grid {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.badge {
  background: var(--surface);
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  padding: 12px;
  text-align: center;
  opacity: 0.7;
}
.badge.is-earned {
  opacity: 1;
  border: 2px solid var(--yellow);
  background: var(--yellow-soft);
}
.badge-emoji {
  display: block;
  font-size: 2rem;
}
.badge-name {
  display: block;
  font-weight: 800;
  font-size: 0.9rem;
}
.badge-desc {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
}

/* ============ Journey ============ */
.journey {
  list-style: none;
  padding: 0;
  margin: 0;
  position: relative;
}
.journey::before {
  content: '';
  position: absolute;
  left: 27px;
  top: 20px;
  bottom: 20px;
  width: 4px;
  background: repeating-linear-gradient(var(--line) 0 10px, transparent 10px 18px);
}
.journey-stop {
  display: flex;
  gap: 16px;
  margin-bottom: 16px;
  position: relative;
}
.journey-marker {
  flex-shrink: 0;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  background: var(--surface);
  border: 3px solid var(--line);
  z-index: 1;
}
.journey-stop.is-current .journey-marker {
  border-color: var(--yellow);
  box-shadow: 0 0 0 6px var(--yellow-soft);
}
.journey-stop.is-complete .journey-marker {
  border-color: var(--green);
  background: var(--green-soft);
}
.journey-card {
  flex: 1;
}
.journey-stop.is-locked .journey-card {
  opacity: 0.6;
}
.journey-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* ============ Stage ============ */
.stage-head {
  display: flex;
  gap: 18px;
  align-items: flex-start;
}
.stage-head > div {
  flex: 1;
  max-width: 640px;
}
.stage-emoji {
  font-size: 4rem;
  line-height: 1;
}
.track {
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 6px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.track-title {
  font-size: 1.15rem;
}
.track-steps {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}
.lesson-step-inner {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--line);
  text-decoration: none;
  color: var(--ink);
  background: var(--card-bg);
}
.lesson-step-inner small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}
.lesson-step-num {
  font-size: 1.7rem;
  width: 40px;
  text-align: center;
  flex-shrink: 0;
}
.lesson-step.is-open .lesson-step-inner {
  border-color: var(--green);
  box-shadow: 0 3px 0 var(--green-soft);
}
.lesson-step.is-open .lesson-step-inner:hover {
  background: var(--green-soft);
}
.lesson-step.is-done .lesson-step-inner {
  background: var(--green-soft);
}
.lesson-step.is-locked .lesson-step-inner {
  background: var(--bg-2);
  color: var(--muted);
  border-style: dashed;
}

/* ============ Lesson ============ */
.lesson {
  max-width: none;
  margin: 0 auto;
}
.lesson-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.lesson-head > div {
  flex: 1;
  min-width: 220px;
}
.lesson-head p {
  margin-bottom: 4px;
}
.done-note {
  color: var(--green-dark);
  font-weight: 700;
}
.big-idea {
  background: var(--yellow-soft);
  border: 2px solid #f3dc8f;
  border-radius: var(--radius);
  padding: 16px 20px;
  font-size: 1.15rem;
  margin-bottom: 18px;
}
.tag-grade {
  background: var(--talent-soft);
  color: var(--talent);
}
.lesson-diagram {
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.dg {
  display: block;
  width: 100%;
  max-width: 600px;
  height: auto;
  margin: 0 auto;
  color: var(--ink);
  font-family: var(--font);
}
.dg-text {
  fill: currentColor;
  font-size: 22px;
  font-weight: 700;
}
.dg-small {
  fill: currentColor;
  font-size: 18px;
  font-weight: 600;
}
.dg-mid {
  fill: currentColor;
  font-size: 34px;
  font-weight: 800;
}
.dg-big {
  fill: var(--green-dark);
  font-size: 76px;
  font-weight: 800;
}
.dg-line {
  stroke: currentColor;
  stroke-width: 3;
  fill: none;
  stroke-linecap: round;
}
.dg-thin {
  stroke: currentColor;
  stroke-width: 1.5;
  opacity: 0.6;
}
.dg-hand {
  stroke: var(--green-fill);
  stroke-width: 6;
  stroke-linecap: round;
}
.dg-hop {
  stroke: var(--business);
  stroke-dasharray: 6 5;
}
.dg-dash {
  stroke-dasharray: 6 5;
}
.dg-ink {
  fill: currentColor;
}
.dg-fill {
  fill: var(--green-fill);
}
.dg-edge {
  stroke: var(--bg-2);
  stroke-width: 2;
}
.dg-soft {
  fill: var(--green-soft);
}
.dg-accent {
  fill: var(--yellow);
}
.dg-box {
  fill: var(--bg);
  stroke: var(--line);
  stroke-width: 2;
}
.dg-shape {
  fill: var(--green-soft);
  stroke: var(--green-fill);
  stroke-width: 4;
  stroke-linejoin: round;
}
.lesson-notes {
  margin: 18px 0;
  border-left: 5px solid var(--talent);
  background: var(--talent-soft);
}
.lesson-notes h2 {
  margin: 0 0 8px;
  font-size: 1.1rem;
}
.lesson-notes ul {
  margin: 0;
  padding-left: 1.2em;
  line-height: 1.6;
}
.lesson-notes li + li {
  margin-top: 4px;
}
.lesson-notes .tiny {
  margin: 10px 0 0;
}
.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0 0 18px;
  display: grid;
  gap: 12px;
}
.step {
  counter-increment: step;
  position: relative;
  padding-left: 64px;
  font-size: 1.08rem;
}
.step::before {
  content: counter(step);
  position: absolute;
  left: 16px;
  top: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green-fill);
  color: var(--on-green);
  font-weight: 900;
  display: grid;
  place-items: center;
}
.activity {
  background: var(--green-soft);
  border-color: color-mix(in srgb, var(--green-fill) 45%, var(--line));
  margin-bottom: 18px;
}
.quiz {
  display: grid;
  gap: 16px;
}
.question {
  border: 0;
  padding: 0;
  margin: 0;
}
.question legend,
.likert legend {
  font-weight: 800;
  margin-bottom: 8px;
}
.choices,
.likert-options {
  display: grid;
  gap: 8px;
}
.likert-options {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}
@media (max-width: 560px) {
  .likert-options {
    grid-template-columns: 1fr;
  }
}
.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  cursor: pointer;
  background: var(--card-bg);
  color: var(--ink);
  font-weight: 600;
}
.choice:hover {
  border-color: var(--green);
}
.choice:has(input:checked) {
  border-color: var(--green);
  background: var(--green-soft);
}
.choice input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
  flex-shrink: 0;
}
.reflection {
  display: grid;
  gap: 6px;
  font-weight: 700;
}

/* ============ Result ============ */
.result {
  max-width: none;
  margin: 0 auto;
  text-align: center;
}
.result.is-pass {
  border-top: 6px solid var(--green);
}
.result.is-retry {
  border-top: 6px solid var(--yellow);
}
.result-emoji {
  font-size: 4rem;
  animation: bob 2.4s ease-in-out infinite;
}
.rewards {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}
.celebrate {
  background: var(--yellow-soft);
  border-radius: var(--radius);
  padding: 18px;
  margin: 18px 0;
}
.answers {
  list-style: none;
  padding: 0;
  margin: 18px 0;
  text-align: left;
  display: grid;
  gap: 8px;
}
.answers li {
  display: flex;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.answers li.ok {
  background: var(--green-soft);
}
.answers li.nope {
  background: var(--red-soft);
}
.correction {
  color: var(--green-dark);
  font-weight: 800;
}
.answers-title {
  margin: 22px 0 0;
  text-align: left;
  font-size: 1.15rem;
}
.review-note,
.moral {
  background: var(--yellow-soft);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  text-align: left;
}
.quiz.is-done .answers {
  margin-bottom: 8px;
}
.reflection-shown {
  color: var(--muted);
}

/* ============ Story Time ============ */
.story-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  color: inherit;
  text-decoration: none;
  border-top: 5px solid #f59e0b;
}
.story-card h2 {
  font-size: 1.15rem;
  margin: 0;
}
.story-card.is-done {
  border-top-color: var(--green);
}
.story-emoji {
  font-size: 2.6rem;
}
.chip-new {
  background: var(--yellow-soft);
  border-color: #f3dc8f;
}
.story-text p {
  font-size: 1.15rem;
  line-height: 1.75;
  margin: 0 0 14px;
}
.para-num {
  display: inline-grid;
  place-items: center;
  min-width: 1.6em;
  height: 1.6em;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--business);
  font-size: 0.8rem;
  font-weight: 800;
  vertical-align: 2px;
}
.word-help ul {
  margin: 0;
  padding-left: 20px;
}

/* ============ Weekly report card ============ */
.report-kids {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.report-kids .chip {
  text-decoration: none;
  color: inherit;
}
.report-kids .chip.is-on {
  background: var(--green-soft);
  border-color: var(--green);
}
.report-card {
  margin-bottom: 22px;
}
.report-card h3 {
  font-size: 1.05rem;
  margin: 18px 0 8px;
}
.report-card-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.report-card-head h2 {
  margin: 0;
}
.report-card-head > div:nth-child(2) {
  flex: 1;
  min-width: 200px;
}
.report-avatar {
  font-size: 2.8rem;
}
.report-overall {
  display: grid;
  justify-items: center;
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  border: 2px solid var(--line);
}
.report-overall strong {
  font-size: 1.8rem;
  line-height: 1.1;
}
.report-overall.tone-great {
  border-color: var(--green);
}
.report-overall.tone-low {
  border-color: var(--red);
}
.report-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 16px;
}
.report-stats > div {
  display: grid;
  gap: 2px;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.report-stats small {
  color: var(--muted);
  font-weight: 700;
}
.report-stats strong {
  font-size: 1.3rem;
}
.report-stats span {
  font-size: 0.82rem;
}
.trend.up {
  color: var(--green-dark);
}
.trend.down {
  color: var(--red);
}
.trend.flat {
  color: var(--muted);
}
.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.report-table th,
.report-table td {
  text-align: left;
  padding: 7px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.report-table thead th {
  color: var(--muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.report-table tbody th {
  font-weight: 700;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.95rem;
  color: var(--ink);
}
.report-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.report-table tr.tone-great td:last-child {
  color: var(--green-dark);
  font-weight: 800;
}
.report-table tr.tone-low td:last-child {
  color: var(--red);
  font-weight: 800;
}
.report-table tr.tone-none td {
  color: var(--muted);
}
.score-bar {
  display: inline-block;
  width: 70px;
  height: 8px;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
  vertical-align: middle;
}
.score-bar > span {
  display: block;
  height: 100%;
  background: var(--green);
}
.report-notes ul {
  margin: 0;
  padding-left: 20px;
}
.report-notes li {
  margin-bottom: 4px;
}
.report-comment {
  background: var(--yellow-soft);
  border-radius: var(--radius-sm);
  padding: 4px 16px 10px;
  margin-top: 16px;
}
.report-sign {
  margin-top: 14px;
}
@media (max-width: 600px) {
  .report-table {
    font-size: 0.85rem;
  }
  /* Each subject becomes a small block: name on top, then lessons, score and rating. */
  .report-table thead {
    display: none;
  }
  .report-table tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 4px 10px;
    padding: 8px 0;
    border-bottom: 1px solid var(--line);
  }
  .report-table th,
  .report-table td {
    border: 0;
    padding: 0;
  }
  .report-table tbody th {
    grid-column: 1 / -1;
    font-size: 0.9rem;
  }
  .report-table td[data-label]::before {
    content: attr(data-label) ': ';
    color: var(--muted);
  }
  .report-table td:last-child {
    text-align: right;
  }
  .report-table th,
  .report-table td {
    padding: 6px 4px;
  }
  .score-bar {
    display: none;
  }
}
@media print {
  .topbar,
  .site-footer,
  .stay-bar,
  .flash,
  .no-print {
    display: none !important;
  }
  body {
    background: #e6d9c4;
  }
  .report-card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
  .report-card + .report-card {
    break-before: page;
  }
}

/* ============ Daily pace ============ */
.pace-card {
  margin-bottom: 20px;
}
.pace-form {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.pace-option {
  display: flex;
  align-items: center;
  gap: 6px;
  border: 2px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  cursor: pointer;
}
.pace-option:has(input:checked) {
  border-color: var(--green);
  background: var(--green-soft);
}
.pace-done {
  border-top: 5px solid #6366f1;
}
.pace-line {
  margin: 8px 0 0;
}

/* ============ Daily exercises ============ */
.drill-grid .tool {
  border-top: 5px solid var(--green);
}
.drill-source {
  margin: -4px 0 6px;
}

/* ============ Review card ============ */
.review-card {
  border-left: 6px solid #f59e0b;
}
.result .actions {
  justify-content: center;
}

/* ============ Business Lab ============ */
.market {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.market-end {
  grid-column: 1 / -1;
  text-align: center;
  border-top: 6px solid var(--yellow);
}
.market-end .actions {
  justify-content: center;
}
@media (max-width: 860px) {
  .market {
    grid-template-columns: minmax(0, 1fr);
  }
}
.market-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.market-status > div {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.market-status span,
.market-status strong {
  display: block;
}
@media (max-width: 480px) {
  .market-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.warn {
  color: var(--red);
  font-weight: 700;
}
.good {
  color: var(--green-dark);
  font-weight: 800;
}
.bad {
  color: var(--red);
  font-weight: 800;
}
.market-feedback {
  margin-top: 14px;
}
.market-feedback ul {
  margin: 0;
  padding-left: 1.2em;
}
.change {
  max-width: 520px;
}
.change-status {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
.change-status > div {
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.change-status span,
.change-status strong {
  display: block;
}
.change-given {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 12px;
}
.change-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.change-feedback {
  margin-top: 12px;
  min-height: 1.4em;
}
.change-end {
  text-align: center;
  border-top: 6px solid var(--yellow);
}
.change-end .actions {
  justify-content: center;
}
.change-log {
  text-align: left;
  margin: 12px auto;
  max-width: 28rem;
  padding-left: 1.2em;
}
.table-wrap {
  overflow-x: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
th,
td {
  text-align: left;
  padding: 8px 6px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
th {
  font-size: 0.8rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tr.empty td {
  color: var(--muted);
  text-align: center;
  padding: 24px;
}
.tips {
  margin-top: 18px;
}
.glossary {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 16px;
  margin: 0;
}
.glossary dt {
  font-weight: 800;
}
.glossary dd {
  margin: 0;
}
.plan-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
@media (max-width: 700px) {
  .plan-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
.plan-box {
  display: grid;
  gap: 6px;
  position: relative;
  border-left: 6px solid var(--line);
}
.plan-box.is-filled {
  border-left-color: var(--green);
}
.plan-num {
  position: absolute;
  top: 14px;
  right: 16px;
  font-weight: 900;
  color: var(--line);
  font-size: 1.6rem;
}
.plan-actions {
  grid-column: 1 / -1;
  text-align: center;
}

/* ============ Studio ============ */
.spark {
  background: linear-gradient(135deg, var(--bg-3) 0%, color-mix(in srgb, var(--creative) 28%, var(--bg-3)) 100%);
}
.spark-text {
  font-size: 1.35rem;
  font-weight: 800;
  min-height: 3.5em;
  color: var(--creative);
}
.spark-text.pop {
  animation: pop 0.35s ease;
}
@keyframes pop {
  0% {
    transform: scale(0.96);
    opacity: 0.4;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}
.idea {
  border-top: 5px solid var(--creative);
  display: flex;
  flex-direction: column;
}
.idea p {
  overflow-wrap: anywhere;
}
.idea-foot {
  margin-top: auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.idea-foot form {
  margin: 0;
}

/* ============ Talents ============ */
.cta-card {
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--bg-3) 0%, color-mix(in srgb, var(--talent) 22%, var(--bg-3)) 100%);
}
.cta-card > div {
  flex: 1;
  min-width: 220px;
}
.talent {
  border-top: 5px solid var(--talent);
}
.talent-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}
.talent-head h3 {
  margin: 0;
}
.talent-emoji {
  font-size: 2.4rem;
}
.business-idea {
  background: var(--business-soft);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
}
.all-scores {
  margin-top: 16px;
}
.all-scores summary {
  cursor: pointer;
  font-weight: 800;
}
.score-list {
  list-style: none;
  padding: 0;
  margin: 12px 0;
  display: grid;
  gap: 6px;
}
.score-list li {
  display: grid;
  grid-template-columns: 170px 1fr;
  gap: 10px;
  align-items: center;
  font-size: 0.92rem;
}
.score-list .bar {
  margin: 0;
}
.week-chart {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  height: 180px;
  margin: 12px 0 16px;
}
.week-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.week-bar {
  flex: 1;
  width: 100%;
  max-width: 36px;
  background: var(--bg-3);
  border-radius: 8px;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
}
.week-bar span {
  display: block;
  width: 100%;
  background: linear-gradient(0deg, var(--green-dark), var(--green-fill));
  border-radius: 8px;
}
.week-val {
  font-size: 0.75rem;
  font-weight: 800;
  min-height: 1.1em;
}
.week-label {
  font-size: 0.75rem;
  color: var(--muted);
}
.practice-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 6px;
}
.practice-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 2px 10px;
  padding: 8px 10px;
  background: var(--bg);
  border-radius: var(--radius-sm);
}
.practice-list small {
  flex-basis: 100%;
}
.talent-quiz {
  display: grid;
  gap: 18px;
  max-width: none;
}
.likert {
  border: 0;
  padding: 0 0 14px;
  margin: 0;
  border-bottom: 1px solid var(--line);
}

/* ============ Family ============ */
.family-card {
  margin-bottom: 20px;
}
.family-head {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.family-head > div {
  flex: 1;
  min-width: 220px;
}
.family-head p {
  margin: 0;
}
.family-switch {
  margin: 0;
}
.family-grid {
  margin-bottom: 12px;
}
.family-grid h3 {
  font-size: 1rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.family-grid .score-list li {
  grid-template-columns: 130px 1fr;
}
.badge-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.reflections {
  padding-left: 1.2em;
}
.reflections li {
  margin-bottom: 6px;
}

/* ============ Footer ============ */
.site-footer {
  margin-top: 48px;
  padding: 36px 24px 0;
  border-top: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--muted);
  font-size: 0.92rem;
}
.site-footer p {
  margin: 0;
}
.site-footer-mini {
  padding: 16px;
  text-align: center;
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) repeat(4, minmax(0, 1fr));
  gap: 28px 28px;
  max-width: 1240px;
  margin: 0 auto;
}
.footer-logo {
  font-size: 1.2rem;
  color: var(--green-dark);
}
.footer-native {
  margin-top: 2px !important;
  font-weight: 700;
  color: var(--business);
}
.footer-tag {
  margin-top: 10px !important;
  max-width: 22rem;
  line-height: 1.5;
}
.footer-partner {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg);
}
.footer-partner:hover,
.footer-partner:focus-visible {
  border-color: var(--green-fill);
  text-decoration: none !important;
}
.footer-partner img {
  display: block;
  border-radius: 10px;
}
.footer-partner span {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}
.footer-partner strong {
  color: var(--ink);
}
.footer-partner small {
  font-size: 0.8rem;
}
.footer-by {
  margin-top: 8px !important;
  font-size: 0.85rem;
}
.footer-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}
.footer-col h2 {
  margin: 0 0 4px;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}
.footer-col a {
  color: var(--muted);
  text-decoration: none;
}
.footer-col a:hover,
.footer-col a:focus-visible {
  color: var(--green-dark);
  text-decoration: underline;
}
.footer-legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
}
.footer-legal a {
  color: var(--muted);
  text-decoration: none;
}
.footer-legal a:hover,
.footer-legal a:focus-visible {
  color: var(--green-dark);
  text-decoration: underline;
}
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px 16px;
  max-width: 1240px;
  margin: 28px auto 0;
  padding: 16px 0 20px;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
}
@media (max-width: 1100px) {
  .footer-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
}
@media (max-width: 760px) {
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
  }
  .footer-partner {
    gap: 8px;
    padding: 6px 8px 6px 6px;
    max-width: 100%;
  }
  .footer-partner img {
    width: 34px;
    height: 34px;
  }
  .footer-partner strong {
    font-size: 0.9rem;
  }
  .footer-partner small {
    font-size: 0.72rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ============ Subject colours ============ */
.pillar-english,
.tag-english {
  --accent: #4f46e5;
  --accent-2: #818cf8;
  --accent-soft: #c9c4e6;
}
.pillar-maths,
.tag-maths {
  --accent: #e11d48;
  --accent-2: #fb7185;
  --accent-soft: #e0c4cb;
}
.pillar-languages,
.tag-languages {
  --accent: #0277b6;
  --accent-2: #38bdf8;
  --accent-soft: #b9d0dc;
}
.pillar-business,
.tag-business {
  --accent: var(--business);
  --accent-2: #f0a030;
  --accent-soft: var(--business-soft);
}
.pillar-creative,
.tag-creative {
  --accent: var(--creative);
  --accent-2: #f08a9b;
  --accent-soft: var(--creative-soft);
}
.pillar-tech,
.tag-tech {
  --accent: #334155;
  --accent-2: #2f9a5d;
  --accent-soft: #e2e8f0;
}
.pillar-talent,
.tag-talent {
  --accent: var(--talent);
  --accent-2: #5fcf8a;
  --accent-soft: var(--talent-soft);
}
.pillar-world,
.tag-world {
  --accent: #15803d;
  --accent-2: #65a30d;
  --accent-soft: #e6f4dc;
}
.pillar-arts,
.tag-arts {
  --accent: #be185d;
  --accent-2: #f472b6;
  --accent-soft: #fde7f1;
}
.tag-english,
.tag-maths,
.tag-languages,
.tag-business,
.tag-creative,
.tag-talent,
.tag-tech,
.tag-world,
.tag-arts {
  background: var(--accent-soft);
  color: var(--accent);
}
.pillar[class*='pillar-'],
.track[class*='pillar-'] {
  border-top-color: var(--accent);
}
.pillar .bar > span,
.track .bar > span {
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.lesson[class*='pillar-'] .step::before {
  background: var(--accent);
}
.group-title {
  margin: 26px 0 12px;
  font-size: 1.15rem;
}
.group-grid {
  margin-bottom: 8px;
}
.lang-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 18px;
}
.lang-symbol {
  display: inline-grid;
  place-items: center;
  min-width: 2.2em;
  height: 2.2em;
  padding: 0 0.3em;
  border-radius: 10px;
  background: color-mix(in srgb, var(--green-fill) 20%, var(--bg-3));
  color: var(--green-dark);
  font-weight: 900;
  font-size: 1.4rem;
  line-height: 1;
}
.lang-symbol.small {
  font-size: 0.85rem;
  min-width: 2em;
  height: 2em;
  border-radius: 8px;
}

/* ============ Lessons: grown-ups, words, facts ============ */
.together-note {
  background: var(--yellow-soft);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  font-weight: 700;
  font-size: 0.95rem;
}
.words-card {
  margin-bottom: 18px;
  border-top: 5px solid #0277b6;
}
.words-card-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}
.words-card-head h2 {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.word-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.word {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 2px 8px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.word-en {
  grid-column: 1;
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 700;
}
.word-target {
  grid-column: 1;
  display: flex;
  flex-direction: column;
}
.word-text {
  font-size: 1.35rem;
  font-weight: 800;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.word-say {
  color: var(--green-dark);
  font-weight: 700;
  font-size: 0.85rem;
}
.say {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, var(--green-fill) 35%, var(--line));
  background: var(--card-bg);
  font-size: 1.2rem;
  cursor: pointer;
}
.say:hover {
  background: color-mix(in srgb, var(--green-fill) 20%, var(--bg-3));
}
.is-hiding .word:not(.revealed) .word-target {
  visibility: hidden;
}
.is-hiding .word:not(.revealed) {
  cursor: pointer;
  background: repeating-linear-gradient(45deg, var(--bg) 0 10px, var(--bg-3) 10px 20px);
}
.fact {
  background: color-mix(in srgb, var(--green-fill) 20%, var(--bg-3));
  border-color: color-mix(in srgb, var(--green-fill) 45%, var(--line));
  margin-bottom: 18px;
}
.choice-script {
  font-size: 1.15rem;
  font-weight: 800;
}
.language-switch {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  margin: 0;
}
.language-switch label {
  display: grid;
  gap: 2px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}
.language-switch select {
  padding: 6px 10px;
  width: auto;
}
.language-picker {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}
.language-picker legend {
  font-weight: 700;
  margin-bottom: 6px;
}
.form .language-option {
  display: block;
  font-weight: 600;
}
.language-option input {
  position: absolute;
  opacity: 0;
}
.language-option > span {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  cursor: pointer;
  background: var(--card-bg);
  color: var(--ink);
}
.language-option input:checked + span {
  border-color: var(--green);
  background: var(--green-soft);
  color: var(--ink);
}
.language-option input:checked + span .muted,
.language-option input:checked + span small {
  color: var(--muted);
}
.language-option input:focus-visible + span {
  outline: 3px solid var(--yellow);
}
@media (max-width: 480px) {
  .language-picker {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============ Practice ============ */
.level-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}
.level {
  display: flex;
  flex-direction: column;
  gap: 4px;
  text-decoration: none;
  color: var(--ink);
  transition: transform 0.12s ease;
}
.level:hover {
  transform: translateY(-3px);
}
.level.is-recommended {
  border: 2px solid #fb7185;
  background: linear-gradient(135deg, var(--bg-3) 0%, color-mix(in srgb, var(--creative) 18%, var(--bg-3)) 100%);
}
.level-emoji {
  font-size: 2rem;
}
.level-foot {
  margin-top: auto;
  padding-top: 6px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  align-items: flex-start;
}
.languages-cta {
  margin-top: 28px;
  background: linear-gradient(135deg, var(--bg-3) 0%, color-mix(in srgb, var(--green-fill) 22%, var(--bg-3)) 100%);
}
.maths-round {
  max-width: none;
}
.problems {
  list-style: none;
  counter-reset: problem;
  padding: 0;
  margin: 0 0 18px;
  display: grid;
  gap: 10px;
}
.problem {
  counter-increment: problem;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.problem::before {
  content: counter(problem);
  flex-shrink: 0;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #e11d48;
  color: #fff;
  font-weight: 900;
  font-size: 0.9rem;
}
.problem-text {
  flex: 1;
  font-size: 1.3rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.problem input {
  width: 110px !important;
  font-size: 1.2rem !important;
  text-align: center;
  font-weight: 800 !important;
}
.words-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
}
.words-tools {
  margin-bottom: 16px;
}
.word-wall {
  display: grid;
  gap: 16px;
}
.word-section h2 {
  font-size: 1.15rem;
}
.family-page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.family-page-head form {
  margin: 0;
}
.center-actions {
  justify-content: center;
}

/* ============ Fidel chart ============ */
.fidel-cta {
  margin-top: 18px;
  background: linear-gradient(135deg, var(--bg-3) 0%, var(--green-soft) 100%);
}
.fidel-guide {
  margin-bottom: 16px;
}
.fidel-vowels {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 6px 14px;
}
.fidel-wrap {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.fidel-table {
  table-layout: fixed;
  min-width: 340px;
}
.fidel-table th,
.fidel-table td {
  text-align: center;
  padding: 6px 2px;
  white-space: normal;
  text-transform: none;
  letter-spacing: 0;
}
.fidel-table thead th {
  color: var(--green-dark);
  font-size: 0.95rem;
  text-transform: none;
}
.fidel-table tbody th {
  font-size: 0.8rem;
  color: var(--muted);
  width: 58px;
}
.fidel-table tbody th small {
  display: block;
  font-size: 0.75rem;
}
.fidel-table thead th:first-child {
  width: 58px;
}
.fidel-table tbody tr:nth-child(even) {
  background: var(--bg-2);
}
.fidel-cell {
  cursor: default;
}
.fidel-char {
  display: block;
  font-size: 1.6rem;
  line-height: 1.2;
  font-weight: 700;
}
.fidel-say {
  display: block;
  font-size: 0.75rem;
  color: var(--green-dark);
  font-weight: 700;
}
.is-hiding .fidel-cell {
  cursor: pointer;
}
.is-hiding .fidel-cell:not(.revealed) .fidel-say {
  visibility: hidden;
}
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
@media (max-width: 480px) {
  .fidel-char {
    font-size: 1.3rem;
  }
  .fidel-table tbody th,
  .fidel-table thead th:first-child {
    width: 44px;
  }
}

/* Reading-and-writing lessons show big letters, centred */
.word-list-big .word-target {
  align-items: center;
  text-align: center;
}
.word-list-big .word-en {
  text-align: center;
}
.word-list-big .word-text {
  font-size: 2.6rem;
  line-height: 1.2;
}

/* ============ Settings ============ */
.settings-list {
  display: grid;
  gap: 12px;
}
.settings-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
}
.settings-row-main {
  flex: 1;
  min-width: 0;
}
.settings-row-main h3,
.settings-row-main p {
  margin: 0;
}
.settings-add {
  text-decoration: none;
  color: var(--ink);
  border-style: dashed;
}
.settings-add:hover {
  border-color: var(--green);
}
.big-avatar.small-avatar {
  width: 56px;
  height: 56px;
  font-size: 2rem;
}
.settings-help {
  margin-top: 18px;
}
.settings-help ul {
  padding-left: 1.2em;
}
.settings-edit {
  max-width: none;
}
.choice-picker {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}
.choice-picker legend {
  font-weight: 700;
  margin-bottom: 6px;
}
.choice-picker .language-option > span {
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
}
.danger-zone {
  max-width: none;
  margin: 18px auto 0;
  border-color: #f5c2c2;
}
.btn-danger {
  background: var(--red);
  border-color: var(--red);
  box-shadow: 0 3px 0 #a12c2c;
}
.btn-danger:hover {
  background: #a12c2c;
}
.head-actions {
  margin-top: 0;
  align-items: center;
}
.head-actions form {
  margin: 0;
}

/* Previous / next lesson links */
.lesson-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.lesson-nav-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 12px 16px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
}
.lesson-nav-link small {
  color: var(--muted);
  font-weight: 700;
}
.lesson-nav-link.next {
  text-align: right;
  grid-column: 2;
}
.lesson-nav-link:hover {
  border-color: var(--green);
}
@media (max-width: 480px) {
  .lesson-nav {
    grid-template-columns: minmax(0, 1fr);
  }
  .lesson-nav-link.next {
    grid-column: 1;
  }
  .lesson-nav > span:empty {
    display: none;
  }
}

/* ============ Ranks ============ */
@property --pct {
  syntax: '<number>';
  inherits: false;
  initial-value: 0;
}
.rank-badge {
  --size: 64px;
  position: relative;
  display: inline-grid;
  flex-shrink: 0;
  width: var(--size);
  height: var(--size);
  padding: calc(var(--size) * 0.075);
  border-radius: 50%;
  background: conic-gradient(var(--tier) calc(var(--pct) * 1%), #e4ebe7 0);
  box-shadow: 0 4px 14px rgba(29, 36, 51, 0.14);
  animation: ring-fill 1.1s ease-out both;
}
.rank-sm {
  --size: 48px;
}
.rank-md {
  --size: 64px;
}
.rank-lg {
  --size: 88px;
}
.rank-xl {
  --size: 124px;
}
.rank-badge-inner {
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--card-bg) 0%, var(--card-bg) 38%, color-mix(in srgb, var(--tier) 24%, var(--card-bg)) 100%);
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.9);
  font-size: calc(var(--size) * 0.46);
  line-height: 1;
}
@keyframes ring-fill {
  from {
    --pct: 0;
  }
}
.rank-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--tier) 15%, var(--card-bg));
  color: color-mix(in srgb, var(--tier) 72%, #000);
  font-weight: 800;
  font-size: 0.9rem;
  white-space: nowrap;
}
.rank-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  margin: 4px 0 !important;
}
.bar-rank > span {
  background: linear-gradient(90deg, var(--tier), color-mix(in srgb, var(--tier) 55%, var(--card-bg)));
}
.welcome-rank {
  text-decoration: none;
  flex-shrink: 0;
}
.rank-chip {
  text-decoration: none;
  color: var(--ink) !important;
  background: var(--yellow-soft) !important;
  border-color: #f3dc8f !important;
}
.rank-progress {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 470px;
  margin: 14px auto 4px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--ink);
  text-align: left;
  text-decoration: none;
}
.rank-progress-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rank-progress .bar {
  display: block;
  margin: 4px 0;
}

/* ============ Weekly Champions (teal panels) ============ */
.champ-panel {
  display: block;
  border-radius: var(--radius);
  padding: 20px;
  background: radial-gradient(circle at 88% 0%, rgba(255, 255, 255, 0.14), transparent 45%),
    linear-gradient(160deg, var(--board-1) 0%, var(--board-2) 100%);
  color: #effafb;
  box-shadow: 0 12px 30px rgba(11, 63, 74, 0.25);
}
.champ-panel h2 {
  margin: 0;
  color: #fff;
  font-size: 1.2rem;
}
.champ-sub {
  margin: 4px 0 0;
  color: var(--on-board-soft);
  font-size: 0.9rem;
}
.week-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 14px;
}
.champ-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  color: #ffd24a;
  font-size: 1.35rem;
  font-weight: 900;
  white-space: nowrap;
}
.champ-stat small {
  color: var(--on-board-soft);
  font-size: 0.7rem;
  font-weight: 700;
}
.dash-top {
  margin-bottom: 18px;
}
a.champs-mini {
  text-decoration: none;
  transition: transform 0.12s ease;
}
a.champs-mini:hover {
  transform: translateY(-3px);
}
.champ-place-pill {
  padding: 2px 12px;
  border-radius: 999px;
  background: #ffd24a;
  color: #3b2a00;
  font-weight: 900;
}

/* Week tracker: consecutive practised days join into one golden bar */
.week-track {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  padding: 8px 6px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}
.wt-day {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.wt-dot {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.13);
  color: var(--board-2);
  font-weight: 900;
}
.wt-day.is-active .wt-dot {
  background: #ffc629;
  box-shadow: 0 0 0 3px rgba(255, 198, 41, 0.3);
}
.wt-day.is-active + .wt-day.is-active::before {
  content: '';
  position: absolute;
  top: 13px;
  right: 50%;
  width: 100%;
  height: 10px;
  background: #ffc629;
}
.wt-day.is-today:not(.is-active) .wt-dot {
  background: transparent;
  border: 2px dashed #ffd24a;
  animation: today-glow 1.8s ease-in-out infinite;
}
@keyframes today-glow {
  50% {
    box-shadow: 0 0 0 6px rgba(255, 210, 74, 0.25);
  }
}
.wt-day.is-future .wt-dot {
  opacity: 0.45;
}
.wt-label {
  color: var(--on-board-soft);
  font-size: 0.75rem;
  font-weight: 700;
}
.wt-day.is-today .wt-label {
  color: #fff;
}

/* Podium: gold, silver and bronze */
.podium {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  gap: 10px;
  padding-top: 26px;
}
.podium-spot {
  --medal: #cfd8dc;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 112px;
  text-align: center;
}
.place-1 {
  --medal: #ffc629;
}
.place-2 {
  --medal: #d5dde1;
}
.place-3 {
  --medal: #e3985b;
}
.podium-avatar {
  position: relative;
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  margin-bottom: 8px;
  border-radius: 50%;
  background: var(--card-bg);
  box-shadow: 0 0 0 4px var(--medal), 0 8px 18px rgba(0, 0, 0, 0.28);
  font-size: 2.4rem;
}
.place-1 .podium-avatar {
  width: 92px;
  height: 92px;
  font-size: 3rem;
}
.crown {
  position: absolute;
  top: -30px;
  left: 50%;
  font-size: 1.9rem;
  animation: crown-bob 2.4s ease-in-out infinite;
  transform: translateX(-50%) rotate(-8deg);
}
@keyframes crown-bob {
  50% {
    transform: translateX(-50%) translateY(-5px) rotate(6deg);
  }
}
.podium-medal {
  position: absolute;
  right: -4px;
  bottom: -6px;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--board-2);
  border-radius: 50%;
  background: var(--medal);
  color: #3b2a00;
  font-size: 0.85rem;
  font-weight: 900;
}
.podium-name {
  color: #fff;
  font-size: 1rem;
}
.podium-spot.is-you .podium-name::after {
  content: ' ⭐';
}
.podium-xp {
  color: #ffd24a;
  font-weight: 800;
  font-size: 0.9rem;
}
.podium-block {
  width: 100%;
  margin-top: 8px;
  border-radius: 14px 14px 4px 4px;
  background: linear-gradient(180deg, var(--medal), color-mix(in srgb, var(--medal) 45%, var(--board-2)));
}
.place-1 .podium-block {
  height: 92px;
}
.place-2 .podium-block {
  height: 64px;
}
.place-3 .podium-block {
  height: 44px;
}
.podium-compact {
  padding-top: 22px;
}
.podium-compact .podium-spot {
  width: 84px;
}
.podium-compact .podium-avatar {
  width: 52px;
  height: 52px;
  font-size: 1.7rem;
}
.podium-compact .place-1 .podium-avatar {
  width: 64px;
  height: 64px;
  font-size: 2.1rem;
}
.podium-compact .crown {
  top: -24px;
  font-size: 1.4rem;
}
.podium-compact .podium-medal {
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
}
.podium-compact .podium-name {
  font-size: 0.85rem;
}
.podium-compact .place-1 .podium-block {
  height: 46px;
}
.podium-compact .place-2 .podium-block {
  height: 32px;
}
.podium-compact .place-3 .podium-block {
  height: 22px;
}
.champ-list {
  display: grid;
  gap: 6px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.champ-list li {
  display: grid;
  grid-template-columns: 30px 40px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.07);
}
.champ-list li.is-you {
  background: rgba(255, 210, 74, 0.18);
  box-shadow: inset 0 0 0 2px #ffd24a;
}
.champ-list-place {
  color: var(--on-board-soft);
  font-weight: 800;
}
.champ-list-face {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card-bg);
  font-size: 1.3rem;
}
.champ-list-name {
  color: #fff;
  font-weight: 800;
}
.champ-list-xp {
  color: #ffd24a;
  font-weight: 800;
}
.champ-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
.champ-chips span {
  padding: 4px 12px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 999px;
  color: #e6f6f8;
  font-size: 0.85rem;
  font-weight: 700;
}
.champ-board {
  max-width: none;
  margin: 0 auto;
}
.family-board {
  max-width: none;
  margin-bottom: 20px;
}
.champ-awards-line {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 16px 0 0;
}
.champ-awards-line span {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}
.nudge-card {
  max-width: 620px;
  margin: 18px auto;
  text-align: center;
  background: linear-gradient(135deg, var(--bg-3) 0%, var(--yellow-soft) 100%);
  border-color: #f3dc8f;
}
.nudge-big {
  margin-bottom: 4px;
  font-size: 1.4rem;
  font-weight: 900;
}
.award-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 14px;
}
.award-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-align: center;
}
.award-card.is-mine {
  border: 2px solid var(--yellow);
  background: linear-gradient(180deg, var(--yellow-soft), var(--card-bg));
}
.award-card h3 {
  margin: 4px 0;
}
.award-emoji {
  display: block;
  font-size: 2.4rem;
}
.award-winners {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 6px 0;
}
.award-winner {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--bg);
  font-size: 0.9rem;
  font-weight: 800;
}
.my-rank {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
}
.my-rank > div {
  flex: 1;
  min-width: 220px;
}
.my-rank-name {
  margin: 0 0 4px;
  font-size: 1.6rem;
}
.rank-ladder {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 12px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}
.rank-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 12px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-align: center;
}
.rank-step strong {
  font-size: 0.9rem;
}
.rank-step small {
  color: var(--muted);
  font-size: 0.75rem;
}
.rank-step.is-done small {
  color: var(--green-dark);
  font-weight: 700;
}
.rank-step.is-current {
  border: 2px solid var(--yellow);
  background: var(--yellow-soft);
  transform: scale(1.05);
}
.rank-step.is-current small {
  color: var(--yellow-ink);
  font-weight: 800;
}
.rank-step.is-ahead .rank-badge {
  filter: grayscale(0.85);
  opacity: 0.55;
}
.xp-guide {
  margin-top: 18px;
}
.xp-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.xp-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.xp-list strong {
  color: var(--yellow-ink);
  white-space: nowrap;
}

/* XP on lesson cards */
.lesson-step-text {
  flex: 1;
  min-width: 0;
}
.xp-tag {
  flex-shrink: 0;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--yellow-ink);
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}
.xp-tag.is-earned {
  background: var(--green-soft);
  color: var(--green-dark);
}

/* Badges show how close they are */
.badge:not(.is-earned) .badge-emoji {
  filter: grayscale(1);
  opacity: 0.45;
}
.badge.is-close {
  border: 2px solid #f3dc8f;
  opacity: 1;
}
.badge.is-close .badge-emoji {
  filter: grayscale(0.3);
  opacity: 0.85;
}
.badge-meter {
  display: block;
  height: 6px;
  margin: 6px 8px 2px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-3);
}
.badge-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--yellow), #ffcf3f);
}
.badge-state {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}
.badge.is-earned .badge-state {
  color: var(--green-dark);
}

/* Rank-up celebration */
.rankup {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 16px;
  overflow: hidden;
  background: rgba(8, 44, 52, 0.62);
  animation: fade-in 0.25s ease;
}
.rankup-card {
  position: relative;
  z-index: 1;
  width: min(390px, 100%);
  padding: 28px 22px;
  border-radius: 24px;
  background: var(--card-bg);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  text-align: center;
  animation: pop-in 0.55s cubic-bezier(0.2, 1.5, 0.4, 1) both;
}
.rankup-card .rank-badge {
  margin: 6px auto 12px;
}
.rankup-card h2 {
  font-size: 1.6rem;
}
.confetti span {
  position: absolute;
  top: -24px;
  width: 10px;
  height: 16px;
  border-radius: 3px;
  opacity: 0.9;
  animation-name: confetti-fall;
  animation-timing-function: linear;
  animation-iteration-count: infinite;
}
@keyframes confetti-fall {
  from {
    transform: translateY(-5vh) rotate(0deg);
  }
  to {
    transform: translateY(110vh) rotate(720deg);
  }
}
@keyframes fade-in {
  from {
    opacity: 0;
  }
}
@keyframes pop-in {
  from {
    transform: scale(0.6);
    opacity: 0;
  }
}

@media (max-width: 480px) {
  .podium {
    gap: 6px;
  }
  .podium-spot {
    width: 96px;
  }
  .place-1 .podium-avatar {
    width: 80px;
    height: 80px;
    font-size: 2.6rem;
  }
  .podium-avatar {
    width: 64px;
    height: 64px;
    font-size: 2rem;
  }
  .wt-dot {
    width: 30px;
    height: 30px;
  }
  .wt-day.is-active + .wt-day.is-active::before {
    top: 10px;
  }
  .week-card-head {
    flex-wrap: wrap;
  }
}

.week-mini {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}
.week-mini span {
  padding: 10px 6px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--on-board-soft);
  font-size: 0.8rem;
  font-weight: 700;
  text-align: center;
}
.week-mini strong {
  display: block;
  color: #fff;
  font-size: 1.4rem;
  line-height: 1.2;
}

/* ============ Coins ============ */
.stat-link {
  text-decoration: none;
  color: var(--ink);
}
.stat-link:hover {
  border-color: var(--yellow);
}
.coin-hero {
  display: flex;
  align-items: center;
  gap: 18px;
}
.coin-big {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 110px;
  height: 110px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, #fff6c7, #ffc629 55%, #d99a00);
  box-shadow: 0 0 0 6px rgba(255, 210, 74, 0.25), 0 10px 24px rgba(0, 0, 0, 0.25);
  font-size: 3.6rem;
  animation: bob 3s ease-in-out infinite;
}
.coin-balance {
  margin: 6px 0 0;
  color: var(--on-board-soft);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.2;
}
.coin-balance span {
  font-size: 0.95rem;
  color: var(--on-board-soft);
  font-weight: 600;
}
.coin-birr {
  margin: 2px 0 0;
  color: #fff;
  font-size: clamp(2.8rem, 8vw, 4.2rem);
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.03em;
}
.coin-worth {
  margin: 4px 0 0;
  color: #ffd24a;
  font-size: 1rem;
  font-weight: 700;
}
.coin-worth small {
  color: var(--on-board-soft);
  font-size: 0.8rem;
  font-weight: 600;
}
.coin-chips {
  justify-content: flex-start;
}
.coin-goal h2 {
  margin-bottom: 6px;
}
.coin-goal-name {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 900;
}
.coin-jar {
  position: relative;
  height: 26px;
  overflow: hidden;
  border: 2px solid #f3dc8f;
  border-radius: 999px;
  background: var(--yellow-soft);
}
.coin-jar::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--fill);
  background: linear-gradient(90deg, #ffc629, #f5b301);
  border-radius: inherit;
}
.coin-jar span {
  position: relative;
  display: block;
  color: #3a2c00;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 22px;
  text-align: center;
}
.compact-form {
  gap: 10px;
  margin-top: 12px;
}
.compact-form .btn {
  justify-self: start;
}
.earn-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 14px;
}
.earn-card {
  padding: 16px;
}
.earn-card h3 {
  margin: 4px 0;
}
.earn-card p {
  margin: 0 0 4px;
}
.earn-emoji {
  font-size: 2rem;
}
.pending-list {
  margin-top: 12px;
}
.pending-list li {
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--yellow-soft);
}

/* ============ Family bank redesign ============ */
.bank-hero-head .lead {
  max-width: 40rem;
}
.bank-rule-banner,
.fb-rule {
  margin-bottom: 22px;
}
.bank-rule-bar {
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  min-height: 2.4rem;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}
.bank-rule-save {
  flex: 0 0 var(--save, 20%);
  display: grid;
  place-items: center;
  background: linear-gradient(90deg, color-mix(in srgb, var(--green-soft) 40%, var(--green-fill)), var(--green-fill));
  color: var(--on-green);
  padding: 0.35rem 0.6rem;
}
.bank-rule-spend {
  flex: 1;
  display: grid;
  place-items: center;
  background: linear-gradient(90deg, color-mix(in srgb, var(--yellow-soft) 35%, var(--yellow)), var(--yellow));
  color: var(--ink);
  padding: 0.35rem 0.6rem;
}
.bank-accounts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 18px;
  margin-bottom: 28px;
}
.bank-account {
  border-top: 5px solid var(--green);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.bank-account-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bank-account-head h2 {
  margin: 0;
}
.bank-balances {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.bank-bal {
  background: var(--bg-3);
  color: var(--ink);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
  text-align: center;
}
.bank-bal strong {
  display: block;
  font-size: 1.15rem;
  color: var(--ink);
}
.bank-bal-save {
  background: var(--green-soft);
  color: var(--green-dark);
}
.bank-bal-save strong {
  color: var(--green-dark);
}
.bank-bal-total {
  background: var(--yellow-soft);
  color: var(--ink);
}
.bank-give {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.bank-give h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.bank-give-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.bank-spend-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 0;
  padding: 0;
  margin: 0 0 10px;
}
.bank-spend-cats legend {
  font-weight: 700;
  margin-bottom: 6px;
  width: 100%;
}
.bank-cat {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  cursor: pointer;
  font-size: 0.9rem;
}
.bank-cat:has(input:checked) {
  outline: 2px solid var(--green);
  background: var(--green-soft);
  color: var(--ink);
}
.bank-budget-hint.is-ok {
  color: var(--green-dark);
  font-weight: 700;
}
.bank-budget-hint.is-bad {
  color: var(--red);
  font-weight: 700;
}
.fb-hero .coin-big {
  background: radial-gradient(circle at 35% 30%, var(--green-soft), var(--green) 70%);
  box-shadow: 0 0 0 6px color-mix(in srgb, var(--green) 18%, transparent), 0 10px 24px rgba(0, 0, 0, 0.2);
}
.fb-savings {
  border-top: 5px solid var(--green-fill);
}
.fb-savings-bal {
  font-size: 1.35rem;
  margin: 0 0 8px;
}
.fb-deposits {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.85rem;
  color: var(--muted);
}
.fb-deposits li {
  padding: 4px 0;
  border-top: 1px solid var(--line);
}
.fb-takeout {
  border-top: 5px solid var(--yellow);
  margin-bottom: 22px;
}
@media (max-width: 640px) {
  .bank-give-row,
  .bank-balances {
    grid-template-columns: 1fr;
  }
}

.coin-history {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.coin-history li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.coin-history-icon {
  font-size: 1.3rem;
}
.coin-history-text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.coin-history-text small {
  color: var(--muted);
  font-size: 0.75rem;
}
.coin-history-mini li {
  padding: 6px 8px;
}
.coin-history-mini .coin-history-text small {
  display: none;
}
.coin-statement .bank-ledger-head {
  margin-bottom: 10px;
}
.coin-amount {
  font-weight: 900;
  white-space: nowrap;
}
.coin-amount.plus {
  color: var(--green-dark);
}
.coin-amount.minus {
  color: var(--red);
}

body.kid-lock {
  padding-bottom: 4.5rem;
}
.stay-bar {
  position: sticky;
  bottom: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  background: var(--band-leaf);
  color: var(--on-band-leaf);
  box-shadow: 0 -6px 20px rgba(38, 52, 25, 0.2);
}
.stay-bar p {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 700;
}
.stay-bar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}
.stay-bar .btn {
  flex-shrink: 0;
  background: var(--on-band-leaf);
  color: var(--band-leaf);
  border-color: var(--on-band-leaf);
}
.stay-bar .stay-logout {
  background: transparent;
  color: var(--on-band-leaf);
  border-color: color-mix(in srgb, var(--on-band-leaf) 60%, transparent);
}
.stay-bar .stay-logout:hover {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  border-color: #fff;
}
.welcome-logout {
  margin: 12px 0 0;
}
.grownup-link {
  font-size: 1.15rem;
}
@media (display-mode: standalone), (display-mode: fullscreen) {
  .install-hint {
    display: none;
  }
}
  text-align: center;
}
.parent-lock .form {
  text-align: left;
}
.parent-lock-icon {
  font-size: 2.6rem;
}
.bank-children {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}
.bank-child-head {
  display: flex;
  align-items: center;
  gap: 12px;
}
.bank-child-head h2 {
  margin: 0;
}
.coin-line {
  margin: 0;
  font-size: 1.1rem;
}
.bank-request {
  margin: 10px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--yellow-soft);
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.bank-request .actions {
  margin-top: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.bank-request form,
.head-actions form {
  margin: 0;
}
.bank-more summary {
  cursor: pointer;
  color: var(--green-dark);
  font-weight: 800;
}
.bank-hero-head h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}
.bank-savings-payout {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 4px;
}
.bank-savings-payout h3 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}
.fb-savings-lock {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 600;
}
.fb-step {
  margin: 0 0 6px;
  font-size: 0.8rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--green-dark);
}
.bank-book {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin: 12px 0;
}
.bank-book h3 {
  margin: 0 0 4px;
}
.bank-book-step {
  margin: 12px 0;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  color: var(--ink);
}
.bank-book-approve {
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--yellow-soft);
  color: var(--ink);
  border: 1px solid var(--line);
}
.bank-sign {
  display: grid;
  gap: 10px;
  width: 100%;
  margin-top: 8px;
}
.bank-sign-form {
  display: grid;
  gap: 6px;
}
.bank-sign-label {
  font-size: 0.85rem;
}
.fb-book-cta {
  border-top: 5px solid var(--green);
  margin-bottom: 22px;
}
.fb-top {
  margin-bottom: 22px;
}
.bank-hero-head h1 {
  font-size: clamp(1.8rem, 4vw, 2.4rem);
}
.fb-savings-lock {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 600;
}
.bank-main {
  margin-bottom: 18px;
}
.kid-picker,
.deed-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: 0;
}
.kid-picker legend,
.deed-picker legend {
  margin-bottom: 6px;
  font-weight: 700;
}
.deed-picker {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.form .kid-option,
.form .deed-option {
  display: block;
}
.kid-option input,
.deed-option input {
  position: absolute;
  opacity: 0;
}
.kid-option span,
.deed-option span {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--ink);
  cursor: pointer;
}
.kid-option span {
  flex-direction: row;
  border-radius: 999px;
  font-weight: 800;
}
.deed-option small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
}
.kid-option input:checked + span,
.deed-option input:checked + span {
  border-color: var(--green);
  background: var(--green-soft);
}
.kid-option input:focus-visible + span,
.deed-option input:focus-visible + span {
  outline: 3px solid var(--yellow);
}
.deed-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.bank-table td {
  white-space: normal;
}
.bank-ledger-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.bank-ledger-head h2 {
  margin: 0 0 2px;
}
.bank-ledger-head .tiny {
  margin: 0;
}
.bank-ledger-tabs {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--bg-3);
}
.bank-ledger-tab {
  padding: 7px 14px;
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.bank-ledger-tab.is-active {
  background: var(--green-soft);
  color: var(--green-dark);
}
.bank-ledger-tab:hover {
  color: var(--ink);
}
.bank-mini-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.bank-mini-list li {
  display: grid;
  grid-template-columns: 4.2rem 5.5rem minmax(0, 1fr) auto;
  gap: 8px 10px;
  align-items: baseline;
  padding: 8px 0;
  border-top: 1px solid var(--line);
  font-size: 0.92rem;
}
.bank-mini-list li:first-child {
  border-top: 0;
  padding-top: 0;
}
.bank-mini-when {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 600;
}
.bank-mini-who {
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.bank-mini-what {
  color: var(--ink);
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bank-mini-amt {
  font-weight: 800;
  white-space: nowrap;
  justify-self: end;
}
.bank-ledger-more {
  margin: 12px 0 0;
  font-weight: 700;
}
.bank-ledger-more a {
  color: var(--green-dark);
  text-decoration: none;
}
.bank-ledger-more a:hover {
  text-decoration: underline;
}
@media (max-width: 640px) {
  .bank-mini-list li {
    grid-template-columns: 3.6rem minmax(0, 1fr) auto;
    grid-template-areas:
      'when who amt'
      'what what what';
  }
  .bank-mini-when { grid-area: when; }
  .bank-mini-who { grid-area: who; }
  .bank-mini-what { grid-area: what; }
  .bank-mini-amt { grid-area: amt; }
}
@media (max-width: 560px) {
  .coin-hero {
    flex-direction: column;
    text-align: center;
  }
  .coin-chips {
    justify-content: center;
  }
  .deed-picker,
  .deed-row {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ============ Good habits ============ */
.habits-card {
  margin-bottom: 18px;
  border-top: 5px solid var(--yellow);
}
.habits-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.habits-head h2 {
  margin-bottom: 2px;
}
.habit-day-picker {
  margin: 0;
}
.habit-day-picker label {
  display: grid;
  gap: 2px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}
.habit-day-picker select {
  width: auto;
  padding: 6px 10px;
}
.habit-grid {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}
.habit-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
}
.habit-row form {
  margin: 0;
}
.habit-kid {
  min-width: 110px;
  font-weight: 900;
}
.habit-btn {
  display: grid;
  grid-template-columns: auto auto;
  grid-template-rows: auto auto;
  column-gap: 8px;
  align-items: center;
  min-width: 128px;
  padding: 8px 14px;
  border: 2px dashed var(--line);
  border-radius: 14px;
  background: var(--card-bg);
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.habit-btn:hover {
  border-color: var(--yellow);
}
.habit-emoji {
  grid-row: 1 / span 2;
  font-size: 1.6rem;
}
.habit-name {
  font-weight: 800;
}
.habit-btn small {
  color: var(--yellow-ink);
  font-weight: 800;
}
.habit-btn.is-done {
  border: 2px solid var(--green);
  background: var(--green-soft);
}
.habit-btn.is-done small {
  color: var(--green-dark);
}
.habit-lastweek .link-button {
  font-size: 0.8rem;
}
.habit-rules {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 12px 0 0;
  border: 0;
  border-top: 1px dashed var(--line);
}
.habit-rules legend {
  font-weight: 800;
}
.habits-mine {
  margin: 18px 0 0;
}
.habit-strips {
  display: grid;
  gap: 12px;
}
.habit-strip-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}
.habit-dots {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  max-width: 420px;
}
.habit-dot {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  max-width: 44px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: var(--card-bg);
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 800;
}
.habit-dot.is-done {
  border-color: #ffc629;
  background: #ffc629;
  color: #3a2c00;
  font-size: 1rem;
}
.habit-dot.is-today:not(.is-done) {
  border-style: dashed;
  border-color: var(--yellow);
}
.habit-dot.is-future {
  opacity: 0.5;
}
.peace-line {
  margin: 14px 0 0;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: #e8f4fb;
}
.peace-line.is-done {
  background: var(--green-soft);
  color: var(--green-dark);
}
/* Phones: each child's three habits sit side by side as compact tiles. */
@media (max-width: 560px) {
  .habit-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
  }
  .habit-kid,
  .habit-lastweek {
    grid-column: 1 / -1;
  }
  .habit-btn {
    width: 100%;
    min-width: 0;
    height: 100%;
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    padding: 8px 4px;
    text-align: center;
  }
  .habit-emoji {
    grid-row: auto;
  }
  .habit-name {
    font-size: 0.8rem;
    line-height: 1.2;
  }
  .habit-btn small {
    font-size: 0.72rem;
  }
}

/* Subject grids adapt to how many subjects a group has (3 core, 4 future skills). */
.subject-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

/* ============ Tech Lab ============ */
.robot-app {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
@media (max-width: 860px) {
  .robot-app {
    grid-template-columns: minmax(0, 1fr);
  }
}
.robot-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.robot-top h2 {
  margin: 0;
  font-size: 1.1rem;
}
.robot-levels {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.robot-level {
  padding: 4px 10px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--ink);
  font: inherit;
  font-size: 0.85rem;
  font-weight: 800;
  cursor: pointer;
}
.robot-level.is-current {
  border-color: var(--green);
  background: var(--green-soft);
}
.robot-board {
  display: grid;
  grid-template-columns: repeat(var(--cols), minmax(0, 1fr));
  gap: 4px;
  max-width: 420px;
  margin: 0 auto;
  padding: 8px;
  border-radius: 16px;
  background: #e9dcc2;
}
.robot-cell {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border-radius: 10px;
  background: var(--bg-2);
  font-size: clamp(1.1rem, 5vw, 1.9rem);
}
.robot-cell.is-rock {
  background: #d8c8a8;
}
.robot-cell.is-water {
  background: #cdeed8;
}
.robot-cell.has-robot {
  background: #fff4d1;
}
.robot-arrow {
  position: absolute;
  right: 4px;
  bottom: 2px;
  color: var(--green-dark);
  font-size: 0.8rem;
  font-weight: 900;
}
.robot-message {
  min-height: 2.6em;
  margin: 12px 0 0;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-weight: 700;
}
.robot-message.is-win {
  background: var(--green-soft);
  color: var(--green-dark);
}
.robot-message.is-warn {
  background: var(--yellow-soft);
  color: var(--yellow-ink);
}
.robot-program {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 60px;
  padding: 10px;
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
}
.robot-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: #e2e8f0;
  font-size: 0.85rem;
  font-weight: 800;
}
.robot-chip.is-empty,
.robot-chip.is-hint {
  background: none;
  color: var(--muted);
  font-weight: 600;
}
.robot-chip.is-loop {
  background: #2f9a5d;
  color: #fff;
}
.robot-loop {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 4px;
  border: 2px solid #2f9a5d;
  border-radius: 14px;
}
.robot-loop.is-open {
  border-style: dashed;
}
.robot-buttons {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}
.robot-times {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
}
.robot-times select {
  width: auto;
  padding: 4px 8px;
}
.robot-help {
  margin-top: 18px;
}
.pw-label {
  display: block;
  margin-bottom: 6px;
  font-weight: 800;
}
.pw-row {
  display: flex;
  gap: 8px;
}
.pw-bar {
  height: 14px;
  margin: 14px 0 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--bg-3);
}
.pw-bar span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  transition: width 0.3s ease;
}
.pw-weak {
  background: var(--red);
}
.pw-okay {
  background: #f59e0b;
}
.pw-strong {
  background: #22a35a;
}
.pw-great {
  background: linear-gradient(90deg, #22a35a, #2f9a5d);
}
.pw-level {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 900;
}
.pw-tips,
.pw-rules {
  padding-left: 1.2em;
}
.pw-rules {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 6px;
}
.pw-idea {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-family: ui-monospace, 'Cascadia Code', 'Courier New', monospace;
  font-size: 1.15rem;
  font-weight: 800;
  overflow-wrap: anywhere;
}
.ai-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}
.ai-toolbar .is-active {
  border-color: var(--green);
  background: var(--green-soft);
}
.ai-chart-wrap {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 4px 8px;
  align-items: center;
}
.ai-axis {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}
.ai-axis-y {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
}
.ai-axis-x {
  grid-column: 2;
  text-align: right;
}
.ai-chart {
  position: relative;
  aspect-ratio: 1;
  max-width: 460px;
  width: 100%;
  overflow: hidden;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, var(--yellow-soft), var(--business-soft));
  cursor: crosshair;
}
.ai-map {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: repeat(16, 1fr);
}
.ai-map-cell.is-mango {
  background: rgba(245, 150, 30, 0.28);
}
.ai-map-cell.is-lemon {
  background: rgba(250, 220, 40, 0.3);
}
.ai-lines {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.ai-line {
  stroke-width: 0.6;
  stroke-dasharray: 2 1.5;
}
.ai-line.is-mango {
  stroke: #d97706;
}
.ai-line.is-lemon {
  stroke: #ca8a04;
}
.ai-points {
  position: absolute;
  inset: 0;
}
.ai-point {
  position: absolute;
  transform: translate(-50%, -50%);
  font-size: 1.5rem;
  pointer-events: none;
}
.ai-guess {
  padding: 2px 6px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: var(--card-bg);
  color: var(--ink);
  font-size: 1.1rem;
  animation: pop-in 0.3s ease;
}
.ai-message {
  min-height: 2.6em;
  margin: 12px 0 4px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-weight: 700;
}
.ai-steps {
  padding-left: 1.2em;
}
.ai-steps li {
  margin-bottom: 6px;
}

.level.is-locked {
  opacity: 0.6;
  background: var(--bg-2);
  border-style: dashed;
}
.grade-warning {
  color: #9a3412;
  font-weight: 800;
}

/* ============ School time ============ */
.time-chip {
  background: var(--green-soft);
  border-color: color-mix(in srgb, var(--green-fill) 45%, var(--line));
  color: var(--green-dark);
}
.time-chip-low,
.time-board.time-chip-low {
  background: var(--yellow-soft);
  border-color: #f3dc8f;
  color: var(--yellow-ink);
}
.time-chip-last,
.time-board.time-chip-last {
  background: var(--red-soft);
  border-color: #f5c2c2;
  color: var(--red);
  animation: time-pulse 1.6s ease-in-out infinite;
}
@keyframes time-pulse {
  50% {
    opacity: 0.55;
  }
}
@media (prefers-reduced-motion: reduce) {
  .time-chip-last,
  .time-board.time-chip-last {
    animation: none;
  }
}

/* Big standalone timer for the selected child — alone above the lesson. */
.time-board {
  display: grid;
  justify-items: center;
  gap: 2px;
  margin: 12px 20px 0;
  padding: 18px 20px 16px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--green);
  border-radius: var(--radius);
  background: var(--green-soft);
  color: var(--green-dark);
  text-align: center;
}
.time-board-label {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.85;
}
.time-board-clock {
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 0.2em;
  font-size: clamp(3.2rem, 10vw, 5rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
}
.time-board-unit {
  font-size: 0.38em;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.time-board.time-chip-low {
  border-top-color: var(--yellow);
}
.time-board.time-chip-last {
  border-top-color: var(--red);
}
@media (max-width: 860px) {
  .time-board {
    margin: 10px 12px 0;
    padding: 14px 16px 12px;
  }
}
.timeup .btn-big {
  margin-top: 6px;
}
.timeup-tally {
  list-style: none;
  margin: 18px auto;
  padding: 14px 18px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg);
  max-width: 420px;
}
.timeup-tally strong {
  font-size: 1.15rem;
}
.pace-set {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  border: 0;
  padding: 0;
  margin: 0;
  width: 100%;
}
.pace-set legend {
  padding: 0;
  margin-bottom: 6px;
}
.time-today {
  list-style: none;
  margin: 16px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
}
.time-today li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.time-today .tag {
  background: var(--red-soft);
  color: var(--red);
  margin-left: 6px;
}

/* ============ How to play ============ */
.how-to {
  margin: 0 0 18px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green);
  border-radius: var(--radius-sm);
  background: var(--green-soft);
}
.how-to p {
  margin: 0;
  font-size: 1.02rem;
}
.how-steps {
  margin: 8px 0 0;
  padding-left: 22px;
  display: grid;
  gap: 3px;
}
.how-steps li {
  font-size: 0.97rem;
}
.quiz .how-to {
  margin-top: 12px;
}

/* ============ Plans and prices ============ */
.plans-hero {
  padding: 36px 0 8px;
  max-width: 36rem;
}
.plans-hero h1 {
  font-size: clamp(2rem, 4.5vw, 3rem);
  margin: 0 0 0.35em;
}
.plans-hero .lead {
  margin: 0;
  color: var(--muted);
  font-size: 1.08rem;
}
.plan-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
  margin: 36px 0 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.plan {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 0;
  padding: 36px 28px 28px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--talent);
  border-radius: var(--radius);
  box-shadow: none;
  background: var(--bg-2);
}
.plan:nth-child(3n + 2) {
  border-top-color: var(--green);
}
.plan:nth-child(3n + 3) {
  border-top-color: var(--yellow);
}
.plan:last-child {
  border-right: 1px solid var(--line);
  background: var(--bg-2);
}
.plan.is-popular {
  background: color-mix(in srgb, var(--green-soft) 55%, var(--bg-2) 45%);
  border-color: var(--green);
  border-top-color: var(--green);
  box-shadow: 0 10px 28px rgba(26, 143, 75, 0.1);
}
.plan-flag {
  position: absolute;
  top: -13px;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  background: var(--green-fill);
  color: var(--on-green);
  border-radius: 999px;
  padding: 3px 14px;
  font-size: 0.8rem;
  font-weight: 800;
  white-space: nowrap;
}
.plan h2 {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.plan-price {
  margin: 4px 0 0;
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}
.plan-price strong {
  font-size: 2.4rem;
  line-height: 1;
  letter-spacing: -0.03em;
}
.plan-per {
  color: var(--muted);
  font-weight: 500;
}
.plan-year {
  margin: 0;
  font-size: 0.88rem;
  color: var(--muted);
}
.plan-tagline {
  margin: 4px 0 0;
  color: var(--ink);
  font-weight: 500;
  font-size: 0.98rem;
}
.plan-children {
  margin: 8px 0 0;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.92rem;
}
.plan-children strong {
  color: var(--ink);
  font-size: 1.05rem;
}
.plan.is-popular .plan-children {
  border-bottom-color: rgba(17, 112, 58, 0.18);
}
.plan-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
  flex: 1;
}
.plan-list li {
  padding-left: 22px;
  position: relative;
  font-size: 0.92rem;
  color: var(--ink);
}
.plan-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
}
.plan-cta {
  margin-top: auto;
  padding-top: 20px;
}
.plan-cta .btn {
  width: 100%;
  text-align: center;
}
.plan-current {
  margin: 0;
  font-weight: 800;
  color: var(--green-dark);
}
.plans-promises {
  margin: 40px 0 0;
  padding: 28px 0 0;
  border-top: 1px solid var(--line);
}
.plans-promises h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.plans-promise-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}
.plans-promise-grid article {
  padding: 20px 28px 8px 0;
  border-right: 1px solid var(--line);
}
.plans-promise-grid article:last-child {
  border-right: 0;
  padding-right: 0;
  padding-left: 28px;
}
.plans-promise-grid article:nth-child(2) {
  padding-left: 28px;
}
.plans-promise-grid h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.plans-promise-grid p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}
.plans-partner {
  margin: 28px 0 0;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green-fill);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  max-width: 40rem;
}
.plans-partner h2 {
  margin: 0 0 6px;
  font-size: 1.15rem;
}
.plans-partner p {
  margin: 0;
}
.plans-pay {
  margin: 28px 0 8px;
  padding: 28px 0 0;
  border-top: 1px solid var(--line);
  max-width: 40rem;
}
.plans-pay h2 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.plans-pay p:last-child {
  margin-bottom: 0;
}
@media (max-width: 960px) {
  .plan-grid,
  .plans-promise-grid {
    grid-template-columns: 1fr;
  }
  .plan,
  .plan:last-child {
    border-right: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
  }
  .plans-promise-grid article,
  .plans-promise-grid article:nth-child(2),
  .plans-promise-grid article:last-child {
    padding: 16px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .plans-promise-grid article:last-child {
    border-bottom: 0;
  }
}
.plan-contact {
  font-size: 1.05rem;
}
.plans-teaser {
  text-align: center;
}
.plans-teaser h2 {
  margin-top: 0;
}

/* ============ Keeping the tablet in school ============ */
.stay-card h3 {
  margin: 18px 0 4px;
  font-size: 1.02rem;
}
.stay-card h3:first-of-type {
  margin-top: 12px;
}
.stay-form {
  gap: 10px;
}
.pin-steps {
  margin: 6px 0 0;
  padding-left: 20px;
  display: grid;
  gap: 8px;
}
.pin-steps li {
  line-height: 1.5;
}

/* ============ Admin ============ */
.admin-tiles .tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: center;
}
.tile-value {
  font-size: 2rem;
  font-weight: 900;
  line-height: 1.1;
}
.tile-label {
  color: var(--muted);
  font-weight: 700;
  font-size: 0.9rem;
}
.admin-list {
  list-style: none;
  margin: 10px 0 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.admin-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
}
.admin-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}
.admin-search {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
}
.admin-search input {
  flex: 1;
  min-width: 220px;
}
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}
.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.admin-table th {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.admin-table tr:last-child td {
  border-bottom: 0;
}
.provider-keys {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
.provider-keys h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.mono {
  font-family: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 0.95rem;
  line-height: 1.6;
}
.device-card {
  margin-bottom: 16px;
}
.device-card h2 {
  margin-top: 0;
}
.kiosk-line {
  display: block;
  margin: 6px 0;
  padding: 8px 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  word-break: break-all;
}
.leave-note {
  background: var(--red-soft);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
}

/* ============ The note for families ============ */
.note-lead {
  max-width: 620px;
  margin: 0 auto 18px;
}
.note-grid {
  align-items: stretch;
}
.note-card h3 {
  margin: 0 0 10px;
  font-size: 1.15rem;
}
.note-card ul {
  margin: 0;
  padding-left: 20px;
  display: grid;
  gap: 9px;
}
.note-card li {
  line-height: 1.5;
}
.note-foot {
  margin-top: 18px;
  font-size: 1.05rem;
}
.limit-cell {
  width: 90px;
}
.switch-cell {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
}
.plan-table td:not(:first-child),
.plan-table th:not(:first-child) {
  text-align: center;
}

/* ============ Show and hide a password ============ */
.pw-wrap {
  position: relative;
  display: block;
}
.pw-wrap input {
  width: 100%;
  padding-right: 46px;
}
.pw-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  border: 0;
  background: none;
  color: var(--muted);
  line-height: 0;
  padding: 6px 8px;
  cursor: pointer;
  border-radius: 8px;
}
.pw-eye[aria-pressed='true'] {
  color: var(--green-dark);
}
.pw-eye:hover {
  background: var(--bg);
  color: var(--ink);
}
.pw-eye:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 1px;
}

/* ============ A child's own picture ============ */
.face {
  display: inline-block;
  vertical-align: middle;
}
img.face {
  width: 1.6em;
  height: 1.6em;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
}
img.face-small {
  width: 1.5em;
  height: 1.5em;
}
img.face-big {
  width: 100%;
  height: 100%;
  max-width: 96px;
  max-height: 96px;
}
.photo-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 18px;
  background: var(--bg);
}
.photo-card h2 {
  margin: 0 0 10px;
  font-size: 1.05rem;
}
.photo-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  flex-wrap: wrap;
}
.photo-now {
  position: relative;
  width: 96px;
  height: 96px;
  border-radius: 50%;
  background: var(--surface);
  border: 2px solid var(--line);
  display: grid;
  place-items: center;
  overflow: hidden;
  flex: none;
}
.photo-now img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.photo-emoji {
  font-size: 2.6rem;
  line-height: 1;
}
.photo-actions {
  flex: 1;
  min-width: 200px;
  display: grid;
  gap: 6px;
  align-content: start;
}
.photo-pick {
  justify-self: start;
  cursor: pointer;
}

/* ============ Putting the school on the device ============ */
.install-bar {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 60;
  margin: 0 auto;
  max-width: 560px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-top: 4px solid var(--green);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(36, 48, 68, 0.18);
  padding: 16px 18px;
  display: grid;
  gap: 8px;
  animation: install-in 0.35s ease;
}
@keyframes install-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
.install-bar p {
  margin: 0;
}
.install-title {
  font-size: 1.05rem;
  color: var(--green-dark);
}
.install-why {
  color: var(--muted);
  line-height: 1.45;
}
.install-step {
  display: inline-block;
  padding: 6px 10px;
  border-radius: 10px;
  background: var(--green-soft);
  color: var(--green-dark);
  font-weight: 700;
  font-size: 0.9rem;
}
.install-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 4px;
}
body.kid-lock .install-bar {
  display: none;
}
@media (max-width: 520px) {
  .install-bar {
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
  }
}

/* ============ Reading and editing lessons ============ */
.stage-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}
.review-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.review-list a,
.review-list .is-readonly {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  text-decoration: none;
  color: inherit;
}
.review-list a:hover {
  border-color: var(--green);
}
.review-list .is-readonly {
  background: var(--bg);
  opacity: 0.85;
}
.review-num {
  font-weight: 900;
  color: var(--muted);
  min-width: 1.6em;
}
.review-main {
  flex: 1;
}
.review-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.steps-edit {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}
.step-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 8px;
}
.step-row textarea {
  flex: 1;
}
.step-num {
  font-weight: 900;
  color: var(--muted);
  padding-top: 10px;
  min-width: 1.4em;
}

/* ============ The weekly test ============ */
.exam-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin: -8px 0 18px;
  padding: 10px 16px;
  border-radius: var(--radius);
  background: var(--green-soft);
  border: 1px solid color-mix(in srgb, var(--green-fill) 45%, var(--line));
}
.exam-clock {
  font-size: 1.6rem;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  color: var(--green-dark);
}
.exam-bar.is-low {
  background: var(--yellow-soft);
  border-color: #f3dc8f;
}
.exam-bar.is-low .exam-clock {
  color: var(--yellow-ink);
}
.exam-bar.is-last {
  background: var(--red-soft);
  border-color: #f5c2c2;
}
.exam-bar.is-last .exam-clock {
  color: var(--red);
}
.exam-note {
  color: var(--muted);
  font-weight: 700;
}
.exam-review {
  display: grid;
  gap: 10px;
  padding-left: 20px;
}
.exam-review li.is-wrong strong {
  color: var(--red);
}

/* ============ Certificate ============ */
.certificate {
  background: var(--surface);
  border: 3px double var(--green);
  border-radius: var(--radius);
  padding: 34px 28px;
  text-align: center;
  max-width: 760px;
  margin: 0 auto;
}
.cert-school {
  font-weight: 900;
  letter-spacing: 0.02em;
  margin: 0 0 10px;
}
.cert-school span {
  color: var(--muted);
  font-weight: 700;
}
.certificate h1 {
  margin: 0 0 6px;
  font-size: 1.9rem;
}
.cert-awarded {
  color: var(--muted);
  margin: 0;
}
.cert-name {
  font-size: 2.1rem;
  font-weight: 900;
  margin: 6px 0 14px;
  border-bottom: 2px solid var(--line);
  display: inline-block;
  padding: 0 24px 6px;
}
.cert-body {
  max-width: 520px;
  margin: 0 auto 14px;
}
.cert-grade {
  font-size: 1.3rem;
  font-weight: 900;
  margin: 0 0 16px;
}
.cert-subjects {
  width: 100%;
  max-width: 460px;
  margin: 0 auto 16px;
  border-collapse: collapse;
  font-size: 0.92rem;
}
.cert-subjects th,
.cert-subjects td {
  border-bottom: 1px solid var(--line);
  padding: 5px 8px;
  text-align: left;
}
.cert-subjects th:not(:first-child),
.cert-subjects td:not(:first-child) {
  text-align: right;
}
.cert-meta {
  color: var(--muted);
  font-size: 0.9rem;
}
.cert-signatures {
  display: flex;
  gap: 30px;
  justify-content: center;
  margin: 26px 0 10px;
}
.cert-signatures div {
  display: grid;
  gap: 4px;
}
.cert-line {
  display: block;
  width: 170px;
  border-bottom: 1px solid var(--ink);
  height: 26px;
}
.cert-note {
  color: var(--muted);
  font-size: 0.82rem;
  max-width: 520px;
  margin: 12px auto 0;
}
@media print {
  .topbar,
  .site-footer,
  .no-print,
  .stay-bar,
  .install-bar {
    display: none !important;
  }
  .certificate {
    border-color: #111;
  }
}

/* ============ Two navigations: a top bar for grown-ups, a side rail for children ============ */
.shell-main {
  min-width: 0; /* so a long word in a lesson cannot push the rail off the screen */
}
.has-rail {
  display: flex;
  align-items: flex-start;
  gap: 0;
}
.has-rail .shell-main {
  flex: 1;
}
.rail {
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  width: 216px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 12px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  overflow-y: auto;
}
.rail-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  padding: 4px 8px 10px;
}
.rail-nav {
  display: grid;
  gap: 4px;
}
.rail-nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
}
.rail-nav a:hover {
  background: var(--bg);
}
.rail-nav a.active {
  background: var(--green-soft);
  color: var(--green-dark);
  box-shadow: inset 0 0 0 2px var(--green);
}
.rail-emoji {
  font-size: 1.5rem;
  line-height: 1;
}
.rail-icon {
  width: 20px;
  height: 20px;
  flex: none;
}
.rail-me {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  justify-items: start;
}
.rail-who {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
  font-weight: 800;
}

/* Grown-up navs (family dashboard, public site): the panel that a hamburger opens on a phone.
   On desktop it's just a pass-through wrapper, so the rail's own flex layout (nav on top,
   rail-me pinned to the bottom via margin-top: auto) is unaffected. */
.rail-toggle {
  display: none;
}
.rail-panel {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}
.rail-panel-sheet {
  display: contents;
}

/* A phone has no room for a rail, and a thumb lives at the bottom. Kids keep a bottom tab bar
   (fewer items, big icons); grown-up navs get a hamburger menu further down. */
@media (max-width: 860px) {
  .has-rail {
    display: block;
  }
  .kids-site .rail {
    position: fixed;
    inset: auto 0 0 0;
    flex-direction: row;
    align-items: center;
    height: auto;
    width: auto;
    gap: 2px;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0;
    border-top: 1px solid var(--line);
    box-shadow: 0 -2px 14px rgba(29, 36, 51, 0.08);
    z-index: 35;
    overflow-x: auto;
  }
  .kids-site .rail-brand {
    display: none;
  }
  .kids-site .rail-nav {
    display: flex;
    gap: 2px;
    flex: 1;
  }
  .kids-site .rail-nav a {
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px;
    font-size: 0.7rem;
    text-align: center;
    white-space: nowrap;
  }
  .kids-site .rail-logout-btn {
    flex-direction: column;
    gap: 2px;
    padding: 6px 10px;
    font-size: 0.7rem;
    text-align: center;
    white-space: nowrap;
  }
  .kids-site .rail-emoji {
    font-size: 1.35rem;
  }
  .kids-site .rail-icon {
    width: 18px;
    height: 18px;
  }
  .kids-site .rail-me {
    margin: 0;
    padding: 0 0 0 8px;
    border-top: 0;
    border-left: 1px solid var(--line);
    grid-auto-flow: column;
    align-items: center;
    gap: 6px;
  }
  .kids-site .rail-me .rank-chip-unit,
  .kids-site .rail-me .me-name {
    display: none;
  }
  .kids-site .has-rail .shell-main {
    padding-bottom: 76px; /* room above the bar */
  }
  .kids-site .has-rail .stay-bar {
    bottom: 76px;
  }
}

/* Family dashboard + public site: a compact top bar with a hamburger, instead of a bottom
   bar crammed with 7-8 tiny labels. */
@media (max-width: 860px) {
  .family-site .rail {
    position: fixed;
    inset: 0 0 auto 0;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    height: auto;
    width: auto;
    gap: 8px;
    padding: calc(10px + env(safe-area-inset-top)) 14px 10px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 2px 14px rgba(29, 36, 51, 0.08);
    z-index: 40;
  }
  .family-site .rail-brand {
    position: relative;
    z-index: 2;
    padding: 0;
  }
  .family-site .rail-toggle {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    flex: none;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: var(--bg);
    color: var(--ink);
    cursor: pointer;
  }
  .family-site .rail-toggle-close {
    display: none;
  }
  .family-site .rail.is-open .rail-toggle-open {
    display: none;
  }
  .family-site .rail.is-open .rail-toggle-close {
    display: inline-flex;
  }
  .family-site .rail-panel {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1;
    background: rgba(15, 20, 28, 0.45);
  }
  .family-site .rail.is-open .rail-panel {
    display: block;
  }
  .family-site .rail-panel-sheet {
    display: block;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    max-height: 85vh;
    overflow-y: auto;
    padding: 64px 14px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(29, 36, 51, 0.18);
  }
  .family-site .rail-nav {
    display: grid;
    gap: 4px;
  }
  .family-site .rail-me {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
  }
  .family-site .public-rail .rail-panel-sheet .fam-lang {
    display: none; /* already shown at the top of the page for visitors */
  }
  .has-rail .shell-main {
    padding-top: 64px; /* room below the fixed top bar */
  }
}

.family-rail {
  width: 228px;
  background: var(--bg-3);
  color: var(--ink);
  border-right: 1px solid var(--line);
}
.family-rail .rail-nav a {
  font-weight: 500;
  color: var(--ink);
}
.family-rail .rail-nav a:hover {
  background: var(--green-soft);
}
.family-rail .rail-nav a.active {
  background: var(--green-soft);
  color: var(--green-dark);
  box-shadow: inset 0 0 0 2px var(--green);
}
.family-rail .link-button {
  color: var(--muted);
}
.rail-logout {
  margin: 0;
  padding: 0;
  border: 0;
}
.rail-logout-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 11px 12px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 500;
  text-align: left;
  cursor: pointer;
}
.rail-logout-btn:hover {
  background: var(--green-soft);
  color: var(--green-dark);
}
.family-rail .rail-logout-btn {
  color: var(--ink);
}
.fam-lang {
  display: flex;
  width: 100%;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: var(--bg);
}
.fam-lang-opt {
  flex: 1;
  padding: 7px 8px;
  text-align: center;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.fam-lang-opt.is-on {
  background: var(--green-soft);
  color: var(--green-dark);
}
.fam-lang-top {
  display: none;
}
@media (max-width: 860px) {
  .fam-lang-top {
    display: flex;
    width: auto;
    max-width: 180px;
    margin: 0 0 36px auto; /* the hero below pulls itself up by 24px */
  }
}
.kids-door {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: var(--action);
  border: 1px solid var(--action);
  color: var(--on-action);
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  box-shadow: none;
}
.kids-door:hover {
  background: var(--action-hover);
  border-color: var(--action-hover);
  color: var(--on-action);
}
.btn-kids {
  background: var(--action);
  border-color: var(--action);
  box-shadow: none;
  color: var(--on-action);
}
.btn-kids:hover {
  background: var(--action-hover);
  border-color: var(--action-hover);
  color: var(--on-action);
}
.btn-kids:active {
  box-shadow: none;
}
.btn-huge {
  padding: 14px 24px;
  font-size: 1.05rem;
}

/* ============ Family setup hub ============ */
.setup-hero {
  padding: 28px 0 8px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.setup-hero h1 {
  margin: 0 0 0.25em;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  color: var(--green-dark);
}
.setup-hero .lead {
  margin: 0;
  max-width: 36rem;
  color: var(--muted);
}
.setup-tutor-note {
  margin: 14px 0 0;
  max-width: 40rem;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--ink);
  font-size: 0.95rem;
  line-height: 1.4;
}
.setup-empty {
  padding: 40px 0;
  text-align: center;
}
.setup-tiles {
  display: grid;
  /* However many tools there are, they share one row; on a narrow screen they wrap two by two. */
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 36px;
}
.setup-tile {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--talent);
  border-radius: var(--radius);
  background: var(--bg-2);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease;
}
.setup-tiles .setup-tile:nth-child(3n + 2) {
  border-top-color: var(--green);
}
.setup-tiles .setup-tile:nth-child(3n + 3) {
  border-top-color: var(--yellow);
}
.setup-tile:hover {
  border-color: var(--green);
  border-top-color: var(--green);
  background: var(--green-soft);
  transform: translateY(-2px);
}
.setup-tile-go {
  background: var(--action);
  border-color: var(--action);
  border-top-color: var(--action-hover);
  color: var(--on-action);
}
.setup-tile-go:hover {
  background: var(--action-hover);
  border-color: var(--action-hover);
  border-top-color: var(--action-hover);
  color: var(--on-action);
}
.setup-tile-mark {
  font-size: 1.6rem;
  line-height: 1;
  margin-bottom: 4px;
}
.setup-tile strong {
  font-size: 1.1rem;
  font-weight: 700;
}
.setup-tile span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.35;
}
/* Must follow .setup-tile span — muted must never win on the green door. */
.setup-tile-go,
.setup-tile-go:hover,
.setup-tile-go strong,
.setup-tile-go span {
  color: var(--on-action);
}
.setup-kids h2 {
  margin: 0 0 14px;
  font-size: 1.2rem;
}
.setup-kid-list {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  overflow: hidden;
}
.setup-kid {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.setup-kid:last-child {
  border-bottom: 0;
}
.setup-kid-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.setup-kid-main strong {
  display: block;
}
.setup-kid-main .muted {
  font-size: 0.88rem;
}
.setup-kid-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ============ Kids world landing ============ */
.kids-site .container {
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}
.kids-rail {
  background: linear-gradient(180deg, var(--bg-3) 0%, var(--surface) 100%);
  color: var(--ink);
}
.kids-rail .rail-nav a {
  color: var(--ink);
}
.kids-rail .rail-brand {
  color: var(--ink);
}
.kids-rail .rail-me {
  border-top-color: var(--line);
  color: var(--ink);
}
.kids-hero {
  padding: 20px 0 8px;
  margin-bottom: 8px;
}
.kids-hero h1 {
  margin: 0 0 0.2em;
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--green-dark);
  letter-spacing: -0.02em;
}
.kids-hero .lead {
  margin: 0;
  font-size: 1.15rem;
  color: var(--muted);
}
.kids-section-title {
  margin: 0 0 14px;
  font-size: 1.05rem;
  font-weight: 700;
}
.kids-who {
  padding: 18px 0 28px;
  border-bottom: 1px solid var(--line);
}
.kids-faces {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.kids-face-form {
  margin: 0;
}
.kids-face {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 104px;
  padding: 14px 12px 12px;
  border: 2px solid var(--line);
  border-top: 3px solid var(--talent);
  border-radius: 18px;
  background: var(--bg-2);
  cursor: pointer;
  font: inherit;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.kids-faces > :nth-child(3n + 2) .kids-face {
  border-top-color: var(--green);
}
.kids-faces > :nth-child(3n + 3) .kids-face {
  border-top-color: var(--yellow);
}
.kids-face:hover {
  border-color: var(--green);
  border-top-color: var(--green);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(26, 143, 75, 0.12);
}
.kids-face.is-on {
  border-color: var(--green);
  border-top-color: var(--green);
  background: var(--green-soft);
  box-shadow: 0 0 0 3px rgba(26, 143, 75, 0.15);
}
.kids-face-avatar {
  font-size: 2.4rem;
  line-height: 1;
}
.kids-face-plus {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--bg-3);
  color: var(--green-dark);
  font-size: 1.8rem;
  font-weight: 700;
}
.kids-face-name {
  font-weight: 700;
}
.kids-face-meta {
  font-size: 0.8rem;
  color: var(--muted);
}
.kids-face-add {
  border-style: dashed;
}
.kids-do {
  padding: 28px 0 16px;
}
.kids-do.is-locked .kids-section-title {
  color: var(--muted);
  font-weight: 600;
}
.kids-doors {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 12px;
}
.kids-door-tile {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-height: 132px;
  padding: 18px 16px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--talent);
  border-radius: 18px;
  background: var(--bg-2);
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.kids-doors > .kids-door-tile:nth-child(3n + 2) {
  border-top-color: var(--green);
}
.kids-doors > .kids-door-tile:nth-child(3n + 3) {
  border-top-color: var(--yellow);
}
a.kids-door-tile:hover {
  transform: translateY(-3px);
  border-color: var(--green);
  border-top-color: var(--green);
  background: var(--card-bg);
  box-shadow: var(--shadow);
}
.kids-door-tile.is-dim {
  opacity: 0.45;
  filter: grayscale(0.2);
}
.kids-door-emoji {
  font-size: 1.8rem;
  line-height: 1;
  margin-bottom: 6px;
}
.kids-door-tile strong {
  font-size: 1.08rem;
}
.kids-door-tile span:last-child {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}
.kids-next-hint {
  margin: 22px 0 0;
}
.kids-tutor-tip {
  margin: 18px 0 0;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--yellow-soft);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.4;
  max-width: 36rem;
}
.kids-pace-done {
  margin: 0 0 18px;
  padding: 18px 20px;
  border-top: 3px solid var(--green);
}
.kids-pace-done h3 {
  margin: 0.2em 0 0.4em;
}
.kids-review-nudge {
  display: inline-flex;
  margin: 0 0 16px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--yellow-soft);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}
.kids-review-nudge:hover {
  background: var(--yellow);
}
.setup-leave {
  margin: 0 0 14px;
}
.setup-reflections {
  margin: 28px 0 8px;
  padding-top: 8px;
}
.setup-reflect-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.setup-reflect-list li {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--talent);
  border-radius: 14px;
  background: var(--bg-2);
}
.setup-reflect-list p {
  margin: 6px 0 0;
}
.kids-grownup {
  margin: 28px 0 8px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}
@media (max-width: 900px) {
  .setup-tiles,
  .kids-doors {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
@media (max-width: 560px) {
  .setup-tiles,
  .kids-doors {
    grid-template-columns: 1fr;
  }
}

.family-site .container {
  max-width: 1240px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}
.fam-photo {
  margin: 0;
  overflow: hidden;
  background: var(--bg-3);
}
.fam-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* Landing hero: words on the left, a framed photo on the right — the picture supports the message, it does not fill the screen. */
.fam-hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  max-width: none;
  margin: 8px auto 0;
  padding: clamp(28px, 5vw, 56px) 0 clamp(32px, 5vw, 60px);
  isolation: isolate;
}
.fam-hero::before {
  content: '';
  position: absolute;
  inset: -24px -20px 0;
  z-index: -1;
  background:
    radial-gradient(40rem 22rem at 85% 30%, var(--green-soft), transparent 70%),
    radial-gradient(28rem 18rem at 5% 90%, var(--yellow-soft), transparent 70%);
  opacity: 0.75;
  border-bottom: 1px solid var(--line);
}
.fam-photo-hero {
  position: relative;
  order: 2;
  justify-self: center;
  width: 100%;
  max-width: 460px;
  aspect-ratio: 4 / 3.4;
  border-radius: 28px;
  border: 6px solid var(--bg-2);
  box-shadow: 0 2px 4px rgba(29, 36, 51, 0.08), 0 24px 48px -12px rgba(29, 36, 51, 0.28);
  transform: rotate(1.5deg);
  overflow: visible;
  background: none;
}
.fam-photo-hero img {
  border-radius: 22px;
  object-position: center 35%;
}
/* Colour shapes peeking out from behind the photo. */
.fam-photo-hero::before,
.fam-photo-hero::after {
  content: '';
  position: absolute;
  z-index: -1;
  border-radius: 24px;
}
.fam-photo-hero::before {
  inset: 18px -18px -18px 18px;
  background: var(--green-fill);
  opacity: 0.85;
  transform: rotate(-4deg);
}
.fam-photo-hero::after {
  width: 84px;
  height: 84px;
  top: -22px;
  left: -22px;
  border-radius: 50%;
  background: var(--yellow);
}
.fam-hero .hero-copy {
  position: relative;
  max-width: 34rem;
  margin: 0;
  padding: 0;
}
.fam-brand {
  margin: 0 0 12px;
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -0.02em;
  color: var(--green-dark);
}
.fam-brand span {
  display: block;
  margin-top: 0.12em;
  font-size: 0.5em;
  font-weight: 700;
  color: var(--business);
  letter-spacing: 0;
}
.fam-hero h1 {
  font-size: clamp(1.3rem, 2.4vw, 1.65rem);
  font-weight: 700;
  margin: 0 0 0.5em;
  max-width: 22ch;
  color: var(--ink);
  line-height: 1.25;
}
.fam-hero .lead {
  font-size: 1.08rem;
  color: var(--muted);
  margin: 0 0 1.6em;
  max-width: 30rem;
  line-height: 1.55;
}
.fam-hero .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}
.fam-section {
  max-width: none;
  margin: 0 auto;
  padding: 48px 0 12px;
}
.fam-section-last {
  padding-bottom: 24px;
}
.fam-section-head {
  margin-bottom: 24px;
}
.fam-section-head h2 {
  margin: 0;
  font-size: clamp(1.4rem, 2.6vw, 1.85rem);
  font-weight: 750;
  max-width: 40ch;
  letter-spacing: -0.01em;
}
.fam-section-head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.fam-more {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  padding: 7px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--bg-2);
  color: var(--green-dark);
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.fam-more:hover,
.fam-more:focus-visible {
  border-color: var(--green-fill);
  background: var(--green-soft);
  text-decoration: none;
}
.fam-section-head-row .fam-more {
  margin-bottom: 4px;
}
/* Information, not buttons: a compact numbered strip with no card lift or shadow. */
.fam-steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px 28px;
}
.fam-steps li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-top: 2px solid var(--line);
  font-size: 1rem;
}
.fam-steps span {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--green-fill);
  color: var(--on-green);
  font-weight: 800;
  font-size: 0.95rem;
}
.fam-steps li:nth-child(2) span {
  background: var(--business);
}
.fam-steps li:nth-child(3) span {
  background: var(--creative);
}
.fam-steps strong {
  font-weight: 600;
  line-height: 1.35;
}
.fam-learn {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  /* auto-fit: however many subjects there are, together they fill the whole row. */
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.fam-learn li {
  --tone: var(--green);
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-top: 4px solid var(--tone);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.fam-learn li:nth-child(4n + 2) {
  --tone: var(--business);
}
.fam-learn li:nth-child(4n + 3) {
  --tone: var(--creative);
}
.fam-learn li:nth-child(4n + 4) {
  --tone: var(--talent);
}
.fam-learn strong {
  font-weight: 750;
  font-size: 1.05rem;
  color: var(--ink);
}
.fam-learn span {
  color: var(--muted);
  line-height: 1.45;
}
.fam-free {
  margin: 0;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--green-fill);
  border-radius: var(--radius-sm);
  background: var(--green-soft);
  color: var(--ink);
  font-weight: 600;
}
.fam-free a {
  font-weight: 800;
}
.auth-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 28px;
  align-items: stretch;
  width: 100%;
  max-width: none;
  margin: 12px 0;
}
/* Photo and form share one top line and one bottom line: the form card stretches to the
   picture column, and the picture fills whatever height is left above its caption. */
.auth-split .auth {
  max-width: none;
  margin: 0;
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-visual {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}
.fam-photo-auth {
  position: relative;
  flex: 1;
  min-height: 260px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
}
/* Out of the flow, so the form decides the height and the photo fills it. */
.fam-photo-auth img {
  position: absolute;
  inset: 0;
  height: 100%;
  object-position: center 35%;
}
.auth-caption {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--green-fill);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.auth-caption-lead {
  margin: 0 0 6px;
  font-weight: 700;
  color: var(--ink);
}
.auth-caption ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}
.auth-caption li::before {
  content: '✓ ';
  color: var(--green);
  font-weight: 800;
}
.fam-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin: 48px 0 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}
.fam-stats div {
  padding: 28px 12px;
  border-right: 1px solid var(--line);
}
.fam-stats div:last-child {
  border-right: 0;
}
.fam-stats strong {
  display: block;
  font-size: 1.05rem;
  font-weight: 500;
}
.fam-parts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.fam-parts article {
  padding: 40px 28px;
  border-right: 1px solid var(--line);
}
.fam-parts article:last-child {
  border-right: 0;
}
.fam-parts h2,
.fam-parts h3 {
  margin: 0 0 8px;
  font-size: 1.15rem;
}
.fam-block {
  margin: 8px 0 0;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.fam-block-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}
.fam-block-head h2 {
  margin: 0;
  font-size: 1.25rem;
}
.fam-path {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.fam-path li {
  padding: 18px 16px;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.fam-path li:last-child {
  border-right: 0;
}
.fam-path span {
  color: var(--green-dark);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
}
.fam-path em {
  font-style: normal;
  color: var(--muted);
  font-size: 0.85rem;
}
.school-group {
  margin: 28px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  overflow: hidden;
}
.school-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(140px, 0.55fr);
  gap: 24px;
  align-items: end;
}
.school-hero-copy {
  min-width: 0;
}
.fam-photo-small {
  display: block;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  border-top: 3px solid var(--talent);
  max-height: 240px;
  min-height: 160px;
  align-self: stretch;
  overflow: hidden;
  background: var(--bg-3);
}
.fam-photo-small img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 160px;
  max-height: 240px;
  object-fit: cover;
}
.kids-hero-row,
.setup-hero-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 260px);
  gap: 18px;
  align-items: center;
}
.kids-hero-photo,
.setup-hero-photo {
  max-height: 200px;
  min-height: 150px;
}
.kids-hero-photo img,
.setup-hero-photo img {
  min-height: 150px;
  max-height: 200px;
}
@media (max-width: 700px) {
  .school-hero,
  .kids-hero-row,
  .setup-hero-row {
    grid-template-columns: 1fr;
  }
  .fam-photo-small,
  .kids-hero-photo,
  .setup-hero-photo {
    max-height: 220px;
    order: -1;
  }
}
.world-switch {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 12px;
  background: var(--green-soft);
  color: var(--green-dark);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.world-switch:hover {
  background: var(--action);
  color: var(--on-action);
  border-color: var(--action-hover);
}
.kids-grownup a {
  font-weight: 700;
  color: var(--green-dark);
}
.kids-grownup a:hover {
  text-decoration: underline;
}

/* Subject and stage cards: a still grid, so a parent can read every card in order. */
.scroll-gallery {
  margin: 14px 0 0;
}
.scroll-gallery.is-stages {
  margin-top: 22px;
}
.scroll-set {
  display: grid;
  /* auto-fit: however many subjects are in a section, together they fill the whole row. */
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 14px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.scroll-card {
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--talent);
  border-radius: var(--radius);
  background: var(--bg-2);
  box-shadow: 0 10px 28px rgba(36, 48, 68, 0.05);
}
.scroll-set > .scroll-card:nth-child(3n + 2) {
  border-top-color: var(--green);
}
.scroll-set > .scroll-card:nth-child(3n + 3) {
  border-top-color: var(--yellow);
}
.scroll-card-mark {
  display: block;
  font-size: 1.7rem;
  line-height: 1;
  margin-bottom: 10px;
}
.scroll-card h2,
.scroll-card h3 {
  margin: 0 0 6px;
  font-size: 1.12rem;
}
.scroll-card p {
  margin: 0 0 0.45em;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}
.scroll-card p:last-child {
  margin-bottom: 0;
  color: var(--ink);
}
.stage-scroll-card .school-path-num {
  display: block;
  margin-bottom: 8px;
}

.school-subjects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.school-subjects article {
  padding: 22px 24px;
  border-right: 1px solid var(--line);
}
.school-subjects article:last-child {
  border-right: 0;
}
.school-subjects h3 {
  margin: 0 0 6px;
}
.school-subjects p {
  margin: 0;
  color: var(--muted);
}
.school-path {
  list-style: none;
  margin: 28px 0 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.school-path li {
  display: grid;
  grid-template-columns: 4rem 1fr;
  gap: 16px;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}
.school-path li:last-child {
  border-bottom: 0;
}
.school-path-num {
  color: var(--green-dark);
  font-weight: 500;
  letter-spacing: 0.08em;
}
.school-path h2 {
  margin: 0 0 4px;
}
.fam-next {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 28px 0 8px;
}
.legal {
  max-width: 40rem;
}
.legal h2 {
  margin-top: 1.4em;
}
.gate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 11px 14px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  box-sizing: border-box;
}
.form .gate-check {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 500;
  margin: 0;
  cursor: pointer;
}
.form .gate-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex-shrink: 0;
  accent-color: var(--green);
}
.gate-mark {
  flex-shrink: 0;
  width: 28px !important;
  height: 28px !important;
  max-width: 28px;
  color: var(--green);
  display: block;
}
.form .agree-line {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-weight: 400;
  font-size: 0.82rem;
  line-height: 1.4;
  color: var(--muted);
  margin: 0;
  cursor: pointer;
}
.form .agree-line input {
  width: 16px;
  height: 16px;
  margin: 2px 0 0;
  flex-shrink: 0;
  accent-color: var(--green);
}
.honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}
.fam-parts p {
  margin: 0;
  color: var(--muted);
}
.fam-how {
  margin: 0;
  padding: 36px 0;
  border-bottom: 1px solid var(--line);
}
.fam-how ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
}
.fam-how li {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 8px 20px;
  border-right: 1px solid var(--line);
  font-weight: 500;
}
.fam-how li:last-child {
  border-right: 0;
}
.fam-how li span {
  color: var(--green-dark);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
}
.fam-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin: 36px 0 8px;
  padding: 28px 32px;
  border-radius: var(--radius);
  background: var(--bg-3);
  color: var(--ink);
  border: 1px solid var(--line);
}
.fam-band h2 {
  margin: 0;
}
.fam-mark {
  position: relative;
  width: 260px;
  height: 260px;
  margin: 0 auto;
}
.fam-ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
}
.fam-ring-outer {
  background: radial-gradient(circle at 50% 42%, var(--bg-2) 0 38%, var(--green-soft) 39% 68%, var(--yellow-soft) 69% 100%);
}
.fam-ring-mid {
  inset: 18%;
  background: var(--bg-2);
  box-shadow: none;
}
.fam-mark-core {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 4.4rem;
  line-height: 1;
}
@media (max-width: 860px) {
  .family-rail {
    width: auto;
    background: var(--bg-3);
  }
  .kids-door {
    width: auto;
    padding: 8px 10px;
    font-size: 0.72rem;
    white-space: nowrap;
  }
  /* A phone stacks a smaller photo above the words. */
  .fam-hero {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 28px;
  }
  .fam-photo-hero {
    order: 0;
    max-width: 340px;
    aspect-ratio: 4 / 3;
    border-width: 4px;
  }
  .fam-photo-hero::after {
    width: 56px;
    height: 56px;
    top: -14px;
    left: -14px;
  }
  .fam-photo-hero::before {
    inset: 12px -12px -12px 12px;
  }
  .fam-steps {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .auth-split {
    grid-template-columns: 1fr;
    gap: 16px;
  }
  .fam-photo-auth {
    flex: none;
    height: 200px;
    min-height: 0;
  }
  .auth-caption {
    display: none;
  }
  .fam-learn li {
    grid-template-columns: 1fr;
    gap: 4px;
  }
  .fam-section-head-row {
    flex-direction: column;
    align-items: flex-start;
  }
  .fam-stats,
  .fam-parts,
  .fam-how ol,
  .fam-path,
  .school-subjects {
    grid-template-columns: 1fr;
  }
  .fam-stats div,
  .fam-parts article,
  .fam-how li,
  .fam-path li,
  .school-subjects article {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .fam-stats div:last-child,
  .fam-parts article:last-child,
  .fam-how li:last-child,
  .fam-path li:last-child,
  .school-subjects article:last-child {
    border-bottom: 0;
  }
}
@media print {
  .family-rail {
    display: none !important;
  }
}
@media print {
  .rail {
    display: none;
  }
}

/* ============ Live tutor (free, at home) ============ */
.tutor-hero {
  padding: 12px 0 8px;
}
.tutor-hero h1 {
  margin: 0 0 0.25em;
  color: var(--green-dark);
}
.tutor-ask,
.tutor-open,
.tutor-tips {
  margin-top: 16px;
}
.tutor-who {
  border: 0;
  padding: 0;
  margin: 12px 0 18px;
  display: grid;
  gap: 8px;
}
.tutor-who legend {
  font-weight: 700;
  margin-bottom: 6px;
}
.tutor-choice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-2);
  cursor: pointer;
}
.tutor-choice:has(input:checked) {
  border-color: var(--green);
  background: var(--green-soft);
}
.tutor-choice small {
  display: block;
  color: var(--muted);
  font-weight: 500;
}
.tutor-open-list,
.setup-tutor-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.tutor-open-list li,
.setup-tutor-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--bg);
}
.setup-tutor-requests {
  margin-bottom: 18px;
  border-top: 3px solid var(--talent);
}
.tutor-back {
  margin: 22px 0 8px;
}
.tutor-next {
  margin: 0 0 12px;
}

/* ============ Friends world ============ */
.social-search {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  max-width: 420px;
}
.social-search input {
  flex: 1;
}
.social-block h2 {
  margin-top: 0;
}
.social-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}
.social-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
}
.social-list li:first-child {
  border-top: 0;
  padding-top: 0;
}
.social-thread {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
  color: var(--ink);
  width: 100%;
}
.chat-panel {
  display: grid;
  gap: 12px;
}
.chat-log {
  display: grid;
  gap: 10px;
  max-height: 50vh;
  overflow-y: auto;
  padding: 4px 2px;
}
.chat-bubble {
  max-width: 85%;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--bg-3);
}
.chat-bubble p {
  margin: 0 0 4px;
}
.chat-bubble.is-mine {
  justify-self: end;
  background: var(--green-soft);
  color: var(--ink);
}
.chat-bubble.is-theirs {
  justify-self: start;
}
.chat-compose {
  display: flex;
  gap: 8px;
  align-items: center;
}
.chat-compose input {
  flex: 1;
}
.world-feed {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 14px;
}
.world-feed li {
  padding: 12px;
  border-radius: var(--radius-sm);
  background: var(--bg-3);
  border: 1px solid var(--line);
}
.world-feed h3 {
  margin: 6px 0;
  font-size: 1.05rem;
}
.world-post-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 6px;
}
.family-chat-log {
  list-style: none;
  margin: 0;
  padding: 0;
}
.family-chat-log li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.family-chat-log li.is-deleted {
  opacity: 0.6;
}

.grownup-door {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}
.grownup-door:hover {
  background: var(--green-soft);
  color: var(--green-dark);
  border-color: var(--green);
}
.kids-enter-form {
  margin: 0;
  width: 100%;
}
.kids-enter-form .kids-door {
  width: 100%;
  cursor: pointer;
  font: inherit;
}
.setup-tile-form {
  margin: 0;
  padding: 0;
  border: 0;
}
.setup-tile-form button {
  display: grid;
  gap: 4px;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 18px 16px;
  border: 0;
  border-radius: inherit;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.timeup-actions {
  flex-wrap: wrap;
  margin: 14px 0 8px;
}

/* ============ Tutor partners ============ */
.partner-how {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.partner-how li {
  display: flex;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
}
.partner-how li > span {
  flex-shrink: 0;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 12px;
  background: var(--green-fill);
  color: var(--on-green);
  font-weight: 800;
}
.partner-how p {
  margin: 4px 0 0;
}
.partner-link {
  display: grid;
  gap: 14px;
  border-left: 5px solid var(--green-fill);
}
.partner-link h2 {
  margin: 0 0 4px;
}
.partner-link p {
  margin: 0;
}
.partner-link-row {
  display: flex;
  gap: 10px;
}
.partner-link-input {
  flex: 1;
  min-width: 0;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95rem;
}
.partner-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.partner-code {
  width: 12ch;
  padding: 4px 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.partner-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 18px 0;
}
.partner-stats div {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.partner-stats strong {
  font-size: 1.6rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
}
.partner-stats span {
  font-size: 0.85rem;
  color: var(--muted);
}
.partner-milestone-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}
.partner-milestone-head h2 {
  margin: 0;
}
.partner-count {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
}
.partner-bar {
  height: 14px;
  margin: 12px 0 8px;
  border-radius: 999px;
  background: var(--bg-3);
  overflow: hidden;
}
.partner-bar span {
  display: block;
  height: 100%;
  min-width: 14px;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-fill), var(--yellow));
  transition: width 0.4s ease;
}
.partner-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 10px;
}
.partner-option {
  position: relative;
  display: block;
  padding: 16px 18px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  cursor: pointer;
}
.partner-option h3 {
  margin: 0 0 4px;
}
.partner-option p {
  margin: 0;
}
.partner-option input {
  position: absolute;
  top: 16px;
  right: 16px;
}
.partner-option:has(input:checked) {
  border-color: var(--green-fill);
  background: var(--green-soft);
}
.partner-options.is-locked .partner-option {
  cursor: default;
  opacity: 0.7;
}
.partner-confirm {
  display: flex;
  gap: 8px;
  align-items: center;
  margin: 6px 0 12px;
  font-weight: 600;
}
.partner-reward.is-lifetime {
  margin-top: 14px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: var(--yellow-soft);
  border: 1px solid var(--yellow);
}
.partner-reward h3 {
  margin: 0 0 4px;
}
.partner-earnings {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 8px;
}
.partner-earnings div {
  display: flex;
  flex-direction: column;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  border: 1px solid var(--line);
}
.partner-earnings span {
  font-size: 0.85rem;
  color: var(--muted);
}
.partner-earnings strong {
  font-size: 1.2rem;
  font-variant-numeric: tabular-nums;
}
.partner-earnings .is-balance {
  background: var(--green-soft);
  border-color: var(--green-fill);
}
.partner-earnings .is-balance strong {
  color: var(--green-dark);
}
.partner-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.partner-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}
.partner-table th,
.partner-table td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.partner-table th {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}
.partner-table tr:last-child td {
  border-bottom: 0;
}
.partner-table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.partner-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg-3);
  color: var(--ink);
  vertical-align: middle;
}
.partner-pill.is-cleared,
.partner-pill.is-approved {
  background: var(--green-soft);
  color: var(--green-dark);
}
.partner-pill.is-review,
.partner-pill.is-pending {
  background: var(--yellow-soft);
}
.partner-pill.is-voided,
.partner-pill.is-rejected,
.partner-pill.is-suspended {
  background: var(--red-soft);
  color: var(--red);
}
.partner-application {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}
.partner-application h3 {
  margin: 0 0 6px;
}
.partner-rate {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}
.partner-rate h2,
.partner-rate p {
  flex-basis: 100%;
  margin: 0;
}
.inline-form {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin: 2px 0;
}
.inline-form input {
  max-width: 16rem;
}
@media (max-width: 700px) {
  .partner-how,
  .partner-options {
    grid-template-columns: 1fr;
  }
  .partner-stats,
  .partner-earnings {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .partner-link-row,
  .partner-application {
    flex-direction: column;
  }
}
.partner-kit h2 {
  margin: 0 0 4px;
}
.partner-tips {
  margin: 12px 0 4px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--yellow-soft);
}
.partner-tips summary {
  font-weight: 700;
  cursor: pointer;
}
.partner-tips ul {
  margin: 10px 0 0;
  padding-left: 1.2em;
  line-height: 1.5;
}
.partner-message {
  padding-top: 16px;
  margin-top: 16px;
  border-top: 1px solid var(--line);
}
.partner-message h3 {
  margin: 0;
}
.partner-message-langs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 8px;
}
.partner-message-lang {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.partner-message-lang textarea {
  width: 100%;
  resize: vertical;
  font: inherit;
  font-size: 0.92rem;
  line-height: 1.45;
}
.partner-message-actions {
  display: flex;
  gap: 8px;
}
@media (max-width: 700px) {
  .partner-message-langs {
    grid-template-columns: 1fr;
  }
}
.signup-tutor {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-top: 4px;
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
  font-weight: 400;
  cursor: pointer;
}
.signup-tutor input {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--green-fill);
  cursor: pointer;
}
.signup-tutor-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.signup-tutor-text strong {
  display: block;
  margin-top: 2px;
  color: var(--green-dark);
}
.signup-tutor-text small {
  display: block;
  margin-top: 2px;
  line-height: 1.4;
}
.signup-tutor:has(input:checked) {
  border-style: solid;
  border-color: var(--green-fill);
  background: var(--green-soft);
}
.settings-partner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-left: 5px solid var(--green-fill);
}
.settings-partner h2,
.settings-partner p {
  margin: 0 0 4px;
}
a.partner-pill {
  text-decoration: none;
  margin: 4px 4px 0 0;
}
.partner-pill.is-referred {
  background: var(--talent-soft);
  color: var(--talent);
}

/* ============ For tutors (public) ============ */
.tt-hero {
  position: relative;
  max-width: 1000px;
  margin: 8px auto 0;
  padding: clamp(36px, 7vw, 72px) 0 clamp(28px, 5vw, 48px);
  text-align: center;
  isolation: isolate;
}
.tt-hero::before {
  content: '';
  position: absolute;
  inset: -24px 0 0;
  z-index: -1;
  background: radial-gradient(closest-side, var(--green-soft), transparent);
  opacity: 0.6;
}
.tt-hero h1 {
  margin: 6px 0 12px;
  font-size: clamp(2.1rem, 5vw, 3.2rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
}
.tt-hero h1 span {
  color: var(--green-dark);
  white-space: nowrap;
}
.tt-sub {
  margin: 0 0 24px;
  font-size: clamp(1.05rem, 2vw, 1.25rem);
  color: var(--muted);
}
.tt-sub strong {
  color: var(--green-dark);
  white-space: nowrap;
}
.tt-note {
  margin: 12px 0 0;
  font-size: 0.88rem;
  color: var(--muted);
  text-align: center;
}
.tt-block {
  max-width: none;
  margin: 0 auto;
  padding: 44px 0 0;
}
.tt-block h2 {
  margin: 0 0 20px;
  text-align: center;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  font-weight: 800;
}
.tt-flow {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 12px;
}
.tt-flow li:not(.tt-arrow) {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 24px 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--bg-2);
  text-align: center;
  height: 100%;
}
.tt-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
  border-radius: 50%;
  background: var(--green-soft);
  font-size: 1.9rem;
}
.tt-flow li:nth-child(3) .tt-icon {
  background: var(--business-soft);
}
.tt-flow li:nth-child(5) .tt-icon {
  background: var(--yellow-soft);
}
.tt-flow strong {
  font-size: 1.05rem;
}
.tt-flow small {
  color: var(--muted);
}
.tt-arrow {
  font-size: 2rem;
  font-weight: 800;
  color: var(--green);
}
.tt-pick {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 14px;
}
.tt-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 26px 18px;
  border-radius: 22px;
  text-align: center;
}
.tt-tile.is-cash {
  background: var(--green-soft);
  border: 2px solid var(--green-fill);
}
.tt-tile.is-life {
  background: var(--yellow-soft);
  border: 2px solid var(--yellow);
}
.tt-tile-big {
  font-size: 2.6rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--green-dark);
}
.tt-tile strong {
  font-size: 1.15rem;
}
.tt-tile small {
  color: var(--muted);
}
.tt-or {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--bg);
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--muted);
}
.tt-bars {
  display: grid;
  gap: 12px;
  max-width: 900px;
  margin: 0 auto;
}
.tt-bar {
  display: grid;
  grid-template-columns: 6.5rem 1fr auto;
  align-items: center;
  gap: 12px;
}
.tt-bar-label {
  color: var(--muted);
}
.tt-bar-track {
  height: 16px;
  border-radius: 999px;
  background: var(--bg-3);
  overflow: hidden;
}
.tt-bar-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--green-fill), var(--yellow));
}
.tt-bar strong {
  min-width: 7.5rem;
  text-align: right;
  color: var(--green-dark);
  font-variant-numeric: tabular-nums;
}
.tt-faq {
  display: grid;
  gap: 10px;
  max-width: 900px;
}
.tt-faq details {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.tt-faq summary {
  font-weight: 700;
  cursor: pointer;
}
.tt-faq p {
  margin: 8px 0 0;
  color: var(--muted);
}
.tutors-cta {
  max-width: none;
  margin: 48px auto 24px;
  padding: clamp(28px, 5vw, 40px) 24px;
  border-radius: 24px;
  background: var(--green-fill);
  text-align: center;
}
.tutors-cta h2 {
  margin: 0 0 16px;
  font-size: clamp(1.4rem, 2.6vw, 1.8rem);
  color: var(--on-green);
}
.tutors-cta .btn {
  background: var(--yellow);
  border-color: var(--yellow);
  color: #1d1400;
}
@media (max-width: 700px) {
  .tt-flow {
    grid-template-columns: 1fr;
  }
  .tt-arrow {
    justify-self: center;
    transform: rotate(90deg);
  }
  .tt-pick {
    grid-template-columns: 1fr;
  }
  .tt-or {
    justify-self: center;
  }
  .tt-bar {
    grid-template-columns: 5.5rem 1fr;
  }
  .tt-bar strong {
    grid-column: 2;
    min-width: 0;
    text-align: left;
  }
}
.admin-launch {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  margin-bottom: 18px;
  border-left: 5px solid var(--yellow);
}
.admin-launch h2 {
  margin: 0 0 4px;
}

.google-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 0 0 0.5rem;
}

.google-or {
  text-align: center;
  margin: 0.75rem 0;
}

.google-logo {
  flex: none;
}

.theme-toggle {
  margin-top: 0.5rem;
}

.nowrap {
  white-space: nowrap;
}

.fam-audiences {
  list-style: none;
  margin: 1.2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.fam-audiences li {
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.fam-audiences li > span[aria-hidden] {
  font-size: 1.6rem;
}

.fam-role-cards {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.fam-role-card {
  display: grid;
  gap: 0.5rem;
  align-content: start;
  padding: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
}

.fam-role-card h3 {
  margin: 0;
}

.fam-role-card p {
  margin: 0;
}

.fam-role-card .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.fam-role-note {
  margin-top: 1rem;
  text-align: center;
}

/* ============ Phones and tablets: polish ============
   Written last so it wins over the earlier rules. Checked at 320, 375, 768 and 1024 pixels wide. */

/* Nothing may push the page sideways: decorative shapes can hang over the edge, so they are clipped. */
html,
body {
  overflow-x: clip;
}
.card,
.settings-row-main,
.tile,
.page-head > div {
  min-width: 0;
  overflow-wrap: anywhere;
}
img,
svg,
video {
  max-width: 100%;
}
button,
.btn,
a,
summary,
label {
  touch-action: manipulation;
}

/* Phones: the "stay in school" bar and the timer must not eat the screen. */
@media (max-width: 700px) {
  .stay-bar {
    padding: 6px 10px;
    gap: 8px;
    justify-content: flex-end;
  }
  .stay-bar p {
    display: none;
  }
  .stay-bar-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
  }
  .stay-bar .btn {
    padding: 6px 12px;
    font-size: 0.85rem;
  }
  body.kid-lock {
    padding-bottom: 3.2rem;
  }

  .time-board {
    grid-auto-flow: column;
    justify-content: space-between;
    align-items: center;
    margin: 8px 12px 0;
    padding: 6px 14px;
    gap: 10px;
  }
  .time-board-label {
    font-size: 0.78rem;
  }
  .time-board-clock {
    font-size: 1.9rem;
  }

  /* Admin and family number tiles sit two to a row instead of one huge tile each. */
  .grid-4,
  .admin-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }
  .admin-tiles .tile,
  .grid-4 .tile {
    padding: 12px 8px;
  }
  .tile-value {
    font-size: 1.6rem;
  }

  .install-bar {
    padding: 10px 12px;
  }
  .install-bar p {
    font-size: 0.9rem;
  }
}

/* Very small phones (320px): buttons wrap instead of overflowing. */
@media (max-width: 380px) {
  .actions,
  .head-actions {
    flex-wrap: wrap;
  }
  .btn-huge,
  .btn-big {
    padding-inline: 16px;
  }
  .container {
    padding-inline: 14px;
  }
}

/* Tablets in portrait: two-column card grids keep their breathing room. */
@media (min-width: 701px) and (max-width: 1100px) {
  .stay-bar p {
    font-size: 0.85rem;
  }
  .time-board {
    margin-inline: 24px;
  }
}

/* Touch screens: bigger targets, per the usual 44px guidance. */
@media (pointer: coarse) {
  .site-footer a,
  .footer-col a,
  .footer-legal a,
  .crumbs a,
  .fam-more,
  .page-back {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
  }
  .footer-legal a {
    padding-inline: 6px;
  }
  .btn,
  button.btn,
  .rail-nav a,
  .rail-logout-btn,
  .fam-lang-opt {
    min-height: 44px;
  }
  .btn-small {
    min-height: 40px;
  }
  input[type='checkbox'],
  input[type='radio'] {
    width: 22px;
    height: 22px;
    accent-color: var(--green-fill);
  }
  .language-option,
  .agree-line,
  .partner-confirm,
  fieldset label {
    padding-block: 6px;
    cursor: pointer;
  }
  summary {
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  input:not([type='checkbox']):not([type='radio']):not([type='range']),
  select,
  textarea {
    font-size: 16px; /* below 16px, iPhones zoom the page in when a box is tapped */
    min-height: 44px;
  }
  textarea {
    min-height: 88px;
  }
}

/* The bottom bar of kids' pages: items snap into place and a fade hints that it scrolls. */
@media (max-width: 860px) {
  .kids-site .rail-nav {
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .kids-site .rail-nav::-webkit-scrollbar {
    display: none;
  }
  .kids-site .rail-nav a {
    scroll-snap-align: start;
    min-width: 62px;
  }
}

/* Kids' pages have their bar at the bottom, so nothing is reserved at the top. */
@media (max-width: 860px) {
  .kids-site .has-rail .shell-main {
    padding-top: 0;
  }
}


/* ============ Simple, airy landing (overrides) ============ */
body {
  font-size: 16px;
  line-height: 1.6;
}
.topbar {
  background: rgba(255, 250, 247, 0.9);
  backdrop-filter: saturate(1.4) blur(10px);
}
:root[data-theme='dark'] .topbar {
  background: rgba(20, 22, 29, 0.88);
}
.btn,
.btn-ghost {
  border-radius: 999px;
}
.btn-ghost {
  background: transparent;
  border-color: var(--line);
}
.btn-ghost:hover {
  background: var(--bg-2);
  border-color: var(--green-fill);
}
.fam-hero {
  margin-top: 0;
  padding: clamp(40px, 7vw, 88px) 0;
}
.fam-hero::before {
  display: none;
}
.fam-photo-hero {
  border: 0;
  transform: none;
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.fam-photo-hero::before,
.fam-photo-hero::after {
  display: none;
}
.fam-photo-hero img {
  border-radius: 0;
}
.fam-brand span {
  color: var(--muted);
  font-weight: 600;
}
.fam-section {
  padding: clamp(36px, 6vw, 72px) 0 0;
}
.fam-steps li {
  border-top: 1px solid var(--line);
}
.fam-steps li:nth-child(n) span {
  background: var(--green-fill);
}
.fam-learn li,
.fam-learn li:nth-child(n) {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-2);
  padding: 22px;
}
.fam-learn li {
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.fam-learn li:hover {
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.fam-free {
  border: 0;
  border-radius: var(--radius);
  background: var(--green-soft);
  padding: 22px 26px;
}

/* ============ Calm palette: cream base, pink action, mint highlight ============ */
.fam-hero::before {
  display: block;
  inset: 0 -24px;
  border: 0;
  border-radius: 0 0 40px 40px;
  background: radial-gradient(36rem 20rem at 90% 10%, var(--green-soft) 0%, transparent 70%);
}
.fam-hero {
  padding-left: 16px;
  padding-right: 16px;
}
.fam-brand {
  color: var(--ink);
}
.fam-photo-hero {
  border: 6px solid #fff;
}
.btn-ghost {
  background: #fff;
  border-color: var(--line);
  color: var(--ink);
}
.btn-ghost:hover {
  background: var(--bg-2);
  border-color: var(--green-fill);
}
.fam-more {
  background: #fff;
  border-color: var(--line);
}
.fam-more:hover,
.fam-more:focus-visible {
  background: var(--green-soft);
  border-color: color-mix(in srgb, var(--green-fill) 45%, var(--line));
}
.fam-steps li {
  border-top-color: var(--line);
}
.fam-steps li:nth-child(n) span {
  background: var(--green-fill);
  color: var(--on-green);
}
.fam-learn li,
.fam-learn li:nth-child(n) {
  background: #fff;
  border: 1px solid var(--line);
}
.fam-learn li:hover {
  border-color: color-mix(in srgb, var(--green-fill) 45%, var(--line));
}
.fam-free {
  background: var(--green-soft);
}

.brand-logo {
  display: block;
  width: 1.6rem;
  height: 1.6rem;
}
.footer-logo .brand-logo {
  display: inline-block;
  vertical-align: -0.3em;
}

/* ============ Night mode for the calm palette ============ */
:root[data-theme='dark'] .fam-hero::before {
  background: radial-gradient(36rem 20rem at 90% 10%, var(--green-soft) 0%, transparent 70%);
}
:root[data-theme='dark'] .fam-photo-hero {
  border-color: var(--bg-2);
}
:root[data-theme='dark'] .btn-ghost,
:root[data-theme='dark'] .fam-more,
:root[data-theme='dark'] .fam-learn li,
:root[data-theme='dark'] .fam-learn li:nth-child(n) {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}
:root[data-theme='dark'] .btn-ghost:hover,
:root[data-theme='dark'] .fam-more:hover,
:root[data-theme='dark'] .fam-more:focus-visible {
  background: var(--bg-3);
  border-color: var(--green);
}
:root[data-theme='dark'] .fam-learn strong {
  color: var(--ink);
}
:root[data-theme='dark'] .fam-learn span {
  color: var(--muted);
}
:root[data-theme='dark'] .fam-free {
  background: var(--green-soft);
  color: var(--ink);
}
:root[data-theme='dark'] .fam-brand {
  color: var(--ink);
}
:root[data-theme='dark'] .fam-steps li {
  border-top-color: var(--line);
}
:root[data-theme='dark'] .fam-steps li:nth-child(n) span {
  color: var(--on-green);
}
:root[data-theme='dark'] .btn {
  color: var(--on-action);
  background: var(--action);
  border-color: var(--action);
}
:root[data-theme='dark'] .btn:hover {
  background: var(--action-hover);
  border-color: var(--action-hover);
}
:root[data-theme='dark'] .btn-ghost {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

/* ============ Live video tutoring ============ */
.session-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.session-item {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-2);
}
.session-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

/* ============ Classroom ============ */
.room { display: grid; gap: 1rem; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; }
.room-frame { width: 100%; min-height: 480px; border-radius: 14px; overflow: hidden; background: var(--surface, #fff); border: 1px solid var(--line, #ddd); }
.room-side { display: grid; gap: 0.75rem; }
.room-card { background: var(--surface, #fff); border: 1px solid var(--line, #ddd); border-radius: 14px; padding: 0.9rem 1rem; }
.room-card h2 { font-size: 1.05rem; margin: 0 0 0.5rem; }
.room-row { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; padding: 0.25rem 0; }
.room-actions { display: inline-flex; gap: 0.25rem; }
.room-dot { display: inline-block; width: 0.65rem; height: 0.65rem; border-radius: 50%; background: var(--line, #ccc); margin-right: 0.25rem; }
.room-dot.is-here { background: var(--green-fill); }
.room-chip { display: inline-block; margin-left: 0.3rem; padding: 0 0.4rem; border-radius: 999px; font-size: 0.75rem; background: var(--bg-2, #f3efe6); color: var(--muted, #666); }
.room-chip.is-sent { background: #fff0b8; color: #5c4a00; }
.room-chip.is-checked { background: var(--green-soft); color: var(--green-dark); }
.room-work { margin-top: 0.6rem; border-top: 1px solid var(--line, #ddd); padding-top: 0.6rem; }
.room-sub { margin: 0.5rem 0; padding: 0.6rem; border-radius: 10px; background: var(--bg-2, #f7f4ec); }
.room-marks label { margin-right: 0.5rem; white-space: nowrap; }
.room-q { border: 0; padding: 0; margin: 0 0 0.6rem; }
.room-q legend { font-weight: 600; padding: 0; }
.room-choice { display: block; padding: 0.2rem 0; }
.room-comment { padding: 0.5rem 0.75rem; border-radius: 10px; background: var(--bg-2, #f7f4ec); }
.room-hand { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.room-hand input { flex: 1 1 10rem; }
.room-compose textarea, .room-compose input, .room-compose select { width: 100%; }
@media (max-width: 860px) {
  .room { grid-template-columns: minmax(0, 1fr); }
  .room-frame { min-height: 300px; }
}
:root[data-theme='dark'] .room-card, :root[data-theme='dark'] .room-frame { background: var(--surface); border-color: var(--line); color: var(--ink); }
:root[data-theme='dark'] .room-sub, :root[data-theme='dark'] .room-comment { background: var(--bg-3, #20242c); }
:root[data-theme='dark'] .room-chip.is-sent { background: #5b4a12; color: #ffe9a3; }
:root[data-theme='dark'] .room-chip.is-checked { background: var(--green-soft); color: var(--green-dark); }

/* ============ Balanced days ============ */
.balance-list { list-style: none; margin: 1rem 0; padding: 0; display: grid; gap: 0.6rem; }
.balance-item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.8rem; padding: 0.7rem 0.9rem; border: 1px solid var(--line, #e3e3e3); border-radius: 0.8rem; text-align: left; }
.balance-item.is-full { opacity: 0.8; }
.balance-name small { margin-left: 0.4rem; }
.kids-balance { display: flex; flex-wrap: wrap; gap: 0.3rem 0.8rem; margin: 0 0 0.8rem; }
.kids-balance-item.is-full { text-decoration: line-through; }

/* ============ Motto ============ */
.fam-motto {
  margin: 1rem 0 1.2rem;
  padding: 0.7rem 1rem;
  border-left: 4px solid var(--green-fill);
  border-radius: 0 0.8rem 0.8rem 0;
  background: var(--green-soft);
}
.fam-motto p { margin: 0; line-height: 1.5; }
.fam-motto p[lang='am'] { font-weight: 800; font-size: 1.05rem; }
.fam-motto p[lang='en'] { margin-top: 0.25rem; font-size: 0.95rem; color: var(--muted); }
:root[data-theme='dark'] .fam-motto { background: var(--green-soft); }

.exp-row { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0.5rem; margin-bottom: 0.5rem; }
@media (max-width: 560px) { .exp-row { grid-template-columns: 1fr; } }

/* ============ Tutor: steps to go live ============ */
.golive-bar { height: 8px; border-radius: 99px; background: var(--bg-3); overflow: hidden; margin: 0.4rem 0 0.8rem; }
.golive-bar span { display: block; height: 100%; background: var(--green-fill); border-radius: 99px; }
.golive-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.golive-steps li { display: grid; grid-template-columns: 1.8rem 1fr auto; gap: 0.6rem; align-items: center; padding: 0.5rem 0.6rem; border-radius: 0.8rem; }
.golive-steps li.is-next { background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green-fill) 45%, var(--line)); }
.golive-steps li.is-done { opacity: 0.85; }
.golive-mark { display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 2px solid var(--line); font-weight: 800; font-size: 0.85rem; }
.is-done .golive-mark { background: var(--green-fill); border-color: var(--green-fill); color: var(--on-green); }
.is-next .golive-mark { border-color: var(--green); color: var(--green); }
@media (max-width: 560px) { .golive-steps li { grid-template-columns: 1.8rem 1fr; } .golive-steps li .btn { grid-column: 2; justify-self: start; } }
.pace-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; width: 100%; }
.pace-row > span.small { flex: 0 0 100%; }

/* ============ Contrast ============ */
/* A clear ring wherever the keyboard is, in both themes. */
a:focus-visible, button:focus-visible, summary:focus-visible, [role='button']:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--green-dark);
  outline-offset: 2px;
}
/* Small grey text stays readable. */
.tiny, .small.muted, .tiny.muted { color: var(--muted); }

/* The logo is used exactly as drawn. On the dark side menu it sits on a small cream circle, so its dark green stays clear. */
.rail .brand-mark { display: inline-grid; place-items: center; background: #fffaf7; border-radius: 50%; padding: 3px; }

/* Short tutor profile: two fields side by side, and folded-away optional parts */
.field-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }
.more-fields { border: 1px solid var(--field-line, #b9b09a); border-radius: 0.75rem; padding: 0.5rem 0.9rem; margin: 0.75rem 0; }
.more-fields > summary { cursor: pointer; font-weight: 600; padding: 0.4rem 0; }
@media (max-width: 520px) { .field-pair { grid-template-columns: 1fr; } }

:root[data-theme="dark"] input::placeholder, :root[data-theme="dark"] textarea::placeholder { color: #9a9a9a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) input::placeholder, :root:not([data-theme="light"]) textarea::placeholder { color: #9a9a9a; } }

/* Tutor page: show the tutor how families will see them */
.tutor-preview { border-top: 4px solid #e8836b; }
.tutor-demand { background: var(--bg-2); border-radius: 0.8rem; padding: 0.6rem 0.8rem; }
.tutor-preview-card { border: 1px dashed var(--field-line, #b9b09a); border-radius: 0.9rem; padding: 0.8rem 1rem; margin: 0.7rem 0; background: #fff; }
.tutor-preview-card h3 { margin: 0 0 0.2rem; }

/* Small tab bar that groups pages merged in a side menu */
.sub-tabs { display: flex; flex-wrap: wrap; gap: .4rem; margin: 0 0 1rem; }
.sub-tabs a { padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--line, #d8d8d8); text-decoration: none; color: inherit; font-weight: 600; font-size: .9rem; }
.sub-tabs a.active { background: var(--green-fill); border-color: transparent; color: var(--on-green); }
.blocked-steps { text-align: left; max-width: 28rem; margin: 0 auto 1rem; }

/* Admin family rows: a small plan badge and no underlined text */
.plan-dot { flex: none; width: 34px; height: 34px; display: grid; place-items: center; font-size: 1.1rem; border-radius: 50%; background: var(--surface); border: 1px solid var(--line, #e5dccb); }
a.settings-row:has(.plan-dot), a.settings-row:has(.plan-dot) * { text-decoration: none; }
a.settings-row:has(.plan-dot) { padding-block: 12px; }

/* Admin overview: five small tiles in one line */
.admin-tiles.grid-4 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.admin-tiles .tile { padding: 8px 6px; border-radius: 14px; text-decoration: none; color: inherit; }
.admin-tiles .tile-value { font-size: clamp(1.1rem, 3.6vw, 1.5rem); }
.admin-tiles .tile-label { font-size: clamp(.62rem, 2.2vw, .78rem); line-height: 1.2; }

/* Admin overview: compact and scannable */
.admin-head { display: flex; align-items: baseline; gap: 12px; margin: 4px 0 10px; }
.admin-head h1 { font-size: 1.4rem; margin: 0; }
.admin-launch { padding: 10px 14px; margin: 10px 0; }
.admin-launch h3 { margin: 0 0 4px; }
.admin-glance { display: grid; grid-template-columns: 2fr 1fr; gap: 16px; padding: 10px 14px; margin: 10px 0; }
.admin-glance h3 { margin: 0 0 4px; font-size: 1rem; }
.admin-glance p { margin: 2px 0; }
.glance-row { display: flex; flex-wrap: wrap; gap: 4px 16px; }
.admin-recent-head { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 6px; }
.admin-recent-head h2 { font-size: 1.05rem; margin: 0; }
.table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; font-size: .9rem; background: var(--surface); border-radius: 10px; }
.admin-table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); padding: 6px 10px; border-bottom: 1px solid var(--line, #e5dccb); }
.admin-table td { padding: 6px 10px; border-bottom: 1px solid var(--line, #eee6d6); vertical-align: top; }
.admin-table .num { text-align: right; }
.admin-table a { text-decoration: none; }
@media (max-width: 700px) { .admin-glance { grid-template-columns: 1fr; } }

/* Reports: today is always visible; only the monthly card is printed */
.report-today { display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; padding: 8px 12px; margin: 8px 0; border-radius: 10px; background: color-mix(in srgb, var(--card-bg) 70%, #fff); border: 1px solid var(--line); }
@media print { .screen-only { display: none !important; } }

/* The phone app: a bottom menu instead of the website footer */
.app-tabs { display: none; }
body.in-app .app-tabs {
  display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
body.in-app .shell-main { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
body.in-app .app-tab {
  flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 8px 2px 6px; background: none; border: 0; color: var(--muted); text-decoration: none;
  font: inherit; font-size: .7rem; font-weight: 700; cursor: pointer;
}
body.in-app .app-tab .rail-icon { width: 22px; height: 22px; }
body.in-app .app-tab-emoji { font-size: 1.25rem; line-height: 22px; }
body.in-app .app-tab.is-on { color: var(--green); }
body.in-app .rail-toggle { display: none; }
body.in-app .stay-bar { display: none; }

/* The phone app: a top bar (school, day/night, who is signed in) and a "More" sheet */
.app-top { display: none; }
body.in-app .rail { display: none; }
body.in-app .app-top {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  position: fixed; top: 0; left: 0; right: 0; z-index: 50; height: 52px;
  padding: 0 12px; padding-top: env(safe-area-inset-top);
  background: var(--surface); border-bottom: 1px solid var(--line);
}
body.in-app .has-rail .shell-main { padding-top: calc(60px + env(safe-area-inset-top)); margin-left: 0; }
/* The logo's own green would vanish on the dark green bar, so it sits on a cream circle (as in the side menu). */
body.in-app .app-top-brand .brand-logo { box-sizing: content-box; background: #fffaf7; border-radius: 50%; padding: 3px; flex: none; }
body.in-app .app-top-brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; min-width: 0; }
body.in-app .app-top-actions { display: flex; align-items: center; gap: 8px; }
body.in-app .app-icon-btn { width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--line); background: var(--card-bg); color: inherit; font-size: 1.1rem; cursor: pointer; }
body.in-app .app-profile { display: flex; align-items: center; gap: 6px; color: inherit; text-decoration: none; font-weight: 700; }
body.in-app .app-profile-name { max-width: 7.5rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .85rem; }
body.in-app .app-avatar { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--green-fill); color: var(--on-green); font-weight: 800; }
body.in-app .app-profile .face { width: 32px; height: 32px; }
.app-sheet[hidden] { display: none; }
.app-sheet { position: fixed; inset: 0; z-index: 60; }
.app-sheet-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, .4); }
.app-sheet-body {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 80vh; overflow-y: auto;
  background: var(--surface); border-radius: 18px 18px 0 0; padding: 8px 0 calc(12px + env(safe-area-inset-bottom));
}
.app-sheet-row {
  display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 20px; border: 0; background: none;
  color: inherit; font: inherit; font-weight: 600; text-decoration: none; text-align: left; cursor: pointer;
}
.app-sheet-row .rail-icon { width: 22px; height: 22px; flex: none; }
.app-sheet-lang { justify-content: space-between; cursor: default; }

/* The native app draws its own bars: the page needs no room for them */
body.in-native .has-rail .shell-main { padding-top: 8px; padding-bottom: 8px; }

/* ============ Home page: the logo's own colours: deep green and coral on cream ============ */
@font-face { font-family: 'Caveat'; font-style: normal; font-weight: 600; font-display: swap; src: url(/static/fonts/caveat-600.woff2) format('woff2'); }
.home2 { --navy: var(--green-dark); --navy-2: var(--green); --orange: var(--coral); --orange-soft: var(--coral-soft); max-width: none; margin: 0 auto; }
.home2 h1, .home2 h2, .home2 h3 { color: var(--navy); }
:root[data-theme="dark"] .home2 h1, :root[data-theme="dark"] .home2 h2, :root[data-theme="dark"] .home2 h3 { color: var(--ink); }
.h2-pill { display: inline-block; margin: 0 0 12px; padding: 6px 14px; border-radius: 999px; background: var(--orange-soft); color: var(--coral); font-weight: 700; font-size: .85rem; }
.h2-hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 32px; align-items: center; padding: 28px 0 8px; }
.h2-hero h1 { font-size: clamp(2rem, 5.2vw, 3.4rem); line-height: 1.08; margin: 0 0 14px; }
.h2-hi { color: var(--orange); background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 12' preserveAspectRatio='none'><path d='M2 8 C50 2 120 2 198 7' fill='none' stroke='%23FF6F61' stroke-width='3' stroke-linecap='round'/></svg>") no-repeat bottom / 100% 10px; padding-bottom: 8px; }
.h2-lead { font-size: 1.1rem; margin: 0 0 12px; max-width: 34rem; }
.h2-motto { margin: 0 0 18px; padding: 12px 16px; background: var(--orange-soft); border-radius: 12px; font-size: .92rem; color: var(--ink); }
:root[data-theme="dark"] .h2-motto { color: var(--ink); background: var(--bg-2); }
.h2-motto p { margin: 2px 0; }
.h2-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 20px; }
.h2-badges { list-style: none; margin: 0; padding: 16px 0 0; display: flex; flex-wrap: wrap; gap: 10px 22px; border-top: 1px solid var(--line); font-size: .85rem; font-weight: 600; }
.h2-badges li { display: flex; align-items: center; gap: 8px; }
.h2-badge-icon { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--orange-soft); color: var(--green-dark); flex: none; }
.h2-badge-icon .rail-icon { width: 20px; height: 20px; }
.h2-hero-art { position: relative; padding: 10px; }
.h2-blob { background: color-mix(in srgb, var(--navy-2) 10%, transparent); border-radius: 46% 54% 52% 48% / 52% 46% 54% 48%; padding: 18px; }
.h2-photo { margin: 0; border: 0; box-shadow: none; transform: none; max-width: none; aspect-ratio: 1 / 1; border-radius: 46% 54% 52% 48% / 52% 46% 54% 48%; overflow: hidden; background: none; order: 0; }
.h2-photo::before, .h2-photo::after { display: none; }
.h2-photo img { width: 100%; height: 100%; object-fit: cover; border-radius: 0; }
.h2-wave { margin: 28px calc(50% - 50vw) -1px; line-height: 0; }
.h2-wave svg { width: 100%; height: 70px; display: block; }
.h2-wave path { fill: var(--band-sky); }
.h2-band { margin: 0 calc(50% - 50vw); padding: 24px max(16px, calc(50vw - 540px)) 56px; background: var(--band-sky); color: var(--on-band-sky); text-align: center; }
.h2-band h2 { color: var(--on-band-sky); font-size: clamp(1.5rem, 3.6vw, 2.2rem); margin: 4px 0 10px; }
:root[data-theme="dark"] .home2 .h2-band h2 { color: var(--on-band-sky); }
.h2-band-head p { max-width: 40rem; margin: 0 auto 8px; opacity: .92; }
.h2-script { font-family: 'Caveat', 'Nyala', 'Noto Sans Ethiopic', cursive; font-weight: 600; font-size: 1.5rem; color: var(--coral); margin: 0; }
.h2-script-orange { color: var(--orange); }
.h2-roles3 { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.h2-roles3 li { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.h2-round { width: 76px; height: 76px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; background: var(--green-fill); color: var(--on-green); border: 3px solid rgba(255, 255, 255, .5); }
.h2-roles3 strong { font-size: 1.05rem; }
.h2-roles3 span:last-child { opacity: .9; font-size: .92rem; max-width: 18rem; }
.h2-story { display: grid; grid-template-columns: 1fr 1.1fr; gap: 36px; align-items: center; padding: 56px 0 24px; }
.h2-story-art { display: grid; place-items: center; }
.h2-story-art img { width: 170px; height: 170px; filter: drop-shadow(0 14px 18px rgba(0, 0, 0, .18)); }
.h2-story-copy h2 { font-size: clamp(1.6rem, 3.6vw, 2.2rem); margin: 4px 0 12px; }
.h2-story-copy p { margin: 0 0 12px; }
.h2-ways { padding: 40px 0 24px; text-align: center; }
.h2-ways h2 { font-size: clamp(1.5rem, 3.6vw, 2.2rem); margin: 0 0 8px; }
.h2-ways h2 .h2-script { display: block; font-size: 1.15em; }
.h2-way-cards { list-style: none; margin: 26px 0 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.h2-way-cards li { background: var(--card-bg); border: 1px solid var(--line); border-radius: 18px; padding: 22px 16px; box-shadow: 0 12px 28px -18px rgba(60, 50, 80, .24); }
.h2-way-icon { width: 64px; height: 64px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--orange-soft); color: var(--navy); }
.h2-way-icon .rail-icon { width: 30px; height: 30px; }
.h2-way-cards h3 { font-size: 1.05rem; margin: 0 0 6px; padding-bottom: 8px; position: relative; }
.h2-way-cards h3::after { content: ''; position: absolute; left: 50%; bottom: 0; width: 28px; height: 2px; margin-left: -14px; background: var(--orange); }
.h2-way-cards p { margin: 8px 0 0; font-size: .9rem; }
.home2 .fam-section { padding-top: 40px; }
.home2 .fam-role-card, .home2 .fam-learn li { border-radius: 18px; }
@media (max-width: 860px) {
  .h2-hero, .h2-story { grid-template-columns: 1fr; }
  .h2-hero-art { max-width: 420px; margin: 0 auto; }
  .h2-roles3 { grid-template-columns: 1fr; }
  .h2-way-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) { .h2-way-cards { grid-template-columns: 1fr; } }
.home2 .btn:not(.btn-ghost) { background: var(--action); border-color: var(--action); color: var(--on-action); }
.home2 .btn:not(.btn-ghost):hover { background: var(--action-hover); border-color: var(--action-hover); }
.home2 .btn-ghost { color: var(--navy); border-color: var(--navy); }
:root[data-theme="dark"] .home2 .btn:not(.btn-ghost) { background: var(--action); border-color: var(--action); }
:root[data-theme="dark"] .home2 .btn-ghost { color: var(--ink); border-color: var(--ink); }

/* One palette: the logo's deep green and coral on cream. The side menu is cream, its main button is the logo green. */
.family-rail { background: var(--surface); }
.family-rail .rail-nav a.active { background: var(--green-soft); box-shadow: inset 0 0 0 2px var(--green); color: var(--green-dark); }
.family-rail .kids-door, .kids-door { background: var(--action); border-color: var(--action); color: var(--on-action); }
.family-rail .kids-door:hover, .kids-door:hover { background: var(--action-hover); border-color: var(--action-hover); }
:root[data-theme="dark"] .family-rail .rail-nav a.active { background: var(--green-soft); color: var(--green-dark); }


/* ============ One palette for every page: the tokens at the top of this file ============ */
/* The older pink rules, now green */
.btn-ghost:hover { border-color: var(--green); }
.fam-steps li:nth-child(n) span { background: var(--green-soft); color: var(--green-dark); }
.fam-hero::before { background: radial-gradient(36rem 20rem at 90% 10%, var(--green-soft) 0%, transparent 70%); }
:root[data-theme='dark'] .btn { color: var(--on-action); }
:root[data-theme='dark'] .fam-steps li:nth-child(n) span { color: var(--on-green); }
:root[data-theme='dark'] .btn:not(.btn-ghost) { background: var(--action); border-color: var(--action); }
:root[data-theme='dark'] .btn:not(.btn-ghost):hover { background: var(--action-hover); border-color: var(--action-hover); }
:root[data-theme='dark'] .btn-ghost { background: var(--surface); border-color: var(--line); color: var(--ink); }
:root[data-theme='dark'] .fam-steps li:nth-child(n) span { background: var(--green-soft); color: var(--green-dark); }
.flash-error, .danger-zone { border-color: #f0b8c0; }

/* The look of the home page, everywhere: rounded pill buttons, deep green headings, soft cards, a green footer with a wave */
.btn { border-radius: 999px; }
.page-head h1, .fam-section-head h2, .section-title { color: var(--green-dark); }
.card { box-shadow: 0 10px 26px -18px rgba(60, 50, 80, 0.3); }
.eyebrow { color: var(--coral); }
.site-footer { position: relative; margin-top: 72px; border-top: 0; background: var(--band-blush); color: var(--on-band-blush); }
.site-footer::before {
  content: ''; position: absolute; left: 0; right: 0; top: -39px; height: 40px;
  /* The wave is a mask, so it takes the band colour in both modes. */
  background: var(--band-blush);
  -webkit-mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 40' preserveAspectRatio='none'><path d='M0,22 C240,48 480,0 720,20 C960,40 1200,6 1440,26 L1440,40 L0,40 Z' fill='%23000'/></svg>") center / 100% 100% no-repeat;
  mask: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 40' preserveAspectRatio='none'><path d='M0,22 C240,48 480,0 720,20 C960,40 1200,6 1440,26 L1440,40 L0,40 Z' fill='%23000'/></svg>") center / 100% 100% no-repeat;
}
.site-footer a, .site-footer .footer-col a { color: var(--on-band-blush); }
.site-footer h2, .site-footer strong, .footer-col h2 { color: var(--band-blush-head); }
.site-footer p, .site-footer span { color: var(--on-band-blush); }
.site-footer-mini { margin-top: 24px; }
.site-footer-mini::before { display: none; }
.site-footer .btn-ghost { background: transparent; color: var(--on-band-blush); border-color: color-mix(in srgb, var(--on-band-blush) 45%, transparent); }

/* Questions parents ask */
.h2-faq { padding: 40px 0 8px; max-width: 760px; margin: 0 auto; }
.h2-faq h2 { text-align: center; margin: 0 0 18px; }
.h2-faq-item { background: var(--card-bg); border: 1px solid var(--line); border-radius: 16px; padding: 4px 16px; margin: 0 0 10px; }
.h2-faq-item summary { cursor: pointer; font-weight: 700; padding: 12px 0; list-style-position: outside; }
.h2-faq-item p { margin: 0 0 14px; }

/* The green band stays inside the page (a rounded panel), so it can never run under the side menu */
.home2 .h2-wave { display: none; }
.home2 .h2-band { margin: 36px 0 0; padding: 40px 24px 44px; border-radius: 32px; }

/* ============ Home page, second order: how it works, safety, trust sections, one closing button ============ */
.pub-topbar { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin: 0 0 8px; }
.login-menu { position: relative; }
.login-menu summary { list-style: none; cursor: pointer; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--green); color: var(--green-dark); font-weight: 700; background: var(--surface); }
.login-menu summary::-webkit-details-marker { display: none; }
.login-menu summary::after { content: ' \25BE'; }
.login-menu ul { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 12rem; margin: 0; padding: 6px; list-style: none; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 30px -14px rgba(40, 36, 56, .35); }
.login-menu a { display: block; padding: 10px 14px; border-radius: 10px; color: var(--ink); text-decoration: none; font-weight: 600; }
.login-menu a:hover, .login-menu a:focus-visible { background: var(--green-soft); }
.pub-topbar .fam-lang { margin: 0; }
body.in-app .pub-topbar { display: none; }

.h2-sec-head { text-align: center; margin: 0 auto 22px; max-width: 40rem; }
.h2-sec-head h2 { margin: 6px 0 0; font-size: clamp(1.5rem, 3.6vw, 2.1rem); }
.h2-how { padding: 44px 0 8px; }
.h2-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; counter-reset: none; }
.h2-steps li { display: flex; gap: 14px; align-items: flex-start; background: var(--card-bg); border: 1px solid var(--line); border-radius: 18px; padding: 18px; }
.h2-step-no { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--green-fill); color: var(--on-green); font-weight: 800; font-size: 1.1rem; }
.h2-steps strong { font-weight: 700; line-height: 1.35; padding-top: 8px; }

.h2-safe { margin: 40px 0 0; padding: 36px 24px 40px; border-radius: 32px; background: var(--band-sky); color: var(--on-band-sky); }
.h2-safe h2, .h2-on-green h2 { color: var(--on-band-sky); }
:root[data-theme="dark"] .home2 .h2-safe h2 { color: var(--on-band-sky); }
.h2-safe-list { list-style: none; margin: 0 auto; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; max-width: 1000px; }
.h2-safe-list li { display: flex; gap: 12px; align-items: flex-start; background: color-mix(in srgb, var(--on-band-sky) 6%, transparent); border: 1px solid color-mix(in srgb, var(--on-band-sky) 22%, transparent); border-radius: 18px; padding: 16px; }
.h2-safe-list .h2-round { width: 36px; height: 36px; flex: none; color: var(--on-green); }
.h2-safe-list .h2-round svg { width: 18px; height: 18px; }
.h2-teachers, .h2-sample, .h2-testi { padding: 44px 0 0; }
.h2-teacher-cards, .h2-testi-cards { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.h2-teacher-cards li, .h2-testi-cards li { background: var(--card-bg); border: 1px solid var(--line); border-radius: 18px; padding: 20px; text-align: center; }
.h2-teacher-cards img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; margin: 0 auto 10px; display: block; }
.h2-teacher-cards h3 { margin: 0 0 2px; font-size: 1.05rem; }
.h2-teacher-subject { margin: 0 0 4px; font-weight: 700; color: var(--green); }
.h2-testi-cards blockquote { margin: 0 0 10px; font-size: 1.02rem; }
.h2-sample-body { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; }
.h2-sample-body video, .h2-sample-body img { width: 100%; height: auto; border-radius: 18px; background: #000; }
.h2-close { margin: 56px 0 8px; padding: 36px 20px; text-align: center; border-radius: 32px; background: var(--green-soft); }
.h2-close h2 { margin: 0 0 8px; }
.h2-close p { margin: 0 0 16px; }
.h2-close .small { margin: 14px 0 0; }
@media (max-width: 860px) {
  .h2-steps { grid-template-columns: 1fr; }
  .h2-sample-body { grid-template-columns: 1fr; }
}
.pub-topbar { justify-content: space-between; }
.pub-topbar .fam-lang { width: auto; flex: 0 0 auto; min-width: 150px; }
.pub-topbar .fam-lang-opt { padding-left: 16px; padding-right: 16px; }
.login-menu summary { white-space: nowrap; }

/* ============ Accessibility ============ */
/* The Log in menu is a button now */
.login-menu-btn { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 18px; border-radius: 999px; border: 1px solid var(--green); background: var(--surface); color: var(--green-dark); font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; white-space: nowrap; }
.login-menu ul[hidden] { display: none; }
.login-menu a { min-height: 44px; display: flex; align-items: center; }
/* The language switch: each choice is at least 44 x 44 px */
.fam-lang-opt { min-height: 44px; min-width: 44px; display: inline-flex; align-items: center; justify-content: center; }
.fam-lang-opt[aria-current='true'] { background: var(--green-soft); color: var(--green-dark); }
/* A visible outline on every link, button, menu and form control when it is reached by keyboard */
a:focus-visible, button:focus-visible, summary:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 6px;
}
.h2-safe a:focus-visible, .h2-safe button:focus-visible, .site-footer a:focus-visible, .site-footer button:focus-visible { outline-color: currentColor; }
:root[data-theme='dark'] a:focus-visible, :root[data-theme='dark'] button:focus-visible, :root[data-theme='dark'] summary:focus-visible, :root[data-theme='dark'] input:focus-visible, :root[data-theme='dark'] select:focus-visible, :root[data-theme='dark'] textarea:focus-visible { outline-color: var(--focus); }
/* Contrast: small coral text, placeholder text, and the night-mode green button all reach 4.5 : 1 */
.eyebrow, .h2-script-orange { color: var(--coral); }
:root[data-theme='dark'] .eyebrow, :root[data-theme='dark'] .h2-script-orange { color: var(--coral); }
input::placeholder, textarea::placeholder { color: #757575; }
:root[data-theme='dark'] .btn:not(.btn-ghost) { background: var(--action); border-color: var(--action); }
:root[data-theme='dark'] .btn:not(.btn-ghost):hover { background: var(--action-hover); border-color: var(--action-hover); }
/* The heading's small label keeps its pill look */
.h2-sec-head h2 .h2-pill { display: block; width: fit-content; margin: 0 auto 8px; font-size: .85rem; }

/* The family PIN: four big digits */
.pin-input { font-size: 1.8rem; letter-spacing: .6em; text-align: center; max-width: 11rem; min-height: 56px; }

/* The partner card sits on cream inside the green footer: its text must be dark, not the footer's light text */
.site-footer .footer-partner { background: var(--surface); border-color: var(--surface); }
.site-footer .footer-partner strong { color: var(--green-dark); }
.site-footer .footer-partner span, .site-footer .footer-partner small { color: var(--muted); }
.site-footer .footer-partner:hover, .site-footer .footer-partner:focus-visible { border-color: var(--action); }
.site-footer .footer-partner { max-width: 100%; box-sizing: border-box; }
.site-footer .footer-partner span { min-width: 0; }
.site-footer .footer-partner strong, .site-footer .footer-partner small { overflow-wrap: anywhere; }
.site-footer .footer-partner small { font-size: .74rem; }

/* ============ Policy pages (Privacy, Platform Usage): hero, tabs, contents, numbered cards ============ */
.legal.legal-page { max-width: none; display: grid; grid-template-columns: minmax(0, 46rem) 17rem; grid-template-areas: 'hero hero' 'body toc'; gap: 0 32px; justify-content: center; padding-bottom: 32px; }
.legal-hero { grid-area: hero; margin: 0 auto 24px; width: 100%; max-width: 67rem; padding: 28px 28px 20px; border-radius: 28px; color: var(--on-band-leaf); background: radial-gradient(circle at 90% 10%, rgba(255, 255, 255, 0.16), transparent 40%), var(--band-leaf); box-shadow: 0 12px 30px rgba(59, 87, 25, 0.18); }
.legal-hero .eyebrow { color: var(--hero-hi); margin: 0 0 6px; }
.legal-hero h1 { margin: 0 0 10px; color: var(--on-band-leaf); font-size: clamp(1.8rem, 4.5vw, 2.6rem); line-height: 1.15; }
.legal-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.legal-chip { display: inline-block; padding: 4px 12px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.35); font-size: 0.85rem; font-weight: 600; }
.legal-lead { margin: 0 0 16px; max-width: 46rem; color: var(--on-band-leaf); line-height: 1.6; }
.legal-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.legal-tabs a, .legal-tabs button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 8px 16px; border-radius: 999px; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; color: var(--on-band-leaf); background: transparent; border: 2px solid color-mix(in srgb, var(--on-band-leaf) 45%, transparent); }
.legal-tabs a:hover, .legal-tabs button:hover { background: rgba(255, 255, 255, 0.14); }
.legal-tabs a.is-on { background: var(--on-band-leaf); color: var(--band-leaf); border-color: var(--on-band-leaf); }
.legal-tabs .legal-print { margin-left: auto; }
.legal-body { grid-area: body; min-width: 0; counter-reset: none; }
.legal-body > p, .legal-body > ul { max-width: 46rem; }
.legal-sec { background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 20px 22px 8px; margin: 0 0 16px; box-shadow: 0 4px 14px rgba(40, 30, 20, 0.06); scroll-margin-top: 84px; }
.legal-sec h2 { display: flex; align-items: center; gap: 12px; margin: 0 0 10px; font-size: 1.3rem; line-height: 1.25; }
.legal-num { flex: none; display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--green-fill); color: var(--on-green); font-size: 1rem; font-weight: 800; }
.legal-sec p, .legal-sec li { line-height: 1.65; }
.legal-sec ul { list-style: none; padding: 0; margin: 0 0 14px; }
.legal-sec li { position: relative; padding: 8px 12px 8px 34px; margin: 0 0 6px; border-radius: 12px; background: var(--green-soft); }
.legal-sec li::before { content: ''; position: absolute; left: 12px; top: 1.05em; width: 10px; height: 10px; border-radius: 50%; background: var(--green-fill); }
.legal-sec li strong { color: var(--green-dark); }
.legal-sec p:last-child { margin-bottom: 14px; }
.legal-toc { grid-area: toc; position: sticky; top: 84px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 22px; padding: 12px 14px; box-shadow: 0 4px 14px rgba(40, 30, 20, 0.06); }
.legal-toc summary { cursor: pointer; font-weight: 800; padding: 6px 4px; min-height: 32px; }
.legal-toc ol { list-style: none; margin: 8px 0 0; padding: 0; }
.legal-toc a { display: flex; gap: 10px; align-items: flex-start; padding: 8px 10px; border-radius: 12px; color: var(--ink); text-decoration: none; font-size: 0.93rem; line-height: 1.35; }
.legal-toc a span { flex: none; display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--green-soft); color: var(--green-dark); font-size: 0.8rem; font-weight: 800; }
.legal-toc a:hover { background: var(--green-soft); }
.legal-toc a.is-on { background: var(--green-soft); box-shadow: inset 0 0 0 2px var(--green); font-weight: 700; }
:root[data-theme='dark'] .legal-sec li, :root[data-theme='dark'] .legal-toc a:hover { background: var(--green-soft); }
:root[data-theme='dark'] .legal-sec li strong { color: var(--green-dark); }
:root[data-theme='dark'] .legal-toc a span { background: var(--green-soft); color: var(--green-dark); }
@media (max-width: 900px) {
  .legal.legal-page { grid-template-columns: minmax(0, 1fr); grid-template-areas: 'hero' 'toc' 'body'; }
  .legal-toc { position: static; max-height: none; margin: 0 0 16px; }
  .legal-hero { padding: 22px 18px 16px; border-radius: 22px; }
  .legal-tabs .legal-print { margin-left: 0; }
  .legal-sec { padding: 16px 14px 6px; }
}
@media print {
  .legal-hero { background: none; color: #000; box-shadow: none; padding: 0; }
  .legal-hero h1, .legal-lead, .legal-hero .eyebrow, .legal-chip { color: #000; border-color: #999; background: none; }
  .legal-tabs, .legal-toc, .rail, .topbar, .site-footer, .app-top { display: none !important; }
  .legal.legal-page { display: block; }
  .legal-sec { box-shadow: none; break-inside: avoid-page; border-color: #bbb; }
  .legal-sec li { background: none; }
}

/* ---------- School year, quarters and the semester report card ---------- */
.track-quarter { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem; margin: 1.1rem 0 0.4rem; padding: 0.35rem 0.7rem; border-radius: 10px; background: var(--green-soft); font-size: 1rem; }
.track-quarter.is-upcoming { background: #f3f3f3; color: #666; }
.track-quarter.is-current { background: var(--green-soft); border-left: 4px solid var(--green-fill); }
.track-later { margin: 0 0 0.6rem; padding: 0.6rem 0.8rem; border: 1px dashed #bbb; border-radius: 10px; color: #555; }
.year-line { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.4rem; list-style: none; padding: 0; margin: 0 0 1.2rem; }
.year-line-step { display: flex; flex-direction: column; align-items: center; gap: 0.1rem; padding: 0.55rem 0.3rem; border-radius: 12px; background: #f1f1f1; color: #666; text-align: center; }
.year-line-step.is-current { background: var(--green-fill); color: var(--on-green); }
.year-line-step.is-ended { background: var(--green-soft); color: var(--green-dark); }
.year-line-n { font-weight: 800; font-size: 1.15rem; }
.year-semester { margin: 0 0 1.6rem; }
.year-semester-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.6rem; margin-bottom: 0.6rem; }
.year-semester-head h2 { margin: 0; }
.year-quarters { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 0.9rem; }
.year-quarter header h3 { margin: 0; }
.year-quarter.is-current { border: 2px solid var(--green-fill); }
.year-quarter.is-later { background: #f7f7f7; }
.year-locked { margin: 0.6rem 0; color: #555; }
.year-progress small { display: block; margin-top: 0.25rem; color: #555; }
.year-subjects { list-style: none; margin: 0.6rem 0; padding: 0; font-size: 0.92rem; }
.year-subjects li { display: flex; justify-content: space-between; gap: 0.5rem; padding: 0.15rem 0; border-bottom: 1px dotted #e2e2e2; }
.year-exam { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem; margin-top: 0.8rem; padding: 0.7rem 0.8rem; border-radius: 12px; background: #fff8e6; border: 1px solid #f2dc9b; }
.year-exam.is-sat { background: var(--green-soft); border-color: color-mix(in srgb, var(--green-fill) 45%, var(--line)); }
.year-exam.is-later { background: #f1f1f1; border-color: #ddd; }
.year-exam-text { display: flex; flex-direction: column; }
.year-exam-result { display: flex; flex-direction: column; align-items: flex-end; text-decoration: none; color: inherit; }
.year-exam-result strong { font-size: 1.3rem; }
.year-exam-later { font-size: 0.9rem; color: #555; }
.year-final { margin-top: 0.9rem; }
.semester-card { padding: 1.4rem; }
.sem-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; align-items: center; border-bottom: 3px double var(--green); padding-bottom: 0.8rem; margin-bottom: 0.9rem; }
.sem-kicker { margin: 0; text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; color: var(--green-dark); font-weight: 700; }
.sem-head h2 { margin: 0.1rem 0; font-size: 1.7rem; }
.sem-sub { margin: 0; color: #555; }
.sem-overall { display: flex; flex-direction: column; align-items: center; padding: 0.6rem 1.1rem; border-radius: 14px; background: var(--green-soft); min-width: 7.5rem; }
.sem-overall strong { font-size: 2rem; line-height: 1.1; }
.sem-overall.tone-low { background: #fdecea; }
.sem-who { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 0.6rem 1rem; margin: 0 0 1rem; }
.sem-who dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: #777; }
.sem-who dd { margin: 0; font-weight: 700; }
.sem-note { padding: 0.55rem 0.8rem; border-radius: 10px; background: #fff3cd; }
.sem-table-wrap { overflow-x: auto; }
.sem-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; min-width: 640px; }
.sem-table th, .sem-table td { border: 1px solid #d5dbd6; padding: 0.35rem 0.4rem; text-align: center; }
.sem-table thead th { background: var(--green-fill); color: var(--on-green); font-weight: 600; }
.sem-table .left { text-align: left; }
.sem-table td small { display: block; color: #777; font-size: 0.72rem; }
.sem-table .strong { font-weight: 700; background: var(--green-soft); }
.sem-table tfoot td { font-weight: 700; background: var(--green-soft); }
.grade-cell { font-weight: 800; font-size: 1.05rem; }
.grade-cell.tone-great { color: var(--green-dark); }
.grade-cell.tone-low { color: #b3261e; }
.sem-stats { margin: 1rem 0; }
.sem-result { padding: 0.6rem 0.8rem; border-left: 4px solid var(--green); background: var(--green-soft); }
.sem-key { display: flex; flex-wrap: wrap; gap: 0.3rem 1rem; font-size: 0.8rem; color: #555; margin: 1rem 0; }
.sem-sign { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2.2rem; font-size: 0.85rem; color: #555; }
.sem-sign span { display: block; border-bottom: 1px solid #555; height: 1.6rem; margin-bottom: 0.25rem; }
@media print {
  .semester-card { box-shadow: none; border: 0; padding: 0; break-inside: avoid; }
  .sem-table thead th { background: #ddd !important; color: #000 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .no-print-card { display: none; }
}

/* The logo is green, and the footer is dark green: give it a cream round badge so it stands out. */
.site-footer .footer-logo .brand-logo {
  box-sizing: content-box;
  width: 28px;
  height: 28px;
  padding: 5px;
  background: #fffaf7;
  border-radius: 50%;
  vertical-align: -0.55em;
}

/* ============ Guided tours (driver.js) in the school's colours ============ */
.driver-popover.buqaya-tour {
  max-width: min(340px, 92vw);
  padding: 18px 18px 14px;
  border-radius: 18px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  box-shadow: 0 18px 50px rgba(10, 79, 43, 0.28);
}
.driver-popover.buqaya-tour .driver-popover-title {
  font-family: inherit;
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--green-dark);
}
.driver-popover.buqaya-tour .driver-popover-description {
  margin-top: 6px;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
}
.driver-popover.buqaya-tour .driver-popover-progress-text {
  color: var(--muted);
  font-size: 0.85rem;
}
.driver-popover.buqaya-tour .driver-popover-footer button {
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid var(--green-dark);
  background: var(--surface);
  color: var(--green-dark);
  font-family: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  text-shadow: none;
}
.driver-popover.buqaya-tour .driver-popover-footer .driver-popover-next-btn {
  background: var(--action);
  color: var(--on-action);
}
.driver-popover.buqaya-tour .driver-popover-close-btn {
  width: 44px;
  height: 44px;
  color: var(--green-dark);
}
.driver-popover.buqaya-tour .driver-popover-arrow-side-left.driver-popover-arrow,
.driver-popover.buqaya-tour .driver-popover-arrow-side-right.driver-popover-arrow,
.driver-popover.buqaya-tour .driver-popover-arrow-side-top.driver-popover-arrow,
.driver-popover.buqaya-tour .driver-popover-arrow-side-bottom.driver-popover-arrow {
  border-color: var(--surface);
}
.tour-help {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 2px solid var(--green-dark);
  background: var(--surface);
  color: var(--green-dark);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.tour-help:hover,
.tour-help:focus-visible {
  background: var(--green-soft);
}
.tour-row {
  margin: 0 0 12px;
}

/* ============ Landing: who are you? ============ */
.h2-gate {
  margin: 28px auto 36px;
  text-align: center;
}
.h2-gate h2 {
  margin: 0 0 6px;
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  color: var(--green-dark);
  text-wrap: balance;
}
.h2-gate-lead {
  max-width: 44rem;
  margin: 0 auto 20px;
  color: var(--ink);
  font-size: 1.05rem;
  line-height: 1.5;
  text-wrap: balance;
}
.h2-gate-cards {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.h2-gate-card {
  padding: 22px 18px 20px;
  border: 1.5px solid color-mix(in srgb, var(--green-dark) 55%, var(--line));
  border-radius: 18px;
  background: var(--surface);
  text-align: center;
}
.h2-gate-card.is-tutor {
  border-color: color-mix(in srgb, var(--coral) 50%, var(--line));
}
.h2-gate-card .h2-way-icon {
  margin-bottom: 8px;
}
.h2-gate-card.is-tutor .h2-way-icon {
  color: var(--coral);
}
.h2-gate-card h3 {
  margin: 0 0 4px;
  font-size: 1.25rem;
}
.h2-gate-card p {
  margin: 0 0 16px;
  color: var(--ink);
  opacity: 0.8;
}
.h2-gate-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.h2-gate-actions .btn {
  min-height: 48px;
}
.h2-gate-tour {
  margin: 14px 0 0;
}
.tour-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 6px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--green-dark);
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.tour-link .rail-icon,
.tour-help .rail-icon {
  width: 18px;
  height: 18px;
  flex: none;
}
.tour-link:hover,
.tour-link:focus-visible {
  background: var(--green-soft);
}
@media (max-width: 760px) {
  .h2-gate {
    margin-top: 20px;
  }
  .h2-gate-cards {
    grid-template-columns: 1fr;
  }
}

/* The public menu on a phone: a row of buttons under the brand, always visible. */
.public-quicknav {
  display: none;
}
@media (max-width: 860px) {
  .public-rail .public-quicknav {
    display: flex;
    order: 3;
    flex: 1 0 100%;
    gap: 6px;
    margin-top: 2px;
    padding: 2px 0 4px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .public-rail .public-quicknav::-webkit-scrollbar {
    display: none;
  }
  .public-rail {
    flex-wrap: wrap;
  }
  .public-quicknav a {
    flex: 1 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 6px 10px;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: var(--surface);
    color: var(--ink);
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    white-space: nowrap;
  }
  .public-quicknav a.active {
    border-color: var(--green-dark);
    background: var(--green-soft);
    color: var(--green-dark);
  }
  .has-rail:has(.public-rail) .shell-main {
    padding-top: 124px;
  }
}

/* ============ Landing hero: the deep green panel, turned up ============
   The page already owns this green (the "Safe for your child" band) and the coral flourish. The first screen
   now uses them at full strength, so the page opens and closes on the same colour. */
.home2 .h2-hero {
  position: relative;
  margin: 0 0 8px;
  padding: clamp(28px, 5vw, 52px);
  gap: clamp(24px, 4vw, 56px);
  grid-template-columns: 1.15fr 0.85fr;
  border-radius: 28px;
  background: var(--band-leaf);
  color: var(--on-band-leaf);
}
.home2 .h2-hero h1 {
  margin: 0 0 22px;
  font-size: clamp(2.4rem, 4.8vw, 3.8rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--on-band-leaf);
  text-wrap: balance;
}
:root[data-theme='dark'] .home2 .h2-hero h1 {
  color: var(--on-band-leaf);
}
.home2 .h2-hero .h2-hi {
  color: var(--hero-hi);
  padding-bottom: 10px;
  background-size: 100% 8px;
}
.home2 .h2-hero .h2-lead {
  max-width: 30rem;
  margin: 0 0 18px;
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  line-height: 1.5;
  color: var(--on-band-leaf);
}
.home2 .h2-hero .h2-motto {
  background: color-mix(in srgb, var(--on-band-leaf) 8%, transparent);
  color: var(--on-band-leaf);
  font-size: 0.95rem;
}
.home2 .h2-hero .h2-actions {
  margin-bottom: 22px;
}
.home2 .h2-hero .btn {
  min-height: 52px;
  padding-inline: 28px;
  border-color: var(--action);
  background: var(--action);
  color: var(--on-action);
  font-size: 1.05rem;
}
.home2 .h2-hero .btn:hover {
  background: var(--action-hover);
  border-color: var(--action-hover);
}
.home2 .h2-hero .h2-badges {
  border-top-color: color-mix(in srgb, var(--on-band-leaf) 25%, transparent);
  color: var(--on-band-leaf);
}
.home2 .h2-hero .h2-badge-icon {
  background: var(--surface);
  color: var(--green-dark);
}
.home2 .h2-hero .h2-blob {
  background: rgba(255, 255, 255, 0.14);
}
@media (max-width: 860px) {
  .home2 .h2-hero {
    grid-template-columns: 1fr;
    border-radius: 22px;
  }
}

/* ============ Landing: one type system ============
   Roles: display (hero), section heading, card heading, body, label. One size per role, balanced headings,
   a 16px body floor, and a little extra air for light text on the green panels. */
.home2 h1,
.home2 h2,
.home2 h3 {
  text-wrap: balance;
}
.home2 p,
.home2 li {
  text-wrap: pretty;
}
/* section headings: five different sizes before, one now */
.home2 .h2-gate h2,
.home2 .h2-sec-head h2,
.home2 .h2-band h2,
.home2 .h2-ways h2,
.home2 .h2-story-copy h2,
.home2 .fam-section-head h2,
.home2 .h2-faq h2 {
  font-size: clamp(1.55rem, 3.4vw, 2.1rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
}
/* card headings */
.home2 .h2-gate-card h3,
.home2 .h2-way-cards h3 {
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.25;
}
/* body copy is never below 16px */
.home2 .h2-way-cards p,
.home2 .h2-motto,
.home2 .h2-motto p {
  font-size: 1rem;
  line-height: 1.55;
}
.home2 .h2-badges {
  font-size: 0.92rem;
  font-weight: 700;
}
/* light text on the green panels: a touch more weight, tracking and leading */
.home2 .h2-hero .h2-lead,
.home2 .h2-hero .h2-motto,
.home2 .h2-hero .h2-badges,
.home2 .h2-safe-list li {
  font-weight: 500;
  letter-spacing: 0.01em;
}
.home2 .h2-safe-list li {
  line-height: 1.6;
}
/* Ge'ez letters are taller and need more leading than Latin ones */
html[lang='am'] .home2 h1 {
  line-height: 1.28;
  letter-spacing: 0;
}
html[lang='am'] .home2 h2,
html[lang='am'] .home2 h3 {
  line-height: 1.35;
  letter-spacing: 0;
}
html[lang='am'] .home2 p,
html[lang='am'] .home2 li {
  line-height: 1.75;
  letter-spacing: 0;
}

/* The tour speaks in the school's own typeface (driver.js sets Helvetica on everything inside it). */
.driver-popover.buqaya-tour,
.driver-popover.buqaya-tour * {
  font-family: inherit;
}

/* ============ Landing page without a side menu ============
   The brand sits at the left of the top row, next to the language switch and the Log in menu. */
.shell.no-rail .shell-main {
  width: 100%;
}
.pub-topbar {
  flex-wrap: wrap;
}
.pub-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-right: auto;
  color: var(--ink);
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.05;
  text-decoration: none;
}
.pub-brand small {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
}
.pub-brand .brand-logo {
  flex: none;
}
@media (max-width: 560px) {
  .pub-brand {
    order: 1;
  }
  .pub-topbar .login-menu {
    order: 2;
  }
  .pub-topbar .fam-lang {
    order: 3;
  }
}

/* Long reading text on the landing page is justified on screens wide enough for it; phones keep a ragged right edge,
   where a narrow justified column would open big gaps between words. */
@media (min-width: 640px) {
  .home2 .h2-story-copy p:not(.h2-script),
  .home2 .h2-faq-item p {
    text-align: justify;
    text-justify: inter-word;
    hyphens: auto;
  }
}

/* ============ The school page: subjects as a plain list ============ */
.subject-group {
  margin: 36px 0 0;
}
.subject-group h2 {
  margin: 0 0 4px;
  font-size: clamp(1.4rem, 3vw, 1.8rem);
  color: var(--green-dark);
}
.subject-group-lead {
  margin: 0 0 12px;
  color: var(--muted);
}
.subject-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.subject-list li {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) 1fr;
  gap: 4px 24px;
  align-items: baseline;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.subject-list strong {
  font-size: 1.1rem;
}
.subject-list span {
  color: var(--ink);
}
@media (max-width: 560px) {
  .subject-list li {
    grid-template-columns: 1fr;
  }
}

/* ============ Plans page: only what tells the plans apart ============ */
.plan-more {
  margin: 10px 0 0;
}
.plan-more summary {
  cursor: pointer;
  color: var(--green-dark);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.plan-more[open] summary {
  margin-bottom: 8px;
}
.plans-promise-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}
.plans-partner-line {
  margin: 20px 0 0;
}

/* Tutors page: the three steps are plain words, no icons. */
.tt-flow strong {
  font-size: 1.1rem;
}

/* ============ Family bank: one row per child, forms open on demand ============ */
.bank-accounts {
  display: block;
}
.bank-account {
  margin: 0 0 12px;
  padding: 0;
  border-top-width: 1px;
}
.bank-account-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  padding: 16px 18px;
  cursor: pointer;
  list-style-position: inside;
}
.bank-account-who {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 1.2rem;
}
.bank-sum {
  display: inline-flex;
  gap: 24px;
}
.bank-sum > span {
  display: grid;
}
.bank-sum small {
  font-size: 0.8rem;
}
.bank-sum strong {
  font-size: 1.15rem;
}
.bank-pending {
  display: inline-block;
  margin-left: 6px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--yellow-soft);
  color: var(--yellow-ink);
  font-size: 0.85rem;
  font-weight: 700;
}
.bank-account-body {
  padding: 0 18px 18px;
  display: grid;
  gap: 12px;
}
.bank-more-all > summary {
  padding: 4px 0;
}
.bank-folds {
  display: grid;
  gap: 12px;
  margin: 0 0 22px;
}
.bank-fold > summary {
  cursor: pointer;
  list-style-position: inside;
}
.bank-fold > summary h2 {
  display: inline;
  margin: 0;
  font-size: 1.2rem;
}
.bank-fold[open] > summary {
  margin-bottom: 12px;
}
.bank-account-summary {
  list-style: none;
}
.bank-account-summary::-webkit-details-marker {
  display: none;
}
.bank-account-summary::after {
  content: '▾';
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--green-dark);
  transition: transform 0.15s ease-out;
}
.bank-account[open] > .bank-account-summary::after {
  transform: rotate(180deg);
}
.bank-account-who {
  flex: 1 1 auto;
}
.bank-account-summary .bank-sum {
  margin-left: auto;
}

/* ============ Lessons page: where to start, then one subject at a time ============ */
.stage-start {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  margin: 0 0 8px;
  padding: 18px 20px;
  border-radius: var(--radius);
  background: var(--green-soft);
  border: 1px solid var(--line);
}
.stage-start h2 {
  margin: 0 0 4px;
  font-size: 1.2rem;
}
.stage-start p {
  margin: 0;
}
.stage-hint {
  margin: 0 0 18px;
}
.track-next {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 10px 0 8px;
  padding: 12px 14px;
  border: 2px solid var(--green);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}
.track-next:hover,
.track-next:focus-visible {
  background: var(--green-soft);
}
.track-next-label {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--green-dark);
}
.track-next strong {
  flex: 1 1 auto;
}
.track-done {
  margin: 10px 0 8px;
  font-weight: 700;
  color: var(--green-dark);
}
.track-all > summary {
  cursor: pointer;
  padding: 8px 0;
  font-weight: 700;
  color: var(--green-dark);
}
.track-all[open] > summary {
  margin-bottom: 8px;
}

/* ============ Report cards: one child at a time, opened on request ============ */
.report-summary,
.sem-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 20px;
  cursor: pointer;
  list-style: none;
}
.report-summary::-webkit-details-marker,
.sem-summary::-webkit-details-marker {
  display: none;
}
.report-summary::after,
.sem-summary::after {
  content: '▾';
  margin-left: auto;
  font-size: 1.2rem;
  color: var(--green-dark);
}
details[open] > .report-summary::after,
details[open] > .sem-summary::after {
  transform: rotate(180deg);
}
.report-summary .report-card-head {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  gap: 14px;
  margin: 0;
}
.report-who {
  display: grid;
  gap: 2px;
}
.report-who > strong {
  font-size: 1.2rem;
}
.report-body,
.sem-body {
  margin-top: 16px;
}
.sem-summary-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
}
.sem-summary-mark strong {
  font-size: 1.4rem;
}
.report-more {
  margin: 14px 0 0;
}
.report-more > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--green-dark);
}
@media print {
  .sem-summary {
    display: none;
  }
}
.report-summary .report-overall {
  display: inline-grid;
  gap: 0;
  padding: 6px 14px;
  min-width: 0;
  text-align: center;
}
.report-summary .report-overall small {
  display: none;
}
.report-summary .report-overall strong {
  font-size: 1.3rem;
  line-height: 1.2;
}
.report-card {
  margin: 0 0 12px;
}

/* Footer contact lines: drawn icons in the footer's own text colour. */
.site-footer .footer-contact {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--on-band-blush);
}
.site-footer .footer-contact .rail-icon {
  width: 20px;
  height: 20px;
  flex: none;
  color: var(--band-blush-head);
}
/* The FAQ is as wide as the sections around it. */
.home2 .h2-faq {
  max-width: none;
}
@media (max-width: 560px) {
  .footer-col:has(.footer-contact) {
    grid-column: 1 / -1;
  }
}

/* ============ Kids' world: tabs ============ */
.kids-tabs {
  display: flex;
  gap: 6px;
  margin: 0 0 20px;
  padding: 6px;
  border-radius: 999px;
  background: var(--green-soft);
  box-shadow: inset 0 0 0 1px rgba(10, 79, 43, 0.12);
  overflow-x: auto;
  scrollbar-width: none;
}
.kids-tabs::-webkit-scrollbar {
  display: none;
}
.kids-tab {
  flex: 1 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 20px;
  border-radius: 999px;
  color: var(--green-dark);
  font-weight: 800;
  font-size: 1.05rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.15s ease-out, box-shadow 0.15s ease-out;
}
.kids-tab:hover {
  background: rgba(255, 255, 255, 0.7);
}
.kids-tab.is-on {
  background: var(--green-dark);
  color: #fff;
  box-shadow: 0 6px 14px -6px rgba(10, 79, 43, 0.6);
}
.kids-tab-emoji {
  font-size: 1.25rem;
  line-height: 1;
}
.kids-tab-badge {
  min-width: 1.5em;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--coral-soft);
  color: var(--coral);
  font-size: 0.85rem;
  line-height: 1.6;
  text-align: center;
}
.kids-tab.is-on .kids-tab-badge {
  background: #fff;
}
@media (max-width: 560px) {
  .kids-tab {
    padding: 8px 14px;
    font-size: 0.95rem;
  }
  .kids-tab-emoji {
    font-size: 1.1rem;
  }
}
@media (max-width: 560px) {
  .kids-tabs {
    border-radius: 22px;
    gap: 4px;
    overflow-x: visible;
  }
  .kids-tab {
    flex: 1 1 0;
    flex-direction: column;
    gap: 2px;
    min-height: 58px;
    padding: 6px 4px;
    border-radius: 18px;
    font-size: 0.82rem;
  }
  .kids-tab-badge {
    position: absolute;
    margin: -4px 0 0 28px;
    font-size: 0.75rem;
  }
  .kids-tab {
    position: relative;
  }
}

/* ============ Books: the library and the reader ============ */
.book-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
  margin: 0 0 18px;
}
.book-card {
  display: grid;
  gap: 6px;
  align-content: start;
  min-height: 140px;
  padding: 16px;
  border: 1px solid var(--line);
  border-top: 5px solid var(--green);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  box-shadow: var(--shadow);
}
.book-card:hover,
.book-card:focus-visible {
  background: var(--green-soft);
}
.book-card strong {
  font-size: 1.2rem;
  line-height: 1.25;
}
.book-level {
  font-size: 0.8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--green-dark);
}
.book-meta {
  color: var(--muted);
  font-size: 0.9rem;
}
.book-all > summary {
  cursor: pointer;
  font-weight: 700;
  color: var(--green-dark);
  padding: 8px 0;
}
.book-list {
  list-style: none;
  margin: 8px 0 0;
  padding: 0;
  border-top: 1px solid var(--line);
}
.book-list a {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 4px 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}
.book-list-title {
  font-weight: 700;
}
.book-source {
  margin-top: 20px;
}
.reader {
  max-width: 46rem;
  margin: 0 auto;
}
.reader-head {
  text-align: center;
}
.reader-head h1 {
  margin-bottom: 4px;
  font-size: clamp(1.5rem, 3.4vw, 2rem);
}
.reader-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 10px 0 18px;
}
.reader-dots span {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--line);
}
.reader-dots .is-seen {
  background: var(--green);
  opacity: 0.55;
}
.reader-dots .is-now {
  width: 26px;
  border-radius: 999px;
  background: var(--green-dark);
}
.reader-page {
  min-height: 12rem;
  padding: clamp(20px, 4vw, 40px);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: var(--shadow);
  font-size: clamp(1.45rem, 3.6vw, 2.1rem);
  line-height: 1.6;
  white-space: pre-line;
  text-align: center;
  display: grid;
  place-items: center;
}
.reader-tools {
  margin: 14px 0 0;
  text-align: center;
}
.reader-nav {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 18px 0 0;
}
.reader-nav .btn {
  min-width: 8rem;
}
.reader-end {
  margin: 20px 0 0;
  text-align: center;
}
.reader-credit {
  margin: 14px 0 0;
  text-align: center;
}

/* ============ Night mode: the guided tour card is a night surface too ============ */
:root[data-theme='dark'] .driver-popover.buqaya-tour {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--line);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.6);
}
:root[data-theme='dark'] .driver-popover.buqaya-tour .driver-popover-title,
:root[data-theme='dark'] .driver-popover.buqaya-tour .driver-popover-close-btn {
  color: var(--green-dark);
}
:root[data-theme='dark'] .driver-popover.buqaya-tour .driver-popover-footer button {
  background: var(--bg-3);
  border-color: var(--green);
  color: var(--green-dark);
}
:root[data-theme='dark'] .driver-popover.buqaya-tour .driver-popover-footer .driver-popover-next-btn {
  background: var(--action);
  border-color: var(--action);
  color: var(--on-action);
}
:root[data-theme='dark'] .driver-popover.buqaya-tour .driver-popover-arrow-side-left.driver-popover-arrow,
:root[data-theme='dark'] .driver-popover.buqaya-tour .driver-popover-arrow-side-right.driver-popover-arrow,
:root[data-theme='dark'] .driver-popover.buqaya-tour .driver-popover-arrow-side-top.driver-popover-arrow,
:root[data-theme='dark'] .driver-popover.buqaya-tour .driver-popover-arrow-side-bottom.driver-popover-arrow {
  border-color: var(--surface);
}

/* ============ Night mode: things that were set in day colours only ============ */
:root[data-theme='dark'] .kids-tab:hover {
  background: rgba(255, 255, 255, 0.08);
}
:root[data-theme='dark'] .kids-tab.is-on {
  background: var(--green-fill);
  color: var(--on-green);
  box-shadow: 0 6px 14px -6px rgba(0, 0, 0, 0.6);
}
:root[data-theme='dark'] .kids-tab-badge {
  background: var(--coral-soft);
  color: var(--coral);
}
:root[data-theme='dark'] .kids-tab.is-on .kids-tab-badge {
  background: #fff;
  color: #b83a2f;
}
:root[data-theme='dark'] .track-quarter {
  background: var(--bg-3);
}
:root[data-theme='dark'] .track-quarter.is-upcoming {
  background: var(--bg-2);
  color: var(--muted);
}
:root[data-theme='dark'] .track-quarter.is-current {
  background: var(--green-soft);
  border-left-color: var(--green);
}
:root[data-theme='dark'] .lang-symbol {
  color: var(--green-dark);
}
:root[data-theme='dark'] :is(.tag-english, .tag-maths, .tag-languages, .tag-business, .tag-creative, .tag-talent, .tag-tech, .tag-world, .tag-arts) {
  background: color-mix(in srgb, var(--accent) 24%, var(--surface));
  color: color-mix(in srgb, var(--accent) 45%, #fff);
}

/* Night mode: surfaces and text that were set in day colours only (year, coins, semester report, tutor cards, games). */
:root[data-theme='dark'] .peace-line,
:root[data-theme='dark'] .robot-chip,
:root[data-theme='dark'] .robot-board {
  background: var(--bg-3);
  color: var(--ink);
}
:root[data-theme='dark'] .robot-cell.has-robot {
  background: var(--yellow-soft);
}
:root[data-theme='dark'] .peace-line.is-done {
  background: var(--green-soft);
  color: var(--green-dark);
}
:root[data-theme='dark'] .habit-dot.is-future {
  opacity: 0.8;
}
:root[data-theme='dark'] .fam-motto,
:root[data-theme='dark'] .golive-bar,
:root[data-theme='dark'] .golive-steps li.is-next,
:root[data-theme='dark'] .tutor-demand,
:root[data-theme='dark'] .tutor-preview-card,
:root[data-theme='dark'] .legal-sec li,
:root[data-theme='dark'] .legal-toc a:hover,
:root[data-theme='dark'] .legal-toc a.is-on,
:root[data-theme='dark'] .tour-link:hover,
:root[data-theme='dark'] .tour-link:focus-visible,
:root[data-theme='dark'] .public-quicknav a.active {
  background: var(--green-soft);
  color: var(--ink);
}
:root[data-theme='dark'] .legal-sec li strong,
:root[data-theme='dark'] .is-next .golive-mark {
  color: var(--green-dark);
}
:root[data-theme='dark'] .year-line-step {
  background: var(--bg-3);
  color: var(--muted);
}
:root[data-theme='dark'] .year-line-step.is-current {
  background: var(--green-fill);
  color: var(--on-green);
}
:root[data-theme='dark'] .year-line-step.is-ended {
  background: var(--green-soft);
  color: var(--green-dark);
}
:root[data-theme='dark'] .year-quarter.is-later,
:root[data-theme='dark'] .year-exam.is-later {
  background: var(--bg-2);
}
:root[data-theme='dark'] .year-exam,
:root[data-theme='dark'] .sem-note {
  background: var(--yellow-soft);
  color: var(--ink);
}
:root[data-theme='dark'] .year-exam.is-sat,
:root[data-theme='dark'] .sem-overall,
:root[data-theme='dark'] .sem-result,
:root[data-theme='dark'] .sem-table .strong {
  background: var(--green-soft);
  color: var(--ink);
}
:root[data-theme='dark'] .sem-overall.tone-low {
  background: var(--red-soft);
}
:root[data-theme='dark'] .sem-table tfoot td {
  background: var(--bg-3);
}
:root[data-theme='dark'] .track-later,
:root[data-theme='dark'] .year-locked,
:root[data-theme='dark'] .year-progress small,
:root[data-theme='dark'] .year-exam-later,
:root[data-theme='dark'] .sem-sub,
:root[data-theme='dark'] .sem-key,
:root[data-theme='dark'] .sem-sign,
:root[data-theme='dark'] .sem-who dt,
:root[data-theme='dark'] .sem-table td small {
  color: var(--muted);
}
:root[data-theme='dark'] .sem-kicker,
:root[data-theme='dark'] .grade-cell.tone-great,
:root[data-theme='dark'] .word-say,
:root[data-theme='dark'] .fidel-table thead th,
:root[data-theme='dark'] .fidel-say {
  color: var(--green-dark);
}
:root[data-theme='dark'] .grade-cell.tone-low,
:root[data-theme='dark'] .flash-error {
  color: var(--red);
}
:root[data-theme='dark'] .flash-error,
:root[data-theme='dark'] .flash-info {
  border-color: var(--line);
}
:root[data-theme='dark'] .grade-warning {
  color: var(--yellow-ink);
}
:root[data-theme='dark'] input::placeholder,
:root[data-theme='dark'] textarea::placeholder {
  color: #9aa4b4;
}

/* ============ Admin: audit log ============ */
.audit-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-bottom: 16px;
}
.audit-filter label {
  flex: 1 1 260px;
}
.audit-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
.audit-table th,
.audit-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.audit-table code {
  word-break: break-all;
}

/* ============ Admin: two-step sign-in ============ */
.setup-key code {
  display: inline-block;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--bg-3);
  font-size: 1.15rem;
  letter-spacing: 0.08em;
  word-break: break-all;
}
.recovery-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 8px;
  padding: 0;
  list-style: none;
}
.recovery-list code {
  font-size: 1.05rem;
}
