.zone{margin-top:32px;padding:22px;border-radius:26px}.learning-zone{background:#eef5ff;border:1px solid #d8e7fb}.fun-zone{background:linear-gradient(135deg,#fff6d8,#fff0c3);border:1px solid #f3d888}.zone-label{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px}.zone-label span{font-weight:900;letter-spacing:.12em;color:#173b70}.zone-label small{color:#5e6f86}.fun-zone .zone-label span{color:#8a4f00}.fun-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.times-card{background:linear-gradient(135deg,#fff,#fff8df);border:1px solid #f0c44f}.times-card .big-symbol{background:#ffcc3d;color:#5c3800}.coding-teacher-card{background:linear-gradient(135deg,#163b70,#295f9f);color:#fff}.coding-teacher-card .big-symbol{background:#4ee0b5;color:#0b3450;font-family:monospace}.math-chooser{display:grid;grid-template-columns:1fr 1fr;gap:18px}.math-chooser[hidden],.question-box[hidden],[hidden]{display:none!important}.math-choice{border:2px solid #d7e4f2;background:#fff;border-radius:22px;padding:24px;text-align:left;display:grid;gap:8px;color:#173b70;cursor:pointer;transition:.2s}.math-choice:hover{transform:translateY(-2px);border-color:#4a82c5}.math-choice>b{font-size:1.7rem}.math-choice strong{font-size:1.25rem}.math-choice span{color:#63748a;line-height:1.45}.math-choice small{font-weight:800;color:#2a69b2}.problem-choice{border-color:#e7d5a1;background:#fffdf4}.text-button{border:0;background:none;color:#2a69b2;font-weight:800;cursor:pointer;justify-self:start;margin-bottom:12px}.times-icon{background:#ffcc3d;color:#5c3800}.times-game{text-align:center}.times-game #timesQuestion{font-size:clamp(2.6rem,8vw,5rem)}.times-game input{max-width:230px;margin-inline:auto;text-align:center;font-size:2rem}.times-results{margin-top:22px;padding:18px;border-radius:18px;background:#eef7ff;display:grid;gap:6px}.times-results strong{font-size:1.35rem;color:#173b70}
.coding-page{max-width:1120px;margin:0 auto}.coding-hero{background:linear-gradient(135deg,#102f5c,#245f96);color:#fff;border-radius:28px;padding:30px;display:flex;justify-content:space-between;align-items:center;gap:24px;margin-bottom:20px}.coding-hero p:last-child{margin:0;color:#d7e8f9;max-width:680px}.coding-level{min-width:150px;background:rgba(255,255,255,.12);border:1px solid rgba(255,255,255,.2);border-radius:20px;padding:16px;text-align:center}.coding-level span,.coding-level small{display:block}.coding-level strong{display:block;font-size:2.2rem;color:#5af0c3}.coding-layout{display:grid;grid-template-columns:300px minmax(0,1fr);gap:20px;align-items:start}.course-map,.lesson-workspace{background:#fff;border:1px solid #dce6f1;border-radius:24px;box-shadow:0 12px 30px rgba(18,54,92,.08)}.course-map{padding:16px;position:sticky;top:92px;max-height:calc(100vh - 115px);overflow:auto}.course-map-head{display:flex;justify-content:space-between;align-items:center;padding:4px 6px 12px}.course-map-head small{color:#64758b}.track{border-top:1px solid #e6edf5;padding-top:13px;margin-top:8px}.track-title{display:flex;gap:8px;align-items:center;padding:0 5px 8px;color:#173b70}.course-lesson{width:100%;border:0;background:transparent;border-radius:13px;padding:9px;text-align:left;display:grid;grid-template-columns:32px 1fr;gap:9px;align-items:center;cursor:pointer}.course-lesson>span{width:30px;height:30px;border-radius:10px;background:#e9f0f8;display:grid;place-items:center;font-weight:900;color:#345b87}.course-lesson strong,.course-lesson small{display:block}.course-lesson strong{font-size:.88rem}.course-lesson small{font-size:.72rem;color:#758397}.course-lesson.active{background:#eaf4ff}.course-lesson.active>span{background:#2468b2;color:#fff}.course-lesson.done>span{background:#24a77a;color:#fff}.course-lesson:disabled{opacity:.46;cursor:not-allowed}.lesson-workspace{padding:26px}.lesson-top{display:flex;justify-content:space-between;gap:16px}.lesson-top h2{font-size:1.8rem;margin:13px 0 7px}.lesson-top p{color:#607086}.teacher-note{display:flex;gap:13px;background:#eafaf5;border:1px solid #c4ebdf;border-radius:17px;padding:15px;margin:20px 0}.teacher-note>span{font-size:1.7rem}.teacher-note p{margin:2px 0 0;color:#385b54}.lesson-tabs{display:flex;border-bottom:1px solid #dae5f0;margin-top:22px}.lesson-tabs button{border:0;background:none;padding:12px 18px;font-weight:850;color:#63748a;cursor:pointer}.lesson-tabs button.active{color:#1762ae;border-bottom:3px solid #1762ae}.code-tab{display:none;padding-top:20px}.code-tab.active{display:block}.tutorial-note{background:#f3f7fc;border-radius:16px;padding:16px}.tool-link{display:inline-block;margin-top:6px;color:#1267b5;font-weight:850}.interactive-steps{list-style:none;padding:0;counter-reset:steps}.interactive-steps li{counter-increment:steps;margin:10px 0}.interactive-steps label{display:grid;grid-template-columns:26px 1fr;gap:10px;padding:13px;border:1px solid #dae5f0;border-radius:14px;cursor:pointer}.interactive-steps input{width:20px;height:20px}.interactive-steps label:has(input:checked){background:#eefaf6;border-color:#a9dbc9}.code-example{background:#10263e;color:#eaf4ff;border-radius:16px;overflow:hidden;margin:16px 0}.code-bar{display:flex;justify-content:space-between;align-items:center;padding:9px 14px;background:#183653;font-size:.82rem}.code-bar button{border:0;background:#4ee0b5;color:#073347;border-radius:8px;padding:5px 10px;font-weight:800}.code-example pre{margin:0;padding:18px;overflow:auto;line-height:1.65}.code-tab textarea{width:100%;border:2px solid #d7e3ef;border-radius:14px;padding:14px;resize:vertical}.check-choices{display:grid;gap:10px}.check-choices button{border:2px solid #d8e4ef;background:#fff;border-radius:13px;padding:13px;text-align:left;font-weight:750;cursor:pointer}.check-choices button.correct{border-color:#22a576;background:#eaf9f3}.check-choices button.wrong{border-color:#cf4b4b;background:#fff0f0}.lesson-nav{display:flex;justify-content:space-between;gap:12px;margin-top:22px}.lesson-nav .primary{width:auto;margin:0}.lesson-nav button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:820px){.zone{padding:15px}.zone-label{align-items:flex-start;gap:6px;flex-direction:column}.fun-grid,.math-chooser{grid-template-columns:1fr}.coding-hero{align-items:flex-start;flex-direction:column}.coding-level{width:100%}.coding-layout{grid-template-columns:1fr}.course-map{position:static;max-height:330px}.lesson-workspace{padding:18px}.lesson-top{flex-direction:column}.lesson-top .secondary{align-self:flex-start}}
.break-screen button{border:0;border-radius:10px;padding:9px 12px;background:#fff;color:#173b70;font-weight:850;cursor:pointer}.break-screen{position:fixed;inset:0;z-index:90;background:rgba(10,30,56,.72);backdrop-filter:blur(7px);display:grid;place-items:center;padding:20px}.break-screen[hidden]{display:none}.break-screen>div{width:min(440px,100%);background:#fff;text-align:center;border-radius:26px;padding:34px;box-shadow:0 24px 70px rgba(0,0,0,.3)}.break-screen span{font-size:3rem}.break-screen h2{font-size:1.7rem;margin:10px 0}.break-screen strong{display:block;font-size:2.5rem;color:#2468b2;margin:17px 0}.break-screen button{background:#2468b2;color:#fff}
/* The Parent View language switch. It replaced the "Coach voice" buttons that lived in the
   Focus Summary card, so it keeps the same quiet shape: a small labelled pair of buttons
   that reads as a setting rather than as an action. */
.parent-language{align-items:center;margin:12px 0 18px;display:flex;gap:8px;flex-wrap:wrap}
.parent-language span{color:#617187}
.parent-language button{border:1px solid #cbd9e8;background:#fff;border-radius:9px;padding:6px 12px;font-weight:800;cursor:pointer;color:#173b70}
.parent-language button.active{background:#173b70;color:#fff;border-color:#173b70}
/* Typing: the sentence lights up letter by letter. Each character is its own span
  (see renderTypingTarget in app.js), so a letter that was typed correctly keeps a
  green tint while a wrong one stays plain. `pre-wrap` keeps the spaces inside those
  spans from collapsing, so the sentence still reads and wraps normally. */
.typing-target{white-space:pre-wrap}
.typing-target span{transition:background-color .15s ease,color .15s ease}
.typing-target span.ok{background:#c9f2df;color:#0b6b45;border-radius:5px}
.typing-target span.next{box-shadow:inset 0 -2px 0 #8fb4ea}
/* Typing: the "start again" control that clears today's typing progress. Deliberately quiet:
  it sits under the check button, where the parent will find it and a child will not hunt
  for it. */
.typing-restart{display:block;margin:14px auto 0;background:none;border:0;color:#5e6f86;font-weight:800;font-size:.9rem;text-decoration:underline;cursor:pointer;padding:6px 10px;border-radius:10px}
.typing-restart:hover{color:#173b70;background:#eef4fb}

/* ---------------------------------------------------------------------------
  The sign-in gate. It covers the station until someone signs in, because every
  learning store below it belongs to an account. One card, the list of accounts on
  this device's family, and a form that swaps between "register" and "sign in". */

body.gate-open { overflow: hidden; }

/* The gate covers the whole viewport, so it is only ever right to have it in the page when it is the
   thing being looked at. Until this rule existed there was no way to say "in the page, but not
   shown": the gate used to be built only when nobody was signed in, and its own `display: grid`
   outranks the user agent's `[hidden] { display: none }`, so `hidden` alone would not have hidden
   it. A session that exists and cannot authenticate needs exactly that state -- the station's page
   stays, the child keeps their own records, and the gate waits unshown until the "sign in again"
   button asks for it (accounts.js's requireSignIn). */
.gate[hidden] { display: none; }

.gate {
 position: fixed;
 inset: 0;
 z-index: 90;
 display: grid;
 place-items: center;
 padding: 20px;
 background: linear-gradient(160deg, #eef5ff, #f7fbff 60%, #fff7e6);
 overflow: auto;
}

.gate-card {
 width: min(440px, 100%);
 background: #fff;
 border: 1px solid var(--line);
 border-radius: 26px;
 padding: 26px;
 box-shadow: var(--shadow);
}

.gate-card h1 { margin: 0; font-size: 1.7rem; letter-spacing: -.03em; }

.gate-lede { margin: 6px 0 18px; color: var(--muted); font-weight: 600; }

.gate-list { display: grid; gap: 10px; }

/* The sign-in screen lists nobody, so there is no .gate-account to style: it is a form. */

.gate-form { display: grid; gap: 10px; margin-top: 16px; }

.gate-label { font-weight: 800; font-size: .9rem; color: var(--navy); }

.gate-name, .gate-pin {
 font: inherit;
 font-weight: 800;
 border: 2px solid var(--line);
 border-radius: 14px;
 padding: 13px 15px;
 background: #fbfdff;
}

/* The password field is ordinary text now, not four centred digits: a password can be any
   4-64 characters, so it is typed and read like a word processor line. */
.gate-pin { width: 100%; letter-spacing: normal; text-align: left; font-size: 1rem; }
/* Show/hide for a password field, as a quiet text button under the box it belongs to. */
.gate-reveal {
 align-self: start;
 border: 0;
 background: none;
 color: var(--muted);
 font: inherit;
 font-weight: 800;
 font-size: .9rem;
 text-decoration: underline;
 cursor: pointer;
 padding: 4px 2px;
 border-radius: 8px;
}
.gate-reveal:hover { color: var(--navy); background: #eef4fb; }
.gate-name:focus, .gate-pin:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px #e6efff; }

.gate-submit, .gate-add, .gate-back {
 border: 0;
 border-radius: 14px;
 padding: 14px 18px;
 font-weight: 850;
 font-size: 1rem;
 cursor: pointer;
}

.gate-submit { background: var(--blue); color: #fff; }
.gate-add { background: var(--sky); color: var(--navy); }
.gate-back { background: none; color: var(--muted); text-decoration: underline; }
.gate-submit:disabled { opacity: .6; cursor: progress; }

.gate-actions { display: grid; gap: 8px; }
.gate-hint { margin: 4px 0 0; color: var(--muted); font-size: .86rem; font-weight: 600; }

.gate-message { min-height: 22px; margin: 12px 0 0; font-weight: 800; }
.gate-message.is-bad { color: var(--red); }
.gate-message.is-good { color: var(--green); }

/* ===================== the sign-in gate's doors (D4) =====================
   The gate is now four doors rather than one form: a child's account, a grown-up's email account,
   a grown-up registering, and a forgotten password. The bar is a wrapping row, so it becomes two
   rows on a narrow phone and stays one line on a tablet or a desktop; the language switch sits at
   its end. Everything is a plain button, so a keyboard and a screen reader get the same order. */
.gate-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 14px;
  padding: 0 0 12px;
  border-bottom: 1px solid #e4ebf5;
}
.gate-tab {
  border: 1px solid #d8e4f2;
  background: #f4f8fd;
  color: var(--navy);
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  font-size: .9rem;
  padding: 8px 14px;
  cursor: pointer;
  min-height: 40px;
}
.gate-tab:hover { background: #e9f2fc; }
.gate-tab.active { background: var(--blue); border-color: var(--blue); color: #fff; }
.gate-lang { display: flex; gap: 6px; margin-left: auto; }
.gate-lang-btn {
  border: 1px solid #d8e4f2;
  background: #fff;
  color: var(--muted);
  border-radius: 999px;
  font: inherit;
  font-weight: 800;
  font-size: .82rem;
  padding: 7px 12px;
  cursor: pointer;
  min-height: 36px;
}
.gate-lang-btn.active { border-color: var(--blue); color: var(--navy); background: #eaf3ff; }
.gate-hint a { color: var(--blue); font-weight: 800; }
@media (max-width: 460px) {
  .gate-tab { font-size: .84rem; padding: 8px 11px; }
  .gate-lang { margin-left: 0; }
  .gate-card { padding: 20px 16px; }
}

/* ===================== the family page (D4) =====================
   A page of its own rather than a card in Parent View, because it is the grown-up's console: it
   needs a grown-up session, which the child's device deliberately does not hold. It is one column
   at every width and a two-column grid once there is room, so a phone, a tablet and a desktop each
   get a layout that fits rather than the same layout squeezed. */
.family-shell {
  max-width: 880px;
  margin: 0 auto;
  padding: 24px 16px 64px;
  font-family: inherit;
}
.family-top {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.family-top h1 { margin: 0; font-size: 1.5rem; letter-spacing: -.02em; }
.family-card {
  background: #fff;
  border: 1px solid #e4ebf5;
  border-radius: 16px;
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(20, 40, 70, .04);
}
.family-card h2 { margin: 0 0 10px; font-size: 1.1rem; }
.family-muted { color: var(--muted); font-size: .9rem; font-weight: 600; }
.family-form { display: grid; gap: 10px; max-width: 460px; }
.family-form label { font-weight: 800; font-size: .9rem; color: var(--navy); }
.family-form input {
  font: inherit;
  font-size: 1rem;
  padding: 11px 12px;
  border: 1px solid #cfdcea;
  border-radius: 10px;
  min-height: 44px;
}
.family-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 4px #e6efff; }
.family-btn {
  font: inherit;
  font-weight: 800;
  border-radius: 10px;
  padding: 11px 16px;
  min-height: 44px;
  border: 1px solid #d8e4f2;
  background: #f4f8fd;
  color: var(--navy);
  cursor: pointer;
}
.family-btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.family-btn.danger { background: #fff1f1; border-color: #f3c9c9; color: #a32525; }
.family-btn:disabled { opacity: .55; cursor: progress; }
.family-message { min-height: 22px; margin: 10px 0 0; font-weight: 800; }
.family-message.bad { color: var(--red); }
.family-message.good { color: var(--green); }
.family-children { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.family-child {
  border: 1px solid #e4ebf5;
  border-radius: 12px;
  padding: 12px 14px;
  display: grid;
  gap: 8px;
}
.family-child-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; justify-content: space-between; }
.family-child-name { font-weight: 800; font-size: 1.05rem; }
.family-child-meta { color: var(--muted); font-size: .84rem; font-weight: 600; }
.family-child-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.family-child-actions .family-btn { padding: 8px 12px; min-height: 38px; font-size: .86rem; }
.family-lang { display: flex; gap: 6px; }
.family-lang button {
  border: 1px solid #d8e4f2; background: #fff; color: var(--muted);
  border-radius: 999px; font: inherit; font-weight: 800; font-size: .8rem;
  padding: 7px 12px; cursor: pointer; min-height: 36px;
}
.family-lang button.active { border-color: var(--blue); color: var(--navy); background: #eaf3ff; }
.family-note { background: #f7fbff; border: 1px solid #dbeafb; border-radius: 12px; padding: 12px 14px; }
.family-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .04em; }
@media (min-width: 720px) {
  .family-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
}
