/* DE: Redaktion: facettierte Wortliste, Wort-Editor, Lehrwerk-Import/Kuration, Klassen, Fehlerseiten, Pruefen-Queue.
   EN: Editorial: faceted word list, word editor, textbook import/curation, classes, error pages, review queue. */

/* Redaktion — faceted word list */
.facet-bar{display:flex;flex-wrap:wrap;gap:var(--sp-md);align-items:end;margin-block:var(--sp-lg);
  padding:var(--sp-md);background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md)}
.facet-field{display:flex;flex-direction:column;gap:.25rem;position:relative}
.facet-field--grow{flex:1;min-inline-size:12rem}
.facet-field label{font-size:var(--step--1);color:var(--text-muted);font-weight:600}
.facet-field select,.facet-field input[type="search"],.facet-field input[type="text"],
.facet-field input[type="number"]{font:inherit;padding:.45rem .6rem;
  border:1px solid var(--border);border-radius:var(--radius-sm);background:var(--surface);color:var(--text)}
/* In the filter bar the open hint FLOATS as a popover (out of flow, anchored under its field) instead of
   expanding the field — so opening several hints (a realistic editor habit) never reshuffles the wrapping
   grid. Paired with the <details name> accordion (InfoHintComponent group:) only one is open at a time. */
.facet-field .info-hint__body{position:absolute;inset-inline-start:0;inset-block-start:calc(100% + .35rem);
  z-index:30;inline-size:max-content;max-inline-size:min(26rem,80vw);
  box-shadow:0 6px 20px rgba(0,0,0,.14)}

.pos-tabs{display:flex;flex-wrap:wrap;gap:var(--sp-2xs);margin-block-end:var(--sp-sm)}
.pos-tab{text-decoration:none;color:var(--text-muted);font-weight:600;font-size:var(--step--1);
  padding:.3rem .7rem;border-radius:var(--radius-pill);border:1px solid var(--border);background:var(--surface)}
.pos-tab:hover{border-color:var(--brand);color:var(--brand)}
.pos-tab--active{background:var(--brand);color:var(--text-on-brand);border-color:transparent}
.pos-tab__count{opacity:.75;font-variant-numeric:tabular-nums}
.facet-total{color:var(--text-muted);font-size:var(--step--1)}

.word-list{list-style:none;display:flex;flex-direction:column;gap:var(--sp-xs);padding:0;margin-block:var(--sp-md)}
.word-panel{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--sp-sm);
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);padding:.5rem .9rem}
.word-panel:hover{border-color:var(--brand)}
.word-panel__lemma{font-family:var(--font-lexical);font-size:var(--step-1);font-weight:600}
.word-panel__meta{display:inline-flex;gap:.6ch;align-items:baseline;color:var(--text-muted);font-size:var(--step--1)}
.word-panel__pos{font-style:italic}
.word-panel__badges{display:inline-flex;flex-wrap:wrap;gap:var(--sp-2xs);margin-inline-start:auto;align-items:center}
.word-list__empty{color:var(--text-muted);font-style:italic}

.review-state-badge,.provenance-badge,.marker-chip{display:inline-flex;align-items:center;gap:.3em;
  font-size:var(--step--1);font-weight:600;padding:.12rem .5rem;border-radius:var(--radius-pill);
  border:1px solid var(--border);background:var(--surface-2);color:var(--text-muted)}
.review-state-badge--draft{color:var(--text-muted)}
.review-state-badge--needs_source,.review-state-badge--needs_linguistic_review,
.review-state-badge--needs_community_review{background:var(--accent-surface);color:var(--accent);border-color:transparent}
.review-state-badge--published{background:var(--brand-surface);color:var(--brand-strong);border-color:transparent}
.provenance-badge--ai{background:var(--c-berry-700);color:#fff;border-color:transparent}
.provenance-badge--imported{background:var(--c-sky-700);color:#fff;border-color:transparent}
.marker-chip{background:var(--accent-surface);color:var(--accent);border-color:transparent;font-family:ui-monospace,Menlo,monospace}

/* Consensus dots — 4-eyes acceptance progress (filled = accepted). Conveyed by shape (solid vs. ring) AND
   the adjacent n/m count, never colour alone (WCAG 1.4.1). The required count is the EFFECTIVE one (AI ⇒ ≥2). */
.consensus{display:inline-flex;align-items:center;gap:.45ch;vertical-align:middle}
.consensus__dot{inline-size:.6rem;block-size:.6rem;border-radius:var(--radius-pill);
  border:1.5px solid var(--brand);background:transparent}
.consensus__dot--filled{background:var(--brand)}
.consensus__count{font-size:var(--step--2);font-weight:700;color:var(--text-muted);font-variant-numeric:tabular-nums}

/* Coverage mini-bar — one segment per didactic block, shaded by its fill ratio (--fill, set inline 0–100 %);
   a fully empty block (0 %) is danger, not a faint brand tint, so a real gap reads as a gap. */
.coverage-bar{display:flex;gap:2px;inline-size:100%;max-inline-size:12rem}
.coverage-bar__seg{flex:1;block-size:.5rem;border-radius:2px;
  background:color-mix(in oklch,var(--brand) var(--fill,0%),var(--surface-2))}
.coverage-bar__seg--empty{background:var(--danger-surface);
  box-shadow:inset 0 0 0 1px color-mix(in oklab,var(--danger) 35%,transparent)}

.pager{display:flex;gap:var(--sp-md);align-items:center;margin-block:var(--sp-lg)}
.pager__info{color:var(--text-muted);font-size:var(--step--1)}

/* Redaktion — word editor */
.words-header{display:flex;justify-content:space-between;align-items:center;gap:var(--sp-md);flex-wrap:wrap}
.word-panel__link{text-decoration:none;color:inherit}
.word-panel__link:hover .word-panel__lemma{text-decoration:underline;text-decoration-thickness:.06em}

.word-editor{display:flex;flex-direction:column;gap:var(--sp-lg);margin-block-start:var(--sp-lg)}
.tc-card{display:grid;gap:var(--sp-sm) var(--sp-xl);grid-template-columns:1fr;
  background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-lg);padding:var(--sp-lg)}
@media (min-width:52rem){.tc-card{grid-template-columns:minmax(11rem,1fr) 2.2fr}}
.tc-card__title{font-size:var(--step-1);margin:0}
.tc-card__desc{color:var(--text-muted);font-size:var(--step--1);margin-block-start:.3rem}
.tc-card__body{display:flex;flex-direction:column;gap:var(--sp-md);min-inline-size:0}

.field{display:flex;flex-direction:column;gap:.3rem}
.field > label{font-weight:600;font-size:var(--step--1);color:var(--text-muted)}
.word-editor input[type="text"],.word-editor select,.word-editor textarea{
  font:inherit;padding:.5rem .7rem;border:1px solid var(--border);border-radius:var(--radius-sm);
  background:var(--surface);color:var(--text);max-inline-size:38rem}
.field-row{display:flex;flex-wrap:wrap;gap:var(--sp-md)}
.field-row .field{flex:1;min-inline-size:8rem}
.field-readonly{color:var(--text-muted)}

/* ADR 0041 ph5c: textbook vocabulary-list import preview. Status is never colour alone — a text label carries
   the meaning (WCAG 1.4.1); the colour/left-border is a redundant cue. Plain, like the rest of the classroom. */
.words-header__actions{display:flex;gap:var(--sp-sm);flex-wrap:wrap}
.form-error{background:var(--danger-surface,#fde8e8);color:var(--danger-strong);border:1px solid var(--danger,#e57373);
  border-radius:var(--radius-sm);padding:.6rem .8rem;margin-block:var(--sp-md)}
/* A non-blocking warning (e.g. „you already have this book") — set apart by an accent border, not an error. */
.form-warning{background:var(--accent-surface,#fef6e0);border:1px solid var(--accent,#b8860b);border-radius:var(--radius-sm);
  padding:.6rem .8rem;margin-block:var(--sp-md)}
.form-warning__actions{display:flex;align-items:center;gap:.8ch;flex-wrap:wrap;margin-block-start:.4rem}
/* Publisher + ISBN line on a textbook's detail page (the citable Source). */
.textbook-meta{display:flex;flex-wrap:wrap;gap:.4rem 1.2ch;margin-block-start:-.4rem}
.textbook-import__form{display:flex;flex-direction:column;gap:var(--sp-lg);max-inline-size:48rem}
.textbook-import__textarea{font-family:var(--font-mono);font-size:var(--step--1);
  inline-size:100%;padding:.6rem .7rem;border:1px solid var(--border);border-radius:var(--radius-sm);
  background:var(--surface);color:var(--text)}
.textbook-import__format-hint{margin-block-start:var(--sp-lg)}
/* ADR 0042 ph6: the photo-upload section (only shown when OCR is available) + the recognizing/processing page.
   Plain, set off from the paste form by a top border. */
.textbook-import__photo{margin-block-start:var(--sp-xl);padding-block-start:var(--sp-lg);border-block-start:1px solid var(--border)}
.textbook-import__recognizing{text-align:center;padding-block:var(--sp-xl)}
.textbook-import__wait{color:var(--text-muted)}
.textbook-import__meta{margin-block:var(--sp-md)}
.textbook-import__license{font-size:var(--step--1)}
.textbook-import__summary{display:flex;flex-wrap:wrap;gap:var(--sp-sm);list-style:none;padding:0;margin-block:var(--sp-lg)}
.import-pill{font-size:var(--step--1);padding:.2rem .7rem;border-radius:var(--radius-pill);border:1px solid var(--border);background:var(--surface-2)}
.import-pill--matched{background:var(--brand-surface);color:var(--brand-strong);border-color:transparent}
.import-pill--gap{color:var(--text-muted)}
.import-lesson{margin-block:var(--sp-lg)}
.import-lesson__title{font-size:var(--step-1)}
.import-rows{list-style:none;padding:0;display:flex;flex-direction:column;gap:.3rem}
.import-row{display:flex;align-items:baseline;gap:.8ch;flex-wrap:wrap;padding:.45rem .6rem;
  border:1px solid var(--border);border-inline-start-width:3px;border-radius:var(--radius-sm);background:var(--surface)}
.import-row--matched{border-inline-start-color:var(--brand,#2e7d32)}
.import-row--ambiguous,.import-row--candidates{border-inline-start-color:var(--accent,#b8860b)}
.import-row--gap{border-inline-start-color:var(--text-muted);background:var(--surface-2)}
.import-row__lemma{font-family:var(--font-lexical);font-weight:600}
.import-row__status{font-size:var(--step--2);font-weight:600;padding:.05rem .5rem;border-radius:var(--radius-pill);
  border:1px solid var(--border);color:var(--text-muted)}
.import-row__gap{color:var(--text-muted);font-style:italic;font-size:var(--step--1)}
.import-row__choices{border:0;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:.4rem 1.2ch;inline-size:100%}
.import-choice{display:inline-flex;align-items:center;gap:.4ch;font-size:var(--step--1)}
.textbook-import__actions{display:flex;gap:var(--sp-md);flex-wrap:wrap;margin-block-start:var(--sp-xl)}
/* ADR 0041 ph5d: curation controls on the textbook page — the current state + the transition the viewer may
   make. Plain, like the rest of the classroom area. */
.curation{display:flex;align-items:center;gap:var(--sp-md);flex-wrap:wrap;margin-block:var(--sp-md);
  padding:var(--sp-sm) var(--sp-md);background:var(--surface-2);border-radius:var(--radius-sm)}
.curation__state{margin:0;color:var(--text-muted);font-size:var(--step--1)}
.curation__actions{display:flex;gap:var(--sp-sm);flex-wrap:wrap}

.nested-rows{display:flex;flex-direction:column;gap:var(--sp-xs)}
.nested-row{display:flex;gap:var(--sp-xs);align-items:center;flex-wrap:wrap}
.nested-row__field{flex:1;min-inline-size:0}
.nested-row__remove{border:1px solid var(--border);background:var(--surface);border-radius:var(--radius-sm);
  inline-size:2rem;block-size:2rem;cursor:pointer;color:var(--text-muted);font-size:1.1rem;line-height:1}
.nested-row__remove:hover{border-color:var(--accent);color:var(--accent)}
/* U-6: die sichtbare _destroy-Checkbox (No-JS-Entfernen). Ruhig, klein; wird per JS ausgeblendet (das × führt dann). */
.nested-row__destroy{display:inline-flex;align-items:center;gap:.35ch;font-size:var(--step--1);color:var(--text-muted);white-space:nowrap}
/* Read-only Silbenbögen preview drops to its own line under the form's surface field, one row per program. */
.nested-row__arcs{flex-basis:100%;margin-block-start:.2rem;display:flex;align-items:baseline;gap:.6ch}
.nested-row__arcs-program{font-size:var(--step--2);color:var(--text-muted);letter-spacing:.04em}

.generated-preview{border:1px solid var(--border);border-radius:var(--radius-md);padding:var(--sp-sm) var(--sp-md);background:var(--surface-2)}
.generated-preview h3{margin:0 0 .2rem}
.generated-preview__root{color:var(--text-muted);margin-block:.3rem}
.generated-preview__list{list-style:none;margin:.4rem 0 0;padding:0;display:flex;flex-wrap:wrap;gap:var(--sp-xs)}
.generated-preview__item{display:inline-flex;align-items:baseline;gap:.5ch;border:1px solid var(--border);border-radius:var(--radius-sm);padding:.15rem .5rem;background:var(--surface)}
.generated-preview__pattern{font-size:var(--step--2);color:var(--text-muted)}

.markers-field{border:1px solid var(--border);border-radius:var(--radius-md);padding:var(--sp-sm) var(--sp-md);
  display:flex;flex-wrap:wrap;gap:var(--sp-md)}
.markers-field legend{font-weight:600;font-size:var(--step--1);color:var(--text-muted);padding-inline:.3rem}
.marker-check{display:inline-flex;align-items:center;gap:.4ch;font-family:ui-monospace,Menlo,monospace;font-size:var(--step--1)}
.word-editor__actions{display:flex;gap:var(--sp-md);flex-wrap:wrap;margin-block-start:var(--sp-sm)}

/* Redaktion — word detail (show) */
.word-show__head{display:flex;flex-direction:column;gap:var(--sp-sm);margin-block-end:var(--sp-lg)}
.word-show h1{font-family:var(--font-lexical);font-size:var(--lemma);font-weight:600;line-height:1.05;margin:0}
.word-show__badges{display:flex;flex-wrap:wrap;gap:var(--sp-2xs);align-items:center}
.word-show__actions{display:flex;gap:var(--sp-md);flex-wrap:wrap;align-items:center;margin-block-start:var(--sp-xl)}
.chip-list{list-style:none;display:flex;flex-wrap:wrap;gap:var(--sp-xs);padding:0}
.chip-list li{font-family:var(--font-lexical);background:var(--surface-2);border:1px solid var(--border);
  border-radius:var(--radius-md);padding:.4rem .8rem}
.meaning-list{list-style:none;padding:0;display:flex;flex-direction:column;gap:var(--sp-2xs);max-inline-size:var(--measure)}
.meaning-list li{background:var(--surface);border-inline-start:.28rem solid var(--brand);border-radius:var(--radius-sm);padding:.5rem .8rem}

/* Classroom — teacher "Meine Klassen" + the no-login pupil-view banner */
.classroom-banner{display:flex;flex-wrap:wrap;gap:var(--sp-md);align-items:center;justify-content:space-between;
  background:var(--brand);color:var(--text-on-brand);border-radius:var(--radius-md);
  padding:var(--sp-sm) var(--sp-md);margin-block-end:var(--sp-md)}
.classroom-banner__label{font-weight:700}
.classroom-banner__actions{display:flex;gap:var(--sp-sm);align-items:center}
.classroom-banner__leave{background:var(--surface);color:var(--text);border-color:transparent}
.classroom-banner__dismiss{background:transparent;border:0;color:var(--text-on-brand);font-size:1.4rem;
  line-height:1;cursor:pointer;padding:.1rem .4rem;border-radius:var(--radius-sm)}
.classroom-banner__dismiss:hover{background:rgba(255,255,255,.18)}
.group-list{list-style:none;padding:0;display:grid;gap:var(--sp-md);
  grid-template-columns:repeat(auto-fill,minmax(min(100%,18rem),1fr))}
.group-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);padding:var(--sp-md);
  display:flex;flex-direction:column;gap:var(--sp-sm)}
.group-card__name{margin:0;font-size:var(--step-1)}
.group-card__actions{display:flex;gap:var(--sp-sm);flex-wrap:wrap;margin-block-start:auto}
.group-code,.share-link code{font-weight:700;letter-spacing:.05em;
  background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-sm);padding:.1rem .45rem}
.share-card{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius-md);
  padding:var(--sp-md);margin-block:var(--sp-md);max-inline-size:var(--measure)}
.share-link{font-size:var(--step-1);overflow-wrap:anywhere}

/* Friendly error pages */
.error-page{text-align:center;max-inline-size:var(--measure);margin-inline:auto;padding-block:var(--sp-2xl)}
.error-page__code{font-size:var(--step-5,4rem);font-weight:800;color:var(--brand);margin:0;line-height:1}
.error-page h1{margin-block:var(--sp-sm) var(--sp-md)}
.error-page__body{color:var(--text-muted)}
.error-page__actions{display:flex;flex-wrap:wrap;gap:var(--sp-sm);justify-content:center;margin-block-start:var(--sp-lg)}
/* the 404 search box: reuses .home-search styling, just centred + width-capped on the error page */
.error-page__search{margin-inline:auto;margin-block-start:var(--sp-lg);max-inline-size:28rem}

/* forced-colors safety */
@media (forced-colors:active){
  .pos,.word-card,article section[aria-labelledby="forms-heading"] li,
  .language-card,.badge,.btn,.feature-card,.theme-toggle,.search-result,.concept-sibling,
  .workqueue-card,.flash,.word-panel,.pos-tab,.review-state-badge,.provenance-badge,.marker-chip,
  .tc-card,.markers-field,.nested-row__remove,.chip-list li{border:1px solid CanvasText}
  .hero__title{-webkit-text-fill-color:CanvasText;color:CanvasText}
}

/* editorial 4-eyes review queue */
/* Prüfen — two-pane 4-eyes review: selectable queue (left) + the selected entry's review panel (right). */
.review-split__intro{max-inline-size:var(--measure)}
.review-split__panes{display:grid;grid-template-columns:minmax(0,22rem) minmax(0,1fr);gap:var(--sp-lg);align-items:start;margin-block-start:var(--sp-md)}
@media (max-width:56rem){.review-split__panes{grid-template-columns:1fr}}

.review-list{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-sm);overflow:hidden}
.review-list__head{padding:.6rem var(--sp-md);border-block-end:1px solid var(--border);font-weight:700;font-size:var(--step--1);color:var(--text-muted)}
.review-list__items{list-style:none;margin:0;padding:.3rem;display:grid;gap:.15rem;max-block-size:36rem;overflow:auto}
.review-queue__item{border-radius:var(--radius-sm)}
.review-queue__item--active{background:var(--brand-surface)}
.review-queue__pick{display:grid;gap:.25rem;padding:.5rem .6rem;text-decoration:none;color:var(--text);border-radius:var(--radius-sm)}
.review-queue__pick:hover{background:var(--surface-2)}
.review-queue__item--active .review-queue__pick:hover{background:transparent}
.review-queue__row{display:flex;align-items:center;gap:.5ch;flex-wrap:wrap}
.review-queue__row--meta{gap:.5rem}
.review-queue__lemma{font-family:var(--font-display);font-weight:800}
.review-queue__lang{color:var(--text-muted);font-size:var(--step--2)}
.review-queue__spacer{flex:1}

.review-panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-md);box-shadow:var(--shadow-sm);
  padding:var(--sp-lg);position:sticky;inset-block-start:calc(var(--header-offset) + var(--sp-md));display:grid;gap:var(--sp-md)}
.review-panel__head{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem}
.review-panel__lemma{font-size:var(--step-2);margin:0}
.review-panel__lemma a{text-decoration:none;color:var(--text)}
.review-panel__lang{color:var(--text-muted)}
.review-panel__progress{display:flex;align-items:center;gap:.8rem;margin:0;flex-wrap:wrap}
.review-panel__decide{display:grid;gap:var(--sp-xs)}
.review-panel__notes{inline-size:100%;padding:.5rem .7rem;border:1px solid var(--border);border-radius:var(--radius-md);background:var(--surface);color:var(--text);font:inherit}
.review-panel__actions{display:flex;gap:var(--sp-xs)}
.review-panel__open{margin:0;font-size:var(--step--1)}
.review-panel__empty{color:var(--text-muted);font-style:italic}

