/* Matteplugg – lugn, trygg, rutat papper.
   Tokens först; allt annat bygger på dem. */

:root {
  --paper: #F6F7FB;
  --sheet: #FFFFFF;
  --sheet-2: #FBFBFE;
  --ink: #1E2240;
  --ink-soft: #454A6B;
  --muted: #62678A;
  --line: #DCDFEC;
  --line-strong: #C3C8DD;
  --grid: rgba(75, 91, 215, 0.075);
  --grid-major: rgba(75, 91, 215, 0.11);

  --primary: #4B5BD7;
  --primary-hover: #3F4EC4;
  --primary-ink: #FFFFFF;
  --primary-soft: #E8EBFC;
  --primary-text: #3A49C2;

  --teal: #1F9D7A;
  --teal-text: #157458;
  --teal-soft: #DDF3EC;

  --highlight: #FFD166;
  --highlight-soft: rgba(255, 209, 102, 0.6);

  --orange: #E08A3C;
  --orange-text: #8F4E12;
  --orange-soft: #FCEBDA;

  --focus: #4B5BD7;
  --shadow: 0 1px 2px rgba(30, 34, 64, 0.05), 0 10px 30px -12px rgba(30, 34, 64, 0.16);
  --shadow-lift: 0 2px 4px rgba(30, 34, 64, 0.06), 0 16px 36px -14px rgba(75, 91, 215, 0.45);
  --radius: 20px;
  --radius-sm: 14px;

  --font-head: "Bricolage Grotesque", ui-rounded, "Segoe UI", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", sans-serif;
  --measure: 62ch;
  --page: 40rem;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #11142A;
    --sheet: #1A1E3A;
    --sheet-2: #1E2344;
    --ink: #ECEEFA;
    --ink-soft: #C4C8E4;
    --muted: #A2A7CC;
    --line: #2E3460;
    --line-strong: #3E4578;
    --grid: rgba(150, 162, 255, 0.055);
    --grid-major: rgba(150, 162, 255, 0.09);

    --primary: #5566E0;
    --primary-hover: #6474EA;
    --primary-ink: #FFFFFF;
    --primary-soft: #262C5A;
    --primary-text: #AEB7FA;

    --teal: #3CC39C;
    --teal-text: #6FDDBD;
    --teal-soft: #173C3A;

    --highlight: #FFD166;
    --highlight-soft: rgba(255, 209, 102, 0.28);

    --orange: #F0A461;
    --orange-text: #F6BE8A;
    --orange-soft: #3A2A22;

    --focus: #AEB7FA;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 12px 30px -12px rgba(0, 0, 0, 0.55);
    --shadow-lift: 0 2px 4px rgba(0, 0, 0, 0.3), 0 16px 36px -14px rgba(85, 102, 224, 0.6);
    color-scheme: dark;
  }
}

/* ------------------------------------------------------------ base */

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

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  /* Rutat papper: fint rutnät, var femte linje lite tydligare. */
  background-image:
    linear-gradient(var(--grid-major) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-major) 1px, transparent 1px),
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  background-position: -1px -1px;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.015em;
  margin: 0 0 0.5rem;
  text-wrap: balance;
}
h1 { font-size: clamp(1.9rem, 6.4vw, 2.6rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 0.9rem; max-width: var(--measure); }
a { color: var(--primary-text); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }
small, .small { font-size: 0.9rem; }
.muted { color: var(--muted); }
.lead { font-size: 1.12rem; color: var(--ink-soft); }

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

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

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* Överstrykningspenna: en mjuk gul markering bakom ordet. */
.hl {
  background-image: linear-gradient(
    100deg,
    transparent 0.2em,
    var(--highlight-soft) 0.35em,
    var(--highlight-soft) calc(100% - 0.35em),
    transparent calc(100% - 0.1em)
  );
  background-size: 100% 0.62em;
  background-position: 0 88%;
  background-repeat: no-repeat;
  padding: 0 0.12em;
  -webkit-box-decoration-break: clone;
  box-decoration-break: clone;
}

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

.topbar {
  width: 100%;
  max-width: calc(var(--page) + 2.5rem);
  margin: 0 auto;
  padding: max(0.9rem, env(safe-area-inset-top)) 1.25rem 0.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--ink);
  text-decoration: none;
  min-height: 48px;
}
.brand svg { width: 34px; height: 34px; }
.topnav { display: flex; gap: 0.25rem; }
.topnav a {
  display: inline-flex; align-items: center;
  min-height: 48px; padding: 0 0.85rem;
  border-radius: 999px;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.95rem;
}
.topnav a:hover { background: var(--primary-soft); color: var(--primary-text); }

.page {
  flex: 1;
  width: 100%;
  max-width: calc(var(--page) + 2.5rem);
  margin: 0 auto;
  padding: 0.75rem 1.25rem 2.5rem;
}

.stack > * + * { margin-top: 1.25rem; }
.stack-sm > * + * { margin-top: 0.6rem; }

.foot {
  width: 100%;
  max-width: calc(var(--page) + 2.5rem);
  margin: 0 auto;
  padding: 1.25rem 1.25rem max(1.5rem, env(safe-area-inset-bottom));
  color: var(--muted);
  font-size: 0.9rem;
}
.foot p {
  display: flex; gap: 0.55rem; align-items: flex-start;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px dashed var(--line-strong);
}
.foot svg { flex: none; width: 20px; height: 20px; margin-top: 0.1rem; color: var(--primary-text); }

/* ------------------------------------------------------------ cards */

.card {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.1rem;
  box-shadow: var(--shadow);
}
.card > :last-child { margin-bottom: 0; }
.card-title {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}
.card-title h2 { margin: 0; }
.eyebrow {
  font-family: var(--font-head);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.btn {
  -webkit-appearance: none;
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 52px;
  padding: 0.7rem 1.3rem;
  border-radius: 16px;
  border: 2px solid transparent;
  font: inherit;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.btn svg { width: 22px; height: 22px; flex: none; }
.btn-primary { background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-lift); }
.btn-primary:hover { background: var(--primary-hover); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary { background: var(--sheet); color: var(--primary-text); border-color: var(--primary); }
.btn-secondary:hover { background: var(--primary-soft); }
.btn-quiet { background: transparent; color: var(--ink-soft); border-color: var(--line-strong); }
.btn-quiet:hover { background: var(--sheet); border-color: var(--muted); }
.btn-block { display: flex; width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] {
  cursor: not-allowed;
  background: var(--sheet-2);
  color: var(--muted);
  border: 2px dashed var(--line-strong);
  box-shadow: none;
}
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }
.btn-row > .btn { flex: 1 1 12rem; }

/* Stora valknappar på startsidan. */
.choice {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: 88px;
  padding: 1.05rem 1.15rem;
  border-radius: 22px;
  border: 2px solid transparent;
  text-decoration: none;
  text-align: left;
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.choice .choice-icon {
  display: grid; place-items: center;
  width: 52px; height: 52px;
  border-radius: 16px;
}
.choice .choice-icon svg { width: 30px; height: 30px; }
.choice strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1.28rem;
  line-height: 1.2;
}
.choice span.sub { display: block; font-size: 0.97rem; margin-top: 0.2rem; }
.choice .chev { width: 24px; height: 24px; opacity: 0.8; }
.choice-primary { background: var(--primary); color: var(--primary-ink); box-shadow: var(--shadow-lift); }
.choice-primary .choice-icon { background: rgba(255, 255, 255, 0.16); }
.choice-primary span.sub { color: rgba(255, 255, 255, 0.88); }
.choice-primary:hover { background: var(--primary-hover); transform: translateY(-1px); }
.choice-secondary { background: var(--sheet); color: var(--ink); border-color: var(--line); box-shadow: var(--shadow); }
.choice-secondary .choice-icon { background: var(--teal-soft); color: var(--teal-text); }
.choice-secondary span.sub { color: var(--muted); }
.choice-secondary:hover { border-color: var(--primary); transform: translateY(-1px); }

/* ------------------------------------------------------------ forms */

label, .label {
  display: block;
  font-weight: 700;
  margin-bottom: 0.35rem;
}
.hint-text { display: block; font-weight: 400; color: var(--muted); font-size: 0.93rem; margin-top: 0.1rem; }
input[type="text"], input[type="password"], textarea {
  width: 100%;
  font: inherit;
  color: var(--ink);
  background: var(--sheet);
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 0.8rem 0.95rem;
  min-height: 52px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
textarea { min-height: 7.5rem; resize: vertical; line-height: 1.5; }
textarea.short { min-height: 4.5rem; }
input:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.field + .field { margin-top: 1rem; }
.field-hint { margin: -0.15rem 0 0.4rem; }
input[aria-invalid="true"] { border-color: var(--orange); }

/* Password with a show/hide button inside the field (right side). */
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 3.6rem; }
.pw-wrap input::-ms-reveal, .pw-wrap input::-ms-clear { display: none; }
.pw-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, background-color 0.15s;
}
.pw-toggle[hidden] { display: none; }
.pw-toggle:hover { color: var(--ink); background: var(--primary-soft); }
.pw-toggle:focus-visible { outline: 3px solid var(--focus); outline-offset: 0; }
.pw-toggle[aria-pressed="true"] { color: var(--primary-text); }
.pw-toggle svg { width: 22px; height: 22px; }
.pw-toggle .pw-eye-off, .pw-toggle[aria-pressed="true"] .pw-eye { display: none; }
.pw-toggle[aria-pressed="true"] .pw-eye-off { display: contents; }
.pw-toggle > span { display: contents; }

math-field {
  display: block;
  width: 100%;
  min-height: 56px;
  font-size: 1.35rem;
  padding: 0.55rem 0.8rem;
  border: 2px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--sheet);
  color: var(--ink);
  --caret-color: var(--primary);
  --selection-background-color: var(--primary-soft);
  --contains-highlight-background-color: transparent;
  --primary: var(--primary);
}
math-field:focus-within { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); outline: none; }
math-field::part(virtual-keyboard-toggle) { color: var(--primary-text); }
math-field::part(menu-toggle) { display: none; }

/* Utan MathLive syns textfältet; med MathLive byts det mot formelfältet. */
.mathlive-only { display: none; }
.has-mathlive .mathlive-only { display: block; }
.has-mathlive .text-fallback.hide-when-mathlive { display: none; }
.has-mathlive.prefer-text .mathlive-only { display: none; }
.has-mathlive.prefer-text .text-fallback.hide-when-mathlive { display: block; }
.linklike {
  background: none; border: 0; padding: 0.4rem 0; min-height: 44px;
  font: inherit; font-size: 0.93rem; color: var(--primary-text);
  text-decoration: underline; text-underline-offset: 0.18em; cursor: pointer;
}

/* ------------------------------------------------------------ notes / feedback */

.note {
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.05rem;
  border: 1px solid var(--line);
  background: var(--sheet-2);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.75rem;
  align-items: start;
}
.note > svg { width: 24px; height: 24px; margin-top: 0.1rem; }
.note p { margin: 0; }
.note p + p { margin-top: 0.45rem; }
.note strong.title { display: block; font-family: var(--font-head); font-size: 1.05rem; margin-bottom: 0.15rem; }
.note-good { background: var(--teal-soft); border-color: transparent; }
.note-good > svg, .note-good .title { color: var(--teal-text); }
.note-check { background: var(--orange-soft); border-color: transparent; }
.note-check > svg, .note-check .title { color: var(--orange-text); }
.note-info { background: var(--primary-soft); border-color: transparent; }
.note-info > svg { color: var(--primary-text); }
.note-gentle { background: var(--sheet); border: 1.5px dashed var(--line-strong); }
.note-gentle > svg { color: var(--primary-text); }

.error-text { color: var(--orange-text); font-weight: 700; }

/* ------------------------------------------------------------ home */

.hello h1 { margin-bottom: 0.25rem; }
.hello p { color: var(--ink-soft); margin: 0; }

.week-list { list-style: none; margin: 0.25rem 0 0.9rem; padding: 0; }
.week-list li {
  position: relative;
  padding: 0.45rem 0 0.45rem 1.6rem;
  border-bottom: 1px dashed var(--line);
}
.week-list li:last-child { border-bottom: 0; }
.week-list li::before {
  content: "";
  position: absolute; left: 0.2rem; top: 1.05rem;
  width: 0.7rem; height: 0.7rem;
  border-radius: 3px;
  border: 2px solid var(--primary);
  transform: rotate(45deg) scale(0.8);
}
.event {
  display: flex; gap: 0.7rem; align-items: center;
  padding: 0.75rem 0.9rem;
  border-radius: var(--radius-sm);
  background: var(--sheet-2);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 0.97rem;
}
.event svg { width: 22px; height: 22px; color: var(--primary-text); flex: none; }

.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; padding: 0; margin: 0.25rem 0 0.8rem; }
.chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  background: var(--teal-soft);
  color: var(--teal-text);
  font-weight: 700;
  font-size: 0.95rem;
}
.chip svg { width: 16px; height: 16px; }
.growth {
  display: flex; align-items: center; gap: 0.75rem;
  font-size: 0.98rem; color: var(--ink-soft);
}
.growth svg { width: 28px; height: 28px; flex: none; color: var(--teal); }
.growth b { font-family: var(--font-head); font-size: 1.3rem; color: var(--teal-text); }

.empty {
  display: grid; grid-template-columns: auto 1fr; gap: 0.9rem; align-items: center;
  color: var(--ink-soft);
}
.empty svg { width: 56px; height: 56px; color: var(--teal); }
.empty p { margin: 0; }

/* ------------------------------------------------------------ problem */

.problem {
  position: relative;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem 1.15rem 1.35rem;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.problem::before {
  /* marginal-linje som i ett räknehäfte */
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 5px;
  background: var(--primary);
  opacity: 0.85;
}
.problem .statement { font-size: 1.12rem; margin: 0.2rem 0 0; }
.problem .display-math { margin-top: 0.6rem; font-size: 1.2rem; overflow-x: auto; overflow-y: hidden; padding: 0.2rem 0; }
.tag-pill {
  display: inline-block;
  font-size: 0.82rem; font-weight: 700;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  background: var(--primary-soft); color: var(--primary-text);
}

/* ------------------------------------------------------------ the stair (ladder) */

.stair-wrap { margin: 0.2rem 0 0.4rem; }
.stair {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  align-items: end;
  gap: 6px;
  height: 64px;
  padding: 0 2px;
}
.stair .tread {
  position: relative;
  border-radius: 8px 8px 3px 3px;
  background: var(--sheet);
  border: 2px dashed var(--line-strong);
  transition: background-color 0.3s, border-color 0.3s;
}
.stair .tread:nth-child(1) { height: 20%; }
.stair .tread:nth-child(2) { height: 40%; }
.stair .tread:nth-child(3) { height: 60%; }
.stair .tread:nth-child(4) { height: 80%; }
.stair .tread:nth-child(5) { height: 100%; }
.stair .tread.open { background: var(--primary); border: 2px solid var(--primary); }
.stair .tread.next { border: 2px solid var(--primary); background: var(--primary-soft); }
.stair .tread.locked { opacity: 0.45; }
.stair-labels {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 0.35rem;
  font-size: 0.78rem;
  line-height: 1.2;
  color: var(--muted);
  text-align: center;
}
.stair-labels .on { color: var(--primary-text); font-weight: 700; }

.ladder { list-style: none; margin: 0; padding: 0; }
.ladder > li + li { margin-top: 0.8rem; }
.hint {
  position: relative;
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.95rem 1.05rem 1rem;
  box-shadow: var(--shadow);
  margin-left: calc((var(--lvl) - 1) * 0.3rem);
}
.hint-head {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-head);
  font-weight: 700;
  margin: 0 0 0.35rem;
  font-size: 1rem;
}
.step-badge {
  display: inline-grid; place-items: center;
  min-width: 2rem; height: 2rem;
  padding: 0 0.4rem;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary-text);
  font-size: 0.95rem;
}
.hint-text-body { margin: 0; }
.hint.full { border-color: var(--primary); }
.hint.new { animation: rise 0.45s ease-out both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
.solution { list-style: none; margin: 0.6rem 0 0; padding: 0; counter-reset: s; }
.solution li {
  counter-increment: s;
  padding: 0.6rem 0 0.6rem 2.2rem;
  position: relative;
  border-top: 1px dashed var(--line);
}
.solution li::before {
  content: counter(s);
  position: absolute; left: 0; top: 0.65rem;
  width: 1.6rem; height: 1.6rem;
  border-radius: 8px;
  display: grid; place-items: center;
  background: var(--sheet-2);
  border: 1px solid var(--line);
  font-size: 0.85rem; font-weight: 700;
}
.solution .why { color: var(--muted); font-size: 0.95rem; margin: 0.15rem 0 0; }
.solution .math { overflow-x: auto; overflow-y: hidden; margin-top: 0.25rem; }
.answer-line {
  margin-top: 0.4rem;
  padding: 0.6rem 0.8rem;
  border-radius: 12px;
  background: var(--sheet-2);
}

/* ------------------------------------------------------------ work area */

.work-grid > * + * { margin-top: 1.1rem; }
.panel {
  background: var(--sheet);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.1rem 1.15rem 1.2rem;
  box-shadow: var(--shadow);
}
.panel h2 { font-size: 1.15rem; margin-bottom: 0.65rem; }
.panel form + form { margin-top: 1.1rem; padding-top: 1.1rem; border-top: 1px dashed var(--line); }
.inline-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 0.75rem; }
.inline-actions .btn { flex: 1 1 11rem; }

.hint-cta { text-align: left; }
.hint-cta .btn { width: 100%; flex-direction: column; align-items: flex-start; gap: 0.15rem; text-align: left; padding: 0.85rem 1.2rem; }
.hint-cta .btn > span:first-child { display: inline-flex; align-items: center; gap: 0.55rem; }
.hint-cta .nextname { font-family: var(--font-body); font-weight: 400; font-size: 0.95rem; color: var(--ink-soft); padding-left: calc(22px + 0.55rem); }
.status-line { color: var(--muted); font-size: 0.95rem; margin-top: 0.5rem; }

.progress-dots { display: flex; gap: 6px; align-items: center; }
.progress-dots span { width: 10px; height: 10px; border-radius: 50%; background: var(--line-strong); }
.progress-dots span.done { background: var(--teal); }
.progress-dots span.now { background: var(--primary); }

/* ------------------------------------------------------------ thinking */

.thinking { text-align: center; padding: 1.5rem 0.5rem; }
.thinking .stair { max-width: 220px; margin: 0.5rem auto 1.25rem; height: 80px; }
.thinking .stair .tread { animation: glow 2.5s ease-in-out infinite; }
.thinking .stair .tread:nth-child(2) { animation-delay: 0.25s; }
.thinking .stair .tread:nth-child(3) { animation-delay: 0.5s; }
.thinking .stair .tread:nth-child(4) { animation-delay: 0.75s; }
.thinking .stair .tread:nth-child(5) { animation-delay: 1s; }
@keyframes glow {
  0%, 100% { background: var(--sheet); border-color: var(--line-strong); }
  40% { background: var(--primary-soft); border-color: var(--primary); }
}
.thinking p { margin-left: auto; margin-right: auto; }

/* ------------------------------------------------------------ practice */

.predict { display: grid; grid-template-columns: repeat(6, 1fr); gap: 0.45rem; border: 0; padding: 0; margin: 0.4rem 0 0; }
.predict legend { font-weight: 700; margin-bottom: 0.5rem; padding: 0; }
.predict input { position: absolute; opacity: 0; pointer-events: none; }
.predict label {
  display: grid; place-items: center;
  min-height: 56px;
  margin: 0;
  border-radius: 14px;
  border: 2px solid var(--line-strong);
  background: var(--sheet);
  font-family: var(--font-head);
  font-size: 1.3rem;
  cursor: pointer;
}
.predict input:checked + label { border-color: var(--primary); background: var(--primary-soft); color: var(--primary-text); }
.predict input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: 2px; }

.calib {
  display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem;
}
.calib div {
  background: var(--sheet-2); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 0.8rem 0.9rem;
}
.calib b { display: block; font-family: var(--font-head); font-size: 2rem; line-height: 1.1; }

/* ------------------------------------------------------------ parent */

.stat-table { width: 100%; border-collapse: collapse; font-size: 0.97rem; }
.stat-table th, .stat-table td { text-align: left; padding: 0.5rem 0.4rem; border-bottom: 1px dashed var(--line); }
.stat-table th { color: var(--muted); font-weight: 700; font-size: 0.85rem; }
.table-wrap { overflow-x: auto; }
.bar { height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; min-width: 60px; }
.bar i { display: block; height: 100%; background: var(--teal); border-radius: 99px; }

/* ------------------------------------------------------------ login */

.login-wrap { max-width: 26rem; margin: 5vh auto 0; }
.login-wrap .brand-big { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 1rem; }
.login-wrap .brand-big svg { width: 52px; height: 52px; }
.login-wrap .brand-big span { font-family: var(--font-head); font-weight: 700; font-size: 1.6rem; }

/* ------------------------------------------------------------ larger screens */

@media (min-width: 720px) {
  body { font-size: 1.1rem; }
  .page { padding-top: 1.5rem; }
  .card, .panel { padding: 1.5rem 1.6rem 1.4rem; }
  .problem { padding: 1.35rem 1.6rem 1.4rem 1.8rem; }
  .hint { margin-left: calc((var(--lvl) - 1) * 1rem); }
  .choice-row { display: grid; grid-template-columns: 1.35fr 1fr; gap: 1rem; }
  .choice-row > * + * { margin-top: 0; }
  .choice-row .choice { height: 100%; }
  .stair { height: 72px; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

.htmx-request .btn[type="submit"], .htmx-request.btn { opacity: 0.7; }
.mt { margin-top: 1.25rem; }
.photo-soon { margin: 0.6rem 0 0; }
.mt-sm { margin-top: 0.6rem; }
.inline-actions > form { flex: 1 1 11rem; }
.inline-actions > form .btn { width: 100%; }
.note-inline {
  margin: 0.4rem 0 0.7rem;
  padding: 0.7rem 0.9rem;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--ink);
  font-weight: 700;
}
.plan-details { margin-top: 1rem; padding-top: 0.6rem; border-top: 1px dashed var(--line); }
.plan-details summary {
  cursor: pointer; min-height: 44px; display: flex; align-items: center;
  color: var(--primary-text); font-weight: 700;
}
.plan-details form { margin-top: 0.5rem; }
.plan-inline { scroll-margin: 5rem 0; }
.plan-inline label { display: block; font-weight: 700; margin-bottom: 0.3rem; }
.plan-inline .note-inline { margin-top: 0; }
.hint-cta .plan-inline .btn { flex-direction: row; align-items: center; justify-content: center; }
.choices { border: 0; padding: 0; margin: 0 0 0.5rem; }
.choice-line {
  display: flex; gap: 0.6rem; align-items: flex-start; font-weight: 400;
  padding: 0.7rem 0.8rem; border: 2px solid var(--line); border-radius: 12px; margin-bottom: 0.5rem; cursor: pointer;
}
.choice-line:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.set-aside { text-align: center; }
.panel h2 svg { width: 22px; height: 22px; vertical-align: -3px; color: var(--primary-text); }
.lvl-1 { --lvl: 1; } .lvl-2 { --lvl: 2; } .lvl-3 { --lvl: 3; } .lvl-4 { --lvl: 4; } .lvl-5 { --lvl: 5; }
.calib span { display: block; }
.bar i.w-0 { width: 0; } .bar i.w-1 { width: 10%; } .bar i.w-2 { width: 20%; } .bar i.w-3 { width: 30%; }
.bar i.w-4 { width: 40%; } .bar i.w-5 { width: 50%; } .bar i.w-6 { width: 60%; } .bar i.w-7 { width: 70%; }
.bar i.w-8 { width: 80%; } .bar i.w-9 { width: 90%; } .bar i.w-10 { width: 100%; }
a.note { text-decoration: none; color: var(--ink); }
a.note:hover { outline: 2px solid var(--primary); outline-offset: 0; }
a.note strong { color: var(--primary-text); }

/* ------------------------------------------------------------ waiting for the tutor */
.thinking-line { display: flex; align-items: center; gap: 0.6rem; color: var(--ink-soft); margin: 0; }
.dots { display: inline-flex; gap: 4px; }
.dots::before, .dots::after, .dots { content: ""; }
.dots {
  width: 30px; height: 8px;
  background:
    radial-gradient(circle 4px, var(--primary) 98%, transparent) 0 50% / 10px 8px no-repeat,
    radial-gradient(circle 4px, var(--primary) 98%, transparent) 50% 50% / 10px 8px no-repeat,
    radial-gradient(circle 4px, var(--primary) 98%, transparent) 100% 50% / 10px 8px no-repeat;
  animation: dots 1.2s ease-in-out infinite;
}
@keyframes dots { 0%, 100% { opacity: 0.35; } 50% { opacity: 1; } }
.pending-hint { border-style: dashed; margin-top: 0.8rem; }
.work-details { margin-top: 0.8rem; }
.work-details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--primary-text); font-weight: 700; }
.work-details textarea { margin-top: 0.4rem; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; }
.check-line { display: inline; }
.photo-work { margin-top: 0.6rem; }
.photo-pick { display: inline-flex; align-items: center; gap: 0.45rem; text-align: left; }
.photo-pick svg { width: 20px; height: 20px; flex: none; }

/* ------------------------------------------------------------ photo crop */
.cropper { margin-top: 0.9rem; }
.crop-stage { position: relative; width: 100%; border-radius: var(--radius-sm); overflow: hidden; background: var(--sheet-2); touch-action: none; }
.crop-stage canvas { display: block; max-width: 100%; }
.crop-box {
  position: absolute;
  border: 2px solid var(--highlight);
  box-shadow: 0 0 0 9999px rgba(17, 20, 42, 0.45);
  border-radius: 6px;
  cursor: move;
  touch-action: none;
}
.crop-handle {
  position: absolute; width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--highlight);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
}
.crop-handle.nw { left: -14px; top: -14px; cursor: nwse-resize; }
.crop-handle.ne { right: -14px; top: -14px; cursor: nesw-resize; }
.crop-handle.sw { left: -14px; bottom: -14px; cursor: nesw-resize; }
.crop-handle.se { right: -14px; bottom: -14px; cursor: nwse-resize; }
.btn-photo { position: relative; }
.btn-photo input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.uncertain-list { list-style: none; padding: 0; margin: 0.4rem 0 0; }
.uncertain-list li { margin: 0.35rem 0; }

/* ------------------------------------------------------------ dagens pass */
.mix-list { list-style: none; margin: 0 0 0.9rem; padding: 0; }
.mix-list li {
  display: flex; flex-direction: column; gap: 0.1rem;
  padding: 0.55rem 0; border-bottom: 1px dashed var(--line);
}
.mix-list li:last-child { border-bottom: 0; }
.mix-name { font-weight: 700; }
.mix-why { color: var(--muted); font-size: 0.93rem; }
.why { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; color: var(--ink-soft); font-size: 0.97rem; margin: 0; }
.why svg { width: 22px; height: 22px; color: var(--primary-text); margin-top: 0.1rem; }
.predict-7 { grid-template-columns: repeat(7, 1fr); }
.predict-8 { grid-template-columns: repeat(4, 1fr); }
.predict-9 { grid-template-columns: repeat(5, 1fr); }
.or-line { display: flex; align-items: center; gap: 0.8rem; color: var(--muted); font-size: 0.93rem; margin: 0; max-width: none; }
.or-line::before, .or-line::after { content: ""; flex: 1; border-top: 1px dashed var(--line-strong); }
.personal { margin-left: auto; font-family: var(--font-body); font-weight: 400; font-size: 0.8rem;
  color: var(--teal-text); background: var(--teal-soft); padding: 0.15rem 0.55rem; border-radius: 999px; }

/* ------------------------------------------------------------ fas 4: resurser vid talet */
.resources { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.75rem; }
.res-link {
  display: flex; align-items: center; gap: 0.6rem;
  min-height: 44px; padding: 0.45rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--sheet); border: 1px solid var(--line);
  color: var(--ink-soft); text-decoration: none; font-size: 0.97rem; line-height: 1.35;
}
.res-link svg { width: 22px; height: 22px; flex: none; color: var(--primary-text); }
a.res-link:hover { border-color: var(--primary); color: var(--primary-text); }
.res-plain { border-style: dashed; }
.quick-links { display: flex; flex-direction: column; gap: 0.5rem; }
.quick-links .res-link { padding: 0.7rem 0.95rem; }
.quick-links .res-link strong { color: var(--ink); }

/* Grafer från generatorerna: vit rundad bakgrund så att de syns i mörkt tema. */
.problem-figure { margin: 0.8rem 0 0; }
.problem-figure img {
  display: block; width: 100%; max-width: 22rem; height: auto;
  background: #fff; border-radius: var(--radius-sm); padding: 0.4rem;
  border: 1px solid var(--line);
}

/* ------------------------------------------------------------ utan räknare */
.toggle {
  display: grid; grid-template-columns: auto 1fr; gap: 0.8rem; align-items: start;
  padding: 0.75rem 0.9rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--line); background: var(--sheet-2); cursor: pointer; font-weight: 400;
}
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-track {
  width: 48px; height: 28px; border-radius: 999px; background: var(--line-strong);
  position: relative; transition: background 0.2s; margin-top: 0.1rem;
}
.toggle-knob {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform 0.2s;
}
.toggle input:checked + .toggle-track { background: var(--teal); }
.toggle input:checked + .toggle-track .toggle-knob { transform: translateX(20px); }
.toggle input:focus-visible + .toggle-track { outline: 3px solid var(--focus); outline-offset: 2px; }
.toggle:has(input:checked) { border-color: var(--teal); }
.toggle-text strong { display: block; }
.note-next { background: var(--primary-soft); border-color: transparent; }
.note-next > svg, .note-next .title { color: var(--primary-text); }
.note-calm { background: var(--teal-soft); border-color: transparent; }
.note-calm > svg { color: var(--teal-text); }
@media (prefers-reduced-motion: reduce) { .toggle-track, .toggle-knob { transition: none; } }

/* ------------------------------------------------------------ inför prov */
.fb-toc a.on, .fb-toc a[aria-current] { background: var(--primary-soft); border-color: var(--primary); color: var(--primary-text); }
.topic-details { margin-bottom: 0.9rem; }
.topic-details summary { cursor: pointer; color: var(--primary-text); font-weight: 700; min-height: 40px; display: flex; align-items: center; }
.topic-details .chips { margin-top: 0.4rem; }
.chip-quiet { background: var(--sheet-2); color: var(--ink-soft); border: 1px solid var(--line); }
.label { display: block; font-weight: 700; margin: 0.9rem 0 0.2rem; }
.plan-list { margin: 0; padding: 0; list-style: none; counter-reset: pl; }
.plan-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
  padding: 0.5rem 0; border-bottom: 1px dashed var(--line); counter-increment: pl;
}
.plan-list li:last-child { border-bottom: 0; }
.plan-list li > span::before {
  content: "Pass " counter(pl) " · "; color: var(--muted); font-size: 0.9rem; font-weight: 400;
}
.plan-list form { flex: none; }
.btn-small { min-height: 40px; padding: 0.3rem 0.9rem; font-size: 0.93rem; }
.how-list { margin: 0.8rem 0 1rem; padding-left: 1.2rem; color: var(--ink-soft); }
.how-list li { margin: 0.25rem 0; }
.summary-list { list-style: none; margin: 0 0 0.6rem; padding: 0; }
.summary-list li {
  display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; align-items: start;
  padding: 0.55rem 0; border-bottom: 1px dashed var(--line);
}
.summary-list li:last-child { border-bottom: 0; }
.summary-list svg { width: 22px; height: 22px; margin-top: 0.15rem; }
.sum-good svg { color: var(--teal); }
.sum-almost svg, .sum-practice svg { color: var(--orange); }
.sum-open svg { color: var(--muted); }
.review-item {
  background: var(--sheet); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.1rem 1.1rem 1rem; box-shadow: var(--shadow);
}
.review-item .problem { box-shadow: none; }
.review-num { font-size: 1.15rem; }
.state-pill {
  display: inline-flex; align-items: center; gap: 0.3rem;
  padding: 0.2rem 0.7rem; border-radius: 999px; font-weight: 700; font-size: 0.88rem;
}
.state-pill svg { width: 16px; height: 16px; }
.state-good { background: var(--teal-soft); color: var(--teal-text); }
.state-check { background: var(--orange-soft); color: var(--orange-text); }
.state-open { background: var(--sheet-2); color: var(--muted); border: 1px solid var(--line); }
.your-answer { margin: 0.8rem 0 0.5rem; }
.review-steps { display: flex; flex-direction: column; gap: 0.4rem; margin-top: 0.6rem; }
.rev-step {
  border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--sheet-2);
  padding: 0.35rem 0.8rem;
}
.rev-step summary {
  display: flex; align-items: center; gap: 0.6rem; min-height: 40px; cursor: pointer;
  font-family: var(--font-head); font-weight: 700; list-style: none;
}
.rev-step summary::-webkit-details-marker { display: none; }
.rev-step summary::after { content: "Visa"; margin-left: auto; font-family: var(--font-body); font-weight: 400; font-size: 0.88rem; color: var(--primary-text); }
.rev-step[open] summary::after { content: "Dölj"; }
.rev-step[open] { background: var(--sheet); }
.rev-step p { margin: 0.4rem 0 0.5rem; }

/* ------------------------------------------------------------ passkeys */
.mix-list li.passkey-row { flex-direction: row; align-items: center; justify-content: space-between; gap: 0.75rem; }
#faceid { display: flex; align-items: center; gap: 0.5rem; }
#faceid svg { width: 24px; height: 24px; color: var(--primary-text); }

/* ------------------------------------------------------------ föräldravyn */
.sub-head { font-size: 1.02rem; margin: 1.1rem 0 0.1rem; }
.area-list { list-style: none; margin: 0.3rem 0 0; padding: 0; }
.area-list li {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "name now" "spark spark";
  gap: 0.2rem 0.75rem; align-items: center; padding: 0.55rem 0; border-bottom: 1px dashed var(--line);
}
.area-list li:last-child { border-bottom: 0; }
@media (min-width: 30rem) {
  .area-list li { grid-template-columns: 1fr auto auto; grid-template-areas: "name spark now"; }
}
.area-name { grid-area: name; font-weight: 700; }
.area-list .spark { grid-area: spark; }
.area-now { grid-area: now; text-align: right; white-space: nowrap; font-size: 0.95rem; }
.spark { display: block; width: 120px; height: 32px; overflow: visible; }
.spark-base { stroke: var(--line); stroke-width: 1; }
.spark-line { fill: none; stroke: var(--teal); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.spark-dot { fill: var(--teal); }
.spark-hints .spark-line { stroke: var(--primary); }
.spark-hints .spark-dot { fill: var(--primary); }
.trend { display: inline-flex; align-items: center; gap: 0.2rem; margin-left: 0.4rem; font-size: 0.85rem; color: var(--teal-text); }
.trend svg { width: 16px; height: 16px; }
.hint-trend { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.hint-trend p { margin: 0; }

/* ------------------------------------------------------------ formelbladet */
.fb-toc { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.fb-toc a {
  padding: 0.35rem 0.8rem; min-height: 40px; display: inline-flex; align-items: center;
  border-radius: 999px; background: var(--sheet); border: 1px solid var(--line);
  text-decoration: none; font-weight: 700; font-size: 0.92rem; color: var(--ink-soft);
}
.fb-toc a:hover { border-color: var(--primary); color: var(--primary-text); }
.formula-sheet {
  background: var(--sheet); border: 1px solid var(--line-strong); border-radius: var(--radius);
  padding: 1.1rem 1.1rem 0.9rem; box-shadow: var(--shadow);
}
.fb-section { scroll-margin-top: 1rem; }
.fb-head {
  font-size: 0.95rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--primary-text); border-bottom: 2px solid var(--primary-soft);
  padding-bottom: 0.3rem; margin-bottom: 0.6rem;
}
.fb-intro { color: var(--ink-soft); font-size: 0.95rem; margin-bottom: 0.4rem; }
.fb-rows { margin: 0; }
.fb-row {
  display: grid; grid-template-columns: minmax(7.5rem, 34%) 1fr; gap: 0.2rem 0.8rem;
  padding: 0.5rem 0; border-bottom: 1px dashed var(--line); align-items: baseline;
}
.fb-row:last-child { border-bottom: 0; }
.fb-row-bare { grid-template-columns: 1fr; }
.fb-row dt { font-weight: 700; font-size: 0.95rem; }
.fb-row dd { margin: 0; min-width: 0; }
.fb-formulas { display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; overflow-x: auto; }
.fb-f { font-size: 1.05rem; }
.fb-note { display: block; color: var(--muted); font-size: 0.9rem; }
@media (max-width: 30rem) {
  .fb-row { grid-template-columns: 1fr; }
}
.fb-prefix { border-collapse: collapse; width: 100%; font-size: 0.97rem; }
.fb-prefix th, .fb-prefix td { text-align: left; padding: 0.3rem 0.5rem; border-bottom: 1px dashed var(--line); }
.fb-prefix th { color: var(--muted); font-size: 0.85rem; }
.fb-sym { font-weight: 700; font-family: var(--font-head); }
.memorize { border: 2px solid var(--highlight); }
.memorize-head { display: grid; grid-template-columns: auto 1fr; gap: 0.6rem; align-items: start; margin-bottom: 0.4rem; }
.memorize-head svg { width: 28px; height: 28px; color: var(--orange-text); margin-top: 0.1rem; }
.memorize-head h2 { margin: 0; font-size: 1.2rem; }
.memo-group { margin-top: 0.9rem; }
.memo-group h3 { margin-bottom: 0.3rem; }
.memo-group ul { list-style: none; margin: 0; padding: 0; }
.memo-group li { padding: 0.4rem 0; border-bottom: 1px dashed var(--line); overflow-x: auto; }
.memo-group li:last-child { border-bottom: 0; }

/* ------------------------------------------------------------ foto: så här läste jag det */

.read-back .statement { font-size: 1.15rem; }
.read-back .display-math { font-size: 1.35rem; }
.read-back .subparts { margin: 0.6rem 0 0; padding-left: 1.4rem; }
.read-back .subparts li { margin: 0.25rem 0; }
.read-unsure {
  display: grid; grid-template-columns: auto 1fr; gap: 0.55rem; align-items: start;
  margin-top: 0.9rem; padding-top: 0.8rem; border-top: 1px dashed var(--line-strong);
  color: var(--ink-soft);
}
.read-unsure > svg { width: 22px; height: 22px; color: var(--primary-text); margin-top: 0.1rem; }
.read-unsure p { margin: 0; }
.read-unsure .uncertain-list { margin-top: 0.2rem; }
.confirm-actions { display: flex; flex-direction: column; gap: 0.75rem; }
.confirm-actions > form { margin: 0; }
@media (min-width: 40rem) {
  .confirm-actions { flex-direction: row; }
  .confirm-actions > * { flex: 1 1 0; }
}
.solution-lines { list-style: none; margin: 0.4rem 0 0; padding: 0; }
.solution-lines li { padding: 0.3rem 0; overflow-x: auto; overflow-y: hidden; }
.solution-lines li + li { border-top: 1px dotted var(--line); }
.solution-lines .katex-display { margin: 0; text-align: left; }
.solution-lines .katex-display > .katex { text-align: left; }

/* ------------------------------------------------------------ Mina tal */

.topnav a[aria-current="page"] { background: var(--primary-soft); color: var(--primary-text); }
@media (max-width: 26rem) {
  .topbar { gap: 0.5rem; }
  .topnav { gap: 0; }
  .topnav a { padding: 0 0.6rem; }
  .brand span { font-size: 1.05rem; }
}
@media (max-width: 23rem) {
  .brand span { display: none; }
}

.continue { display: flex; flex-direction: column; gap: 0.35rem; }
.continue-all {
  align-self: flex-end;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 0.4rem;
  font-weight: 700; font-size: 0.95rem;
}

.tal-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.tal-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-areas: "meta chev" "preview chev" "progress chev";
  column-gap: 0.6rem; row-gap: 0.3rem;
  padding: 0.8rem 0.9rem 0.8rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--sheet);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--ink);
  text-decoration: none;
  overflow: hidden;
}
.tal-row::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px;
  background: var(--primary); opacity: 0.7;
}
.tal-aside::before { background: var(--line-strong); opacity: 1; }
.tal-done::before { background: var(--teal); }
.tal-row:hover { border-color: var(--primary); }
.tal-row:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.tal-meta {
  grid-area: meta;
  display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.45rem;
  font-size: 0.86rem; color: var(--muted);
}
.tal-meta .tag-pill { font-size: 0.8rem; }
.tal-meta > span { white-space: nowrap; }
.tal-preview {
  grid-area: preview;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  font-size: 1rem; line-height: 1.5;
  overflow-wrap: anywhere;
}
.tal-preview .katex { font-size: 1.02em; }
.tal-progress { grid-area: progress; font-size: 0.9rem; color: var(--ink-soft); }
.tal-row .chev { grid-area: chev; align-self: center; width: 22px; height: 22px; color: var(--muted); }
