/* Einkommenssicherung im Adminbereich - gleicher Baukasten wie tarifoptimierung.css,
   eigener Namensraum .eink-* und Petrol/Gold-Palette passend zur Kundenseite. */
#einkBox {
  /* app.js zeigt die Sektion mit display:flex (wie topt/ropt) - ohne
     flex-direction stuenden Hero und Inhalt nebeneinander. */
  flex-direction: column;
  --eink-petrol: #087985;
  --eink-petrol-dunkel: #055d67;
  --eink-gold: #e5b74b;
  --eink-gruen: #08763f;
  --eink-rot: #a12c26;
  --eink-linie: #d7dfdb;
  --eink-text-2: #5c6874;
  --eink-shadow: 0 12px 34px rgba(8, 53, 59, .09);
  min-width: 0;
  color: #172330;
}
#einkBox * { box-sizing: border-box; }

.eink-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.eink-rechner-cta {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  min-height: 58px;
  padding: 12px 18px;
  border: 1px solid rgba(255,255,255,.42);
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(135deg, rgba(255,255,255,.18), rgba(255,255,255,.09));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.16), 0 12px 30px rgba(0,34,40,.2);
  backdrop-filter: blur(12px);
  cursor: pointer;
  text-align: center;
  font: inherit;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.eink-rechner-cta strong { display: block; font-size: 14.5px; line-height: 1.25; white-space: nowrap; }
.eink-rechner-cta:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.7);
  background: linear-gradient(135deg, rgba(255,255,255,.26), rgba(255,255,255,.14));
}
.eink-rechner-cta:active { transform: translateY(0) scale(.98); }
.eink-rechner-cta:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.eink-rechner-dialog {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  place-items: center;
  width: 100vw;
  height: 100dvh;
  max-width: none;
  max-height: none;
  margin: 0;
  padding: 12px;
  border: 0;
  border-radius: 0;
  color: #eefbff;
  background: rgba(2,13,18,.68) !important;
  backdrop-filter: blur(8px);
  box-shadow: none;
  overflow: hidden;
}
.eink-rechner-dialog[open] { display: grid; }
.eink-rechner-shell {
  display: flex;
  width: min(1320px, calc(100vw - 24px));
  height: min(900px, calc(100dvh - 24px));
  background: transparent !important;
}
.eink-rechner-dialog iframe {
  display: block;
  flex: 1 1 auto;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: transparent !important;
  filter: drop-shadow(0 24px 34px rgba(0,0,0,.42));
}

@media (prefers-reduced-motion: reduce) {
  .eink-rechner-cta { transition: none; }
}

.eink-kopf-knoepfe { display: flex; gap: 8px; flex-wrap: wrap; }
.eink-zurueck { margin-bottom: 14px; }
.eink-treffer { padding: 7px 10px; border-radius: 9px; cursor: pointer; font-size: 13.5px; }
.eink-treffer:hover { background: #e3f2f3; }
.eink-zeile-fertig td { opacity: .62; }
.eink-btn-nur-icon { width: 34px; padding: 6px 0 !important; }
.eink-btn-icon { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.eink-meldung { margin: 0 0 16px; padding: 11px 15px; border-radius: 12px; font-weight: 750; }
.eink-meldung.gut { color: #075b32; background: #d9f2e3; }
.eink-meldung.fehl { color: #7c231d; background: #fbe4e1; }

.eink-karte {
  margin-bottom: 18px; padding: 22px 24px; border: 1px solid var(--eink-linie); border-radius: 20px;
  background: #fff; box-shadow: var(--eink-shadow);
}
/* flex-wrap:wrap fehlte hier (anders als bei .topt-karte h3/.ropt-karte h3) -
   "Kundenfälle" + Aktuelle/Archiv/+Neu mussten sich eine Zeile teilen statt
   der Titel auf einer eigenen Zeile stehen zu duerfen. */
.eink-karte h3 { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin: 0 0 16px; font-size: 18px; }
.eink-listenkarte h3 { margin-bottom: 14px; }

.eink-hinweis { color: var(--eink-text-2); font-size: 13px; }
.eink-fehler { color: var(--eink-rot); font-weight: 750; }

.eink-tabelle {
  width: 100%; margin: 10px 0;
  border: 1px solid var(--eink-linie); border-radius: 13px;
  border-collapse: separate; border-spacing: 0;
  background: #fff; font-size: 14px;
}
.eink-tabelle th {
  padding: 10px 11px; border: 0; border-bottom: 1px solid var(--eink-linie);
  color: #172330; background: #e9f2f2;
  text-align: left; font-size: 12px; font-weight: 800; letter-spacing: .015em; white-space: nowrap;
}
.eink-tabelle th[data-k] { cursor: pointer; user-select: none; }
.eink-tabelle th[data-k]:hover { background: #dfeced; }
.eink-tabelle th .arr { opacity: .35; font-size: 10px; }
.eink-tabelle th.sorted .arr { opacity: 1; color: var(--eink-petrol-dunkel); }
.eink-tabelle td { padding: 9px 10px; border: 0; border-bottom: 1px solid var(--eink-linie); vertical-align: middle; }
.eink-tabelle tr:last-child td { border-bottom: 0; }
.eink-tabelle tr:hover td { background-color: #fafcfb; }
.eink-aktionen { display: flex; gap: 6px; flex-wrap: wrap; }

.eink-pill { display: inline-flex; align-items: center; min-height: 24px; padding: 3px 10px; border-radius: 999px; color: #fff; font-size: 11px; font-weight: 850; vertical-align: middle; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.eink-st-entwurf { background: #6c7680; }
.eink-st-veroeffentlicht { background: var(--eink-petrol-dunkel); }
.eink-st-widerrufen { background: var(--eink-rot); }
.eink-st-archiviert { color: #46515b; background: #dce1df; }
.eink-st-abgeschlossen { background: #1e7a46; }

.eink-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px;
  padding: 8px 15px; border: 1px solid var(--eink-petrol); border-radius: 10px; color: #fff;
  background: var(--eink-petrol-dunkel); font-weight: 800; font-size: 13px; cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}
.eink-btn:hover { filter: brightness(1.06); }
.eink-btn:active { transform: scale(.98); }
.eink-btn:disabled { opacity: .5; cursor: not-allowed; }
.eink-btn.klein { min-height: 34px; padding: 6px 11px; font-size: 12px; }
.eink-btn.grau { color: #172330; border-color: var(--eink-linie); background: #fff; }
.eink-btn.gruen { border-color: var(--eink-gruen); background: var(--eink-gruen); }
.eink-btn.rot { border-color: var(--eink-rot); background: var(--eink-rot); }
.eink-btn.gold { color: #082d32; border-color: #d5a032; background: linear-gradient(135deg, #f4ce70, #dea735); }

.eink-editor-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.eink-editor-top h3 { margin: 0; }
.eink-editor-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; margin-bottom: 16px; }
.eink-feld { min-width: 0; }
.eink-feld.wide { grid-column: span 2; }
.eink-feld label { display: block; margin-bottom: 5px; color: var(--eink-text-2); font-size: 11px; font-weight: 800; }
.eink-feld input, .eink-feld select {
  width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid var(--eink-linie);
  border-radius: 9px; background: #f7fafb; font: inherit;
}
.stu-groesse-stepper { display: flex; align-items: center; gap: 6px; }
.stu-groesse-stepper input {
  flex: 1 1 auto; min-width: 0; min-height: 42px; padding: 8px 6px; border: 1px solid var(--eink-linie);
  border-radius: 9px; background: #f7fafb; font: inherit; text-align: center;
}
.stu-groesse-stepper button {
  flex: 0 0 auto; min-width: 38px; min-height: 38px; padding: 0 10px; font-weight: 800;
}
.eink-editor-zeile { display: grid; grid-template-columns: 220px 1fr; align-items: center; gap: 14px; padding-top: 14px; border-top: 1px solid var(--eink-linie); margin-top: 4px; }
.eink-seg { display: flex; flex-wrap: wrap; gap: 6px; }
.eink-seg-btn { min-height: 38px; padding: 7px 13px; border: 1px solid var(--eink-linie); border-radius: 9px; background: #f7fafb; color: var(--eink-text-2); font-size: 12.5px; font-weight: 800; cursor: pointer; }
.eink-seg-btn.an { color: var(--eink-petrol-dunkel); border-color: var(--eink-petrol); background: #e3f2f3; }
.eink-editor-aktionen { display: flex; align-items: center; gap: 12px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--eink-linie); }

.eink-warn { border-color: #e3c98c; background: #fff8e7; }
.eink-warn ul { margin: 0; padding-left: 18px; color: #6a5726; font-size: 13px; }

.eink-link-box { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 14px; border: 1px solid var(--eink-linie); border-radius: 10px; background: #f7fafb; }
.eink-link-box code { flex: 1 1 260px; overflow: hidden; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; }
.eink-link-url { flex: 1 1 260px; overflow: hidden; font-size: 12.5px; text-overflow: ellipsis; white-space: nowrap; color: var(--eink-petrol-dunkel); text-decoration: underline; }
.eink-link-url:hover { color: var(--eink-gold, #b4860f); }

.eink-cockpit { background: #f4f8f8; }
.eink-guide { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.eink-guide li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; font-size: 13px; color: #33474a; }
.eink-guide b { width: 26px; height: 26px; display: grid; place-items: center; border-radius: 50%; background: var(--eink-petrol-dunkel); color: #fff; font-size: 11px; }

/* Meldung gross in der Bildschirmmitte - im Vollbild-Editor ging der kleine
   Hinweis unten zu leicht unter. */
.eink-toast {
  position: fixed; z-index: 400; left: 50%; top: 50%; min-width: 240px; padding: 22px 40px;
  border-radius: 16px; color: #fff; background: rgba(6, 54, 60, .95); text-align: center;
  font-weight: 900; font-size: 30px; letter-spacing: .01em; box-shadow: 0 18px 48px rgba(6, 32, 36, .35);
  transform: translate(-50%, -50%) scale(.92); opacity: 0; pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.eink-toast.show { transform: translate(-50%, -50%) scale(1); opacity: 1; }

@media (max-width: 900px) {
  .eink-editor-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .eink-feld.wide { grid-column: span 2; }
  .eink-editor-zeile { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .eink-hero { align-items: stretch; flex-direction: column; gap: 13px; }
  .eink-rechner-cta { width: 100%; min-height: 50px; }
  .eink-rechner-cta strong { white-space: normal; }
  .eink-rechner-dialog { width: 100vw; height: 100dvh; max-height: 100dvh; }
  .eink-editor-grid { grid-template-columns: 1fr; }
  .eink-feld.wide { grid-column: auto; }
}

/* ===========================================================================
   Strecken-Studio (Story Engine) - liegt im Einkommenssicherungs-Tab.
   Prinzip "Controlled Flexibility": links die festen 5 Schritte, rechts die
   variablen Felder. Kein freier Seitenbaukasten.
   =========================================================================== */
.eink-unternav {
  display: flex; gap: 8px; flex-wrap: wrap;
  margin: 0 0 18px; padding: 7px;
  border: 1px solid var(--eink-linie); border-radius: 16px; background: #fff;
  box-shadow: 0 7px 22px rgba(8, 31, 58, .06);
}
.eink-unternav .eink-btn {
  min-height: 42px; padding: 9px 18px; border: 0; border-radius: 11px;
  color: #172330; background: transparent; font-size: 14px; font-weight: 750;
}
.eink-unternav .eink-btn:hover { filter: none; background: #eef3f6; }
.eink-unternav .eink-btn.an {
  color: #fff; background: linear-gradient(135deg, var(--eink-petrol-dunkel), var(--eink-petrol));
  box-shadow: 0 7px 18px rgba(8, 53, 59, .18);
}
.stu-tabs { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 16px; }

.stu-key { padding: 3px 8px; border-radius: 7px; background: #eef4f4; color: var(--eink-text-2); font-size: 12px; }
.stu-tag { display: inline-block; padding: 2px 8px; border-radius: 999px; background: #e3f2f3; color: #055d67; font-size: 11px; font-weight: 800; }
.stu-zone { display: inline-block; min-width: 78px; padding: 3px 9px; border-radius: 999px; background: #f0ebd8; color: #7a5c1e; font-size: 11px; font-weight: 800; text-align: center; }
.stu-mono { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 12px; }

.stu-pruefung { margin-bottom: 14px; padding: 12px 16px; border: 1px solid #e3c98c; border-radius: 12px; background: #fff8e7; color: #6a5726; font-size: 13px; }
.stu-pruefung ul { margin: 6px 0 0; padding-left: 18px; }
.stu-leiste { display: flex; gap: 8px; flex-wrap: wrap; }

/* Zweispaltig: Schrittliste + Felder. Die Reihenfolge der Schritte ist fest. */
.stu-grid { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 18px; align-items: start; }
.stu-schritte { position: sticky; top: 12px; display: grid; gap: 6px; }
.stu-schritt {
  display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 10px;
  padding: 11px 13px; border: 1px solid var(--eink-linie); border-radius: 12px;
  background: #fff; color: #172330; font-size: 13.5px; font-weight: 800; text-align: left; cursor: pointer;
}
.stu-schritt b {
  display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  background: #eef4f4; color: var(--eink-text-2); font-size: 12px;
}
.stu-schritt.an { border-color: var(--eink-petrol); background: #e3f2f3; color: var(--eink-petrol-dunkel); }
.stu-schritt.an b { background: var(--eink-petrol-dunkel); color: #fff; }

.stu-felder { display: grid; gap: 16px; min-width: 0; container-type: inline-size; }
.stu-schritt-kopf { padding: 14px 18px; border-left: 4px solid var(--eink-petrol); border-radius: 0 12px 12px 0; background: #f4f8f8; }
.stu-schritt-kopf h3 { margin: 0 0 4px; font-size: 17px; }
.stu-schritt-kopf p { margin: 0; color: var(--eink-text-2); font-size: 12.5px; }

.stu-block { padding: 18px 20px; border: 1px solid var(--eink-linie); border-radius: 16px; background: #fff; box-shadow: var(--eink-shadow); }
.stu-block > h4 { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; font-size: 15px; }
.stu-feld { margin-bottom: 12px; }
.stu-feld > label { display: block; margin-bottom: 5px; color: var(--eink-text-2); font-size: 11px; font-weight: 800; }
.stu-feld input, .stu-feld textarea, .stu-feld select {
  width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--eink-linie);
  border-radius: 9px; background: #f7fafb; font: inherit; resize: vertical;
}
.stu-feld small { display: block; margin-top: 4px; color: var(--eink-text-2); font-size: 11px; }

/* Bearbeiten-Popups (Kachel, Berufsprofil, ...): echtes <dialog>, erscheint
   zentriert ueber allem, statt (unsichtbar fuer den Nutzer) irgendwo im
   gescrollten Inhalt. */
.stu-popup-dialog {
  width: min(860px, calc(100vw - 32px)); max-width: none;
  max-height: min(90dvh, 900px); margin: auto; padding: 0;
  border: 1px solid var(--eink-linie); border-radius: 18px;
  box-shadow: 0 32px 90px rgba(8, 53, 59, .35); overflow: hidden;
  /* Flex statt einer zweiten, von Hand mitgepflegten max-height-Rechnung fuer
     den Inhalt (die driftete bei langen Formularen wie der Pain-Kachel vom
     900px-Deckel des Popups auseinander und schnitt die Aktionsleiste ab). */
  display: flex; flex-direction: column;
}
.stu-popup-dialog::backdrop { background: rgba(6, 32, 36, .6); backdrop-filter: blur(4px); }
.stu-popup-dialog-kopf {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 16px 20px; border-bottom: 1px solid var(--eink-linie); background: #f7fafb;
  flex: none;
}
.stu-popup-dialog-kopf h4 { margin: 0; font-size: 16px; }
.stu-popup-dialog-zu {
  width: 32px; height: 32px; border: 1px solid var(--eink-linie); border-radius: 9px;
  background: #fff; color: #172330; font-size: 18px; line-height: 1; cursor: pointer;
}
.stu-popup-dialog-inhalt { padding: 18px 20px; overflow-y: auto; flex: 1 1 auto; min-height: 0; }
/* Speichern/Abbrechen bleiben beim Scrollen sichtbar, egal wie lang das
   Formular ist (galt vor allem beim Kachel-Popup mit vielen Feldern als
   "verschwunden") - gilt fuer alle Popups mit dieser Struktur (Kachel,
   Berufsprofil, Produkt, ...). */
.stu-popup-dialog-inhalt .eink-editor-aktionen {
  position: sticky; bottom: 0; z-index: 2;
  margin: 18px -20px -18px; padding: 14px 20px 18px;
  background: #fff; border-top: 1px solid var(--eink-linie);
}
@media (max-width: 720px) {
  .stu-popup-dialog { width: 100vw; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
}

/* Bestaetigungs-Popup (stuBestaetigen): schmalere Variante des Bearbeiten-Popups.
   Haengt per JS direkt an <body>, ausserhalb von #einkBox - die --eink-*-Variablen
   muessen deshalb hier nochmal definiert werden, sonst verschwinden Button-Hintergruende
   unsichtbar (var() ohne Wert), siehe .stu-vb-overlay weiter unten fuer den gleichen Fall. */
.stu-confirm-dialog {
  width: min(420px, calc(100vw - 32px));
  --eink-petrol: #087985;
  --eink-petrol-dunkel: #055d67;
  --eink-gold: #e5b74b;
  --eink-gruen: #08763f;
  --eink-rot: #a12c26;
  --eink-linie: #d7dfdb;
  --eink-text-2: #5c6874;
}
.stu-confirm-dialog .stu-popup-dialog-inhalt p { margin: 0 0 16px; }
.stu-confirm-dialog .eink-editor-aktionen { justify-content: flex-end; }
/* Eingabefeld im Eingabedialog (stuTextFragen) - gleiche Optik wie .eink-feld input. */
.stu-eingabe {
  width: 100%; min-height: 42px; margin: -6px 0 16px; padding: 8px 10px;
  border: 1px solid var(--eink-linie); border-radius: 9px; background: #f7fafb; font: inherit;
}

/* Abstands-Popup: Hoehe eines einzelnen Abstands in der Strecke. Haengt wie das
   Bestaetigungs-Popup direkt an <body> - Variablen deshalb nochmal setzen. */
.stu-abstand-dialog {
  width: min(420px, calc(100vw - 32px));
  --eink-petrol: #087985;
  --eink-petrol-dunkel: #055d67;
  --eink-gold: #e5b74b;
  --eink-gruen: #08763f;
  --eink-rot: #a12c26;
  --eink-linie: #d7dfdb;
  --eink-text-2: #5c6874;
}
.stu-abstand-dialog .eink-editor-aktionen { justify-content: flex-end; }
.stu-abstand-schnell { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
/* Hoehen-Knopf in der Kachelzeile: sieht wie ein Wert aus, nicht wie ein Titel. */
.stu-pxknopf { font-variant-numeric: tabular-nums; }
.stu-pxknopf b { font-weight: 700; }
/* Zeile "Abstand einfügen": Hoehe + Schritt nebeneinander. */
.stu-abstand-neu { display: flex; align-items: center; gap: 8px; }
.stu-abstand-neu input { width: 90px; }
.stu-abstandzeile { grid-template-columns: auto 1fr auto auto; }

/* Design-Vorschau: Katalog aller Kachel-Arten, echte Produktfarben (fest,
   nicht themeabhaengig - Miniaturen des tatsaechlichen Kunden-Layouts).
   Bewusst ohne Farbverlaeufe - nur flaeche Flaechenfarben. */
.dv-dialog { width: min(1080px, calc(100vw - 32px)); max-height: min(92dvh, 960px); }
.dv-inhalt { background: #f4f7f6; }
.dv-gruppe { margin-top: 26px; }
.dv-gruppe:first-of-type { margin-top: 16px; }
.dv-gruppe h4 { margin: 0 0 12px; font-size: 15px; letter-spacing: -.01em; color: var(--eink-text-2); }
.dv-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 520px) { .dv-grid { grid-template-columns: 1fr; } }
.dv-card { display: flex; flex-direction: column; gap: 8px; }
.dv-card h5 { margin: 0; font-size: 12.5px; font-weight: 800; color: var(--eink-petrol-dunkel); }
.dv-card-preview { border-radius: 14px; overflow: hidden; box-shadow: var(--eink-shadow); }

/* Spezimen: 1:1 die echten Kunden-Kachel-Farben aus einkommen/einkommen.css. */
.dv-spec { border-radius: 12px; overflow: hidden; background: #fff; }
.dv-body { padding: 15px 16px; display: flex; flex-direction: column; gap: 6px; }
.dv-body h4 { margin: 0; font-size: 14px; line-height: 1.25; color: #08353b; letter-spacing: -.01em; }
.dv-body p { margin: 0; color: #5c6d70; font-size: 11.5px; line-height: 1.4; }
.dv-quote { margin: 0 0 3px; color: #a35047; font-size: 10.5px; font-weight: 800; font-style: italic; }
.dv-photo { aspect-ratio: 16/9; display: flex; align-items: end; justify-content: start; padding: 10px; background: #1f3d33; }
.dv-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dv-photo { position: relative; }
.dv-zahl { font-size: 26px; font-weight: 850; line-height: 1; font-variant-numeric: tabular-nums; }

.dv-nutzen { background: #eaf8f0; }
.dv-nutzen h4 { color: #075b32; } .dv-nutzen .dv-zahl { color: #08763f; }

.dv-vertrauen { background: #f7fafb; } .dv-vertrauen .dv-zahl { color: #055d67; }

.dv-warnung { background: #fdf0ee; } .dv-warnung h4 { color: #8a2a22; }

.dv-zitat { background: #062f35; text-align: center; }
.dv-zitat .dv-body { align-items: center; padding: 20px 16px; }
.dv-zitat blockquote { margin: 0; color: #fff; font-size: 16px; font-weight: 800; font-style: italic; line-height: 1.3; }
.dv-zitat cite { color: #e5b74b; font-size: 10.5px; font-style: normal; font-weight: 800; }

.dv-stat { background: #062f35; }
.dv-stat .dv-zahl { color: #e5b74b; } .dv-stat h4 { color: #fff; } .dv-stat p { color: #b6d5d7; }

.dv-video .dv-photo { background: #08383e; align-items: center; justify-content: center; }
.dv-play { position: relative; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; background: #e5b74b; box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.dv-play svg { width: 13px; height: 13px; fill: #062f35; }

.dv-ueberschrift { background: #fff; padding: 20px 16px; }
.dv-ueberschrift strong { display: block; font-size: 21px; font-weight: 850; letter-spacing: -.02em; color: #062f35; }
.dv-ueberschrift span { display: block; margin-top: 7px; color: #546b70; font-size: 11.5px; }

.dv-abstand { background: #f1f6f7; padding: 18px; display: grid; place-items: center; border: 1.5px dashed #b9c9c8; }
.dv-abstand span { color: #6b7c7f; font-size: 10px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }

.dv-statement { background: #062f35; padding: 24px 18px; }
.dv-statement small { display: block; margin-bottom: 8px; color: #e5b74b; font-size: 9px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.dv-statement p { margin: 0; color: #fff; font-size: 18px; font-weight: 800; line-height: 1.15; letter-spacing: -.02em; }
.dv-statement p b { color: #e5b74b; }
.dv-statement .dv-sub { margin-top: 10px; color: #c9e3e4; font-size: 11px; font-weight: 500; }

.dv-umkehr { background: #fdf1d4; padding: 18px 16px; }
.dv-umkehr .dv-quote { color: #62552f; font-size: 10.5px; margin-bottom: 6px; }
.dv-umkehr h4 { color: #4a3d18; } .dv-umkehr p { color: #62552f; }

.dv-wendepunkt { background: #06402a; text-align: center; padding: 22px 18px; }
.dv-wendepunkt h4 { color: #eafaf1; font-size: 14.5px; } .dv-wendepunkt p { color: #bfe8d2; font-weight: 700; }

/* Vorschau der Streich-Kachel - 1:1 der Aufbau von .em-streich-* aus
   einkommen.css (Kicker-Pille, Fehlbetrag+Label nebeneinander, Trennzeile,
   Kacheln, Fusszeile), nur verkleinert und ohne Farbverlauf. */
.dv-streichen { background: #5c1712; padding: 20px 18px; }
.dv-streich-kicker {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  background: rgba(255,255,255,.14); color: #fff; font-size: 8.5px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase;
}
.dv-streich-kicker i { width: 5px; height: 5px; border-radius: 50%; background: #ffcac3; }
.dv-streich-luecke { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; margin: 14px 0 0; }
.dv-streich-zahl { display: block; color: #fff; font-size: 32px; font-weight: 900; letter-spacing: -.045em; line-height: .88; }
.dv-streich-luecke span { padding-bottom: 3px; color: #ffcac3; font-size: 10px; font-weight: 750; line-height: 1.3; }
.dv-streichen h4 { margin-top: 14px; color: #fff; font-size: 14px; font-weight: 900; }
.dv-streichen .dv-sub { margin-top: 6px; color: #f6d5d0; font-size: 11px; font-weight: 650; }
.dv-streich-trenner { display: flex; align-items: center; gap: 8px; margin: 16px 0 10px; }
.dv-streich-trenner span { font-size: 8px; font-weight: 900; letter-spacing: .1em; text-transform: uppercase; color: #f0b7b0; }
.dv-streich-trenner hr { flex: 1; height: 1px; border: 0; margin: 0; background: rgba(255,255,255,.18); }
.dv-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.dv-chip { padding: 10px 8px; border: 1.3px solid rgba(255,255,255,.3); border-radius: 10px; background: #fff; color: #3d0f0c; font-size: 10px; font-weight: 800; text-align: left; }
.dv-chip em { display: block; margin-bottom: 4px; font-size: 15px; font-style: normal; }
.dv-chip s { display: block; margin-top: 3px; color: #9a6a63; font-size: 9px; font-weight: 600; text-decoration: none; }
/* Ein durchgestrichenes Beispiel zeigt den Zustand direkt in der Vorschau. */
.dv-chip.aus { background: #1a0705; border-color: #ffcac3; color: rgba(255,202,195,.85); }
.dv-chip.aus em { opacity: .28; filter: grayscale(1); }
.dv-chip.aus b { text-decoration: line-through; text-decoration-color: rgba(255,202,195,.6); }
.dv-streich-fuss { margin-top: 14px; color: #f0b7b0; font-size: 10.5px; font-weight: 700; line-height: 1.5; }
.dv-streich-fuss b { color: #fff; font-weight: 850; }

/* Art-Waehler im Kachel-Formular: Liste statt natives <select>-Popup, damit
   beim Drueberfahren eine Live-Vorschau (dieselbe wie in der Design-Vorschau)
   erscheint. Das <select> bleibt unsichtbar als Wertspeicher bestehen. */
.dv-artfeld { position: relative; }
.dv-artknopf {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 42px; padding: 8px 10px; border: 1px solid var(--eink-linie); border-radius: 9px;
  background: #f7fafb; font: inherit; text-align: left; cursor: pointer;
}
.dv-artknopf-pfeil { color: var(--eink-text-2); font-size: 11px; }
.dv-artpanel {
  position: absolute; z-index: 60; top: calc(100% + 6px); left: 0; display: flex; flex-direction: column;
  width: 190px; max-height: 320px; overflow-y: auto; padding: 6px;
  border: 1px solid var(--eink-linie); border-radius: 12px; background: #fff; box-shadow: 0 20px 50px rgba(8, 53, 59, .25);
}
/* Ohne diese Regel gewinnt "display:flex" oben gegen die Browser-Regel fuer
   [hidden] (Autoren-CSS schlaegt UA-Stylesheet immer, unabhaengig von
   Spezifitaet) - das Panel war dadurch nie wirklich versteckt und ging beim
   Oeffnen des Kachel-Dialogs sofort sichtbar auf. */
.dv-artpanel[hidden] { display: none; }
.dv-artliste-item { padding: 8px 10px; border: 0; border-radius: 8px; background: transparent; color: #172330; font-size: 12.5px; font-weight: 700; text-align: left; cursor: pointer; }
.dv-artliste-item:hover, .dv-artliste-item:focus-visible { background: #eef4f4; }
.dv-artliste-item.aktiv { background: var(--eink-petrol-dunkel); color: #fff; }

/* Schwebende Kachel-Vorschau: bewusst NICHT ins Dropdown gequetscht, sondern
   frei im Viewport (position:fixed) - wirkt wie eine echte, freistehende
   Kachel statt einer eingepferchten Miniatur. position:fixed statt :absolute,
   damit sie unabhaengig vom scrollenden Dialoginhalt an derselben Bildschirm-
   stelle bleibt und nicht abgeschnitten wird. left/top setzt das Script
   (artSchwebePositionieren) an der tatsaechlichen Dialogkante - deshalb hier
   nur Breite/Optik, keine feste Position. */
.dv-artschwebe {
  position: fixed; z-index: 500; width: 300px;
  pointer-events: none; filter: drop-shadow(0 26px 60px rgba(6, 32, 36, .4));
}
.dv-artschwebe h5 {
  display: inline-block; margin: 0 0 8px; padding: 4px 11px; border-radius: 999px;
  background: rgba(6, 32, 36, .85); color: #fff; font-size: 11px; font-weight: 800;
}
.dv-artschwebe .dv-spec { border-radius: 14px; }
@media (max-width: 900px) { .dv-artschwebe { display: none; } }

/* Wiederholbare Zeilen (Vergleichskacheln, Hinweise, Trust, CTAs) */
.stu-wdh { display: grid; gap: 10px; margin-bottom: 10px; }
.stu-wdh-zeile {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) 44px; gap: 9px;
  align-items: end; padding: 12px; border: 1px dashed var(--eink-linie); border-radius: 12px; background: #f7fafb;
}
.stu-wdh-zeile label { display: block; color: var(--eink-text-2); font-size: 11px; font-weight: 800; }
.stu-wdh-zeile input, .stu-wdh-zeile textarea, .stu-wdh-zeile select {
  width: 100%; min-height: 38px; margin-top: 4px; padding: 7px 9px;
  border: 1px solid var(--eink-linie); border-radius: 8px; background: #fff; font: inherit; resize: vertical;
}

/* Pain-Zuordnung des Szenarios */
.stu-gruppe { margin-bottom: 16px; }
.stu-gruppe-titel {
  margin: 0 0 8px; padding: 9px 14px; border-radius: 11px; color: #fff;
  background: var(--eink-petrol-dunkel); text-align: center;
  font-size: 12.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em;
}
.stu-painliste { display: grid; gap: 7px; margin-bottom: 14px; }
.stu-painzeile {
  display: grid; grid-template-columns: auto 1fr auto auto; align-items: center; gap: 12px;
  padding: 10px 13px; border: 1px solid var(--eink-linie); border-radius: 11px; background: #f7fafb;
}
.stu-painzeile.aus { opacity: .5; }
.stu-painzeile b { font-size: 13.5px; }
.stu-painzeile small { color: var(--eink-text-2); font-size: 11.5px; }
.stu-painbtn { display: flex; gap: 5px; }

@media (max-width: 900px) {
  .stu-grid { grid-template-columns: 1fr; }
  .stu-schritte { position: static; grid-auto-flow: column; overflow-x: auto; }
  .stu-schritt { grid-template-columns: 1fr; text-align: center; }
  .stu-schritt b { display: none; }
}

/* ---------------------------------------------------------------------------
   Statusleiste aus wiedervorlage.js: sie vergibt fuer 'eink' die Klasse
   .ropt-btn, deren Farben aber nur unter #roptBox definiert sind. Hier die
   fehlenden Variablen nachziehen, damit die Knoepfe im Einkommenstab aussehen
   wie die uebrigen.
   --------------------------------------------------------------------------- */
#einkBox {
  --ropt-navy: #172330;
  --ropt-gruen: var(--eink-gruen);
}
#einkBox .ropt-btn {
  border: 1px solid var(--eink-petrol);
  background: var(--eink-petrol-dunkel);
  color: #fff;
}
#einkBox .ropt-btn.grau { color: #172330; border-color: var(--eink-linie); background: #fff; box-shadow: none; }
#einkBox .ropt-btn.rot { border-color: var(--eink-rot); background: var(--eink-rot); color: #fff; }
#einkBox .ropt-btn.gruen { border-color: var(--eink-gruen); background: var(--eink-gruen); color: #fff; }

/* --- Kachel-Zuordnung: Umsortieren per Ziehen am Griff --------------------- */
.stu-painzeile {
  grid-template-columns: 22px auto 1fr 260px auto;
}
.stu-griff {
  color: var(--eink-text-2); font-size: 17px; line-height: 1; cursor: grab;
  user-select: none; touch-action: none; text-align: center;
}
.stu-painzeile.zieht { opacity: .55; }
.stu-painzeile.drop-ziel { border-color: var(--eink-petrol); background: #e3f2f3; }
body.stu-zieht { cursor: grabbing; user-select: none; }
.stu-painnamen { min-width: 0; }
.stu-painnamen b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stu-freizeile { grid-template-columns: auto 1fr auto; }
.stu-platz { min-height: 34px; padding: 5px 8px; border: 1px solid var(--eink-linie); border-radius: 8px; background: #fff; font: inherit; font-size: 12px; }

/* Art-Kennzeichnung der Kachel */
.stu-art {
  display: inline-block; min-width: 74px; padding: 3px 9px; border-radius: 999px;
  background: #eef2f1; color: #45514f; font-size: 11px; font-weight: 800; text-align: center;
}
/* Inhalts-Kacheln */
.stu-art-pain      { background: #fbe4e1; color: #7c231d; }
.stu-art-nutzen    { background: #d9f2e3; color: #075b32; }
.stu-art-vertrauen { background: #e6e9ec; color: #4a545c; }
.stu-art-zitat     { background: #dfe9ef; color: #1e4a5e; }
.stu-art-stat      { background: #f0ebd8; color: #7a5c1e; }
.stu-art-warnung   { background: #fbe0d3; color: #8a4213; }
.stu-art-bild      { background: #e3f2f3; color: #055d67; }
.stu-art-video     { background: #e5ddf5; color: #4a3383; }
/* Erzaehl-Kacheln (eigenes Layout, kein Karten-Rahmen) */
.stu-art-statement { background: #e8e3d3; color: #6b5518; }
.stu-art-umkehr    { background: #fde8cf; color: #8a5210; }
.stu-art-wendepunkt{ background: #d6f0e6; color: #0a5b46; }
.stu-art-streichen { background: #f3dde6; color: #7a2447; }
/* Layout-Kacheln (strukturieren die Seite, kein eigener Inhalt) */
.stu-art-ueberschrift { background: #dde4ea; color: #33424f; }
.stu-art-abstand      { background: #eceff1; color: #62707a; font-style: italic; }
/* Systemtypen: fest verdrahtet, nicht loesch-/neu anlegbar - dunkler Rahmen
   als optischer Unterschied zu den frei anlegbaren Arten. */
.stu-art-rechner,
.stu-art-em_rente,
.stu-art-schritt4_titel,
.stu-art-schritt5_titel {
  border: 1px solid #9db4b8; background: #eef4f4; color: #0b4a52;
}

/* Beitragstabelle im Fall-Editor: Stuetzstellen aus DEAS */
.eink-stufen-kopf { display: block; }
.eink-stufen-kopf .eink-hinweis { display: block; margin-top: 4px; }
.eink-stufen-tab { width: 100%; margin-bottom: 10px; }
.eink-stufen-tab th { font-size: 11.5px; text-align: left; }
.eink-stufen-tab td { padding: 4px 6px 4px 0; }
.eink-stufen-tab input {
  width: 100%; min-height: 34px; padding: 5px 9px; border: 1px solid var(--eink-linie);
  border-radius: 8px; background: #fff; font: inherit; font-size: 13px;
}
.eink-stufen-tab td:last-child { width: 44px; }

/* Hinweisleiste, solange die Kachel-Ansicht fixiert ist */
.stu-kacheln-fest {
  position: sticky; top: 0; z-index: 3;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 12px; padding: 9px 12px; border: 1px solid #d5a032; border-radius: 11px;
  background: #fdf6e4; color: #6b4c0d; font-size: 12.5px; font-weight: 700;
}

/* Art-Kachel als Knopf: oeffnet die Bibliotheks-Auswahl zum Tauschen */
.stu-art-knopf { border: 0; cursor: pointer; font-family: inherit; }
.stu-art-knopf:hover { outline: 2px solid var(--eink-petrol); outline-offset: 1px; }

/* Popup "Wohin damit?" beim Hinzufuegen einer Kachel */
.stu-platz-dialog { width: min(540px, 94vw); }
.stu-popup-dialog .stu-popup-label {
  margin: 16px 0 7px; color: var(--eink-text-2);
  font-size: 11.5px; font-weight: 800; text-transform: uppercase; letter-spacing: .04em;
}
.stu-platz-kachel {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 11px;
  padding: 10px 13px; border: 1px solid var(--eink-linie); border-radius: 11px; background: #f7fafb;
}
.stu-platz-kachel b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.stu-platzwahl { display: grid; gap: 6px; }
.stu-popup-dialog .stu-platzknopf {
  display: grid; grid-template-columns: 26px 1fr; align-items: center; gap: 11px; width: 100%;
  min-height: 42px; padding: 8px 12px; border: 1px solid var(--eink-linie); border-radius: 10px;
  background: #fff; color: #172330; font: inherit; font-size: 13.5px; font-weight: 700;
  text-align: left; cursor: pointer;
}
.stu-popup-dialog .stu-platzknopf:hover { border-color: var(--eink-petrol); background: #f2f9fa; }
.stu-popup-dialog .stu-platzknopf.aktiv {
  border-color: var(--eink-petrol-dunkel); background: #e3f2f3;
  box-shadow: inset 0 0 0 1px var(--eink-petrol-dunkel);
}
.stu-platznr {
  display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px;
  border-radius: 999px; background: var(--eink-petrol-dunkel); color: #fff; font-size: 12px; font-weight: 800;
}
/* Zwei-Wege-Umschalter statt Radios (native Radios skalieren im Popup hässlich) */
.stu-segment { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--eink-linie); border-radius: 10px; overflow: hidden; }
.stu-popup-dialog .stu-segknopf {
  min-height: 40px; padding: 8px 12px; border: 0; background: #fff; color: #172330;
  font: inherit; font-size: 13px; font-weight: 700; cursor: pointer;
}
.stu-popup-dialog .stu-segknopf + .stu-segknopf { border-left: 1px solid var(--eink-linie); }
.stu-popup-dialog .stu-segknopf.aktiv { background: var(--eink-petrol-dunkel); color: #fff; }
.stu-platz-dialog .eink-editor-aktionen { justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* Popup "Andere Kachel wählen" */
.stu-kachelwahl-dialog { width: min(620px, 94vw); }
.stu-kachelwahl-liste { display: grid; gap: 6px; max-height: 52vh; overflow-y: auto; margin: 6px 0 12px; }
.stu-kachelwahl-zeile {
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 12px; width: 100%;
  padding: 9px 12px; border: 1px solid var(--eink-linie); border-radius: 10px; background: #f7fafb;
  font: inherit; text-align: left; cursor: pointer;
}
.stu-kachelwahl-zeile:hover { border-color: var(--eink-petrol); background: #e3f2f3; }
.stu-kachelwahl-zeile.aktiv { border-color: var(--eink-petrol); box-shadow: inset 0 0 0 1px var(--eink-petrol); }
.stu-kachelwahl-zeile b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }

.stu-unterblock { margin: 12px 0; border-style: dashed; box-shadow: none; }
.stu-block-hinzufuegen { margin-top: 26px; border-style: dashed; background: #fafcfc; box-shadow: none; }

/* Gleiche schmale Variante wie unten, aber an der Breite des Feld-Containers
   gemessen (nicht am Browserfenster) - noetig, weil die rechte Spalte im
   Vollbild-Editor auf breiten Monitoren schmal sein kann, obwohl der
   Viewport selbst breit ist. */
@container (max-width: 520px) {
  .stu-painzeile { grid-template-columns: 22px 1fr; row-gap: 8px; }
  .stu-painzeile .stu-art, .stu-platz, .stu-painbtn { grid-column: 2; }
}

@media (max-width: 720px) {
  .stu-painzeile { grid-template-columns: 22px 1fr; row-gap: 8px; }
  .stu-painzeile .stu-art, .stu-platz, .stu-painbtn { grid-column: 2; }
}

/* --- Speicherleiste: erscheint erst bei ungespeicherten Aenderungen -------- */
/* Gleiche Mechanik wie .topt-speicherleiste/.ropt-speicherleiste. */
.eink-speicherleiste {
  position: sticky; bottom: 12px; z-index: 6;
  display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap;
  margin-top: 18px; padding: 13px 18px;
  border: 1px solid var(--eink-gold); border-radius: 14px;
  background: linear-gradient(135deg, #fff8e7, #fdf1d4);
  box-shadow: 0 12px 30px rgba(8, 53, 59, .16);
}
.eink-speicherleiste[hidden] { display: none; }
.eink-speicherleiste strong { color: #6a5726; font-size: 14px; }

/* --- Unverbindliche Hinweise (blockieren die Veroeffentlichung nicht) ------ */
.eink-hinweiskarte { border-color: #cfd8e0; background: #f4f7fa; }
.eink-hinweiskarte h3 { color: #33474a; }
.eink-hinweiskarte ul { margin: 8px 0 0; padding-left: 18px; color: #55636a; font-size: 13px; }

/* --- Tag-Vorschlaege beim Zuordnen von Kacheln ----------------------------- */
.stu-vorschlaege { margin: 12px 0; padding: 12px 14px; border: 1px dashed var(--eink-petrol); border-radius: 12px; background: #e3f2f3; }
.stu-vorschlaege label { display: block; margin-bottom: 8px; color: var(--eink-petrol-dunkel); font-size: 11px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.stu-vorschlag-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.stu-vorschlag-chips .eink-seg-btn { display: flex; flex-direction: column; align-items: flex-start; gap: 1px; }
.stu-vorschlag-chips .eink-seg-btn small { color: var(--eink-text-2); font-weight: 700; }

/* --- Vollbild-Editor: links Schritte, Mitte Live-Vorschau, rechts Felder --- */
/* Haengt per JS direkt an <body>, ausserhalb von #einkBox - die --eink-*-Variablen
   muessen deshalb hier nochmal definiert werden, sonst werden z.B. Button-Hintergruende
   ungueltig (var() ohne Wert) und Buttons wie "Speichern" verschwinden unsichtbar. */
.stu-vb-overlay {
  position: fixed; inset: 0; z-index: 150; display: flex; flex-direction: column;
  background: #eef3f4;
  --eink-petrol: #087985;
  --eink-petrol-dunkel: #055d67;
  --eink-gold: #e5b74b;
  --eink-gruen: #08763f;
  --eink-rot: #a12c26;
  --eink-linie: #d7dfdb;
  --eink-text-2: #5c6874;
  --eink-shadow: 0 12px 34px rgba(8, 53, 59, .09);
}
.stu-vb-kopf {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 20px; border-bottom: 1px solid var(--eink-linie); background: #fff;
}
.stu-vb-kopf h3 { margin: 0; font-size: 15px; display: flex; align-items: center; gap: 8px; }
.stu-vb-pruefung { position: relative; font-size: 12px; }
.stu-vb-pruefung summary {
  list-style: none; cursor: pointer; color: #8a6a1a; font-weight: 700;
  padding: 4px 10px; border: 1px solid #e3c98c; border-radius: 8px; background: #fff8e7;
}
.stu-vb-pruefung summary::-webkit-details-marker { display: none; }
.stu-vb-pruefung summary::after { content: ' ▾'; }
.stu-vb-pruefung[open] summary::after { content: ' ▴'; }
.stu-vb-pruefung ul {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 10; width: max-content; max-width: 340px;
  margin: 0; padding: 10px 14px 10px 30px; border: 1px solid #e3c98c; border-radius: 10px;
  background: #fff8e7; color: #6a5726; font-weight: 500; box-shadow: 0 12px 30px rgba(8,53,59,.18);
}
.stu-vb-pruefung li { margin: 3px 0; }
.stu-vb-knoepfe { display: flex; gap: 8px; margin-left: auto; }
.stu-vb-body {
  flex: 1; min-height: 0; display: flex; gap: 14px; padding: 14px 20px 20px; overflow: auto;
}
.stu-vb-schritte { flex: 0 0 190px; }
.stu-vb-vorschau {
  flex: 1 1 auto; min-width: 320px; border: 1px solid var(--eink-linie); border-radius: 16px;
  overflow: hidden; background: #fff; box-shadow: var(--eink-shadow);
}
.stu-vb-vorschau iframe { width: 100%; height: 100%; border: 0; display: block; }

/* Rechte Feldspalte: Breite ueber width (nicht flex-basis), damit sich per
   Ziehgriff (.stu-vb-resize) eine feste px-Breite per JS setzen laesst. */
.stu-vb-felder { flex: 0 0 auto; width: 440px; min-width: 340px; max-width: 85%; overflow-y: auto; padding-right: 4px; }
.stu-vb-resize {
  flex: 0 0 8px; cursor: col-resize; border-radius: 4px;
  background: transparent; position: relative;
}
.stu-vb-resize::after {
  content: ''; position: absolute; top: 8px; bottom: 8px; left: 3px; width: 2px;
  border-radius: 2px; background: var(--eink-linie);
}
.stu-vb-resize:hover::after, .stu-vb-resize.zieht::after { background: var(--eink-petrol); }

@media (max-width: 1100px) {
  .stu-vb-body { flex-direction: column; overflow: auto; }
  .stu-vb-schritte { flex: none; position: static; display: flex; flex-wrap: wrap; gap: 6px; }
  .stu-vb-vorschau { min-height: 420px; }
  .stu-vb-felder { width: auto; min-width: 0; max-width: none; }
  .stu-vb-resize { display: none; }
}

/* Dark Mode: Modul und Strecken-Studio verwenden dieselben Flaechen und
   Kontraste wie die uebrigen Manager-Reiter. Die Design-Miniaturen (.dv-*)
   bleiben bewusst in ihren echten Kundenfarben. */
html[data-theme="dark"] #einkBox,
html[data-theme="dark"] .stu-popup-dialog,
html[data-theme="dark"] .stu-vb-overlay {
  --eink-petrol: var(--vm-primary);
  --eink-petrol-dunkel: var(--vm-primary-strong);
  --eink-linie: var(--vm-border);
  --eink-text-2: var(--vm-muted);
  --eink-shadow: var(--vm-card-shadow);
  color: var(--vm-text);
}
html[data-theme="dark"] #einkBox .eink-unternav,
html[data-theme="dark"] #einkBox .eink-karte,
html[data-theme="dark"] #einkBox .eink-tabelle,
html[data-theme="dark"] #einkBox .stu-schritt,
html[data-theme="dark"] #einkBox .stu-block,
html[data-theme="dark"] .stu-popup-dialog {
  color: var(--vm-text);
  border-color: var(--vm-border);
  background: var(--vm-surface);
  box-shadow: var(--vm-card-shadow);
}
html[data-theme="dark"] #einkBox .eink-unternav .eink-btn,
html[data-theme="dark"] #einkBox .stu-schritt,
html[data-theme="dark"] #einkBox .dv-artliste-item {
  color: var(--vm-text);
}
html[data-theme="dark"] #einkBox .eink-unternav .eink-btn:hover,
html[data-theme="dark"] #einkBox .eink-treffer:hover,
html[data-theme="dark"] #einkBox .stu-schritt:hover,
html[data-theme="dark"] #einkBox .dv-artliste-item:hover,
html[data-theme="dark"] #einkBox .dv-artliste-item:focus-visible {
  background: var(--vm-surface-2);
}
html[data-theme="dark"] #einkBox .eink-unternav .eink-btn.an,
html[data-theme="dark"] #einkBox .stu-schritt.an,
html[data-theme="dark"] #einkBox .dv-artliste-item.aktiv {
  color: #032326;
  border-color: var(--vm-primary);
  background: var(--vm-primary);
}
html[data-theme="dark"] #einkBox .eink-tabelle th {
  color: var(--vm-text);
  border-color: var(--vm-border);
  background: var(--vm-surface-2);
}
html[data-theme="dark"] #einkBox .eink-tabelle th[data-k]:hover,
html[data-theme="dark"] #einkBox .eink-tabelle tr:hover td {
  background: var(--vm-surface-2);
}
html[data-theme="dark"] #einkBox .eink-btn.grau,
html[data-theme="dark"] #einkBox .eink-seg-btn,
html[data-theme="dark"] #einkBox .stu-groesse-stepper input,
html[data-theme="dark"] #einkBox .stu-platz,
html[data-theme="dark"] #einkBox .stu-platz-kachel,
html[data-theme="dark"] #einkBox .stu-platzknopf,
html[data-theme="dark"] #einkBox .stu-segknopf,
html[data-theme="dark"] #einkBox .stu-kachelwahl-zeile,
html[data-theme="dark"] #einkBox .dv-artknopf,
html[data-theme="dark"] #einkBox .dv-artpanel,
html[data-theme="dark"] .stu-popup-dialog .eink-btn.grau,
html[data-theme="dark"] .stu-popup-dialog .stu-eingabe,
html[data-theme="dark"] .stu-popup-dialog .stu-platzknopf,
html[data-theme="dark"] .stu-popup-dialog .stu-segknopf {
  color: var(--vm-text);
  border-color: var(--vm-border);
  background: var(--vm-surface-3);
}
html[data-theme="dark"] #einkBox .eink-feld input,
html[data-theme="dark"] #einkBox .eink-feld select,
html[data-theme="dark"] #einkBox .stu-feld input,
html[data-theme="dark"] #einkBox .stu-feld textarea,
html[data-theme="dark"] #einkBox .stu-feld select,
html[data-theme="dark"] #einkBox .stu-wdh-zeile input,
html[data-theme="dark"] #einkBox .stu-wdh-zeile textarea,
html[data-theme="dark"] #einkBox .stu-wdh-zeile select,
html[data-theme="dark"] #einkBox .eink-stufen-tab input {
  color: var(--vm-text);
  border-color: var(--vm-border);
  background: var(--vm-surface-3);
}
html[data-theme="dark"] #einkBox .eink-link-box,
html[data-theme="dark"] #einkBox .eink-cockpit,
html[data-theme="dark"] #einkBox .eink-hinweiskarte,
html[data-theme="dark"] #einkBox .stu-schritt-kopf,
html[data-theme="dark"] #einkBox .stu-wdh-zeile,
html[data-theme="dark"] #einkBox .stu-painzeile,
html[data-theme="dark"] #einkBox .stu-block-hinzufuegen,
html[data-theme="dark"] #einkBox .stu-vorschlaege,
html[data-theme="dark"] .stu-popup-dialog-kopf,
html[data-theme="dark"] .stu-popup-dialog-inhalt .eink-editor-aktionen,
html[data-theme="dark"] .stu-vb-kopf {
  color: var(--vm-text);
  border-color: var(--vm-border);
  background: var(--vm-surface-2);
}
html[data-theme="dark"] #einkBox .eink-guide li,
html[data-theme="dark"] #einkBox .eink-hinweiskarte h3,
html[data-theme="dark"] #einkBox .eink-hinweiskarte ul {
  color: var(--vm-muted);
}
html[data-theme="dark"] #einkBox .eink-st-veroeffentlicht {
  color: #032326;
  background: var(--vm-primary);
}
html[data-theme="dark"] .stu-popup-dialog-zu {
  color: var(--vm-text);
  border-color: var(--vm-border);
  background: var(--vm-surface-3);
}
