/* Code Arena
 * Brand (from the Instagram page): teal "CODE", red "ARENA", binary
 * digits, deep purple and light blue panels, yellow highlights.
 * Layout: a sticky top bar, then one reading column; lessons add a
 * lesson index on the start (right) side on wide screens. Code blocks
 * are always dark purple "terminal" panels in both themes. */
:root {
  --bg: #f2f7fa;
  --surface: #ffffff;
  --surface-2: #e6f0f5;
  --ink: #17142e;
  --muted: #556078;
  --line: #d3e1ea;
  --accent: #087f92;          /* brand teal, dark enough for text */
  --accent-ink: #ffffff;
  --accent-soft: #daf2f6;
  --brand-teal: #1fbfd2;
  --brand-red: #e3373b;
  --brand-purple: #33276b;
  --brand-sky: #a3d3e5;
  --brand-yellow: #ffe45c;
  --gold: #9a6a00;
  --gold-soft: #fff3c4;
  --ok: #17804a;
  --ok-soft: #dff3e7;
  --bad: #c4282d;
  --bad-soft: #fde4e5;
  --code-bg: #1e1840;
  --code-bar: #2b2358;
  --code-ink: #ece9fb;
  --code-dim: #9b94c4;
  --tok-key: #6fe0ee;
  --tok-str: #ffe45c;
  --tok-num: #9df0c6;
  --tok-fn: #ff9a9c;
  --tok-com: #8079ab;

  --f-logo: "Fredoka", "Cairo", "Segoe UI", sans-serif;
  --f-display: "Cairo", "Segoe UI", Tahoma, sans-serif;
  --f-body: "IBM Plex Sans Arabic", "Segoe UI", Tahoma, sans-serif;
  --f-mono: "JetBrains Mono", Consolas, "Courier New", monospace;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(23, 20, 46, .06), 0 4px 16px rgba(23, 20, 46, .05);
  color-scheme: light;
}

/* Dark theme: by the device setting, unless the theme button chose light
 * (data-theme="light"), or forced by the button (data-theme="dark"). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #110e24;
    --surface: #1a1634;
    --surface-2: #241e45;
    --ink: #ece9f8;
    --muted: #a49fc4;
    --line: #322a5c;
    --accent: #45d3e4;
    --accent-ink: #110e24;
    --accent-soft: #163a4a;
    --brand-teal: #45d3e4;
    --brand-red: #ff5a5e;
    --gold: #f5c542;
    --gold-soft: #3a2f0d;
    --ok: #4fcb87;
    --ok-soft: #12301f;
    --bad: #ff6f74;
    --bad-soft: #3d1518;
    --code-bg: #0d0a1f;
    --code-bar: #1d1740;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #110e24;
  --surface: #1a1634;
  --surface-2: #241e45;
  --ink: #ece9f8;
  --muted: #a49fc4;
  --line: #322a5c;
  --accent: #45d3e4;
  --accent-ink: #110e24;
  --accent-soft: #163a4a;
  --brand-teal: #45d3e4;
  --brand-red: #ff5a5e;
  --gold: #f5c542;
  --gold-soft: #3a2f0d;
  --ok: #4fcb87;
  --ok-soft: #12301f;
  --bad: #ff6f74;
  --bad-soft: #3d1518;
  --code-bg: #0d0a1f;
  --code-bar: #1d1740;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

* { box-sizing: border-box; }
/* `hidden` must win over the display rules below (grid forms, flex nav). */
[hidden] { display: none !important; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 17px;
  line-height: 1.75;
}

h1, h2, h3 {
  font-family: var(--f-display);
  line-height: 1.35;
  text-wrap: balance;
  margin: 0;
}
h1 { font-size: clamp(1.7rem, 4vw, 2.4rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1.1rem; font-weight: 600; }
p { margin: 0; }

a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible,
textarea:focus-visible, summary:focus-visible, .option:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

code {
  font-family: var(--f-mono);
  font-size: .88em;
  background: var(--surface-2);
  border-radius: 5px;
  padding: .05em .35em;
  unicode-bidi: isolate;
}

/* ---------------------------------------------------------------- top bar */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: .6rem max(16px, env(safe-area-inset-right, 0px)) .6rem max(16px, env(safe-area-inset-left, 0px));
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.brand {
  font-family: var(--f-logo);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: .02em;
  text-decoration: none;
  display: inline-flex;
  align-items: baseline;
  gap: .3rem;
  line-height: 1;
}
.logo-code { color: var(--brand-teal); }
.logo-arena { color: var(--brand-red); }
.brand-mark { display: none; }
.mainnav { display: flex; gap: .25rem; flex: 1; }
.mainnav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  padding: .35rem .7rem;
  border-radius: 8px;
}
.mainnav a:hover { background: var(--surface-2); color: var(--ink); }
.mainnav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }

.xp-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--gold-soft);
  color: var(--gold);
  border-radius: 999px;
  padding: .2rem .8rem;
  font-size: .9rem;
  text-decoration: none;
  white-space: nowrap;
}
.xp-chip strong { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* ------------------------------------------------------------------- page */
.page {
  max-width: 1180px;
  margin: 0 auto;
  padding: 2rem max(16px, env(safe-area-inset-right, 0px)) 4rem max(16px, env(safe-area-inset-left, 0px));
  display: grid;
  gap: 2.5rem;
}
.page:focus { outline: none; }

.narrow { max-width: 760px; width: 100%; margin: 0 auto; display: grid; gap: 1.25rem; min-width: 0; }
.narrow.wide { max-width: 980px; }

.eyebrow {
  color: var(--muted);
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .02em;
}
.eyebrow a { color: inherit; }
.lede { color: var(--muted); font-size: 1.08rem; max-width: 62ch; }
.fine { color: var(--muted); font-size: .88rem; }
.note {
  background: var(--gold-soft);
  color: var(--ink);
  border-radius: var(--radius);
  padding: .7rem 1rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }

/* ---------------------------------------------------------------- buttons */
.btn, .btn-ghost {
  font: inherit;
  font-weight: 600;
  font-size: .95rem;
  border-radius: 8px;
  padding: .5rem 1.1rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.5;
}
.btn { background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); }
.btn:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--surface-2); }
.signout-btn { padding: .3rem .8rem; font-size: .85rem; white-space: nowrap; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }

/* ---------------------------------------------------------------- welcome */
.welcome {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
  padding-block: 2rem;
}
.welcome-copy { display: grid; gap: 1rem; }
.welcome-form { padding: 1.5rem; display: grid; gap: .5rem; }
.welcome-form .btn { margin-top: .75rem; }

label, .field-label { font-weight: 600; font-size: .92rem; }
input[type="text"], select, textarea {
  font: inherit;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: .55rem .75rem;
}
textarea {
  font-family: var(--f-mono);
  font-size: .9rem;
  line-height: 1.6;
  resize: vertical;
  tab-size: 4;
  text-align: left;
}

input[type="password"] {
  font: inherit;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: .55rem .75rem;
}
input[type="date"], input[type="time"] {
  font: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: .5rem .7rem;
}
.auth-form { display: grid; gap: .5rem; }
.group-box { display: grid; }
.text-answer {
  font-family: var(--f-mono);
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: .55rem .75rem;
  text-align: left;
}
.is-right .text-answer { border-color: var(--ok); background: var(--ok-soft); }
.is-wrong .text-answer { border-color: var(--bad); background: var(--bad-soft); }
.answer-key { margin: .4rem 0 0; font-weight: 600; color: var(--ok); }
.auth-form .btn { margin-top: .75rem; }
.auth-title { margin: 0 0 .25rem; font-size: 1.25rem; }
.auth-back {
  justify-self: start;
  font: inherit;
  font-size: .9rem;
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
}
.auth-back:hover { text-decoration: underline; }
.auth-chooser { display: grid; gap: .6rem; }
.auth-choice {
  font: inherit;
  text-align: start;
  display: grid;
  gap: .15rem;
  padding: .85rem 1rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.auth-choice strong { font-size: 1.05rem; }
.auth-choice span { font-size: .85rem; color: var(--muted); }
.auth-choice:hover { border-color: var(--accent); background: var(--surface-2); }
.auth-choice.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.auth-choice.primary span { color: inherit; opacity: .85; }
.auth-choice.primary:hover { filter: brightness(1.08); background: var(--accent); }
.form-error {
  background: var(--bad-soft);
  color: var(--bad);
  border-radius: 8px;
  padding: .55rem .8rem;
  font-weight: 600;
  font-size: .92rem;
}
.tabs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--surface-2);
  border-radius: 9px;
  padding: 3px;
  margin-bottom: .6rem;
}
.tab {
  font: inherit;
  font-weight: 600;
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: .4rem;
  border-radius: 7px;
  cursor: pointer;
}
.tab[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow); }

/* --------------------------------------------------------------- sessions */
.sessions { display: grid; gap: 1rem; }
.session-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1rem; }
.session { padding: 1.1rem 1.2rem; display: grid; gap: .5rem; align-content: start; }
.session.next { border-color: var(--accent); border-width: 2px; }
.session-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.session-when { font-family: var(--f-display); font-size: 1.05rem; }
.session-head .chip:last-child { margin-inline-start: auto; }
.rsvp-yes[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.rsvp-no[aria-pressed="true"] { background: var(--bad-soft); border-color: var(--bad); color: var(--bad); }
button:disabled { opacity: .6; cursor: progress; }

/* ------------------------------------------------------------------- home */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  align-items: center;
}
.hero > div:first-child { display: grid; gap: .8rem; justify-items: start; }
.level-card {
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 14px;
  padding: 1.4rem;
  display: grid;
  gap: .4rem;
}
.level-name { font-family: var(--f-display); font-weight: 800; font-size: 1.4rem; }
.level-xp { font-family: var(--f-mono); font-size: 2.2rem; color: var(--tok-str); font-variant-numeric: tabular-nums; line-height: 1.2; }
.level-card .fine { color: var(--code-dim); }

.bar {
  height: 8px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.level-card .bar { background: var(--code-bar); }
.bar span { display: block; height: 100%; background: var(--gold); border-radius: inherit; }
.level-card .bar span { background: var(--tok-str); }

.unit { display: grid; gap: 1rem; }
.lesson-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.lesson-card {
  display: grid;
  grid-template-rows: auto auto 1fr auto;
  gap: .4rem;
  padding: 1.1rem 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.lesson-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.lesson-card p { color: var(--muted); font-size: .92rem; line-height: 1.6; }
.lesson-num { font-family: var(--f-mono); color: var(--accent); font-weight: 600; font-size: .9rem; justify-self: start; }

.chips { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .4rem; }
.chip {
  font-size: .78rem;
  font-weight: 600;
  padding: .1rem .55rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--muted);
  white-space: nowrap;
}
.chip-ok { background: var(--ok-soft); color: var(--ok); }
.chip-gold { background: var(--gold-soft); color: var(--gold); }

/* ----------------------------------------------------------------- lesson */
.lesson-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 2.5rem;
  align-items: start;
}
.side {
  position: sticky;
  top: 4.5rem;
  max-height: calc(100vh - 6rem);
  overflow-y: auto;
  font-size: .9rem;
}
.side ol { list-style: none; margin: 0; padding: 0; counter-reset: l; display: grid; gap: .1rem; }
.side li { counter-increment: l; }
.side a {
  display: flex;
  gap: .6rem;
  padding: .35rem .6rem;
  border-radius: 7px;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.45;
}
.side a::before {
  content: counter(l, decimal-leading-zero);
  font-family: var(--f-mono);
  font-size: .78rem;
  padding-top: .1rem;
  min-width: 1.4rem;
}
.side a:hover { background: var(--surface-2); color: var(--ink); }
.side a.done::before { color: var(--ok); }
.side a.on { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

.lesson { display: grid; gap: 1.4rem; max-width: 780px; min-width: 0; }
.lesson-section { display: grid; gap: .8rem; }
.lesson-section p { max-width: 68ch; }
.block-title { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--line); }

/* code panels */
.code {
  margin: 0;
  background: var(--code-bg);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 0;
}
.code-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: .5rem;
  background: var(--code-bar);
  padding: .3rem .5rem .3rem .9rem;
}
.code-lang { font-family: var(--f-mono); font-size: .78rem; color: var(--code-dim); }
.code-actions { display: flex; gap: .3rem; }
.code-actions .btn-ghost {
  color: var(--code-ink);
  border-color: transparent;
  font-size: .8rem;
  padding: .15rem .6rem;
}
.code-actions .btn-ghost:hover { background: rgba(255, 255, 255, .08); }
.code pre {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  text-align: left;
  color: var(--code-ink);
  font-family: var(--f-mono);
  font-size: .88rem;
  line-height: 1.65;
  tab-size: 4;
}
.code pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.token.keyword, .token.class-name .keyword { color: var(--tok-key); }
.token.string, .token.char { color: var(--tok-str); }
.token.number, .token.boolean { color: var(--tok-num); }
.token.function { color: var(--tok-fn); }
.token.comment { color: var(--tok-com); font-style: italic; }
.token.class-name { color: #a9e6ff; }
.token.punctuation, .token.operator { color: var(--code-dim); }

pre.example {
  margin: 0;
  font-family: var(--f-mono);
  font-size: .86rem;
  background: var(--surface-2);
  border-radius: 8px;
  padding: .6rem .9rem;
  text-align: left;
  white-space: pre-wrap;
}

/* exercises */
.exercise { padding: 1.2rem; display: grid; gap: .8rem; min-width: 0; }
.exercise-head { display: flex; justify-content: space-between; align-items: center; gap: .8rem; flex-wrap: wrap; }
details {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .45rem .8rem;
}
details > summary { cursor: pointer; font-weight: 600; color: var(--accent); }
details[open] > summary { margin-bottom: .6rem; }
details .code { margin-bottom: .3rem; }

.quiz-cta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--accent-soft);
  border-radius: 14px;
  padding: 1.3rem 1.5rem;
  margin-top: 1rem;
}
.quiz-cta p { color: var(--muted); }

.pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-weight: 600; }
.pager a { text-decoration: none; }

/* ------------------------------------------------------------------- quiz */
.quiz { display: grid; gap: 1rem; justify-items: start; }
.quiz > .question { width: 100%; }
.question { margin: 0; padding: 1.2rem; display: grid; gap: .8rem; min-width: 0; }
.question legend { display: contents; }
.question legend > span:last-child { font-weight: 600; font-size: 1.05rem; display: block; }
.q-num { display: block; font-size: .8rem; color: var(--muted); font-weight: 600; }
.options { display: grid; gap: .5rem; }
.option {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .55rem .8rem;
  cursor: pointer;
  font-weight: 400;
  font-size: .98rem;
}
.option:hover { background: var(--surface-2); }
.option input { margin-top: .45rem; accent-color: var(--accent); }
.option:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.option.opt-right { border-color: var(--ok); background: var(--ok-soft); }
.option.opt-wrong { border-color: var(--bad); background: var(--bad-soft); }
.question.is-right { border-inline-start: 4px solid var(--ok); }
.question.is-wrong { border-inline-start: 4px solid var(--bad); }
.explain { color: var(--muted); font-size: .94rem; }

.quiz-result {
  background: var(--code-bg);
  color: var(--code-ink);
  border-radius: 14px;
  padding: 1.5rem;
  display: grid;
  gap: .6rem;
  justify-items: start;
}
.quiz-result .score { font-family: var(--f-mono); font-size: 2.4rem; line-height: 1.2; font-variant-numeric: tabular-nums; }
.quiz-result .gain { font-family: var(--f-mono); color: var(--tok-str); font-weight: 600; }
.quiz-result .btn-ghost { color: var(--code-ink); border-color: var(--code-dim); }

/* ------------------------------------------------------------- playground */
.steps { margin: 0; padding-inline-start: 1.3rem; color: var(--muted); }
.editor {
  min-height: 420px;
  background: var(--code-bg);
  color: var(--code-ink);
  border-color: var(--code-bar);
  padding: 1rem;
}
.embed iframe { width: 100%; height: 520px; border: 1px solid var(--line); border-radius: var(--radius); }

/* --------------------------------------------------------------- progress */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: .8rem; }
.stat {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .9rem 1rem;
  display: grid;
}
.stat strong { font-family: var(--f-mono); font-size: 1.4rem; font-variant-numeric: tabular-nums; text-align: start; }
.stat span { color: var(--muted); font-size: .88rem; }
.confirm { padding: 1rem 1.2rem; display: grid; gap: .8rem; }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
th, td { padding: .55rem .8rem; text-align: start; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 600; color: var(--muted); background: var(--surface-2); font-size: .85rem; }
tbody tr:last-child td { border-bottom: 0; }
td.num { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }
td a { text-decoration: none; }

/* ------------------------------------------------------------ brand bits */
/* Faint binary digits, as on the logo. */
.binary-bg {
  position: relative;
  isolation: isolate;
}
.binary-bg::before {
  content: "";
  position: absolute;
  inset: -1rem;
  z-index: -1;
  opacity: .5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='96'%3E%3Cg font-family='monospace' font-size='13' fill='%238aa3b8' fill-opacity='.35'%3E%3Ctext x='4' y='16'%3E1 0 1 1 0%3C/text%3E%3Ctext x='18' y='40'%3E0 1 0 0 1%3C/text%3E%3Ctext x='2' y='64'%3E1 1 0 1 0%3C/text%3E%3Ctext x='22' y='88'%3E0 0 1 0 1%3C/text%3E%3C/g%3E%3C/svg%3E");
  mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at center, #000 30%, transparent 75%);
  pointer-events: none;
}
.welcome h1 .hl { background: linear-gradient(transparent 55%, var(--brand-yellow) 55%); color: #17142e; padding-inline: .15em; }
@media (prefers-color-scheme: dark) { .welcome h1 .hl { color: #17142e; } }
.tagline { font-family: var(--f-mono); font-size: .85rem; color: var(--muted); letter-spacing: .04em; }

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  margin-top: 2rem;
}
.site-footer-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.4rem max(16px, env(safe-area-inset-right, 0px)) calc(1.4rem + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-wrap: wrap;
  gap: .6rem 2rem;
  align-items: center;
  justify-content: space-between;
  font-size: .9rem;
  color: var(--muted);
}
.site-footer .brand { font-size: 1.1rem; }
.site-footer a { color: var(--accent); }
.footer-info { display: flex; flex-wrap: wrap; gap: .3rem 1.5rem; }

/* ------------------------------------------------- feedback, homework */
.chip-bad { background: var(--bad-soft); color: var(--bad); }
.fb-chip {
  background: var(--brand-red);
  color: #fff;
  border-radius: 999px;
  padding: .2rem .8rem;
  font-size: .85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.notice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--bad-soft);
  color: var(--ink);
  border: 1px solid var(--brand-red);
  border-radius: var(--radius);
  padding: .9rem 1.2rem;
  text-decoration: none;
}
.notice span { color: var(--bad); font-weight: 600; }
.notice-soft { background: var(--gold-soft); border-color: var(--gold); }
.notice-soft span { color: var(--gold); }

/* Review page and streak. */
.streak { margin: .2rem 0 0; font-weight: 700; color: var(--brand-yellow); }
.streak.fine { font-weight: 400; color: var(--code-dim); }
.streak .fine { color: var(--code-dim); font-weight: 400; }
.mistakes-card { padding: 1rem 1.2rem; margin-bottom: 1rem; }
.mistakes-card h2 { margin: 0 0 .2rem; font-size: 1.15rem; }
.rv-block { padding: .8rem 1.1rem; margin-bottom: .7rem; }
.rv-block > summary { cursor: pointer; font-weight: 700; }
.rv-block.has-wrong > summary { color: var(--bad); }
.rv-list { list-style: none; margin: .6rem 0; padding: 0; display: grid; gap: .6rem; }
.rv-item { border: 1px solid var(--line); border-inline-start-width: 4px; border-radius: 8px; padding: .6rem .8rem; display: grid; gap: .35rem; }
.rv-item.is-right { border-inline-start-color: var(--ok); }
.rv-item.is-wrong { border-inline-start-color: var(--bad); }
.rv-item p { margin: 0; }
.rv-right { color: var(--ok); font-weight: 600; }
.teacher-note {
  background: var(--accent-soft);
  border-inline-start: 4px solid var(--accent);
  border-radius: 8px;
  padding: .7rem .9rem;
  display: grid;
  gap: .4rem;
}
.pre-line { white-space: pre-line; }
.fb-list { display: grid; gap: .8rem; }
.fb-item { padding: 1rem 1.2rem; display: grid; gap: .5rem; }
.fb-item.unseen { border-color: var(--brand-red); }
.hw-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 1rem; }
.hw { padding: 1.1rem 1.2rem; display: grid; gap: .5rem; align-content: start; }
.hw.hw-done { border-color: var(--ok); }
.hw-lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: .3rem; font-size: .92rem; }
.hw-lessons li { display: flex; justify-content: space-between; gap: .6rem; flex-wrap: wrap; }
.hw-lessons li::before { content: "○"; color: var(--muted); margin-inline-end: .2rem; }
.hw-lessons li.ok::before { content: "✓"; color: var(--ok); }
.hw-lessons li a { flex: 1; }

/* -------------------------------------------------------- trace tables */
table.trace { width: auto; min-width: 100%; }
table.trace th { text-align: center; font-family: var(--f-mono); }
table.trace td { padding: .3rem; text-align: center; }
table.trace td.fixed { font-family: var(--f-mono); background: var(--surface-2); padding-inline: .7rem; white-space: nowrap; }
table.trace input {
  font: inherit;
  font-family: var(--f-mono);
  width: 100%;
  min-width: 4.5rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .3rem .4rem;
  background: var(--surface);
  color: var(--ink);
}
table.trace td.cell-right input { border-color: var(--ok); background: var(--ok-soft); }
table.trace td.cell-wrong input { border-color: var(--bad); background: var(--bad-soft); }
table.trace td.cell-shown input { border-color: var(--gold); background: var(--gold-soft); }

/* --------------------------------------------------------------- exam */
.exam-setup { padding: 1.2rem; display: grid; gap: 1rem; }
.plain-fieldset { border: 0; margin: 0; padding: 0; display: grid; gap: .5rem; min-width: 0; }
.plain-fieldset legend { font-weight: 600; margin-bottom: .4rem; padding: 0; }
.exam-bar {
  position: sticky;
  top: calc(env(safe-area-inset-top, 0px) + 3.6rem);
  z-index: 5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  background: var(--brand-purple);
  color: #fff;
  border-radius: var(--radius);
  padding: .6rem 1rem;
}
.exam-timer { font-family: var(--f-mono); font-size: 1.3rem; font-variant-numeric: tabular-nums; }
.exam-timer.warn { color: var(--brand-yellow); }
.weak-list { margin: .3rem 0 0; padding-inline-start: 1.2rem; }
.weak-list a { color: var(--tok-key); }

/* -------------------------------------------------------------- arena */
.narrow-tabs { max-width: 320px; }
table.arena td { padding: .65rem .9rem; }
table.arena .rank { width: 3rem; font-weight: 600; text-align: center; }
table.arena tr.top .rank { color: var(--gold); }
table.arena tr.me td { background: var(--accent-soft); font-weight: 600; }
table.arena tr.gap td { text-align: center; color: var(--muted); }
table.arena .chip { margin-inline-start: .5rem; }
.nick-box { padding: 1rem 1.2rem; display: grid; gap: .5rem; }
.nick-box input { flex: 1; min-width: 0; }

/* ---------------------------------------------------------------- teacher */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .3rem .8rem; }
.check { display: flex; gap: .5rem; align-items: center; font-weight: 400; font-size: .92rem; }
.fb-form { display: grid; gap: .5rem; border-top: 1px dashed var(--line); padding-top: .7rem; }
.mark-btn { font-size: .85rem; padding: .25rem .8rem; }
.mark-excellent[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.mark-good[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #fff; }
.mark-fix[aria-pressed="true"] { background: var(--bad); border-color: var(--bad); color: #fff; }

/* Teacher: attendance per lesson. */
.attendance > summary { cursor: pointer; font-weight: 600; }
.att-list { list-style: none; margin: .6rem 0; padding: 0; display: grid; gap: .3rem; }
.att-row {
  display: flex;
  flex-wrap: wrap;
  gap: .3rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: .3rem 0;
  border-bottom: 1px solid var(--line);
}
.att-yes[aria-pressed="true"] { background: var(--ok); border-color: var(--ok); color: #fff; }
.att-late[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: #fff; }
.att-no[aria-pressed="true"] { background: var(--bad); border-color: var(--bad); color: #fff; }

/* Teacher: a student's answers, question by question. */
.link-btn {
  font: inherit;
  background: none;
  border: 0;
  padding: 0;
  color: var(--accent);
  cursor: pointer;
  text-align: start;
}
.link-btn:hover { text-decoration: underline; }
.ans-section h3 { margin: .8rem 0 .4rem; font-size: 1rem; }
.ans-block { border: 1px solid var(--line); border-radius: 8px; padding: .4rem .7rem; margin-bottom: .4rem; background: var(--surface); }
.ans-block > summary { cursor: pointer; font-weight: 600; }
.ans-list { margin: .5rem 0 0; padding-inline-start: 0; list-style: none; display: grid; gap: .45rem; }
.ans { padding: .4rem .6rem; border-radius: 6px; border-inline-start: 4px solid var(--line); background: var(--surface-2); }
.ans-right { border-inline-start-color: var(--ok); }
.ans-wrong { border-inline-start-color: var(--bad); }
.ans-code { margin: .3rem 0; padding: .4rem .6rem; border-radius: 6px; background: var(--code-bg); color: var(--code-ink); font-family: var(--f-mono); font-size: .82rem; white-space: pre-wrap; text-align: left; }
.cell-expected { color: var(--muted); font-size: .8em; }
.answers-panel table.trace td { font-family: var(--f-mono); padding: .3rem .6rem; }
.answers-panel table.trace td.cell-right { background: var(--ok-soft); color: var(--ok); }
.answers-panel table.trace td.cell-wrong { background: var(--bad-soft); color: var(--bad); }
.sol-lock { margin: .2rem 0; }

/* Teacher: managing students and groups. */
.manage > summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.manage-box { display: grid; gap: .5rem; padding: .5rem 0; min-width: 260px; }
.groups-card, .blocked-card { padding: .8rem 1.1rem; margin: .8rem 0; display: grid; gap: .5rem; }
.groups-card > summary { cursor: pointer; font-weight: 700; }
.group-chip { display: inline-flex; align-items: center; gap: .25rem; }
.chip-btn { font: inherit; font-size: .85rem; background: none; border: 0; padding: 0 .2rem; color: var(--muted); cursor: pointer; }
.chip-btn:hover { color: var(--accent); }
.chip-btn.wide { border: 1px dashed var(--line); border-radius: 6px; padding: .1rem .5rem; margin-inline-end: .3rem; }

/* Teacher: questions and sets. */
.q-editor { padding: 1rem 1.2rem; display: grid; gap: .6rem; margin-top: 1rem; }
.q-editor h2, .q-editor h3 { margin: .2rem 0; }
.q-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.q-item { border: 1px solid var(--line); border-radius: 8px; padding: .6rem .8rem; background: var(--surface); display: grid; gap: .3rem; }
.q-item p { margin: 0; }
.q-hidden { opacity: .55; border-style: dashed; }
.q-options { margin: 0; padding-inline-start: 1.1rem; font-size: .92rem; }
.q-correct { color: var(--ok); font-weight: 600; }
.q-form { padding: 1rem 1.2rem; display: grid; gap: .6rem; border: 2px solid var(--accent-soft); }
.q-form textarea[dir="ltr"] { font-family: var(--f-mono); font-size: .9rem; text-align: left; }
.q-choice, .q-text { display: grid; gap: .35rem; }
.q-opt { gap: .6rem; }
.q-opt .inline-input { flex: 1; }

/* Teacher: exercise and trace table editors. */
.q-item pre.ans-code { margin: .2rem 0; }
table.trace td.cell-fill { font-family: var(--f-mono); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.tf-grid { border: 1px dashed var(--line); border-radius: 8px; padding: .4rem; }
table.tf-table th { vertical-align: top; padding: .3rem; }
table.trace input.tf-cell { min-width: 4rem; }
table.tf-table th input.tf-cell { font-weight: 700; background: var(--surface-2); }
.tf-given { justify-content: center; font-size: .8rem; font-weight: 400; color: var(--muted); margin-top: .2rem; font-family: var(--f-body); }
.chip-teacher { background: var(--accent-soft); color: var(--accent); }

/* Teacher: progress report for parents. */
.report-card { padding: 1rem 1.25rem; margin-bottom: 1.25rem; display: grid; gap: .6rem; }
.report-card h2 { margin: 0; font-size: 1.15rem; }
.report-text { font-family: var(--f-body); font-size: .95rem; line-height: 1.7; text-align: right; }
.spread { justify-content: space-between; }
.inline-label { font-weight: 600; font-size: .9rem; display: inline-flex; align-items: center; gap: .4rem; }
.inline-select { width: auto; padding: .3rem .6rem; }
.inline-input { width: 11rem; padding: .3rem .6rem; }
.session-form { padding: 1.2rem; display: grid; gap: .8rem; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .8rem; }
.field { display: grid; gap: .3rem; min-width: 0; }
.field input { width: 100%; }
textarea.plain { font-family: var(--f-body); font-size: .95rem; text-align: start; }
.t-sessions { display: grid; gap: .8rem; }
.t-session { padding: 1rem 1.2rem; display: grid; gap: .6rem; }
.rsvp-counts { display: flex; flex-wrap: wrap; gap: .4rem; }
.rsvp-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.rsvp-cols h4 { margin: 0 0 .3rem; font-size: .9rem; }
.name-list { margin: 0; padding-inline-start: 1.1rem; font-size: .92rem; }
.danger-armed { background: var(--bad); border-color: var(--bad); color: #fff; }

/* Teacher: sign-ups waiting for approval, shown above every tab. */
.approval-panel {
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border: 2px solid var(--brand-yellow);
  background: var(--gold-soft);
}
.approval-panel h2 { margin: 0 0 .5rem; font-size: 1.15rem; }
.approval-panel h3 { margin: .9rem 0 .4rem; font-size: 1rem; }
.approval-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .5rem; }
.approval-item {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  align-items: center;
  justify-content: space-between;
  padding: .6rem .8rem;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.whatsapp-btn { background: #1f8f4e; border-color: #1f8f4e; color: #fff; }
.pending-card p { margin: 0; }
.lesson-key { columns: 3 220px; font-size: .85rem; color: var(--muted); margin: 0; padding-inline-start: 1.4rem; }
.matrix td, .matrix th { padding: .4rem .5rem; text-align: center; }
.matrix .sticky-col { position: sticky; inset-inline-start: 0; background: var(--surface); text-align: start; z-index: 1; }
.matrix th.sticky-col { background: var(--surface-2); }
.cell-full { background: var(--ok-soft); color: var(--ok); }
.cell-mid { background: var(--gold-soft); color: var(--gold); }
.cell-low { background: var(--bad-soft); color: var(--bad); }
.cell-empty { color: var(--line); }
.t-solution { padding: 1rem 1.2rem; display: grid; gap: .6rem; min-width: 0; }
pre.solution {
  margin: 0;
  background: var(--code-bg);
  color: var(--code-ink);
  font-family: var(--f-mono);
  font-size: .85rem;
  border-radius: 8px;
  padding: .8rem 1rem;
  overflow-x: auto;
  text-align: left;
  max-height: 360px;
}

/* ------------------------------------------------------------------ toast */
.toast {
  position: fixed;
  bottom: calc(1.2rem + env(safe-area-inset-bottom, 0px));
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: .6rem 1.1rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: .92rem;
  z-index: 30;
  max-width: calc(100vw - 32px);
}

/* ------------------------------------------------------------- responsive */
@media (max-width: 900px) {
  .lesson-layout { grid-template-columns: minmax(0, 1fr); }
  .side { display: none; }
  .hero, .welcome { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 560px) {
  body { font-size: 16px; }
  .mainnav { order: 3; flex-basis: 100%; }
  .xp-chip { margin-inline-start: auto; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page { padding-top: 1.25rem; gap: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ------------------------------------------- automata and Turing machines */
.m-widget { display: grid; gap: .6rem; }
.m-kind { margin: 0; }
.m-text { width: 100%; font-family: var(--f-mono); font-size: .92rem; direction: ltr; text-align: left; border: 1px solid var(--line); border-radius: 8px; padding: .6rem .7rem; background: var(--surface); color: var(--ink); resize: vertical; }
.m-errors { margin: 0; padding: .5rem .9rem; border-radius: 8px; background: var(--bad-soft); color: var(--bad); font-size: .9rem; list-style: none; }
.m-picture { border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: .3rem; overflow: hidden; }
.m-picture.m-quiz { max-width: 460px; }
.m-diagram { display: block; width: 100%; height: auto; max-height: 340px; overflow: visible; color: var(--ink); }
.m-diagram .m-edge { fill: none; stroke: var(--muted); stroke-width: 1.6; }
.m-diagram .m-arrowhead { fill: var(--muted); }
.m-diagram .m-label { font-family: var(--f-mono); font-size: 13px; fill: var(--accent); paint-order: stroke; stroke: var(--surface); stroke-width: 4px; stroke-linejoin: round; }
.m-diagram .m-state circle { fill: var(--surface); stroke: var(--ink); stroke-width: 1.8; }
.m-diagram .m-state text { font-family: var(--f-mono); font-size: 13px; font-weight: 600; fill: var(--ink); }
.m-diagram .m-state.on circle { fill: var(--brand-yellow); stroke: var(--gold); stroke-width: 2.6; }
.m-diagram .m-state.on text { fill: #17142e; }
.m-diagram .m-state .m-inner { fill: none; }
.m-tablebox:empty, .m-tape:empty, .m-out:empty { display: none; }
table.m-table { width: auto; font-family: var(--f-mono); }
table.m-table th, table.m-table td { text-align: center; padding: .25rem .7rem; }
.m-run { display: grid; gap: .5rem; }
.m-input { font-family: var(--f-mono); direction: ltr; border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; min-width: 12rem; background: var(--surface); color: var(--ink); }
.m-examples { gap: .3rem; align-items: center; }
.m-chip { cursor: pointer; border: 1px solid var(--line); font-family: var(--f-mono); }
.m-tape { display: flex; flex-wrap: wrap; gap: 3px; direction: ltr; }
.m-cell { font-family: var(--f-mono); min-width: 1.9rem; text-align: center; padding: .25rem .3rem; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.m-cell.done { opacity: .45; }
.m-cell.here { border-color: var(--gold); background: var(--gold-soft); font-weight: 700; box-shadow: 0 0 0 2px var(--gold-soft); }
.m-out p, .m-result p { margin: 0; }
.m-good { color: var(--ok); font-weight: 600; }
.m-bad { color: var(--bad); font-weight: 600; }
.m-path { font-family: var(--f-mono); font-size: .88rem; margin: .3rem 0 0; padding-inline-start: 1.6rem; max-height: 14rem; overflow: auto; }
.m-demo { padding: .9rem 1rem; display: grid; gap: .5rem; margin: .6rem 0; }
.m-task .m-widget { margin-top: .4rem; }
.m-solution, .m-help pre { font-family: var(--f-mono); font-size: .88rem; direction: ltr; text-align: left; background: var(--surface-2); border-radius: 8px; padding: .6rem .8rem; white-space: pre-wrap; }
.m-help { padding: .8rem 1rem; margin-top: 1rem; }
.lab-link { margin: .4rem 0 1rem; }

/* ------------------------------------------------ top bar icon buttons */
.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-size: 1rem;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  padding: 0;
}
.icon-btn:hover, .icon-btn[aria-current="page"] { background: var(--accent-soft); border-color: var(--accent); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
@media (max-width: 560px) {
  .mainnav { overflow-x: auto; scrollbar-width: none; }
  .mainnav::-webkit-scrollbar { display: none; }
  .mainnav a { white-space: nowrap; }
}

/* ---------------------------------------------------------- glossary */
.term-he { font-family: "Segoe UI", Arial, "Noto Sans Hebrew", sans-serif; font-weight: 600; unicode-bidi: isolate; }
.term-en { font-family: var(--f-mono); font-size: .9em; unicode-bidi: isolate; }
.terms-filter input, .terms-filter select, #search-q {
  font: inherit; border: 1px solid var(--line); border-radius: 8px; padding: .5rem .7rem;
  background: var(--surface); color: var(--ink);
}
.terms-filter input { flex: 1; min-width: 12rem; }
#search-q { width: 100%; font-size: 1.05rem; }
.terms-list { display: grid; gap: 1.5rem; }
.terms-group { display: grid; gap: .6rem; }
.terms-group h2 { font-size: 1.05rem; }
.terms-group h2 a { color: inherit; text-decoration: none; }
.terms-group h2 a:hover { color: var(--accent); }
.term { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: .7rem 1rem; display: grid; gap: .3rem; }
.term-names { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem 1rem; }
.term-ar { font-size: 1.05rem; }
.term-def { color: var(--muted); font-size: .93rem; margin: 0; }
.cards-cta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 1rem; }
.cards-cta h2 { font-size: 1.1rem; margin-bottom: .2rem; }
.lesson-terms { display: grid; gap: .7rem; }
.lesson-terms h2 { font-size: 1.15rem; }
table.terms-table td { padding: .35rem .8rem; }

.flash-stage { display: grid; gap: .8rem; }
.flash-card { min-height: 11rem; display: grid; align-content: center; gap: 1rem; text-align: center; }
.flash-front { font-size: 1.9rem; font-weight: 700; font-family: var(--f-display); }
.flash-front .term-en { font-size: .8em; }
.flash-back { border-top: 1px dashed var(--line); padding-top: .9rem; display: grid; gap: .4rem; }
.flash-back p { margin: 0; }
.flash-names { font-size: 1.05rem; }
.flash-grade .btn, .flash-grade .btn-ghost { min-width: 8rem; }
.btn-ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.flash-done { display: grid; gap: .7rem; }

/* ------------------------------------------------------------ search */
.search-results { display: grid; gap: .5rem; }
.search-hit {
  display: grid; gap: .2rem; justify-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: .65rem .9rem; color: var(--ink); text-decoration: none;
}
.search-hit:hover { border-color: var(--accent); }
.lesson-section { scroll-margin-top: 5.5rem; }
.flash-target { animation: target-glow 2.4s ease-out 1; border-radius: var(--radius); }
@keyframes target-glow {
  0%, 40% { box-shadow: 0 0 0 4px var(--gold-soft); background: var(--gold-soft); }
  100% { box-shadow: 0 0 0 4px transparent; background: transparent; }
}

/* ------------------------------------------------------------ badges */
.badges h2 { font-size: 1.15rem; margin-bottom: .6rem; }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .7rem; }
.badge {
  display: grid; gap: .2rem; justify-items: center; text-align: center;
  border: 1px dashed var(--line); border-radius: var(--radius); padding: .8rem .6rem;
  color: var(--muted);
}
.badge.on { border: 1px solid var(--gold); background: var(--gold-soft); color: var(--ink); }
.badge .badge-icon { font-size: 1.7rem; }
.badge:not(.on) .badge-icon { opacity: .55; }
.badge-toast {
  position: fixed;
  top: 4.5rem;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex; align-items: center; gap: .8rem;
  background: var(--surface); color: var(--ink);
  border: 2px solid var(--gold); border-radius: 12px;
  box-shadow: var(--shadow);
  padding: .7rem 1.1rem;
  text-decoration: none;
  max-width: calc(100vw - 32px);
  animation: badge-in .35s ease-out 1;
}
.badge-toast > span:last-child { display: grid; }
.badge-toast .badge-icon { font-size: 2rem; }
@keyframes badge-in { from { opacity: 0; transform: translate(-50%, -12px); } to { opacity: 1; transform: translate(-50%, 0); } }
