/* Deutsch lernen – one stylesheet for the whole app.
   Colours are defined once as variables; dark mode follows the system setting. */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --surface-2: #f0eee8;
  --text: #1f2430;
  --muted: #6b7080;
  --border: #e2dfd6;
  --primary: #2f5bd3;
  --primary-text: #ffffff;
  --ok: #1f8a4c;
  --ok-bg: #e5f5ec;
  --ko: #c8332b;
  --ko-bg: #fbe9e7;
  --almost: #a76a00;
  --almost-bg: #fff3d6;
  --der: #2f6fd6;
  --die: #d23a5c;
  --das: #1f9a5b;
  --shadow: 0 1px 2px rgba(20, 20, 30, .06), 0 4px 14px rgba(20, 20, 30, .05);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14161c;
    --surface: #1d2028;
    --surface-2: #262a34;
    --text: #e8e9ee;
    --muted: #9aa0ae;
    --border: #323744;
    --primary: #6d8ff0;
    --primary-text: #0f1220;
    --ok: #4fc483;
    --ok-bg: #173527;
    --ko: #f0766d;
    --ko-bg: #3d1e1c;
    --almost: #f2b94b;
    --almost-bg: #3a2e14;
    --der: #6ea2ff;
    --die: #ff7b98;
    --das: #55d391;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

h1 { font-size: 1.8rem; margin: .4em 0 .3em; letter-spacing: -.01em; }
h2 { font-size: 1.25rem; margin: .6em 0 .4em; }
h3 { font-size: 1.05rem; margin: .2em 0 .3em; }
a { color: var(--primary); }

.muted { color: var(--muted); }
.small { font-size: .85rem; }
.big { font-size: 1.2rem; }
.center { text-align: center; }
.error { color: var(--ko); min-height: 1.5em; }
.hidden { display: none !important; }
.only-mobile { display: none; }

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

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.mainnav { display: flex; gap: 4px; }

.mainnav a {
  padding: 7px 12px;
  border-radius: 9px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
}

.mainnav a:hover { background: var(--surface-2); color: var(--text); }
.mainnav a.active { background: var(--surface-2); color: var(--text); }
.mainnav .nav-icon, .mainnav .nav-short { display: none; }   /* only in the phone tab bar */
.topbar .mainnav { margin-left: auto; }
.settings-link { padding: 7px 10px; border-radius: 9px; color: var(--muted); text-decoration: none; font-size: 1.1rem; line-height: 1; }
.settings-link:hover, .settings-link.active { background: var(--surface-2); color: var(--text); }

.container { max-width: 1040px; margin: 0 auto; padding: 16px 20px 64px; }

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

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

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 28px; align-items: start; }

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

.section-title { margin-top: 1.4em; }

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .05s;
  min-height: 44px;
}

.btn:hover:not(:disabled) { background: var(--surface-2); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { cursor: default; opacity: .75; }
.btn:focus-visible, input:focus-visible, select:focus-visible, .flashcard:focus-visible, .chip:focus-visible, .tile:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary) 45%, transparent);
  outline-offset: 2px;
}

.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--primary) 88%, black); }
.btn.success { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: var(--ko-bg); border-color: transparent; color: var(--ko); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover:not(:disabled) { color: var(--text); }
.btn.small { min-height: 34px; padding: 6px 12px; font-size: .85rem; }
.btn.wide { width: 100%; }
.btn.toggle { min-width: 80px; }
.btn.toggle.active { background: var(--primary); border-color: var(--primary); color: var(--primary-text); }
.btn.pulse { animation: pulse .6s; }

.key-hint {
  display: inline-grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .75rem;
  font-weight: 700;
}

@media (pointer: coarse) { .key-hint { display: none; } }

.badge {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 99px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 600;
}

.badge.good { background: var(--ok-bg); color: var(--ok); }
.badge.mid { background: var(--almost-bg); color: var(--almost); }

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

.login-page { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.login-card { width: 100%; max-width: 360px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px; box-shadow: var(--shadow); }
.login-card .logo { display: flex; align-items: center; gap: 12px; }
.login-card h1 { font-size: 1.5rem; margin: 0; }
.login-card form { display: grid; gap: 10px; margin-top: 18px; }
.login-card label { font-weight: 600; }

input[type="text"], input[type="password"], input[type="search"], select {
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 1.05rem;
}

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

.hero h1 { margin-bottom: 0; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin: 16px 0; }
.stat { display: flex; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.stat-icon { font-size: 1.6rem; }
.stat-value { font-size: 1.4rem; font-weight: 750; line-height: 1.1; }
/* long words wrap inside the tile on a phone instead of sticking out */
.stat > div { min-width: 0; overflow-wrap: break-word; hyphens: auto; }

.card.highlight { display: flex; justify-content: space-between; align-items: center; gap: 18px; flex-wrap: wrap; border-left: 5px solid var(--primary); }
.card.highlight h2 { margin-top: 0; }

.tile-link { color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.tile-link:hover, .card.game:hover:not(.disabled), .topic-card:hover { border-color: var(--primary); transform: translateY(-1px); }
.tile-icon { font-size: 1.7rem; }

/* ------------------------------------------------------------ vocabulary */

.switch { display: flex; align-items: center; gap: 8px; margin: 6px 0 12px; cursor: pointer; flex-wrap: wrap; }
.switch input, .subtopic input, .topic summary input { width: 18px; height: 18px; accent-color: var(--primary); flex: none; }

.topics { display: grid; gap: 8px; }
.topic { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; }
.topic summary { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; list-style: none; }
.topic summary::-webkit-details-marker { display: none; }
.topic summary::after { content: "›"; margin-left: 4px; color: var(--muted); transition: transform .15s; }
.topic[open] summary::after { transform: rotate(90deg); }
.topic-name { flex: 1; font-weight: 600; }
.subtopics { display: grid; gap: 2px; padding: 0 10px 10px 38px; }
.subtopic { display: flex; align-items: center; gap: 10px; padding: 6px 4px; cursor: pointer; border-radius: 8px; }
.subtopic:hover { background: var(--surface-2); }
.subtopic span:nth-child(2) { flex: 1; min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 600px) {
  .subtopics { padding-left: 22px; }
  .subtopic .meter { width: 40px; }
}

.meter { display: inline-block; width: 60px; height: 6px; border-radius: 99px; background: var(--border); overflow: hidden; vertical-align: middle; }
.meter-fill { display: block; height: 100%; background: var(--ok); border-radius: 99px; }

.games { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin-top: 10px; }
.card.game { display: flex; flex-direction: column; gap: 4px; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.card.game p { flex: 1; margin: 0 0 8px; }
.card.game .badge { align-self: flex-start; }
.card.game.disabled { opacity: .5; }

/* ------------------------------------------------------------ word list */

.search { margin: 8px 0; }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
table.words { width: 100%; border-collapse: collapse; }
.words th, .words td { padding: 9px 12px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.words th { font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--surface-2); }
.words tr:last-child td { border-bottom: 0; }
.words .productive { font-weight: 700; }

/* ------------------------------------------------------------ sessions */

.session-head { display: flex; align-items: center; gap: 14px; justify-content: space-between; }
.session-head h2 { margin: .3em 0; flex: 1; text-align: center; }
.back { color: var(--muted); text-decoration: none; font-weight: 600; white-space: nowrap; }
.back:hover { color: var(--text); }

.progress { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin: 8px 0 24px; }
.progress-fill { height: 100%; width: 0; background: var(--primary); border-radius: 99px; transition: width .3s; }

.question { max-width: 640px; margin: 0 auto; }
/* "d__ T____": first letter and number of letters */
.letter-hint { text-align: center; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1.25rem; letter-spacing: 0.18em; color: var(--muted); margin: 4px 0 12px; overflow-wrap: anywhere; }
.prompt { font-size: 1.6rem; font-weight: 700; text-align: center; margin: 12px 0 6px; overflow-wrap: anywhere; }
.big-word { font-size: 2.4rem; }

.options { display: grid; gap: 10px; margin-top: 18px; }
.btn.option { justify-content: flex-start; text-align: left; padding: 12px 16px; font-weight: 500; }

.btn.right, .chip.right { background: var(--ok-bg); border-color: var(--ok); color: var(--ok); opacity: 1; }
.btn.wrong { background: var(--ko-bg); border-color: var(--ko); color: var(--ko); opacity: 1; }
input.right { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); }
input.wrong { border-color: var(--ko); background: var(--ko-bg); color: var(--ko); }

.answer-form { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.answer-form .answer-input { flex: 1 1 240px; font-size: 1.2rem; }
.answer-form.column { flex-direction: column; align-items: stretch; }

.umlauts { display: flex; gap: 6px; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.key { min-width: 40px; height: 40px; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--text); font: inherit; font-size: 1.05rem; cursor: pointer; }
.key:hover { background: var(--surface-2); }

.feedback { max-width: 640px; margin: 20px auto 0; border-radius: var(--radius); }
.feedback:empty { display: none; }
.feedback.ok, .feedback.ko, .feedback.almost { display: flex; justify-content: space-between; align-items: center; gap: 14px; flex-wrap: wrap; padding: 14px 18px; }
.feedback.ok { background: var(--ok-bg); color: var(--ok); }
.feedback.ko { background: var(--ko-bg); color: var(--ko); }
.feedback.almost { background: var(--almost-bg); color: var(--almost); }
.feedback b { color: var(--text); }
.feedback .note { color: var(--text); opacity: .8; font-size: .9rem; margin-top: 4px; }

/* flashcards */
.flashcard { display: block; width: 100%; max-width: 520px; height: 260px; margin: 0 auto 18px; padding: 0; border: 0; background: none; perspective: 1200px; cursor: pointer; font: inherit; color: inherit; }
.flashcard-inner { position: relative; width: 100%; height: 100%; transition: transform .45s; transform-style: preserve-3d; }
.flashcard.flipped .flashcard-inner { transform: rotateY(180deg); }
.face { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; padding: 24px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--shadow); backface-visibility: hidden; -webkit-backface-visibility: hidden; text-align: center; }
.face-back { transform: rotateY(180deg); background: var(--surface-2); }
.face-text { font-size: 1.7rem; font-weight: 700; overflow-wrap: anywhere; }
.rate .btn { min-width: 150px; }

.art-der { color: var(--der); }
.art-die { color: var(--die); }
.art-das { color: var(--das); }

.gender-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 24px; }
.btn.gender { font-size: 1.3rem; padding: 18px 0; border-width: 2px; }
.btn.gender.art-der { border-color: var(--der); }
.btn.gender.art-die { border-color: var(--die); }
.btn.gender.art-das { border-color: var(--das); }

/* grammar */
.gap-line { font-size: 1.35rem; line-height: 2.4; text-align: center; margin: 8px 0 16px; }
input.gap-input { display: inline-block; width: auto; min-width: 3ch; margin: 0 3px; padding: 2px 6px; border: 0; border-bottom: 2px solid var(--primary); border-radius: 6px 6px 0 0; background: var(--surface-2); color: var(--text); font: inherit; text-align: center; }
input.gap-input.right { border-bottom-color: var(--ok); }
input.gap-input.wrong { border-bottom-color: var(--ko); }

.order-target, .order-source { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; min-height: 58px; padding: 10px; border-radius: 12px; }
.order-target { border: 2px dashed var(--border); margin-bottom: 12px; align-items: center; }
.order-target.right { border-color: var(--ok); background: var(--ok-bg); }
.order-target.wrong { border-color: var(--ko); background: var(--ko-bg); }
.chip { padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; font-size: 1.1rem; cursor: pointer; box-shadow: var(--shadow); }
.chip:hover:not(:disabled) { border-color: var(--primary); }
.chip:disabled { cursor: default; }

.rules ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.topic-card { display: flex; flex-direction: column; gap: 2px; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; }
.topic-card .badge { align-self: flex-start; margin-top: 6px; }

/* summary */
.summary { display: grid; gap: 14px; justify-items: center; }
.summary .card { width: 100%; }
.score-ring { display: grid; place-items: center; width: 130px; height: 130px; border-radius: 50%; font-size: 2rem; font-weight: 800; border: 8px solid; }
.score-ring.good { border-color: var(--ok); color: var(--ok); }
.score-ring.mid { border-color: var(--almost); color: var(--almost); }
.score-ring.low { border-color: var(--ko); color: var(--ko); }
.mistakes { margin: 0; padding-left: 20px; display: grid; gap: 6px; }

/* match game */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tile { min-height: 72px; padding: 10px; border: 2px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font: inherit; font-weight: 600; cursor: pointer; overflow-wrap: anywhere; transition: opacity .3s, background .15s; }
.tile-tr { font-weight: 400; }
.tile.selected { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 12%, var(--surface)); }
.tile.done { border-color: var(--ok); background: var(--ok-bg); color: var(--ok); opacity: .45; cursor: default; }
.tile.shake { animation: shake .35s; border-color: var(--ko); }

/* settings */
.card.form { display: grid; gap: 8px; max-width: 520px; margin-bottom: 16px; }
.card.form label:not(.switch) { font-weight: 600; margin-top: 6px; }

.sync-status { position: fixed; bottom: 14px; right: 14px; padding: 6px 12px; border-radius: 99px; background: var(--text); color: var(--bg); font-size: .8rem; opacity: 0; transition: opacity .3s; pointer-events: none; }
.sync-status.visible { opacity: .85; }

@keyframes shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@keyframes pulse { 50% { transform: scale(1.06); border-color: var(--ko); } }

/* ------------------------------------------------------------ phones */

@media (max-width: 760px) {
  .two-col { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .hide-mobile { display: none; }
  .only-mobile { display: inline-flex; }
}

@media (max-width: 600px) {
  body { font-size: 15px; }
  .container { padding: 12px 16px 56px; }
  .topbar { padding: 8px 12px; }
  .brand span { display: inline; }
  /* the menu becomes a tab bar at the bottom of the screen, within reach of your thumb */
  .mainnav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: flex; justify-content: space-around; gap: 0;   /* long labels (Werkwoorden) get more room */
    padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
    background: var(--surface); border-top: 1px solid var(--border);
  }
  .mainnav a {
    display: flex; flex-direction: column; align-items: center; gap: 2px;
    flex: 1 1 auto; padding: 6px 2px; border-radius: 10px; font-size: .68rem; font-weight: 600; min-width: 0;
  }
  .mainnav a.active { background: none; color: var(--primary); }
  .mainnav .nav-icon { display: block; font-size: 1.3rem; line-height: 1.2; filter: grayscale(1); opacity: .75; }
  .mainnav a.active .nav-icon { filter: none; opacity: 1; }
  .mainnav .nav-label { display: none; }
  .mainnav .nav-short { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .container { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  /* ä ö ü ß above the answer field: below it, the phone keyboard would cover them */
  .question { display: flex; flex-direction: column; }
  .question > * { margin-top: 0; }
  .question > .prompt { margin-top: 8px; }
  .question > form { order: 2; margin-top: 8px; }
  .question > .umlauts { order: 1; margin-top: 4px; }
  /* while typing an answer in an exercise the keyboard needs the room (not for search fields or checkboxes) */
  body:has(.question input[type="text"]:focus, .report-form textarea:focus) .mainnav { display: none; }
  h1 { font-size: 1.5rem; }
  .prompt { font-size: 1.35rem; }
  .big-word { font-size: 2rem; }
  .flashcard { height: 220px; }
  .face-text { font-size: 1.4rem; }
  .tiles { grid-template-columns: repeat(2, 1fr); }
  .gap-line { font-size: 1.15rem; }
  .rate .btn { min-width: 0; flex: 1; }
  .session-head h2 { font-size: 1.05rem; }
  .grid { grid-template-columns: minmax(0, 1fr); }
}

input.almost { border-color: var(--almost); background: var(--almost-bg); color: var(--almost); }
.answer-form.column { max-width: 520px; margin-left: auto; margin-right: auto; }
.answer-form.column .answer-input { flex: none; }

.lang-switch { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.lang-switch button { padding: 4px 10px; border: 1px solid var(--border); border-radius: 8px; background: none; color: var(--muted); font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.lang-switch button.active { background: var(--surface-2); color: var(--text); }

/* level overview on the start page: new = grey, levels 1-2 = learning (amber), 3+ = learned (green) */
.card.levels { margin-top: 16px; }
.card.levels h3 { margin-top: 0; }
.level-bar { display: flex; height: 14px; border-radius: 99px; overflow: hidden; background: var(--surface-2); margin: 10px 0; }
.level-bar .lvl { flex-basis: 0; min-width: 3px; }
.level-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; margin-bottom: 6px; }
.legend-item { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); }
.legend-item b { color: var(--text); }
.dot { width: 10px; height: 10px; border-radius: 50%; }
.lvl-0 { background: color-mix(in srgb, var(--muted) 35%, var(--surface-2)); }
.lvl-1 { background: color-mix(in srgb, var(--almost) 55%, var(--surface)); }
.lvl-2 { background: var(--almost); }
.lvl-3 { background: color-mix(in srgb, var(--ok) 55%, var(--surface)); }
.lvl-4 { background: color-mix(in srgb, var(--ok) 70%, var(--surface)); }
.lvl-5 { background: color-mix(in srgb, var(--ok) 85%, var(--surface)); }
.lvl-6, .lvl-7 { background: var(--ok); }

/* Lektionen */
.lesson-card { position: relative; }
.lesson-number { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--surface-2); font-weight: 800; color: var(--primary); }
.lesson-card.general .lesson-number { color: var(--muted); }
.lesson-progress { display: grid; gap: 4px; margin-top: 6px; }
.lesson-progress .meter { width: 100%; }
.theme-list { display: grid; gap: 0; padding: 6px 0; }
.theme-row { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1.2fr) 56px 80px; gap: 12px; align-items: center; padding: 10px 18px; color: var(--text); text-decoration: none; border-bottom: 1px solid var(--border); }
.theme-row:last-child { border-bottom: 0; }
.theme-row:hover { background: var(--surface-2); }
.theme-row .meter { width: 80px; }
.section-title h2 { margin: 0; }
@media (max-width: 600px) {
  .theme-row { grid-template-columns: minmax(0, 1fr) 48px 60px; }
  .theme-row > span:nth-child(2) { display: none; }
  .theme-row .meter { width: 60px; }
}

/* Not enough room for the app name next to five menu items (a phone has the tab bar instead) */
@media (max-width: 900px) and (min-width: 601px) {
  .brand span { display: none; }
}

.end-mark { font-size: 1.4rem; font-weight: 700; color: var(--muted); padding: 0 4px; }

.personal-password { border-top: 1px solid var(--border); padding-top: 10px; margin: 6px 0 10px; }
.personal-password h4 { margin: 0 0 4px; }
.personal-password input { flex: 1 1 200px; }

.mini-progress { display: inline-flex; align-items: center; gap: 8px; }
.progress-cell { white-space: nowrap; }
.progress-cell .meter { display: block; margin-top: 4px; }

/* two-colour bar: learned (green) + being learned (yellow) */
.meter.split { display: inline-flex; }
.meter.split > span { display: block; height: 100%; flex: none; }
.meter.split .meter-fill { border-radius: 0; }
.meter-learning { background: var(--almost); }

.gender-hint { margin: -6px 0 10px; min-height: 34px; }

.lesson-picker { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; min-width: 0; font-size: .9rem; font-weight: 600; color: var(--muted); }
.lesson-picker > span { white-space: nowrap; }
/* long lesson titles must not make the page wider than the phone */
.lesson-picker select { width: auto; min-width: 0; max-width: 100%; flex: 0 1 auto; text-overflow: ellipsis; padding: 6px 10px; font-size: .9rem; }
@media (max-width: 600px) {
  .lesson-picker { display: flex; width: 100%; }
  .lesson-picker select { flex: 1 1 auto; }
}

/* rule box in the feedback after a wrong grammar answer */
.rule-box { margin-top: 8px; color: var(--text); font-size: .9rem; }
.rule-box summary { cursor: pointer; font-weight: 600; }
.rule-box ul { margin: 6px 0 0; padding-left: 20px; display: grid; gap: 4px; }

/* daily round card */
.card.today .today-text { flex: 1 1 320px; }
.goal { display: grid; gap: 6px; margin-top: 4px; max-width: 360px; }
.goal-meter { width: 100%; height: 8px; }
.goal-meter.done .meter-fill { background: var(--ok); }

/* practice exam */
.section-label { text-align: center; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--primary); margin: 0 0 4px; }
.exam-lessons { padding: 8px 0; }
.exam-parts { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 6px; }
.exam-parts li { display: flex; justify-content: space-between; gap: 12px; }
.exam-summary { display: grid; gap: 10px; justify-items: center; width: 100%; }
.exam-table { max-width: 520px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.exam-table .num { text-align: right; white-space: nowrap; font-weight: 700; }

.current-lesson { margin-top: 8px; }

/* reading (practice exam) */
.reading-text { max-width: 640px; margin: 8px auto 14px; line-height: 1.65; }
.reading-text h3 { margin-top: 0; }
.text-questions { max-width: 640px; margin: 0 auto 14px; padding-left: 22px; display: grid; gap: 14px; }
.text-question p { margin: 0 0 6px; font-weight: 600; }
.text-options { display: grid; gap: 6px; }
.btn.small-option { min-height: 38px; padding: 7px 12px; font-weight: 500; justify-content: flex-start; text-align: left; }
.btn.small-option.active { border-color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, var(--surface)); }

/* "Fout melden" under the feedback */
.report { margin-top: 10px; }
.link-button { background: none; border: 0; padding: 0; font: inherit; font-size: 0.85rem; color: var(--muted); cursor: pointer; text-decoration: underline; }
.link-button:hover { color: inherit; }
.report-form { display: grid; gap: 8px; margin-top: 4px; }
.report-form textarea { width: 100%; box-sizing: border-box; font: inherit; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); color: inherit; resize: vertical; }
