/* =========================================================================
   IT-Prüfer3 — "Warm Fokus" Theme Layer  (Redesign 2026)
   ---------------------------------------------------------------------------
   Load AFTER styles.css. This layer redefines every upstream token and
   restyles every component class the bundle emits, without touching the
   read-only source. Direction: warm, calm, precise — a learning tool made
   for long, focused study sessions. Deep teal accent, soft radii, warm paper
   surfaces, one coherent type + spacing + elevation system.
   German UI, exam semantics (richtig / falsch / wird geprüft), the diagram
   editor interaction and the d-* SVG language are all preserved.

   Produced in the Claude Design project "IT-Prüfer3 Design System"
   (templates/warm-fokus/theme.css) and ported here 1:1; the only change is
   the font loading — self-hosted woff2 via fonts.css instead of the Google
   Fonts CDN (the app's CSP allows no external origins).
   ========================================================================= */

@import url("fonts.css");

/* ============================ 1. FOUNDATIONS ============================ */

:root {
  /* --- Type families ---------------------------------------------------- */
  --font-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
  --font-sans: "Hanken Grotesk", system-ui, -apple-system, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

  /* --- Fluid type scale (min .. max across 360–1280px) ------------------ */
  --text-2xs: clamp(0.68rem, 0.66rem + 0.10vw, 0.74rem);
  --text-xs:  clamp(0.75rem, 0.72rem + 0.14vw, 0.82rem);
  --text-sm:  clamp(0.84rem, 0.80rem + 0.18vw, 0.92rem);
  --text-md:  clamp(0.95rem, 0.90rem + 0.24vw, 1.05rem);
  --text-lg:  clamp(1.10rem, 1.02rem + 0.40vw, 1.30rem);
  --text-xl:  clamp(1.35rem, 1.20rem + 0.70vw, 1.75rem);
  --text-2xl: clamp(1.70rem, 1.40rem + 1.40vw, 2.60rem);
  --text-3xl: clamp(2.20rem, 1.70rem + 2.40vw, 3.60rem);

  --leading-tight: 1.15;
  --leading-snug: 1.35;
  --leading-normal: 1.6;
  --tracking-tight: -0.015em;
  --tracking-wide: 0.06em;
  --tracking-caps: 0.10em;

  /* --- Spacing scale (4px base) ----------------------------------------- */
  --sp-1: 0.25rem;  --sp-2: 0.5rem;   --sp-3: 0.75rem;  --sp-4: 1rem;
  --sp-5: 1.25rem;  --sp-6: 1.5rem;   --sp-8: 2rem;     --sp-10: 2.5rem;
  --sp-12: 3rem;    --sp-16: 4rem;
  /* fluid page + card padding */
  --pad-page: clamp(1rem, 0.4rem + 2.6vw, 2.5rem);
  --pad-card: clamp(1rem, 0.7rem + 1.2vw, 1.6rem);
  --gap-card: clamp(0.85rem, 0.6rem + 1vw, 1.4rem);

  /* --- Radii ------------------------------------------------------------ */
  --r-xs: 6px;  --r-sm: 9px;  --r-md: 12px;  --r-lg: 16px;  --r-xl: 22px;
  --r-full: 999px;

  /* --- Warm neutral ramp (paper) --------------------------------------- */
  --paper:        oklch(0.985 0.008 78);   /* app background */
  --paper-sunk:   oklch(0.965 0.010 74);   /* recessed wells */
  --line-strong:  oklch(0.86 0.014 72);
  --line:         oklch(0.90 0.012 74);
  --line-soft:    oklch(0.935 0.010 76);

  /* Ink — warm charcoal, softened for long reading */
  --ink:        oklch(0.30 0.014 60);
  --ink-strong: oklch(0.24 0.016 55);
  --ink-soft:   oklch(0.42 0.014 58);
  --muted:      oklch(0.52 0.012 60);
  --faint:      oklch(0.66 0.011 64);

  /* Surfaces (warm whites) */
  --surface:      oklch(0.995 0.004 80);
  --surface-alt:  oklch(0.975 0.008 78);
  --surface-dim:  oklch(0.958 0.011 75);
  --border:       oklch(0.90 0.012 74);
  --border-soft:  oklch(0.865 0.014 72);
  --border-faint: oklch(0.935 0.009 76);

  /* --- Accent — deep teal ---------------------------------------------- */
  --accent:        oklch(0.52 0.088 195);
  --accent-strong: oklch(0.44 0.092 197);
  --accent-hover:  oklch(0.48 0.092 196);
  --accent-ink:    oklch(0.34 0.070 198);   /* accent text on tint */
  --accent-soft:   oklch(0.945 0.030 196);
  --accent-faint:  oklch(0.968 0.018 196);
  --on-accent:     oklch(0.99 0.01 196);
  --bar:           oklch(0.72 0.055 200);

  /* --- Semantic verdicts (share tone, vary hue) ------------------------ */
  --ok:        oklch(0.50 0.098 155);
  --ok-strong: oklch(0.43 0.10 156);
  --ok-bg:     oklch(0.955 0.036 155);
  --ok-line:   oklch(0.86 0.055 156);

  --bad:       oklch(0.55 0.145 32);
  --bad-dark:  oklch(0.47 0.150 33);
  --bad-bg:    oklch(0.960 0.032 40);
  --bad-line:  oklch(0.86 0.070 36);

  --review:      oklch(0.58 0.098 72);
  --review-strong: oklch(0.50 0.10 70);
  --review-bg:   oklch(0.955 0.048 82);
  --review-line: oklch(0.85 0.075 78);

  --flash: oklch(0.955 0.060 90);

  /* --- Elevation (warm-tinted shadows) --------------------------------- */
  --shadow-color: 40 30% 30%;
  --shadow-xs: 0 1px 2px hsl(var(--shadow-color) / 0.06);
  --shadow-sm: 0 1px 2px hsl(var(--shadow-color) / 0.05),
               0 2px 6px hsl(var(--shadow-color) / 0.06);
  --shadow-md: 0 2px 4px hsl(var(--shadow-color) / 0.05),
               0 6px 16px hsl(var(--shadow-color) / 0.09);
  --shadow-lg: 0 4px 8px hsl(var(--shadow-color) / 0.06),
               0 16px 36px hsl(var(--shadow-color) / 0.13);
  --ring: 0 0 0 3px var(--accent-soft), 0 0 0 4px color-mix(in oklch, var(--accent) 55%, transparent);

  /* --- Motion ----------------------------------------------------------- */
  --dur-1: 90ms; --dur-2: 160ms; --dur-3: 260ms;
  --ease: cubic-bezier(0.2, 0.6, 0.2, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);

  color-scheme: light;
}

/* ============================ 2. BASE ============================ */

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

body {
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--leading-normal);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 100% -10%, var(--accent-faint), transparent 60%),
    var(--paper);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "cv05" 1, "ss01" 1;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink-strong);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  font-weight: 600;
  text-wrap: balance;
}

p { text-wrap: pretty; }

a { color: var(--accent-strong); text-underline-offset: 0.15em; text-decoration-color: color-mix(in oklch, var(--accent) 35%, transparent); }
a:hover { text-decoration-color: currentColor; }

.container {
  max-width: 72rem;
  padding: var(--pad-page);
}

.muted { color: var(--muted); }

::selection { background: var(--accent-soft); color: var(--accent-ink); }

:focus-visible {
  outline: none;
  box-shadow: var(--ring);
  border-radius: var(--r-xs);
}

/* Subtle warm scrollbars */
* { scrollbar-color: var(--line-strong) transparent; scrollbar-width: thin; }
*::-webkit-scrollbar { height: 10px; width: 10px; }
*::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: var(--r-full); border: 3px solid transparent; background-clip: content-box; }

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ============================ 3. TOP NAV ============================ */

.topnav {
  position: sticky;
  top: 0;
  z-index: 50;
  padding: var(--sp-3) var(--pad-page);
  gap: var(--sp-4);
  background: color-mix(in oklch, var(--surface) 82%, transparent);
  backdrop-filter: saturate(1.3) blur(12px);
  -webkit-backdrop-filter: saturate(1.3) blur(12px);
  border-bottom: 1px solid var(--border-faint);
}

.topnav h1 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  letter-spacing: var(--tracking-tight);
  color: var(--ink-strong);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.55em;
  white-space: nowrap;
}
.topnav h1::before {
  content: "";
  width: 0.55em; height: 0.55em;
  border-radius: 4px;
  background: linear-gradient(150deg, var(--accent) 0%, var(--accent-strong) 100%);
  box-shadow: inset 0 1px 0 hsl(0 0% 100% / 0.25), var(--shadow-xs);
  flex: none;
}

.nav-links {
  gap: var(--sp-1);
  padding: 4px;
  background: var(--surface-dim);
  border: 1px solid var(--border-faint);
  border-radius: var(--r-full);
}
.nav-links a {
  padding: 0.42rem 0.9rem;
  border-radius: var(--r-full);
  color: var(--ink-soft);
  text-decoration: none;
  font-size: var(--text-sm);
  font-weight: 550;
  line-height: 1;
  transition: color var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
  white-space: nowrap;
}
.nav-links a:hover { color: var(--ink-strong); background: color-mix(in oklch, var(--surface) 70%, transparent); }
.nav-links a[aria-current="page"] {
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: var(--shadow-xs);
  font-weight: 600;
}

.nav-user {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  color: var(--muted);
  font-size: var(--text-sm);
}
.nav-user::before {
  content: "";
  width: 1.85rem; height: 1.85rem;
  border-radius: var(--r-full);
  background: var(--accent-soft);
  border: 1px solid var(--accent-line, var(--accent-soft));
  box-shadow: inset 0 0 0 1.5px var(--surface);
  flex: none;
}

/* ============================ 4. BUTTONS ============================ */

button,
.button {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  margin-top: 0;
  padding: 0.62rem 1.05rem;
  min-height: 2.55rem;
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--ink-strong);
  box-shadow: var(--shadow-xs);
  cursor: pointer;
  transition: background var(--dur-2) var(--ease), border-color var(--dur-2) var(--ease),
              box-shadow var(--dur-2) var(--ease), transform var(--dur-1) var(--ease), color var(--dur-2) var(--ease);
}
button:hover,
.button:hover { background: var(--surface-alt); border-color: var(--line-strong); box-shadow: var(--shadow-sm); }
button:active,
.button:active { transform: translateY(1px); box-shadow: var(--shadow-xs); }

button:disabled,
.button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; box-shadow: none; }

/* Grade button — the primary action. Filled teal with an evaluate glyph. */
.grade-button {
  background: linear-gradient(180deg, var(--accent-hover), var(--accent));
  border-color: var(--accent-strong);
  color: var(--on-accent);
  box-shadow: var(--shadow-sm), inset 0 1px 0 hsl(0 0% 100% / 0.18);
  padding-left: 0.9rem;
}
.grade-button::before {
  content: "✓";
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: 0.95em;
  display: inline-grid;
  place-items: center;
  width: 1.25em; height: 1.25em;
  border-radius: 5px;
  background: hsl(0 0% 100% / 0.18);
  transition: transform var(--dur-3) var(--ease-out);
}
.grade-button:hover { background: linear-gradient(180deg, var(--accent), var(--accent-strong)); border-color: var(--accent-strong); box-shadow: var(--shadow-md), inset 0 1px 0 hsl(0 0% 100% / 0.2); }
.grade-button:hover:not(:disabled)::before { transform: scale(1.12) rotate(-4deg); }
.grade-button:disabled { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; opacity: 0.8; }
.grade-button:disabled::before {
  content: "";
  border-radius: 50%;
  background: none;
  border: 2px solid color-mix(in oklch, var(--accent-ink) 35%, transparent);
  border-top-color: var(--accent-ink);
  width: 1em; height: 1em;
  animation: itp-spin 0.7s linear infinite;
}
@keyframes itp-spin { to { transform: rotate(360deg); } }

/* Link-style text button */
button.linklike,
.linklike {
  display: inline-flex;
  min-height: 0;
  margin: 0; padding: 0;
  border: 0; background: none; box-shadow: none;
  color: var(--accent-strong);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--r-xs);
  transition: color var(--dur-2) var(--ease);
}
button.linklike:hover,
.linklike:hover { background: none; box-shadow: none; color: var(--accent-hover); text-decoration: underline; text-underline-offset: 0.2em; }

/* Larger touch targets on touch devices */
@media (pointer: coarse) {
  button, .button { min-height: 2.85rem; }
}

/* ============================ 5. FIELDS ============================ */

.answer-input,
.short-input,
.auth-form input,
.settings-row input,
.settings-row select,
.usecase-row input,
.usecase-row select,
.netzplan-cell input,
.match-row select,
.gantt-table input,
label > input,
label > textarea,
label > select {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  color: var(--ink-strong);
  background: var(--surface);
  border: 1.5px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: 0.6rem 0.75rem;
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease), background var(--dur-2) var(--ease);
}
textarea.answer-input { line-height: var(--leading-snug); resize: vertical; min-height: 5.5rem; }
.short-input { padding: 0.5rem 0.65rem; }

.answer-input:hover,
.short-input:hover,
label > input:hover,
label > textarea:hover,
label > select:hover,
.settings-row input:hover,
.settings-row select:hover { border-color: var(--line-strong); }

.answer-input:focus,
.short-input:focus,
.auth-form input:focus,
.settings-row input:focus,
.settings-row select:focus,
.usecase-row input:focus,
.usecase-row select:focus,
.netzplan-cell input:focus,
.match-row select:focus,
.gantt-table input:focus,
label > input:focus,
label > textarea:focus,
label > select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--ring);
  background: var(--surface);
}
::placeholder { color: var(--faint); }
input[readonly], textarea[readonly] { cursor: default; }

/* Labels wrapping a control (FormField, settings, auth) */
label:has(> input:not([type="radio"]):not([type="checkbox"])),
label:has(> textarea),
label:has(> select) {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-strong);
}

/* Option labels (radios/checkboxes) stay inline */
label:has(> input[type="radio"]),
label:has(> input[type="checkbox"]) {
  display: inline-flex;
  align-items: baseline;
  gap: 0.5rem;
  font-size: var(--text-md);
  font-weight: 400;
}

.auth-form { max-width: 26rem; }
.auth-form label { margin-top: var(--sp-4); }

.settings-row { gap: var(--sp-4); }
.settings-row label { font-weight: 600; }
.settings-row input, .settings-row select { margin-top: var(--sp-1); }

/* Form messages */
.form-error, .form-success {
  display: flex;
  align-items: flex-start;
  gap: 0.45em;
  font-size: var(--text-sm);
  font-weight: 500;
  margin: 0.35rem 0 0;
  line-height: var(--leading-snug);
}
.form-error { color: var(--bad-dark); }
.form-success { color: var(--ok-strong); }
.form-error::before, .form-success::before {
  font-family: var(--font-mono); font-weight: 600;
  flex: none;
  display: inline-grid; place-items: center;
  width: 1.25em; height: 1.25em; margin-top: 0.05em;
  border-radius: 50%; font-size: 0.85em;
}
.form-error::before { content: "!"; background: var(--bad-bg); color: var(--bad-dark); box-shadow: inset 0 0 0 1px var(--bad-line); }
.form-success::before { content: "✓"; background: var(--ok-bg); color: var(--ok-strong); box-shadow: inset 0 0 0 1px var(--ok-line); }

/* ============================ 6. DATA TABLE ============================ */

.data-table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  margin-top: var(--sp-4);
  font-size: var(--text-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.data-table th,
.data-table td {
  border: none;
  border-bottom: 1px solid var(--border-faint);
  padding: 0.7rem 0.95rem;
  text-align: left;
}
.data-table thead th {
  background: var(--surface-dim);
  color: var(--muted);
  font-family: var(--font-sans);
  font-weight: 650;
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: var(--tracking-caps);
  border-bottom: 1px solid var(--border);
}
.data-table tbody tr { transition: background var(--dur-2) var(--ease); }
.data-table tbody tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover td { background: var(--accent-faint); }

/* ============================ 7. BADGES ============================ */

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.22rem 0.6rem 0.22rem 0.5rem;
  border-radius: var(--r-full);
  font-family: var(--font-sans);
  font-size: var(--text-2xs);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.4;
  border: 1px solid transparent;
}
.badge::before {
  content: "";
  width: 0.5em; height: 0.5em;
  border-radius: 50%;
  background: currentColor;
  flex: none;
}
.badge-open { background: var(--ok-bg); color: var(--ok-strong); border-color: var(--ok-line); }
.badge-locked { background: var(--surface-dim); color: var(--muted); border-color: var(--border); }

/* ============================ 8. SUBTASK CARD ============================ */

.subtask,
.aufgabe {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--pad-card);
  box-shadow: var(--shadow-sm);
  margin: var(--gap-card) 0;
  transition: box-shadow var(--dur-3) var(--ease), border-color var(--dur-3) var(--ease);
}
.subtask:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.aufgabe { padding-top: var(--pad-card); border-top: 1px solid var(--border); }

.subtask h3 {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 var(--sp-3);
  font-size: var(--text-md);
}
/* Label chip: first span in the h3 (e.g. "b)") */
.subtask h3 > span:first-child {
  font-family: var(--font-mono);
  font-weight: 600;
  font-size: var(--text-sm);
  display: inline-grid;
  place-items: center;
  min-width: 2rem; height: 2rem;
  padding: 0 0.5rem;
  color: var(--accent-strong);
  background: var(--accent-soft);
  border-radius: var(--r-sm);
  line-height: 1;
}
.points {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface-dim);
  border: 1px solid var(--border-faint);
  padding: 0.2rem 0.55rem;
  border-radius: var(--r-full);
}
.subtask-id {
  font-family: var(--font-mono);
  font-size: var(--text-2xs);
  color: var(--faint);
  opacity: 1;
  margin-left: auto;
  letter-spacing: 0.02em;
}
.subtask-id.linkable:hover { color: var(--accent-strong); text-decoration: none; }
.subtask-id.copied { color: var(--ok-strong); }

.prompt { color: var(--ink); line-height: var(--leading-normal); }
.prompt p { margin: 0.4rem 0; }
.widgets { margin-top: var(--sp-4); display: flex; flex-direction: column; gap: var(--sp-3); align-items: flex-start; }
.grade-row { margin-top: 0; }

.subtask-nested {
  margin-left: 0;
  padding-left: var(--sp-5);
  border-left: 2px solid var(--accent-soft);
}

/* Situation / task context callout */
.situation,
.aufgabe-context {
  border-left: 3px solid var(--accent);
  background: var(--accent-faint);
  padding: var(--sp-3) var(--sp-4);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  margin: var(--sp-4) 0;
  color: var(--ink);
}

.choices { list-style: none; padding-left: 0; display: flex; flex-direction: column; gap: var(--sp-2); }
.choices li { display: flex; gap: 0.5rem; }
.choice-key {
  font-family: var(--font-mono); font-weight: 600;
  color: var(--accent-strong);
  margin-right: 0;
}

.prompt table {
  border-collapse: separate; border-spacing: 0;
  border: 1px solid var(--border); border-radius: var(--r-sm); overflow: hidden;
  font-size: var(--text-sm);
}
.prompt th, .prompt td { border: none; border-bottom: 1px solid var(--border-faint); border-right: 1px solid var(--border-faint); }
.prompt th { background: var(--surface-dim); font-weight: 650; }
.prompt tr:last-child td { border-bottom: none; }
.prompt th:last-child, .prompt td:last-child { border-right: none; }

/* ============================ 9. GRADE RESULT ============================ */

.grade-result {
  position: relative;
  margin-top: var(--sp-3);
  padding: var(--sp-4) var(--sp-4) var(--sp-4) 3.4rem;
  border-radius: var(--r-md);
  border: 1px solid;
  overflow: hidden;
}
.grade-result::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
}
.grade-result > strong {
  font-family: var(--font-display);
  font-weight: 650;
  font-size: var(--text-md);
  letter-spacing: var(--tracking-tight);
}
.grade-result p { margin: 0.3rem 0 0; color: var(--ink); font-size: var(--text-sm); }
/* Verdict icon badge */
.grade-result > strong::before {
  position: absolute;
  left: 0.85rem; top: 0.95rem;
  display: inline-grid; place-items: center;
  width: 1.85rem; height: 1.85rem;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 1rem;
}
.grade-correct   { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-strong); }
.grade-correct::before   { background: var(--ok); }
.grade-correct > strong::before { content: "✓"; background: var(--ok); color: var(--on-accent); }

.grade-incorrect { background: var(--bad-bg); border-color: var(--bad-line); color: var(--bad-dark); }
.grade-incorrect::before { background: var(--bad); }
.grade-incorrect > strong::before { content: "✕"; background: var(--bad); color: var(--on-accent); }

.grade-review    { background: var(--review-bg); border-color: var(--review-line); color: var(--review-strong); }
.grade-review::before    { background: var(--review); }
.grade-review > strong::before {
  content: "";
  background: none;
  border: 2.5px solid color-mix(in oklch, var(--review-strong) 35%, transparent);
  border-top-color: var(--review-strong);
  border-radius: 50%;
  width: 1.15rem; height: 1.15rem;
  animation: itp-spin 1.1s linear infinite;
}

/* Official solution nested in a grade */
.grade-solution {
  margin-top: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border-top: none;
  background: color-mix(in oklch, var(--surface) 70%, transparent);
  border: 1px dashed var(--border-soft);
  border-radius: var(--r-sm);
}
.grade-solution > strong { font-size: var(--text-sm); color: var(--ink-strong); }
.grade-solution pre,
.review-solution pre,
.review-answer pre {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  white-space: pre-wrap;
  background: var(--surface-dim);
  border: 1px solid var(--border-faint);
  border-radius: var(--r-sm);
  padding: var(--sp-3);
  margin: 0.4rem 0;
  color: var(--ink-strong);
  line-height: var(--leading-snug);
}
.review-solution pre { background: var(--ok-bg); border-color: var(--ok-line); }

/* ============================ 10. FEEDBACK ROW ============================ */

.feedback-row {
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--surface-dim);
  border: 1px solid var(--border-faint);
  border-radius: var(--r-full);
  width: fit-content;
  font-size: var(--text-sm);
}
.feedback-row .muted { margin-right: var(--sp-1); }
.feedback-row .linklike {
  font-size: 1.05rem;
  width: 2.1rem; height: 2.1rem;
  border-radius: 50%;
  opacity: 0.85;
  filter: grayscale(0.4);
  transition: background var(--dur-2) var(--ease), transform var(--dur-2) var(--ease), filter var(--dur-2) var(--ease);
}
.feedback-row .linklike:hover { background: var(--surface); box-shadow: var(--shadow-xs); transform: translateY(-1px); filter: grayscale(0); opacity: 1; }
.feedback-row .vote-active { opacity: 1; filter: grayscale(0); background: var(--surface); box-shadow: var(--shadow-xs); }

/* ============================ 11. ATTEMPT STATUS ============================ */

.attempt-status { gap: 0.5rem; font-size: var(--text-sm); }
.attempt-status .muted {
  display: inline-flex; align-items: center; gap: 0.45em;
  font-weight: 500;
}
.attempt-status .muted::before {
  content: ""; width: 0.55em; height: 0.55em; border-radius: 50%;
  background: var(--bar);
  box-shadow: 0 0 0 3px var(--accent-faint);
  animation: itp-pulse 1.6s var(--ease) infinite;
}
@keyframes itp-pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.45; } }
.attempt-status .form-error::before { animation: none; }

.attempt-header { gap: var(--sp-4); }

/* ============================ 12. CONTEXT MENU ============================ */

.ctx-menu {
  min-width: 13rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg);
  padding: var(--sp-1);
}
.ctx-menu-item {
  min-height: 0;
  padding: 0.5rem 0.75rem;
  border-radius: var(--r-xs);
  background: none;
  box-shadow: none;
  border: none;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-strong);
  text-align: left;
  justify-content: flex-start;
}
.ctx-menu-item:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent-ink); box-shadow: none; }
.ctx-menu-item:disabled { color: var(--faint); background: none; }
.ctx-menu-danger { color: var(--bad-dark); }
.ctx-menu-danger:hover:not(:disabled) { background: var(--bad-bg); color: var(--bad-dark); }
.ctx-menu-sep { border-top: 1px solid var(--border-faint); margin: var(--sp-1) 0.5rem; }

/* ============================ 13. DEBUG PANEL ============================ */

.debug-panel {
  font-size: var(--text-sm);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: var(--sp-3) var(--sp-4);
  box-shadow: var(--shadow-xs);
}
.debug-panel summary {
  cursor: pointer; font-weight: 600; color: var(--ink-strong);
  font-family: var(--font-display); list-style: none;
  display: flex; align-items: center; gap: 0.5em;
}
.debug-panel summary::before { content: "▸"; color: var(--muted); transition: transform var(--dur-2) var(--ease); font-size: 0.85em; }
.debug-panel[open] summary::before { transform: rotate(90deg); }
.debug-panel pre {
  font-family: var(--font-mono); font-size: var(--text-2xs);
  white-space: pre-wrap; background: var(--surface-dim);
  border: 1px solid var(--border-faint); padding: var(--sp-3);
  border-radius: var(--r-sm); margin-top: var(--sp-3);
}
.debug-panel dt { font-weight: 600; margin-top: var(--sp-2); font-family: var(--font-mono); font-size: var(--text-2xs); color: var(--muted); text-transform: uppercase; letter-spacing: var(--tracking-wide); }
.debug-panel dd { margin: 0.15rem 0 0; }

/* ============================ 14. NETZPLAN ============================ */
/* Classic CPM Vorgangsknoten (IHK worksheet convention), from the Claude
   Design round-trip (templates/warm-fokus theme, section 17):
        FAZ                 FEZ        earliest start / finish (above box)
      +--------------------------+
      |          Vorgang         |     activity id (given)
      +--------+--------+--------+
      |  Dauer |   GP   |   FP   |     duration (given) - total - free float
      +--------+--------+--------+
        SAZ                 SEZ        latest start / finish (below box)
   Value fields are plain text inputs; no steppers. */

.np-node {
  display: inline-flex;
  flex-direction: column;
  width: 10rem;
  font-family: var(--font-mono);
  color: var(--ink-strong);
}
.np-corners {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 0.1rem;
  min-height: 1.4rem;
}
.np-corners--top { margin-bottom: 3px; }
.np-corners--bottom { margin-top: 3px; }

.np-box {
  border: 1.5px solid var(--ink-strong);
  border-radius: var(--r-xs);
  overflow: hidden;
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.np-head {
  text-align: center;
  font-family: var(--font-display);
  font-weight: 650;
  font-size: var(--text-md);
  padding: 0.35rem 0.5rem;
  border-bottom: 1.5px solid var(--ink-strong);
  color: var(--ink-strong);
  background: var(--surface-alt);
  letter-spacing: 0.01em;
  line-height: 1.1;
}
.np-cells { display: grid; grid-template-columns: 1fr 1fr 1fr; }
.np-cell {
  display: flex;
  min-width: 0;
  border-right: 1.5px solid var(--ink-strong);
}
.np-cell:last-child { border-right: none; }
.np-cell--given {
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: 0.4rem 0.2rem;
  color: var(--ink-strong);
  background: var(--surface-dim);
}

/* Editable value fields (FAZ/FEZ/SAZ/SEZ, GP, FP) — text input, no spinners */
.np-in {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  font-weight: 500;
  text-align: center;
  color: var(--ink-strong);
  background: var(--surface);
  border: none;
  width: 100%;
  min-width: 0;
  padding: 0.4rem 0.2rem;
  transition: background var(--dur-1) var(--ease), box-shadow var(--dur-1) var(--ease);
}
.np-in::-webkit-outer-spin-button,
.np-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.np-in:hover { background: var(--accent-faint); }
.np-in:focus {
  outline: none;
  background: var(--accent-faint);
  box-shadow: inset 0 0 0 2px var(--accent);
  border-radius: 4px;
}
.np-in::placeholder { color: var(--faint); opacity: 0.6; }

/* Corner fields sit outside the box, smaller and quieter */
.np-corners .np-in {
  width: 2.7rem;
  padding: 0.15rem 0.1rem;
  background: transparent;
  color: var(--ink-soft);
  font-weight: 600;
}
.np-corners .np-in:hover,
.np-corners .np-in:focus { background: var(--accent-faint); border-radius: 4px; }

/* Static values (solution/review rendering) reuse the input geometry */
span.np-in { display: inline-flex; align-items: center; justify-content: center; }

/* Legende variant — captions instead of inputs */
.np-node--legend .np-corners span,
.np-node--legend .np-cell--cap {
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: var(--text-xs);
  color: var(--ink-strong);
  width: 100%;
  padding: 0.4rem 0.2rem;
}
.np-node--legend .np-corners span { color: var(--ink-soft); }
.np-legend-wrap { text-align: center; }
.np-legend-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-md);
  color: var(--ink-strong);
  margin: 0 0 var(--sp-4);
}

/* Critical path */
.np-node--critical .np-box { border-color: var(--bad); box-shadow: 0 0 0 1px var(--bad-line), var(--shadow-sm); }
.np-node--critical .np-head { border-bottom-color: var(--bad); background: var(--bad-bg); color: var(--bad-dark); }
.np-node--critical .np-cell { border-right-color: var(--bad); }
.np-node--critical .np-cell--given { background: color-mix(in oklch, var(--bad-bg) 70%, var(--surface)); }
.np-node--critical .np-corners .np-in { color: var(--bad-dark); }

/* Layout row: legend + Vorgangstabelle above the diagram */
.np-top {
  display: grid;
  grid-template-columns: minmax(13rem, 15rem) 1fr;
  gap: var(--gap-card);
  align-items: start;
  width: 100%;
  margin-bottom: var(--sp-4);
}
@media (max-width: 640px) { .np-top { grid-template-columns: 1fr; } }
.np-top .data-table { margin-top: 0; }

.np-diagram { overflow-x: auto; padding-bottom: var(--sp-2); }

/* ============================ 15. EDITOR CANVAS / DIAGRAMS ============================ */

.editor-canvas {
  border: 1.5px dashed var(--border-soft);
  background:
    radial-gradient(circle at 1px 1px, var(--border-faint) 1px, transparent 0) 0 0 / 20px 20px,
    var(--surface);
  border-radius: var(--r-md);
  transition: border-color var(--dur-2) var(--ease), box-shadow var(--dur-2) var(--ease);
}
.editor-canvas:hover { border-color: var(--accent); }
.editor-canvas.connecting { outline: 2px solid var(--accent); outline-offset: 2px; border-color: var(--accent); }
.editor-hint { color: var(--muted); font-size: var(--text-xs); margin-top: var(--sp-2); }

/* d-* SVG vocabulary — retuned to the warm palette + mono labels (preserved) */
.d-title, .d-label, .d-label-lg, .d-label-sm, .d-hint, .d-hint-sm, .d-hint-lg, .d-accent-text, .d-axis { font-family: var(--font-mono); }
.d-title { font-weight: 600; }
.d-shape { fill: var(--surface); stroke: var(--ink-strong); stroke-width: 1.4; }
.d-device { fill: var(--surface-dim); }
.d-device-active { fill: var(--accent-soft); stroke: var(--accent); }
.d-bar { fill: var(--bar); }
.d-boundary { stroke: var(--border-soft); }

/* Given (locked) diagram elements */
.given-el { opacity: 0.7; }

/* ============================ 16. UTILITIES / MISC ============================ */

.subtask-target { animation: subtask-flash 2.4s var(--ease-out); }
@keyframes subtask-flash { 0% { background: var(--flash); } 100% { background: transparent; } }

.usecase-forms fieldset { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-4); }
.usecase-forms legend { font-weight: 600; color: var(--ink-strong); padding: 0 0.4rem; }
.editor-block { border-left: 2px solid var(--accent-soft); padding-left: var(--sp-3); }
.match-row { gap: var(--sp-3); }
.inline-check { font-size: var(--text-sm); }

/* ============================ 17. MOBILE (#72) ============================ */
/* The theme's rounded-corner tables set overflow: hidden, which beats the
   base stylesheet's mobile scroll rules (this sheet loads last). Re-assert
   the scroll behavior for narrow screens here. */

@media (max-width: 700px) {
  .prompt table,
  .aufgabe-context table,
  .situation table,
  .exam-table,
  .data-table,
  .code-correction-table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .prompt table tbody,
  .aufgabe-context table tbody,
  .situation table tbody,
  .exam-table tbody {
    display: table;
    min-width: 100%;
  }

  .nav-links {
    order: 3;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    justify-content: flex-start;
  }

  .netzplan-scroll .editor-canvas,
  .netzplan-canvas { max-width: none; }

  .exam-table th,
  .exam-table td,
  .prompt table th,
  .prompt table td,
  .aufgabe-context table th,
  .aufgabe-context table td {
    padding: 0.25rem 0.3rem;
    font-size: 0.75rem;
    white-space: normal;
    overflow-wrap: break-word;
    hyphens: auto;
  }

  .win-ip-octet { width: 1.9rem; padding: 0.2rem 0; }
  .win-ip-row { flex-wrap: wrap; gap: 0.15rem 0.5rem; }
  .win-ip-label { width: 100%; font-size: 0.8rem; }
}
