:root {
  color-scheme: light;
  --ink: #2b1f1a;
  --ink-soft: #554238;
  --muted: #7a6558;
  --paper: #f7f1ec;
  --paper-2: #efe4dc;
  --glow-1: #f4ddd1;
  --glow-2: #edd8c8;
  --grid-line: rgba(43, 31, 26, 0.045);
  --panel: rgba(255, 255, 255, 0.9);
  --surface: #fff;
  --surface-2: rgba(247, 241, 236, 0.9);
  --surface-hover: rgba(255, 255, 255, 0.7);
  --line: rgba(43, 31, 26, 0.12);
  --accent: #b4532f;
  --accent-deep: #8c3c20;
  --lemma: #5a3b2c;
  --accent-soft: #f4ddd1;
  --accent-wash: rgba(180, 83, 47, 0.1);
  --accent-line: rgba(180, 83, 47, 0.35);
  --accent-line-soft: rgba(180, 83, 47, 0.22);
  --on-accent: #fff8f4;
  --track-bg: rgba(180, 83, 47, 0.12);
  --track-fade: rgba(180, 83, 47, 0.04);
  --track-line: rgba(180, 83, 47, 0.18);
  --fill: #b4532f;
  --fill-goal: #8c3c20;
  --fill-max: #6e2e18;
  --pos-neutral-bg: rgba(43, 31, 26, 0.06);
  --pos-neutral-bg-strong: rgba(43, 31, 26, 0.21);
  --pos-neutral-wash: rgba(43, 31, 26, 0.04);
  --ok: #1f6b3a;
  --bad: #9b2c2c;
  --bad-soft: #f7e4e4;
  --bad-line: rgba(155, 44, 44, 0.4);
  --shadow: 0 16px 36px rgba(43, 31, 26, 0.08);
  --shadow-soft: 0 6px 14px rgba(43, 31, 26, 0.06);
  --radius: 16px;
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Figtree", "Segoe UI", sans-serif;
  /* Fluid so the table doesn't step down at the mobile breakpoint */
  --table-word: clamp(1.08rem, 0.92rem + 0.95vw, 1.2rem);
  --table-data: clamp(0.84rem, 0.72rem + 0.55vw, 0.9rem);
  --table-head: clamp(0.66rem, 0.5rem + 0.85vw, 0.9rem);
  --btn-size: clamp(1.72rem, 1.5rem + 0.9vw, 1.85rem);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f3e6dc;
  --ink-soft: #d4c0b2;
  --muted: #b49a88;
  --paper: #171210;
  --paper-2: #100c0a;
  --glow-1: #3a241c;
  --glow-2: #2a1c16;
  --grid-line: rgba(243, 230, 220, 0.05);
  --panel: rgba(36, 28, 24, 0.85);
  --surface: #241c18;
  --surface-2: rgba(16, 12, 10, 0.9);
  --surface-hover: rgba(243, 230, 220, 0.06);
  --line: rgba(243, 230, 220, 0.14);
  --accent: #e39070;
  --accent-deep: #f8d8c8;
  --lemma: #fde4d6;
  --accent-soft: rgba(227, 144, 112, 0.18);
  --accent-wash: rgba(227, 144, 112, 0.14);
  --accent-line: rgba(227, 144, 112, 0.45);
  --accent-line-soft: rgba(227, 144, 112, 0.3);
  --on-accent: #171210;
  --track-bg: rgba(227, 144, 112, 0.16);
  --track-fade: rgba(227, 144, 112, 0.05);
  --track-line: rgba(227, 144, 112, 0.3);
  --fill: #d07a58;
  --fill-goal: #e39070;
  --fill-max: #f0b399;
  --pos-neutral-bg: rgba(243, 230, 220, 0.09);
  --pos-neutral-bg-strong: rgba(243, 230, 220, 0.21);
  --pos-neutral-wash: rgba(243, 230, 220, 0.05);
  --ok: #74cf94;
  --bad: #f09393;
  --bad-soft: rgba(240, 147, 147, 0.16);
  --bad-line: rgba(240, 147, 147, 0.45);
  --shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  --shadow-soft: 0 6px 14px rgba(0, 0, 0, 0.35);
}

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

html {
  scroll-behavior: smooth;
  overflow-x: clip;
  max-width: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  color: var(--ink);
  font-family: var(--font-body);
  background:
    radial-gradient(1000px 520px at 8% -8%, var(--glow-1) 0%, transparent 55%),
    radial-gradient(800px 460px at 100% 0%, var(--glow-2) 0%, transparent 48%),
    linear-gradient(180deg, var(--paper) 0%, var(--paper-2) 100%);
  line-height: 1.5;
  overflow-x: clip;
  max-width: 100%;
  text-align: left;
}

.bg-grid {
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.28;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px;
  mask-image: radial-gradient(circle at 50% 20%, black, transparent 75%);
}

.wrap {
  width: min(960px, calc(100% - 2rem));
  margin-inline: auto;
}

.site-header {
  padding: 1.15rem 0 0.55rem;
}

.site-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.site-header-copy {
  min-width: 0;
}

.theme-toggle {
  --switch-h: 1.9rem;
  --switch-w: 3.5rem;
  --switch-icon: 0.85rem;
  appearance: none;
  position: relative;
  flex: 0 0 auto;
  width: var(--switch-w);
  height: var(--switch-h);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-2);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.theme-toggle:hover {
  border-color: var(--accent-line);
}

.theme-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.theme-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: calc(var(--switch-h) - 6px);
  height: calc(var(--switch-h) - 6px);
  border-radius: 999px;
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 0.18s ease;
}

.theme-toggle[aria-checked="true"] .theme-knob {
  transform: translateX(calc(var(--switch-w) - var(--switch-h)));
}

.icon-theme {
  position: absolute;
  top: 50%;
  z-index: 1;
  width: var(--switch-icon);
  height: var(--switch-icon);
  margin-top: calc(var(--switch-icon) / -2);
  color: var(--muted);
  transition: color 0.18s ease;
}

.theme-icon-sun {
  left: calc(var(--switch-h) / 2 - var(--switch-icon) / 2);
  color: var(--accent-deep);
}

.theme-icon-moon {
  right: calc(var(--switch-h) / 2 - var(--switch-icon) / 2);
}

.theme-toggle[aria-checked="true"] .theme-icon-sun {
  color: var(--muted);
}

.theme-toggle[aria-checked="true"] .theme-icon-moon {
  color: var(--accent-deep);
}

.eyebrow {
  margin: 0 0 0.4rem;
  color: var(--accent-deep);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-header h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.85rem, 4.5vw, 3.1rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.05;
  text-align: left;
}

.site-header h1 a {
  color: inherit;
  text-decoration: none;
}

.lede {
  margin: 0.45rem 0 0;
  max-width: none;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

.progress-title {
  margin: 0 0 0.5rem;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  text-align: left;
}

.progress-track {
  height: 12px;
  border-radius: 999px 0 0 999px;
  background: linear-gradient(
    90deg,
    var(--track-bg) 0%,
    var(--track-bg) 88%,
    var(--track-fade) 100%
  );
  overflow: visible;
  border: 1px solid var(--track-line);
  border-right: none;
  position: relative;
}

.progress-track::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -10px;
  bottom: -1px;
  width: 12px;
  background: linear-gradient(90deg, var(--track-bg), transparent);
  border-top: 1px solid var(--track-line);
  border-bottom: 1px solid var(--track-line);
  pointer-events: none;
}

.progress-fill {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: var(--fill);
}

.progress-track.is-past-goal .progress-fill {
  background: var(--fill-goal);
}

.progress-track.is-max {
  border-radius: 999px;
  border-right: 1px solid var(--track-line);
}

.progress-track.is-max::after {
  display: none;
}

.progress-track.is-max .progress-fill {
  border-radius: 999px;
  background: var(--fill-max);
}

.progress-goal-mark {
  position: absolute;
  top: -4px;
  bottom: -4px;
  width: 2px;
  background: var(--ink);
  transform: translateX(-50%);
  border-radius: 1px;
  pointer-events: none;
}

.progress-scale {
  position: relative;
  display: flex;
  align-items: baseline;
  justify-content: flex-start;
  min-height: 1.2rem;
  margin: 0.2rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.progress-status {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.86rem;
  line-height: 1.2;
}

.progress-goal-label {
  position: absolute;
  transform: translateX(-50%);
  color: var(--ink-soft);
  font-weight: 600;
  white-space: nowrap;
  line-height: 1.2;
}

.save-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  line-height: 1.35;
}

.save-progress-aside,
.save-progress-status {
  color: var(--muted);
}

.save-progress-status {
  color: var(--ink-soft);
}

.save-progress.is-behind .save-progress-status {
  order: -1;
}

/* Filtered pages have no progress to save, so the note sits out of the way */
.save-progress-note {
  justify-content: flex-end;
  text-align: right;
}

main {
  display: grid;
  gap: 0.85rem;
  padding-bottom: 2.5rem;
}

/* Grid items default to a min-content floor, which let a wide table stretch
   every panel past the viewport instead of scrolling inside its own shell */
.progress-panel,
.week-panel,
.test-panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(8px);
  padding: 0.95rem 1.15rem 1.05rem;
}

.progress-head,
.week-head {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 0.7rem;
  text-align: left;
}

.test-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.35rem 0.75rem;
  align-items: start;
  margin-bottom: 0.7rem;
  text-align: left;
}

.test-head h2 {
  grid-column: 1;
  grid-row: 1;
}

.test-head .mode-switch {
  grid-column: 2;
  grid-row: 1 / span 2;
  align-self: start;
}

.test-head p {
  grid-column: 1;
  grid-row: 2;
}

h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  text-align: left;
}

.progress-head p,
.week-range,
.test-head p {
  margin: 0;
  color: var(--ink-soft);
}

.muted {
  color: var(--muted);
}

.hint {
  display: inline;
  color: var(--muted);
  font-size: 0.92em;
}

.pager {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
}

.jump {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
}

.jump-label {
  color: var(--muted);
  font-size: var(--table-data);
  font-weight: 600;
  white-space: nowrap;
}

.jump input,
#test-input {
  width: 5.5rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0.55rem 0.65rem;
  font: inherit;
  background: var(--surface);
  color: var(--ink);
}

#test-input {
  width: min(100%, 18rem);
  flex: 1;
}

.btn[hidden] {
  display: none;
}

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 0.55rem 0.9rem;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  background: var(--accent);
  color: var(--on-accent);
}

.btn-primary:hover {
  background: var(--accent-deep);
}

.btn-nav,
.btn-ghost {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

.btn-ghost {
  margin-top: 0.15rem;
}

/* Resting state stays neutral; the warning only appears once you reach for it */
.btn-warn:hover,
.btn-warn:focus-visible {
  border-color: var(--bad-line);
  background: var(--bad-soft);
  color: var(--bad);
}

.btn-warn.is-armed {
  border-color: var(--bad);
  background: var(--bad-soft);
  color: var(--bad);
  box-shadow: 0 0 0 3px var(--bad-soft);
}

.btn.disabled,
.btn:disabled {
  opacity: 0.45;
  pointer-events: none;
}

/* The page never scrolls sideways (html/body clip), so residual table overflow
   has to stay reachable here rather than being cut off */
.table-shell {
  overflow-x: auto;
  overflow-y: hidden;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: var(--surface);
  max-width: 100%;
}

.word-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 0;
  table-layout: auto;
}

.word-table th,
.word-table td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
  font-size: var(--table-data);
}

.word-table td.rank,
.word-table td.lemma,
.word-table td.pos {
  vertical-align: baseline;
}

.word-table th {
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  font-size: var(--table-head);
}

/* The shell can't clip its own radius (it scrolls), so the header rounds itself */
.word-table thead th:first-child {
  border-top-left-radius: 13px;
}

.word-table thead th:last-child {
  border-top-right-radius: 13px;
}

.word-table tr:last-child td {
  border-bottom: none;
}

.rank {
  width: 4rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  line-height: 1.15;
}

.rank-link {
  color: inherit;
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 2px;
  cursor: pointer;
}

.rank-link:hover,
.rank-link:focus-visible {
  color: var(--accent-deep);
  text-decoration-style: solid;
}

/* Marks the row you land on when arriving from a filtered page. The outsized
   scroll margin makes the browser clamp to the top of the page instead of
   hoisting the row up there, since all ten rows already fit on screen. */
.word-table tr:target {
  scroll-margin-top: 100vh;
}

.word-table tr:target td {
  background: var(--accent-soft);
  animation: row-arrive 2s ease-out;
}

.word-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 13px;
}

.word-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 13px;
}

@keyframes row-arrive {
  from {
    background: var(--accent-line);
  }
}

@media (prefers-reduced-motion: reduce) {
  .word-table tr:target td {
    animation: none;
  }

  .milestone-piece,
  .milestone-sway,
  .milestone-scrap,
  .milestone-word,
  .milestone-count {
    animation: none;
  }

  .milestone.is-leaving {
    transition: none;
  }
}

.lemma {
  white-space: nowrap;
  min-width: 0;
}

.lemma-link {
  font-weight: 700;
  font-size: var(--table-word);
  line-height: 1.15;
  color: var(--lemma);
  text-decoration: none;
}

.lemma-link:hover {
  color: var(--accent);
}

.lemma-article {
  display: inline-block;
  margin-right: 0.4em;
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--gender-ink, var(--muted));
  vertical-align: 0.08em;
}

.lemma-article.gender-m {
  --gender-ink: #164e7a;
}
.lemma-article.gender-f {
  --gender-ink: #6e245c;
}
.lemma-article.gender-n {
  --gender-ink: #3a5818;
}

.forms-empty {
  color: var(--muted);
}

:root[data-theme="dark"] .lemma-article.gender-m {
  --gender-ink: #8eb8d6;
}
:root[data-theme="dark"] .lemma-article.gender-f {
  --gender-ink: #d6a8c8;
}
:root[data-theme="dark"] .lemma-article.gender-n {
  --gender-ink: #b4c88a;
}

.cloze-blank {
  display: inline-block;
  min-width: 4.5ch;
  padding: 0 0.15em;
  border-bottom: 2px solid var(--accent);
  color: transparent;
  user-select: none;
}

.audio-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--btn-size);
  height: var(--btn-size);
  min-width: var(--btn-size);
  min-height: var(--btn-size);
  aspect-ratio: 1;
  flex-shrink: 0;
  margin-left: 0.35rem;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-deep);
  cursor: pointer;
  vertical-align: middle;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.audio-btn:hover {
  background: var(--accent-soft);
  border-color: var(--accent-line);
  color: var(--accent);
}

.icon-speaker {
  width: 1rem;
  height: 1rem;
  display: block;
}

.forms-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.forms-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
}

.form-chip {
  appearance: none;
  margin: 0;
  padding: 0.12rem 0.38rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--ink-soft);
  font: inherit;
  font-size: var(--table-data);
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
}

.form-chip:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent-deep);
}

.pos-pill {
  display: inline-block;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: var(--pos-bg, var(--pos-neutral-bg));
  color: var(--pos-ink, var(--ink));
  font-size: var(--table-data);
  line-height: 1.15;
  white-space: nowrap;
  vertical-align: baseline;
  text-decoration: none;
}

a.pos-pill {
  cursor: pointer;
  transition: box-shadow 0.15s ease, background 0.15s ease;
}

a.pos-pill:hover,
a.pos-pill:focus-visible {
  background: var(--pos-bg-strong, var(--pos-neutral-bg-strong));
  box-shadow: inset 0 0 0 1px var(--pos-line, var(--line));
}

/* A filtered page sets --pos-* on <body>, so every type must define its own full
   set or it inherits the page's colour instead of its own */
.pos-partikel,
.pos-artikel,
.pos-zahlwort {
  --pos-bg: var(--pos-neutral-bg);
  --pos-bg-strong: var(--pos-neutral-bg-strong);
  --pos-ink: var(--ink);
  --pos-line: var(--line);
  --pos-wash: var(--pos-neutral-wash);
}

/* Verb violet → adverb blue → adjektiv teal → nomen green → pronomen lime
   (English proper-noun) → präposition gold → konjunktion orange; interjektion rose. */
.pos-verb {
  --pos-bg: #e9d3f8;
  --pos-bg-strong: #e1c0f7;
  --pos-ink: #61238b;
  --pos-line: rgba(97, 35, 139, 0.32);
  --pos-wash: rgba(97, 35, 139, 0.07);
}

.pos-adverb {
  --pos-bg: #d3e4f8;
  --pos-bg-strong: #b8d4f4;
  --pos-ink: #1e4a7a;
  --pos-line: rgba(30, 74, 122, 0.32);
  --pos-wash: rgba(30, 74, 122, 0.07);
}

.pos-adjektiv {
  --pos-bg: #d3f8f6;
  --pos-bg-strong: #aaf2ee;
  --pos-ink: #1e6763;
  --pos-line: rgba(30, 103, 99, 0.32);
  --pos-wash: rgba(30, 103, 99, 0.07);
}

.pos-nomen {
  --pos-bg: #d3f7d5;
  --pos-bg-strong: #c0f6c3;
  --pos-ink: #1e693a;
  --pos-line: rgba(30, 105, 58, 0.32);
  --pos-wash: rgba(30, 105, 58, 0.07);
}

.pos-pronomen {
  --pos-bg: #e9f8d3;
  --pos-bg-strong: #dcf4ba;
  --pos-ink: #48671e;
  --pos-line: rgba(72, 103, 30, 0.32);
  --pos-wash: rgba(72, 103, 30, 0.07);
}

.pos-praeposition {
  --pos-bg: #f5ebc4;
  --pos-bg-strong: #f0e09e;
  --pos-ink: #6b5414;
  --pos-line: rgba(107, 84, 20, 0.32);
  --pos-wash: rgba(107, 84, 20, 0.07);
}

.pos-konjunktion {
  --pos-bg: #f8ddc4;
  --pos-bg-strong: #f4c89e;
  --pos-ink: #7a3f14;
  --pos-line: rgba(122, 63, 20, 0.32);
  --pos-wash: rgba(122, 63, 20, 0.07);
}

.pos-interjektion {
  --pos-bg: #f8d3e0;
  --pos-bg-strong: #f4b8cd;
  --pos-ink: #7a2348;
  --pos-line: rgba(122, 35, 72, 0.32);
  --pos-wash: rgba(122, 35, 72, 0.07);
}

:root[data-theme="dark"] .pos-verb {
  --pos-bg: #371849;
  --pos-bg-strong: #471d60;
  --pos-ink: #c892e7;
  --pos-line: rgba(200, 146, 231, 0.38);
  --pos-wash: rgba(200, 146, 231, 0.1);
}

:root[data-theme="dark"] .pos-adverb {
  --pos-bg: #18324a;
  --pos-bg-strong: #1d4466;
  --pos-ink: #9cc4ea;
  --pos-line: rgba(156, 196, 234, 0.38);
  --pos-wash: rgba(156, 196, 234, 0.1);
}

:root[data-theme="dark"] .pos-adjektiv {
  --pos-bg: #183f3d;
  --pos-bg-strong: #1d5956;
  --pos-ink: #90dfdb;
  --pos-line: rgba(144, 223, 219, 0.38);
  --pos-wash: rgba(144, 223, 219, 0.1);
}

:root[data-theme="dark"] .pos-nomen {
  --pos-bg: #183f26;
  --pos-bg-strong: #1e5532;
  --pos-ink: #90dfad;
  --pos-line: rgba(144, 223, 173, 0.38);
  --pos-wash: rgba(144, 223, 173, 0.1);
}

:root[data-theme="dark"] .pos-pronomen {
  --pos-bg: #2f3f18;
  --pos-bg-strong: #405520;
  --pos-ink: #bedf90;
  --pos-line: rgba(190, 223, 144, 0.38);
  --pos-wash: rgba(190, 223, 144, 0.1);
}

:root[data-theme="dark"] .pos-praeposition {
  --pos-bg: #3f3518;
  --pos-bg-strong: #554820;
  --pos-ink: #e6d48a;
  --pos-line: rgba(230, 212, 138, 0.38);
  --pos-wash: rgba(230, 212, 138, 0.1);
}

:root[data-theme="dark"] .pos-konjunktion {
  --pos-bg: #3f2818;
  --pos-bg-strong: #5a3820;
  --pos-ink: #e6b08a;
  --pos-line: rgba(230, 176, 138, 0.38);
  --pos-wash: rgba(230, 176, 138, 0.1);
}

:root[data-theme="dark"] .pos-interjektion {
  --pos-bg: #3f1830;
  --pos-bg-strong: #5a2044;
  --pos-ink: #e196b8;
  --pos-line: rgba(225, 150, 184, 0.38);
  --pos-wash: rgba(225, 150, 184, 0.1);
}

/* Only the hued types tint their page; the neutral ones keep the site's own
   chrome, since a grey wash would just look like a broken page */
body.is-tinted {
  --glow-1: color-mix(in srgb, var(--pos-ink) 14%, #fff);
  --glow-2: color-mix(in srgb, var(--pos-ink) 6%, #fff);
  --grid-line: var(--pos-wash);
}

/* The tint stays in the page and in outlines and type, never in filled slabs */
body.is-tinted .week-panel,
body.is-tinted .test-panel,
body.is-tinted .table-shell {
  border-color: var(--pos-line);
}

body.is-tinted .word-table th {
  color: var(--pos-ink);
}

body.is-tinted .crumb-pos,
body.is-tinted .week-head h2,
body.is-tinted .test-head h2,
body.is-tinted .filter-label {
  color: var(--pos-ink);
}

/* --muted loses too much contrast once the bar carries a tint */
body.is-tinted .filter-count {
  color: var(--ink-soft);
}

:root[data-theme="dark"] body.is-tinted {
  --glow-1: color-mix(in srgb, var(--pos-ink) 18%, transparent);
  --glow-2: color-mix(in srgb, var(--pos-ink) 10%, transparent);
}

:root[data-theme="dark"] body.is-tinted .week-panel,
:root[data-theme="dark"] body.is-tinted .test-panel {
  background-image: linear-gradient(var(--pos-wash), var(--pos-wash));
}

.pos-short {
  display: none;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem 0.55rem;
  margin: 0 0 0.6rem;
  padding: 0.35rem 0.55rem;
  border: 1px solid var(--pos-line, var(--line));
  border-radius: 10px;
  background: var(--pos-wash, var(--pos-neutral-wash));
  font-size: 0.9rem;
}

.filter-label {
  color: var(--muted);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.filter-bar .pos-pill {
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.1rem 0.55rem;
  box-shadow: inset 0 0 0 1px var(--pos-line, var(--line));
}

.filter-count {
  color: var(--muted);
  font-size: 0.82rem;
}

.filter-clear {
  margin-left: auto;
  padding: 0.28rem 0.6rem;
  font-size: 0.82rem;
  border-radius: 9px;
}

.pos-index {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.pos-index li {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.pos-index .pos-pill {
  font-size: 0.95rem;
  font-weight: 700;
  padding: 0.15rem 0.6rem;
}

.mode-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem;
  padding: 0.25rem;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-2);
  min-width: min(100%, 20rem);
}

.mode-option {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 0.55rem;
  margin: 0;
  padding: 0.55rem 0.65rem;
  border: 1px solid transparent;
  border-radius: 11px;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}

.mode-option:hover {
  color: var(--ink);
  background: var(--surface-hover);
}

.mode-option.is-active {
  background: var(--surface);
  border-color: var(--accent-line-soft);
  color: var(--ink);
  box-shadow: var(--shadow-soft);
}

.mode-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 999px;
  background: var(--accent-wash);
  color: var(--accent-deep);
  flex: 0 0 auto;
}

.mode-option-icon .icon-speaker {
  width: 0.9rem;
  height: 0.9rem;
}

.mode-option-def {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.mode-option-copy {
  display: grid;
  gap: 0.05rem;
  min-width: 0;
}

.mode-option-label {
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
}

.mode-option-hint {
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.2;
}

.mode-option.is-active .mode-option-hint {
  color: var(--ink-soft);
}

.answered-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.answered-list:empty {
  display: none;
}

.answered-list li {
  display: grid;
  grid-template-columns: 1.75rem 1.25rem minmax(0, 1fr);
  gap: 0.4rem;
  align-items: baseline;
  padding: 0.35rem 0;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 0.98rem;
  line-height: 1.4;
}

.answered-list li + li {
  border-top: 1px solid var(--line);
}

.answered-num {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  text-align: right;
  font-weight: 600;
}

.answered-ok,
.answered-miss {
  border-color: transparent;
  background: transparent;
}

.answered-mark {
  font-weight: 600;
  font-size: 1rem;
  line-height: 1.4;
  text-align: center;
}

.answered-ok .answered-mark {
  color: var(--ok);
}

.answered-miss .answered-mark {
  color: var(--bad);
}

.answered-main {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

.answered-line {
  display: block;
  min-width: 0;
}

.answered-other {
  display: grid;
  grid-template-columns: 1.25rem minmax(0, 1fr);
  gap: 0.4rem;
  align-items: baseline;
  margin-top: 0.1rem;
}

.answered-mark-spacer {
  visibility: hidden;
}

.answered-word,
.answered-def,
.answered-sep {
  display: inline;
}

.answered-sep {
  font-weight: 400;
  color: var(--muted);
  margin-right: 0.15em;
}

.answered-word {
  font-weight: 700;
  color: var(--ink);
}

.answered-word.is-typed {
  font-weight: 600;
  color: var(--muted);
}

.answered-def {
  font-weight: 400;
  color: var(--ink-soft);
}

.answered-def.is-typed,
.answered-other .answered-def {
  color: var(--muted);
}

.answered-cloze-line {
  font-weight: 400;
  color: var(--ink-soft);
}

.answered-cloze {
  font-weight: 700;
  color: var(--ink);
}

.listen-caption {
  display: none;
}

.test-counter,
.test-score {
  display: inline-block;
}

.test-done {
  display: grid;
  gap: 0.55rem;
  justify-items: start;
  padding: 0.5rem 0 0.15rem;
}

.test-done[hidden] {
  display: none !important;
}

.test-done-score {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 8vw, 3.4rem);
  font-weight: 700;
  line-height: 1;
  color: var(--accent-deep);
}

.done-of {
  font-size: 0.55em;
  color: var(--muted);
  font-weight: 600;
}

.test-current[hidden] {
  display: none !important;
}

.audio-btn {
  margin-left: 0;
}

.audio-btn-lg {
  width: 2.35rem;
  height: 2.35rem;
  min-width: 2.35rem;
  min-height: 2.35rem;
  flex-shrink: 0;
}

.audio-btn-lg .icon-speaker {
  width: 1.15rem;
  height: 1.15rem;
}

.lemma .audio-btn {
  margin-left: 0.35rem;
}

.forms-row .audio-btn {
  margin-left: 0;
}

.test-prompt-row {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
}

.test-current {
  display: grid;
  gap: 0.75rem;
}

.test-done {
  display: grid;
  gap: 0.75rem;
  justify-items: start;
  padding: 0.35rem 0 0.15rem;
}

.test-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 600;
}

.test-prompt-row .test-prompt {
  flex: 1;
  min-width: 0;
}

.test-prompt {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
}

.test-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.test-pos {
  display: inline-block;
  margin-left: 0.5rem;
  /* lifts the chip off the baseline toward the cap-height centre of the display face */
  vertical-align: 0.18em;
  font-family: var(--font-body);
  font-weight: 600;
  line-height: 1.2;
}

.test-pos:empty {
  display: none;
}

.test-pos .pos-pill {
  font-size: 1.05rem;
  padding: 0.24rem 0.8rem;
  vertical-align: baseline;
  box-shadow: inset 0 0 0 1px var(--pos-line, var(--line));
}

/* Listen mode has no prompt text, so the button and the chip centre on each other */
.listen-block:not([hidden]) {
  display: inline-flex;
  vertical-align: middle;
}

.listen-block + .test-prompt-text:empty + .test-pos {
  margin-left: 0.65rem;
  vertical-align: middle;
}

.site-footer {
  padding: 1rem 0 2rem;
  color: var(--ink-soft);
  font-size: 0.92rem;
}

.site-footer a {
  color: var(--accent-deep);
  font-weight: 600;
}

.site-footer p {
  margin: 0.35rem 0;
}

/* Standalone nav, so the pills keep full size and full names at every width.
   A contained tinted block, sized to the panels above it, rather than a rule. */
.pos-nav {
  padding: 1.15rem 0 0.15rem;
}

.pos-nav-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.5rem;
  padding: 0.7rem 0.9rem;
  border-radius: var(--radius);
  background: var(--surface-2);
}

.pos-nav-label {
  color: var(--muted);
  font-size: 0.92rem;
}

.pos-nav .pos-pill {
  color: var(--pos-ink, var(--ink));
  padding: 0.22rem 0.6rem;
  font-weight: 600;
}

.pos-nav-all {
  color: var(--accent-deep);
  font-size: 0.92rem;
  font-weight: 600;
}

.th-short {
  display: none;
}

.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: 720px) {
  .wrap {
    width: min(960px, calc(100% - 1rem));
  }

  .eyebrow,
  .lede {
    display: none;
  }

  .site-header {
    padding: 0.45rem 0 0.3rem;
  }

  /* Descenders in the display face overflow a 1.05 line box */
  .site-header h1 {
    font-size: 1.3rem;
    line-height: 1.2;
  }

  .theme-toggle {
    --switch-h: var(--btn-size);
    --switch-w: 2.85rem;
    --switch-icon: 0.75rem;
  }

  main {
    gap: 0.55rem;
    padding-bottom: 1.25rem;
  }

  .progress-head {
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
  }

  /* Heading and pager share one row, and only stack if the heading runs long */
  .week-head {
    align-items: center;
    gap: 0.3rem 0.5rem;
    margin-bottom: 0.35rem;
  }

  .test-head {
    grid-template-columns: 1fr;
    gap: 0.4rem;
    margin-bottom: 0.45rem;
  }

  .test-head h2,
  .test-head .mode-switch,
  .test-head p {
    grid-column: 1;
    grid-row: auto;
  }

  .week-head > div {
    text-align: left;
  }

  .week-head h2,
  .progress-title,
  .test-head h2 {
    font-size: 0.95rem;
  }

  .pager {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.25rem;
    align-items: center;
    margin-left: auto;
  }

  .pager .btn-nav {
    flex: none;
    width: auto;
    padding: 0.22rem 0.4rem;
    font-size: var(--chrome);
    border-radius: 8px;
    white-space: nowrap;
  }

  .pager-label {
    display: none;
  }

  .jump {
    width: auto;
    min-width: 0;
    gap: 0.25rem;
    justify-content: center;
  }

  .jump-label {
    font-size: var(--chrome);
  }

  .jump input {
    width: 2.6rem;
    flex: none;
    padding: 0.22rem 0.28rem;
    font-size: var(--chrome);
    border-radius: 8px;
  }

  .jump .btn-nav {
    padding: 0.22rem 0.4rem;
  }

  .mode-switch {
    min-width: 0;
    width: 100%;
  }

  .mode-option {
    padding: 0.4rem 0.45rem;
  }

  .mode-option-hint {
    display: none;
  }

  .progress-panel,
  .week-panel,
  .test-panel {
    padding: 0.55rem 0.65rem 0.6rem;
  }

  .progress-title {
    margin-bottom: 0.35rem;
  }

  .progress-track {
    height: 8px;
  }

  .progress-scale {
    min-height: 0.9rem;
    margin-top: 0.15rem;
    font-size: var(--chrome);
  }

  .progress-status,
  .progress-goal-label {
    font-size: var(--chrome);
  }

  /* One line, so the table keeps the room the second line used to take */
  .save-progress {
    flex-wrap: nowrap;
    align-items: center;
    margin-top: 0.3rem;
    gap: 0.4rem;
    font-size: var(--chrome);
  }

  .save-progress-status {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .filter-bar {
    gap: 0.2rem 0.4rem;
    margin-bottom: 0.4rem;
    padding: 0.25rem 0.4rem;
  }

  .filter-label {
    font-size: 0.62rem;
  }

  .filter-bar .pos-pill {
    font-size: 0.8rem;
    padding: 0.05rem 0.45rem;
  }

  .filter-count {
    font-size: 0.72rem;
  }

  .test-pos {
    margin-left: 0.4rem;
  }

  .test-pos .pos-pill {
    font-size: 0.95rem;
    padding: 0.2rem 0.65rem;
  }

  .site-footer {
    padding: 0.9rem 0 1.5rem;
    font-size: 0.75rem;
  }

  .pos-nav {
    padding-top: 0.9rem;
  }

  .pos-nav-row {
    padding: 0.55rem 0.65rem;
    border-radius: 10px;
  }

  .pos-nav-label,
  .pos-nav-all {
    font-size: 0.78rem;
  }

  .filter-clear {
    padding: 0.22rem 0.45rem;
    font-size: 0.72rem;
  }

  .save-progress-aside,
  .save-progress-note {
    display: none;
  }

  .save-progress .btn {
    flex: 0 0 auto;
    padding: 0.26rem 0.5rem;
    font-size: var(--chrome);
    border-radius: 9px;
  }

  /* The table keeps its fluid size; --chrome sizes what merely frames it */
  :root {
    --chrome: 0.7rem;
  }

  .table-shell {
    overflow-x: auto;
    overflow-y: hidden;
    border-radius: 10px;
  }

  /* auto: short lemmas stay narrow so forms can use the leftover (no fixed %).
     fixed/% shares made short words waste space while chips stacked. */
  .word-table {
    table-layout: auto;
    width: 100%;
    min-width: 0;
  }

  .word-table th {
    letter-spacing: 0.02em;
    padding: 0.12rem 0.22rem;
  }

  .word-table td {
    padding: 0.16rem 0.22rem;
    vertical-align: baseline;
  }

  .th-full,
  .th-short {
    display: none;
  }

  .word-table th:nth-child(1),
  .word-table td.rank {
    width: 1%;
    white-space: nowrap;
    padding-left: 0.22rem;
    padding-right: 0.55rem;
    letter-spacing: 0;
    text-align: right;
    vertical-align: middle;
  }

  .word-table th:nth-child(2),
  .word-table td.lemma {
    width: auto;
    min-width: 0;
    padding-left: 0.2rem;
    padding-right: 0.2rem;
    white-space: normal;
    vertical-align: middle;
  }

  .word-table td.lemma .lemma-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    line-height: 1;
  }

  .word-table td.lemma .lemma-article {
    display: block;
    margin-right: 0;
    margin-bottom: 0;
    line-height: 1;
    font-size: 0.88rem;
    vertical-align: baseline;
  }

  /* Half the one-line length, floored at the longest word (no mid-word breaks).
     Do not replace with width:% / min-width:rem / width:max-content alone —
     those either starve long lemmas, expand on narrow viewports, or blow past ~50%.
     Keep max(min-content, calc(max-content / 2)); splitting into width+min-width
     regresses the column balance. Firefox accepts this on <a>, not on <button>. */
  .word-table td.lemma .lemma-link {
    display: inline-block;
    width: max(min-content, calc(max-content / 2));
    max-width: 50vw;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
    vertical-align: middle;
    line-height: 1.05;
    margin-top: -0.08em;
  }

  .word-table th:nth-child(3),
  .word-table td.pos {
    width: 1%;
    white-space: nowrap;
    padding-left: 0.2rem;
    padding-right: 0.32rem;
    letter-spacing: 0;
    /* middle: type pill sits beside multi-line lemmas (e.g. num. on /404) */
    vertical-align: middle;
  }

  .pos-full {
    display: none;
  }

  .pos-short {
    display: inline;
  }

  .pos-pill {
    padding: 0.18rem 0.34rem;
    line-height: 1.2;
    vertical-align: middle;
  }

  .word-table th:nth-child(4),
  .word-table td.inflections {
    width: auto;
    min-width: 0;
    padding-left: 0.18rem;
    padding-right: 0.16rem;
    vertical-align: middle;
  }

  .forms-row {
    align-items: center;
    gap: 0.12rem;
    min-width: 0;
  }

  .forms-chips {
    flex: 1;
    min-width: 0;
    gap: 0.16rem;
  }

  .form-chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.75rem;
    padding: 0.1rem 0.3rem;
    border-radius: 6px;
    flex: 0 0 auto;
  }

  /* Two lines via HTML midpoint split (build.mjs formChipLabel), not width calc.
     Firefox drops calc(max-content/…) on <button>, so width tricks overflow as
     one line; max-width:100% fills the cell. Do not reintroduce those. */
  .form-chip.is-multiword {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0;
    width: auto;
    max-width: none;
    white-space: normal !important;
    line-height: 1.15;
    text-align: start;
    vertical-align: middle;
  }

  .form-chip-line {
    display: block;
    white-space: nowrap;
  }

  .icon-speaker {
    width: 0.85rem;
    height: 0.85rem;
  }
}

/* Extra-short viewports: keep trimming chrome */
@media (max-height: 720px) {
  .eyebrow,
  .lede {
    display: none;
  }

  .site-header {
    padding: 0.5rem 0 0.3rem;
  }

  .site-header h1 {
    line-height: 1.15;
  }

  main {
    gap: 0.5rem;
  }

  .progress-panel,
  .week-panel {
    padding: 0.5rem 0.6rem 0.55rem;
  }

  .week-head {
    margin-bottom: 0.35rem;
  }
}

/* Milestone cheer: full-board on a smartboard, still fits a phone */
html.milestone-open,
html.milestone-open body {
  overflow: hidden;
}

.milestone {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: safe center;
  gap: clamp(0.35rem, 1.5vmin, 0.9rem);
  box-sizing: border-box;
  margin: 0;
  padding:
    max(0.85rem, env(safe-area-inset-top))
    max(1rem, env(safe-area-inset-right))
    max(0.85rem, env(safe-area-inset-bottom))
    max(1rem, env(safe-area-inset-left));
  overflow: auto;
  border: 0;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.milestone:focus {
  outline: none;
}

.milestone.is-leaving {
  opacity: 0;
  transition: opacity 0.25s ease;
}

.milestone-burst {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.milestone-piece {
  position: absolute;
  animation-name: milestone-fall;
  animation-timing-function: linear;
  animation-fill-mode: forwards;
  animation-delay: var(--delay, 0s);
}

.milestone-sway {
  display: block;
  animation-name: milestone-sway;
  animation-timing-function: ease-in-out;
  animation-iteration-count: infinite;
  animation-direction: alternate;
}

.milestone-scrap {
  display: block;
  width: calc(clamp(16px, 2.4vmin, 30px) * var(--sx, 1));
  height: calc(clamp(18px, 2.8vmin, 36px) * var(--sy, 1));
  border-radius: 2px;
  background: color-mix(in srgb, var(--pos-ink) 40%, var(--pos-bg-strong));
  opacity: 0;
  animation-name: milestone-fade, milestone-spin;
  animation-timing-function: linear, linear;
  animation-iteration-count: 1, infinite;
  animation-fill-mode: forwards, none;
  animation-delay: var(--delay, 0s), var(--delay, 0s);
}

:root[data-theme="dark"] .milestone-scrap {
  background: var(--pos-ink);
}

@keyframes milestone-fall {
  from {
    transform: translate3d(0, 0, 0);
  }

  to {
    transform: translate3d(var(--dx), var(--dy), 0);
  }
}

@keyframes milestone-sway {
  from {
    transform: translateX(calc(var(--sway) * -1));
  }

  to {
    transform: translateX(var(--sway));
  }
}

@keyframes milestone-spin {
  from {
    transform: rotate(0deg);
  }

  to {
    transform: rotate(var(--spin));
  }
}

@keyframes milestone-fade {
  0% {
    opacity: 0;
  }

  12% {
    opacity: 1;
  }

  78% {
    opacity: 1;
  }

  100% {
    opacity: 0;
  }
}

.milestone-card {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: clamp(0.3rem, 1.4vmin, 0.85rem);
  width: min(100%, 68rem);
  margin-block: auto;
  pointer-events: none;
}

.milestone-kicker,
.milestone-unit {
  margin: 0;
  color: var(--muted);
  font-size: clamp(1.18rem, 3.35vmin, 2.1rem);
  font-weight: 600;
  line-height: 1.2;
}

.milestone-count {
  margin: 0;
  color: var(--accent-deep);
  font-family: var(--font-display);
  font-optical-sizing: none;
  font-size: clamp(4.4rem, 22vmin, 13rem);
  font-weight: 700;
  font-variation-settings: "opsz" 72, "wght" 700;
  line-height: 0.9;
  letter-spacing: -0.03em;
  animation:
    milestone-count-in 1.6s cubic-bezier(0.16, 0.84, 0.3, 1) both,
    milestone-count-breathe 3.2s ease-in-out 1.6s 6;
}

.milestone.is-goal .milestone-count {
  color: var(--fill-goal);
}

.milestone-line {
  margin: 0.85rem 0 0;
  max-width: 18em;
  color: var(--ink);
  font-size: clamp(1.25rem, 5vmin, 3.15rem);
  font-weight: 700;
  line-height: 1.35;
}

.milestone-punct {
  color: var(--muted);
}

.milestone-word {
  display: inline-block;
  margin: 0.08em 0.08em;
  padding: 0.05em 0.38em 0.1em;
  border-radius: 999px;
  background: var(--pos-bg, var(--pos-neutral-bg));
  color: var(--pos-ink, var(--ink));
  font-size: 1em;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  vertical-align: baseline;
  animation: milestone-word-in 0.42s cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--i, 0s);
}

.milestone-rank {
  margin-left: 0.08em;
  color: inherit;
  font-size: 0.42em;
  font-weight: 700;
  line-height: 0;
  letter-spacing: 0;
  vertical-align: super;
}

@keyframes milestone-count-in {
  from {
    opacity: 0;
    transform: scale(0.86);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes milestone-count-breathe {
  0%,
  100% {
    transform: none;
  }

  50% {
    transform: scale(1.025);
  }
}

@keyframes milestone-word-in {
  from {
    opacity: 0;
    transform: translateY(0.28em) scale(0.94);
  }

  to {
    opacity: 1;
    transform: none;
  }
}

.milestone-hint {
  margin: 0.15rem 0 0;
  color: var(--muted);
  font-size: clamp(0.85rem, 2.1vmin, 1.2rem);
  font-weight: 600;
}
