/*
 * Deutschwerkstatt – Design B as on the teacher's worksheets: slate blue
 * labels, light grey-blue panels, white sheets, square number badges,
 * large tap targets. Hand-written CSS only (custom properties, Grid,
 * Flexbox). No webfonts.
 */

:root {
  --blue-50: #f3f5f8;
  --blue-100: #edf1f5;
  --blue-200: #d3dce5;
  --blue-500: #5a7690;
  --blue-700: #3d5872;
  --blue-900: #263a4e;
  --ink: #1f2a33;
  --ink-soft: #4f5f6f;
  --white: #ffffff;
  --green-50: #ebf7ef;
  --green-700: #1c6b3a;
  --amber-50: #fff6e5;
  --amber-700: #8a5300;
  --red-50: #fdeeee;
  --red-700: #a12828;

  --radius: 6px;
  --radius-small: 4px;
  --shadow: 0 1px 2px rgb(31 42 51 / 0.08), 0 6px 20px rgb(31 42 51 / 0.06);
  --focus: 0 0 0 3px var(--white), 0 0 0 6px var(--blue-700);
  --space: 1rem;
  --tap: 3rem;
  --font: "DejaVu Sans", "Verdana", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Ubuntu, sans-serif;
}

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

[hidden] {
  display: none !important;
}

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.55;
  color: var(--ink);
  background: var(--blue-50);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  line-height: 1.25;
  color: var(--blue-900);
  margin: 0 0 0.5em;
}

h1 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2.1rem); }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.15rem; }

p { margin: 0 0 0.75em; }

a {
  color: var(--blue-700);
  text-underline-offset: 0.15em;
}

a:hover { color: var(--blue-900); }

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 4px;
}

.container {
  width: min(100% - 2rem, 60rem);
  margin-inline: auto;
}

main {
  flex: 1;
  padding-block: 1.5rem 3rem;
}

main:focus { outline: none; }

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -4rem;
  background: var(--white);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-small);
  z-index: 10;
}

.skip-link:focus { top: 1rem; }

/* ---------- Header / footer ---------- */

.site-header {
  background: var(--white);
  color: var(--ink);
  border-bottom: 3px solid var(--blue-700);
}

.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding-block: 0.75rem;
}

.brand {
  color: var(--blue-700);
  font-weight: 700;
  font-size: 0.95rem;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.brand:hover { color: var(--blue-900); }

.nav {
  display: flex;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-inline: 0.85rem;
  color: var(--blue-700);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-small);
}

.nav a:hover,
.nav a[aria-current="page"] {
  background: var(--blue-100);
  color: var(--blue-900);
}

.site-footer {
  font-size: 0.9rem;
  color: var(--ink-soft);
  padding-block: 1.5rem;
  border-top: 1px solid var(--blue-200);
}

/* ---------- Building blocks ---------- */

.lead {
  font-size: 1.15rem;
  color: var(--ink-soft);
}

.sv {
  color: var(--ink-soft);
  font-style: italic;
}

.sv::before {
  content: "SV · " / "";
  font-style: normal;
}

.help {
  color: var(--ink-soft);
  font-size: 0.95rem;
}

.eyebrow {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--blue-700);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: clamp(1rem, 0.75rem + 1.5vw, 1.75rem);
  margin-bottom: 1.25rem;
}

.card--accent { border-left: 6px solid var(--blue-500); }
.card--danger { border-left: 6px solid var(--red-700); }

.narrow { max-width: 28rem; margin-inline: auto; }

.hero { margin-bottom: 1.5rem; }

.module-grid,
.two-col {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr));
  align-items: stretch;
}

.module-grid .card,
.two-col .card {
  display: flex;
  flex-direction: column;
  margin-bottom: 0;
}

.module-card .button,
.two-col .card > form:last-child,
.two-col .card > .button:last-child {
  margin-top: auto;
}

.module-list { margin-top: 1rem; }

.level-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

.level-card { margin: 0; display: flex; flex-direction: column; }
.level-card form { margin-top: auto; }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.actions form { margin: 0; }

.stack > * + * { margin-top: 1rem; }

.page-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

/* ---------- Buttons and form controls ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: var(--tap);
  padding: 0.6rem 1.25rem;
  font: inherit;
  font-weight: 600;
  color: var(--blue-700);
  background: var(--white);
  border: 2px solid var(--blue-500);
  border-radius: var(--radius-small);
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s;
}

.button:hover { background: var(--blue-100); color: var(--blue-900); }

.button--primary {
  background: var(--blue-700);
  border-color: var(--blue-700);
  color: var(--white);
}

.button--primary:hover { background: var(--blue-900); border-color: var(--blue-900); color: var(--white); }

.button--quiet {
  border-color: transparent;
  background: transparent;
  text-decoration: underline;
  font-weight: 500;
}

.button--danger {
  background: var(--red-700);
  border-color: var(--red-700);
  color: var(--white);
}

.button--danger:hover { background: #7d1d1d; color: var(--white); }

.button--wide { width: 100%; margin-top: 1.25rem; }

.field { display: flex; flex-direction: column; gap: 0.35rem; }
.field label { font-weight: 600; }

.field--inline {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
}

.field--inline label { min-width: 7rem; }

.input {
  font: inherit;
  font-size: 1.15rem;
  min-height: var(--tap);
  padding: 0.5rem 0.75rem;
  border: 2px solid var(--blue-200);
  border-radius: var(--radius-small);
  background: var(--white);
  color: var(--ink);
  width: 100%;
}

.field--inline .input { width: auto; flex: 1; min-width: 10rem; }

.input:focus-visible { border-color: var(--blue-700); }

.input--code {
  font-family: ui-monospace, "DejaVu Sans Mono", "Liberation Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* ---------- Flash and notices ---------- */

.flash {
  padding: 0.85rem 1rem;
  border-radius: var(--radius-small);
  margin-bottom: 1.25rem;
  background: var(--white);
  border-left: 6px solid var(--blue-500);
  box-shadow: var(--shadow);
}

.flash--alert { border-left-color: var(--red-700); background: var(--red-50); }

.notice-box {
  background: var(--amber-50);
  border-left: 6px solid var(--amber-700);
  border-radius: var(--radius-small);
  padding: 1rem;
  margin-block: 1.25rem;
}

.notice-box h2 { font-size: 1.1rem; color: var(--amber-700); }

/* ---------- Learning code ---------- */

.learning-code {
  margin: 1.25rem 0;
  padding: 1.25rem;
  text-align: center;
  background: var(--blue-50);
  border: 2px dashed var(--blue-500);
  border-radius: var(--radius);
}

.learning-code code {
  font-family: ui-monospace, "DejaVu Sans Mono", "Liberation Mono", monospace;
  font-size: clamp(1.15rem, 0.8rem + 2.5vw, 1.9rem);
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--blue-900);
  word-break: break-word;
}

.status { color: var(--green-700); font-weight: 600; }

/* ---------- Exercise ---------- */

.task-header { margin-bottom: 1rem; }

.task-count { font-weight: 600; margin-bottom: 0.35rem; }

.round-progress {
  appearance: none;
  width: 100%;
  height: 0.6rem;
  border: none;
  border-radius: 999px;
  background: var(--blue-200);
  overflow: hidden;
}

.round-progress::-webkit-progress-bar { background: var(--blue-200); border-radius: 999px; }
.round-progress::-webkit-progress-value { background: var(--blue-500); border-radius: 999px; }
.round-progress::-moz-progress-bar { background: var(--blue-500); border-radius: 999px; }

.task-instruction { margin-bottom: 1rem; }

.prompt {
  font-size: clamp(1.3rem, 1.1rem + 1vw, 1.65rem);
  font-weight: 600;
  color: var(--blue-900);
  margin-bottom: 1.25rem;
}

.dialogue {
  border-left: 4px solid var(--blue-200);
  padding-left: 1rem;
  margin-bottom: 0.75rem;
  font-size: 1.15rem;
  color: var(--ink-soft);
}

.choices {
  border: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
}

.choice {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.5rem;
  padding: 0.75rem 1rem;
  border: 2px solid var(--blue-200);
  border-radius: var(--radius-small);
  background: var(--white);
  cursor: pointer;
  font-size: 1.2rem;
  font-weight: 600;
}

.choice:hover { border-color: var(--blue-500); background: var(--blue-50); }

.choice input {
  width: 1.35rem;
  height: 1.35rem;
  accent-color: var(--blue-700);
  flex-shrink: 0;
}

.choice:has(input:checked) {
  border-color: var(--blue-700);
  background: var(--blue-100);
}

.choice:has(input:focus-visible) { box-shadow: var(--focus); }
.choice input:focus-visible { box-shadow: none; }

.skip {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid var(--blue-100);
}

.leave { margin-top: 1rem; }
.leave .sv { display: block; }

/* Feedback: colour plus symbol plus text (spec §9). */
.feedback {
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
  border: 2px solid;
}

.feedback:focus { outline: none; }

.feedback__title {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.25rem;
  margin-bottom: 0.4rem;
}

.feedback__symbol {
  display: inline-grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  color: var(--white);
  font-size: 1.1rem;
}

.feedback--correct { background: var(--green-50); border-color: var(--green-700); }
.feedback--correct .feedback__title { color: var(--green-700); }
.feedback--correct .feedback__symbol { background: var(--green-700); }

.feedback--wrong { background: var(--red-50); border-color: var(--red-700); }
.feedback--wrong .feedback__title { color: var(--red-700); }
.feedback--wrong .feedback__symbol { background: var(--red-700); }

.feedback--solution { background: var(--amber-50); border-color: var(--amber-700); }
.feedback--solution .feedback__title { color: var(--amber-700); }
.feedback--solution .feedback__symbol { background: var(--amber-700); }

/* Word tiles */
.tiles-fallback {
  border: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.6rem;
}

.tiles-fallback legend { font-weight: 600; margin-bottom: 0.5rem; }

.tiles-label { font-weight: 600; margin: 0.75rem 0 0.4rem; }

.tile-answer,
.tile-pool {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  min-height: 4rem;
  padding: 0.6rem;
  border-radius: var(--radius-small);
}

.tile-answer {
  border: 2px dashed var(--blue-500);
  background: var(--blue-50);
  align-items: center;
}

.tile-placeholder { color: var(--ink-soft); padding-inline: 0.4rem; }

.tile-pool { background: var(--white); border: 1px solid var(--blue-200); }

.tile {
  min-height: var(--tap);
  min-width: var(--tap);
  padding: 0.5rem 0.9rem;
  font: inherit;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--blue-900);
  background: var(--white);
  border: 2px solid var(--blue-500);
  border-radius: var(--radius-small);
  cursor: pointer;
  box-shadow: 0 2px 0 var(--blue-200);
}

.tile:hover { background: var(--blue-100); }

.tile--placed {
  background: var(--blue-700);
  border-color: var(--blue-700);
  color: var(--white);
  box-shadow: none;
}

.tile--placed:hover { background: var(--blue-900); }

/* Rail (Satzschiene): every tile has a place; place 2 and the end are
   marked with text (and optionally a symbol), not by colour alone. */
.rail {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.5rem;
  padding: 0.6rem;
  border-radius: var(--radius-small);
  border: 2px solid var(--blue-500);
  background: var(--blue-50);
  /* the rail itself: a line the tiles stand on */
  box-shadow: inset 0 -6px 0 var(--blue-200);
}

.rail__slot {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.rail__mark {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--blue-700);
}

.rail__fallback-label { font-size: 0.85rem; color: var(--ink-soft); }
.rail__select { min-width: 9rem; }
.rail__input { width: 11rem; max-width: 100%; font-size: 1.1rem; font-weight: 600; }

.rail__verb { margin: 0 0 0.25rem; }

.rail__slot--aux,
.rail__slot--participle {
  padding: 0.3rem;
  border: 2px solid var(--blue-700);
  border-radius: var(--radius-small);
  background: var(--white);
}

.tiles--enhanced .rail__select,
.tiles--enhanced .rail__fallback-label { display: none; }

/* With JavaScript: an empty place is a dashed box of tile height. */
.tiles--enhanced .rail__slot[data-word-tiles-target="slot"]::after {
  content: "";
  display: block;
  min-width: var(--tap);
  min-height: var(--tap);
  border: 2px dashed var(--blue-200);
  border-radius: var(--radius-small);
}

.tiles--enhanced .rail__slot--filled[data-word-tiles-target="slot"]::after { display: none; }
.tiles--enhanced .rail__slot--next[data-word-tiles-target="slot"]::after { border-color: var(--blue-500); }

/* Word pieces of a participle sit close together: auf|ge|räum|t. */
.rail--pieces { gap: 0.15rem; }
.rail--pieces .tile { padding-inline: 0.55rem; }

/* Montessori word-class symbols, shown on request only. */
.sym {
  display: none;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--red-700);
  vertical-align: middle;
}

.sym--participle { width: 1rem; height: 1rem; }
.sym--aux { width: 0.6rem; height: 0.6rem; }
.tile .sym { margin-right: 0.4rem; }

body:has(#show-symbols:checked) .sym { display: inline-block; }

.symbol-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 1rem;
  margin: 0.75rem 0;
}

.symbol-switch__label { display: inline-flex; align-items: center; gap: 0.5rem; min-height: var(--tap); cursor: pointer; }
.symbol-switch__label input { width: 1.2rem; height: 1.2rem; accent-color: var(--blue-700); }
.symbol-switch__legend { display: none; margin: 0; }
body:has(#show-symbols:checked) .symbol-switch__legend { display: block; }

/* Help on request, one task at a time. */
.item-help {
  margin-top: 0.5rem;
  border-left: 3px solid var(--blue-200);
  padding-left: 0.75rem;
}

.item-help summary {
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  color: var(--blue-700);
  font-weight: 600;
}

.item-help p { margin: 0.35rem 0; }
.item-help--more { border-left-style: dotted; }

/* Sentence rail or typing */
.mode-switch {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-small);
  background: var(--blue-100);
}

.mode-switch__state { margin: 0 0 0.5rem; font-weight: 600; }
.mode-switch form { display: inline; }
.mode-switch .help { margin: 0.5rem 0 0; }

/* ß key for Swedish keyboards */
.eszett-key { min-width: var(--tap); font-size: 1.25rem; font-weight: 700; }
.answer-form__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

/* Stumbling stones */
.stumbling__list { list-style: none; padding: 0; margin: 0.75rem 0 1rem; display: grid; gap: 0.4rem; }
.stumbling__list li { display: flex; align-items: center; gap: 0.6rem; }

.stumbling__count {
  display: inline-grid;
  place-items: center;
  min-width: 2rem;
  height: 2rem;
  border-radius: var(--radius-small);
  background: var(--blue-700);
  color: var(--white);
  font-weight: 700;
}

/* Werkstatt: practice material below the two main modules (spec §9). */
.werkstatt-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  margin-top: 1rem;
  border-left: 6px solid var(--blue-500);
}

.werkstatt-card__text { flex: 1 1 20rem; }
.werkstatt-card h3 { margin: 0.1rem 0 0.25rem; }
.werkstatt-card p { margin: 0.25rem 0; }

/* A calm stamp when a sheet is finished – like on paper. */
.stamp {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0 1rem;
  padding: 0.35rem 0.9rem;
  border: 3px double var(--green-700);
  border-radius: var(--radius);
  color: var(--green-700);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: rotate(-3deg);
  animation: stamp-in 0.45s ease-out both;
}

.stamp__mark { font-size: 1.3rem; }

@keyframes stamp-in {
  from { opacity: 0; transform: rotate(-3deg) scale(1.25); }
  to { opacity: 1; transform: rotate(-3deg) scale(1); }
}

/* Summary */
.stats {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  margin: 1.25rem 0;
}

.stat {
  background: var(--blue-50);
  border-radius: var(--radius-small);
  padding: 0.9rem;
  display: flex;
  flex-direction: column-reverse;
  gap: 0.2rem;
}

.stat dt { font-size: 0.95rem; color: var(--ink-soft); }
.stat dd { margin: 0; font-size: 2rem; font-weight: 700; color: var(--blue-900); }
.stat--good { background: var(--green-50); }
.stat--good dd { color: var(--green-700); }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.98rem;
}

.table th,
.table td {
  text-align: left;
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--blue-100);
  vertical-align: top;
}

.table thead th { color: var(--ink-soft); font-weight: 600; font-size: 0.9rem; }
.table tbody th { font-weight: 600; }
.table .num { text-align: right; white-space: nowrap; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 2rem;
  margin: 0 0 1.25rem;
}

.meta dt { font-size: 0.9rem; color: var(--ink-soft); }
.meta dd { margin: 0; font-weight: 600; }

/* ---------- Worksheet ("Arbeitsblatt") ---------- */

.breadcrumb { margin-bottom: 0.75rem; font-size: 0.95rem; }

.sheet {
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: var(--radius-small);
  padding: clamp(1rem, 0.5rem + 3vw, 2.75rem);
  margin-bottom: 1.5rem;
}

.sheet__head { margin-bottom: 1.25rem; }

.sheet__eyebrow {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--blue-700);
  margin-bottom: 0.9rem;
}

.sheet__title {
  font-size: clamp(1.7rem, 1.3rem + 2vw, 2.4rem);
  font-weight: 800;
  color: var(--ink);
  margin: 0 0 0.2rem;
  line-height: 1.15;
}

.sheet__title--h2 { font-size: clamp(1.5rem, 1.2rem + 1.5vw, 2rem); }

.sheet__topic {
  font-size: 1.05rem;
  font-weight: 400;
  color: var(--ink-soft);
  margin: 0 0 0.35rem;
}

.sheet__topic-small { color: var(--ink-soft); margin: 0; }

.sheet__meta { font-size: 0.85rem; color: var(--ink-soft); margin: 0; }

.stufe { font-weight: 700; color: var(--blue-700); }

.sheet__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem 1rem;
  margin: 1.5rem 0;
}

.sheet__actions form { margin: 0; }

.sheet__footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.25rem 1rem;
  margin: 1rem 0 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--blue-200);
  font-size: 0.75rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.label-heading {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--blue-700);
  margin: 1.5rem 0 0.5rem;
}

.panel {
  background: var(--blue-100);
  padding: 1rem 1.25rem;
  margin-bottom: 1.25rem;
}

.panel .label-heading { margin-top: 0; }

.sv-plain { color: var(--ink-soft); font-size: 0.9em; }

/* Info boxes under the title ("MIT HABEN" / "BEISPIELE") */
.info-boxes {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
  margin-bottom: 1.75rem;
}

.info-box {
  background: var(--blue-100);
  border-top: 2px solid var(--blue-700);
  padding: 0.9rem 1.1rem;
}

.info-box p { margin: 0 0 0.35rem; font-size: 0.95rem; }

.info-box__heading {
  font-size: 0.75rem !important;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--blue-700);
  margin-bottom: 0.6rem !important;
}

/* Steps: Aufgabe 1 · 2 · 3 · Kontrolle */
.steps ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.step {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.step__badge {
  display: inline-grid;
  place-items: center;
  width: 1.9rem;
  height: 1.9rem;
  font-weight: 700;
  border: 2px solid var(--blue-200);
  color: var(--blue-700);
  background: var(--white);
}

.step--current { color: var(--ink); font-weight: 700; }
.step--current .step__badge { background: var(--blue-700); border-color: var(--blue-700); color: var(--white); }
.step--done .step__badge { background: var(--blue-100); border-color: var(--blue-500); }

/* Task block with square number badge */
.task-block { margin-bottom: 1rem; }

.task-block__head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  align-items: start;
  margin-bottom: 0.75rem;
}

.task-badge {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  background: var(--blue-700);
  color: var(--white);
  font-weight: 700;
  font-size: 1rem;
}

.task-block__title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0.2rem 0 0.1rem;
}

.task-block__sv { font-size: 0.85rem; margin: 0; }
.task-block__sv::before { content: none; }
.task-block__label { font-size: 0.85rem; font-weight: 700; color: var(--blue-700); margin: 0.35rem 0 0; }

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

.section-list__item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--blue-200);
}

.section-list__item .help { margin: 0.3rem 0 0; }

/* Items (numbered lines on the sheet) */
.items {
  list-style: none;
  margin: 0;
  padding: 0 0 0 calc(2.1rem + 1rem);
}

.item {
  display: grid;
  grid-template-columns: 2.4rem 1fr;
  gap: 0.25rem 0.5rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid var(--blue-200);
}

.item__num {
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  padding-top: 0.15rem;
  font-size: 0.95rem;
}

.item__body > * + * { margin-top: 0.5rem; }
.item__prompt { font-size: 1.1rem; margin: 0; }
.item__context { color: var(--ink-soft); margin: 0; font-style: italic; }
.item__solution { font-size: 1.1rem; margin: 0; }
.item__note { font-size: 0.95rem; color: var(--ink-soft); margin: 0; }
.item__note--ok { color: var(--green-700); font-weight: 600; }

.item--solved { background: linear-gradient(to right, var(--green-50), transparent 60%); }

.item__feedback {
  border-left: 4px solid var(--red-700);
  background: var(--red-50);
  padding: 0.6rem 0.8rem;
  font-size: 0.97rem;
}

.item__feedback p { margin: 0 0 0.3rem; }
.item__feedback p:last-child { margin-bottom: 0; }
.item__hint { color: var(--ink); }

.mark {
  display: inline-grid;
  place-items: center;
  width: 1.4rem;
  height: 1.4rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
  vertical-align: 0.05em;
}

.mark--ok { background: var(--green-700); }
.mark--wrong { background: var(--red-700); }

/* Gap inputs inside a sentence */
.prompt--gaps { line-height: 2.6; }

.gap-input {
  font: inherit;
  width: 7.5em;
  min-height: 2.5rem;
  margin-inline: 0.3rem;
  padding: 0.2rem 0.45rem;
  border: none;
  border-bottom: 2px solid var(--blue-500);
  background: var(--blue-50);
  color: var(--ink);
}

.gap-input:focus-visible { border-bottom-color: var(--blue-900); }

.gap-mark { color: var(--blue-500); letter-spacing: 0.1em; padding-inline: 0.2rem; }

/* Option pills ("habe / bin", "R / F") */
.options {
  border: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.options--inline { display: flex; flex-wrap: wrap; }

.option {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  min-height: var(--tap);
  padding: 0.45rem 0.95rem;
  border: 2px solid var(--blue-200);
  background: var(--white);
  cursor: pointer;
  font-weight: 600;
}

.option:hover { border-color: var(--blue-500); background: var(--blue-50); }
.option input { width: 1.2rem; height: 1.2rem; accent-color: var(--blue-700); flex-shrink: 0; }
.option:has(input:checked) { border-color: var(--blue-700); background: var(--blue-100); }
.option:has(input:focus-visible) { box-shadow: var(--focus); }
.option input:focus-visible { box-shadow: none; }

.correction label { font-weight: 500; font-size: 0.9rem; color: var(--ink-soft); }

.continue-box {
  background: var(--blue-100);
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
}

.continue-box p { margin-bottom: 0.6rem; }

/* XP boxes at the bottom of every worksheet */
.xp-boxes {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  margin-top: 1.5rem;
}

.xp-box { background: var(--blue-100); padding: 0.7rem 0.9rem; }
.xp-box--on { background: var(--green-50); }
.xp-box p { margin: 0; }
.xp-box__title { color: var(--blue-700); margin-bottom: 0.3rem !important; }
.xp-box--on .xp-box__title { color: var(--green-700); }
.xp-box__label { font-size: 0.85rem; }

.xp-check {
  display: inline-grid;
  place-items: center;
  width: 1.15rem;
  height: 1.15rem;
  border: 1.5px solid var(--blue-500);
  background: var(--white);
  color: var(--green-700);
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1;
  vertical-align: -0.15em;
}

.xp-check--on { border-color: var(--green-700); }

/* Log book table */
.logbook th, .logbook td { padding: 0.45rem 0.6rem; }
.logbook thead th { background: var(--blue-100); color: var(--blue-700); border-bottom: none; }
.logbook tbody th { color: var(--blue-700); font-weight: 700; }
.logbook .center, .table .center { text-align: center; }
.logbook__block th {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--blue-700);
  padding-top: 1rem;
}

.logbook tr.is-goal td, .logbook tr.is-goal th { background: var(--amber-50); }
.logbook tr.is-done td:last-child { color: var(--green-700); }

.quiet-link { color: var(--ink); text-decoration: none; }
.quiet-link:hover { text-decoration: underline; color: var(--blue-900); }

.next-mission { background: var(--blue-100); border-left: 4px solid var(--blue-700); padding: 0.75rem 1rem; margin: 1rem 0; }
.next-mission .label-heading { margin-top: 0; }
.next-mission__title { margin: 0 0 0.75rem; font-size: 1.1rem; }
.next-mission .help { margin: 0.75rem 0 0; }

.badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.1rem 0.45rem;
  margin-left: 0.4rem;
  background: var(--blue-100);
  color: var(--blue-700);
  white-space: nowrap;
}

.badge--ok { background: var(--green-50); color: var(--green-700); }
.badge--todo { background: var(--amber-50); color: var(--amber-700); }
.badge--goal { background: var(--amber-700); color: var(--white); }

.goal-summary { background: var(--amber-50); border-left: 4px solid var(--amber-700); padding: 0.75rem 1rem; margin: 1rem 0; }
.goal-summary .label-heading { margin-top: 0; color: var(--amber-700); }
.goal-summary p { margin: 0; }

.goal-tag { margin: 0; font-weight: 600; color: var(--amber-700); }

.goal-form fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
.goal-form__slots { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr)); }
.goal-change { margin: 1.25rem 0; }
.goal-change summary { cursor: pointer; font-weight: 600; color: var(--blue-700); min-height: 2.75rem; display: flex; align-items: center; }
.goal-change[open] summary { margin-bottom: 0.75rem; }

.bonus { margin-top: 1rem; }
.pass-total { font-weight: 700; color: var(--blue-700); font-size: 1.1rem; margin-top: 1rem; }
.stage-status { display: flex; align-items: center; gap: 0.5rem; }
.stage-hint a { font-weight: 600; }
.stage-closed { display: block; }

/* Learner's own label: masked until the eye toggle is opened (no JS). */
.display-id { margin-top: 1rem; }
.display-id .label-heading { margin-bottom: 0.25rem; }
.display-id__toggle summary {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  min-height: var(--tap);
  padding: 0.35rem 0.75rem;
  border: 2px solid var(--blue-200);
  border-radius: var(--radius-small);
  background: var(--white);
  cursor: pointer;
  list-style: none;
}
.display-id__toggle summary::-webkit-details-marker { display: none; }
.display-id__toggle summary:hover { border-color: var(--blue-500); }
.display-id__value {
  font-family: ui-monospace, "DejaVu Sans Mono", monospace;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--blue-900);
  min-width: 6.5ch;
}
.display-id__eye { display: inline-flex; color: var(--blue-700); }
.display-id__action { font-weight: 600; color: var(--blue-700); }
.display-id__toggle:not([open]) :is(.display-id__value--full, .display-id__icon--hide, .display-id__action--hide),
.display-id__toggle[open] :is(.display-id__value--masked, .display-id__icon--show, .display-id__action--show) {
  display: none;
}

.skills th[scope="row"] { font-weight: 500; }
.skill-sv { display: block; font-size: 0.85rem; }
.skill-sv::before { content: none; }
.input--small { min-height: 2.75rem; font-size: 1rem; padding: 0.3rem 0.4rem; min-width: 7rem; }
.evidence { font-size: 0.9rem; color: var(--ink-soft); }

.history { padding-left: 1.2rem; }
.history li { margin-bottom: 0.75rem; }
.history form { margin-top: 0.5rem; }

.mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  margin: 0.5rem 0 0.75rem;
}

.mini-stats dt { font-size: 0.8rem; color: var(--ink-soft); }
.mini-stats dd { margin: 0; font-weight: 700; color: var(--blue-700); font-size: 1.15rem; }

.actions--tight { margin-top: 0.5rem; }
.actions--card { margin-top: auto; padding-top: 0.5rem; }

.task-instruction-de { font-weight: 700; margin-bottom: 0.2rem; }

.done h2 { color: var(--green-700); }

.merkblatt__section { padding: 1rem 0; border-bottom: 1px solid var(--blue-200); }
.merkblatt__example { font-size: 1.05rem; margin: 0.5rem 0 0; padding-left: 0.75rem; border-left: 3px solid var(--blue-200); }
.table--compact th, .table--compact td { padding: 0.35rem 0.6rem; }

.level-card {
  background: var(--blue-50);
  padding: 1rem;
}

@media (max-width: 40rem) {
  .items { padding-left: 0; }
  .item { grid-template-columns: 2rem 1fr; }
  .col-date { display: none; }
  .task-block__head { gap: 0.75rem; }
}

/* ---------- Motion and print ---------- */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}

@media print {
  .site-header,
  .no-print,
  .skip-link {
    display: none !important;
  }

  .site-footer { border-top: none; padding-block: 1rem 0; }
  .site-footer p:not(.site-footer__copyright) { display: none; }

  body { background: var(--white); }
  .card, .sheet { box-shadow: none; border: 1px solid #999; }
  .sheet { border: none; padding: 0; }
}

/* Student-friendly worksheet interaction */
.mission-form .items { padding-left: 0; }

.item {
  background: var(--white);
  border: 1px solid var(--blue-200);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  margin-bottom: 0.75rem;
}

.item__num {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: var(--blue-100);
  color: var(--blue-900);
  font-weight: 700;
}

.item--solved { border-color: var(--green-700); background: var(--green-50); }
.item--wrong { border-color: var(--red-700); }

.item__prompt { font-size: 1.2rem; }

/* choice cards: big targets, clear selected state with a check mark */
.options--inline .option { flex: 1 1 8rem; justify-content: center; font-size: 1.15rem; }
.option { border-radius: var(--radius); min-height: 3.4rem; transition: background 0.15s, border-color 0.15s; }
.option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.option { position: relative; }
.option:has(input:checked) { border-color: var(--blue-700); background: var(--blue-700); color: var(--white); }
.option:has(input:checked)::before { content: "✓"; font-weight: 700; }
@media (prefers-reduced-motion: reduce) { .option { transition: none; } }

.gap-input { font-size: 1.1rem; border-radius: var(--radius-small) var(--radius-small) 0 0; }

.sheet__count { margin: 0; font-size: 0.95rem; color: var(--ink-soft); flex: 1 1 auto; }

.sheet__actions--sticky {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: var(--white);
  border-top: 2px solid var(--blue-200);
  padding: 0.75rem 1rem;
  margin: 1.5rem -1rem 0;
}

.sheet__actions--sticky .button { min-width: 11rem; }

@media (max-width: 40rem) {
  .item { grid-template-columns: 1fr; }
  .sheet__actions--sticky .button { flex: 1 1 100%; }
}

.submit-box {
  background: var(--blue-100);
  border-left: 4px solid var(--blue-700);
  padding: 1rem 1.25rem;
  margin: 1.5rem 0;
}
.submit-box__title { font-size: 1.1rem; margin-bottom: 0.4rem; }
.submit-box form { margin-top: 0.75rem; }

.section-status { margin: 0.25rem 0 0; font-size: 0.95rem; font-weight: 600; color: var(--ink-soft); }
.section-status--done { color: var(--green-700); }
.section-status--partial { color: var(--amber-700); }
.section-status__here { color: var(--blue-700); margin-left: 0.5rem; }

.step__link { display: inline-flex; align-items: center; gap: 0.5rem; color: inherit; text-decoration: none; }
.step__link:hover .step__label { text-decoration: underline; }
.revisit-note { background: var(--amber-50); border-left: 4px solid var(--amber-700); padding: 0.6rem 0.9rem; margin: 1rem 0; }
.section-status__link { margin-left: 0.75rem; font-weight: 600; }

/* Perfekt bracket (Satzklammer): auxiliary and participle framed like a
   bracket below the sentence – shape and weight, not colour alone. */
.klammer {
  font-weight: 700;
  padding: 0 0.2em 0.05em;
  border-bottom: 2px solid var(--blue-700);
}
.klammer--aux { border-left: 2px solid var(--blue-700); }
.klammer--end { border-right: 2px solid var(--blue-700); }
@media print {
  .klammer, .klammer--aux, .klammer--end { border-color: #000; }
}

/* Help on request inside a worksheet: check steps and Merkblatt. */
.help-panels { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.75rem 0 1rem; }
.help-panel {
  flex: 1 1 16rem;
  background: var(--blue-100);
  border: 1px solid var(--blue-200);
  border-radius: var(--radius-small);
  padding: 0 0.85rem;
}
.help-panel[open] { flex-basis: 100%; padding-bottom: 0.75rem; }
.help-panel summary {
  cursor: pointer;
  font-weight: 600;
  color: var(--blue-700);
  min-height: var(--tap);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-wrap: wrap;
}
.help-panel summary:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-small); }
.help-panel .merkblatt__section { margin-top: 0.75rem; }
.help-panel h3.task-block__title { font-size: 1rem; }

/* Control card (Kontrollkarte): own answer next to the solution, then the
   learner's own judgement. */
.self-check-note { margin: 0.75rem 0 0; }
.control-card__compare { margin: 0.25rem 0 0.75rem; display: grid; gap: 0.35rem; }
.control-card__row {
  display: grid;
  grid-template-columns: minmax(7rem, auto) 1fr;
  gap: 0.75rem;
  align-items: baseline;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-small);
  background: var(--blue-50);
}
.control-card__row--solution { background: var(--blue-100); border-left: 4px solid var(--blue-700); }
.control-card__row dt { font-size: 0.85rem; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; }
.control-card__row dd { margin: 0; font-size: 1.05rem; }
.control-card__marks legend { font-weight: 600; margin-bottom: 0.35rem; }
@media (max-width: 40rem) {
  .control-card__row { grid-template-columns: 1fr; gap: 0.1rem; }
}
