/* Schreiben (Teil 4): task list, exam sheet, editor with live checks, models, rubric, attempts.
   The sheet, editor and rubric are also embedded in the Probetest Schreiben stages.
   Two-column layouts switch on when the content column is about 840px wide:
   (min-width: 880px) and (max-width: 1023px) – no sidebar – or (min-width: 1184px) – with the 264px sidebar. */

/* ---------- small pieces */
.w-level { display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px; border-radius: var(--r-xs); border: 1px solid var(--line-strong); font-size: 0.72rem; font-weight: 600; color: var(--ink); letter-spacing: 0; }
.w-reg { display: inline-flex; align-items: center; gap: 6px; height: 22px; font-size: 0.8rem; font-weight: 500; color: var(--ink-2); white-space: nowrap; }
.w-reg b { display: inline-grid; place-items: center; min-width: 28px; height: 20px; padding: 0 5px; border-radius: var(--r-xs); font-size: 0.7rem; font-weight: 650; letter-spacing: 0.01em; }
.w-reg.is-formell b { background: var(--ink); color: var(--surface); }
.w-reg.is-informell b { border: 1.5px solid var(--ink); color: var(--ink); }
.w-pts { font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -0.02em; white-space: nowrap; }
.w-pts small { font-size: 0.72em; font-weight: 500; color: var(--ink-3); margin-left: 1px; }
.side-title { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-size: var(--fs-eyebrow); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.side-title .icon { width: 15px; height: 15px; color: var(--l-schreiben); }

/* segmented control from buttons (same look as .tabs) */
.tabs.w-seg { margin: 0; flex-wrap: nowrap; }
.w-seg button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 13px; border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); font: inherit; font-size: 0.9rem; font-weight: 560; white-space: nowrap; cursor: pointer;
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast), transform var(--t-fast) var(--ease-press); }
.w-seg button:hover { color: var(--ink); }
.w-seg button:active { transform: translateY(1px); }
.w-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
:root[data-theme="dark"] .w-seg button[aria-pressed="true"] { background: var(--surface-hover); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .w-seg button[aria-pressed="true"] { background: var(--surface-hover); } }
.w-seg-key { display: inline-grid; place-items: center; min-width: 24px; height: 18px; padding: 0 4px; border-radius: 4px; background: var(--surface-hover); color: var(--ink-2); font-size: 0.68rem; font-weight: 650; }
.w-seg button[aria-pressed="true"] .w-seg-key { background: var(--ink); color: var(--surface); }
.w-seg-sm button { min-height: 30px; padding: 0 11px; font-size: 0.84rem; }
@media (pointer: coarse) { .w-seg button { min-height: 44px; } .w-seg-sm button { min-height: 40px; } }

/* ---------- task list */
.w-hub { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "stats" "list" "recent" "method"; gap: var(--s-4); align-items: start; }
.w-tasks { grid-area: list; min-width: 0; }
.w-side { display: contents; }
.w-side > .card { margin: 0; }
.w-stats-card { grid-area: stats; }
.w-recent-card { grid-area: recent; }
.w-method-card { grid-area: method; }
@media (min-width: 880px) and (max-width: 1023px), (min-width: 1184px) {
  .w-hub { grid-template-columns: minmax(0, 1fr) 328px; grid-template-areas: "list side"; gap: var(--s-6); }
  .w-side { grid-area: side; display: flex; flex-direction: column; gap: var(--s-4); position: sticky; top: 24px; }
}
@media (min-width: 880px) and (max-width: 1023px) { .w-side { top: calc(var(--topbar-h) + 16px + env(safe-area-inset-top)); } }

.w-toolbar { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--s-3) var(--s-5); margin: 0 0 var(--s-4); }
.w-filter { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.w-filter-label { font-size: var(--fs-caption); font-weight: 600; color: var(--ink-2); }
.w-count { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 0 auto; padding-bottom: 9px; font-size: var(--fs-small); color: var(--ink-3); white-space: nowrap; }
.w-count .mono { color: var(--ink); font-weight: 600; }
.w-count .sep { width: 4px; height: 4px; margin: 0 4px; border-radius: 50%; background: var(--line-strong); }
@media (max-width: 599px) {
  .w-toolbar { gap: var(--s-3); }
  .w-filter, .w-filter .w-seg { width: 100%; }
  .w-filter .w-seg button { flex: 1; justify-content: center; padding: 0 8px; }
  .w-count { margin-left: 0; padding-bottom: 0; }
}

.w-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden; }
.w-list > li + li { border-top: 1px solid var(--line); }
.w-list > li.w-list-empty .empty { margin: 0; border: 0; border-radius: 0; }
.w-row { position: relative; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto 20px; gap: 6px 16px; align-items: center; padding: 16px 20px 16px 18px; color: inherit; text-decoration: none; transition: background-color var(--t-fast) var(--ease-out); }
@media (hover: hover) { .w-row:hover { background: var(--surface-sunken); } }
.w-row:focus-visible { border-radius: 0; box-shadow: inset 0 0 0 2px var(--accent-strong); }
.w-dot { align-self: start; display: grid; place-items: center; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 2.5px solid var(--l-schreiben); background: var(--surface); color: var(--surface); }
.w-dot .icon { width: 13px; height: 13px; stroke-width: 3; }
.w-row.is-done .w-dot { background: var(--l-schreiben); }
:root[data-theme="dark"] .w-row.is-done .w-dot { color: var(--canvas); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .w-row.is-done .w-dot { color: var(--canvas); } }
.w-row-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.w-row-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-bottom: 3px; }
.w-row-theme { font-size: var(--fs-caption); color: var(--ink-3); }
.w-row-title { font-weight: 600; letter-spacing: -0.01em; line-height: 1.35; }
.w-row-sit { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; max-width: 70ch; font-size: var(--fs-small); line-height: 1.5; color: var(--ink-2); }
.w-row-status { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; text-align: right; }
.w-row-status .w-pts { font-size: 1.15rem; }
.w-row-count { font-size: var(--fs-caption); color: var(--ink-3); white-space: nowrap; }
.w-row-new { font-size: var(--fs-caption); color: var(--ink-3); white-space: nowrap; }
.w-row-go { display: grid; place-items: center; color: var(--ink-3); transition: transform var(--t-mid) var(--ease-out), color var(--t-fast); }
.w-row-go .icon { width: 18px; height: 18px; }
@media (hover: hover) { .w-row:hover .w-row-go { color: var(--ink); transform: translateX(3px); } }
@media (max-width: 599px) {
  .w-row { grid-template-columns: 24px minmax(0, 1fr); padding: 14px 14px 14px 12px; gap: 8px 12px; }
  .w-row-status { grid-column: 2; flex-direction: row; align-items: baseline; gap: 8px; }
  .w-row-status .w-pts { font-size: 1rem; }
  .w-row-go { display: none; }
}

/* side panel cards */
.w-stat-grid { display: grid; grid-template-columns: 1fr 1fr; margin: 0 -4px; }
.w-stat { display: flex; flex-direction: column; gap: 2px; min-width: 0; padding: 10px 4px; }
.w-stat:nth-child(n + 3) { border-top: 1px solid var(--line); }
.w-stat:nth-child(even) { padding-left: 16px; border-left: 1px solid var(--line); }
.w-stat-label { font-size: var(--fs-caption); color: var(--ink-3); }
.w-stat-value { font-size: 1.5rem; font-weight: 550; letter-spacing: -0.03em; line-height: 1.2; }
.w-stat-value small { font-size: 0.6em; color: var(--ink-3); font-weight: 500; letter-spacing: 0; }
.w-stat .progress { margin: 6px 0 0; }
.w-stat .hint { line-height: 1.3; }
@media (max-width: 599px) {
  .w-stats-card { padding: 14px 14px 12px; }
  .w-stat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; }
  .w-stat, .w-stat:nth-child(even), .w-stat:nth-child(n + 3) { padding: 2px 8px 2px 10px; border-left: 1px solid var(--line); border-top: 0; }
  .w-stat:first-child { padding-left: 0; border-left: 0; }
  .w-stat-label { font-size: 0.72rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .w-stat-value { font-size: 1.15rem; }
  .w-stat .hint { display: none; }
}

.w-recent { list-style: none; margin: 0 -10px; padding: 0; }
.w-recent a { display: grid; grid-template-columns: 52px minmax(0, 1fr) 16px; align-items: center; gap: 10px; min-height: 52px; padding: 6px 10px; border-radius: var(--r-md); color: inherit; text-decoration: none; transition: background-color var(--t-fast); }
.w-recent a:hover { background: var(--surface-sunken); }
.w-recent a > .icon { width: 16px; height: 16px; color: var(--ink-3); transition: transform var(--t-mid) var(--ease-out); }
.w-recent a:hover > .icon { transform: translateX(2px); color: var(--ink); }
.w-recent .w-pts { font-size: 1.02rem; }
.w-recent-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.w-recent-title { font-size: var(--fs-small); font-weight: 560; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w-recent-meta { font-size: var(--fs-caption); color: var(--ink-3); }
.w-recent-empty { display: flex; gap: 12px; align-items: flex-start; margin: 0; font-size: var(--fs-small); color: var(--ink-2); }
.w-empty-icon { display: grid; place-items: center; width: 36px; height: 36px; flex: none; border-radius: 50%; background: var(--surface-sunken); color: var(--ink-3); }
.w-empty-icon .icon { width: 17px; height: 17px; }

.w-method { position: relative; list-style: none; margin: 4px 0 12px; padding: 0; }
.w-method::before { content: ""; position: absolute; left: 7px; top: 12px; bottom: 12px; width: 3px; border-radius: 3px; background: var(--lc); opacity: 0.35; }
.w-method li { position: relative; display: flex; flex-direction: column; padding: 5px 0 5px 28px; line-height: 1.35; }
.w-method li::before { content: ""; position: absolute; left: 0; top: 8px; width: 17px; height: 17px; border-radius: 50%; background: var(--surface); border: 3px solid var(--lc); box-sizing: border-box; }
.w-method li strong { font-size: 0.95rem; }
.w-method li span { font-size: var(--fs-small); color: var(--ink-2); }
.w-method-card .hint { margin: 0 0 6px; }
.w-method-link { margin-left: -12px; }

/* ---------- task sheet (exam paper) */
.w-sheet { container-type: inline-size; padding: 0; margin: 0 0 var(--s-4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); overflow: hidden; }
.w-sheet-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 20px; background: var(--surface-sunken); border-bottom: 1px solid var(--line); }
.w-sheet-title { margin: 0; font-size: 1rem; font-weight: 600; letter-spacing: -0.01em; }
.w-sheet-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-left: auto; }
.w-sheet-theme, .w-sheet-id { font-size: var(--fs-caption); color: var(--ink-3); }
.w-sheet-body { padding: 20px 24px 22px; font-size: 1.0625rem; line-height: 1.7; }
.w-sheet .w-sheet-situation .situation { max-width: 68ch; margin: 0; padding: 0; border: 0; border-radius: 0; background: none; font-size: inherit; line-height: inherit; }
.w-sheet .w-sheet-situation .situation p { margin: 0 0 0.6em; }
.w-sheet-to { margin: 0 0 16px; max-width: 68ch; color: var(--ink-2); }
.w-sheet-to strong { color: var(--ink); }
.leitpunkte { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.leitpunkte li { display: flex; align-items: center; gap: 14px; min-height: 48px; padding: 8px 2px; border-bottom: 1px solid var(--line); }
.leitpunkte .lp-num { display: grid; place-items: center; width: 28px; height: 28px; flex: none; border-radius: 50%; border: 1.5px solid var(--line-strong); font-size: 0.8rem; font-weight: 600; color: var(--ink-2); background: var(--surface);
  transition: background-color var(--t-mid) var(--ease-out), border-color var(--t-mid), color var(--t-mid); }
.leitpunkte .lp-text { flex: 1; min-width: 0; font-weight: 500; }
.leitpunkte .lp-state { display: grid; place-items: center; width: 24px; height: 24px; flex: none; border-radius: 50%; color: var(--good); background: var(--good-soft); opacity: 0; transform: scale(0.6); transition: opacity var(--t-mid) var(--ease-out), transform var(--t-mid) var(--ease-out); }
.leitpunkte .lp-state .icon { width: 14px; height: 14px; stroke-width: 2.6; }
.leitpunkte li.covered .lp-num { background: var(--good); border-color: var(--good); color: var(--surface); }
.leitpunkte li.covered .lp-state { opacity: 1; transform: none; }
.w-sheet-foot { display: flex; align-items: center; gap: 8px; margin: 14px 0 0; font-size: 0.95rem; color: var(--ink-2); }
.w-sheet-foot .icon { color: var(--ink-3); width: 16px; height: 16px; }
@container (min-width: 900px) {
  .w-sheet-body { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 36px; padding: 22px 28px 24px; }
  .w-sheet-to { margin-bottom: 0; }
}
@media (max-width: 599px) {
  .w-sheet-head { padding: 12px 16px; }
  .w-sheet-meta { margin-left: 0; width: 100%; }
  .w-sheet-body { padding: 16px 16px 18px; font-size: 1.02rem; }
  .leitpunkte li { gap: 12px; }
}

/* ---------- editor: writing surface + live-check panel */
.editor { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-4); align-items: start; margin: 0 0 var(--s-4); }
@media (min-width: 880px) and (max-width: 1023px), (min-width: 1184px) {
  .editor { grid-template-columns: minmax(0, 1fr) 300px; gap: var(--s-5); }
  .editor-side { position: sticky; top: 72px; }
}
@media (min-width: 880px) and (max-width: 1023px) { .editor-side { top: calc(var(--topbar-h) + 66px + env(safe-area-inset-top)); } }

.editor-main { position: relative; min-width: 0; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-lg); box-shadow: var(--shadow-1); overflow: hidden;
  transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.editor-main:focus-within { border-color: var(--accent-strong); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 35%, transparent); }
.editor-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 46px; padding: 8px 16px 8px 20px; border-bottom: 1px solid var(--line); }
.editor-label { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-small); font-weight: 600; color: var(--ink-2); white-space: nowrap; cursor: text; }
.editor-label .icon { width: 16px; height: 16px; color: var(--l-schreiben); }
.w-wc { display: inline-flex; align-items: baseline; gap: 8px; font-size: var(--fs-small); white-space: nowrap; }
.w-wc .wordcount { color: var(--ink-2); }
.w-wc .wordcount .mono { font-weight: 600; color: var(--ink); }
.w-wc-target { font-size: var(--fs-caption); color: var(--ink-3); padding: 1px 8px; border: 1px solid var(--line); border-radius: 999px; }
@media (max-width: 599px) { .editor-head { padding: 8px 12px 8px 16px; } .w-wc-tlabel { display: none; } }

/* ruled answer sheet: one rule per 30px text line, scrolling with the text */
textarea.writing { --lh: 30px; display: block; width: 100%; min-height: 392px; margin: 0; padding: 16px 22px 20px; border: 0; border-radius: 0; resize: vertical;
  font-size: 1.0625rem; line-height: var(--lh); color: var(--ink); background-color: transparent;
  background-image: linear-gradient(to bottom, transparent calc(var(--lh) - 1px), var(--line) calc(var(--lh) - 1px));
  background-size: 100% var(--lh); background-position: 0 16px; background-repeat: repeat-y; background-attachment: local; background-clip: content-box; }
.editor-main textarea.writing:hover, .editor-main textarea.writing:focus-visible { border: 0; box-shadow: none; border-radius: 0; }
@media (max-width: 599px) { textarea.writing { min-height: 300px; padding: 14px 16px 18px; } }

.w-meter { position: relative; height: 4px; background: var(--surface-sunken); }
.w-meter-fill { position: absolute; inset: 0; background: var(--accent); transform-origin: left center; transform: scaleX(var(--p, 0)); transition: transform var(--t-mid) var(--ease-out), background-color var(--t-mid); }
.w-meter.is-good .w-meter-fill { background: var(--good); }
.w-meter.is-long .w-meter-fill { background: var(--warn); }
.w-meter-band { position: absolute; top: 0; bottom: 0; left: calc(var(--lo) * 100%); right: calc((1 - var(--hi)) * 100%); border-left: 2px solid var(--ink-3); border-right: 2px solid var(--ink-3); opacity: 0.55; }

.editor-side { margin: 0; padding: 18px 18px 16px; font-size: var(--fs-small); }
.side-block + .side-block { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.side-block .side-title .w-lp-count { margin-left: auto; padding: 1px 8px; border-radius: 999px; background: var(--surface-sunken); color: var(--ink-2); font-size: 0.75rem; letter-spacing: 0; text-transform: none; }
.side-block .side-title .w-lp-count.all { background: var(--good-soft); color: var(--good); }
.ck-list { list-style: none; margin: 0; padding: 0; }
.ck-list li { display: flex; align-items: flex-start; gap: 10px; padding: 7px 0; }
.ck-list li > .icon { width: 18px; height: 18px; margin-top: 1px; color: var(--ink-3); transition: color var(--t-fast); }
.ck-list li.ok > .icon { color: var(--good); }
.ck-list li.warn > .icon { color: var(--warn); }
.ck-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.ck-text strong { color: var(--ink); font-weight: 600; }
.ck-detail { font-size: var(--fs-caption); color: var(--ink-3); }
.ck-list li.ok .ck-detail { color: var(--good); }
.ck-list li.warn .ck-detail { color: var(--warn); }
.issues { list-style: none; display: flex; flex-direction: column; gap: 6px; margin: 6px 0 0; padding: 0; }
.issues:empty { display: none; }
.issues li.warn { display: flex; gap: 8px; align-items: flex-start; padding: 8px 10px; border-radius: var(--r-sm); background: var(--warn-soft); border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent); color: var(--ink); font-size: var(--fs-caption); line-height: 1.45; }
.issues li.warn .icon { width: 15px; height: 15px; margin-top: 1px; color: var(--warn); }
.lp-ticks { margin: 0 0 6px; }
.lp-ticks li { gap: 10px; padding: 5px 0; }
.lp-ticks label { display: flex; gap: 8px; cursor: pointer; line-height: 1.4; }
.lp-ticks .lp-num { flex: none; min-width: 1.1em; color: var(--ink-3); font-size: 0.8rem; font-weight: 600; line-height: 1.75; }
.lp-ticks input:checked + label { color: var(--ink-2); }
.lp-ticks input:checked + label .lp-num { color: var(--good); }
@media (pointer: coarse) { .lp-ticks li { min-height: 44px; align-items: center; } .lp-ticks li input { margin-top: 0; } }
.editor-side .hint { margin: 0; }

/* task page: sheet + writing surface on the left, live checks sticky on the right */
.w-layout { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "sheet" "write" "side" "actions"; gap: var(--s-4); align-items: start; margin-bottom: var(--s-5); }
.w-layout > .w-sheet { grid-area: sheet; margin: 0; }
.w-layout > .editor { display: contents; }
.w-layout .editor-main { grid-area: write; }
.w-layout .editor-side { grid-area: side; }
.w-layout > .w-actions { grid-area: actions; }
@media (min-width: 880px) and (max-width: 1023px), (min-width: 1184px) {
  .w-layout { grid-template-columns: minmax(0, 1fr) 300px; grid-template-areas: "sheet side" "write side" "actions side"; column-gap: var(--s-5); }
}

.w-actions { display: flex; flex-direction: column; gap: var(--s-3); min-width: 0; }
.w-actions-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.w-draft { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.w-draft .icon { width: 14px; height: 14px; }
.w-ai { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; padding: 14px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); }
.w-ai-icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--surface-sunken); color: var(--l-schreiben); }
.w-ai-icon .icon { width: 20px; height: 20px; }
.w-ai-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.4; }
.w-ai-text strong { font-size: 0.95rem; }
.w-ai-text span { font-size: var(--fs-small); color: var(--ink-2); }
@media (max-width: 599px) {
  .w-actions-row > .btn.primary { flex: 1 1 100%; }
  .w-draft { margin-left: 0; }
  .w-ai { grid-template-columns: auto minmax(0, 1fr); }
  .w-ai-btn { grid-column: 1 / -1; width: 100%; }
}

/* ---------- after finishing: compare, self-assessment, history */
.w-after:empty { display: none; }
.w-after > .card { animation: rise-in var(--t-slow) var(--ease-out) both; }
.w-after > .card + .card { animation-delay: 60ms; }
.w-sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: var(--s-4); }
.w-sec-head h2 { margin: 0; }
.w-sec-head .eyebrow { margin-bottom: 6px; }
.w-sec-head .eyebrow .icon { width: 15px; height: 15px; color: var(--l-schreiben); }
.w-sec-head .sub { margin: 6px 0 0; }

.w-compare { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); align-items: start; margin-bottom: var(--s-4); }
@media (min-width: 880px) and (max-width: 1023px), (min-width: 1184px) { .w-compare { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.w-col-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; min-height: 40px; margin-bottom: 10px; }
.w-col-head h3 { margin: 0; font-size: var(--fs-small); font-weight: 600; text-transform: uppercase; letter-spacing: 0.07em; color: var(--ink-3); }
.w-compare .attempt-text { margin: 0; font-size: 1rem; }
.w-model { background: var(--surface); border-color: var(--line-strong); font-size: 1rem; }
.w-model p { margin: 0 0 0.8em; }
.w-model p:last-child { margin-bottom: 0; }
.w-model-panel { animation: fade-in var(--t-mid) var(--ease-out); }
.w-model-panel > .hint { margin: 8px 0 0; }
.w-model-panel details.reveal { margin: 10px 0 0; }
.w-translation p { margin: 0 0 0.7em; color: var(--ink-2); }
.w-translation p:last-child { margin-bottom: 0; }
details.reveal > summary .icon { width: 17px; height: 17px; color: var(--ink-3); }
.w-notes { margin: 0; padding-left: 1.2em; color: var(--ink-2); line-height: 1.6; }
.w-notes li { margin: 0 0 6px; }
.w-notes li::marker { color: var(--l-schreiben); }
.w-notes li:last-child { margin-bottom: 0; }

.w-assess-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s-5); align-items: start; }
@media (min-width: 880px) and (max-width: 1023px), (min-width: 1184px) { .w-assess-grid { grid-template-columns: minmax(0, 1.65fr) minmax(250px, 1fr); gap: var(--s-6); } }
.w-ai-panel { padding: 18px 18px 6px; border-radius: 14px; background: var(--surface-sunken); border: 1px solid var(--line); }
.w-ai-steps { list-style: none; counter-reset: ai; margin: 0; padding: 0; }
.w-ai-steps > li { counter-increment: ai; position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 0 0 16px 34px; font-size: var(--fs-small); color: var(--ink-2); }
.w-ai-steps > li::before { content: counter(ai); position: absolute; left: 0; top: -1px; display: grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-strong); font-family: var(--mono); font-size: 0.72rem; font-weight: 600; color: var(--ink); }
.w-ai-steps .field { width: 100%; margin: 0; }
.w-ai-steps input { width: 100%; max-width: 160px; }
.w-save-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: var(--s-5); padding-top: var(--s-4); border-top: 1px solid var(--line); }
.w-save-row .hint { margin: 0; }

/* rubric (also in Probetest › Bewertung Schreiben) */
.w-rubric { max-width: 780px; }
.w-rubric-note { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 16px; font-size: var(--fs-caption); color: var(--ink-2); line-height: 1.5; }
.w-rubric-note .icon { width: 15px; height: 15px; margin-top: 1px; color: var(--warn); }
.w-sec-head h2 .badge { margin-left: 4px; vertical-align: 3px; }
.w-crit-group { margin: 0 0 12px; }
.w-crit-group-title { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0; padding-bottom: 8px; font-size: var(--fs-eyebrow); font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-3); }
.w-crit-group-title .mono { letter-spacing: 0; text-transform: none; font-weight: 500; }
.w-crit { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "label steps" "level steps"; align-items: center; gap: 2px 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.w-crit-label { grid-area: label; display: flex; flex-direction: column; font-weight: 560; line-height: 1.35; }
.w-crit-label small { font-size: var(--fs-caption); font-weight: 500; color: var(--ink-3); }
.w-crit-level { grid-area: level; font-size: var(--fs-caption); color: var(--ink-3); line-height: 1.4; }
.w-steps { grid-area: steps; display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-sunken); border: 1px solid var(--line); border-radius: 12px; justify-self: end; }
.w-step { position: relative; display: block; }
.w-step input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.w-step span { display: grid; place-items: center; min-width: 46px; min-height: 32px; padding: 0 10px; border-radius: 9px; font-family: var(--mono); font-variant-numeric: tabular-nums; font-size: 0.86rem; font-weight: 500; color: var(--ink-2);
  transition: background-color var(--t-fast) var(--ease-out), color var(--t-fast); pointer-events: none; }
.w-step input:hover + span { color: var(--ink); }
.w-step input:checked + span { background: var(--surface); color: var(--ink); font-weight: 650; box-shadow: var(--shadow-1), inset 0 0 0 1px var(--line-strong); }
:root[data-theme="dark"] .w-step input:checked + span { background: var(--surface-hover); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .w-step input:checked + span { background: var(--surface-hover); } }
.w-step input:focus-visible + span { box-shadow: var(--focus-ring); }
@media (pointer: coarse) { .w-step span { min-height: 40px; min-width: 52px; } }
@media (max-width: 599px) {
  .w-crit { grid-template-columns: minmax(0, 1fr); grid-template-areas: "label" "steps" "level"; gap: 8px; padding: 12px 0; }
  .w-steps { justify-self: stretch; }
  .w-step { flex: 1; }
}
.w-score-row { display: grid; grid-template-columns: auto auto minmax(80px, 1fr); align-items: center; gap: 6px 16px; margin-top: 4px; padding: 14px 16px; border-radius: 12px; background: var(--surface-sunken); border: 1px solid var(--line); }
.w-score-label { display: flex; flex-direction: column; font-weight: 600; line-height: 1.3; }
.w-score-label small { font-size: var(--fs-caption); font-weight: 500; color: var(--ink-3); }
.w-score { display: inline-flex; align-items: baseline; gap: 6px; font-variant-numeric: tabular-nums; }
.w-score-num { font-size: 1.9rem; font-weight: 600; letter-spacing: -0.04em; line-height: 1; }
.w-score-of { color: var(--ink-3); font-size: 0.95rem; }
.w-score-row .progress { margin: 0; }
@media (max-width: 599px) { .w-score-row { grid-template-columns: minmax(0, 1fr) auto; } .w-score-row .progress { grid-column: 1 / -1; } }

/* attempts history */
.w-history-best { display: inline-flex; align-items: baseline; gap: 6px; font-size: var(--fs-small); color: var(--ink-3); }
.w-history-best .w-pts { font-size: 1.15rem; color: var(--ink); }
.w-attempts details.reveal > summary { flex-wrap: wrap; gap: 6px 14px; font-weight: 500; }
.w-at-score { min-width: 4.2ch; font-size: 1.05rem; }
.w-at-date { font-weight: 600; }
.w-at-facts { font-size: var(--fs-caption); color: var(--ink-3); }
.w-attempts .attempt-text { margin: 0 0 4px; }
.w-attempts .row { margin-bottom: 0; }
@media (max-width: 599px) { .w-at-facts { flex-basis: 100%; order: 5; } }
