/* The web pages of the app. Colours, spacing and type are the iOS app's
   Theme.swift: cool paper, deep cobalt for every action, and the gender of
   a noun as the one other place colour carries meaning. Light only. */

@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("/static/fonts/newsreader.woff2") format("woff2");
}

@font-face {
  font-family: "Newsreader";
  font-style: italic;
  font-weight: 300 600;
  font-display: swap;
  src: url("/static/fonts/newsreader-italic.woff2") format("woff2");
}

:root {
  color-scheme: light;

  /* The page, cards on it, and wells sunk into a card. */
  --surface: #f6f8fb;
  --surface-raised: #ffffff;
  --surface-sunken: #e8edf5;
  --text: #182238;
  --text-secondary: #5d6778;
  --text-faint: #9aa3b5;
  --border: rgb(24 34 56 / 0.08);
  --track: #dce1ec;

  /* Every primary action and highlight. */
  --primary: #3454d1;
  --primary-soft: #e2e7f7;
  --on-primary: #ffffff;

  --success: #2e8b57;
  --error: #c93a3a;
  /* Almost right, and a word that was fixed. */
  --warning: #b7791f;
  /* The streak's flame, the one warm colour. */
  --streak: #e8620c;
  /* A day a gem or a freeze held the streak through: an ice blue, and
     the pale fill behind it. */
  --held: #1f86ae;
  --held-soft: #d3ecf7;

  /* der, die, das. */
  --masculine: #1e73b8;
  --feminine: #c2347a;
  --neuter: #2f8a4e;

  --radius-md: 16px;

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  /* German text and screen titles: New York on Apple devices, as in the
     app, and Newsreader elsewhere. */
  --serif: ui-serif, "New York", "Newsreader", Georgia, serif;
  /* The wordmark. */
  --rounded: ui-rounded, "SF Pro Rounded", var(--sans);

  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
}

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

html,
body {
  height: 100%;
}

/* Room for the scrollbar is kept on a page too short to have one, so going
   from a long page to a short one doesn't move everything sideways. */
html {
  scrollbar-gutter: stable;
}

body {
  margin: 0;
  background: var(--surface);
  color: var(--text);
  font: 16px/1.4 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
p,
ol {
  margin: 0;
}

ol {
  padding: 0;
  list-style: none;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

svg {
  display: block;
}

:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

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

/* A noun's article, in the colour of its gender. */
span.masculine {
  color: var(--masculine);
}

span.feminine {
  color: var(--feminine);
}

span.neuter {
  color: var(--neuter);
}

/* Screen titles, in the same serif as the German. */
.title {
  font: 600 40px/1.15 var(--serif);
  letter-spacing: -0.01em;
}

.card {
  background: var(--surface-raised);
  border-radius: var(--radius-md);
  box-shadow: 0 0 0 1px var(--border);
}

/* The one primary action of a page. */
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  padding: 0 20px;
  border-radius: 15px;
  background: var(--primary);
  color: var(--on-primary);
  font-weight: 600;
  font-size: 17px;
  transition:
    transform 0.15s ease,
    filter 0.15s ease;
}

.button:active {
  transform: scale(0.98);
  filter: brightness(0.92);
}

/* An alternative to it, as text. */
.quiet {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  color: var(--primary);
  font-weight: 600;
  font-size: 15px;
}

.quiet:disabled {
  color: var(--text-faint);
  cursor: default;
}

.quiet.wide {
  width: 100%;
  margin-top: 6px;
}

.wordmark {
  font: 700 23px var(--rounded);
  letter-spacing: -0.02em;
}

.wordmark i {
  font-style: normal;
  color: var(--primary);
}

.streak {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14.5px;
  color: var(--text-secondary);
}

.streak b {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.streak svg {
  width: 18px;
  height: 18px;
  color: var(--text-faint);
}

.streak.lit svg {
  color: var(--streak);
}

/* A frozen streak shows a snowflake for its flame. */
.streak.frozen svg {
  color: var(--held);
}

/* ---- The shell: four tabs in a sidebar ---- */

.shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.shell-side {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  padding: 30px 18px 26px 22px;
  display: flex;
  flex-direction: column;
}

.shell-nav {
  margin-top: 34px;
  display: grid;
  gap: 4px;
}

.shell-tab {
  display: flex;
  align-items: center;
  gap: 12px;
  height: 42px;
  padding: 0 12px;
  border-radius: 11px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--text-secondary);
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.shell-tab svg {
  width: 20px;
  height: 20px;
}

.shell-tab:hover {
  color: var(--text);
}

.shell-tab.active {
  color: var(--primary);
  background: var(--primary-soft);
}

.shell-page {
  min-width: 0;
}

/* A page inside the shell: its main column and, beside it, what there is
   room for on a wide screen. */
/* No page has its name at the top, the tab lit in the sidebar says where
   this is: every page starts 32px down, as the search over the words does. */
.page {
  padding: 32px 40px 64px 34px;
  max-width: 760px;
}

.page.with-aside {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 282px;
  gap: 34px;
  padding-right: 34px;
}

.page-main {
  min-width: 0;
}

.page-aside {
  display: grid;
  gap: 14px;
  align-content: start;
}

.page-sub {
  font-size: 16px;
  color: var(--text-secondary);
}

/* Pieces of a page arriving one after another. */
.rail > li,
.page-aside > * {
  animation: rise 0.6s var(--ease) both;
}

.rail > li:nth-child(2) { animation-delay: 60ms; }
.rail > li:nth-child(3) { animation-delay: 120ms; }
.rail > li:nth-child(4) { animation-delay: 180ms; }
.rail > li:nth-child(5) { animation-delay: 240ms; }
.rail > li:nth-child(n + 6) { animation-delay: 300ms; }
.page-aside > :nth-child(1) { animation-delay: 180ms; }
.page-aside > :nth-child(2) { animation-delay: 300ms; }
.page-aside > :nth-child(3) { animation-delay: 420ms; }

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rail > li,
  .page-aside > * {
    animation: none;
  }
}

/* ---- Learn: the course rail ---- */

/* A line down the page with a stop for each unit and lesson. Each row
   draws its own stretch of it, in cobalt as far as the learner has come. */
.rail {
  margin: 0;
}

.rail-row {
  position: relative;
}

.rail-row::before {
  content: "";
  position: absolute;
  left: 21px;
  top: 0;
  bottom: 0;
  width: 2px;
  margin-left: -1px;
  background: var(--primary);
}

.unit.ahead > details > summary::before,
.lesson.ahead::before {
  background: var(--track);
}

.rail > li:first-child summary::before {
  top: 50%;
}

.rail > li:last-child details:not([open]) > summary::before,
.rail > li:last-child .lessons > li:last-child::before,
.rail > li:last-child > .rail-row::before {
  bottom: 50%;
}

.rail-node {
  position: relative;
  z-index: 1;
  flex: none;
  width: 44px;
  display: flex;
  justify-content: center;
}

/* A unit, which opens to show its lessons */
summary {
  display: block;
  cursor: pointer;
  list-style: none;
}

summary::-webkit-details-marker {
  display: none;
}

.unit-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 11px 0;
}

.unit-number {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  padding-bottom: 1px;
  background: var(--primary);
  color: var(--on-primary);
  font: 600 20px var(--serif);
}

.unit.now .unit-number {
  background: var(--surface-raised);
  color: var(--primary);
  box-shadow: inset 0 0 0 2.5px var(--primary);
}

.unit.later .unit-number {
  background: var(--surface-raised);
  color: var(--text-faint);
  box-shadow: inset 0 0 0 2px var(--track);
}

.unit-text {
  min-width: 0;
  display: grid;
}

.unit-text small {
  font-size: 14px;
  color: var(--text-secondary);
}

.unit-title {
  font: 600 26px/1.15 var(--serif);
  letter-spacing: -0.01em;
}

.unit.later .unit-title,
.unit.later .unit-text small {
  color: var(--text-faint);
}

/* A unit done, and one ahead with nothing to open yet: a line each, so the
   unit being worked on stands out. */
.unit.done .unit-head,
.unit.compact .unit-head {
  padding: 7px 0;
}

.unit.done .unit-number,
.unit.compact .unit-number {
  width: 36px;
  height: 36px;
  font-size: 16px;
}

.unit.done .unit-number svg {
  width: 17px;
  height: 17px;
}

.unit.done .unit-title,
.unit.compact .unit-title {
  min-width: 0;
  font-size: 19px;
  font-weight: 500;
}

.unit.compact .unit-title {
  color: var(--text-secondary);
}

.unit-count {
  margin-left: auto;
  flex: none;
  font-size: 13.5px;
  color: var(--text-secondary);
}

.unit.compact .unit-count {
  color: var(--text-faint);
}

.unit-count + .icon-chevron {
  margin-left: 6px;
  width: 16px;
  height: 16px;
}

.unit.ahead > .rail-row::before {
  background: var(--track);
}

/* The stop after the last unit: an empty, dashed ring for the units still
   being written. */
.unit.soon .unit-number {
  background: var(--surface);
  box-shadow: none;
  border: 2px dashed var(--text-faint);
  animation: soon 2.4s ease-in-out infinite;
}

.soon-text {
  font-size: 15px;
  color: var(--text-secondary);
}

/* With the course done and its card shut, no rail leads to it. */
.rail > .earlier:has(> details:not([open])) + .soon > .rail-row::before {
  display: none;
}

@keyframes soon {
  50% {
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  .unit.soon .unit-number {
    animation: none;
  }
}

.icon-chevron {
  margin-left: auto;
  flex: none;
  width: 20px;
  height: 20px;
  stroke-width: 2;
  color: var(--text-secondary);
  transition: transform 0.25s var(--ease);
}

details[open] .icon-chevron {
  transform: rotate(180deg);
}

/* A lesson */
.lesson-link {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 9px 0;
}

.lesson-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 2px var(--track);
}

.lesson.done .lesson-dot {
  width: 12px;
  height: 12px;
  background: var(--primary);
  box-shadow: 0 0 0 3px var(--surface);
}

.lesson-text {
  min-width: 0;
  display: grid;
}

.lesson-title {
  font-size: 17px;
  font-weight: 600;
}

.lesson-text small {
  font-size: 14px;
  color: var(--text-secondary);
}

.lesson.todo .lesson-title {
  color: var(--text-faint);
}

.lesson.todo small {
  color: #b1b8c7;
}

a.lesson-link:hover .lesson-title {
  color: var(--primary);
}

/* The lesson to do next, opened out as a card */
.lesson.current {
  display: flex;
  align-items: flex-start;
  gap: 18px;
  padding: 10px 0;
}

.lesson.current::before {
  background: linear-gradient(var(--primary) 0 67px, var(--track) 67px);
}

.rail > li:last-child .lessons > li.current:last-child::before {
  bottom: auto;
  height: 67px;
  background: var(--primary);
}

.lesson.current .rail-node {
  margin-top: 52px;
}

.lesson.current .lesson-dot {
  width: 10px;
  height: 10px;
  background: var(--primary);
  box-shadow:
    0 0 0 4px var(--surface-raised),
    0 0 0 6px rgb(52 84 209 / 0.28);
}

.lesson-card {
  flex: 1;
  min-width: 0;
  padding: 24px 26px 26px;
  border-radius: 20px;
  background: var(--surface-raised);
  box-shadow:
    0 0 0 1px var(--border),
    0 18px 30px -22px rgb(24 34 56 / 0.3);
}

.lesson-card small {
  font-size: 14.5px;
  color: var(--text-secondary);
}

.lesson-sentence {
  margin: 6px 0 22px;
  font: 500 29px/1.2 var(--serif);
  letter-spacing: -0.01em;
}

/* The learner's own words. */
.lesson-sentence b {
  font-weight: 500;
  color: var(--primary);
}

.lesson-sentence .tag {
  margin: 0 0 0 4px;
  vertical-align: 5px;
  font-family: var(--sans);
  letter-spacing: 0;
}

@keyframes fill {
  from {
    transform: scaleX(0);
  }
}

.lesson-go {
  display: flex;
  align-items: center;
  gap: 18px;
}

.lesson-go .button {
  flex: none;
  width: auto;
  min-height: 48px;
  padding: 0 24px;
  font-size: 16px;
}

/* Continue lesson, a form that starts practice, holds its size as the link does. */
.lesson-go form {
  flex: none;
}

.lesson-go p {
  font-size: 14px;
  color: var(--text-secondary);
}

/* Beside the rail */
/* It stays in view while the units scroll by. */
.learn-page .page-aside {
  position: sticky;
  top: 32px;
  align-self: start;
}

/* The course as a whole: the unit reached, and the lessons done of all. */
.course {
  padding: 18px 20px 20px;
}

/* A Pro learner's mark sits across from the card's name, on the line it
   would take anyway. */
.course-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.course-head .pro-mark {
  margin: -7px 0;
}

.course h2 {
  font-size: 13.5px;
  font-weight: 400;
  color: var(--text-secondary);
}

.course-unit {
  margin-top: 6px;
  font: 600 26px/1.1 var(--serif);
}

.course-unit small {
  margin-left: 6px;
  font: 400 14px var(--sans);
  color: var(--text-secondary);
}

.course progress {
  appearance: none;
  display: block;
  width: 100%;
  height: 6px;
  margin: 14px 0 10px;
  border: 0;
  border-radius: 3px;
  overflow: hidden;
  background: var(--track);
}

.course progress::-webkit-progress-bar {
  background: var(--track);
}

.course progress::-webkit-progress-value {
  border-radius: 3px;
  background: var(--primary);
}

.course progress::-moz-progress-bar {
  border-radius: 3px;
  background: var(--primary);
}

.course-stats {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.week {
  padding: 18px 20px;
}

/* The streak, across from the week it is counted in. */
.week-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.week .streak {
  font-size: 13.5px;
}

.week .streak b {
  font-size: 15px;
}

.week .streak svg {
  width: 16px;
  height: 16px;
}

.week h2,
.gems p {
  font-size: 15px;
  font-weight: 600;
}

.week ol {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.week li {
  display: grid;
  justify-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--text-faint);
}

.week i {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  box-shadow: inset 0 0 0 1.5px #c9d0de;
}

/* A day practised: filled, as in the app, with a tick in it. */
.week .practised i {
  background: var(--primary);
  box-shadow: none;
}

.week .practised svg {
  width: 10px;
  height: 10px;
  stroke-width: 3.4;
  color: var(--on-primary);
}

/* A day a gem or a freeze held the streak through. */
.week .held i {
  background: var(--held-soft);
  box-shadow: inset 0 0 0 1.5px rgb(31 134 174 / 0.45);
}

.week .today i {
  box-shadow: none;
  border: 1.8px dashed var(--primary);
}

.week .is-today {
  font-weight: 600;
  color: var(--primary);
}

/* The whole card opens the streak's sheet. */
.week {
  position: relative;
}

.week-open,
.card-open {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-md);
  transition: box-shadow 0.2s ease;
}

@media (hover: hover) {
  .week-open:hover,
  .card-open:hover {
    box-shadow: 0 0 0 1px rgb(24 34 56 / 0.2);
  }
}

/* The course card opens what the learner has done so far, the same way. */
.course {
  position: relative;
}

/* ---- The streak's sheet: the flame, the count, this month ---- */

.sheet.streak-sheet {
  width: min(400px, calc(100vw - 32px));
  text-align: center;
}

.streak-sheet header {
  margin-bottom: 0;
}

/* Grey until today's practice is done, then lit with a soft glow. */
.streak-flame {
  position: relative;
  width: 60px;
  height: 60px;
  margin: 0 auto;
  color: #c7ccd6;
}

.streak-flame.lit {
  color: var(--streak);
}

.streak-flame.lit::before {
  content: "";
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(232 98 12 / 0.22), rgb(232 98 12 / 0));
}

.streak-flame.frozen {
  color: var(--held);
}

.streak-flame.frozen::before {
  content: "";
  position: absolute;
  inset: -22px;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgb(43 155 196 / 0.22), rgb(43 155 196 / 0));
}

.streak-flame.frozen svg {
  stroke-width: 1.6;
}

.streak-flame svg {
  position: relative;
  width: 60px;
  height: 60px;
}

.streak-count {
  margin-top: 8px;
  font-size: 17px;
  color: var(--text-secondary);
}

.streak-count b {
  display: block;
  font: 500 76px/1.05 var(--serif);
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: -0.02em;
  color: var(--text);
}

/* A streak that just ended, which gems can bring back. */
.streak-count.ended b {
  color: #b4bbc8;
}

.month {
  margin-top: 24px;
  padding: 16px 12px;
}

.month-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  padding: 0 6px 10px;
}

.month-head h2 {
  font: 600 20px var(--serif);
}

.month-head p {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.month-letters,
.month-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.month-letters {
  padding-bottom: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-faint);
}

/* The links between days sit under every day's circle. */
.month-days {
  isolation: isolate;
}

.month-days li {
  position: relative;
  height: 40px;
  display: grid;
  place-items: center;
}

.month-days b {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 15px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
  transition:
    transform 0.45s cubic-bezier(0.34, 1.56, 0.64, 1),
    background-color 0.2s ease,
    color 0.2s ease;
}

.month-days .ahead b {
  color: var(--text-faint);
}

/* Today, still to practise. */
.month-days .waiting b {
  border: 1.5px dashed var(--primary);
  font-weight: 600;
  color: var(--primary);
}

/* A day a gem or a freeze held the streak through: ice blue, there from
   the start, and part of the chain. */
.month-days .held b {
  background: var(--held-soft);
  color: var(--held);
}

.month-days .held.today b::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--held);
}

.month-days .held.joined::before {
  background: var(--held-soft);
  opacity: 1;
}

/* A missed day that ended the streak, which a gem can fill. */
.month-days .gap b {
  border: 1.5px dashed #bcc4d1;
}

/* A practised day is filled in as the month plays: tinted before the
   streak, solid and chained in it. */
.month-days .practised b,
.month-days .in-streak b {
  transform: scale(0.8);
}

.month-days .filled b {
  transform: none;
}

.month-days .practised.filled b {
  background: var(--primary-soft);
  color: var(--primary);
}

.month-days .in-streak.filled b {
  background: var(--primary);
  color: var(--on-primary);
}

/* Today, done: the end of the streak, ringed in the flame's colour. */
.month-days .in-streak.today b::after {
  content: "";
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  border: 1.5px solid var(--streak);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.month-days .in-streak.today.filled b::after {
  opacity: 1;
}

/* From the day before to this one. */
.month-days .joined::before {
  content: "";
  position: absolute;
  z-index: -1;
  top: 50%;
  left: -50%;
  width: 100%;
  height: 6px;
  margin-top: -3px;
  background: rgb(52 84 209 / 0.08);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.month-days .in-streak.joined::before {
  background: rgb(52 84 209 / 0.18);
}

.month-days .joined.filled::before {
  opacity: 1;
}

.streak-stats {
  margin-top: 18px;
  display: flex;
  justify-content: center;
  gap: 36px;
}

.streak-stats p {
  font-size: 12.5px;
  color: var(--text-secondary);
}

.streak-stats b {
  display: block;
  font: 500 28px/1.2 var(--serif);
  font-variant-numeric: lining-nums;
  color: var(--text);
}

.streak-sheet .button {
  margin-top: 24px;
}

/* What the missing days or the freeze mean, over the one button. */
.streak-note {
  margin-top: 22px;
  font-size: 16px;
  line-height: 1.4;
  color: var(--text-secondary);
  text-wrap: balance;
}

.streak-note b {
  font-weight: 600;
  color: var(--text);
}

.streak-note + form .button {
  margin-top: 14px;
}

.streak-sheet .button.soft {
  background: var(--surface-sunken, #e8edf5);
  color: var(--text);
}

/* The gem a mend takes, on its button. */
.mend-gem {
  width: 24px;
  height: 24px;
  margin-right: 8px;
}

.mend-gem svg {
  display: block;
  width: 24px;
  height: 24px;
}

.streak-sheet .quiet.again {
  color: var(--text-secondary);
}

.streak-done {
  margin: 24px 0 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 17px;
  color: var(--text-secondary);
}

.streak-done svg {
  width: 20px;
  height: 20px;
  color: var(--success);
}

/* Opened, the flame lights and the rest comes up after it, top down. */
.streak-sheet[open] .streak-flame svg {
  animation: flame 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

.streak-sheet[open] .streak-flame::before {
  animation: appear 0.8s ease 0.2s both;
}

.streak-sheet[open] > :is(.streak-count, .month, .streak-stats, .streak-done, .streak-note, .button, .quiet, form) {
  animation: rise 0.5s var(--ease) both;
}

.streak-sheet[open] > .streak-count { animation-delay: 0.15s; }
.streak-sheet[open] > .month { animation-delay: 0.3s; }
.streak-sheet[open] > .streak-stats { animation-delay: 0.45s; }
.streak-sheet[open] > :is(.streak-done, .streak-note, .button, .quiet, form) { animation-delay: 0.55s; }

@keyframes flame {
  from {
    opacity: 0;
    transform: scale(0.4);
  }
}

@media (prefers-reduced-motion: reduce) {
  .streak-sheet[open] *,
  .streak-sheet[open] *::before {
    animation: none;
  }
}

.gems {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
}

.gems-pile {
  display: flex;
}

.gems-pile svg {
  margin-right: -4px;
}

.gems small {
  font-size: 14px;
  font-weight: 400;
  color: var(--text-secondary);
}

/* ---- Profile ---- */

.group {
  margin: 22px 0 10px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

.rows {
  max-width: 520px;
  overflow: hidden;
}

.rows > div,
.rows > a,
.rows > label,
.rows button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
  min-height: 50px;
  padding: 0 16px;
  font-size: 16px;
  text-align: left;
}

.rows > * + * {
  box-shadow: 0 -1px 0 var(--border);
}

.row-value {
  min-width: 0;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rows button:hover,
.rows > a:hover {
  background: var(--surface);
}

.rows .icon-next,
.rows .icon-external {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--text-faint);
}

.rows > label {
  cursor: pointer;
}

.profile-page .rows {
  max-width: none;
}

.profile-page .group:first-of-type {
  margin-top: 22px;
}

.profile-page .chips {
  margin-bottom: 0;
}

/* The sentence the choice changes, its feminine ending lifted out. */
.example {
  margin-top: 10px;
  padding: 12px 16px 13px;
  font-size: 20px;
}

/* A setting's choices with its example beside them. */
.chips-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.chips-row .chips {
  margin: 0;
}

.chips-row .example {
  margin: 0;
  padding: 7px 14px 8px;
  font-size: 18px;
}

.example b {
  font-weight: inherit;
  color: var(--primary);
}

/* A change was kept: said by the title for a moment. */
/* A setting was saved: said at the top of the column, wherever the page
   has been scrolled to. It takes no room of its own. */
.saved {
  position: sticky;
  top: 10px;
  z-index: 3;
  order: -3;
  height: 0;
  display: flex;
  justify-content: flex-end;
}

.saved[hidden] {
  display: none;
}

.saved span {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 15px;
  background: var(--surface-raised);
  box-shadow:
    0 0 0 1px var(--border),
    0 8px 16px -10px rgb(24 34 56 / 0.3);
  font-size: 14px;
  font-weight: 600;
  color: var(--success);
  animation: rise 0.3s var(--ease) both;
}

.saved svg {
  width: 16px;
  height: 16px;
}

.setting-hint {
  margin: 8px 4px 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* On or off. */
.switch {
  flex: none;
  position: relative;
  width: 46px;
  height: 28px;
  margin: 0;
  border-radius: 14px;
  background: var(--track);
  appearance: none;
  cursor: pointer;
  transition: background 0.2s ease;
}

.switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(24 34 56 / 0.25);
  transition: transform 0.2s var(--ease);
}

.switch:checked {
  background: var(--primary);
}

.switch:checked::before {
  transform: translateX(18px);
}

.button.save {
  margin-top: 18px;
}

/* Pro: cobalt for a learner who could have it, the foil of a badge for
   one who does. */
.plan {
  padding: 18px;
  border-radius: 20px;
  background: var(--primary);
  color: var(--on-primary);
  box-shadow: 0 14px 22px -12px rgb(52 84 209 / 0.55);
}

.plan h2 {
  font: 600 24px/1.2 var(--serif);
}

.plan p {
  margin-top: 4px;
  font-size: 15px;
  line-height: 1.4;
  opacity: 0.85;
}

.plan a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  margin-top: 14px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--on-primary);
  color: var(--primary);
  font-weight: 600;
  text-align: center;
}

.plan.pro {
  background: linear-gradient(115deg, #f9c6e8, #bfe6ff 28%, #d9c7ff 52%, #c4f5e2 76%, #ffe9b8);
  color: var(--text);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.75),
    0 14px 22px -12px rgb(24 34 56 / 0.3);
}

.plan.pro p {
  opacity: 0.75;
}

.plan.pro a {
  background: var(--text);
  color: var(--on-primary);
}

/* What the learner has done in German so far, in the sheet the course
   card on Learn opens: this week as one number and a bar for each day,
   split into what was written, said and heard, then everything since the
   start as four quiet numbers. */
.sheet.so-far-sheet {
  width: min(420px, calc(100vw - 32px));
}

/* The title is the sheet's top line, across from the way out. */
.so-far-sheet header {
  justify-content: flex-start;
  margin-bottom: 0;
  padding: 0 34px 0 0;
  text-align: left;
  color: var(--text);
}

.so-far-sheet .sheet-title {
  margin-bottom: 0;
}

.so-far-group {
  margin-top: 16px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
}

.so-far-group.all {
  margin-top: 20px;
  padding-top: 18px;
  box-shadow: 0 -1px 0 var(--border);
}

.so-far-count {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-top: 2px;
  font-size: 14.5px;
  color: var(--text-secondary);
}

.so-far-count b {
  font: 600 52px/1 var(--serif);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums lining-nums;
  color: var(--text);
}

.so-far-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 10px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.so-far-days li {
  text-align: center;
}

/* A day's bar: what was written at the foot, then said, then heard. */
.so-far-days span {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 112px;
  border-radius: 8px;
  overflow: hidden;
}

.so-far-days i {
  display: block;
  height: 0;
  transition: height 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.so-far-days li:nth-child(2) i { transition-delay: 70ms; }
.so-far-days li:nth-child(3) i { transition-delay: 140ms; }
.so-far-days li:nth-child(4) i { transition-delay: 210ms; }
.so-far-days li:nth-child(5) i { transition-delay: 280ms; }
.so-far-days li:nth-child(6) i { transition-delay: 350ms; }
.so-far-days li:nth-child(7) i { transition-delay: 420ms; }

.so-far-days .part-written,
.so-far-key .part-written::before {
  background: var(--primary);
}

.so-far-days .part-said,
.so-far-key .part-said::before {
  background: #8fa2e6;
}

.so-far-days .part-heard,
.so-far-key .part-heard::before {
  background: #cdd6f5;
}

/* A day with nothing on it is an outline: today's in the primary colour
   while it is still to do. The days to come are left open. */
.so-far-days .empty span {
  box-shadow: inset 0 0 0 1.5px var(--track);
}

.so-far-days .empty.today span {
  box-shadow: inset 0 0 0 1.5px var(--primary);
}

.so-far-days small {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  color: var(--text-secondary);
}

.so-far-days .ahead small {
  color: var(--text-faint);
}

.so-far-days .today small {
  font-weight: 700;
  color: var(--primary);
}

.so-far-key {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--text-secondary);
}

.so-far-key span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.so-far-key span::before {
  content: "";
  width: 9px;
  height: 9px;
  border-radius: 3px;
}

.so-far-key b {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.so-far-tiles {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 10px 0 0;
}

.so-far-tiles > div {
  padding: 11px 4px 10px;
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
  text-align: center;
}

.so-far-tiles dd {
  margin: 0;
  font: 600 19px/1.2 var(--serif);
  font-variant-numeric: tabular-nums lining-nums;
}

.so-far-tiles .known dd {
  color: var(--primary);
}

.so-far-tiles dt {
  margin-top: 1px;
  font-size: 11.5px;
  line-height: 1.25;
  color: var(--text-secondary);
}

@media (prefers-reduced-motion: reduce) {
  .so-far-days i {
    transition: none;
  }
}

/* Today's use of each daily limit, under the plan that sets them: a row
   and a thin bar for each. */
.usage {
  display: grid;
  gap: 11px;
  margin: 0;
  padding: 13px 16px 15px;
  list-style: none;
}

.usage li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 5px 12px;
}

.use-name {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
}

/* None of it is left today. */
.use-name small {
  padding: 2px 7px;
  border-radius: 8px;
  background: var(--surface-sunken);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

.use-count {
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

.use-count b {
  font-weight: 600;
  color: var(--text);
}

.usage progress {
  grid-column: 1 / -1;
  appearance: none;
  display: block;
  width: 100%;
  height: 4px;
  border: 0;
  border-radius: 2px;
  overflow: hidden;
  background: var(--track);
}

.usage progress::-webkit-progress-bar {
  background: var(--track);
}

.usage progress::-webkit-progress-value {
  border-radius: 2px;
  background: var(--primary);
}

.usage progress::-moz-progress-bar {
  border-radius: 2px;
  background: var(--primary);
}

.delete {
  width: 100%;
  min-height: 44px;
  font-size: 15.5px;
  font-weight: 500;
  color: var(--error);
}

.button.danger {
  background: var(--error);
}

.sheet-title {
  margin-bottom: 4px;
  font: 600 26px/1.2 var(--serif);
}

.sheet-title em {
  font-style: normal;
  color: var(--primary);
}

.sheet .sheet-title + .well.note {
  margin-top: 12px;
}

/* A note's field comes straight under the sheet's name. */
.sheet header + .well.note {
  margin-top: 0;
}

/* Profile is one column at every width: the plan first, as in the app,
   then the settings, then help and the account. */
.page.with-aside.profile-page {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 634px;
}

.profile-page .page-main,
.profile-page .page-aside {
  display: contents;
}

.profile-page .page-aside > * {
  order: 1;
  margin-top: 14px;
}

.profile-page .page-aside > .plan,
.profile-page .page-aside > .today-use {
  order: -1;
  margin-top: 0;
}

/* ---- A lesson: the whole window, no sidebar ---- */

.stage {
  width: 100%;
  max-width: 600px;
  margin: 0 auto;
  padding: 30px 20px 64px;
}

.stage header {
  position: relative;
  height: 30px;
  margin-bottom: 44px;
  text-align: center;
  font-size: 16.5px;
  font-weight: 600;
}

.stage header a {
  position: absolute;
  right: 0;
  top: 0;
  color: var(--primary);
}

/* How many exercises are left, across from the way out. */
.stage header .left {
  position: absolute;
  left: 0;
  top: 0;
  margin: 0;
  line-height: 30px;
  font-size: 14.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--text-secondary);
}

/* A lesson's name, steps and way out stay in view as its parts stack up:
   only the room above them scrolls away. */
.stage-top {
  position: sticky;
  top: -14px;
  z-index: 2;
  margin: -30px -20px 16px;
  padding: 30px 20px 14px;
  background: var(--surface);
}

.stage-top .segments {
  margin-bottom: 0;
}

.icon-close {
  stroke-width: 2;
}

/* ---- Sign-in ---- */

.signin {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 20px 64px;
}

/* The landing page's soft mists behind the top of the page, so signing in
   looks like the next room and not another site. */
.signin-wash {
  position: absolute;
  inset: 0 0 auto;
  z-index: -1;
  height: 1000px;
  overflow: hidden;
  pointer-events: none;
}

.signin-wash i {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  animation: mist-drift 16s ease-in-out infinite alternate;
}

.signin-wash i:nth-child(1) {
  left: -12vw;
  top: -220px;
  width: 60vw;
  height: 620px;
  background: #dce4fc;
}

.signin-wash i:nth-child(2) {
  right: -10vw;
  top: -140px;
  width: 46vw;
  height: 540px;
  background: #f7e3ee;
  animation-duration: 19s;
  animation-direction: alternate-reverse;
}

.signin-wash i:nth-child(3) {
  left: 26vw;
  top: 320px;
  width: 50vw;
  height: 420px;
  background: #e2ecf8;
  animation-duration: 21s;
}

.signin-wash::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  z-index: 1;
  height: 140px;
  background: linear-gradient(#ebe6f6, transparent);
}

.signin-wash::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 480px;
  background: linear-gradient(transparent, var(--surface));
}

@keyframes mist-drift {
  to {
    transform: translate(4vw, 40px) scale(1.05);
  }
}

@media (prefers-reduced-motion: reduce) {
  .signin-wash i {
    animation: none;
  }
}

.signin-top {
  width: 100%;
  max-width: 1280px;
  padding: 30px 2px 0;
}

.signin-panel {
  width: 100%;
  max-width: 400px;
  margin-top: min(16vh, 140px);
  animation: rise 0.6s var(--ease) both;
}

/* The big serif headline, one word lifted out. */
.hero {
  font: 600 44px/1.1 var(--serif);
  letter-spacing: -0.015em;
}

.hero em {
  font-weight: 500;
  color: var(--primary);
}

.signin-lead {
  color: var(--text-secondary);
  margin-top: 10px;
}

.signin-lead b {
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}

.signin-change {
  color: var(--primary);
  font-weight: 600;
}

.signin-email {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 12px;
  font-size: 18px;
  font-weight: 500;
  overflow-wrap: anywhere;
}

.field-label {
  display: block;
  margin: 30px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.well {
  width: 100%;
  height: 56px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
  font-size: 19px;
  outline: none;
  transition: box-shadow 0.2s ease;
}

.well::placeholder {
  color: var(--text-faint);
}

.well:focus {
  box-shadow: 0 0 0 2px var(--primary);
}

.well.bad {
  box-shadow: 0 0 0 2px var(--error);
}

/* The code, its digits spread like six boxes. */
.well.code {
  height: 64px;
  padding-left: calc(16px + 0.5em);
  text-align: center;
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.5em;
}

/* With the script, the code shows in six boxes drawn over the field, which
   is still there under them to type and paste into. */
.code-cells {
  display: none;
}

.code-field.boxed {
  position: relative;
}

.code-field.boxed .well.code {
  position: absolute;
  inset: 0;
  height: 100%;
  opacity: 0;
}

.code-field.boxed .code-cells {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 10px;
}

.code-cells span {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 64px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
  font-size: 28px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  transition: box-shadow 0.2s ease;
}

.code-field:focus-within .code-cells span.on {
  box-shadow: 0 0 0 2px var(--primary);
}

.well.bad ~ .code-cells span {
  box-shadow: 0 0 0 2px var(--error);
}

.signin-note {
  min-height: 21px;
  margin: 10px 0 22px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.signin-note.bad {
  color: var(--error);
}

/* ---- Narrower windows ---- */

/* Too narrow for three columns: what was beside the page goes above it. */
@media (max-width: 1000px) {
  .page.with-aside {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-width: 760px;
  }

  .page-main {
    display: contents;
  }

  .page-aside {
    order: -1;
    margin: 0 0 22px;
  }

  /* The course and the week are the first thing on the page here, side by
     side, the gems under them. */
  .learn-page .page-aside {
    position: static;
    align-self: stretch;
    grid-template-columns: 1fr 1fr;
  }

  .learn-page .gems {
    grid-column: 1 / -1;
  }
}

@media (max-width: 560px) {
  .learn-page .page-aside {
    grid-template-columns: 1fr;
  }

  /* Above the rail on a phone, the course card is kept to its numbers. */
  .course {
    padding: 14px 18px 16px;
  }

  .course h2 {
    display: none;
  }

  /* With the name gone, the mark rides beside the unit. */
  .course-head {
    float: right;
    margin: 2px 0 0 12px;
  }

  .course-unit {
    margin: 0;
    font-size: 20px;
  }

  .course progress {
    margin: 10px 0 8px;
  }

  .lesson-card {
    padding: 20px;
  }
}

/* A phone: the sidebar becomes the tab bar, as in the iOS app. */
@media (max-width: 700px) {
  .shell {
    display: block;
  }

  .shell-side {
    position: fixed;
    top: auto;
    left: 14px;
    right: 14px;
    bottom: max(14px, env(safe-area-inset-bottom));
    z-index: 10;
    height: 62px;
    padding: 0 8px;
    border-radius: 31px;
    background: rgb(255 255 255 / 0.92);
    backdrop-filter: blur(16px);
    box-shadow:
      0 0 0 1px var(--border),
      0 12px 24px -14px rgb(24 34 56 / 0.35);
    flex-direction: row;
    align-items: center;
  }

  .shell-side .wordmark {
    display: none;
  }

  .shell-nav {
    margin: 0;
    flex: 1;
    display: flex;
    justify-content: space-around;
  }

  .shell-tab {
    flex-direction: column;
    gap: 2px;
    width: 76px;
    height: 48px;
    justify-content: center;
    padding: 0;
    border-radius: 24px;
    font-size: 11.5px;
    color: var(--text);
  }

  .shell-tab svg {
    width: 22px;
    height: 22px;
  }

  .shell-tab.active {
    background: var(--surface-sunken);
  }

  .page,
  .page.with-aside {
    padding: 20px 20px 110px;
  }

  .title {
    font-size: 36px;
  }

  .unit-title {
    font-size: 23px;
  }

  .lesson-sentence {
    font-size: 25px;
  }

  .lesson-go {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .lesson-go p {
    text-align: center;
  }
}

/* ---- A lesson and its practice: the whole window, no sidebar ---- */

[hidden] {
  display: none !important;
}

.stage > header span:empty {
  display: block;
  height: 1px;
}

/* The lesson's steps: the sentence, each part, then practice. */
.segments {
  display: flex;
  gap: 6px;
  margin: -24px 0 30px;
}

.segments i,
.progress {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--track);
}

.segments i.on {
  background: var(--primary);
  transition: background 0.4s ease;
}

.progress {
  margin: -24px 0 30px;
  overflow: hidden;
}

.progress i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: 2px;
  background: var(--primary);
  transition: width 0.5s var(--ease);
}

.stage .title {
  margin-bottom: 20px;
}

.de {
  font-family: var(--serif);
  font-weight: 500;
}

em.de {
  font-style: normal;
}

/* A part of a lesson, on a card */
.part {
  padding: 18px 20px 20px;
  margin-bottom: 14px;
  animation: rise 0.5s var(--ease) both;
}

.part h2,
.prompt small,
.setting small,
.result-card small,
.your-note small {
  display: block;
  margin-bottom: 10px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.your-sentence {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -0.01em;
}

/* The learner's own part of it, to change. */
.slot {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 0 1px 1px;
  border-bottom: 2px solid var(--primary);
  font: inherit;
  letter-spacing: inherit;
}

.slot.empty {
  min-width: 96px;
  justify-content: flex-end;
}

.slot svg {
  width: 16px;
  height: 16px;
  color: var(--primary);
}

.slot .more {
  margin-left: 2px;
  padding: 1px 7px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 12.5px;
  letter-spacing: 0;
}

.your-sentence em {
  font-style: normal;
  color: var(--primary);
  border-bottom: 2px solid var(--primary);
}

.part-hint {
  margin-top: 12px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.say-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.say-row > p {
  flex: 1;
  min-width: 0;
  font-size: 26px;
  line-height: 1.25;
}

.say-row.also {
  margin-top: 14px;
  padding-top: 14px;
  box-shadow: 0 -1px 0 var(--border);
}

.say-row.also > p,
.result-card .say-row > p {
  font-size: 22px;
}

.say-row small {
  display: block;
  margin: 2px 0 0;
  font: 400 15px var(--sans);
  color: var(--text-secondary);
}

/* The learner's words in the German. */
.german-sentence b {
  font-weight: 500;
  padding: 1px 8px 3px;
  border-radius: 8px;
  background: var(--surface-sunken);
}

.say {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
}

.say:active {
  transform: scale(0.94);
}

.say svg {
  width: 22px;
  height: 22px;
}

.variant {
  margin-top: 18px;
  padding-top: 16px;
  box-shadow: 0 -1px 0 var(--border);
}

.words {
  margin: -6px 0 -8px;
  padding: 0;
  list-style: none;
}

.words li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 0;
}

.words li + li {
  box-shadow: 0 -1px 0 var(--border);
}

.words li > div {
  flex: 1;
  min-width: 0;
}

.words .say {
  width: 40px;
  height: 40px;
}

.word {
  font-size: 23px;
  font-weight: 600;
  line-height: 1.2;
}

.word-english {
  font-size: 17px;
  color: var(--text-secondary);
}

.note-line {
  display: flex;
  gap: 8px;
  margin-top: 6px;
  font-size: 14.5px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.note-line svg {
  flex: none;
  width: 17px;
  height: 17px;
  margin-top: 1px;
  color: var(--primary);
}

.tag {
  display: inline-block;
  margin-top: 8px;
  padding: 2px 9px 3px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}

.tag.plain {
  background: var(--surface-sunken);
  color: var(--text-secondary);
  font-weight: 400;
}

/* A question about the sentence, which opens to its answer */
.grammar + .grammar {
  box-shadow: 0 -1px 0 var(--border);
}

.grammar summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  font-size: 17px;
  font-weight: 600;
}

.grammar summary .icon-chevron {
  width: 18px;
  height: 18px;
}

.grammar p {
  margin-bottom: 12px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.grammar em.de,
.reason em.de,
.part-hint em.de {
  font-size: 1.08em;
  color: var(--text);
}

.grammar .example {
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
}

.example .de {
  font-size: 19px;
}

.example b {
  color: var(--primary);
}

.example small {
  display: block;
  font-size: 14.5px;
  color: var(--text-secondary);
}

.grammar-note {
  line-height: 1.5;
}

.stage-foot {
  margin-top: 22px;
}

.button:disabled {
  opacity: 0.45;
  cursor: default;
}

.button kbd,
.hold kbd {
  margin-left: 12px;
  padding: 3px 7px 4px;
  border-radius: 6px;
  background: rgb(255 255 255 / 0.2);
  font: 600 12px var(--sans);
}

/* Before an optional unit, and when something couldn't be done */
.kicker {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.lead {
  margin: 12px 0 24px;
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-secondary);
}

/* ---- A sheet over the page: a slot's editor, the AI agreement ---- */

.sheet {
  width: min(480px, calc(100vw - 32px));
  padding: 22px;
  /* Its own, whatever the page under it does: a quiz is centred. */
  text-align: left;
  border: 0;
  border-radius: 24px;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 30px 60px -20px rgb(24 34 56 / 0.4);
}

/* It holds the focus when it opens (app.js), without a ring around it. */
.sheet:focus-visible {
  outline: none;
}

.sheet::backdrop {
  background: rgb(24 34 56 / 0.35);
}

/* Its name in the middle, the way out at the right. */
.sheet header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin-bottom: 14px;
  padding: 0 34px;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  color: var(--text-secondary);
}

.sheet header button {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--primary);
}

/* What a sheet sends goes under what was written in it. */
.sheet .well.note + .button {
  margin-top: 16px;
}

.sheet-hint {
  margin: 10px 0 14px;
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.sheet-hint.bad {
  color: var(--error);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 15px;
  border-radius: 19px;
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.chip input {
  position: absolute;
  opacity: 0;
}

.chip.on,
.chip:has(input:checked) {
  background: var(--primary-soft);
  color: var(--primary);
  box-shadow: inset 0 0 0 1.5px var(--primary);
}

.chip:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.ai-note {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
  font-size: 14.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.ai-note b {
  color: var(--text);
}

.ai-note a {
  display: inline-block;
  margin-top: 6px;
  color: var(--primary);
  font-weight: 600;
}

/* ---- Practice ---- */

.item {
  animation: rise 0.45s var(--ease) both;
}

.item-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.item-head h1 {
  font-size: 18px;
  font-weight: 600;
}

.item-head .tag {
  margin-top: 0;
}

/* What a riddle asks, under its heading: learners didn't see what to do
   from "Guess the word" alone. */
.item-explain {
  margin: -10px 0 16px;
  color: var(--text-secondary);
  font-size: 15px;
  line-height: 1.45;
}

.item-explain b {
  color: var(--text);
  font-weight: 600;
}

.prompt {
  padding: 18px 20px;
  font-size: 21px;
  line-height: 1.35;
}

.prompt .de {
  font-size: 25px;
}

.prompt p + small {
  margin: 6px 0 0;
  font-weight: 400;
  font-size: 15.5px;
}

/* The word left out of a sentence. */
.blank {
  display: inline-block;
  min-width: 2.4em;
  border-bottom: 2px solid var(--text-faint);
  text-align: center;
  line-height: 1.1;
  transition:
    color 0.2s ease,
    border-color 0.2s ease;
}

.blank.filled {
  border-color: transparent;
  color: var(--success);
}

.setting {
  margin-bottom: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  line-height: 1.45;
}

.setting small {
  margin-bottom: 4px;
}

.listen {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 14px 0 6px;
  color: var(--text-secondary);
  font-size: 15px;
}

.play-big {
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
}

.play-big svg {
  width: 38px;
  height: 38px;
}

.asked {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.asked > div {
  flex: 1;
  min-width: 0;
}

.asked small {
  margin: 4px 0 0;
  font-weight: 400;
  font-size: 15.5px;
}

.quiet.link {
  min-height: 32px;
  padding: 0;
  font-size: 14.5px;
}

.choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.choice {
  min-height: 58px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
  font-size: 22px;
  transition:
    opacity 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.choice:disabled {
  cursor: default;
}

/* The number key that picks a choice, in its corner, where there are keys. */
@media (hover: hover) and (pointer: fine) {
  .choices {
    counter-reset: choice;
  }

  .choice {
    position: relative;
    counter-increment: choice;
  }

  .choice::after {
    content: counter(choice);
    position: absolute;
    top: 7px;
    right: 10px;
    font: 600 11px var(--sans);
    color: var(--text-faint);
  }

  .choice:disabled::after {
    content: none;
  }
}

.choice.dim {
  opacity: 0.45;
}

.choice.right {
  box-shadow: inset 0 0 0 2px var(--success);
  color: var(--success);
}

.choice.right.masculine,
.blank.masculine {
  box-shadow: inset 0 0 0 2px var(--masculine);
  color: var(--masculine);
}

.choice.right.feminine,
.blank.feminine {
  box-shadow: inset 0 0 0 2px var(--feminine);
  color: var(--feminine);
}

.choice.right.neuter,
.blank.neuter {
  box-shadow: inset 0 0 0 2px var(--neuter);
  color: var(--neuter);
}

.blank.masculine,
.blank.feminine,
.blank.neuter {
  box-shadow: none;
}

.choice.wrong {
  box-shadow: inset 0 0 0 2px var(--error);
  color: var(--error);
}

/* Words to put in order */
.order {
  margin-top: 14px;
}

.order-placed {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 64px;
  padding: 10px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
}

.order-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tile {
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  background: var(--surface-sunken);
  font-size: 20px;
}

.order-pool .tile.used {
  visibility: hidden;
}

/* The answer */
.answer {
  margin-top: 14px;
}

.answer-row {
  display: flex;
  gap: 10px;
}

.answer .well {
  flex: 1;
  min-width: 0;
  height: 62px;
  font-size: 23px;
}

/* A talk's field, as tall as what is written in it. */
.answer textarea.well {
  height: auto;
  min-height: 62px;
  padding: 16px;
  line-height: 30px;
  resize: none;
  overflow: hidden;
}

.mode {
  flex: none;
  width: 62px;
  height: 62px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
  color: var(--primary);
  display: grid;
  place-items: center;
}

.umlauts {
  display: flex;
  gap: 6px;
  margin-top: 10px;
}

.umlauts button {
  width: 36px;
  height: 34px;
  padding-bottom: 2px;
  border-radius: 9px;
  background: var(--surface-sunken);
  font: 500 18px var(--serif);
}

.hold {
  flex: 1;
  height: 62px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  touch-action: none;
  user-select: none;
}

.hold kbd {
  background: var(--primary-soft);
}

/* A key to press means nothing on a touch screen. */
@media (hover: none), (pointer: coarse) {
  .button kbd,
  .hold kbd {
    display: none;
  }
}

.hold.listening {
  background: var(--primary-soft);
  box-shadow: 0 0 0 2px var(--primary);
}

.hold.listening svg {
  animation: pulse 1s ease-in-out infinite;
}

@keyframes pulse {
  50% {
    opacity: 0.35;
  }
}

.item-error {
  margin-top: 12px;
  font-size: 15px;
  color: var(--error);
}

.item-foot {
  margin-top: 22px;
}

/* What was just left out of the round, said once. */
.round-note {
  margin: -8px 0 18px;
  font-size: 14.5px;
  color: var(--text-secondary);
}

/* A first miss: look again, without the answer */
.miss,
.result-card,
.checked {
  margin-top: 14px;
  border-radius: var(--radius-md);
  animation: rise 0.4s var(--ease) both;
}

.miss {
  padding: 16px 20px;
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
  color: var(--text-secondary);
  line-height: 1.45;
}

.result-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 600;
  color: var(--text);
}

.result-title svg {
  flex: none;
  width: 22px;
  height: 22px;
}

.miss .result-title {
  margin-bottom: 6px;
  color: var(--error);
}

.miss.almost .result-title {
  color: var(--warning);
}

.miss .fixed,
.miss .heard-line .de {
  font-size: 21px;
  color: var(--text);
}

.miss .heard-line {
  display: flex;
  align-items: center;
  gap: 8px;
}

.miss .heard-line svg {
  flex: none;
  width: 18px;
  height: 18px;
}

/* A spoken miss: what was said, small, over what to say. */
.miss small {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  color: var(--text-faint);
}

.miss .said {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 17px;
}

.miss .said svg {
  flex: none;
  align-self: center;
  width: 16px;
  height: 16px;
}

.miss .said mark {
  color: var(--error);
}

mark {
  background: none;
  color: var(--warning);
}

/* The answer as given, once checked */
.checked {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 62px;
  padding: 12px 20px;
  background: var(--surface-raised);
  box-shadow: 0 0 0 2px var(--error);
  font-size: 23px;
}

.checked.correct {
  box-shadow: 0 0 0 2px var(--success);
}

.checked.almost {
  box-shadow: 0 0 0 2px var(--warning);
}

.checked svg {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--text-secondary);
}

.checked .none {
  font-size: 17px;
  color: var(--text-faint);
}

.checked mark {
  color: var(--error);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.result-card {
  padding: 18px 20px;
  background: #f7e9e9;
}

.result-card.correct {
  background: var(--success-soft, #e3eeea);
}

.result-card.almost {
  background: #f7efdf;
}

.result-card.explains {
  background: var(--primary-soft);
}

.result-card.correct .result-title {
  color: var(--success);
}

.result-card.wrong .result-title {
  color: var(--error);
}

.result-card.almost .result-title {
  color: var(--warning);
}

.result-card.explains .result-title {
  color: var(--primary);
}

.result-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.result-card small {
  margin: 10px 0 2px;
  font-weight: 400;
}

.result-card .say {
  background: rgb(52 84 209 / 0.13);
}

.reason {
  margin-top: 10px;
  line-height: 1.45;
}

.your-note {
  margin-top: 12px;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgb(255 255 255 / 0.6);
}

.your-note small {
  margin: 0 0 2px;
}

/* How it went */
.summary {
  padding-top: 20px;
  text-align: center;
  animation: rise 0.5s var(--ease) both;
}

.summary-mark {
  width: 72px;
  height: 72px;
  margin: 0 auto 18px;
  color: var(--success);
}

.summary-mark.complete {
  color: var(--primary);
}

.summary-mark svg {
  width: 100%;
  height: 100%;
}

.summary .title {
  margin-bottom: 0;
}

.summary .part {
  text-align: left;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 17px;
  font-weight: 600;
}

.summary progress {
  display: block;
  width: 100%;
  height: 6px;
  margin-top: 12px;
  border: 0;
  border-radius: 3px;
  background: var(--track);
  overflow: hidden;
  appearance: none;
}

.summary progress::-webkit-progress-bar {
  background: var(--track);
}

.summary progress::-webkit-progress-value {
  background: var(--primary);
  border-radius: 3px;
}

.summary progress::-moz-progress-bar {
  background: var(--primary);
  border-radius: 3px;
}

/* A round's share of right answers, with a mark where a lesson is
   finished: green once the bar reaches it. */
.round-bar {
  position: relative;
  margin-top: 12px;
  padding: 4px 0;
}

.round-bar progress {
  margin-top: 0;
}

.round-bar::after {
  content: "";
  position: absolute;
  top: 0;
  left: calc(80% - 1px);
  width: 2px;
  height: 14px;
  border-radius: 1px;
  background: var(--text);
}

.round-bar.passed progress::-webkit-progress-value {
  background: var(--success);
}

.round-bar.passed progress::-moz-progress-bar {
  background: var(--success);
}

.summary .finish-line {
  margin-top: 6px;
  text-align: right;
}

.summary .streak {
  margin-top: 12px;
}

.saving {
  padding-top: 80px;
  text-align: center;
}

/* ---- Practice: the newer exercises ---- */

/* Help with an exercise, asked for a step at a time. */
.links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 20px;
  margin-top: 8px;
}

/* A recording drawn as bars, which fill as it plays. */
.wave {
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  height: auto;
  overflow: visible;
}

.wave rect {
  fill: var(--primary);
  opacity: 0.35;
  transition: opacity 0.12s linear;
}

/* The one who answers, in ink. */
.wave .voice-1 rect {
  fill: var(--text);
}

.wave rect.on {
  opacity: 1;
}

/* The light behind the sentence a question was about. */
.wave rect.lit {
  fill: var(--primary);
  opacity: 0;
  transform: scaleX(1.04);
  transform-box: fill-box;
  transform-origin: center;
  transition: opacity 0.3s ease;
}

.wave .about rect.lit {
  opacity: 0.12;
}

/* A text to listen to, as a voice message */
.heard {
  padding: 16px 20px 10px;
}

/* The text a block for each line across the card, to tap to play from
   there: wider for a longer line, at least a thumb wide. */
.heard-lines {
  display: flex;
  gap: 4px;
  height: 52px;
}

.heard-lines .line {
  flex: 1 1 0;
  min-width: 30px;
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--surface-sunken);
  box-shadow: inset 0 0 0 1.5px transparent;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.heard-lines .line:active {
  transform: scale(0.97);
}

.heard-lines .line i {
  flex: none;
  width: 3px;
  border-radius: 1.5px;
  background: var(--primary);
  opacity: 0.35;
  transition: opacity 0.12s linear;
}

/* The one who answers, in ink. */
.heard-lines .voice-1 i {
  background: var(--text);
}

.heard-lines .line i.on {
  opacity: 1;
}

/* The line a question was about, once answered, and the one playing. */
.heard-lines .line.about,
.heard-lines .line.now {
  background: var(--primary-soft);
}

.heard-lines .line.now {
  box-shadow: inset 0 0 0 1.5px rgb(52 84 209 / 0.35);
}

.heard-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
}

.heard-controls .say {
  width: 44px;
  height: 44px;
}

.heard-controls .say .icon {
  width: 20px;
  height: 20px;
}

.heard-controls .say .icon-stop,
.heard.playing .heard-controls .say .icon-play {
  display: none;
}

.heard.playing .heard-controls .say .icon-stop {
  display: block;
}

.heard-at {
  flex: 1;
  font-size: 13.5px;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
}

.slower-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 600;
  transition: transform 0.15s ease;
}

.slower-chip:active {
  transform: scale(0.96);
}

.slower-chip .icon {
  width: 12px;
  height: 12px;
}

.heard-controls .say,
.voice-message .say,
.voices .say {
  background: var(--primary);
  color: var(--on-primary);
}

.heard .links {
  justify-content: space-between;
}

.heard-text {
  padding: 8px 0 10px;
  animation: appear 0.3s ease both;
}

.heard-text p + p {
  margin-top: 10px;
}

.heard-text .de {
  display: block;
  font-size: 19px;
}

.heard-text small,
.asked-meaning {
  display: block;
  font-size: 14.5px;
  color: var(--text-secondary);
}

/* A bar for each question of the round. */
.rungs {
  display: flex;
  gap: 5px;
  margin: 18px 4px 0;
}

.rungs i {
  width: 22px;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-sunken);
}

.rungs i.on {
  background: var(--primary);
}

.ask {
  margin: 16px 4px 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* What a conversation was about: the choices are the question. */
.ask.alone {
  font-size: 18px;
  color: var(--text);
}

.asked-line {
  margin: 0 4px;
  font-size: 22px;
  font-weight: 500;
  line-height: 1.3;
}

.asked-line.de {
  font-size: 25px;
}

.asked-line ~ .asked-meaning,
.asked-line ~ .quiet.link {
  margin-left: 4px;
}

.asked-line ~ .asked-meaning {
  margin-top: 4px;
  font-size: 16px;
}

/* The questions about one text come in under it; the text stays. */
.item.goes-on {
  animation: none;
}

.item.goes-on .rungs ~ *,
.item.goes-on .ask,
.item.goes-on .ask ~ * {
  animation: appear 0.35s ease both;
}

@keyframes appear {
  from {
    opacity: 0;
  }
}

.choices.stacked {
  grid-template-columns: 1fr;
}

.choice:not(.de) {
  font-size: 18px;
  font-weight: 600;
}

.choices.stacked .choice {
  min-height: 54px;
  padding: 10px 16px;
  font-size: 18px;
  line-height: 1.3;
}

.choices.stacked .choice.de {
  font-size: 20px;
}

/* Only right or wrong, in a line. */
.grade-note {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  margin-top: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  background: #f7e9e9;
  color: var(--error);
  font-size: 17px;
  animation: rise 0.4s var(--ease) both;
}

.grade-note.correct {
  background: #e3eeea;
  color: var(--success);
}

.grade-note svg {
  flex: none;
  width: 22px;
  height: 22px;
}

.grade-note span {
  flex-basis: 100%;
  color: var(--text);
}

/* A riddle, as a voice message from someone */
.voice-message {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  width: fit-content;
  max-width: 100%;
  padding: 12px 18px 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
}

.voice-message > div {
  min-width: 0;
}

.voice-message small {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* It plays slower than it was said, while it plays. */
.voice-message small i {
  margin-left: 6px;
  font-style: normal;
  color: var(--primary);
  visibility: hidden;
}

.voice-message:has(.say.playing[data-rate]) small i {
  visibility: visible;
}

.voice-message .riddle {
  margin-top: 8px;
  font-size: 20px;
  line-height: 1.35;
  animation: appear 0.3s ease both;
}

.voice-message .asked-meaning {
  margin: 4px 0 0;
  font-weight: 400;
  animation: appear 0.3s ease both;
}

/* Written out for a learner who can't listen right now. */
.voice-message.read .say,
.voice-message.read .wave {
  display: none;
}

.voice-message.read .riddle {
  margin-top: 0;
}

/* A further clue: who and which, its new words dotted to tap. */
.voice-message.clue {
  animation: appear 0.3s ease both;
}

.voice-message.clue small em {
  margin-left: 6px;
  font-style: normal;
  font-weight: 500;
  opacity: 0.7;
}

.voice-message.clue .riddle {
  animation: none;
}

.gloss {
  position: relative;
  padding: 0;
  border: 0;
  border-radius: 3px;
  background: none;
  font: inherit;
  color: inherit;
  text-decoration: underline dotted color-mix(in srgb, var(--primary) 60%, transparent);
  text-underline-offset: 4px;
  cursor: pointer;
}

.gloss.open {
  background: color-mix(in srgb, var(--primary) 12%, transparent);
}

.gloss-tip {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  z-index: 2;
  padding: 6px 10px 7px;
  border-radius: 9px;
  background: var(--text);
  color: var(--surface-raised);
  font-family: var(--sans);
  font-size: 14px;
  white-space: nowrap;
  transform: translateX(-50%);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.2s ease;
}

.gloss-tip b {
  margin-right: 4px;
  font-family: var(--serif);
  font-weight: 500;
}

.gloss.open .gloss-tip {
  visibility: visible;
  opacity: 1;
}

.letter-hint {
  font-size: 15.5px;
  color: var(--text-secondary);
}

/* A right guess, as the learner said it. */
.mine {
  width: fit-content;
  max-width: 85%;
  margin: 14px 0 0 auto;
  padding: 10px 16px;
  border-radius: var(--radius-md);
  background: var(--primary-soft);
  animation: rise 0.4s var(--ease) both;
}

.mine small {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.mine small svg {
  width: 14px;
  height: 14px;
  color: var(--success);
}

.mine .de {
  font-size: 20px;
}

/* The word of a riddle, its article in its gender's colour. */
.word-card {
  margin-top: 14px;
  padding: 28px 20px;
  text-align: center;
  animation: rise 0.45s var(--ease) both;
}

.word-card .de {
  font-size: 36px;
  line-height: 1.15;
}

.word-card small {
  display: block;
  margin-top: 6px;
  font-size: 17px;
  color: var(--text-secondary);
}

.word-card .got {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  margin-top: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--success);
}

.word-card .got svg {
  width: 15px;
  height: 15px;
}

/* A sentence to say after someone: their voice, then the learner's */
.voices {
  margin-top: 12px;
  padding: 14px 20px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
}

.voice {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 15.5px;
  font-weight: 600;
}

.voice + .voice {
  margin-top: 12px;
  animation: appear 0.3s ease both;
}

.voice .quiet.link {
  margin-left: auto;
}

.voices .say {
  width: 40px;
  height: 40px;
}

.voices .say svg {
  width: 20px;
  height: 20px;
}

/* The word that didn't come out clearly. */
.unclear {
  color: var(--error);
  text-decoration: underline;
  text-underline-offset: 5px;
  text-decoration-thickness: 1.5px;
}

.miss .result-title em.de {
  font-size: 1.1em;
}

.hear-word {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 38px;
  margin: 4px 0 2px;
  padding: 0 14px 0 10px;
  border-radius: 19px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 19px;
}

.hear-word svg {
  width: 18px;
  height: 18px;
}

/* A talk: what there is to say, ticked as it is said */
.talk-prompt {
  font: 500 24px/1.3 var(--serif);
}

.topics {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 2px;
  padding: 0;
  list-style: none;
}

.topics li {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  padding: 0 12px;
  border-radius: 16px;
  box-shadow: inset 0 0 0 1px var(--track);
  font: 600 14px/1.2 var(--sans);
  color: var(--text-secondary);
  transition:
    color 0.3s ease,
    background 0.3s ease,
    box-shadow 0.3s ease;
}

.topics svg {
  display: none;
  width: 14px;
  height: 14px;
}

.topics .said {
  background: rgb(46 139 87 / 0.1);
  box-shadow: none;
  color: var(--success);
}

.topics .said svg {
  display: block;
}

.topics .next {
  box-shadow: inset 0 0 0 1px var(--primary);
  color: var(--primary);
}

/* What the learner said, fixed, and a sentence of theirs taken further. */
.said-card {
  margin: 12px 0 0;
  animation: appear 0.3s ease both;
}

.said-card h2 {
  margin-bottom: 6px;
}

.said-card [data-said] p {
  font-size: 19px;
  line-height: 1.4;
  transition: color 0.3s ease;
}

.said-card mark {
  font-weight: 600;
}

/* With a sentence taken further under them, that one is what to read. */
.said-card.taken-further [data-said] p {
  color: var(--text-secondary);
}

.said-card .reason,
.said-card [data-said] p.reason {
  margin-top: 4px;
  font-size: 14.5px;
  line-height: inherit;
  color: var(--text-secondary);
}

/* A sentence after another one's reason stands clear of it. */
.said-card [data-said] .reason + p {
  margin-top: 10px;
}

.further {
  margin-top: 14px;
  padding-top: 14px;
  box-shadow: 0 -1px 0 var(--border);
  animation: appear 0.4s ease both;
}

.further small {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.further .de {
  font-size: 23px;
  line-height: 1.3;
}

.further b {
  font-weight: 600;
  color: var(--primary);
}

.talk-help {
  margin: 12px 0 0;
}

.talk-help p + p {
  margin-top: 10px;
}

.talk-help span {
  display: block;
  line-height: 1.4;
}

.talk-help .de {
  font-size: 19px;
}

.talk-help.german span:not(.de) {
  font-size: 14.5px;
  color: var(--text-secondary);
}

.talk-help ~ .links {
  justify-content: center;
}

@media (prefers-reduced-motion: reduce) {
  .item,
  .item *,
  .summary {
    animation: none !important;
  }
}

/* ---- Words: the learner's dictionary as a slim index, and one word
   opened as the page beside it ---- */

.page.words-page {
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 0;
  padding: 0;
}

.words-page .page-main {
  padding: 32px 10px 64px 14px;
}

/* The search and the kinds of word stay at the top while the list scrolls
   under them. The room above them is the bar's own, so it doesn't move. */
.words-page {
  --bar-top: 32px;
}

.words-page .page-main:has(.words-bar) {
  padding-top: 0;
}

.words-bar {
  position: sticky;
  top: 0;
  z-index: 2;
  margin: 0 -4px;
  padding: var(--bar-top) 4px 12px;
  background: var(--surface);
}

.search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 14px;
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
  color: var(--text-secondary);
  cursor: text;
  transition: box-shadow 0.2s ease;
}

.search:focus-within {
  box-shadow: 0 0 0 2px var(--primary);
}

.search svg {
  flex: none;
  width: 18px;
  height: 18px;
}

.search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  font-size: 16px;
  color: var(--text);
}

.search input::placeholder {
  color: var(--text-faint);
}

/* The kinds of word, as one control: the one shown is raised. */
.filters {
  display: flex;
  margin-top: 12px;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-sunken);
}

.filter {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 6px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--text-secondary);
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.filter small {
  font-size: inherit;
  font-variant-numeric: tabular-nums;
  opacity: 0.6;
}

.filter.on {
  background: var(--surface-raised);
  box-shadow:
    0 0 0 1px var(--border),
    0 1px 2px rgb(24 34 56 / 0.08);
  color: var(--text);
}

/* How well a word is known: a ring while it fades, half full while it is
   being learned, full once it is known. */
.mark {
  flex: none;
  width: 9px;
  height: 9px;
  border-radius: 50%;
}

.mark.fading {
  box-shadow: inset 0 0 0 1.5px var(--warning);
}

.mark.learning {
  background: linear-gradient(90deg, var(--primary) 50%, transparent 50%);
  box-shadow: inset 0 0 0 1.5px var(--primary);
}

.mark.known {
  background: var(--success);
}

/* The letter the list is in stays under the bar: 58px of search under
   the room above it, and 50px more where there are kinds to pick. */
.letter h2 {
  position: sticky;
  top: calc(var(--bar-top) + 58px);
  z-index: 1;
  margin: 8px -4px 0;
  padding: 8px 8px 6px;
  background: var(--surface);
  font: 600 15px var(--serif);
  color: var(--text-secondary);
}

.words-bar:has(.filters) ~ .letter h2 {
  top: calc(var(--bar-top) + 108px);
}

.words-bar + .letter h2 {
  margin-top: 0;
}

.dictionary {
  margin: 0;
  padding: 0;
  list-style: none;
  overflow: hidden;
}

.dictionary li + li {
  box-shadow: 0 -1px 0 var(--border);
}

.dictionary a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 16px 10px;
  /* Brought into view, a word clears the bar and its letter. */
  scroll-margin: 190px 0 16px;
  transition: background 0.15s ease;
}

.dictionary a:hover {
  background: var(--surface);
}

.dictionary a[aria-current] {
  background: var(--primary-soft);
}

.entry {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.entry-word {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 7px;
}

.entry-word .de {
  font-size: 19px;
  font-weight: 600;
  line-height: 1.25;
}

.entry-word small {
  font-size: 13px;
  color: var(--text-secondary);
}

.entry-word .tag {
  margin-top: 0;
  padding: 1px 8px 2px;
  font-size: 12px;
}

.entry-english {
  font-size: 14.5px;
  color: var(--text-secondary);
}

/* The learner's note, like one in a margin. */
.entry .entry-note {
  margin-top: 3px;
  padding-left: 8px;
  border-left: 2px solid var(--primary);
  font-size: 13px;
  font-style: italic;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entry .entry-note.masculine {
  border-color: var(--masculine);
}

.entry .entry-note.feminine {
  border-color: var(--feminine);
}

.entry .entry-note.neuter {
  border-color: var(--neuter);
}

/* No words yet, or none found. Named with its page: a slot of a sentence
   with nothing in it is .empty too. */
.words-page .empty {
  padding: 90px 20px;
  text-align: center;
  color: var(--text-secondary);
}

.words-page .empty svg {
  width: 38px;
  height: 38px;
  margin: 0 auto;
}

.words-page .empty h2 {
  margin-top: 12px;
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
}

.words-page .empty p {
  max-width: 320px;
  margin: 4px auto 0;
  font-size: 15.5px;
  line-height: 1.45;
}

/* The word opened: the page beside the index. Its own width, not the
   window's, says whether its two columns fit. */
.word-pane {
  position: sticky;
  top: 0;
  height: 100vh;
  height: 100dvh;
  overflow-y: auto;
  background: var(--surface-raised);
  box-shadow: -1px 0 0 var(--border);
  container-type: inline-size;
}

.word-detail {
  max-width: 860px;
  margin: 0 auto;
  padding: 32px 52px 70px;
}

.word-pane .card {
  background: var(--surface);
  box-shadow: none;
}

.back {
  display: none;
  align-items: center;
  gap: 2px;
  margin: 0 0 14px -6px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--primary);
}

.back svg {
  width: 20px;
  height: 20px;
}

/* What kind of word it is and its other forms, under what it means:
   large enough to be read with the word, not after it. */
.word-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  animation: rise 0.55s 0.1s var(--ease) both;
}

.word-tags .tag {
  margin-top: 0;
  padding: 5px 12px 6px;
  font-size: 15px;
}

/* The kind of word, each in its own colour. */
.tag.type {
  --tint: var(--text-secondary);
  background: color-mix(in srgb, var(--tint) 12%, transparent);
  color: var(--tint);
}

.tag.type.noun {
  --tint: var(--masculine);
}

.tag.type.verb {
  --tint: var(--neuter);
}

.tag.type.pronoun {
  --tint: #7c4dbd;
}

.tag.type.preposition {
  --tint: var(--warning);
}

.tag.type.conjunction {
  --tint: #1e8c8a;
}

.tag.type.adverb {
  --tint: var(--feminine);
}

.tag.type.phrase {
  --tint: #4b5563;
}

/* The word, and at its side how well it is remembered. The card sits
   over the forms and the note: one column for what there is to know. */
.word-top,
.word-cols {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 270px;
  gap: 36px;
  align-items: start;
}

.word-head {
  display: flex;
  align-items: center;
  gap: 18px;
}

.word-head h2 {
  min-width: 0;
  /* As large as the room beside the card lets a word of usual length be. */
  font-size: clamp(44px, 6.6cqw, 60px);
  font-weight: 600;
  line-height: 1.05;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
  animation: rise 0.55s var(--ease) both;
}

/* A long word, die Entschuldigung, still on one line beside the card. */
.word-head h2.long {
  font-size: clamp(32px, 4.6cqw, 40px);
}

.word-head .say {
  width: 48px;
  height: 48px;
  animation: appear 0.5s 0.2s ease both;
}

.word-meaning {
  margin-top: 8px;
  font-size: 21px;
  color: var(--text-secondary);
  animation: rise 0.55s 0.06s var(--ease) both;
}

.word-detail > .note-line {
  margin-top: 14px;
}

/* How well it is known: five steps in the colour of the mark the word
   has in the index, what they mean in words, and the numbers behind it. */
.word-memory {
  padding: 18px 18px 8px;
  animation: rise 0.55s 0.12s var(--ease) both;
}

.word-memory .meter {
  display: flex;
}

.word-memory .meter i {
  flex: 1;
  width: auto;
}

.word-memory h3 {
  margin-top: 12px;
  font-size: 17px;
  font-weight: 600;
}

.word-memory dl {
  margin: 12px 0 0;
}

.word-memory dl > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  box-shadow: 0 -1px 0 var(--border);
  font-size: 15px;
}

.word-memory dt {
  color: var(--text-secondary);
}

.word-memory dd {
  margin: 0;
  font-weight: 600;
}

.word-memory dd.due {
  color: var(--warning);
}

.meter {
  --tint: var(--success);
  display: inline-flex;
  gap: 4px;
}

.meter.fading {
  --tint: var(--warning);
}

.meter.learning {
  --tint: var(--primary);
}

.meter i {
  position: relative;
  width: 40px;
  height: 6px;
  border-radius: 3px;
  background: var(--track);
  overflow: hidden;
}

.meter i.on::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--tint);
  transform-origin: left;
  animation: fill 0.5s 0.25s var(--ease) both;
}

.meter i:nth-child(2)::after { animation-delay: 0.34s; }
.meter i:nth-child(3)::after { animation-delay: 0.43s; }
.meter i:nth-child(4)::after { animation-delay: 0.52s; }
.meter i:nth-child(5)::after { animation-delay: 0.61s; }

/* The learner's sentences with the word, and beside them what there is
   to know about it. */
.word-cols {
  margin-top: 36px;
}

.used h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

.used-sentence {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  box-shadow: 0 1px 0 var(--border);
  animation: rise 0.55s 0.18s var(--ease) both;
}

.used-sentence + .used-sentence {
  animation-delay: 0.27s;
}

.used-sentence + .used-sentence + .used-sentence {
  animation-delay: 0.36s;
}

.used-sentence > div {
  flex: 1;
  min-width: 0;
}

.used-sentence .de {
  font-size: 24px;
  line-height: 1.25;
}

.used-sentence b {
  font-weight: 600;
  color: var(--primary);
}

.used-sentence small {
  display: block;
  margin-top: 4px;
  font-size: 15px;
  color: var(--text-secondary);
}

.used-sentence .say {
  width: 40px;
  height: 40px;
  background: none;
  box-shadow: 0 0 0 1px var(--border);
}

.used-sentence .say svg {
  width: 20px;
  height: 20px;
}

.used-none {
  padding: 16px 0;
  font-size: 15px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.word-side {
  display: grid;
  gap: 12px;
  align-content: start;
  animation: rise 0.55s 0.2s var(--ease) both;
}

.facts {
  padding: 16px 18px 12px;
}

.facts h3 {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* A verb's forms, each next to its person. */
.facts .forms {
  margin: 8px 0 0;
}

.facts .forms > div {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 5px 0;
  font-size: 14.5px;
}

.facts .forms dt {
  flex: none;
  width: 62px;
  color: var(--text-secondary);
}

.facts .forms dd {
  min-width: 0;
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.past {
  margin-top: 10px;
  padding: 12px 0 6px;
  box-shadow: 0 -1px 0 var(--border);
}

.past p {
  margin-top: 6px;
  font-size: 17px;
}

.past p span {
  color: var(--text-secondary);
}

.past b {
  font-weight: 600;
}

/* The learner's own note, tinted like the word's article. */
.own-note {
  --tint: var(--primary);
  display: block;
  width: 100%;
  padding: 13px 16px 14px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--tint) 7%, transparent);
  text-align: left;
  transition: transform 0.15s ease;
}

.own-note:active {
  transform: scale(0.99);
}

.own-note.masculine {
  --tint: var(--masculine);
}

.own-note.feminine {
  --tint: var(--feminine);
}

.own-note.neuter {
  --tint: var(--neuter);
}

.own-note-head {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  font-weight: 600;
  color: var(--tint);
}

.own-note-head span:first-child {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.own-note-head svg {
  width: 15px;
  height: 15px;
}

.own-note-text {
  display: block;
  margin-top: 4px;
  font-size: 16px;
  line-height: 1.45;
  white-space: pre-line;
}

.own-note-text.none {
  color: var(--text-secondary);
}

/* A page too narrow for both columns: the sentences, then the rest. */
@container (max-width: 720px) {
  .word-detail {
    padding: 32px 32px 64px;
  }

  .word-head h2 {
    font-size: 46px;
  }

  .word-meaning {
    font-size: 19px;
  }

  .word-top,
  .word-cols {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .word-cols {
    margin-top: 32px;
  }

  /* Its forms have the page's width: three across. */
  .facts .forms {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0 14px;
  }

  .used-sentence .de {
    font-size: 21px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .word-detail *,
  .word-detail *::after {
    animation: none;
  }
}

/* Beside an open word the dictionary is an index to it: a word is its
   German on one line, a kind of word its mark and count. */
@media (min-width: 1001px) {
  .words-page .words-bar {
    margin: 0;
    padding: var(--bar-top) 0 10px;
  }

  .words-page .search {
    height: 40px;
    border-radius: 12px;
  }

  .words-page .filters {
    gap: 4px;
    margin-top: 10px;
    padding: 0;
    background: none;
  }

  .words-page .filter {
    height: 30px;
    font-size: 13px;
  }

  .words-page .filter.on {
    background: var(--surface-sunken);
    box-shadow: none;
  }

  .words-page .filter span {
    display: none;
  }

  .words-page .filter small {
    opacity: 1;
  }

  /* 50px of search under the room above it, and 40px more of kinds. */
  .words-page .letter h2 {
    top: calc(var(--bar-top) + 50px);
    margin: 0;
    padding: 12px 10px 3px;
    font: 600 12px var(--sans);
    color: var(--text-faint);
  }

  .words-page .words-bar:has(.filters) ~ .letter h2 {
    top: calc(var(--bar-top) + 90px);
  }

  .words-page .dictionary {
    border-radius: 0;
    background: none;
    box-shadow: none;
    overflow: visible;
  }

  .words-page .dictionary li + li {
    box-shadow: none;
  }

  .words-page .dictionary a {
    gap: 10px;
    height: 34px;
    padding: 0 10px;
    border-radius: 9px;
    scroll-margin: 180px 0 16px;
  }

  .words-page .dictionary a:hover {
    background: var(--surface-sunken);
  }

  .words-page .dictionary a[aria-current] {
    background: var(--primary-soft);
  }

  .words-page .dictionary .mark {
    width: 8px;
    height: 8px;
  }

  .words-page .entry-word {
    flex-wrap: nowrap;
  }

  .words-page .entry-word .de {
    font-size: 16.5px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .words-page .dictionary a[aria-current] .de {
    font-weight: 600;
  }

  .words-page .entry-word small,
  .words-page .entry-word .tag,
  .words-page .entry-english,
  .words-page .entry .entry-note {
    display: none;
  }

  .words-page .empty {
    padding: 60px 10px;
  }
}

/* Writing the note. */

.well.note {
  display: block;
  height: 160px;
  margin-top: 14px;
  padding: 13px 16px;
  resize: none;
  font-size: 17px;
  line-height: 1.45;
}

/* No room for both: the list is the page, and a word opened takes it. */
@media (max-width: 1000px) {
  .page.words-page {
    padding: 32px 40px 64px 34px;
  }

  .page.words-page:not(.named):has(.words-bar) {
    padding-top: 0;
  }

  .word-pane {
    position: static;
    height: auto;
    overflow: visible;
    background: none;
    box-shadow: none;
  }

  /* The page has its own room around it. */
  .word-detail {
    max-width: 760px;
    margin: 0;
    padding: 0;
  }

  .word-pane .card {
    background: var(--surface-raised);
    box-shadow: 0 0 0 1px var(--border);
  }

  .words-page:not(.named) .word-pane,
  .page.words-page.named .page-main {
    display: none;
  }

  /* No word is open beside the list. */
  .dictionary a[aria-current] {
    background: none;
  }

  .back {
    display: inline-flex;
  }
}

@media (max-width: 700px) {
  .page.words-page {
    --bar-top: 20px;
    padding: 20px 20px 110px;
  }

  /* Four kinds in a phone's width: each as wide as its name needs. */
  .filter {
    flex: 1 1 auto;
    gap: 4px;
    padding: 0 4px;
    font-size: 12.5px;
  }
}

/* ---- Basics: sound boards, and over each a stage for the key pressed
   last ---- */

.page.basics-page {
  max-width: 1000px;
}

.tabs {
  display: flex;
  margin: 0 0 14px;
  padding: 3px;
  border-radius: 12px;
  background: var(--surface-sunken);
  overflow-x: auto;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tabs a {
  flex: 1;
  min-width: 96px;
  height: 34px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 34px;
  text-align: center;
  white-space: nowrap;
  color: var(--text-secondary);
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.tabs a.on {
  background: var(--surface-raised);
  box-shadow: 0 1px 2px rgb(24 34 56 / 0.12);
  color: var(--text);
}

.keys {
  display: grid;
  gap: 9px;
}

.keys.letters {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

/* A flat key: it dims while pressed and stays cobalt once it is the one
   pressed last. */
.key {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  min-height: 64px;
  padding: 6px 4px;
  border-radius: 13px;
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
  transition:
    background 0.15s ease,
    color 0.15s ease,
    opacity 0.12s ease;
}

.key:active {
  opacity: 0.7;
}

.key .de {
  font-size: 24px;
  font-weight: 600;
  line-height: 1.15;
}

.key small {
  max-width: 100%;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key.lit {
  background: var(--primary);
  box-shadow: none;
  color: var(--on-primary);
}

.key.lit small {
  color: inherit;
  opacity: 0.8;
}

/* A key with a colour on it is ringed, as the colour would be lost on cobalt. */
.key.ring.lit {
  background: var(--surface-raised);
  box-shadow: 0 0 0 2px var(--primary);
  color: inherit;
}

.key.ring.lit small {
  color: var(--text-secondary);
  opacity: 1;
}

.dot {
  flex: none;
  display: block;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
}

.key .dot {
  position: absolute;
  top: 7px;
  right: 7px;
}

.key.lit .dot {
  background: var(--on-primary);
}

.board-note {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 14px 2px 0;
  font-size: 14px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.board-note .dot {
  position: relative;
  top: -2px;
}

/* The spellings that sound new, each a key. */
.keys.spellings {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* The numbers: a place's keys under its name. */
.basics-page .group {
  margin: 16px 2px 8px;
  font-size: 14px;
}

.basics-page .place:first-of-type .group {
  margin-top: 4px;
}

.keys.digits {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.digits .key {
  min-height: 50px;
}

.digits .key .de {
  font-size: 20px;
  font-variant-numeric: lining-nums;
}

.keys.colours {
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
}

.colours .key {
  gap: 4px;
  padding: 12px 4px;
}

.colours .key .de {
  font-size: 20px;
}

/* A colour, outlined so white shows on white. */
.swatch {
  flex: none;
  width: 26px;
  height: 26px;
}

.swatch circle,
.swatch rect {
  stroke: rgb(24 34 56 / 0.12);
}

/* The days, the weekend a little apart and today marked. */
.keys.days {
  grid-template-columns: 1fr;
  max-width: 520px;
}

.days .key {
  flex-direction: row;
  align-items: baseline;
  justify-content: flex-start;
  gap: 12px;
  min-height: 0;
  padding: 12px 14px;
}

.days .key b {
  width: 28px;
  font-size: 17px;
  font-weight: 600;
  text-align: left;
  color: var(--primary);
}

.days .key span {
  font-size: 20px;
}

.days .key small {
  font-size: 14px;
}

.days .key em {
  margin-left: auto;
  font-size: 13.5px;
  font-style: normal;
  font-weight: 600;
  color: var(--primary);
}

.days .key.lit b,
.days .key.lit em {
  color: inherit;
}

.days .key.apart {
  margin-top: 8px;
}

/* The stage over a board: the key pressed last drawn large, what it says,
   more about it, and the speaker to hear it again. The same place and
   shape on every topic. Named for the key, as a lesson is a .stage too. */
.pressed {
  display: grid;
  grid-template-columns: minmax(150px, auto) minmax(0, 1fr) auto;
  align-items: center;
  gap: 30px;
  min-height: 176px;
  margin: 0 0 16px;
  padding: 24px 30px;
  border-radius: 20px;
}

/* What a key puts there comes up into place. */
.pressed[data-now] > * {
  animation: rise 0.35s var(--ease) both;
}

.pressed-mark {
  font-size: 92px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--primary);
}

/* A spelling of more than a letter or two: eu · äu. */
.pressed-mark.long {
  font-size: 60px;
}

svg.pressed-mark {
  justify-self: center;
  width: 96px;
  height: 96px;
}

.pressed-text {
  min-width: 0;
}

.pressed-text h2 {
  font: 600 26px/1.2 var(--serif);
}

.pressed-text h2 span {
  font-weight: 400;
  color: var(--text-secondary);
}

.pressed-text > p {
  max-width: 540px;
  margin-top: 6px;
  font-size: 16.5px;
  line-height: 1.45;
  color: var(--text-secondary);
}

.pressed-text > p > .de {
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
}

/* Words to hear a spelling in, and a colour's light and dark. */
.pressed-text > .pressed-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.pressed-word,
.shade {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  transition: opacity 0.12s ease;
}

.pressed-word:active,
.shade:active {
  opacity: 0.7;
}

.pressed-word b {
  font-size: 18px;
  font-weight: 600;
}

.pressed-word small {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.pressed-word svg {
  width: 18px;
  height: 18px;
  margin-left: 2px;
  color: var(--primary);
}

.shade {
  padding-left: 9px;
  font-size: 17px;
}

.shade .swatch {
  width: 18px;
  height: 18px;
}

/* The number built: its digits, its word in pieces, and the rule. */
.number .pressed-mark {
  color: var(--text);
  font-variant-numeric: lining-nums tabular-nums;
}

.number .new {
  color: var(--primary);
}

.number span {
  transition: color 0.3s ease;
}

.parts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

/* Each piece of the word a block, with what it means under it. */
.parts span {
  display: grid;
  justify-items: center;
  gap: 1px;
  padding: 7px 12px 6px;
  border-radius: 12px;
  background: var(--surface);
  animation: rise 0.3s var(--ease) both;
}

.parts b {
  font-size: 26px;
  font-weight: 600;
  line-height: 1.15;
}

.parts small {
  font-size: 12.5px;
  color: var(--text-secondary);
}

/* Kept when empty, so the display doesn't jump as rules come and go. */
.pressed-text > .rule {
  min-height: 24px;
  margin-top: 8px;
}

/* Under the board: what to know about it, and its round of practice. */
.board-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  margin-top: 18px;
}

.board-foot .board-note {
  margin: 0 2px;
}

.board-foot .button.practise {
  flex: none;
  width: auto;
  min-height: 44px;
  margin: 0;
  padding: 0 20px;
  border-radius: 13px;
  font-size: 15px;
}

/* Room for the board to be one screen: the alphabet in three rows, a place
   of the numbers in one, the week in a row. */
@media (min-width: 1001px) {
  .basics-page .keys {
    gap: 8px;
  }

  .basics-page .keys.letters {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }

  .basics-page .letters .key {
    min-height: 76px;
  }

  .basics-page .letters .key .de {
    font-size: 26px;
  }

  .basics-page .keys.spellings {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .basics-page .spellings .key {
    min-height: 72px;
  }

  .basics-page .place {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    align-items: center;
    margin-bottom: 8px;
  }

  .basics-page .place .group {
    margin: 0;
  }

  .basics-page .keys.digits {
    grid-template-columns: repeat(10, minmax(0, 1fr));
  }

  .basics-page .digits .key {
    min-height: 56px;
  }

  .basics-page .keys.colours {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .basics-page .colours .key {
    min-height: 104px;
  }

  .basics-page .colours .swatch {
    width: 30px;
    height: 30px;
  }

  .basics-page .keys.days {
    grid-template-columns: repeat(7, minmax(0, 1fr));
    max-width: none;
  }

  .basics-page .days .key {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 112px;
    padding: 6px 4px;
  }

  .basics-page .days .key b {
    width: auto;
    font-size: 15px;
  }

  .basics-page .days .key small {
    font-size: 12.5px;
  }

  .basics-page .days .key em {
    position: absolute;
    top: 9px;
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .basics-page .days .key.apart {
    margin: 0 0 0 14px;
  }
}

/* No room for a large stage: it sits over the board, small, and stays in
   view as the keys scroll under it. */
@media (max-width: 1000px) {
  .pressed {
    position: sticky;
    top: 8px;
    z-index: 2;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 12px;
    min-height: 0;
    margin-bottom: 12px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    box-shadow:
      0 0 0 1px var(--border),
      0 12px 22px -14px rgb(24 34 56 / 0.35);
  }

  .pressed-mark {
    min-width: 36px;
    font-size: 34px;
  }

  .pressed-mark.long {
    font-size: 24px;
  }

  svg.pressed-mark {
    width: 36px;
    height: 36px;
  }

  .pressed-text h2 {
    font-size: 17px;
  }

  .pressed-text > p {
    margin-top: 1px;
    font-size: 14px;
  }

  .pressed-text > p > .de {
    font-size: 16px;
  }

  .pressed-text > .pressed-row {
    gap: 6px;
    margin-top: 6px;
  }

  .pressed-word,
  .shade {
    min-height: 32px;
    padding: 0 9px;
    font-size: 15px;
  }

  .pressed-word b {
    font-size: 16px;
  }

  .pressed .say {
    width: 40px;
    height: 40px;
  }

  .number .pressed-mark {
    font-size: 44px;
  }

  .parts span {
    padding: 4px 8px;
  }

  .parts b {
    font-size: 20px;
  }

  .pressed-text > .rule {
    min-height: 20px;
    margin-top: 4px;
  }

  .board-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .board-foot .button.practise {
    width: 100%;
    min-height: 52px;
  }
}

@media (max-width: 700px) {
  .keys.letters {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  /* A phone's width: the number leaves room for its word. */
  .number .pressed-mark {
    font-size: 34px;
  }

  /* Five topics just fit a phone, pressed together across its width; on
     one narrower still the row scrolls. */
  .tabs a {
    flex: 1 0 auto;
    min-width: 0;
    padding: 0 6px;
    font-size: 13.5px;
  }
}

/* ---- A round of practice in Basics: a name to spell, the numbers ---- */

.button.practise {
  max-width: 520px;
  margin-top: 22px;
}

.quiz {
  text-align: center;
}

.quiz header {
  margin-bottom: 26px;
}

.quiz-score,
.quiz-hint {
  font-size: 17px;
  color: var(--text-secondary);
}

.quiz-play {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin: 22px 0;
}

.play-big.solid {
  width: 68px;
  height: 68px;
  background: var(--primary);
  color: var(--on-primary);
  transition: transform 0.15s ease;
}

.play-big.solid:active {
  transform: scale(0.95);
}

.play-big.solid svg {
  width: 30px;
  height: 30px;
}

.play-big.solid.large {
  width: 104px;
  height: 104px;
}

.play-big.solid.large svg {
  width: 44px;
  height: 44px;
}

.pill {
  min-height: 32px;
  padding: 0 13px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
}

/* A slot for each letter of the name: the one being said or next to fill
   underlined in cobalt, a finished name green with each letter's name. */
.slots {
  display: flex;
  justify-content: center;
  gap: 7px;
  min-height: 78px;
}

.slots span {
  display: grid;
  justify-items: center;
  gap: 4px;
  width: 40px;
}

.slots b {
  display: block;
  width: 100%;
  height: 44px;
  padding-bottom: 2px;
  border-bottom: 2.5px solid var(--track);
  font-size: 32px;
  font-weight: 600;
  line-height: 42px;
  transition:
    border-color 0.2s ease,
    color 0.2s ease;
}

.slots small {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.slots .next b {
  border-color: var(--primary);
}

.slots .missed b {
  border-color: var(--error);
  color: var(--error);
}

.slots.done b {
  border-color: var(--success);
  color: var(--success);
}

.slots.done small {
  opacity: 1;
}

/* The whole name shakes once for a wrong key. */
.slots.nudge {
  animation: nudge 0.35s ease;
}

@keyframes nudge {
  25% {
    transform: translateX(5px);
  }

  75% {
    transform: translateX(-5px);
  }
}

.quiz-verdict {
  margin: 12px 0 18px;
  font-size: 17px;
  font-weight: 600;
}

.quiz-verdict.right {
  color: var(--success);
}

.quiz-verdict.wrong {
  color: var(--error);
}

/* Kept when it has nothing to say, so the keys don't move. */
.quiz-verdict[data-right] {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.quiz-verdict[data-right].shown {
  opacity: 1;
}

.keys.spell {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 7px;
  transition: opacity 0.3s ease;
}

.spell .key {
  min-height: 46px;
}

.spell .key .de {
  font-size: 20px;
}

.spell.over {
  opacity: 0.3;
}

.key:disabled {
  cursor: default;
}

/* The wrong key for the letter asked, red until it clears. */
.key.missed {
  background: rgb(201 58 58 / 0.14);
  box-shadow: 0 0 0 1px rgb(201 58 58 / 0.5);
  color: var(--error);
}

/* A number heard, to pick from four. */
.options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.option {
  min-height: 68px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
  font-size: 30px;
  font-weight: 600;
  font-variant-numeric: lining-nums;
  transition:
    background 0.2s ease,
    color 0.2s ease,
    transform 0.15s ease;
}

.option:active {
  transform: scale(0.98);
}

.option:disabled {
  cursor: default;
}

.option.right {
  background: var(--success);
  box-shadow: none;
  color: #fff;
}

.option.wrong {
  background: var(--error);
  box-shadow: none;
  color: #fff;
}

.option.dim {
  color: var(--text-secondary);
}

.quiz-told {
  animation: rise 0.4s var(--ease) both;
}

.quiz-told .quiz-verdict {
  margin: 20px 0 6px;
}

.quiz-told .de {
  font-size: 24px;
}

.quiz-number {
  margin-top: 22px;
  font-size: 64px;
  font-weight: 600;
  line-height: 1.1;
  font-variant-numeric: lining-nums;
}

/* The verdict's icon and words sit in the title's row. */
.result-title [data-was-right],
.result-title [data-was-wrong] {
  display: contents;
}

.quiz [data-produce] .answer {
  margin-top: 22px;
}

.quiz [data-produce] .item-error,
.quiz [data-result] {
  text-align: left;
}


/* ---- A finished unit, on the way to the next ---- */

.unit-done {
  padding-top: 40px;
}

.done-mark {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--success);
  transition: opacity 0.3s ease;
}

.done-mark .icon {
  width: 18px;
  height: 18px;
}

.landing-pending:not(.ticked) .done-mark {
  opacity: 0;
}

.ticked .done-mark .icon {
  animation: tick 0.5s var(--ease) both;
}

@keyframes tick {
  from {
    transform: scale(0.5);
  }
  60% {
    transform: scale(1.15);
  }
}

/* The words and sentences, landing one by one. */
.landing {
  margin-top: 22px;
  transform-origin: top center;
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.landing.folding {
  opacity: 0;
  transform: translateY(-40px) scale(0.92);
}

.landing-group {
  transition: opacity 0.3s ease;
}

.landing-group + .landing-group {
  margin-top: 36px;
}

.landing-pending .landing-group:not(.started) {
  opacity: 0;
}

.landing-count {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font: 500 30px/1.1 var(--serif);
}

.landing-count b {
  font-size: 64px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.landing-after {
  margin-top: 6px;
  font-size: 17px;
  color: var(--text-secondary);
  transition: opacity 0.3s ease;
}

.landing-pending [data-after]:not(.shown) {
  opacity: 0;
}

[data-lands] > li {
  transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.landing-pending [data-lands] > li:not(.landed) {
  opacity: 0;
  transform: translateY(-16px) scale(0.9);
}

.word-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 22px;
  padding: 0;
  list-style: none;
}

.word-chips li {
  padding: 6px 11px;
  border-radius: 11px;
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
  font-size: 17px;
  font-weight: 500;
}

.unit-sentences {
  margin-top: 14px;
  padding: 0;
  list-style: none;
}

.unit-sentences li {
  padding: 10px 0;
  border-top: 1px solid var(--border);
}

.unit-sentences .de {
  font-size: 20px;
  font-weight: 500;
}

/* The learner's own details, as on the lesson page. */
.unit-sentences .own {
  color: var(--primary);
}

.unit-sentences small {
  display: block;
  margin-top: 2px;
  font-size: 14.5px;
  color: var(--text-secondary);
}

/* Folded: the finished unit, the gem it earned, the next unit. */
.next-up {
  display: grid;
  gap: 24px;
  margin-top: 22px;
}

.next-up > * {
  animation: rise 0.6s var(--ease) var(--delay, 0ms) both;
}

.next-up > .next-unit {
  animation-name: slide-in;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
}

/* A small stack of cards, its words and sentences put away in it. */
.finished-unit {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding: 14px 16px;
  box-shadow:
    0 0 0 1px var(--border),
    0 7px 0 -4px var(--surface-raised),
    0 7px 0 -3px rgb(24 34 56 / 0.09),
    0 14px 0 -9px #fbfcfe,
    0 14px 0 -8px rgb(24 34 56 / 0.06);
}

.finished-unit .icon {
  flex: none;
  width: 28px;
  height: 28px;
  color: var(--success);
}

.finished-unit .de {
  font-size: 18px;
  font-weight: 500;
}

.finished-unit small {
  font-size: 14px;
  color: var(--text-secondary);
}

/* The gem, on a dark card lit in its own colour: it pops in and floats,
   and a sheen crosses the card once. */
.gem-card {
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px;
  border-radius: 22px;
  background:
    radial-gradient(230px circle at 12% 50%, var(--glow), transparent 70%),
    radial-gradient(200px circle at 100% 0%, rgb(52 84 209 / 0.25), transparent 70%),
    #141a2b;
  box-shadow: 0 12px 24px -10px rgb(20 26 43 / 0.45), inset 0 0 0 1px rgb(255 255 255 / 0.08);
}

.gem-card::after {
  content: "";
  position: absolute;
  top: -30%;
  bottom: -30%;
  left: -30%;
  width: 70px;
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 0.12), transparent);
  transform: rotate(18deg);
  animation: sheen 1.4s ease calc(var(--delay, 0ms) + 500ms) both;
  pointer-events: none;
}

@keyframes sheen {
  from {
    left: -30%;
  }
  to {
    left: 120%;
  }
}

.gem-stone {
  flex: none;
  margin: 6px;
  animation:
    pop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) calc(var(--delay, 0ms) + 250ms) both,
    float 2.1s ease-in-out calc(var(--delay, 0ms) + 950ms) infinite alternate;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: scale(0.4) rotate(-30deg);
  }
}

@keyframes float {
  from {
    transform: translateY(3px);
  }
  to {
    transform: translateY(-3px);
  }
}

.gem-card small {
  display: block;
  font-size: 13.5px;
  color: rgb(255 255 255 / 0.6);
}

.gem-card .gem-new {
  font-weight: 600;
  color: rgb(255 255 255 / 0.78);
}

.gem-card .de {
  font: 500 26px/1.25 var(--serif);
  color: #fff;
}

/* The articles' colours as they read on the dark card. */
.gem-card span.masculine {
  color: #78b8f5;
}

.gem-card span.feminine {
  color: #f28ab8;
}

.gem-card span.neuter {
  color: #7acf8e;
}

/* The next unit: its title, what it's about and what it teaches. */
.next-unit {
  padding: 20px 20px 6px;
}

.next-unit:not(:has(ol)) {
  padding-bottom: 20px;
}

.next-kicker {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary);
}

.next-unit h2 {
  margin-top: 2px;
  font: 600 30px/1.15 var(--serif);
}

.next-summary {
  margin-top: 4px;
  font-size: 16.5px;
  color: var(--text-secondary);
}

.next-unit ol {
  margin-top: 16px;
  padding: 0;
  list-style: none;
  counter-reset: goal;
}

.next-unit li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  font-size: 16.5px;
  counter-increment: goal;
}

.next-unit li::before {
  content: counter(goal);
  flex: none;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px rgb(24 34 56 / 0.16);
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Continue, then the ways on, over the bottom of the page. */
.done-foot {
  position: sticky;
  bottom: 0;
  padding: 12px 0 18px;
  background: linear-gradient(transparent, var(--surface) 30%);
}

.landing-pending [data-continue] {
  visibility: hidden;
}

[data-leave] {
  animation: rise 0.5s var(--ease) var(--delay, 0ms) both;
}

@media (prefers-reduced-motion: reduce) {
  .unit-done *,
  .unit-done *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---- Logging out: a question with nothing under it ---- */

/* The sheet asks in its title alone, so the button keeps clear of it. */
.sheet .sheet-title + .button {
  margin-top: 18px;
}

/* ---- Pro mark ---- */

/* A Pro learner carries the mark on the course card: the word in the serif
   on a small chip of the plan card's foil. The foil drifts slowly, as it
   does in the app, and holds still for reduced motion. */
.pro-mark {
  flex: none;
  padding: 5px 11px;
  border-radius: 999px;
  background: linear-gradient(115deg, #f9c6e8, #bfe6ff 28%, #d9c7ff 52%, #c4f5e2 76%, #ffe9b8) 0 50% / 220% 100%;
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.7),
    0 2px 8px rgb(24 34 56 / 0.12);
  font: 500 14px/1.2 var(--serif);
  color: var(--text);
  animation: pro-drift 7s ease-in-out infinite alternate;
}

@keyframes pro-drift {
  to {
    background-position: 100% 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pro-mark {
    animation: none;
  }
}

/* ---- The optional unit's examples, typed ---- */

/* Every example is laid in the same place, unseen, so the card keeps the
   height of the longest while the shown one is typed over them. */
.your-sentence.typing {
  display: grid;
}

.typing > .typed-ghost,
.typing > .typed-shown {
  grid-area: 1 / 1;
}

.typed-ghost {
  visibility: hidden;
}

.your-sentence .caret {
  font-weight: 300;
  color: var(--primary);
}

/* Off, the caret keeps its place, so nothing beside it moves. */
.your-sentence .caret.off {
  color: transparent;
}

/* ---- All done: the course finished, with a lesson to review ---- */

/* Above the rail, where the lesson to do next would be, as on iOS. */
.all-done {
  margin-bottom: 28px;
  padding: 22px 24px 24px;
  animation: rise 0.6s var(--ease) both;
}

.all-done h2 {
  font: 600 26px/1.15 var(--serif);
  letter-spacing: -0.01em;
}

.all-done p {
  margin-top: 6px;
  font-size: 16px;
  color: var(--text-secondary);
}

.all-done .button {
  width: auto;
  display: inline-flex;
  min-height: 48px;
  margin-top: 18px;
  padding: 0 24px;
  font-size: 16px;
}

@media (max-width: 560px) {
  .all-done {
    padding: 20px;
  }

  .all-done .button {
    display: flex;
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .all-done {
    animation: none;
  }
}

/* ---- Learn: skipped units ---- */

/* A unit the learner passed by: ringed in grey rather than cobalt, as it
   isn't being worked on, but in full colour, as it opens any time. */
.unit.skipped .unit-number {
  background: var(--surface-raised);
  color: var(--text);
  box-shadow: inset 0 0 0 2.5px var(--track);
}

/* Its lessons can be opened, so they read as reached, not locked: an empty
   cobalt ring on the drawn-in rail. */
.lesson.skipped .lesson-dot {
  box-shadow: inset 0 0 0 2px var(--primary);
}

.lesson.skipped .lesson-title {
  color: var(--text);
}

.lesson.skipped small {
  color: var(--text-secondary);
}

/* ---- Best round on the current lesson ---- */
/* How close the best practice round came to finishing the lesson, as in the
   iOS app: the bar filled to that round, a notch at the pass mark with its
   label above, and the stretch still to go hatched. The hatching is the
   track's own background up to the mark, so the fill covers what was
   reached and no width has to be set inline. */
.pass-line {
  position: relative;
  height: 36px;
}

.pass-mark {
  position: absolute;
  top: 0;
  left: 80%;
  transform: translateX(-50%);
  font: 600 13px/16px var(--sans);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.pass-line::after {
  content: "";
  position: absolute;
  top: 20px;
  left: calc(80% - 1px);
  width: 2px;
  height: 16px;
  border-radius: 1px;
  background: var(--text);
}

.pass-line progress {
  appearance: none;
  position: absolute;
  top: 25px;
  left: 0;
  display: block;
  width: 100%;
  height: 6px;
  margin: 0;
  border: 0;
  border-radius: 3px;
  overflow: hidden;
  background:
    repeating-linear-gradient(90deg, rgb(52 84 209 / 0.28) 0 3px, transparent 3px 6px) 0 0 / 80% 100% no-repeat,
    var(--surface-sunken);
}

.pass-line progress::-webkit-progress-bar {
  background: transparent;
}

.pass-line progress::-webkit-progress-value {
  border-radius: 3px;
  background: var(--primary);
  transform-origin: left;
  animation: fill 1.1s var(--ease) 0.3s both;
}

.pass-line progress::-moz-progress-bar {
  border-radius: 3px;
  background: var(--primary);
  transform-origin: left;
  animation: fill 1.1s var(--ease) 0.3s both;
}

.pass-note {
  margin: 12px 0 18px;
  font-size: 14px;
  color: var(--text-secondary);
}

.pass-note b {
  font-weight: 600;
  color: var(--text);
}

/* Each browser drops a rule naming the other's pseudo-element, so the two
   are kept apart. */
@media (prefers-reduced-motion: reduce) {
  .pass-line progress::-webkit-progress-value {
    animation: none;
  }

  .pass-line progress::-moz-progress-bar {
    animation: none;
  }
}

/* ---- A slot that collects: five picked, the rest wait ---- */

.chip:has(input:disabled) {
  opacity: 0.4;
  cursor: default;
}

.sheet .well:disabled {
  opacity: 0.5;
}

/* ---- Learn: the earlier units, folded ---- */

/* The units gone past fold into one card above the rail, as in the iOS
   app: the words they taught as one big number, and the lessons and units
   they came from. It opens to list them on a stretch of rail of their own,
   so the unit being worked on stays the first thing on the page. */
.earlier-card {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface-raised);
  box-shadow: 0 0 0 1px var(--border);
}

.earlier-number {
  font: 600 38px/1 var(--serif);
  color: var(--primary);
}

.earlier-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.earlier-title {
  font-size: 16px;
  font-weight: 600;
}

.earlier-text small {
  font-size: 13.5px;
  color: var(--text-secondary);
}

.earlier-card .icon-chevron {
  width: 16px;
  height: 16px;
}

/* A unit in the card turns its own chevron only when it is open itself. */
.earlier-units details:not([open]) > summary .icon-chevron {
  transform: none;
}

.earlier > details[open] > .earlier-units {
  animation: rise 0.3s var(--ease) both;
}

/* The card sits apart from the rail: the rail starts at the first unit it
   opens to, and with the card shut, at the unit after it. */
.rail > .earlier .earlier-units > li:not(:first-child) > details > summary::before {
  top: 0;
}

.rail > .earlier:has(> details:not([open])) + li > details > summary::before {
  top: 50%;
}

/* With the course done the card is the last thing on the rail, which runs
   on through every unit in it but the last. */
.rail > .earlier .earlier-units > li:not(:last-child) > details > summary::before,
.rail > .earlier .earlier-units > li:not(:last-child) .lessons > li:last-child::before {
  bottom: 0;
}

@media (prefers-reduced-motion: reduce) {
  .earlier > details[open] > .earlier-units {
    animation: none;
  }
}

/* ---- Audio on its way: a spinner for a speaker's icon ---- */

/* While a clip asked for loads, which for one the server has to voice first
   can take a few seconds, its buttons' icon turns into a ring that spins,
   in the icon's own colour and place, so nothing moves. speech.js waits a
   beat before showing it, so a clip already loaded never flashes it. */
.loading-audio svg.icon {
  box-sizing: border-box;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: audio-spin 0.8s linear infinite, audio-spinner-in 0.2s ease;
}

.loading-audio svg.icon > * {
  visibility: hidden;
}

@keyframes audio-spin {
  from {
    transform: scale(0.8) rotate(0turn);
  }
  to {
    transform: scale(0.8) rotate(1turn);
  }
}

@keyframes audio-spinner-in {
  from {
    opacity: 0;
  }
}

/* ---- Words about you: the question on Learn just after signing in ---- */

/* Each part rises in turn as the sheet opens, as in the app. */
.about-you[open] form > * {
  animation: rise 0.45s var(--ease) both;
}

.about-you[open] .sheet-title { animation-delay: 50ms; }
.about-you[open] .sheet-hint { animation-delay: 100ms; }
.about-you[open] .about-you-choices { animation-delay: 150ms; }
.about-you[open] form > button { animation-delay: 200ms; }

.about-you-choices {
  display: grid;
  gap: 10px;
  margin: 18px 0 20px;
  padding: 0;
  border: 0;
}

/* A choice in a well: a small label over its sentence. Picked, the well
   lifts to white with a blue ring and its round check fills in. */
.about-you-choice {
  position: relative;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px 15px;
  border-radius: var(--radius-md);
  background: var(--surface-sunken);
  cursor: pointer;
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.15s ease;
}

.about-you-choice:active {
  transform: scale(0.98);
}

.about-you-choice:has(input:checked) {
  background: var(--surface-raised);
  box-shadow:
    inset 0 0 0 1.5px var(--primary),
    0 0 0 4px rgb(52 84 209 / 0.12);
}

.about-you-choice:has(input:focus-visible) {
  outline: 2px solid var(--primary);
  outline-offset: 6px;
}

/* The radio itself is the whole well; the check beside it shows it. */
.about-you-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.about-you-text {
  display: grid;
  flex: 1;
  gap: 4px;
}

.about-you-text small {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s ease;
}

.about-you-choice:has(input:checked) small {
  color: var(--primary);
}

.about-you-text .de {
  font-size: 21px;
  line-height: 1.3;
  color: var(--text);
}

.about-you-text b {
  font-weight: inherit;
  color: var(--primary);
}

.about-you-check {
  display: grid;
  place-items: center;
  flex: none;
  width: 22px;
  height: 22px;
  margin-top: 2px;
  border-radius: 50%;
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 1.5px rgb(24 34 56 / 0.2);
  color: var(--on-primary);
  transition:
    background 0.2s ease,
    box-shadow 0.2s ease;
}

.about-you-check .icon {
  width: 13px;
  height: 13px;
  opacity: 0;
  transform: scale(0.5);
  transition:
    opacity 0.2s ease,
    transform 0.2s var(--ease);
}

.about-you-choice:has(input:checked) .about-you-check {
  background: var(--primary);
  box-shadow: none;
}

.about-you-choice:has(input:checked) .about-you-check .icon {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  .about-you[open] form > *,
  .about-you-choice,
  .about-you-check,
  .about-you-check .icon {
    animation: none;
    transition: none;
  }
}

/* ---- Words: the letters down the side of the list ---- */

/* The letters hang from the bar over the list, which keeps them in view,
   and sit in the room just beside the list, centred in the window below
   the bar as in the app. A short window squeezes them rather than cutting
   any off. */
.letter-index {
  position: absolute;
  top: calc(50% + 50vh);
  top: calc(50% + 50dvh);
  right: -14px;
  display: flex;
  flex-direction: column;
  width: 16px;
  max-height: calc(100vh - 100% - 16px);
  max-height: calc(100dvh - 100% - 16px);
  transform: translateY(-50%);
  /* A finger slides along the letters rather than scrolling the page. */
  touch-action: none;
}

.letter-index a {
  flex: 0 1 17px;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  color: var(--primary);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

/* A letter jumped to lands where its heading stays, under the bar: 58px
   of search under the room above it, and 50px more of kinds, less the
   8px above the heading. */
.letter {
  scroll-margin-top: calc(var(--bar-top) + 50px);
}

.words-bar:has(.filters) ~ .letter {
  scroll-margin-top: calc(var(--bar-top) + 100px);
}

/* Beside an open word the list is slim: the letters take the edge by the
   word, and the words make room for them. */
@media (min-width: 1001px) {
  .words-page .letter-index {
    right: -10px;
  }

  .words-page .words-bar:has(.letter-index:not([hidden])) ~ .letter .dictionary {
    margin-right: 8px;
  }

  .words-page .letter {
    scroll-margin-top: calc(var(--bar-top) + 50px);
  }

  .words-page .words-bar:has(.filters) ~ .letter {
    scroll-margin-top: calc(var(--bar-top) + 90px);
  }
}

/* A phone: the letters are centred between the bar and the tab bar, and
   keep clear of it. */
@media (max-width: 700px) {
  .letter-index {
    top: calc(50% + 50vh - 45px);
    top: calc(50% + 50dvh - 45px);
    max-height: calc(100vh - 100% - 106px);
    max-height: calc(100dvh - 100% - 106px);
  }
}

/* ---- Reporting a problem with an exercise ---- */

/* A quiet flag at the end of an exercise's heading, as in the app. */
.report-flag {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -4px -6px -4px auto;
  border-radius: 10px;
  color: var(--text-secondary);
  transition: color 0.15s ease, background 0.15s ease;
}

.report-flag:hover {
  color: var(--text);
  background: var(--surface-sunken);
}

.report-flag .icon {
  width: 18px;
  height: 18px;
}

.report-sheet .chips {
  margin: 16px 0 0;
}

/* One line to start with, growing with the note (report.js). */
.report-sheet .well.note {
  height: auto;
  min-height: 52px;
  max-height: 132px;
  overflow-y: auto;
}

.report-sheet .sheet-hint.bad {
  margin-bottom: 0;
}

.report-sheet .button {
  margin-top: 20px;
}

/* Sent: a ring draws in around a check and then drains, a quiet count down
   to the sheet closing, with the thanks under it in the middle of where
   the form was. */
.report-thanks {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-align: center;
}

.report-thanks h2 {
  margin-top: 10px;
  font: 600 21px/1.25 var(--serif);
}

.report-thanks h2 em {
  font-style: normal;
  color: var(--primary);
}

.report-thanks p {
  font-size: 14.5px;
  color: var(--text-secondary);
}

.report-ring circle {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
}

.report-ring circle:first-child {
  opacity: 0.12;
}

.report-ring .drawn {
  stroke-linecap: round;
  stroke-dasharray: 1 1;
  transform: rotate(-90deg);
  transform-origin: center;
  animation: report-ring 2.7s ease-in-out both;
}

.report-ring path {
  fill: none;
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  transform-box: fill-box;
  transform-origin: center;
  animation: report-tick 0.5s var(--ease) 0.55s both;
}

/* Drawn from 0.15s to 0.7s, held, then drained until just before the
   sheet closes at 2.9s. */
@keyframes report-ring {
  0%,
  5.6% {
    stroke-dashoffset: 1;
  }
  25.9%,
  40.7% {
    stroke-dashoffset: 0;
  }
  100% {
    stroke-dashoffset: -1;
  }
}

@keyframes report-tick {
  from {
    opacity: 0;
    transform: scale(0.5);
  }
  60% {
    transform: scale(1.12);
  }
}

@media (prefers-reduced-motion: reduce) {
  .report-ring .drawn,
  .report-ring path {
    animation: none;
  }
}

/* ---- Skip ahead: "Already know it?" on a new lesson ---- */

/* The sheet holds a field, then a result: on a short window it scrolls
   inside rather than running off the screen. */
.skip-sheet {
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
}

.skip-sheet .prompt {
  margin-top: 4px;
}

.skip-sheet .answer {
  margin-top: 14px;
}

.skip-foot {
  margin-top: 18px;
}

/* An answer shown beside the German without being checked carries no
   colour of a grade. */
.checked.shown {
  box-shadow: 0 0 0 1.5px var(--track);
}

/* What comes next, under the German. */
.skip-result .reason {
  color: var(--text-secondary);
}

/* ---- A spoken answer heard again beside the native speaker ---- */

/* The learner's row over the native one, then Compare, as in the iOS
   app. A row plays when tapped: its bars fill as it goes, and the waves of
   the speaker at its end run. The learner's voice is in ink. */
.voice-rows {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  margin-top: 12px;
}

/* In a sentence's card the rows take the place of the native voice alone. */
.voices .voice-rows {
  margin-top: 0;
  animation: appear 0.3s ease both;
}

.voice-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 600;
  text-align: left;
}

.voice-row > span:first-child {
  flex: none;
  width: 52px;
}

.voice-row.own {
  color: var(--text);
}

.voice-row.own > span:first-child {
  color: var(--text-secondary);
}

.voice-row .icon-speaking {
  flex: none;
  width: 18px;
  height: 18px;
}

.voice-row.playing .icon-speaking path + path {
  animation: speaker-waves 0.9s ease-in-out infinite;
}

.voice-row.playing .icon-speaking path:last-child {
  animation-delay: 0.15s;
}

@keyframes speaker-waves {
  0%,
  100% {
    opacity: 0.25;
  }
  45% {
    opacity: 1;
  }
}

/* A voice's loudness along its length as bars, 3 wide and evenly spaced,
   their heights set by practice.js. */
.levels {
  flex: 1;
  min-width: 0;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: space-around;
}

.levels i {
  flex: none;
  width: 3px;
  border-radius: 1.5px;
  background: currentColor;
  opacity: 0.3;
  transition: opacity 0.12s linear;
}

.levels i.on {
  opacity: 1;
}

.compare-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-raised);
  box-shadow: inset 0 0 0 1px var(--border);
  color: var(--primary);
  font-size: 13.5px;
  font-weight: 600;
  transition: transform 0.15s ease;
}

.compare-chip:active,
.own-play:active {
  transform: scale(0.96);
}

.compare-chip .icon {
  width: 15px;
  height: 15px;
}

/* The learner's recording under the note of a first miss. */
.own-recording {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  color: var(--text);
}

.own-play {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgb(24 34 56 / 0.08);
  display: grid;
  place-items: center;
  transition: transform 0.15s ease;
}

.own-play .icon {
  width: 12px;
  height: 12px;
}

@media (prefers-reduced-motion: reduce) {
  .voice-row.playing .icon-speaking path {
    animation: none;
  }
}

/* ---- Daily limits: Pro over a free one used up, Pro's own note ---- */

/* The modal that sells Pro as a page of its own, after a form that ran
   into a free limit. Its parts are pro.css's, which the page loads. */
.limit-page {
  width: 100%;
  max-width: 892px;
  margin: 0 auto;
  padding: 30px 16px 64px;
}

/* Its name in the middle, the way out at the right, as on a sheet. */
.limit-page > header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 30px;
  margin-bottom: 24px;
  padding: 0 34px;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-secondary);
}

.limit-page > header a {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--primary);
}

.limit-page .pro-columns > * {
  animation: rise-in 0.55s var(--ease) both;
}

.limit-page .pro-columns > :last-child {
  animation-delay: 0.08s;
}

/* While today's use counts up (limits.js), the limit used up is marked so
   only once its bar is full. */
.ledger-name small {
  transition:
    opacity 0.25s ease,
    transform 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.ledger.counting .ledger-name small {
  opacity: 0;
  transform: scale(0.7);
}

/* A Pro learner's day of new audio or AI checks used up: the foil mark of
   Pro where the sheet's name goes, then what rests and what carries on.
   Learn's mark on the course card shares the class; here it sits in the header's
   place and holds still. */
.big-day .pro-mark {
  margin-left: 0;
  animation: none;
  padding: 4px 12px;
  border-radius: 999px;
  font: 500 15px/1.3 var(--serif);
  color: var(--text);
  background: linear-gradient(115deg, #f9c6e8, #bfe6ff 28%, #d9c7ff 52%, #c4f5e2 76%, #ffe9b8);
  box-shadow:
    inset 0 0 0 1px rgb(255 255 255 / 0.7),
    0 2px 4px rgb(24 34 56 / 0.12);
}

.big-day .sheet-hint {
  margin-bottom: 0;
}

.big-day-rows {
  display: grid;
  gap: 8px;
  margin: 18px 0 22px;
  padding: 0;
  list-style: none;
}

.big-day-rows li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface-sunken);
  font-size: 15.5px;
}

.big-day-rows li > :last-child {
  text-align: right;
  color: var(--text-secondary);
}

.big-day[open] > * {
  animation: big-day-in 0.45s var(--ease) both;
}

.big-day[open] > :nth-child(2) {
  animation-delay: 0.05s;
}

.big-day[open] > :nth-child(3) {
  animation-delay: 0.1s;
}

.big-day[open] > :nth-child(n + 4) {
  animation-delay: 0.15s;
}

@keyframes big-day-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .limit-page .pro-columns > *,
  .big-day[open] > * {
    animation: none;
  }
}

/* ---- The German revealed word by word ---- */

/* Each word of the German comes in as it is said, rising a little. */
[data-word-by-word] > * {
  display: inline-block;
  transition:
    opacity 0.3s var(--ease),
    transform 0.3s var(--ease);
}

[data-word-by-word] > .waiting {
  opacity: 0;
  transform: translateY(8px);
}

[data-word-by-word].still > * {
  transition: none;
}

/* The learner's other values, and the other way to say it, rise in under
   the sentence one after the other. */
[data-german-card] .arrive {
  animation: rise 0.5s var(--ease) both;
}

/* The other way to say it, turning out of a copy of the sentence. A word
   only it has is in cobalt; one that moves to another place ends in cobalt,
   underlined. */
.morph-line {
  position: relative;
}

.morph-line span {
  display: inline-block;
  text-decoration: underline 2px transparent;
  text-underline-offset: 6px;
  transition:
    color 0.4s var(--ease),
    text-decoration-color 0.4s var(--ease);
}

.morph-line b {
  font-weight: 500;
  padding: 1px 8px 3px;
  border-radius: 8px;
  background: var(--surface-sunken);
}

.morph-line .new,
.morph-line .moved {
  color: var(--primary);
}

.morph-line .moved {
  text-decoration-color: var(--primary);
}

/* A word that goes, fading out where it stood. */
.morph-line .leaving {
  position: absolute;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  [data-german-card] .arrive {
    animation: appear 0.3s ease both;
  }
}

/* ---- Gem jar ---- */

/* The gems' row on Learn, as in the app: a small jar of them, how many are
   in it and how many new ones wait beside it. It opens the jar's page. */
a.gems {
  transition: box-shadow 0.2s ease;
}

a.gems:hover {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--primary) 30%, transparent);
}

.gems-jar {
  flex: none;
  width: 39.6px;
  height: 51.6px;
}

.gems p {
  flex: 1;
  min-width: 0;
}

.gems p small {
  display: block;
  margin-top: 1px;
}

.gems .icon-next {
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--text-faint);
}

/* How many new gems wait: on the row and over the heap on the shelf. */
.gems-new,
.gem-new-count {
  padding: 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--primary) 10%, transparent);
  color: var(--primary);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}

/* The jar's own page: the jar on its shelf, the new gems in a heap beside
   it, and under them the gems in the jar. As narrow as the phone's, so the
   heap stays a heap. */
.page.gems-page {
  max-width: 600px;
}

.gems-back {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  margin: 0 0 14px -6px;
  font-size: 15.5px;
  font-weight: 600;
  color: var(--primary);
}

.gems-back svg {
  width: 20px;
  height: 20px;
}

.gems-summary {
  margin-top: 2px;
  font-size: 16px;
  color: var(--text-secondary);
}

/* gem-jar.js gives the shelf its height and lays out what is on it. */
.gem-shelf {
  position: relative;
  margin-top: 28px;
  user-select: none;
  -webkit-user-select: none;
}

.gem-plank {
  position: absolute;
  left: 0;
  right: 0;
  height: 6px;
  border-radius: 3px;
  background: var(--surface-sunken);
}

.gem-jar-box {
  position: absolute;
  top: 0;
  right: 0;
}

/* A gem falls in from just above the neck. */
.gem-jar {
  overflow: visible;
}

/* The jar lit up while a dragged gem would drop in. */
.gem-jar-hover {
  fill: color-mix(in srgb, var(--primary) 6%, transparent);
  stroke: var(--primary);
  stroke-opacity: 0.45;
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
  opacity: 0;
  transition: opacity 0.15s ease-out;
}

.gem-jar-box.over .gem-jar-hover {
  opacity: 1;
}

/* The light that sweeps across the glass as a gem lands, out of sight
   until then. */
.gem-jar-glint {
  opacity: 0;
}

.gem-new-count {
  position: absolute;
  left: 0;
}

.shelf-gem,
.gem-flight {
  position: absolute;
  top: 0;
  left: 0;
}

.shelf-gem {
  border-radius: 50%;
  cursor: grab;
  touch-action: none;
  transition: filter 0.2s ease;
}

.shelf-gem.lifted {
  z-index: 1;
  cursor: grabbing;
  filter: drop-shadow(0 6px 8px rgb(24 34 56 / 0.18));
}

/* Let go away from the jar, it springs back to its place. */
.shelf-gem.springing {
  transition: transform 0.35s cubic-bezier(0.34, 1.4, 0.64, 1);
}

.gem-flight {
  z-index: 2;
  pointer-events: none;
}

.shelf-gem svg,
.gem-flight svg {
  width: 100%;
  height: 100%;
}

/* The gems in the jar, the last in first: the stone, its German name with
   the article in the gender's colour, and the unit that earned it. */
.gem-list {
  margin: 24px 0 0;
  padding: 0 16px;
  list-style: none;
}

.gem-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
}

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

.gem-row-stone {
  flex: none;
  width: 28px;
  height: 28px;
}

.gem-list .de {
  flex: 1;
  min-width: 0;
  font-size: 17px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gem-list small {
  max-width: 50%;
  font-size: 13px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* A gem that has just landed joins the list at the top. */
.gem-list li.arrived {
  animation: gem-row-in 0.45s var(--ease) both;
}

@keyframes gem-row-in {
  from {
    opacity: 0;
    transform: translateY(-12px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gem-list li.arrived {
    animation: none;
  }

  .shelf-gem.springing {
    transition: none;
  }
}
