/* Kibo — site styles. No external fonts, no external requests. */

:root {
  /* Kibo palette: logo blue and robot yellow for shapes, deeper blue and navy for text (AA contrast) */
  --paper: #f8faf5;
  --white: #ffffff;
  --ink: #1d3557;
  --ink-soft: #46597a;
  --line: #ccd7e6;
  --grid: rgba(43, 90, 148, 0.08);
  --brand: #259fa0;
  --brand-wash: #e3f4f4;
  --teal-deep: #0f6e71;
  --day: #e7af58;
  --day-deep: #7a5200;
  --day-wash: #fff4d9;
  --night: #2b5a94;
  --night-wash: #e8f0fa;
  --ok: #0b7a5c;
  --ok-wash: #e3f5ee;
  --bad: #b42318;
  --bad-wash: #fdeceb;
  --grey-dot: #8a94a8;
  --font: "Avenir Next Rounded", "Nunito", "Trebuchet MS", "Segoe UI", ui-rounded, system-ui, sans-serif;
  --measure: 68ch;
  --wrap: 72rem;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.65 var(--font);
}

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

a { color: var(--night); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }

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

.skip {
  position: absolute; left: 0.75rem; top: -4rem;
  background: var(--ink); color: var(--white);
  padding: 0.6rem 1rem; border-radius: 8px; z-index: 10;
}
.skip:focus { top: 0.75rem; }

.wrap { width: min(100% - 2.5rem, var(--wrap)); margin-inline: auto; }

/* ---------- type ---------- */

h1, h2, h3, h4 { font-weight: 800; line-height: 1.12; letter-spacing: -0.015em; margin: 0 0 0.6em; }
h1 { font-size: clamp(2.3rem, 5.2vw, 3.9rem); }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
h3 { font-size: 1.25rem; letter-spacing: -0.005em; }
p { margin: 0 0 1em; }
.lede { font-size: 1.25rem; line-height: 1.55; color: var(--ink-soft); max-width: 40ch; }
.measure { max-width: var(--measure); }
.small { font-size: 0.9375rem; color: var(--ink-soft); }

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

.site-header { border-bottom: 2px solid var(--ink); background: var(--white); }
.site-header > .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 0.5rem 2rem; padding-block: 0.8rem;
}
.brand { display: inline-flex; align-items: center; color: var(--ink); text-decoration: none; }
.brand img { display: block; height: 3.5rem; width: auto; }
.nav { display: flex; flex-wrap: wrap; gap: 0.2rem 1.4rem; margin: 0; padding: 0; list-style: none; }
.nav a { display: inline-block; padding: 0.35rem 0; color: var(--ink); text-decoration: none; font-weight: 700; border-bottom: 3px solid transparent; }
.nav a:hover { border-bottom-color: var(--line); }
.nav a[aria-current="page"] { border-bottom-color: var(--ink); }

.site-footer { margin-top: 5rem; background: var(--ink); color: #dfe6f5; padding-block: 2.5rem 3rem; }
.site-footer a { color: #fff; }
.site-footer .cols { display: grid; gap: 2rem; grid-template-columns: 2fr 1fr 1fr; }
.site-footer h2 { font-size: 1rem; letter-spacing: 0; color: #fff; margin-bottom: 0.5em; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 0.3em; }
.site-footer .fine { margin-top: 2rem; font-size: 0.875rem; color: #b6c1da; max-width: 70ch; }

/* ---------- layout blocks ---------- */

main { display: block; }
.section { padding-block: 3.5rem; }
.section + .section { padding-top: 0; }
.stack > * + * { margin-top: 1rem; }

.page-head {
  padding-block: 3rem 2.5rem;
  border-bottom: 2px solid var(--ink);
  background-color: var(--white);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
}
.page-head h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); margin-bottom: 0.3em; }
.page-head .lede { margin-bottom: 0; }
.crumbs { margin: 0 0 1rem; font-size: 0.9375rem; font-weight: 700; }
.crumbs a { color: var(--ink-soft); }

.two { display: grid; gap: 3rem; grid-template-columns: 1fr 1fr; align-items: start; }
.three { display: grid; gap: 2.5rem; grid-template-columns: repeat(3, 1fr); }

.rule-col { border-left: 6px solid var(--ink); padding-left: 1.25rem; }
.rule-col.day { border-color: var(--day); }
.rule-col.night { border-color: var(--night); }
.rule-col.mix { border-color: var(--ok); }
.rule-col h3 { margin-bottom: 0.4em; }
.rule-col p { margin-bottom: 0; color: var(--ink-soft); }

/* ---------- buttons ---------- */

.btn {
  display: inline-block; font: inherit; font-weight: 800; line-height: 1.2;
  padding: 0.8rem 1.3rem; border-radius: 10px; border: 2px solid var(--ink);
  cursor: pointer; text-decoration: none; text-align: center;
  transition: background-color 0.15s, color 0.15s;
}
.btn-primary { background: var(--teal-deep); border-color: var(--teal-deep); color: var(--white); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: var(--white); }
.btn-secondary { background: var(--white); color: var(--ink); }
.btn-secondary:hover { background: var(--day-wash); color: var(--ink); }
/* hero: outlined secondary button so the teal primary leads */
.hero .btn-secondary { background: transparent; border-color: var(--teal-deep); color: var(--teal-deep); }
.hero .btn-secondary:hover { background: var(--teal-deep); color: var(--white); }
.badge-row { display: flex; flex-wrap: wrap; gap: 0.5rem 0.75rem; margin-top: 1rem; }
.badge-row .uk-badge { margin-top: 0; }
.uae-badge { border-color: var(--teal-deep); }
.uae-badge .uk-chip { background: var(--teal-deep); }
.btn-quiet { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-quiet:hover { border-color: var(--ink); }
.btn:disabled { cursor: default; opacity: 0.55; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }
.text-link { font-weight: 800; }

/* ---------- hero ---------- */

.hero {
  background-color: var(--white);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 32px 32px;
  border-bottom: 2px solid var(--ink);
  padding-block: 3.5rem 4rem;
}
.hero .wrap { display: grid; gap: 3rem; grid-template-columns: 1.05fr 1fr; align-items: start; }
.hero h1 { margin-bottom: 0.35em; }
.hero-note { margin: 1.5rem 0 0; font-size: 0.9375rem; color: var(--ink-soft); }
.lab-card {
  background: var(--white); border: 2px solid var(--ink); border-radius: 14px;
  padding: 1rem; box-shadow: 6px 6px 0 var(--ink);
}
.lab-card h2 { font-size: 1.05rem; letter-spacing: 0; margin-bottom: 0.7em; }

/* ---------- teach lab ---------- */

.lab { display: grid; gap: 1.5rem; grid-template-columns: minmax(18rem, 34rem) 1fr; align-items: start; }
.lab-compact { grid-template-columns: 1fr; gap: 1rem; }
.board {
  display: block; width: 100%; height: auto; aspect-ratio: 1; touch-action: manipulation;
  background-color: var(--white);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 10% 10%;
  border: 2px solid var(--ink); border-radius: 8px;
}
.cell { fill: transparent; }
.cell.day { fill: var(--day); fill-opacity: 0.24; }
.cell.night { fill: var(--night); fill-opacity: 0.17; }
.patch-label { font: 800 3.3px var(--font); fill: var(--ink-soft); opacity: 0.85; }

.pt { cursor: pointer; }
.pt .hit { fill: transparent; }
.pt .c, .pt .d { stroke-width: 0.9; stroke-linejoin: round; }
.pt .x { display: none; stroke: var(--bad); stroke-width: 0.9; stroke-linecap: round; fill: none; }
.shape-night .c, .shape-day .d, .shape-none .d { display: none; }
.untaught .c, .untaught .d { fill: var(--white); }
.col-none .c, .col-none .d { stroke: var(--grey-dot); }
.col-day .c, .col-day .d { stroke: var(--day-deep); }
.col-night .c, .col-night .d { stroke: var(--night); }
.taught.col-day .c, .taught.col-day .d { fill: var(--day); }
.taught.col-night .c, .taught.col-night .d { fill: var(--night); stroke: var(--ink); }
.untaught.wrong .x { display: block; }
.pt:focus-visible { outline: none; }
.pt:focus-visible .hit { stroke: var(--night); stroke-width: 0.8; fill: rgba(43, 90, 148, 0.14); }

.hide-guesses .untaught .d { display: none; }
.hide-guesses .untaught .c { display: block; stroke: var(--grey-dot); }
.hide-guesses .untaught .x { display: none; }

.legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1.1rem; margin: 0 0 0.9rem; font-size: 0.9375rem; font-weight: 700; }
.legend-item { display: inline-flex; align-items: center; gap: 0.3rem; }
.legend-icon { flex: none; }
.legend-day circle { fill: var(--day); stroke: var(--day-deep); stroke-width: 1; }
.legend-night polygon { fill: var(--night); stroke: var(--ink); stroke-width: 1; stroke-linejoin: round; }
.legend-grey { color: var(--ink-soft); font-weight: 600; }

.lab-summary { font-weight: 800; font-size: 1.05rem; margin-bottom: 0.5rem; }
.meter { height: 0.75rem; background: var(--paper); border: 2px solid var(--ink); border-radius: 999px; overflow: hidden; margin-bottom: 0.9rem; }
.meter-fill { display: block; height: 100%; width: 0; background: var(--ok); transition: width 0.25s; }
.lab-message { min-height: 3.2em; color: var(--ink-soft); }
.lab-buttons { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0.6rem 0 0.9rem; }
.lab-buttons .btn { padding: 0.6rem 1rem; font-size: 0.9375rem; }
.lab-check { display: flex; margin-top: 0.6rem; align-items: center; gap: 0.4rem; font-size: 0.9375rem; font-weight: 700; }
.lab-check input { width: 1.1rem; height: 1.1rem; accent-color: var(--night); }
.lab-compact .lab-message { min-height: 0; margin-bottom: 0.4rem; }
.lab-compact .lab-buttons { margin-top: 0.3rem; }
.lab-compact .text-link { display: block; margin-top: 0.9rem; }

.tally { width: 100%; border-collapse: collapse; margin: 0.6rem 0 0.4rem; font-size: 0.9375rem; background: var(--white); }
.tally caption { text-align: left; font-weight: 800; padding-bottom: 0.4rem; }
.tally th, .tally td { text-align: left; padding: 0.4rem 0.6rem; border-bottom: 1px solid var(--line); }
.tally thead th { border-bottom: 2px solid var(--ink); }

/* ---------- age ruler ---------- */

.ruler { list-style: none; margin: 2.5rem 0 0; padding: 0; display: grid; grid-template-columns: 2fr 2fr 2fr 3fr; position: relative; }
.ruler li { position: relative; padding: 1.5rem 1.25rem 1.25rem 0; border-top: 14px solid var(--ink); }
.ruler li:nth-child(1) { border-top-color: var(--day); }
.ruler li:nth-child(2) { border-top-color: var(--ok); }
.ruler li:nth-child(3) { border-top-color: var(--night); }
.ruler li:nth-child(4) { border-top-color: var(--ink); }
.ruler li::before {
  content: attr(data-from); position: absolute; top: -2.3rem; left: 0;
  font-weight: 800; font-size: 0.95rem; color: var(--ink-soft);
}
.ruler li:last-child::after {
  content: attr(data-to); position: absolute; top: -2.3rem; right: 0;
  font-weight: 800; font-size: 0.95rem; color: var(--ink-soft);
}
.ruler .code { display: block; font-weight: 800; font-size: 0.9375rem; color: var(--ink-soft); }
.ruler h3 { margin: 0.1rem 0 0.35rem; }
.ruler h3 a { color: var(--ink); text-decoration: none; }
.ruler h3 a:hover { text-decoration: underline; }
.ruler p { margin: 0; font-size: 0.9375rem; color: var(--ink-soft); }
.ruler-caption { margin-top: 3rem; }

/* ---------- facts / badges ---------- */

.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: 1rem 2rem; margin: 2rem 0 0; }
.facts div { border-left: 4px solid var(--ink); padding-left: 0.9rem; }
.facts dt { font-size: 0.875rem; font-weight: 700; color: var(--ink-soft); }
.facts dd { margin: 0; font-weight: 800; }

.badge { display: inline-block; font-size: 0.875rem; font-weight: 800; padding: 0.2rem 0.65rem; border-radius: 999px; border: 2px solid var(--ink); background: var(--white); }
.badge.ready { background: var(--ok-wash); border-color: var(--ok); color: #075a43; }
.badge.building { background: var(--day-wash); border-color: var(--day-deep); color: var(--day-deep); }

.notice { border: 2px solid var(--day-deep); background: var(--day-wash); border-radius: 10px; padding: 0.9rem 1.1rem; margin: 1.5rem 0; max-width: var(--measure); }
.notice p:last-child { margin-bottom: 0; }
.notice strong { color: var(--day-deep); }
.note-box { border-left: 6px solid var(--night); background: var(--night-wash); padding: 0.9rem 1.1rem; border-radius: 0 10px 10px 0; max-width: var(--measure); }
.note-box p:last-child { margin-bottom: 0; }

/* ---------- lists / tables ---------- */

.ticks { list-style: none; padding: 0; margin: 0 0 1em; }
.ticks li { position: relative; padding-left: 1.7rem; margin-bottom: 0.45em; }
.ticks li::before { content: ""; position: absolute; left: 0; top: 0.55em; width: 0.8rem; height: 0.8rem; background: var(--day); border: 2px solid var(--day-deep); border-radius: 50%; }
.ticks.night li::before { background: var(--night); border-color: var(--ink); border-radius: 0; transform: rotate(45deg) scale(0.85); }

.plain-table { width: 100%; border-collapse: collapse; background: var(--white); border: 2px solid var(--ink); }
.plain-table caption { text-align: left; font-weight: 800; padding: 0 0 0.6rem; }
.plain-table th, .plain-table td { text-align: left; vertical-align: top; padding: 0.7rem 0.9rem; border-bottom: 1px solid var(--line); }
.plain-table thead th { background: var(--ink); color: var(--white); border-bottom: 0; }
.plain-table tbody th { font-weight: 800; }
.table-scroll { overflow-x: auto; }

/* ---------- lessons ---------- */

details.lesson { background: var(--white); border: 2px solid var(--ink); border-radius: 10px; margin-bottom: 0.8rem; }
details.lesson summary { cursor: pointer; padding: 0.9rem 1.1rem; font-weight: 800; list-style: none; display: flex; gap: 0.9rem; align-items: baseline; }
details.lesson summary::-webkit-details-marker { display: none; }
details.lesson summary::before { content: "+"; flex: none; width: 1.4rem; font-size: 1.4rem; line-height: 1; font-weight: 800; color: var(--night); }
details.lesson[open] summary::before { content: "\2212"; }
details.lesson[open] summary { border-bottom: 2px solid var(--line); }
.lesson-title small { display: block; font-weight: 600; color: var(--ink-soft); margin-top: 0.15rem; }
.lesson-body { padding: 1rem 1.1rem 1.1rem 3.4rem; max-width: 70ch; }
.lesson-body ol { padding-left: 1.2rem; margin: 0 0 1em; }
.lesson-body li { margin-bottom: 0.5em; }
.lesson-body .tag { font-weight: 800; }
.lesson-note { font-size: 0.9375rem; color: var(--ink-soft); margin: 0 0 0.4em; }
.lesson-actions { margin: 0 0 1rem; }

.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 3rem; border-top: 2px solid var(--ink); padding-top: 1.2rem; font-weight: 800; }

/* ---------- card sort ---------- */

.sort-list { list-style: none; margin: 1.5rem 0; padding: 0; display: grid; gap: 0.8rem; max-width: 44rem; }
.sort-list li { background: var(--white); border: 2px solid var(--ink); border-radius: 10px; padding: 0.9rem 1rem; }
.sort-list li.card-right { border-color: var(--ok); background: var(--ok-wash); }
.sort-list li.card-wrong { border-color: var(--bad); background: var(--bad-wash); }
.sort-q { font-weight: 800; margin: 0 0 0.6rem; }
.sort-btns { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.sort-btns .btn { padding: 0.5rem 0.9rem; font-size: 0.9375rem; }
.sort-btns .btn.is-right { background: var(--ok); border-color: var(--ok); color: var(--white); opacity: 1; }
.sort-btns .btn.is-wrong { background: var(--bad); border-color: var(--bad); color: var(--white); opacity: 1; }
.sort-fb { margin: 0.6rem 0 0; font-size: 0.9375rem; min-height: 1.4em; }
.sort-result { font-weight: 800; border: 2px solid var(--ink); background: var(--white); border-radius: 10px; padding: 0.9rem 1rem; max-width: 44rem; }

/* ---------- faq ---------- */

.faq details { border-top: 2px solid var(--ink); padding: 0.9rem 0; max-width: var(--measure); }
.faq details:last-child { border-bottom: 2px solid var(--ink); }
.faq summary { cursor: pointer; font-weight: 800; }
.faq details p { margin: 0.7rem 0 0; color: var(--ink-soft); }

/* ---------- responsive ---------- */

@media (max-width: 62rem) {
  .hero .wrap, .two, .lab { grid-template-columns: 1fr; }
  .three { grid-template-columns: 1fr; gap: 1.5rem; }
  .site-footer .cols { grid-template-columns: 1fr; }
  .lab-card { box-shadow: 4px 4px 0 var(--ink); }
}

@media (max-width: 46rem) {
  .ruler { grid-template-columns: 1fr; margin-top: 1.5rem; }
  .ruler li { border-top: 0; border-left: 14px solid; padding: 0.4rem 0 1.2rem 1.1rem; margin-bottom: 0.5rem; }
  .ruler li:nth-child(1) { border-left-color: var(--day); }
  .ruler li:nth-child(2) { border-left-color: var(--ok); }
  .ruler li:nth-child(3) { border-left-color: var(--night); }
  .ruler li:nth-child(4) { border-left-color: var(--ink); }
  .ruler li::before, .ruler li:last-child::after { display: none; }
  .ruler-caption { margin-top: 1.5rem; }
  .lesson-body { padding-left: 1.1rem; }
  .section { padding-block: 2.5rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .meter-fill { transition: none; }
}

@media (forced-colors: active) {
  .btn, .board, .lab-card, details.lesson { border-color: CanvasText; }
}

@media print {
  .site-header, .site-footer, .skip, .btn-row, .lab-buttons, .pager, .lesson-actions { display: none; }
  body { background: #fff; font-size: 11pt; }
  .page-head, .hero { background: #fff; border: 0; }
  details.lesson { break-inside: avoid; border-width: 1px; }
  a { color: inherit; }
}

/* Stack the courses table into cards on narrow screens */
@media (max-width: 40rem) {
  .stack-table, .stack-table tbody, .stack-table tr, .stack-table th, .stack-table td { display: block; width: auto; }
  .stack-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .stack-table tr { border: 2px solid var(--ink); border-radius: 0.75rem; margin-bottom: 1rem; padding: 0.75rem 1rem; background: var(--white); }
  .stack-table th { padding: 0 0 0.4rem; border: 0; font-size: 1.125rem; }
  .stack-table td { padding: 0.25rem 0; border: 0; }
  .stack-table td::before { content: attr(data-label); display: block; font-size: 0.8125rem; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.04em; }
}

/* Kids' do-it-yourself pages */
.diy-steps { list-style: none; counter-reset: step; padding: 0; margin: 0.5rem 0 1rem; }
.diy-steps > li { counter-increment: step; margin: 0 0 0.9rem; }
.step { display: grid; grid-template-columns: auto 1fr; gap: 0.75rem; align-items: start; cursor: pointer; font-size: 1.0625rem; line-height: 1.55; }
.step input { width: 1.5rem; height: 1.5rem; margin-top: 0.1rem; accent-color: var(--night); }
.step input:checked + span { color: var(--ink-soft); text-decoration: line-through; text-decoration-thickness: 1px; }
.diy-steps pre { margin: 0.6rem 0 0.4rem 2.25rem; }
ol.diy-steps pre, ol.diy-steps .small { margin-left: 0; }
.diy-steps .small { margin: 0 0 0.3rem 2.25rem; }
.case { margin: 0 0 0.9rem; }
.reveal { margin-top: 0.4rem; }
.reveal summary { cursor: pointer; font-weight: 800; color: var(--night); }
.reveal p { margin: 0.4rem 0 0; padding: 0.6rem 0.9rem; border-left: 4px solid var(--night); background: var(--white); }
.lesson-body h3 { margin-top: 1.25rem; }
.lesson-kids { margin-top: 1rem; }
.expect { opacity: 0.9; }
@media print { .reveal > p { display: block; } }

/* Code blocks: scroll sideways inside the block, never the page */
pre { background: var(--ink); color: #f5f8fb; padding: 0.9rem 1rem; border-radius: 0.6rem; overflow-x: auto; max-width: 100%; font: 0.875rem/1.55 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; tab-size: 4; }
pre code { font: inherit; white-space: pre; }
pre.expect { background: #e9edf5; color: var(--ink); border: 1px solid #c3cbdd; }
pre:focus-visible { outline: 3px solid var(--night); outline-offset: 2px; }
.diy-steps > li, .lesson-body li { min-width: 0; }

/* Real AI tests */
.ai-test { margin: 1.25rem 0; border: 2px dashed var(--night); border-radius: 0.75rem; background: var(--white); }
.ai-test > summary { cursor: pointer; padding: 0.8rem 1rem; font-weight: 800; color: var(--night); }
.ai-body { padding: 0 1rem 1rem; }
.ai-body h4 { margin: 1.1rem 0 0.4rem; }
.prompt { margin: 0.9rem 0; }
.prompt pre { margin: 0.3rem 0 0.5rem; }
.prompt pre code { white-space: pre-wrap; word-break: break-word; }
.copy-status { margin-left: 0.5rem; }
.age-table td, .age-table th { vertical-align: top; }
.record-table td { height: 3rem; border: 1px solid #c3cbdd; }
.record-table th { font-size: 0.875rem; }

/* ---------- Kibo additions: utility bar, accounts, progress ---------- */

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.utility { background: var(--ink); color: #fff; font-size: 0.9rem; }
.utility .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.25rem 1.5rem; padding-block: 0.3rem; min-height: 2.2rem; }
.utility ul { display: flex; flex-wrap: wrap; gap: 0.2rem 1.1rem; list-style: none; margin: 0; padding: 0; }
.utility a { color: #fff; display: inline-block; padding: 0.25rem 0; }
.utility a[aria-current="true"] { font-weight: 800; }
.utility .signins { margin-left: auto; }
.utility .signin-parent { font-weight: 800; }

.footer-tagline { color: var(--day); font-weight: 800; }
.note-box.sun { background: var(--day-wash); border-color: var(--day); }
.lang-notice { margin-block: 1.5rem 0; }

/* forms */
.app { max-width: 52rem; }
.app.narrow, .form.narrow { max-width: 28rem; }
.form { display: grid; gap: 1.1rem; max-width: 34rem; }
.form.inline { max-width: 26rem; margin-top: 0.8rem; }
.field { display: grid; gap: 0.3rem; }
.field label, .avatars legend { font-weight: 800; }
.field .hint { margin: 0; font-size: 0.9rem; color: var(--ink-soft); }
input[type="text"], input[type="email"], input[type="password"], select {
  font: inherit; color: var(--ink); background: var(--white);
  border: 2px solid var(--ink); border-radius: 8px; padding: 0.65rem 0.8rem; width: 100%; min-height: 2.9rem;
}
input:focus-visible, select:focus-visible { outline: 3px solid var(--night); outline-offset: 2px; }
.row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: stretch; }
.row input { flex: 1 1 12rem; width: auto; }
.check { display: flex; gap: 0.7rem; align-items: flex-start; }
.check input { width: 1.4rem; height: 1.4rem; margin-top: 0.2rem; flex: none; accent-color: var(--night); }
.form-msg { margin: 0; min-height: 1.4em; font-weight: 700; color: var(--bad); }
.form-msg.ok { color: var(--ok); }
.linklike { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--night); text-decoration: underline; cursor: pointer; }
.btn-danger { background: var(--white); color: var(--bad); border-color: var(--bad); }
.btn-danger:hover { background: var(--bad-wash); color: var(--bad); }
.btn-row.tight { margin-top: 0.8rem; gap: 0.5rem; }
.bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 0.5rem 1rem; margin-bottom: 1rem; }
.bar p { margin: 0; }

.tabs { display: flex; gap: 0.4rem; margin-bottom: 1.2rem; }
.tab { font: inherit; font-weight: 800; padding: 0.6rem 1.1rem; border: 2px solid var(--ink); border-radius: 10px; background: var(--white); color: var(--ink); cursor: pointer; }
.tab[aria-pressed="true"] { background: var(--night); border-color: var(--night); color: var(--white); }

/* avatars */
.avatars { border: 0; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 0.5rem; }
.avatars legend { padding: 0; margin-bottom: 0.3rem; width: 100%; }
.avatar-opt { position: relative; cursor: pointer; }
.avatar-opt input { position: absolute; opacity: 0; inset: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.avatar { display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; font-size: 1.7rem; border-radius: 50%; background: var(--brand-wash); border: 2px solid var(--line); flex: none; }
.avatar.big { width: 4rem; height: 4rem; font-size: 2.2rem; }
.avatar-opt input:checked + .avatar { border-color: var(--night); background: var(--day-wash); box-shadow: 0 0 0 3px var(--night); }
.avatar-opt input:focus-visible + .avatar { outline: 3px solid var(--night); outline-offset: 3px; }

/* children and progress */
.children { display: grid; gap: 1rem; margin-bottom: 2.5rem; }
.course-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); margin-block: 1.5rem 2rem; }
.child-card { background: var(--white); border: 2px solid var(--ink); border-radius: 14px; padding: 1.1rem 1.2rem; }
.child-card h3 { margin-bottom: 0.2em; }
.child-card p { margin-bottom: 0.5em; }
.child-head { display: flex; align-items: center; gap: 0.9rem; margin-bottom: 0.8rem; }
.child-head h2, .child-head h3 { margin: 0; }
.details { margin-top: 1rem; }
.badges { list-style: none; padding: 0; margin: 0 0 2rem; display: flex; flex-wrap: wrap; gap: 0.7rem; }
.badge-item { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.9rem; border: 2px solid var(--day); background: var(--day-wash); border-radius: 999px; font-weight: 800; }
.badge-star { font-size: 1.3rem; }
.meter-fill { background: var(--night); }

.progress-actions { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: 0.6rem; }
.progress-actions:empty { display: none; }
.progress-btn.is-done { background: var(--ok-wash); border-color: var(--ok); color: #075a43; }
.progress-bar-note { margin: 0 0 1rem; padding: 0.7rem 1rem; border: 2px solid var(--day); background: var(--day-wash); border-radius: 10px; font-weight: 700; }

@media (max-width: 40rem) {
  .utility .wrap { justify-content: center; }
  .utility .signins { margin-left: 0; }
  .tabs { flex-wrap: wrap; }
}
@media (forced-colors: active) {
  .meter-fill { background: Highlight; }
  .avatar-opt input:checked + .avatar { outline: 3px solid Highlight; }
}
@media print { .utility, .progress-actions, .progress-bar-note { display: none; } }

/* Tap targets: keep links under progress buttons comfortably apart */
.progress-actions { margin: 1rem 0 1.25rem; }
.lesson .small .text-link { display: inline-block; padding: .5rem 0; min-height: 24px; }

/* =====================================================================
   Kibo look, round 2: sky background, picture-led steps, simpler pages
   ===================================================================== */

body {
  background-color: #eef6ff;
  background-image: url(../img/bg-tile.svg), linear-gradient(180deg, #e2effd 0, #f1f8ff 560px, #fffaf1 100%);
  background-repeat: repeat, no-repeat;
}

.page-head, .hero {
  position: relative; overflow: hidden;
  background-color: #d9eafb;
  background-image: linear-gradient(180deg, #d3e6fa 0%, #e9f3fe 100%);
  background-size: auto;
  border-bottom: 0;
}
.page-head::after, .hero::after {
  content: ""; position: absolute; right: 0; bottom: 0; z-index: 0; pointer-events: none;
  width: min(46rem, 62%); aspect-ratio: 2 / 1;
  background: url(../img/hero-scene.svg) no-repeat right bottom / contain;
}
.page-head > .wrap, .hero > .wrap { position: relative; z-index: 1; }
.page-head .lede, .page-head .facts { max-width: 40rem; }

/* soft cards instead of hard outlines in the content area */
.note-box { background: #fff; border: 2px solid var(--line); border-left: 8px solid var(--night); border-radius: 14px; box-shadow: 0 6px 18px rgba(29, 53, 87, 0.07); }
.note-box.sun { border-left-color: var(--day); background: #fffaf0; }
details.lesson { border-radius: 16px; border-color: #b8cde6; box-shadow: 0 6px 18px rgba(29, 53, 87, 0.07); }
details.lesson[open] { border-color: var(--night); }
.lab-card { border-radius: 20px; border-color: var(--night); box-shadow: 0 10px 28px rgba(29, 53, 87, 0.16); }

/* ---------- "do this, then this" step flow ---------- */

.flow-head { margin-bottom: 1.6rem; }
.flow-head h2 { margin-bottom: 0.25em; }
.flow-head p { margin: 0; color: var(--ink-soft); max-width: 40rem; }
.steps-flow {
  list-style: none; margin: 1.75rem 0 0; padding: 0;
  display: grid; gap: 1.5rem 1.25rem; grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
}
.steps-flow > li {
  position: relative; background: #fff; border: 2px solid var(--night); border-radius: 18px;
  padding: 2.1rem 1.1rem 1.15rem; text-align: center; box-shadow: 0 8px 20px rgba(29, 53, 87, 0.08);
}
.steps-flow .num {
  position: absolute; top: -1.15rem; left: 50%; transform: translateX(-50%);
  width: 2.3rem; height: 2.3rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--day); color: var(--ink); border: 2px solid var(--ink); font-weight: 800; font-size: 1.05rem;
}
.steps-flow .ico { display: block; font-size: 2.4rem; line-height: 1.1; margin-bottom: 0.4rem; }
.steps-flow h3 { font-size: 1.1rem; margin: 0 0 0.3em; }
.steps-flow p { margin: 0; font-size: 0.975rem; color: var(--ink-soft); }
.steps-flow > li:not(:last-child)::after {
  content: "\2192"; position: absolute; right: -1.25rem; top: 50%; width: 1.25rem; transform: translateY(-50%);
  text-align: center; font-weight: 800; color: var(--night); font-size: 1.1rem;
}
.steps-flow.kids > li { border-color: var(--day-deep); }
.steps-flow.kids .num { background: var(--teal-deep); color: #fff; }
.steps-flow .step-link { display: inline-block; margin-top: 0.6rem; padding: 0.45rem 0; font-weight: 800; }

/* "In short" line at the top of busy pages */
.in-short {
  display: flex; gap: 0.9rem; align-items: flex-start; max-width: 46rem; margin-top: 1.4rem;
  background: #fff; border: 2px solid var(--day); border-radius: 14px; padding: 0.85rem 1.1rem;
}
.in-short .ico { font-size: 1.7rem; line-height: 1.2; }
.in-short p { margin: 0; font-weight: 600; }

/* ---------- lessons: a path and numbered steps ---------- */

.journey { list-style: none; margin: 0 0 1.4rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 0.4rem; }
.journey li {
  display: flex; align-items: center; gap: 0.45rem; background: var(--brand-wash); border: 2px solid var(--line);
  border-radius: 999px; padding: 0.3rem 0.85rem 0.3rem 0.35rem; font-weight: 800; font-size: 0.9375rem; margin: 0;
}
.journey .n { width: 1.7rem; height: 1.7rem; border-radius: 50%; display: grid; place-items: center; background: var(--night); color: #fff; font-size: 0.875rem; }
.journey li:nth-child(2) .n { background: var(--day); color: var(--ink); }
.journey li:nth-child(3) .n { background: var(--ok); }
.journey li:nth-child(4) .n { background: var(--ink); }

.phase-h { display: flex; align-items: center; gap: 0.6rem; font-size: 1.2rem; margin: 1.8rem 0 0.7rem; }
.phase-h .n {
  flex: none; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--night); color: #fff; font-size: 1rem;
}
.phase-h.p2 .n { background: var(--day); color: var(--ink); }
.phase-h.p3 .n { background: var(--ok); }
.phase-h.p4 .n { background: var(--ink); }

ol.diy-steps, .lesson-body ol.step-list { list-style: none; padding: 0; margin: 0 0 1em; counter-reset: stp; }
ol.diy-steps > li, .lesson-body ol.step-list > li {
  counter-increment: stp; position: relative; padding: 0.15rem 0 0.15rem 2.8rem; margin-bottom: 0.85rem;
}
ol.diy-steps > li::before, .lesson-body ol.step-list > li::before {
  content: counter(stp); position: absolute; left: 0; top: 0.05rem;
  width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-wash); border: 2px solid var(--night); color: var(--ink); font-weight: 800; font-size: 0.95rem;
}
ol.diy-steps > li:has(input:checked)::before { background: var(--ok); border-color: var(--ok); color: #fff; content: "\2713"; }
ol.diy-steps label.step:has(input:checked) > span { color: var(--ink-soft); text-decoration: line-through; text-decoration-thickness: 1px; }
.lesson-body { max-width: 72ch; padding-left: 1.1rem; }

/* ---------- pictures ---------- */

.head-art { display: block; width: 11rem; height: auto; border-radius: 16px; border: 2px solid var(--ink); margin-bottom: 1rem; background: #fff; }
.ruler-art { display: block; width: 100%; max-width: 12rem; height: auto; border-radius: 14px; margin: 0 0 0.9rem; }
.ruler li { padding-top: 1.1rem; }

@media (max-width: 900px) {
  .page-head::after, .hero::after { width: 70%; opacity: 0.55; }
  .steps-flow > li:not(:last-child)::after { content: "\2193"; right: auto; left: 50%; top: auto; bottom: -1.45rem; transform: translateX(-50%); }
  .steps-flow { gap: 1.9rem 1rem; }
}
@media print {
  body { background: #fff; }
  .page-head::after, .hero::after { display: none; }
  .steps-flow > li { box-shadow: none; break-inside: avoid; }
}

/* footer: full logo on a white badge */
.footer-logo { display: inline-block; background: #fff; border-radius: 16px; padding: 0.6rem 0.9rem; margin-bottom: 0.9rem; }
.footer-logo img { display: block; width: 10.5rem; height: auto; }

/* =====================================================================
   School-guidelines map (home infographic and About page)
   ===================================================================== */

.cmap { display: grid; gap: 1.6rem; margin-top: 1.5rem; }
.cmap-country { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; font-size: 1.15rem; margin: 0 0 0.6rem; }
.cmap-country small, details.country > summary small { font-weight: 600; color: var(--ink-soft); font-size: 0.9rem; }
.cc {
  display: inline-grid; place-items: center; min-width: 3rem; height: 2rem; padding: 0 0.6rem; border-radius: 999px;
  background: var(--ink); color: #fff; font-weight: 800; font-size: 0.875rem; letter-spacing: 0.02em; flex: none;
}
.cmap-cells { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.75rem; grid-template-columns: repeat(4, 1fr); }
.cmap-cell {
  display: flex; flex-direction: column; gap: 0.35rem; background: #fff; border: 2px solid var(--line);
  border-top: 10px solid var(--ink); border-radius: 14px; padding: 0.7rem 0.8rem 0.8rem; box-shadow: 0 6px 16px rgba(29, 53, 87, 0.07);
}
.cmap-cell.a1 { border-top-color: var(--day); }
.cmap-cell.a2 { border-top-color: var(--ok); }
.cmap-cell.a3 { border-top-color: var(--night); }
.cmap-cell.a4 { border-top-color: var(--ink); }
.cmap-course { font-weight: 800; font-size: 0.9375rem; line-height: 1.25; }
.cmap-course small { display: block; font-weight: 600; color: var(--ink-soft); }
.cmap-stage { font-weight: 800; font-size: 1.05rem; line-height: 1.2; color: var(--teal-deep); }
.cmap-fit {
  display: inline-flex; align-items: center; gap: 0.4rem; align-self: flex-start; border-radius: 999px; padding: 0.15rem 0.7rem;
  font-weight: 800; font-size: 0.8125rem; border: 2px solid var(--teal-deep); white-space: nowrap;
}
.cmap-fit.fit-strong { background: var(--teal-deep); color: #fff; }
.cmap-fit.fit-partial { background: var(--brand-wash); color: var(--ink); }
.cmap-fit.fit-light { background: #fff; color: var(--ink); border-style: dashed; }
.fit-dots { letter-spacing: 0.08em; }
.cmap-legend { margin: 1.1rem 0 1.2rem; color: var(--ink-soft); }
.cmap-legend .fit-dots { color: var(--teal-deep); }

details.country { background: #fff; border: 2px solid #b8cde6; border-radius: 16px; margin-bottom: 0.8rem; box-shadow: 0 6px 18px rgba(29, 53, 87, 0.07); }
details.country[open] { border-color: var(--night); }
details.country > summary {
  cursor: pointer; padding: 0.9rem 1.1rem; font-weight: 800; font-size: 1.1rem; list-style: none;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.7rem;
}
details.country > summary::-webkit-details-marker { display: none; }
details.country > summary small { flex-basis: 100%; padding-left: 3.7rem; }
.country-body { padding: 0.2rem 1.1rem 1.2rem; border-top: 2px solid var(--line); }
.country-body h4 { margin: 1.3rem 0 0.4rem; }
.countries { margin: 1.5rem 0 2.2rem; }
.block { display: block; font-weight: 600; color: var(--ink-soft); }
.strand-table td, .strand-table th { vertical-align: top; }
.strand-s { font-weight: 800; color: var(--teal-deep); }
.strand-p { font-weight: 700; }
.strand-n { color: var(--ink-soft); }
.country-body .ticks { margin-bottom: 0.4rem; }

@media (max-width: 62rem) { .cmap-cells { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 30rem) { .cmap-cells { gap: 0.6rem; } .cmap-fit { white-space: normal; } }
@media print { details.country:not([open]) .country-body { display: block; } }

/* ---------- guest mode: Lesson 1 teaser, sign-up pop-up, hero demo ---------- */
.btn-lg { font-size: 1.1rem; padding: 0.85rem 1.4rem; }
.lab-static { margin: 0; }

.lab-static .pt { cursor: default; }
.lab-static > p.small { text-align: center; margin: 0.6rem 0 0; }
.lab-mini .lab-message { font-weight: 700; color: var(--ink); }
.lab-mini .meter { height: 0.7rem; }
.lab-mini .lab-summary { display: none; }

details.lesson.is-locked { background: #f4f7fb; border-style: dashed; border-color: #9fb3cc; }
details.lesson.is-locked .lesson-body { display: none; }
details.lesson.is-locked summary::before { content: "\1F512"; font-size: 1.1rem; width: 1.4rem; }
.lock-tag {
  display: inline-block; margin-left: 0.6rem; padding: 0.1rem 0.6rem; border-radius: 999px; font-size: 0.8125rem; font-weight: 800;
  background: #e8eef7; color: var(--night);
}
.paused-tag { color: var(--bad); font-weight: 800; }

.gate-dialog {
  border: 0; padding: 0; background: transparent; max-width: min(30rem, calc(100vw - 2rem)); width: 100%; color: var(--ink);
}
.gate-dialog::backdrop { background: rgba(29, 53, 87, 0.55); }
.gate-card {
  background: var(--white); border: 3px solid var(--night); border-radius: 24px; padding: 1.6rem 1.5rem 1.4rem; text-align: center;
  box-shadow: 0 18px 50px rgba(29, 53, 87, 0.35);
}
.gate-dialog[open] .gate-card { animation: gate-pop 0.28s ease-out; }
.gate-art { display: block; font-size: 3rem; line-height: 1; margin-bottom: 0.4rem; }
.gate-card h2 { margin: 0 0 0.5rem; letter-spacing: 0; }
.gate-text { font-size: 1.15rem; line-height: 1.5; margin: 0 0 1.2rem; }
.gate-card .btn-row { justify-content: center; }
@keyframes gate-pop { from { opacity: 0; transform: translateY(12px) scale(0.96); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .gate-dialog[open] .gate-card { animation: none; } }

/* ---------- loading frame for the hero demo (no layout shift), UK badge, mobile quick-start ---------- */
.lab-static-board { position: relative; }
.kibo-peek { position: absolute; inset-inline-end: -0.4rem; inset-block-end: -0.6rem; width: 4.5rem; height: auto; filter: drop-shadow(0 4px 6px rgba(29, 53, 87, 0.25)); }
.lab-skeleton .pt .c { animation: sk-pulse 1.6s ease-in-out infinite; }
.lab-skeleton .pt:nth-child(3n) .c { animation-delay: 0.3s; }
.lab-skeleton .pt:nth-child(3n+1) .c { animation-delay: 0.6s; }
.sk-line, .sk-btn {
  display: block; border-radius: 999px; background: linear-gradient(90deg, #e3ebf5 25%, #f1f6fb 50%, #e3ebf5 75%); background-size: 200% 100%;
  animation: sk-shimmer 1.6s linear infinite;
}
.sk-line { height: 0.9rem; }
.sk-line.w60 { width: 60%; } .sk-line.w75 { width: 45%; }
.sk-legend { height: 25px; align-items: center; }
.sk-meter { border-color: #d3deeb; }
.sk-btn { height: 41px; width: 8.5rem; border-radius: 0.6rem; }
.sk-check { height: 25px; margin: 0.6rem 0 0; }
.sk-link { display: block; height: 28px; width: 9rem; margin-top: 0.9rem; border-radius: 999px; background: #e3ebf5; }
.lab-mini .lab-message { min-height: 0; margin: 0 0 0.5rem; }
.lab-mini .mini-stage { min-height: 15.5rem; }
@media (max-width: 40rem) { .lab-mini .mini-stage { min-height: 19rem; } }
@keyframes sk-shimmer { to { background-position: -200% 0; } }
@keyframes sk-pulse { 50% { opacity: 0.45; } }
@media (prefers-reduced-motion: reduce) { .lab-skeleton .pt .c, .sk-line, .sk-btn { animation: none; } }
.lab-card { scroll-margin-top: 1rem; }

.uk-badge {
  display: inline-flex; align-items: center; gap: 0.55rem; margin-top: 1rem; padding: 0.4rem 0.9rem 0.4rem 0.45rem; border-radius: 999px;
  background: var(--white); border: 2px solid var(--night); color: var(--ink); font-weight: 800; font-size: 0.9rem; text-decoration: none;
}
.uk-badge:hover { background: #eef5fd; }
.uk-chip { display: inline-grid; place-items: center; min-width: 2rem; height: 1.7rem; border-radius: 999px; background: var(--night); color: var(--white); font-size: 0.75rem; letter-spacing: 0.04em; }

.sticky-cta { display: none; }
@media (max-width: 47.99rem) {
  .sticky-nav {
    position: fixed; inset-inline: 0; bottom: 0; z-index: 40; padding: 0.6rem 0.75rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
    background: rgba(255, 255, 255, 0.97); border-top: 2px solid var(--line); box-shadow: 0 -6px 18px rgba(20, 30, 50, 0.12);
  }
  .sticky-nav:has(.sticky-cta.is-hidden) { display: none; }
  .sticky-cta {
    display: flex; align-items: center; justify-content: center; width: 100%; min-height: 3rem; border-radius: 12px; background: var(--teal-deep); color: var(--white);
    font-weight: 800; font-size: 1.05rem; text-decoration: none; border: 2px solid var(--teal-deep);
  }
  .sticky-cta.is-hidden { display: none; }
  body { padding-bottom: 5rem; }
}
@media print { .sticky-cta { display: none; } }
/* keep the loading frame and the live widget the same height */
.lab-skeleton { display: grid; gap: 1rem; }
@media (max-width: 40rem) { .lab-mini .legend { flex-wrap: nowrap; } .lab-mini .legend-grey { display: none; } }

/* ---------- profile switcher (header), lesson 1 badges, paid-plan locks ---------- */
.profile-switcher { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem 0.8rem; font-size: 0.9rem; }
.profile-switcher[hidden] { display: none; }
.profile-switcher select {
  font: inherit; padding: 0.2rem 0.5rem; border-radius: 8px; border: 2px solid #fff; background: var(--white); color: var(--ink); min-height: 1.9rem;
}
.profile-switcher .linklike { color: #fff; font: inherit; text-decoration: underline; padding: 0.25rem 0; }
.l1-badges { display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none; margin: 0.6rem 0; padding: 0; }
.l1-badges li { display: inline-flex; gap: 0.35rem; align-items: center; padding: 0.2rem 0.7rem; border-radius: 999px; border: 2px solid var(--line); font-size: 0.875rem; font-weight: 700; }
.l1-badges li.on { border-color: var(--teal-deep); background: #e3f4f4; color: var(--teal-deep); }
.l1-badges li.off { color: var(--ink-soft); background: var(--white); }
.locked-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0.3rem 0 0.6rem; padding: 0.5rem 0.8rem; border: 2px dashed #9fb3cc; border-radius: 10px; background: #f4f7fb; font-weight: 700; font-size: 0.9rem; }
.upgrade-banner { margin: 1rem 0; }
@media (max-width: 47.99rem) { .profile-switcher { justify-content: center; } }

/* ---------- Arabic / RTL ---------- */
:root[dir="rtl"] body,
html[dir="rtl"] body {
  font-family: "Segoe UI", "Noto Naskh Arabic", "Noto Sans Arabic", Tahoma, "Geeza Pro", system-ui, sans-serif;
  letter-spacing: normal;
  line-height: 1.8;
}
html[dir="rtl"] h1, html[dir="rtl"] h2, html[dir="rtl"] h3, html[dir="rtl"] .btn,
html[dir="rtl"] .eyebrow, html[dir="rtl"] .badge { letter-spacing: normal; text-transform: none; }
html[dir="rtl"] .board, html[dir="rtl"] .lab-skeleton svg, html[dir="rtl"] [data-teach] svg { direction: ltr; }
html[dir="rtl"] .brand, html[dir="rtl"] .brand-name { direction: ltr; unicode-bidi: isolate; }
html[dir="rtl"] .arrow, html[dir="rtl"] .btn .arr { display: inline-block; transform: scaleX(-1); }
html[dir="rtl"] ul, html[dir="rtl"] ol { padding-inline-start: 1.25rem; padding-inline-end: 0; }
html[dir="rtl"] .cmap-legend, html[dir="rtl"] .hero-art { direction: rtl; }
html[dir="rtl"] .hero-art svg { transform: scaleX(-1); }
html[dir="rtl"] .ruler li { padding: 1.5rem 0 1.25rem 1.25rem; }
html[dir="rtl"] .ruler li::before { left: auto; right: 0; }
html[dir="rtl"] .ruler li:last-child::after { right: auto; left: 0; }

/* ---------- Kibo greeting video (home hero) ---------- */
.greeter { margin: 0 0 1rem; width: 100%; max-width: 30rem; }
.greeter-video { display: block; width: 100%; height: auto; aspect-ratio: 864 / 496; border-radius: 16px; border: 3px solid var(--night); background: #cfe3f3; }
.greeter figcaption { margin-top: 0.35rem; font-weight: 800; font-size: 0.9rem; color: var(--ink-soft); }

@media print { .greeter { display: none; } }

/* ---------- teacher classroom ---------- */
.btn-sm { font-size: 0.85rem; padding: 0.35rem 0.6rem; border-width: 2px; border-radius: 8px; }
.mono { font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; }
.class-table td.actions { display: flex; flex-wrap: wrap; gap: 0.35rem; border-bottom: 0; }
.class-table tbody tr { border-bottom: 1px solid var(--line); }
.class-table td, .class-table th { vertical-align: middle; }
.results { margin: 1.5rem 0; }
.form textarea { width: 100%; font: inherit; padding: 0.6rem 0.8rem; border: 2px solid var(--ink); border-radius: 10px; background: var(--white); color: var(--ink); resize: vertical; }
.cards-print { display: none; }
@media print {
  body.print-cards > *:not(.cards-print) { display: none !important; }
  body.print-cards .cards-print { display: grid; grid-template-columns: 1fr 1fr; gap: 0.6cm; padding: 0; }
  body.print-cards .login-card { break-inside: avoid; border: 2px dashed #000; border-radius: 0.4cm; padding: 0.5cm 0.6cm; color: #000; background: #fff; font-size: 12pt; }
  body.print-cards .login-card p { margin: 0.15cm 0; }
  body.print-cards .lc-brand { font-weight: 800; font-size: 14pt; }
  body.print-cards .lc-name { font-weight: 800; font-size: 16pt; }
  body.print-cards .sticky-nav { display: none !important; }
}
[data-app="classroom"] > * + * { margin-top: 1.5rem; }
[data-app="classroom"] .bar + .form-msg { margin-top: 0.5rem; }

/* ---------- Teach the machine: clearer full-size version ---------- */
.board-key { list-style: none; margin: 0.7rem 0 0; padding: 0; display: grid; gap: 0.2rem; font-size: 0.875rem; color: var(--ink-soft); }
.board-key li::before { content: "•"; margin-right: 0.45rem; color: var(--night); font-weight: 800; }
.coach { background: #fff8e1; border: 2px solid var(--ink); border-radius: 14px; padding: 0.7rem 0.9rem 0.8rem; margin-bottom: 1rem; position: relative; }
.coach-name { margin: 0 0 0.2rem; font-weight: 800; font-size: 0.875rem; color: var(--ink-soft); text-transform: none; }
.coach-face { font-size: 1.3rem; vertical-align: middle; }
.coach .lab-message { min-height: 3.6em; margin: 0; color: var(--ink); font-size: 1.1rem; font-weight: 700; line-height: 1.4; }
.score { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.8rem; margin: 0.3rem 0 0.4rem; }
.score-big { font-size: 2.4rem; font-weight: 800; line-height: 1; color: var(--ink); font-variant-numeric: tabular-nums; }
.score-small { font-weight: 700; color: var(--ink-soft); }
.meter { position: relative; }
.meter-goal { position: absolute; top: 0; bottom: 0; left: 80%; width: 0; border-left: 3px dashed var(--ink); }
.goal { margin: 0 0 0.9rem; padding: 0.5rem 0.8rem; border-radius: 10px; border: 2px dashed var(--line); background: var(--white); }
.goal.reached { border: 2px solid var(--ok); background: #e9f7ef; }
.goal-text { margin: 0; font-weight: 700; font-size: 0.95rem; }
.goal-stars { margin: 0.2rem 0 0; font-size: 1.6rem; letter-spacing: 0.15em; color: #b8860b; }
.patch-label.needs { fill: var(--ink); opacity: 1; text-decoration: underline; }
.tally-details { margin: 0.4rem 0 0.8rem; }
.tally-details summary { cursor: pointer; font-weight: 800; padding: 0.3rem 0; }
.tally-details .tally { margin-top: 0.3rem; }
.patch-label { font-size: 3.8px; }

/* ---------- hero mini game: mission, numbered steps, result card ---------- */
.mini-mission { background: var(--paper); border: 2px solid var(--ink); border-radius: 14px; padding: 0.8rem 1rem; margin: 0 0 0.9rem; }
.mini-goal { margin: 0 0 0.5rem; font-weight: 700; }
.mini-steps { list-style: none; counter-reset: ms; margin: 0; padding: 0; display: grid; gap: 0.3rem; }
.mini-steps li { counter-increment: ms; display: flex; align-items: center; gap: 0.5rem; font-weight: 700; color: var(--ink-soft); }
.mini-steps li::before {
  content: counter(ms); flex: none; display: inline-grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%;
  border: 2px solid var(--ink); background: var(--white); color: var(--ink); font-size: 0.9rem;
}
.mini-steps li.current { color: var(--ink); }
.mini-steps li.current::before { background: var(--night); color: var(--white); border-color: var(--night); }
.mini-steps li.done { color: var(--ink); }
.mini-steps li.done::before { content: "\2713"; background: var(--ok); border-color: var(--ok); color: var(--white); }
.mini-result { margin-top: 0.4rem; }
.mini-score { margin: 0 0 0.4rem; font-size: 2rem; font-weight: 800; line-height: 1.1; color: var(--ink); }
.mini-explain { margin: 0.5rem 0 0; color: var(--ink-soft); font-size: 0.9375rem; }
.lab-buttons .is-off { visibility: hidden; }
.hide-guesses .cell.day, .hide-guesses .cell.night { fill-opacity: 0; }
html[lang^="ar"] .sk-legend { height: 30px; }

/* ---------- Try page: "Sort it like a robot" ---------- */
.sortbot { max-width: 46rem; }
.sb-step h3, .sb-out h3 { margin: 0 0 0.6rem; }
.sb-list, .sb-results { list-style: none; margin: 0 0 1rem; padding: 0; display: grid; gap: 0.6rem; }
.sb-item, .sb-res {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem 0.8rem; padding: 0.7rem 0.9rem;
  background: var(--white); border: 2px solid var(--ink); border-radius: 14px;
}
.sb-emoji { font-size: 2rem; line-height: 1; flex: none; }
.sb-name { font-weight: 800; min-width: 6.5rem; }
.sb-bins { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-inline-start: auto; }
.sb-bin { padding: 0.5rem 0.9rem; font-size: 0.9375rem; }
.sb-go { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin: 0 0 1.4rem; }
.sb-hint { color: var(--ink-soft); font-weight: 600; }
.sb-out { margin-top: 1.4rem; }
.sb-res.is-right { border-color: var(--ok); background: var(--ok-wash); }
.sb-res.is-wrong { border-color: var(--bad); }
.sb-res-body { display: grid; gap: 0.15rem; flex: 1 1 14rem; }
.sb-says { font-weight: 700; }
.sb-why { color: var(--ink-soft); font-size: 0.9375rem; }
.sb-verdict { font-weight: 800; margin-inline-start: auto; }
.sb-res.is-right .sb-verdict { color: var(--ok); }
.sb-res.is-wrong .sb-verdict { color: var(--bad); }
.sb-score { font-size: 1.5rem; font-weight: 800; margin: 0 0 0.5rem; }
.sb-explain { font-weight: 700; margin: 0 0 0.5rem; }
.sb-learn { color: var(--ink-soft); margin: 0 0 1rem; }
.sb-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0; }
@media (max-width: 40rem) { .sb-bins { margin-inline-start: 0; width: 100%; } .sb-bin { flex: 1 1 8rem; } .sb-verdict { margin-inline-start: 0; width: 100%; } }
