/* E-Paper-Namensschild (/namensschild, AFU-394). Nur eigene Klassen mit ns-. */

.ns-raster {
  display: grid; gap: 1.1rem; align-items: start; margin-bottom: 2.5rem;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
}
@media (min-width: 1800px) { .ns-raster { grid-template-columns: minmax(0, 440px) minmax(0, 1fr); } }
@media (max-width: 900px) { .ns-raster { grid-template-columns: minmax(0, 1fr); } }

.ns-vorschau {
  position: sticky; top: 4rem; min-width: 0;
  padding: 1rem; border: 1px solid var(--border); border-radius: var(--radius); background: var(--card-bg);
}
@media (max-width: 900px) { .ns-vorschau { position: static; } }
.ns-h-klein { margin: 0 0 0.6rem; font-size: 1rem; color: var(--muted); font-weight: 600; }

/* Das Badge: Rahmen wie das Gehäuse, Bild in Pixeln scharf. */
.ns-badge {
  padding: 10px; border-radius: 14px; background: #2b2e36; box-shadow: inset 0 0 0 2px #3c414d;
  max-width: 320px; margin: 0 auto 0.8rem;
}
@media (min-width: 1800px) { .ns-badge { max-width: 420px; } }
@media (max-width: 900px) { .ns-badge { max-width: 260px; } }
.ns-badge.ziel { box-shadow: inset 0 0 0 3px var(--accent); }
.ns-badge canvas {
  display: block; width: 100%; height: auto; aspect-ratio: 2 / 3; border-radius: 3px;
  image-rendering: pixelated; touch-action: none; background: #e4e2d8;
}

.ns-zeile { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.ns-seg { display: inline-flex; gap: 0.3rem; }
.ns-seg .btn-sm { padding: 0.3rem 0.7rem; font-size: 0.85rem; }
.ns-klein { color: var(--muted); font-size: 0.86rem; }
.ns-knoepfe { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.8rem; }

.ns-arbeit { min-width: 0; }
.ns-karte {
  padding: 1.2rem 1.3rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card-bg); min-width: 0; margin-bottom: 1rem;
}
.ns-karte h2 { margin: 0 0 0.8rem; font-size: 1.25rem; }
.ns-karte p { margin: 0.7rem 0 0; }

/* Vorlagen als Kacheln mit kleinem Bild. */
.ns-vorlagen { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.ns-vorlage {
  display: flex; flex-direction: column; align-items: center; gap: 0.35rem; cursor: pointer;
  padding: 0.5rem 0.6rem 0.45rem; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg2); color: var(--fg); font: inherit; font-size: 0.9rem;
}
.ns-vorlage:hover { border-color: var(--accent); }
.ns-vorlage[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); font-weight: 600; }
.ns-vorlage img, .ns-vorlage-bild { width: 80px; height: 120px; border-radius: 4px; display: block; }
.ns-vorlage-bild { display: grid; place-items: center; font-size: 2rem; background: var(--card-bg); border: 1px dashed var(--border); }

.ns-felder {
  display: grid; gap: 0.8rem 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr));
}
.ns-feld { display: flex; flex-direction: column; gap: 0.3rem; font-size: 0.92rem; min-width: 0; }
.ns-feld[hidden] { display: none; }
.ns-feld.ns-breit { grid-column: 1 / -1; }
.ns-feld input:not([type="checkbox"]):not([type="range"]), .ns-feld select, .ns-knoepfe select {
  width: 100%; min-width: 0; background: var(--bg2); color: var(--fg);
  border: 1px solid var(--border); border-radius: 9px; padding: 0.5rem 0.7rem; font: inherit; font-size: 0.95rem;
}
.ns-feld input:focus, .ns-feld select:focus, .ns-knoepfe select:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.ns-feld input[type="range"] { width: 100%; accent-color: var(--accent); }
.ns-gross { text-transform: uppercase; }
.ns-haken { display: inline-flex; gap: 0.4rem; align-items: center; font-size: 0.9rem; }
.ns-stand { font-size: 0.84rem; color: var(--muted); min-height: 1.2em; display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.ns-stand.ok { color: var(--ok, #27af57); }
.ns-stand.warn { color: var(--warn, #d9a441); }
.ns-stand .btn-sm { padding: 0.15rem 0.6rem; font-size: 0.82rem; min-height: 0; height: auto; }

.ns-datei { position: relative; overflow: hidden; }
.ns-datei input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* Ablauf beim Beschreiben. */
.ns-stufen { list-style: none; margin: 0 0 0.8rem; padding: 0; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
.ns-stufen li { color: var(--muted); font-size: 0.92rem; }
.ns-stufen li::before { content: "○"; margin-right: 0.4rem; }
.ns-stufen li.aktiv { color: var(--fg); font-weight: 600; }
.ns-stufen li.aktiv::before { content: "◉"; color: var(--accent); }
.ns-stufen li.fertig { color: var(--fg); }
.ns-stufen li.fertig::before { content: "✓"; color: var(--ok, #27af57); }
.ns-fortschritt { height: 8px; border-radius: 4px; background: var(--bg2); overflow: hidden; border: 1px solid var(--border); }
.ns-fortschritt div { height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent2)); transition: width 0.2s; }
.ns-stand-text { margin: 0.6rem 0 0; }

.ns-anleitung { margin: 0; padding-left: 1.4rem; }
.ns-anleitung li { margin: 0.5rem 0; }

.ns-dl { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.2rem 1rem; margin: 0; font-size: 0.94rem; }
.ns-dl dt { color: var(--muted); }
.ns-dl dd { margin: 0; overflow-wrap: anywhere; }
.ns-dl select { max-width: 100%; }
.ns-log {
  margin: 0; max-height: 18rem; overflow: auto; padding: 0.6rem 0.8rem; font-size: 0.82rem;
  background: var(--bg2); border: 1px solid var(--border); border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere;
}
.ns-log:empty::before { content: "Noch nichts."; color: var(--muted); }
.ns-knoepfe select { width: auto; max-width: 100%; flex: 1 1 10rem; padding: 0.4rem 0.6rem; font-size: 0.88rem; }

/* Reiter Firmware (AFU-395) */
.ns-fw-raster { display: grid; gap: 1.1rem; align-items: start; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
@media (max-width: 1000px) { .ns-fw-raster { grid-template-columns: minmax(0, 1fr); } }
.ns-fw-dl { margin: 0.9rem 0; }
.ns-fw-wahl { border: 1px solid var(--border); border-radius: 6px; margin: 0 0 1rem; padding: 0.6rem 0.9rem 0.8rem; }
.ns-fw-wahl legend { padding: 0 0.3rem; font-weight: 600; }
.ns-fw-wahl:disabled { opacity: 0.6; }
.ns-wahl { display: flex; gap: 0.5rem; align-items: baseline; margin: 0.35rem 0; cursor: pointer; }
.ns-fw-wahl .ns-klein { margin: 0.2rem 0 0.5rem 1.6rem; }
.ns-stufen li.weg { display: none; }
.ns-fw-raster .ns-anleitung { padding-left: 1.2rem; }
