/* Neu + - Gestaltung zu public/neuplus.js.
 *
 * Arbeitet ausschliesslich mit den Werten aus styles.css: Farben ueber
 * var(--...), Schriftgroessen ueber --fs-xs..--fs-xl, Abstaende in 4/8/12/16/24.
 * Keine neuen Farben, keine neuen Groessen, kein zweiter Buntton.
 *
 * Die vier Hebel aus AUSTAUSCH/design-referenz-claude-app.md:
 *   - Trennungen sind Haarlinien in var(--border), nie eigene Graufelder.
 *   - Radien 8px aussen, 6px innen. Keine grossen Bubbles.
 *   - Kein Schlagschatten in diesem Dialog. Tiefe kommt aus der Abstufung
 *     surface-1 (Dialog) / surface-2 (Eingaben) / surface-sunken (Hinweise).
 *   - Gewichte hoechstens 600, Text zweistufig (primary fuer das Wesentliche,
 *     secondary/muted fuer alles Erklaerende).
 *
 * Geladen in index.html nach styles.css.
 */

/* Schmaler als der Rapporteditor (780px): Hier steht eine Entscheidung, kein
   Formular. Kurze Zeilen lesen sich schneller, und der Dialog wirkt wie ein
   Zwischenschritt statt wie eine zweite Anwendung. */
.np-sheet { max-width: 620px; }

.np-kopftitel { flex: 1; font-weight: 600; }

.np-body { display: flex; flex-direction: column; gap: 16px; }

/* Schiebt im Fuss die rechte Gruppe nach rechts und traegt in Zeilen den
   Zwischenraum - ein Element statt eines Randes an fuenf Stellen. */
.np-schub { flex: 1; }

.np-versteckt { display: none; }

/* ============================================================ Die Wahl */

.np-wahl, .np-vorlagen { display: flex; flex-direction: column; gap: 16px; }

/* Eine Liste, kein Kachelraster: Die Wege stehen untereinander und werden von
   oben nach unten gelesen. Die Haarlinie zwischen ihnen ist die einzige
   Trennung - Kaesten um jeden Weg waeren drei Rahmen fuer eine Entscheidung. */
.np-wege {
  display: flex; flex-direction: column;
  border: 1px solid var(--border); border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
}

.np-weg {
  display: flex; align-items: center; gap: 16px;
  padding: 16px; width: 100%;
  border: 0; border-top: 1px solid var(--border);
  background: none; color: inherit;
  font: inherit; text-align: left;
  cursor: pointer;
}
.np-weg:first-child { border-top: 0; }
.np-weg:hover { background: var(--surface-1); }
.np-weg:focus-visible { outline: 2px solid var(--accent-fg); outline-offset: -2px; }

.np-weg-text { display: flex; flex-direction: column; gap: 4px; min-width: 0; flex: 1; }
.np-weg-name { font-size: var(--fs-lg); font-weight: 600; color: var(--text-primary); }
.np-weg-satz { font-size: var(--fs-md); color: var(--text-muted); line-height: 1.5; }

/* Der Pfeil ist zwei Striche, kein Bild: Ein Winkel aus zwei Raendern braucht
   keine Datei, keine Schriftart und kein Symbol aus icons.js - und er kippt im
   Dunkelmodus mit der Textfarbe mit. */
.np-pfeil {
  flex: none; width: 8px; height: 8px;
  border-right: 1.5px solid var(--text-muted);
  border-top: 1.5px solid var(--text-muted);
  transform: rotate(45deg);
}

/* ============================================================ Das Blatt */

.np-blatt { display: flex; flex-direction: column; gap: 8px; }

.np-textfeld {
  width: 100%; min-height: 220px; resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface-2); color: var(--text-primary);
  font: inherit; font-size: var(--fs-lg); line-height: 1.6;
}
.np-textfeld:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent-fg); }
.np-textfeld[readonly] { color: var(--text-secondary); }

.np-blattfuss {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-sm); color: var(--text-muted);
}
.np-zaehler { font-variant-numeric: tabular-nums; }
.np-zaehler.np-voll { color: var(--warning-ink); }

/* ---- Der Hinweis, was beim Zuordnen geschieht ----
   Abgesenkte Flaeche statt farbigem Kasten: Der Hinweis ist keine Warnung, die
   erschrecken soll, sondern die Auskunft, die vor der Entscheidung dasteht.
   Ein roter oder gelber Kasten wuerde als Fehler gelesen und darum weggeklickt. */
.np-hinweis {
  background: var(--surface-sunken);
  border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px;
  display: flex; flex-direction: column; gap: 6px;
}
.np-hinweis-titel { font-size: var(--fs-md); font-weight: 600; color: var(--text-primary); }
.np-hinweis-satz { margin: 0; font-size: var(--fs-md); line-height: 1.55; color: var(--text-secondary); }
/* Die harte Regel steht eine Stufe kraeftiger als der Rest - sie ist der Satz,
   der bleiben soll, wenn nur einer haengenbleibt. */
.np-regel { color: var(--text-primary); font-weight: 500; }
.np-gesperrt { color: var(--warning-ink); }

.np-fehler {
  border: 1px solid var(--border-strong); border-radius: 8px;
  padding: 10px 12px;
  background: var(--surface-2); color: var(--critical-ink);
  font-size: var(--fs-md); line-height: 1.5;
}

/* ========================================================= Die Pruefung */

.np-pruefung { display: flex; flex-direction: column; gap: 16px; }

.np-banner {
  border: 1px solid var(--border); border-left: 2px solid var(--accent-fg);
  border-radius: 8px; padding: 12px 14px;
  background: var(--surface-2);
  display: flex; flex-direction: column; gap: 4px;
}
.np-banner-titel { font-size: var(--fs-md); font-weight: 600; color: var(--text-primary); }
.np-banner-satz { margin: 0; font-size: var(--fs-md); line-height: 1.55; color: var(--text-secondary); }

/* Die Selbsteinschaetzung: ein Punkt und ein Satz. Kein Balken, keine Prozente -
   eine Zahl wuerde eine Genauigkeit behaupten, die es nicht gibt. */
.np-sicherheit { display: flex; align-items: baseline; gap: 8px; font-size: var(--fs-md); color: var(--text-secondary); }
.np-punkt { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--text-muted); }
.np-s-hoch .np-punkt { background: var(--good-ink); }
.np-s-mittel .np-punkt { background: var(--warning-ink); }
.np-s-niedrig .np-punkt { background: var(--serious-ink); }
.np-sicherheit-satz { line-height: 1.5; }

.np-zaehlzeile { font-size: var(--fs-sm); color: var(--text-muted); font-variant-numeric: tabular-nums; }

/* ---- Die Felder, jedes einzeln ---- */

.np-felder { display: flex; flex-direction: column; }

.np-feld {
  display: flex; flex-direction: column; gap: 6px;
  padding: 12px 0;
  border-top: 1px solid var(--border);
}
.np-feld:first-child { border-top: 0; padding-top: 0; }

.np-feld-kopf { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.np-haken { flex: none; width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
.np-feld-name { font-size: var(--fs-md); font-weight: 600; color: var(--text-secondary); }

.np-feld-wert {
  width: 100%; padding: 8px 10px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-2); color: var(--text-primary);
  font: inherit; font-size: var(--fs-md); line-height: 1.55;
  resize: vertical;
}
.np-feld-wert:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-soft); border-color: var(--accent-fg); }
.np-feld-wert:disabled { background: var(--surface-1); color: var(--text-muted); }

/* Abgewaehlt: sichtbar zurueckgenommen, aber nicht versteckt. Wer eine Zeile
   nicht mitnimmt, soll trotzdem sehen, was er stehen laesst - verschwaende sie,
   waere das genau das stille Verschwinden, das dieser Schritt verhindert. */
.np-aus .np-feld-name { color: var(--text-muted); font-weight: 500; text-decoration: line-through; }
.np-aus .np-feld-wert { opacity: .6; }

.np-fehlend, .np-leerfall {
  margin: 0; font-size: var(--fs-md); line-height: 1.55; color: var(--text-muted);
}

/* ---- Der Rest ---- */

.np-rest {
  border: 1px solid var(--border); border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface-2);
  display: flex; flex-direction: column; gap: 8px;
}
.np-rest-titel { font-size: var(--fs-md); font-weight: 600; color: var(--text-secondary); }
.np-rest-satz { margin: 0; font-size: var(--fs-md); color: var(--text-muted); }
.np-rest-warnung { margin: 0; font-size: var(--fs-sm); color: var(--serious-ink); }

/* ---- Das Blatt im Wortlaut ---- */

.np-wortlaut {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.np-wortlaut > summary {
  cursor: pointer; font-size: var(--fs-md); color: var(--text-secondary);
  list-style-position: outside;
}
.np-wortlaut > summary:focus-visible { outline: 2px solid var(--accent-fg); outline-offset: 2px; border-radius: 6px; }
.np-wortlaut-text {
  margin: 8px 0 0; padding: 12px;
  border: 1px solid var(--border); border-radius: 6px;
  background: var(--surface-sunken); color: var(--text-secondary);
  font: inherit; font-size: var(--fs-md); line-height: 1.6;
  white-space: pre-wrap; word-break: break-word;
  max-height: 240px; overflow: auto;
}

.np-laedt { margin: 0; font-size: var(--fs-md); color: var(--text-muted); }

/* ============================================================ Am Handy */

/* Unter 560px wird der Dialog zur Vollflaeche - genau die Groesse, auf der
   nachts wirklich getippt wird. Die Fusszeile bricht um, damit die drei Knoepfe
   nicht auf Daumenbreite zusammengedrueckt werden. */
@media (max-width: 560px) {
  .np-body { gap: 12px; }
  .np-textfeld { min-height: 180px; font-size: var(--fs-md); }
  .np-weg { padding: 14px 12px; gap: 12px; }
  /* Jeder Knopf auf eine eigene Zeile. Die Knoepfe tragen white-space: nowrap,
     schrumpfen also nicht - nebeneinander schoebe «Ohne Zuordnen ins Formular»
     die Fusszeile auf dem Handy ueber den Rand hinaus. */
  .np-foot { flex-wrap: wrap; }
  .np-foot .btn { flex: 1 1 100%; white-space: normal; }
  /* Nur der Abstandhalter IM FUSS wird zum Zeilenumbruch. Derselbe Baustein
     traegt in der Blattzeile den Zwischenraum zwischen Merker und Zaehler -
     ohne diese Eingrenzung risse er dort die Zeile auseinander. */
  .np-foot .np-schub { flex-basis: 100%; height: 0; }
}
