/* Fonts are self-hosted (static/fonts, SIL OFL, licenses alongside); variable files, one per script. */
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/figtree-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Figtree';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(fonts/figtree-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Shantell Sans';
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url(fonts/shantell-sans-cyrillic-ext.woff2) format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Shantell Sans';
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url(fonts/shantell-sans-cyrillic.woff2) format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Shantell Sans';
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url(fonts/shantell-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: 'Shantell Sans';
  font-style: normal;
  font-weight: 700 800;
  font-display: swap;
  src: url(fonts/shantell-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --ground: #F3F0FF;
  --ink: #1C1638;
  --muted: #4B4566;
  --accent: #5B3FD9;
  --accent-dark: #36209A;
  --line: #DCD5F7;
  --error-bg: #FFE4DC;
  --error-ink: #8A2A12;
  --display: 'Shantell Sans', system-ui, sans-serif;
  --body: 'Figtree', system-ui, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink);
  overflow-wrap: break-word;
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.5;
}

/* Mobile first. The desktop layout is at the bottom (min-width: 900px). */

.page {
  max-width: 1120px;
  min-height: 100vh;
  margin: 0 auto;
  padding: 20px 24px 32px;
  display: flex;
  flex-direction: column;
}

main { flex: 1; display: flex; flex-direction: column; }
.foot { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 20px; margin-top: 48px; padding: 16px 0 8px; border-top: 1px solid var(--line); font-size: 14px; }

a { color: var(--accent-dark); }
a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

/* Phones: logo and languages on the first row, the page links on a full-width row below.
   Desktop: one row, languages last. */
.top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 44px; margin-bottom: 24px; }
.top form { margin: 0; }
.nav { flex-basis: 100%; display: flex; flex-wrap: wrap; align-items: center; gap: 0 12px; font-size: 15px; }
.logo { margin-right: auto; display: inline-flex; align-items: center; gap: 6px; font-family: var(--display); font-size: 22px; font-weight: 800; color: var(--accent); text-decoration: none; }

.link {
  font: inherit;
  font-weight: 600;
  color: var(--accent-dark);
  background: none;
  border: 0;
  padding: 12px 4px;
  cursor: pointer;
  text-decoration: none;
}

h1 {
  margin: 0;
  font-family: var(--display);
  font-size: 36px;
  font-weight: 800;
  line-height: 1.12;
}
.hero { display: flex; flex-direction: column; gap: 12px; }
.lead { margin: 0; color: var(--muted); max-width: 32ch; }
.home .lead { max-width: 42ch; }
.hero .hint { margin: 0; font-size: 15px; color: var(--muted); overflow-wrap: anywhere; }

/* Home: hero, desk calendar, then the buttons pinned to the bottom of the screen. */
.home { flex: 1; display: flex; flex-direction: column; gap: 24px; }
.home .actions { margin-top: auto; display: flex; flex-direction: column; gap: 8px; text-align: center; }

/* Landing page, below the hero: three steps, then a closing call to action. */
.button.secondary { background: #FFFFFF; color: var(--accent-dark); box-shadow: inset 0 0 0 2px var(--line); }
.button.secondary:hover { background: var(--line); }
.button.light { background: #FFFFFF; color: var(--accent-dark); }
.button.light:hover { background: var(--ground); }
.steps { margin-top: 56px; }
.steps h2, .cta h2 { margin: 0 0 20px; font-family: var(--display); font-size: 28px; line-height: 1.15; }
.steps ol { margin: 0; padding: 0; list-style: none; display: grid; gap: 16px; }
.steps li { padding: 20px; border-radius: 24px; background: #FFFFFF; }
.steps h3 { margin: 16px 0 4px; font-size: 19px; }
.steps p { margin: 0; color: var(--muted); }
.step-visual { height: 64px; display: flex; align-items: center; }
.step-visual .sticker { transform: rotate(-3deg); font-size: 22px; }
.pills { display: flex; gap: 4px; }
.pills span { padding: 4px 10px; border-radius: 999px; background: var(--ground); color: var(--accent-dark); font-size: 13px; font-weight: 700; }
.pills .on { background: var(--accent); color: #FFFFFF; }
.step-visual .rated { align-self: auto; background: var(--ground); font-size: 15px; }
.cta { margin-top: 32px; padding: 32px 24px; border-radius: 28px; background: var(--accent); color: #FFFFFF; text-align: center; }
.cta .button { max-width: 360px; height: auto; min-height: 58px; margin: 0 auto; padding: 8px 20px; text-align: center; }

/* Done screens (study, guest lesson): one centred message. */
.done { align-items: center; text-align: center; }
.done .lead { margin: 0 auto; }
.done .button { max-width: 320px; }
.done h2 { margin: 8px 0 0; }
/* A guest's rated words: smaller than the card's form stickers, left to right like a collection. */
.forms.jar { margin: 0; }
.jar .gender-form { font-size: 17px; }

/* Form pages: one centred column. */
.narrow { width: 100%; max-width: 440px; margin: 0 auto; display: flex; flex-direction: column; gap: 24px; }

/* Word stickers (the how-it-works step). */
.sticker {
  display: inline-block;
  padding: 0.35em 0.7em;
  border: 0.17em solid #FFFFFF;
  border-radius: 0.7em;
  box-shadow: 0 3px 10px rgba(28, 22, 56, 0.16);
  font-family: var(--display);
  font-size: 1.35em;
  font-weight: 700;
  white-space: nowrap;
}
.yellow { background: #FFD84D; }

/* Home: a desk flip calendar, one word a page, tinted by gender. study.js punches the holes and turns the pages
   (the top one lifts towards you and goes to the back); without it only the first page shows. Flat on purpose:
   pages stacked in shared 3D flickered in Safari and Firefox, so only the turning page is 3D, alone. */
.desk { position: relative; height: 250px; overflow: hidden; display: grid; place-items: center; }
.cal { --grain: url("grain.svg"); position: relative; isolation: isolate; width: 270px; height: 188px; rotate: -3deg; scale: 0.9; translate: 0 -8px; }
.cal .board { position: absolute; left: -3px; right: -3px; top: 0; bottom: -12px; border-radius: 2px 2px 4px 4px;
  background: var(--grain), linear-gradient(180deg, #7A5FE6, #4A2FC4); box-shadow: 0 14px 24px -10px rgba(40, 20, 110, 0.45); }
/* The pages below the top one, seen as a striped edge. */
.stack-edge { position: absolute; left: 0; right: 0; top: 100%; height: 6px; border-radius: 0 0 2px 2px;
  background: linear-gradient(rgba(30, 15, 80, 0.15), rgba(30, 15, 80, 0.15)), repeating-linear-gradient(180deg, #FFC4AE 0 1.2px, #AED7FF 1.2px 2.4px, #FFE27E 2.4px 3.6px, #9FE5C5 3.6px 4.8px, #D9C8FF 4.8px 6px); }
.cal-page { position: absolute; inset: 0; overflow: hidden; border-radius: 1px 1px 3px 3px; background: var(--tint); transform-origin: top; }
.cal:not(.live) .cal-page ~ .cal-page { display: none; }
.cal-page.turning { backface-visibility: hidden; animation: cal-turn 0.7s cubic-bezier(0.5, 0, 0.7, 1) forwards; }
@keyframes cal-turn { 70% { opacity: 1; } 100% { opacity: 0; transform: perspective(700px) rotateX(95deg); } }
.cal-page::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(180deg, rgba(30, 15, 80, 0.14) 0, rgba(30, 15, 80, 0.04) 12px, transparent 20px),
    linear-gradient(118deg, rgba(255, 255, 255, 0.14) 0%, transparent 40%), linear-gradient(0deg, rgba(30, 15, 80, 0.05) 0, transparent 22px), var(--grain); }
/* The lifting page shades the one below, then the shade slides off. */
.cal-page.under::before { content: ""; position: absolute; inset: 0; z-index: 1; transform-origin: top;
  background: linear-gradient(180deg, rgba(30, 15, 80, 0.32), rgba(30, 15, 80, 0.1) 55%, transparent 90%);
  animation: cal-lift 0.7s cubic-bezier(0.5, 0, 0.3, 1) forwards; }
@keyframes cal-lift { 0% { opacity: 0; } 25% { opacity: 1; transform: scaleY(1); } 100% { opacity: 0; transform: scaleY(0.15); } }
.tint-die { --tint: #FFC4AE; }
.tint-der { --tint: #AED7FF; }
.tint-das { --tint: #9FE5C5; }
.tint-verb { --tint: #FFE27E; }
.tint-other { --tint: #D9C8FF; }
.tint-next { --tint: var(--ground); }
.cal .hole { position: absolute; top: 3px; width: 7px; height: 8px; border-radius: 1.5px; background: #2B1C66; box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.5); }

/* The page's print: everything on one centre line. */
.cal .sheet { position: absolute; inset: 30px 18px 12px; display: flex; flex-direction: column; align-items: center; text-align: center; color: rgba(28, 22, 56, 0.92); }
.cal .sheet p { margin: 0; }
.cal .eyebrow { font-size: 11px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(28, 22, 56, 0.6); }
.cal .eyebrow b { color: rgba(28, 22, 56, 0.85); }
.cal .lemma { margin-top: auto; font-family: var(--display); font-size: 44px; font-weight: 800; line-height: 1; letter-spacing: -0.01em; }
.cal .art { margin-right: 0.55em; font-size: 0.5em; font-weight: 700; color: rgba(28, 22, 56, 0.62); }
.cal .rule { width: 36px; height: 2px; margin: 10px 0 8px; border-radius: 1px; background: rgba(28, 22, 56, 0.35); }
.cal .sheet .gloss { margin-bottom: auto; font-family: var(--display); font-size: 20px; font-weight: 500; line-height: 1.2; }
.cal .sheet .mark { display: inline-flex; align-items: center; gap: 3px; font-family: var(--display); font-size: 9px; font-weight: 700; letter-spacing: 0.04em; color: rgba(28, 22, 56, 0.38); }
.cal .mark img { opacity: 0.55; filter: grayscale(1); }
.cal .sheet .cal-slot { flex: 1; align-self: stretch; margin: 6px 4px 10px; display: grid; place-items: center; border: 2.5px dashed #A99BEA; border-radius: 14px; font-family: var(--display); font-size: 22px; font-weight: 700; color: var(--accent); }

@media (prefers-reduced-motion: reduce) {
  .cal-page.turning, .cal-page.under::before { animation: none; }
  .cal-page.under::before { opacity: 0; }
}

.button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 58px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #FFFFFF;
  font: inherit;
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.button:hover { background: var(--accent-dark); }

.form { display: flex; flex-direction: column; }
.form label { font-weight: 600; margin-bottom: 6px; }
.form :where(input:not([type=checkbox]), select) {
  height: 54px;
  padding: 0 18px;
  margin-bottom: 18px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #FFFFFF;
  color: var(--ink);
  font: inherit;
}
.form :where(input:not([type=checkbox]), select):focus { border-color: var(--accent); }
.form .hint { margin: -12px 0 18px; font-size: 15px; color: var(--muted); }
.form .button { margin-top: 6px; }

.error {
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 14px;
  background: var(--error-bg);
  color: var(--error-ink);
  font-weight: 600;
}

/* Study page: the word is a big sticker; its answer fills a label where the reveal button was,
   so nothing moves. On phones the buttons sit at the bottom (thumb reach). */
.study { flex: 1; gap: 16px; }
.card-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 32px; }
.card-top .hint { margin: 0; font-size: 15px; color: var(--muted); }
.rated { align-self: flex-start; margin: 0; padding: 4px 12px; border-radius: 999px; background: #FFFFFF; color: var(--accent-dark); font-size: 14px; font-weight: 600; }
.card { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; text-align: center; }
.word {
  max-width: 100%;
  padding: 0.12em 0.5em 0.2em;
  border: 6px solid #FFFFFF;
  border-radius: 24px;
  background: #FFD84D;
  box-shadow: 0 4px 14px rgba(28, 22, 56, 0.16);
  transform: rotate(-2deg);
  font-size: min(48px, 10vw); /* smaller on narrow phones, so das Prozent stays on one line */
  overflow-wrap: break-word;
  hyphens: auto;
}
/* Noun stickers take the article's colour, so gender sticks along with the word; plural-only nouns (die Leute) get their own, not feminine's.
   Lithuanian nouns have no article: their gender (m, f) takes der's and die's colour. */
.word.der, .gender-form.der, .word.m, .gender-form.m, .tag.m::before { background: #8CC8FF; }
.word.die, .gender-form.die, .word.f, .gender-form.f, .tag.f::before { background: #FFB59A; }
.word.das, .gender-form.das { background: #7ADBB0; }
.word.plural-only, .gender-form.pl { background: #CDB8FF; }
/* The pronunciation button is a second, smaller sticker stuck on the word's corner. */
.word-wrap { position: relative; max-width: calc(100% - 24px); margin-bottom: 12px; }
.say {
  position: absolute;
  right: -24px;
  bottom: -16px;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 4px solid #FFFFFF;
  border-radius: 50%;
  background: var(--accent);
  color: #FFFFFF;
  box-shadow: 0 3px 10px rgba(28, 22, 56, 0.22);
  transform: rotate(8deg);
}
.say:hover, .say.playing { background: var(--accent-dark); }
.say:active { transform: rotate(8deg) scale(0.92); }
.say svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.say .cone { fill: currentColor; }
/* The plural pairs with the word, in its font but not its gender colour (plurals have none).
   The umlaut and ending, what the learner must memorise, are marked like a dictionary's ¨-er.
   Hidden until the answer opens; visibility keeps its space, so the card doesn't move. */
.plural { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: center; gap: 0 10px; max-width: 100%; margin: -4px 0 0; }
.plural-label { font-size: 15px; font-weight: 600; color: var(--muted); }
.plural-form { font-family: var(--display); font-size: 28px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.plural-form b { color: var(--accent); text-decoration: underline 3px; text-underline-offset: 5px; }
.card:not(:has(.answer[open])) .plural { visibility: hidden; opacity: 0; }
.pos { margin: -8px 0 0; font-size: 14px; font-weight: 600; letter-spacing: 0.02em; color: var(--muted); }
.answer { width: 100%; margin-top: 8px; }
.answer > summary { list-style: none; }
.answer > summary::-webkit-details-marker { display: none; }
.answer[open] > summary { display: none; }
.translation {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 58px;
  margin: 0;
  padding: 10px 20px;
  border-radius: 18px;
  background: #FFFFFF;
  box-shadow: 0 3px 10px rgba(28, 22, 56, 0.1);
  font-size: 24px;
  font-weight: 600;
  line-height: 1.25;
}
/* A determiner's forms (der, die, das, die) as mini stickers in the noun gender colours (set with .word.der above); the one on the card is tilted and ringed. */
.forms { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
/* Lithuanian grammar under the answer: declension and accent class, a verb's or adjective's forms, a noun's case table. */
/* Gender, declension and accent class as chips; the gender chip carries its colour as a dot. */
.grammar { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 12px 0 0; }
.tag { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 10%, #FFFFFF); font-size: 13px; font-weight: 600; color: var(--muted); }
.tag.m::before, .tag.f::before { content: ""; width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(28, 22, 56, 0.25); }
/* A short rule between the translation and the grammar under it. */
.translation + :is(.grammar, .forms-line, .cases) { position: relative; margin-top: 34px; }
.translation + :is(.grammar, .forms-line, .cases)::before { content: ""; position: absolute; top: -19px; left: calc(50% - 24px); width: 48px; height: 3px; border-radius: 2px; background: color-mix(in srgb, var(--accent) 30%, transparent); }
/* A verb's, adjective's or adverb's forms as "label · form" rows in a white card, the way a dictionary lists them.
   The rows share one label column (subgrid), as wide as the longest label, so a long Russian label stays on one line. */
.forms-line { display: grid; grid-template-columns: fit-content(60%) 1fr; max-width: 420px; margin: 12px auto 0; padding: 0; border-radius: 16px; background: #FFFFFF; box-shadow: 0 2px 8px rgba(28, 22, 56, 0.08); list-style: none; text-align: left; }
.forms-line li { display: grid; grid-column: 1 / -1; grid-template-columns: 9.5em 1fr; grid-template-columns: subgrid; /* fixed columns where subgrid is unknown */ align-items: baseline; gap: 16px; padding: 8px 16px; }
.forms-line li + li { border-top: 1px solid var(--line); }
.forms-line small { font-size: 13px; font-weight: 600; color: var(--muted); }
.forms-line span { font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
/* A noun's cases: a toggle pill, then a white card like the translation's, nominative first and bold. */
.cases { max-width: 420px; margin: 14px auto 0; text-align: left; }
.cases summary { width: fit-content; margin: 0 auto; padding: 6px 16px; border-radius: 999px; background: color-mix(in srgb, var(--accent) 10%, #FFFFFF); cursor: pointer; font-size: 15px; font-weight: 700; color: var(--accent-dark); list-style: none; }
.cases summary::-webkit-details-marker { display: none; }
.cases summary::after { content: " ▾" / ""; } /* empty alt: screen readers already hear open/closed */
.cases[open] summary::after { content: " ▴" / ""; }
.cases table { width: 100%; margin-top: 10px; border-collapse: separate; border-spacing: 0; overflow: hidden; border-radius: 16px; background: #FFFFFF; box-shadow: 0 2px 8px rgba(28, 22, 56, 0.08); font-size: min(17px, 4.4vw); }
.cases th, .cases td { padding: 7px 6px; }
.cases td { overflow-wrap: anywhere; } /* a very long form breaks in its cell, never widens the page */
.cases tbody tr:nth-child(odd) { background: color-mix(in srgb, var(--accent) 5%, #FFFFFF); }
.cases tbody tr:first-child td { font-weight: 700; }
.cases thead th { padding-top: 10px; font-size: 12px; font-weight: 700; letter-spacing: 0.02em; white-space: nowrap; text-transform: uppercase; color: var(--muted); }
.cases tbody th { font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.gender-form {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2px 12px 4px;
  border: 3px solid #FFFFFF;
  border-radius: 12px;
  box-shadow: 0 2px 6px rgba(28, 22, 56, 0.12);
  font-family: var(--display);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}
.gender-form small { font-family: var(--body); font-size: 12px; font-weight: 600; color: var(--muted); }
.gender-form[aria-current] { outline: 3px solid var(--accent); outline-offset: 1px; transform: rotate(-3deg); }
.rate { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
/* Rating comes after seeing the answer: until then the buttons are dimmed and ignore clicks. */
.study:not(:has(.answer[open])) .rate .button { opacity: 0.4; pointer-events: none; }
.rate .button.pressed { background: var(--accent-dark); transform: scale(0.95); }
.rate .button { flex-direction: column; gap: 2px; height: auto; min-height: 64px; padding: 8px 4px; border-radius: 18px; font-size: 16px; line-height: 1.2; }
.rate small { font-size: 12px; font-weight: 400; opacity: 0.8; }
.rate kbd { display: none; }
.rate-help { margin: 12px 0 0; font-size: 14px; line-height: 1.4; color: var(--muted); text-align: center; }
.audio-credit { font-size: 12px; }
.audio-credit a { color: inherit; }

/* Language switcher: small codes, the current one filled. */
.langs { display: flex; gap: 2px; }
.langs a { padding: 4px 6px; border-radius: 999px; font-size: 13px; font-weight: 600; color: var(--muted); text-decoration: none; }
.langs a:hover { color: var(--accent-dark); }
.langs [aria-current] { color: var(--accent-dark); box-shadow: inset 0 0 0 1.5px var(--accent); }
.login { padding: 8px 18px; border-radius: 999px; background: var(--accent); color: #FFFFFF; font-weight: 700; text-decoration: none; }
.login:hover { background: var(--accent-dark); }

/* Current page in the top bar: a thick violet bar under the item, plus darker text on plain links. */
.nav [aria-current="page"] { position: relative; color: var(--ink); }
.nav [aria-current="page"]::after { content: ""; position: absolute; left: 4px; right: 4px; bottom: 2px; height: 4px; border-radius: 999px; background: var(--accent); }
.nav .login[aria-current="page"] { color: #FFFFFF; background: var(--accent-dark); }
.nav .login[aria-current="page"]::after { left: 14px; right: 14px; bottom: -8px; }
.prose { display: flex; flex-direction: column; gap: 12px; }
.prose h2 { margin: 12px 0 0; font-family: var(--display); font-size: 22px; }
.prose p { margin: 0; }
/* About: what each rating button does, its name shown as a small button. */
.prose dl { margin: 4px 0; display: grid; gap: 12px; }
.prose dl div { padding: 14px 16px; border-radius: 18px; background: #FFFFFF; }
.prose dt { display: inline-block; margin-bottom: 6px; padding: 2px 12px; border-radius: 999px; background: var(--accent); color: #FFFFFF; font-weight: 700; }
.prose dd { margin: 0; }

/* Settings: the daily limit, then progress as a meter, tiles and one bar per rating.
   Bars are <progress> elements because the CSP forbids inline widths. */
.panel { padding: 18px; border-radius: 22px; background: #FFFFFF; }
.settings h2, .stats h2 { margin: 0 0 12px; font-family: var(--display); font-size: 22px; }
.limit-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 12px; }
.limit-top .rated { background: var(--ground); }
.limit h2 { margin: 0; font-family: var(--body); font-size: 17px; font-weight: 700; }
.presets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; margin: 0 0 18px; padding: 4px; border-radius: 999px; background: var(--ground); }
.presets button { height: 44px; border: 0; border-radius: 999px; background: none; color: var(--accent-dark); font: inherit; font-size: 17px; font-weight: 700; cursor: pointer; }
.presets button:hover { background: var(--line); }
.presets [aria-pressed="true"], .presets [aria-pressed="true"]:hover { background: var(--accent); color: #FFFFFF; }
.custom { display: grid; grid-template-columns: 1fr auto; gap: 0 8px; }
.custom label { grid-column: 1 / -1; font-size: 15px; color: var(--muted); }
.custom input { margin: 0; height: 50px; }
.custom .button { margin: 0; width: auto; height: auto; min-height: 50px; padding: 8px 26px; font-size: 16px; }
.reminder .check { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-weight: 600; cursor: pointer; }
.reminder .check input { flex-shrink: 0; width: 22px; height: 22px; accent-color: var(--accent); }
.reminder > form > label:not(.check) { font-size: 15px; font-weight: 400; color: var(--muted); }
.reminder select { min-width: 0; height: 50px; padding: 0 14px; border: 2px solid var(--line); border-radius: 18px; background: #FFFFFF; color: var(--ink); font: inherit; }
.reminder select:focus { border-color: var(--accent); }
.note { margin: 12px 0 0; font-size: 15px; color: var(--muted); }
.calendar { margin-top: 20px; padding: 16px; border-radius: 18px; background: var(--ground); }
.calendar-h { margin: 0; font-family: var(--body); font-size: 16px; font-weight: 700; }
.calendar .note { margin-top: 4px; }
.calendar-buttons { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(9em, 100%), 1fr)); gap: 8px; margin-top: 14px; }
.calendar .button, .vocab-actions .button { max-width: none; height: auto; min-height: 46px; padding: 8px 16px; font-size: 16px; text-align: center; }
.calendar-buttons + .note { margin-top: 10px; font-size: 14px; }
.done .remind { width: 100%; text-align: left; }
.remind form .button { max-width: none; height: auto; min-height: 50px; font-size: 17px; }
.remind > .note { margin: 0; }
.remind .link { padding: 0 4px; }
.remind .calendar { margin-top: 16px; padding: 0; background: none; }

.stats progress, .session progress { display: block; width: 100%; height: 10px; border: 0; border-radius: 999px; appearance: none; overflow: hidden; }
.stats progress { background: var(--ground); }
.stats progress::-webkit-progress-bar { background: var(--ground); }
.stats progress::-webkit-progress-value, .session progress::-webkit-progress-value { background: var(--accent); border-radius: 999px; }
.stats progress::-moz-progress-bar, .session progress::-moz-progress-bar { background: var(--accent); border-radius: 999px; }

.session { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; }
.session p { margin: 0; color: var(--muted); }
.session-count { font-size: 15px; }
.session-count b { color: var(--ink); }
.session-split { font-size: 13px; }
.session progress { flex-basis: 100%; background: var(--line); }
.session progress::-webkit-progress-bar { background: var(--line); }

.today { margin-bottom: 10px; }
.today p { margin: 0; }
.today-label { color: var(--muted); font-weight: 600; }
.today .today-value { margin: 2px 0 12px; font-family: var(--display); font-size: 34px; font-weight: 800; line-height: 1.1; }
.today progress { height: 14px; }
.today .today-note { margin-top: 10px; font-size: 15px; color: var(--muted); }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0 0 28px; }
.tiles div { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 4px; padding: 14px; border-radius: 18px; background: #FFFFFF; }
.tiles dt { font-size: 13px; line-height: 1.3; color: var(--muted); }
.tiles dd { margin: 0; font-family: var(--display); font-size: 26px; font-weight: 800; line-height: 1; }

.bars { margin: 0; padding: 8px 18px; }
.bars div { display: grid; grid-template-columns: 7em 1fr; align-items: center; gap: 12px; padding: 10px 0; }
.bars div + div { border-top: 1px solid var(--line); }
.bars dt { color: var(--muted); }
.bars dd { display: grid; grid-template-columns: 1fr 2.5ch; align-items: center; gap: 12px; margin: 0; font-weight: 700; text-align: right; }
.bars .unrated progress::-webkit-progress-value { background: var(--line); }
.bars .unrated progress::-moz-progress-bar { background: var(--line); }

.switch { margin: 0; text-align: center; color: var(--muted); }

@media (prefers-reduced-motion: no-preference) {
  .button, .say { transition: background-color 120ms, transform 120ms; }
  .plural { transition: opacity 250ms, visibility 250ms; }
  .say.playing .wave1 { animation: wave 500ms ease-in-out infinite alternate; }
  .say.playing .wave2 { animation: wave 500ms 160ms ease-in-out infinite alternate; }
}
@keyframes wave { from { opacity: 0.2; } to { opacity: 1; } }

/* Word lists (/words, /saved): German left, translation right; on /saved an unsave button at the end. */
.vocab-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vocab { list-style: none; margin: 0; padding: 0; }
.vocab li { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: center; min-height: 48px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.vocab li:last-child { border-bottom: 0; }
.vocab.with-action li { grid-template-columns: 1fr 1fr 44px; }
.vocab-de { font-family: var(--display); font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.vocab-de small { display: block; font-family: var(--body); font-size: 13px; font-weight: 600; color: var(--muted); }
.vocab-tr { color: var(--muted); overflow-wrap: anywhere; }
.bookmark { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.unsave { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--accent); cursor: pointer; }
.unsave .bookmark, .save.on .bookmark { fill: currentColor; }
.unsave:hover { background: #FFFFFF; }

/* The save toggle sits in the card's top-right corner, on its own row so long words never run under it. */
.save-form { align-self: flex-end; margin-bottom: -12px; }
.save { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 6px 10px; border: 2px solid var(--line); border-radius: 999px; background: #FFFFFF; color: var(--accent-dark); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.save .bookmark { width: 16px; height: 16px; }
.save:hover { border-color: var(--accent); }
.save.on:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.save.on { border-color: var(--accent); background: var(--accent); color: #FFFFFF; }

/* Word lists (/words, /saved): German left, translation right; on /saved an unsave button at the end. */
.vocab-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.vocab { list-style: none; margin: 0; padding: 0; }
.vocab li { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: center; min-height: 48px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.vocab li:last-child { border-bottom: 0; }
.vocab.with-action li { grid-template-columns: 1fr 1fr 44px; }
.vocab-de { font-family: var(--display); font-size: 19px; font-weight: 700; overflow-wrap: anywhere; }
.vocab-de small { display: block; font-family: var(--body); font-size: 13px; font-weight: 600; color: var(--muted); }
.vocab-tr { color: var(--muted); overflow-wrap: anywhere; }
.bookmark { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; }
.unsave { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--accent); cursor: pointer; }
.unsave .bookmark, .save.on .bookmark { fill: currentColor; }
.unsave:hover { background: #FFFFFF; }

/* The save toggle sits in the card's top-right corner, on its own row so long words never run under it. */
.save-form { align-self: flex-end; margin-bottom: -12px; }
.save { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px 6px 10px; border: 2px solid var(--line); border-radius: 999px; background: #FFFFFF; color: var(--accent-dark); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.save .bookmark { width: 16px; height: 16px; }
.save:hover { border-color: var(--accent); }
.save.on:hover { border-color: var(--accent-dark); background: var(--accent-dark); }
.save.on { border-color: var(--accent); background: var(--accent); color: #FFFFFF; }

@media (min-width: 900px) {
  .page { padding: 28px 48px 48px; }
  .top { margin-bottom: 32px; }

  h1 { font-size: 60px; line-height: 1.05; }
  .lead { font-size: 20px; }

  /* Home: text and buttons on the left, the desk calendar on the right. */
  .home {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas: "hero desk" "actions desk";
    grid-template-rows: auto 1fr;
    column-gap: 64px;
    row-gap: 40px;
  }
  .home .hero { grid-area: hero; }
  /* The calendar spans both rows, so it centres on the text and buttons beside it, scaled to fill its column. */
  .home .desk { grid-area: desk; height: auto; min-height: 440px; overflow: visible; }
  .cal { scale: 1.6; }
  @media (max-width: 1099px) { .cal { scale: 1.2; } }
  .home .actions { grid-area: actions; margin-top: 0; max-width: 360px; text-align: left; align-items: stretch; }
  .steps { margin-top: 96px; }
  .steps h2, .cta h2 { font-size: 40px; }
  .steps ol { grid-template-columns: repeat(3, 1fr); gap: 20px; }
  .steps li { padding: 28px; }
  .cta { margin-top: 48px; padding: 56px 32px; }

  .narrow h1 { font-size: 44px; }
  .narrow .word { font-size: 64px; }
  .narrow .plural-form { font-size: 34px; }
  .logo { font-size: 24px; }
  .top { flex-wrap: nowrap; gap: 16px; }
  .nav { flex-basis: auto; gap: 0 16px; }
  .langs { order: 1; }
  .rate { gap: 8px; }
  .narrow.prose { max-width: 720px; }
  .prose dl { grid-template-columns: 1fr 1fr; }
  .study { flex: 0 0 auto; max-width: 520px; }
  .card { flex: 0 0 auto; min-height: 300px; }
  .rate kbd { display: block; margin-top: 2px; font: inherit; font-size: 11px; font-weight: 600; opacity: 0.6; }
}
