/* The signed-in app: navigation, dashboard, levels, progress, projection, lessons, quiz and summary. */

/* ---------- layout ---------- */
.page {
  max-width: 1100px;
  margin: 0 auto;
  padding: 24px 20px 120px;
}

.page > * + * {
  margin-top: 20px;
}

.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-head h1 {
  margin: 0;
  font-size: 40px;
  letter-spacing: -0.03em;
}

.page-head.wide {
  flex-wrap: wrap;
}

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

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 14px;
}

.card-head h3 {
  margin: 0;
}

.card-head p {
  margin: 4px 0 0;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
}

.empty-state .btn {
  margin-top: 14px;
}

.empty {
  padding: 12px 0;
}

.two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

/* Grid children may shrink below their content's natural width; without this a card can push past a phone screen. */
.two > *,
.hero-row > * {
  min-width: 0;
}

.grow {
  flex: 1;
}

.dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 8px;
}



.dotted {
  border-bottom: 1px dotted currentColor;
}

/* ---------- navigation ---------- */
/* The bar's wrapper takes no box of its own, so the sticky bar sticks to the whole page, not to the wrapper. */
#nav {
  display: contents;
}

/* Two rows: logo, search and account on top, the section tabs below. */
.nav {
  position: sticky;
  top: 0;
  z-index: 20;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.nav-top {
  display: grid;
  grid-template-columns: 1fr minmax(0, 520px) 1fr;
  align-items: center;
  gap: 16px;
  max-width: 1100px;
  height: 58px;
  margin: 0 auto;
  padding: 0 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  justify-self: start;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.04em;
  text-decoration: none;
}

.logo {
  flex: none;
  display: block;
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 12px 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--mut);
  font-size: 15px;
  text-align: left;
}

.search-bar:hover {
  border-color: color-mix(in srgb, var(--mut) 50%, var(--line));
}

.search-bar .sb-text {
  flex: 1;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.search-bar kbd {
  margin: 0;
}

.user {
  position: relative;
  justify-self: end;
}

.user summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  cursor: pointer;
  list-style: none;
  font-size: 14px;
  font-weight: 600;
}

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

.uname {
  max-width: 140px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--root);
  color: var(--on);
  font-weight: 800;
}

.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 30;
  display: flex;
  flex-direction: column;
  min-width: 200px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.menu a,
.menu button {
  padding: 11px 12px;
  border: 0;
  border-radius: 8px;
  background: none;
  font-size: 15px;
  text-align: left;
  text-decoration: none;
}

.menu a:hover,
.menu button:hover,
.menu a[aria-current] {
  background: var(--surface-2);
}

/* The menu button and the dashboard button only show on phones (see the small-screen rules). */
.burger,
.home-btn {
  display: none;
}

.home-btn {
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
}

/* On the dashboard itself the button is quieter. */
.home-btn[aria-current] {
  background: none;
  color: var(--mut);
}

.burger summary {
  position: relative;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

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

.burger[open] summary {
  background: var(--surface);
  border-color: var(--mut);
}

.burger-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--salmon);
}

.burger-panel {
  position: fixed;
  top: 64px;
  left: 10px;
  right: 10px;
  z-index: 30;
  display: grid;
  gap: 6px;
  max-height: calc(100dvh - 80px);
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3);
}

.burger-panel .search-bar {
  height: 46px;
  border-radius: 14px;
  font-size: 16px;
}

.burger-links {
  display: grid;
  padding-top: 6px;
  border-top: 1px solid var(--line);
}

.burger-links a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 14px;
  border-radius: 12px;
  font-size: 17px;
  font-weight: 500;
  text-decoration: none;
}

.burger-links a .badge:first-of-type {
  margin-left: auto;
}

.burger-links a[aria-current] {
  background: var(--surface-2);
  font-weight: 700;
}

.nav .links {
  display: flex;
  gap: 2px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav .links::-webkit-scrollbar {
  display: none;
}

.nav .links a {
  position: relative;
  display: flex;
  align-items: center;
  gap: 6px;
  height: 44px;
  padding: 0 12px;
  color: var(--mut);
  font-weight: 600;
  font-size: 15px;
  text-decoration: none;
  white-space: nowrap;
}

.nav .links a:hover,
.nav .links a[aria-current] {
  color: var(--ink);
}

.nav .links a[aria-current]::after {
  content: "";
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 0;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--root);
}

.badge {
  display: inline-block;
  min-width: 24px;
  padding: 1px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.badge.lessons {
  background: var(--salmon);
  color: var(--salmon-ink);
}

.badge.reviews {
  background: var(--sky);
  color: var(--sky-ink);
}

.badge.grammar {
  background: color-mix(in srgb, var(--en) 30%, var(--surface));
  color: var(--ink);
}

.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  font-size: 20px;
  line-height: 1;
}

.icon-btn:disabled {
  opacity: 0.35;
}

#banner .banner {
  position: fixed;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 92vw;
  padding: 10px 16px;
  border-radius: 12px;
  background: var(--warn);
  color: var(--warn-ink);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
  font-size: 15px;
}

#banner .banner button {
  border: 1px solid currentColor;
  border-radius: 8px;
  background: none;
  padding: 4px 10px;
  white-space: nowrap;
}

/* ---------- dashboard ---------- */
.hero-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  min-height: 220px;
  padding: 22px 24px;
  border-radius: 20px;
  color: #fff;
}

.hero-card::after {
  content: attr(data-mark);
  position: absolute;
  right: -6px;
  bottom: -14px;
  z-index: -1;
  pointer-events: none;
  font-size: 76px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  white-space: nowrap;
  opacity: 0.1;
}

.hero-card h2 {
  margin: 0;
  font-size: 15px;
  letter-spacing: 0.02em;
  opacity: 0.92;
}

.hero-card .big {
  margin: 10px 0 2px;
  font-size: 64px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.hero-card .big small {
  font-size: 0.4em;
  opacity: 0.7;
  letter-spacing: 0;
}

.hero-card .sub {
  margin: 0 0 16px;
  font-size: 15px;
  opacity: 0.92;
}

.hero-card .foot {
  margin: 12px 0 0;
  font-size: 13px;
  opacity: 0.85;
}

.hero-card.lessons {
  background: linear-gradient(135deg, #6f3418, #b4531d);
}

.hero-card.reviews {
  background: linear-gradient(135deg, #1b3580, #2f66d8);
}

.hero-card.level {
  background: linear-gradient(135deg, #0e4a2f, #1d8a50);
}

.meter-row {
  display: flex;
  justify-content: space-between;
  margin: 6px 0;
  font-size: 14px;
}

.meter {
  position: relative;
  height: 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.25);
}

.meter i {
  display: block;
  height: 100%;
  border-radius: 99px;
  background: #fff;
}

.meter b {
  position: absolute;
  top: -3px;
  width: 2px;
  height: 16px;
  background: #fff;
  opacity: 0.8;
}

.level-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.tabs {
  display: flex;
  gap: 8px;
}

.tab {
  display: inline-flex;
  align-items: center;
  padding: 7px 14px;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: none;
  font-weight: 600;
  font-size: 15px;
}

.tab span {
  margin-left: 8px;
  color: var(--mut);
  font-weight: 500;
}

.tab.on {
  border-color: var(--ink);
  background: var(--surface-2);
}

.level-nav {
  display: flex;
  align-items: center;
  gap: 12px;
}

.level-panel .scroll {
  max-height: 440px;
  overflow: auto;
}

.level-panel h4 {
  margin: 18px 0 8px;
  font-size: 15px;
}

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

.chip-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.chip-col small {
  min-height: 14px;
  font-size: 11px;
  color: var(--mut);
}

.chip {
  display: inline-block;
  padding: 8px 14px;
  border: 2px solid transparent;
  border-radius: 10px;
  background: var(--root);
  color: var(--on);
  font-weight: 700;
  font-size: 16px;
  text-decoration: none;
}


.chip.cur {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 2px var(--bg);
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface-2);
}

.seg button {
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: none;
  color: var(--mut);
  font-weight: 600;
  font-size: 14px;
}

.seg button.on {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

.pct {
  margin: 6px 0;
  font-size: 56px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
}

.pct small {
  font-size: 0.45em;
  opacity: 0.7;
}

.stack {
  display: flex;
  height: 14px;
  margin: 10px 0;
  overflow: hidden;
  border-radius: 99px;
  background: var(--surface-2);
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 13px;
  color: var(--mut);
}

.sw {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 6px;
  border-radius: 3px;
}

.row-bar {
  margin-top: 16px;
}

.row-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.stats3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.stats3 > div {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--surface-2);
}

.stats3 small {
  display: block;
  font-size: 13px;
  color: var(--mut);
}

.stats3 b {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.big3 > div {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.big3 b {
  font-size: 30px;
}

.big3 .accent {
  background: var(--root);
  border-color: var(--root);
  color: var(--on);
}

.big3 .accent small {
  color: inherit;
  opacity: 0.85;
}

.card .stats3 {
  margin: 4px 0 8px;
}

/* ---------- charts ---------- */
.chart {
  display: block;
  width: 100%;
  height: auto;
}

.chart text {
  fill: var(--mut);
  font-size: 11px;
  font-family: inherit;
}

.chart .grid {
  stroke: var(--line);
}

.chart .bar {
  fill: var(--root);
}

.chart .bar + text {
  fill: var(--ink);
  font-weight: 700;
}

.chart .done {
  fill: none;
  stroke: var(--root);
  stroke-width: 3;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.chart .proj {
  stroke: var(--word);
  stroke-width: 2.5;
  stroke-dasharray: 6 5;
}

.chart .band {
  fill: var(--word);
  opacity: 0.14;
}

.chart .goal {
  fill: var(--word);
}

.chart .today {
  stroke: var(--mut);
  stroke-dasharray: 2 4;
}

.chart .dbar {
  fill: var(--root);
}

.chart .dbar.faded {
  opacity: 0.3;
}

.chart .avg {
  stroke: var(--word);
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

/* ---------- tiles, levels, progress ---------- */
.tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(156px, 1fr));
  gap: 10px;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-height: 86px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--root);
  color: var(--on);
  text-decoration: none;
}


.tile-word {
  font-size: 18px;
  font-weight: 800;
  overflow-wrap: break-word;
}

.tile-en {
  font-size: 13px;
  opacity: 0.92;
}

.tile-state {
  margin-top: auto;
  font-size: 12px;
  font-weight: 700;
  opacity: 0.88;
}

.tile.mini {
  min-height: 0;
  padding: 8px 12px;
}

.tile.locked {
  background: transparent;
  border: 2px dashed var(--line);
  color: var(--mut);
}

/* A most-used word the course does not teach yet. */
.tile.missing {
  background: var(--surface-2);
  color: var(--mut);
  opacity: 0.8;
}

.tile.ready {
  box-shadow: inset 0 0 0 3px var(--ink);
}

.tile.started {
  box-shadow: inset 0 -6px 0 var(--gc);
}

.tile.g0 {
  --gc: var(--g0);
}
.tile.g1 {
  --gc: var(--g1);
}
.tile.g2 {
  --gc: var(--g2);
}
.tile.g3 {
  --gc: var(--g3);
}
.tile.g4 {
  --gc: var(--g4);
}

.strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  padding-bottom: 4px;
}

.strip .band-name {
  margin: 0 0 6px;
  color: var(--mut);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.strip .band-name b {
  color: var(--ink);
}

.strip .nums {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.strip a {
  display: grid;
  place-items: center;
  min-width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--mut);
  font-weight: 700;
  text-decoration: none;
}

.strip a.done {
  color: var(--ok);
}

.strip a.locked {
  opacity: 0.5;
}

.strip a.on {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--bg);
}

.levels-page .page-head {
  text-align: center;
}

.levels-page .page-head h1 {
  font-size: 46px;
}

.step {
  display: grid;
  place-items: center;
  flex: none;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  font-size: 26px;
  text-decoration: none;
}

.step.off {
  opacity: 0.3;
}

.note {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--warn);
  color: var(--warn-ink);
}

.group h3 {
  display: flex;
  align-items: center;
  margin: 0 0 12px;
}

.group h3 .mut {
  margin-left: 12px;
  font-weight: 500;
}

.pcards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}

.pcard {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 18px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  text-align: left;
}

.pcard.on {
  border-color: var(--root);
}

.pcard .pct {
  font-size: 42px;
}

.pcard .stack {
  width: 100%;
}

.overall {
  display: flex;
  align-items: center;
  gap: 28px;
}

.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.controls-card {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 24px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 13px;
}

.chip-btn b {
  font-size: 16px;
}

.chip-btn.on {
  border-color: var(--root);
  background: color-mix(in srgb, var(--root) 10%, var(--surface));
}

/* ---------- item page and lessons ---------- */
.hero {
  padding: 36px 18px 32px;
  text-align: center;
  background: var(--root);
  color: var(--on);
}


.hero h2 {
  margin: 0;
  /* Long words get smaller so they fit on one line on a phone. */
  font-size: clamp(30px, min(14vw, calc(118vw / var(--len, 6))), 88px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
}

.hero .art {
  margin-right: 0.1em;
  font-size: 0.4em;
  font-weight: 600;
  opacity: 0.85;
}

.hero p {
  margin: 4px 0 0;
  font-size: 22px;
  font-weight: 600;
}

.item-page .hero {
  border-radius: 20px;
}

.crumb {
  margin: 0 0 4px;
}

.crumb a {
  display: inline-block;
  padding: 8px 0;
  color: var(--mut);
  text-decoration: none;
}

.status {
  text-align: center;
  color: var(--mut);
}

.status strong {
  color: var(--ink);
}

.lesson {
  position: relative;
  padding-bottom: 120px;
  overflow-x: clip; /* the slide animation must never add a horizontal scrollbar */
}

.hint {
  margin: -6px 14px 14px;
  font-size: 14px;
}

/* Lessons have no top navigation, so a way home sits in the corner of the hero. */
.lesson-home {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  left: 12px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.lesson-home:hover {
  background: rgba(255, 255, 255, 0.3);
}

.bar .pos {
  margin-right: 8px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* The new item slides in from the side the finger moved away from. */
@keyframes slide-from-right {
  from {
    opacity: 0;
    transform: translateX(32px);
  }
}

@keyframes slide-from-left {
  from {
    opacity: 0;
    transform: translateX(-32px);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .lesson.go-next .hero,
  .lesson.go-next .panel {
    animation: slide-from-right 0.22s ease-out;
  }

  .lesson.go-prev .hero,
  .lesson.go-prev .panel {
    animation: slide-from-left 0.22s ease-out;
  }
}

.chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 18px 14px;
}

.panel {
  width: calc(100% - 28px);
  max-width: 760px;
  margin: 0 auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
}

.item-page .panel {
  width: 100%;
}

.panel h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.panel h3.sep {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.panel h4 {
  margin: 20px 0 6px;
  font-size: 15px;
  color: var(--mut);
}

.row {
  display: flex;
  align-items: baseline;
  gap: 16px;
  margin: 4px 0;
}

.row .mut {
  min-width: 110px;
}

.row b {
  font-size: 22px;
}

.mn {
  margin: 6px 0;
  font-size: 19px;
  line-height: 1.5;
}

.ex {
  margin: 12px 0;
}

.ex p {
  margin: 0;
}

.ex .nl {
  font-size: 19px;
}

.play {
  min-height: 34px;
  margin-left: 10px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--mut);
  font-size: 13px;
  vertical-align: middle;
}

.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 20px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--bg);
}

.bar-end {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* ---------- quiz ---------- */
.quiz {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.qcard {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.qtop {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 18px;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 600;
  color: var(--mut);
}

.qclose {
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin: -4px 0 -4px -8px;
  border-radius: 50%;
  color: var(--mut);
}

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

.qbar {
  flex: 1;
  height: 6px;
  border-radius: 6px;
  background: var(--line);
}

.qbar i {
  display: block;
  height: 100%;
  border-radius: 6px;
  background: var(--ok);
}

.qhero {
  padding: 48px 16px;
  text-align: center;
  color: var(--banner-ink);
}

.qhero.nl {
  background: linear-gradient(160deg, var(--nl), color-mix(in srgb, var(--nl) 70%, #000));
}

.qhero.en {
  background: linear-gradient(160deg, var(--en), color-mix(in srgb, var(--en) 70%, #000));
}

.qhero h2 {
  margin: 0;
  font-size: clamp(28px, min(13vw, calc(112vw / var(--len, 6))), 76px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.03em;
  overflow-wrap: break-word;
}

.qlab {
  padding: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.qlab.nl {
  background: color-mix(in srgb, var(--nl) 14%, var(--surface));
}

.qlab.en {
  background: color-mix(in srgb, var(--en) 14%, var(--surface));
}

.qin {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 22px 22px 0;
}

/* An invisible twin of the → button on the left, so the answer box sits in the middle of the card. */
.qin::before {
  content: "";
  flex: none;
  width: 48px;
}

.qin input {
  padding: 14px 16px;
  font-size: 24px;
  text-align: center;
}

.qin input.ok {
  border-color: var(--ok);
  background: var(--ok);
  color: var(--ok-ink);
}

.qin input.bad {
  border-color: var(--bad);
  background: var(--bad);
  color: var(--bad-ink);
}

.send {
  flex: none;
  width: 48px;
  height: 48px;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: none;
  font-size: 22px;
}

.fb:not(:empty) {
  margin: 14px 22px 0;
  padding: 10px 14px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--mut);
  text-align: center;
}

.fb.warn {
  background: var(--warn);
  color: var(--warn-ink);
}

.fb.ok {
  color: var(--ok);
}

.fb.bad {
  color: var(--bad);
}

/* The floating note after a right answer: drops in over the new word, then fades away by itself. */
.qhero {
  position: relative;
}

.toast {
  position: absolute;
  top: 12px;
  left: 50%;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 24px);
  padding: 7px 14px 7px 8px;
  border-radius: 999px;
  background: var(--ok);
  color: var(--ok-ink);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  pointer-events: none;
  transform: translateX(-50%);
  animation: toast 1.6s ease forwards;
}

.toast.near {
  background: var(--warn);
  color: var(--warn-ink);
  animation-duration: 2.6s; /* a little longer, to read the right spelling */
}

.toast b {
  overflow: hidden;
  text-overflow: ellipsis;
}

.toast-word {
  font-weight: 500;
  opacity: 0.8;
  text-decoration-thickness: 1px;
}

.toast-word::after {
  content: " →";
}

.toast-tick {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.3);
  font-size: 13px;
}

.toast-stage {
  padding-left: 8px;
  border-left: 1px solid currentColor;
  font-weight: 500;
  opacity: 0.85;
}

@keyframes toast {
  0% {
    opacity: 0;
    transform: translate(-50%, -10px);
  }

  12%,
  70% {
    opacity: 1;
    transform: translate(-50%, 0);
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -6px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast {
    animation: toast-fade 1.6s linear forwards;
  }

  @keyframes toast-fade {
    0%,
    70% {
      opacity: 1;
    }

    100% {
      opacity: 0;
    }
  }
}

.qbtn {
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 14px 22px 22px;
}

.soft {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: none;
  color: var(--mut);
  font-size: 15px;
}

.soft:disabled {
  opacity: 0.4;
}

.info {
  padding: 0 22px 22px;
}

.ibox {
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.ibox .ans {
  margin: 2px 0 10px;
  font-size: 22px;
  font-weight: 700;
}

.sep2 {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

/* ---------- session summary ---------- */
/* Room below the last tiles for the fixed action bar, which can wrap to two rows on a phone. */
.page.summary {
  padding-bottom: 180px;
}

.summary h1 {
  margin: 8px 0 0;
  text-align: center;
  font-size: 36px;
}

.sum-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 28px;
  margin: 22px 0;
}

.ring {
  width: 140px;
  height: 140px;
}

.ring-bg {
  fill: none;
  stroke: var(--surface-2);
  stroke-width: 12;
}

.ring-fg {
  fill: none;
  stroke: var(--ok);
  stroke-width: 12;
  stroke-linecap: round;
}

.ring text {
  fill: var(--ink);
  font-size: 30px;
  font-weight: 800;
  font-family: inherit;
}

.sum-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.sum-stats > div {
  min-width: 112px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.sum-stats small {
  display: block;
  font-size: 13px;
  color: var(--mut);
}

.sum-stats b {
  font-size: 24px;
}

.sum-stats b span {
  font-size: 13px;
  font-weight: 500;
  color: var(--mut);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.pill {
  padding: 6px 16px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
}

.pill.up {
  background: color-mix(in srgb, var(--ok) 22%, var(--surface));
  color: var(--ok);
}

.pill.down {
  background: color-mix(in srgb, var(--bad) 22%, var(--surface));
  color: var(--bad);
}

.pill.learned {
  background: var(--ok);
  color: var(--ok-ink);
}

.pill.burned {
  background: var(--gold);
  color: var(--gold-ink);
}

.levelup {
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--ok);
  color: var(--ok-ink);
  text-align: center;
  font-weight: 700;
}

.sgroup h3 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 18px;
}

.count {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
}

.count.ok {
  background: var(--ok);
  color: var(--ok-ink);
}

.count.bad {
  background: var(--bad);
  color: var(--bad-ink);
}

.stiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.stile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 120px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--root);
  color: var(--on);
  text-decoration: none;
}


.stile.burned {
  background: var(--gold);
  color: var(--gold-ink);
}

.stile b {
  font-size: 22px;
}

.stile small {
  font-size: 11px;
  opacity: 0.9;
}

.actionbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  padding: 14px;
  border-top: 1px solid var(--line);
  background: var(--bg);
}

/* ---------- grammar ---------- */
/* Grammar sits apart from the vocabulary tabs, with a small divider, because it is a separate section. */
.nav .links .grammar-link {
  margin-left: 6px;
}

.nav .links .grammar-link::before {
  content: "";
  position: absolute;
  left: -4px;
  top: 14px;
  bottom: 14px;
  width: 1px;
  background: var(--line);
}

.grammar .page-head p {
  margin: 6px 0 0;
  max-width: 560px;
}

.ghead {
  align-items: flex-end;
}

.gcat + .gcat {
  margin-top: 26px;
}

.band .mut {
  font-weight: 500;
}

.gmeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.gcefr {
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--mut);
  font-size: 12px;
  font-weight: 700;
}

.gpill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--mut);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.gpill.st-0 {
  background: var(--g0);
}
.gpill.st-1 {
  background: var(--g1);
}
.gpill.st-2 {
  background: var(--g2);
}
.gpill.st-3 {
  background: var(--g3);
}
.gpill.st-4 {
  background: var(--g4);
}

.gpill.gst-new {
  background: none;
  color: var(--mut);
  box-shadow: inset 0 0 0 1px var(--line);
}

.gpill.gst-tried {
  background: var(--warn);
  color: var(--warn-ink);
}

.gpill.gst-up {
  background: var(--ok);
}

.gpill.gst-down {
  background: var(--bad);
}

.gq-topic {
  margin: 0 0 10px;
}

.grlist {
  display: grid;
  gap: 8px;
  max-width: 460px;
  margin: 18px auto 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.grlist li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 12px;
  border-radius: 10px;
  background: var(--surface-2);
}

.band {
  margin: 8px 0 12px;
  font-size: 14px;
  letter-spacing: 0.08em;
  color: var(--mut);
}

.glist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.gcard {
  display: flex;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.gcard:hover {
  border-color: var(--en);
}

.gnum {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--en) 14%, var(--surface));
  color: var(--en);
  font-weight: 800;
}

.gcard.done .gnum {
  background: var(--en);
  color: #fff;
}

.gbody {
  display: grid;
  gap: 3px;
}

.gbody small {
  color: var(--mut);
  font-size: 14px;
}

.gstat {
  font-size: 13px;
  font-weight: 700;
  color: var(--mut);
}

.gstat.done {
  color: var(--en);
}

.gstat.tried {
  color: var(--ink);
}

/* Words and examples quoted inside grammar explanations. */
em.nl {
  font-weight: 600;
}

.gtopic,
.gpage {
  max-width: 820px;
}

.gtext {
  font-size: 17px;
}

.gtext > p {
  margin: 0 0 14px;
}

.gtable {
  margin: 0 0 16px;
  overflow-x: auto;
}

.gtable table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.gtable th,
.gtable td {
  padding: 8px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.gtable th {
  color: var(--mut);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.gex {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
  padding: 12px 16px;
  border-left: 4px solid var(--en);
  border-radius: 0 12px 12px 0;
  background: var(--surface-2);
}

.gex p {
  display: grid;
  margin: 0;
}

.gex .nl {
  font-weight: 700;
}

.gtip {
  margin: 0 0 4px;
  padding: 12px 16px;
  border-radius: 12px;
  background: var(--warn);
  color: var(--warn-ink);
}

.gtip b {
  margin-right: 6px;
}

.gpractice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.gpractice h3 {
  margin: 0;
}

/* The action sits on the right, under the thumb, also when it wraps below the text on a phone. */
.gpractice .btn {
  margin-left: auto;
}

.gbig-sub {
  font-size: 14px;
  font-weight: 600;
  opacity: 0.9;
}

.gbig.off:has(.gbig-sub) {
  opacity: 0.75;
}

.gnav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.gnav a {
  padding: 8px 0;
  color: var(--mut);
  text-decoration: none;
}

.gnav a:hover {
  color: var(--ink);
}

.gq {
  padding: 30px 24px 10px;
  text-align: center;
}

.gprompt {
  display: block;
  margin: 0;
  font-size: clamp(24px, 5vw, 32px);
  font-weight: 700;
  line-height: 1.3;
}

.gblank {
  display: inline-block;
  min-width: 2.5em;
  margin: 0 4px;
  padding: 0 8px;
  border-bottom: 3px solid var(--en);
  color: var(--en);
}

.gblank.ok {
  color: var(--ok);
  border-color: var(--ok);
}

.ghint {
  display: inline-block;
  margin-top: 10px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--mut);
  font-size: 14px;
}

.gen {
  margin-top: 10px;
}

.gin {
  padding: 8px 22px 22px;
}

.gin .qin {
  padding: 0;
}

.gfb {
  margin: 0 22px 22px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--surface-2);
}

.gfb p {
  margin: 0 0 14px;
  line-height: 1.5;
}

.galso {
  display: block;
  margin-top: 4px;
  color: var(--mut);
  font-size: 15px;
}

.gnext-row,
.gnext-end {
  display: flex;
  align-items: center;
  gap: 12px;
}

.gnext-row {
  justify-content: space-between;
  flex-wrap: wrap;
}

.gnext-end {
  margin-left: auto;
}

/* The button to the point's explanation, named after it. */
.grule {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  max-width: 100%;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.grule span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.grule svg {
  flex: none;
  color: var(--gram);
}

.grule:hover {
  border-color: var(--gram);
}

.btn.gnext {
  min-width: 132px;
  color: #fff;
}

.btn.gnext.ok {
  background: var(--ok);
}

.btn.gnext.bad {
  background: var(--bad);
}

.gresult {
  text-align: center;
}

.gresult h2 {
  margin: 4px 0;
  font-size: 64px;
}

.gresult .actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-top: 16px;
}

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

  .gq {
    padding: 22px 16px 8px;
  }

  .gin {
    padding: 8px 14px 16px;
  }

  .gfb {
    margin: 0 14px 16px;
  }
}

/* ---------- settings ---------- */
.settings {
  max-width: 860px;
}

.theme-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
  gap: 12px;
  margin: 10px 0 18px;
}

.mode-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 6px;
}

.skin-label {
  margin: 20px 0 0;
}

.theme-card {
  display: grid;
  gap: 2px;
  padding: 10px 10px 12px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
}

.theme-card:hover {
  border-color: var(--mut);
}

.theme-card[aria-pressed="true"] {
  border-color: var(--root);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--root) 25%, transparent);
}

.theme-card b {
  margin-top: 8px;
  font-size: 15px;
}

.theme-card small {
  color: var(--mut);
  font-size: 13px;
  line-height: 1.3;
}

/* A tiny drawing of the theme: page, a card with two lines of text, and an accent pill. */
.tp {
  position: relative;
  display: block;
  height: 64px;
  border-radius: 9px;
  background: var(--tp-bg);
  box-shadow: inset 0 0 0 1px rgba(127, 127, 127, 0.25);
  overflow: hidden;
}

.tp i {
  position: absolute;
  display: block;
  border-radius: 4px;
}

.tp i:nth-child(1) {
  inset: 10px 12px 10px 12px;
  border-radius: 7px;
  background: var(--tp-card);
}

.tp i:nth-child(2) {
  top: 20px;
  left: 22px;
  width: 46%;
  height: 7px;
  background: var(--tp-ink);
}

.tp i:nth-child(3) {
  top: 34px;
  left: 22px;
  width: 28%;
  height: 12px;
  border-radius: 99px;
  background: var(--tp-accent);
}

.tp-system {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  padding: 0;
  background: none;
}

.tp-system .tp {
  border-radius: 0;
  box-shadow: none;
}

.tp-system .tp i:nth-child(2) {
  left: 18px;
  width: 52%;
}

.tp-system .tp i:nth-child(3) {
  left: 18px;
  width: 40%;
}

.font-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.font-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: left;
}

.font-card:hover {
  border-color: var(--mut);
}

.font-card[aria-pressed="true"] {
  border-color: var(--root);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--root) 25%, transparent);
}

.fc-sample {
  flex: none;
  width: 54px;
  font-size: 34px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
}

.fc-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.fc-text small {
  color: var(--mut);
  font-size: 13px;
  line-height: 1.3;
}

.fc-nl {
  margin-top: 4px;
  color: var(--root);
  font-size: 15px;
}

.switch {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  cursor: pointer;
}

.switch input {
  flex: none;
  appearance: none;
  position: relative;
  width: 46px;
  height: 28px;
  margin: 2px 0 0;
  border-radius: 99px;
  background: var(--line);
  cursor: pointer;
  transition: background 0.15s;
}

.switch input::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}

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

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

.switch span {
  display: grid;
  gap: 2px;
}

.fields {
  display: grid;
  gap: 18px;
  margin-top: 14px;
}

.fields label {
  display: grid;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
}

.fields select {
  width: 100%;
  font-weight: 400;
}

.fields small {
  font-weight: 400;
  font-size: 13px;
}

.fields output {
  font-weight: 500;
  color: var(--mut);
}

input[type="range"] {
  width: 100%;
  accent-color: var(--root);
}

.note.warn ul {
  margin: 8px 0 0;
  padding-left: 20px;
}

.note.warn li {
  margin: 4px 0;
}

.acct {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0 0 18px;
}

.acct b {
  overflow-wrap: anywhere;
}

.tag {
  display: inline-block;
  padding: 1px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.tag.ok {
  background: color-mix(in srgb, var(--ok) 18%, var(--surface));
  color: color-mix(in srgb, var(--ok) 75%, var(--ink));
}

.tag.warn {
  background: var(--warn);
  color: var(--warn-ink);
}

.forms2 {
  align-items: start;
}

.forms2 .form {
  padding: 16px;
  border-radius: 12px;
  background: var(--surface-2);
}

.forms2 .btn,
.reset-form .btn {
  justify-self: start;
}

.danger {
  border-color: color-mix(in srgb, var(--bad) 45%, var(--line));
}

.reset-form {
  max-width: 360px;
}

.reset-form .btn:disabled {
  opacity: 0.4;
}

.own-data {
  margin-top: 20px;
}

.own-data h4 {
  margin: 0;
  font-size: 17px;
}

.own-data p {
  margin: 4px 0 12px;
}

.legal-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 18px;
  padding: 8px 0 24px;
}

.legal-links a {
  padding: 8px 0; /* a comfortable finger target */
}

/* ---------- account gate (add or confirm an email) ---------- */
.gate {
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
}

.gate-card {
  display: grid;
  gap: 14px;
  width: min(440px, 100%);
  padding: 28px;
}

.gate-card h1 {
  margin: 0;
  font-size: 30px;
}

.gate-card .mut {
  margin: 0;
}

.gate-card > .link {
  justify-self: center;
}

.brand-line {
  margin: 0;
}

.gate-more summary {
  color: var(--mut);
  cursor: pointer;
  padding: 6px 0;
}

.gate-more .form {
  margin-top: 10px;
}

/* ---------- search ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 10vh 16px 16px;
  background: rgba(5, 10, 25, 0.55);
  backdrop-filter: blur(2px);
}

.palette {
  display: flex;
  flex-direction: column;
  width: min(620px, 100%);
  max-height: 80vh;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.4);
}

.sp-input {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--mut);
}

.sp-input input,
.sp-input input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  background: none;
  font-size: 18px;
  outline: none;
}

.sp-input input::-webkit-search-cancel-button {
  display: none;
}

.sp-close {
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: none;
  color: var(--mut);
  font-size: 12px;
}

#results {
  overflow-y: auto;
  overscroll-behavior: contain;
}

.sr-head {
  margin: 12px 18px 4px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--mut);
}

.sr-empty {
  margin: 0;
  padding: 22px 18px;
  color: var(--mut);
}

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

.sr {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  border-radius: 10px;
  text-decoration: none;
}

.sr:hover,
.sr[aria-selected="true"] {
  background: var(--surface-2);
}

.sr[aria-selected="true"] {
  box-shadow: inset 3px 0 0 var(--root);
}

.sr-tile {
  flex: none;
  min-width: 46px;
  max-width: 46%;
  padding: 7px 10px;
  border-radius: 9px;
  background: var(--root);
  color: var(--on);
  font-weight: 800;
  font-size: 16px;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}


.sr-main {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.sr-main b {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.sr-main small {
  color: var(--mut);
  font-size: 13px;
}

.sr-stage {
  flex: none;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  background: var(--mut);
}

.sr-stage.st-0 {
  background: var(--g0);
}
.sr-stage.st-1 {
  background: var(--g1);
}
.sr-stage.st-2 {
  background: var(--g2);
}
.sr-stage.st-3 {
  background: var(--g3);
}
.sr-stage.st-4 {
  background: var(--g4);
}

.sr-stage.st-lesson {
  background: var(--salmon);
  color: var(--salmon-ink);
}

.sr-stage.st-locked {
  background: none;
  color: var(--mut);
  box-shadow: inset 0 0 0 1px var(--line);
}

.sr-all {
  display: block;
  margin: 0 8px 8px;
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  color: var(--root);
  font-weight: 700;
  text-decoration: none;
}

.sr-all:hover,
.sr-all[aria-selected="true"] {
  text-decoration: underline;
}

.sp-keys {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  margin: 0;
  padding: 10px 18px;
  border-top: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--mut);
  font-size: 13px;
}

.sp-keys kbd {
  margin: 0 3px 0 0;
}

.search-form {
  display: flex;
  gap: 10px;
}

.search-page .sr-list {
  padding: 0;
}

.search-page h3 .mut {
  font-weight: 500;
}

@media (hover: none) and (pointer: coarse) {
  .sp-keys {
    display: none;
  }
}

@media (max-width: 560px) {
  .overlay {
    padding: 8px;
  }

  .palette {
    max-height: calc(100dvh - 16px);
  }
}

/* ---------- small screens ---------- */
@media (max-width: 900px) {
  .hero-row,
  .two,
  .stats3 {
    grid-template-columns: 1fr;
  }

  .card .stats3,
  .levels-page .stats3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .uname {
    display: none;
  }

  .user summary {
    padding: 4px;
  }

  .overall {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 700px) {
  /* Phones: one slim bar that stays in view, with the sections and search behind a menu button. */
  .nav-top {
    display: flex;
    gap: 10px;
    height: 56px;
    padding: 0 12px;
  }

  .nav-top .brand {
    margin-right: auto;
  }

  .nav-top > .search-bar,
  .nav > .links {
    display: none;
  }

  .burger {
    display: block;
  }

  .home-btn {
    display: grid;
  }

  .brand-name {
    display: none;
  }

  #banner .banner {
    top: 12px;
  }
}

@media (max-width: 560px) {
  .qin input {
    padding: 12px;
    font-size: 18px;
  }

  .card,
  .panel {
    padding: 18px 16px;
  }

  .page-head h1 {
    font-size: 32px;
  }

  .card-head {
    flex-wrap: wrap;
    gap: 10px;
  }

  .seg button {
    padding: 6px 11px;
    white-space: nowrap;
  }

  .stats3 {
    gap: 8px;
  }

  .stats3 > div {
    padding: 10px 12px;
  }

  .tiles {
    grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  }

  /* Dashboard: lessons and reviews side by side, the level card below them. */
  .hero-row {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .hero-card {
    min-height: 0;
    padding: 16px;
    border-radius: 16px;
  }

  .hero-card.level {
    grid-column: 1 / -1;
  }

  /* The faint Dutch word behind each card is decoration; on a small card it is just clutter. */
  .hero-card::after {
    display: none;
  }

  .hero-card .big {
    font-size: 48px;
  }

  .hero-card .sub {
    margin-bottom: 12px;
    font-size: 14px;
  }

  .hero-card .btn {
    width: 100%;
    padding: 10px 12px;
  }

  .hero-card .opt {
    display: none;
  }

  .page {
    padding: 16px 14px 120px;
  }

  .bar .batch {
    display: none;
  }

  .stats3 b {
    font-size: 20px;
  }

  .big3 b {
    font-size: 22px;
  }
}

/* ---------- typing on a phone ----------
   While a question waits for a typed answer, the quiz fills exactly the part of the screen above the
   keyboard and the page cannot scroll: the word stays in view, the answer box sits right above the keys.
   main.js sets html.typing and the --vv-* sizes from the visual viewport. */
html.typing,
html.typing body {
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
}

html.typing .quiz,
html.typing .gpage {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--vv-top, 0px);
  z-index: 30;
  display: flex;
  flex-direction: column;
  height: var(--vv-h, 100dvh);
  max-width: none;
  margin: 0;
  padding: 0;
  background: var(--surface);
}

html.typing .quiz > .center,
html.typing .gpage > .crumb {
  display: none;
}

html.typing .gpage > .card,
html.typing .qcard {
  flex: 1;
  min-height: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

html.typing .qtop {
  padding-top: calc(10px + env(safe-area-inset-top, 0px));
}

/* The word takes all the room that is left, so it is centred in whatever the keyboard leaves free. */
html.typing .qhero,
html.typing .gq {
  flex: 1 0 auto;
  min-height: 90px;
  display: grid;
  place-content: center;
  padding: 14px 16px;
}

html.typing .qhero h2 {
  font-size: clamp(26px, min(11vw, calc(112vw / var(--len, 6))), 64px);
}

/* After answering, the keyboard goes away and the feedback and item info need the space instead. */
html.typing .has-fb .qhero,
html.typing .has-fb .gq {
  flex: 0 0 auto;
}

html.typing .qlab {
  padding: 9px;
}

html.typing .qin {
  padding: 12px 14px;
}

html.typing .qin input {
  padding: 11px 14px;
  font-size: 20px;
}

html.typing .quiz:not(.has-fb) .qbtn {
  display: none;
}

html.typing .fb:empty {
  display: none;
}

html.typing .fb:not(:empty) {
  margin: 0 14px 10px;
}

html.typing .gin {
  padding: 0 14px 12px;
}

/* Thumb zone: on a phone the Next button after an answer sits on the right, about two thirds down the screen,
   where the thumb rests, instead of under the explanation wherever that ends. */
.qnext {
  display: none;
}

html.typing .qnext {
  position: fixed;
  right: 16px;
  bottom: calc(26% + env(safe-area-inset-bottom, 0px));
  z-index: 5;
}

/* Before an answer the sentence is the input's label: tapping it puts the cursor in the input. */
label.gprompt {
  cursor: text;
  -webkit-tap-highlight-color: transparent;
}

html.typing .gfb p {
  margin: 0;
}

/* Grammar: the rule and Next in a bar along the bottom of the screen. */
html.typing .gnext-row {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 5;
  flex-wrap: nowrap;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

html.typing .qnext {
  display: inline-flex;
}

html.typing .btn.gnext {
  min-width: 0;
  padding: 16px 26px;
  font-size: 18px;
}

html.typing .btn.qnext {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Room to scroll a long explanation clear of the button. */
html.typing .gpage.has-fb .qcard,
html.typing .quiz.has-fb .qcard {
  padding-bottom: 40vh;
}

/* ---------- grammar, built like the vocabulary ---------- */
.gsum {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
  margin: 18px 0 6px;
}

.gbig {
  flex: 1 1 150px;
  display: grid;
  gap: 2px;
  padding: 16px 20px;
  border-radius: 18px;
  color: #fff;
  text-decoration: none;
}

.gbig small {
  font-size: 15px;
  font-weight: 700;
  opacity: 0.92;
}

.gbig b {
  font-size: 44px;
  line-height: 1;
  letter-spacing: -0.03em;
}

.gbig.lessons {
  background: linear-gradient(135deg, #6f3418, #b4531d);
}

.gbig.reviews {
  background: linear-gradient(135deg, #1b3580, #2f66d8);
}

.gbig.off {
  opacity: 0.45;
  pointer-events: none;
}

.gcount {
  flex: 1 1 150px;
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 0;
  padding: 16px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
}

.gcount b {
  font-size: 44px;
  line-height: 1;
}

.gsum-note {
  margin: 4px 0 0;
}



/* The grammar colour: lessons and the exercise banner are violet, as words are blue and compounds orange. */
.hero.gram {
  background: linear-gradient(160deg, var(--gram), color-mix(in srgb, var(--gram) 70%, #000));
  color: #fff;
}

.hero.gram h2 {
  font-size: clamp(28px, min(9vw, calc(118vw / var(--len, 8))), 60px);
}

.hero.gram p {
  font-size: 18px;
  font-weight: 500;
  opacity: 0.92;
}

.hero.gram em.nl {
  color: inherit;
}

.ghero-eyebrow {
  margin: 0 0 10px !important;
  font-size: 13px !important;
  font-weight: 700 !important;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.8;
}

@media (prefers-reduced-motion: no-preference) {
  .lesson.go-next .panel.gtext,
  .lesson.go-prev .panel.gtext {
    animation-duration: 0.22s;
  }
}

.glesson .panel.gtext {
  margin-top: 6px;
}

.gcard-q .gq {
  position: relative;
  padding-bottom: 26px;
  background: linear-gradient(160deg, var(--gram), color-mix(in srgb, var(--gram) 70%, #000));
  color: #fff;
}

.gcard-q .gq .eyebrow,
.gcard-q .gq .gen {
  color: rgba(255, 255, 255, 0.82);
}

.gcard-q .gq .ghint {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.gcard-q .gq .gprompt {
  color: #fff;
}

.gcard-q .gq .gblank {
  border-bottom-color: rgba(255, 255, 255, 0.85);
  color: #fff;
}

.gcard-q .gq .gblank.ok {
  border-bottom-color: #7be3a4;
  color: #c9f7da;
}

/* After a miss: the right word in green, above your word crossed out (as ruby, so the line keeps its height). */
.gfix {
  margin: 0 4px;
  ruby-position: over;
}

.gwrong {
  color: #ffd0d0;
  font-size: 0.8em;
  text-decoration-thickness: 3px;
  opacity: 0.85;
}

.gright {
  padding-bottom: 2px;
  color: #7be3a4;
  font-size: 0.75em;
  font-weight: 800;
  letter-spacing: 0;
}

/* "Grammar lesson →" after a word session: the grammar colour, first in the row. */
.btn.gram {
  background: var(--gram);
  color: #fff;
}

/* Optional help on a grammar exercise: the point, then the translation, one tap (or Space) at a time. */
.gq-point {
  margin: 10px 0 0;
  font-size: 15px;
  color: rgba(255, 255, 255, 0.88);
}

.gq-point em.nl {
  color: inherit;
}

.ghint-btn {
  justify-self: center;
  width: auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  padding: 7px 14px;
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.ghint-btn kbd {
  border-color: rgba(255, 255, 255, 0.4);
  background: none;
  color: inherit;
  font-size: 11px;
}

.gq .ghint {
  justify-self: center;
}

/* ---------- admin panel ---------- */
.afilter input {
  width: 100%;
  height: 46px;
  margin: 8px 0 14px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.alist {
  display: grid;
  padding: 6px;
}

.agroups {
  display: grid;
  gap: 16px;
}

.agroup[hidden] {
  display: none;
}

.agroup-h {
  margin: 0;
  padding: 10px 14px 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--mut);
}

.agroup-h .mut {
  font-weight: 500;
}

.arow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(4, 76px);
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  color: inherit;
  text-decoration: none;
}

.arow[hidden] {
  display: none;
}

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

.arow:hover {
  background: var(--surface-2);
}

.aname {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  min-width: 0;
}

.aname b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.aname small {
  flex-basis: 100%;
}

.astat {
  display: grid;
  text-align: right;
}

.astat small {
  color: var(--mut);
  font-size: 12px;
}

.astat b {
  font-size: 18px;
}

.pill.admin,
.pill.warn {
  padding: 2px 10px;
  font-size: 12px;
}

.pill.admin {
  background: var(--gram);
  color: #fff;
}

.pill.warn {
  background: color-mix(in srgb, var(--gold) 25%, var(--surface));
  color: var(--ink);
}

.aemail {
  overflow-wrap: anywhere;
}

.apills {
  display: flex;
  gap: 6px;
}

.astats {
  margin-bottom: 16px;
}

.abar {
  display: flex;
  height: 14px;
  overflow: hidden;
  margin: 6px 0 10px;
  border-radius: 999px;
  background: var(--surface-2);
}

.abar i {
  display: block;
}

.abar .g0 {
  background: var(--g0);
}

.abar .g1 {
  background: var(--g1);
}

.abar .g2 {
  background: var(--g2);
}

.abar .g3 {
  background: var(--g3);
}

.abar .g4 {
  background: var(--g4);
}

.aactions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 4px;
}

.anote p {
  margin: 0;
}

.anote .alink-url {
  margin-top: 8px;
}

.alink-url {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--ink);
  font: 14px ui-monospace, monospace;
}

@media (max-width: 700px) {
  .arow {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .aname {
    grid-column: 1 / -1;
  }

  .astat {
    text-align: left;
  }
}

.anote {
  margin: 0 0 14px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--surface);
}

/* Read by screen readers, not shown. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.atabs {
  display: flex;
  gap: 6px;
  margin: 0 0 18px;
}

.atabs a {
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--mut);
  font-weight: 600;
  text-decoration: none;
}

.atabs a[aria-current] {
  background: var(--surface-2);
  color: var(--ink);
}

.wrow {
  grid-template-columns: minmax(0, 1fr) 76px;
}

.aword {
  display: grid;
  gap: 16px;
}

.aword textarea,
.aword select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}

.aword textarea {
  resize: vertical;
}

.aword input[readonly] {
  opacity: 0.7;
}

.agrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}

.asteps {
  display: grid;
  gap: 8px;
  padding-left: 20px;
}

@media (max-width: 700px) {
  .wrow {
    grid-template-columns: minmax(0, 1fr) 60px;
  }

  .wrow .aname {
    grid-column: auto;
  }
}

/* Save sits on the right, under the thumb. */
.aword .aactions {
  justify-content: flex-end;
}

/* Words in the admin panel, folded per level. */
.alevels {
  display: grid;
  gap: 10px;
}

.alevel {
  padding: 0;
}

.alevel[hidden] {
  display: none;
}

.alevel summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 16px 20px;
  cursor: pointer;
  list-style: none;
}

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

.alevel summary::before {
  content: "›";
  display: inline-block;
  width: 12px;
  color: var(--mut);
  transition: transform 0.15s;
}

.alevel[open] summary::before {
  transform: rotate(90deg);
}

.wgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 2px 8px;
  padding: 0 10px 12px;
}

.wgrid .wrow {
  grid-template-columns: minmax(0, 1fr);
  padding: 8px 10px;
}

.wgrid .arow + .arow {
  border-top: 0;
}

.wgrid .aname b,
.wgrid .aname small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Recordings: the speaker under a word's pronunciation, and the credits page */
.credit {
  margin: 4px 0 0;
  font-size: 12px;
}

.credit-groups {
  display: grid;
  gap: 12px;
}

.credit-group summary {
  cursor: pointer;
}

.credit-words {
  margin: 12px 0 0;
  line-height: 1.8;
}

.pnote {
  max-width: 34ch;
  margin: 6px 0 0;
  font-size: 13px;
}

.pnote.src {
  font-size: 11px;
}

/* Admin → Words: which words have a recording */
.arec {
  margin-left: 6px;
  color: var(--ok);
  font-size: 13px;
}

.wrow .pill.warn {
  margin-left: 8px;
  vertical-align: 2px;
}

.achk {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: -4px 0 14px;
  color: var(--mut);
  font-size: 14px;
}

/* Dashboard level card: Words / Grammar tabs */
button.tab {
  color: inherit;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.tabs-note {
  margin: 10px 0 0;
  font-size: 12px;
}

.chip.gchip.off {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--mut);
}

/* Levels page: grammar tiles hold a title and a one-line summary */
.gtiles .tile-word {
  font-size: 16px;
}

.gtile.ready {
  background: var(--surface-2);
  color: var(--ink);
  box-shadow: none;
}

.gpill.gst-later {
  background: transparent;
  border: 1px dashed var(--line);
  color: var(--mut);
}

/* Language lab (beta) */
.badge.beta {
  background: var(--gram);
  color: #fff;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.labgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.labcourse h3 {
  margin: 6px 0 4px;
}

.labflag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
}

.labbtns {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.labbtns .btn.off {
  opacity: 0.45;
  pointer-events: none;
}

.labwords {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.labword h3 {
  margin: 4px 0;
  font-size: 26px;
}

.labsrc {
  margin: 0 0 10px;
  color: var(--mut);
  font-size: 17px;
}

.labex {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
}

.quiz.lab .fbwrap .fb {
  margin: 14px 22px 22px;
}

/* Beta: course switcher next to the logo */
.course-switch {
  position: relative;
  margin-left: 10px;
}

.course-switch summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
  font-weight: 700;
  font-size: 14px;
}

.course-switch summary::-webkit-details-marker {
  display: none;
}

.course-switch .menu {
  position: absolute;
  left: 0;
  top: calc(100% + 6px);
  z-index: 30;
  display: grid;
  min-width: 230px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
}

.course-switch .menu a {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 10px;
  border-radius: 10px;
  color: inherit;
  text-decoration: none;
}

.course-switch .menu a:hover,
.course-switch .menu a[aria-current] {
  background: var(--surface-2);
}

.course-switch .menu small {
  color: var(--mut);
}

.course-switch .cs-all {
  border-top: 1px solid var(--line);
  border-radius: 0 0 10px 10px;
  color: var(--mut);
  font-size: 13px;
}

@media (max-width: 560px) {
  .course-switch .cs-name {
    display: none;
  }
}

/* Beta: profile */
.pcourses {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
}

.pcourse {
  display: block;
  color: inherit;
  text-decoration: none;
}

.pc-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.pc-level {
  margin-left: auto;
  font-weight: 800;
}

.pc-level small {
  color: var(--mut);
  font-weight: 500;
}

.pbar {
  height: 10px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}

.pbar i {
  display: block;
  height: 100%;
  background: var(--ok);
}

.pcourse p {
  margin: 10px 0 0;
  font-size: 14px;
}

.pshare {
  margin-top: 18px;
}

.pcard-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 14px;
}

.pshare p {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.course-switch .cs-name small {
  color: var(--mut);
  font-weight: 500;
}

/* The logo and (for beta testers) the course switcher share the first column of the top bar. */
.brand-wrap {
  display: flex;
  align-items: center;
  min-width: 0;
  justify-self: start;
}

@media (max-width: 700px) {
  .nav-top .brand-wrap {
    margin-right: auto;
  }
}

.course-switch summary {
  white-space: nowrap;
}

.course-switch .cs-from {
  color: var(--mut);
  font-weight: 500;
  font-size: 12px;
}

@media (max-width: 980px) {
  .course-switch .cs-from {
    display: none;
  }
}

/* The top bar's first column is narrow: the switcher shows just the flag there, and the full names in its menu. */
.course-switch .cs-from {
  display: none;
}

@media (max-width: 1240px) {
  .course-switch .cs-name {
    display: none;
  }
}

/* Audio in lessons and the quiz: the auto-play switch at the top, and replay left of the answer box */
.qaudio {
  flex: none;
  height: 40px;
  margin-left: 12px;
  padding: 0 14px 0 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  font: 700 14px var(--font);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--mut);
  cursor: pointer;
}

.qaudio.on {
  background: var(--surface-2);
  color: var(--ink);
}

.lesson-audio {
  position: absolute;
  top: calc(12px + env(safe-area-inset-top, 0px));
  right: 12px;
  z-index: 2;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
}

.lesson-audio.on {
  color: #fff;
}

.lesson-audio:hover,
.qaudio:hover {
  filter: brightness(1.15);
}

/* The replay button takes the place of the invisible twin that keeps the answer box centred. */
.qin.has-replay::before {
  display: none;
}

.qreplay {
  flex: none;
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 2px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}

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

/* Lessons: a play button next to the auto-play switch */
.lesson-replay {
  right: 64px;
}

/* Profile: the card first, the share buttons under it */
.profile .pshare {
  margin: 0 0 22px;
}

.pshare-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0 0;
}

.pshare-note {
  margin: 10px 0 0;
  font-size: 14px;
}

.profile .legend {
  margin: 0 0 10px;
}

.pcourse .stack {
  margin: 4px 0 0;
}

/* Quiz item info: small uppercase labels (Meaning or Spelling, Mnemonic, Examples), unlike any content text */
.ibox .ilab {
  display: block;
  margin-top: 16px;
  color: var(--mut);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.ibox .ilab.first {
  margin-top: 0;
}

.ibox .ilab + .mn,
.ibox .ilab + .ex {
  margin-top: 2px;
}

/* Lessons: the switch is a pill too ("Auto"), and the play button sits left of it */
.lesson-audio:not(.lesson-replay) {
  width: auto;
  padding: 0 14px 0 11px;
  display: flex;
  align-items: center;
  gap: 6px;
  border-radius: 999px;
  font: 700 14px var(--font);
}

.lesson-replay {
  right: auto;
  left: 64px;
}

/* ---------- grammar point in a sheet over an exercise ---------- */
body:has(.gsheet) {
  overflow: hidden;
}

.gsheet-back {
  position: fixed;
  inset: 0;
  margin: 0 !important;
  z-index: 60;
  background: rgba(0, 0, 0, 0.5);
  animation: gsheet-fade 0.2s ease-out;
}

.gsheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 61;
  margin: 0 !important;
  display: flex;
  flex-direction: column;
  max-height: 88dvh;
  padding: 0 0 env(safe-area-inset-bottom, 0px);
  border-radius: 22px 22px 0 0;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.35);
  outline: none;
  transition: transform 0.2s ease-out;
  animation: gsheet-up 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.gsheet.closing {
  transform: translateY(100%) !important;
}

.gsheet-back.closing {
  opacity: 0;
  transition: opacity 0.2s;
}

.gsheet-grab {
  flex: none;
  width: 40px;
  height: 5px;
  margin: 8px auto 0;
  border-radius: 999px;
  background: var(--line);
}

.gsheet-head {
  flex: none;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 20px 12px;
  border-bottom: 1px solid var(--line);
  touch-action: none;
}

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

.gsheet-head h2 {
  margin: 2px 0 4px;
  font-size: 24px;
}

.gsheet-head .mut {
  margin: 0;
  font-size: 15px;
}

.gsheet-head .eyebrow {
  margin: 0;
}

.gsheet-x {
  flex: none;
}

.gsheet-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 20px 24px;
}

@keyframes gsheet-up {
  from {
    transform: translateY(100%);
  }
}

@keyframes gsheet-fade {
  from {
    opacity: 0;
  }
}

/* On a computer: a panel in the middle of the screen. */
@media (min-width: 760px) and (hover: hover) {
  .gsheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: min(680px, calc(100vw - 48px));
    max-height: 82vh;
    border-radius: 22px;
    transform: translate(-50%, -50%);
    animation: gsheet-pop 0.2s ease-out;
  }

  .gsheet.closing {
    opacity: 0;
    transform: translate(-50%, -48%) !important;
    transition: opacity 0.15s, transform 0.15s;
  }

  .gsheet-grab {
    display: none;
  }

  .gsheet-head {
    padding-top: 18px;
  }
}

@keyframes gsheet-pop {
  from {
    opacity: 0;
    transform: translate(-50%, -46%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .gsheet,
  .gsheet-back {
    animation: none;
  }
}

/* ---------- add to home screen ---------- */
.inote {
  padding: 14px 16px;
}

.inote-row {
  display: grid;
  grid-template-columns: 44px 1fr auto auto;
  align-items: center;
  gap: 12px;
}

.inote-icon {
  border-radius: 11px;
}

.inote-text {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.inote-text .mut {
  font-size: 14px;
}

.inote-x {
  width: 34px;
  height: 34px;
  border: 0;
  background: none;
  color: var(--mut);
}

/* Phones: the button gets its own row, under the text. */
@media (max-width: 560px) {
  .inote-row {
    grid-template-columns: 44px 1fr auto;
  }

  .inote-btn {
    order: 3;
    grid-column: 1 / -1;
  }
}

.isteps {
  display: grid;
  gap: 12px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.isteps li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.5;
}

.isteps small {
  display: block;
}

.inum {
  flex: none;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  font-size: 14px;
  font-weight: 700;
}

.ishare {
  vertical-align: -3px;
  color: var(--en);
}
