/* HeimdallMedia Verwaltung — Oberfläche (dunkel, ruhig, Gold-Akzent) */

:root {
  --bg: #0c0c0f;
  --karte: #151519;
  --karte-hell: #1b1b21;
  --rand: #26262c;
  --rand-hell: #34343c;
  --gold: #E0AC2B;
  --gold-dunkel: #b8891c;
  --gold-hell: #f2c860;
  --gruen: #3ddc84;
  --gelb: #f5c451;
  --rot: #ff5c5c;
  --grau: #7a7d85;
  --text: #ececef;
  --text-2: #d6d8dc;
  --text-auf-gold: #16120a;
  --radius: 12px;
  --radius-klein: 8px;
  --schatten: 0 8px 28px rgba(0, 0, 0, 0.45);
  --fokus: 0 0 0 3px rgba(224, 172, 43, 0.45);
  --mono: ui-monospace, "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--bg); color-scheme: dark; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gold); text-decoration: none; }
a:hover { color: var(--gold-hell); text-decoration: underline; }

:focus-visible { outline: none; box-shadow: var(--fokus); border-radius: 4px; }

h1, h2, h3, h4 { margin: 0 0 0.5em; line-height: 1.25; font-weight: 600; color: var(--text); }
h1 { font-size: 1.75rem; letter-spacing: -0.01em; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
small, .klein { font-size: 0.875rem; }
.stumm { color: var(--text-2); }
.rechts { text-align: right; }
.mitte { text-align: center; }
.nowrap { white-space: nowrap; }
.versteckt { display: none !important; }

/* Kopfleiste */
.kopf {
  position: sticky; top: 0; z-index: 20;
  background: rgba(12, 12, 15, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rand);
}
.kopf-innen {
  max-width: 1440px; margin: 0 auto; padding: 0 20px;
  display: flex; align-items: center; gap: 18px; min-height: 60px; flex-wrap: wrap;
}
.marke { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; letter-spacing: 0.01em; }
.marke:hover { text-decoration: none; color: var(--gold-hell); }
.marke img { height: 30px; width: auto; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--text-2); padding: 8px 12px; border-radius: var(--radius-klein);
  font-weight: 600; font-size: 0.95rem;
}
.nav a:hover { background: var(--karte-hell); color: var(--text); text-decoration: none; }
.nav a.aktiv { color: var(--gold); background: rgba(224, 172, 43, 0.1); }
.kopf-rechts { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.kopf-rechts .benutzer { color: var(--text-2); font-size: 0.95rem; }

/* Inhalt */
.inhalt { max-width: 1440px; margin: 0 auto; padding: 24px 20px 60px; }
.seitenkopf { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.seitenkopf h1 { margin-bottom: 4px; }
.seitenkopf .aktionen { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* Knöpfe */
.knopf, button.knopf, input[type="submit"].knopf {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 9px 16px; border-radius: var(--radius-klein);
  border: 1px solid var(--rand-hell); background: var(--karte-hell); color: var(--text);
  font: inherit; font-weight: 600; font-size: 0.95rem; line-height: 1.2; cursor: pointer;
  text-decoration: none; transition: background 0.15s, border-color 0.15s, transform 0.05s;
}
.knopf:hover { background: #22222a; border-color: #45454f; color: var(--text); text-decoration: none; }
.knopf:active { transform: translateY(1px); }
.knopf.primaer { background: var(--gold); border-color: var(--gold); color: var(--text-auf-gold); }
.knopf.primaer:hover { background: var(--gold-hell); border-color: var(--gold-hell); color: var(--text-auf-gold); }
.knopf.gefahr { border-color: rgba(255, 92, 92, 0.5); color: var(--rot); }
.knopf.gefahr:hover { background: rgba(255, 92, 92, 0.12); }
.knopf.klein { padding: 6px 10px; font-size: 0.85rem; }
.knopf[disabled], .knopf.laeuft { opacity: 0.55; cursor: progress; }
.knopf-zeile { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.inline { display: inline; }

/* Karten */
.karte {
  background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--schatten);
}
.karte + .karte { margin-top: 16px; }
.karte h2, .karte h3 { margin-top: 0; }
.karte-kopf { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.karte-kopf h2, .karte-kopf h3 { margin: 0; }
.karte-kopf .aktionen { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }

.raster { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.raster-2 { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }

/* Kennzahlen */
.kennzahlen { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); margin-bottom: 20px; }
.kennzahl { background: var(--karte); border: 1px solid var(--rand); border-radius: var(--radius); padding: 12px 16px; }
.kennzahl .wert { font-size: 1.7rem; font-weight: 700; line-height: 1.2; color: var(--text); }
.kennzahl .wert.gold { color: var(--gold); }
.kennzahl .wert.gruen { color: var(--gruen); }
.kennzahl .wert.rot { color: var(--rot); }
.kennzahl .wert.gelb { color: var(--gelb); }
.kennzahl .label { color: var(--text-2); font-size: 0.85rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }

/* Ampel */
.ampel {
  display: inline-block; width: 12px; height: 12px; border-radius: 50%; flex: none;
  background: var(--grau); box-shadow: 0 0 0 3px rgba(122, 125, 133, 0.18);
}
.ampel.gruen { background: var(--gruen); box-shadow: 0 0 0 3px rgba(61, 220, 132, 0.2), 0 0 12px rgba(61, 220, 132, 0.45); }
.ampel.gelb { background: var(--gelb); box-shadow: 0 0 0 3px rgba(245, 196, 81, 0.2), 0 0 12px rgba(245, 196, 81, 0.4); }
.ampel.rot { background: var(--rot); box-shadow: 0 0 0 3px rgba(255, 92, 92, 0.22), 0 0 12px rgba(255, 92, 92, 0.5); }
.ampel.gross { width: 18px; height: 18px; }
.farbe-gruen { color: var(--gruen); }
.farbe-gelb { color: var(--gelb); }
.farbe-rot { color: var(--rot); }
.farbe-grau { color: var(--grau); }
.farbe-gold { color: var(--gold); }

/* Marken / Badges */
.badge {
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px;
  font-size: 0.8rem; font-weight: 700; line-height: 1.5; border: 1px solid var(--rand-hell); color: var(--text-2);
  white-space: nowrap;
}
.badge.gold { background: rgba(224, 172, 43, 0.14); border-color: rgba(224, 172, 43, 0.5); color: var(--gold); }
.badge.gruen { background: rgba(61, 220, 132, 0.12); border-color: rgba(61, 220, 132, 0.4); color: var(--gruen); }
.badge.gelb { background: rgba(245, 196, 81, 0.12); border-color: rgba(245, 196, 81, 0.45); color: var(--gelb); }
.badge.rot { background: rgba(255, 92, 92, 0.12); border-color: rgba(255, 92, 92, 0.45); color: var(--rot); }
.badge.grau { color: var(--text-2); }

/* Seitenkarte (Übersicht) */
.seitenkarte { display: flex; flex-direction: column; gap: 10px; position: relative; }
.seitenkarte .titel { display: flex; align-items: center; gap: 10px; }
.seitenkarte .titel h3 { margin: 0; font-size: 1.1rem; }
.seitenkarte .titel h3 a { color: var(--text); }
.seitenkarte .titel h3 a:hover { color: var(--gold); text-decoration: none; }
.seitenkarte .kunde { color: var(--text-2); font-size: 0.9rem; }
.seitenkarte .url { color: var(--text-2); font-size: 0.9rem; word-break: break-all; }
.seitenkarte .fakten { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 12px; font-size: 0.9rem; }
.seitenkarte .fakten dt { color: var(--text-2); font-weight: 500; }
.seitenkarte .fakten dd { margin: 0; font-weight: 600; }
.seitenkarte .fakten div { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dashed var(--rand); padding: 2px 0; }
.seitenkarte .sparkline { width: 100%; height: 42px; display: block; }
.seitenkarte .sparkline polyline { fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.seitenkarte .sparkline .flaeche { fill: rgba(224, 172, 43, 0.12); stroke: none; }
.seitenkarte .sparkline .ausfall { fill: var(--rot); }
.seitenkarte .fuss { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: auto; }
.seitenkarte .fuss .gruende { flex-basis: 100%; color: var(--text-2); font-size: 0.85rem; }
.seitenkarte.ausgeblendet { display: none; }

.werkzeugleiste { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.werkzeugleiste input[type="search"] { flex: 1 1 240px; }
.filter { display: flex; gap: 6px; flex-wrap: wrap; }
.filter button { padding: 6px 10px; }
.filter button.aktiv { border-color: var(--gold); color: var(--gold); }

/* Formulare */
label { display: block; font-weight: 600; font-size: 0.92rem; margin-bottom: 4px; color: var(--text-2); }
input[type="text"], input[type="search"], input[type="url"], input[type="password"], input[type="email"],
input[type="number"], input[type="date"], input[type="datetime-local"], select, textarea {
  width: 100%; padding: 9px 12px; border-radius: var(--radius-klein);
  border: 1px solid var(--rand-hell); background: #101014; color: var(--text);
  font: inherit; font-weight: 500; line-height: 1.4;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--gold); box-shadow: var(--fokus); }
textarea { min-height: 96px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: 18px; height: 18px; accent-color: var(--gold); vertical-align: middle; cursor: pointer; }
.feld { margin-bottom: 14px; }
.feld .hinweis { color: var(--text-2); font-size: 0.85rem; margin-top: 4px; }
.feld-zeile { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.kontrollkaestchen { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text); }
fieldset { border: 1px solid var(--rand); border-radius: var(--radius); padding: 12px 16px; margin: 0 0 16px; }
legend { padding: 0 8px; color: var(--gold); font-weight: 700; }

/* Tabellen */
.tabelle-huelle { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
th, td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--rand); vertical-align: top; }
th { color: var(--text-2); font-weight: 700; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.04em; position: sticky; top: 0; background: var(--karte); }
tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
td.zahl, th.zahl { text-align: right; font-variant-numeric: tabular-nums; }

/* Hinweise */
.hinweis-kasten {
  border: 1px solid var(--rand-hell); border-left: 4px solid var(--gold);
  background: rgba(224, 172, 43, 0.06); border-radius: var(--radius-klein); padding: 12px 16px; margin: 0 0 16px;
}
.hinweis-kasten.fehler { border-left-color: var(--rot); background: rgba(255, 92, 92, 0.08); }
.hinweis-kasten.erfolg { border-left-color: var(--gruen); background: rgba(61, 220, 132, 0.08); }
.hinweis-kasten.warnung { border-left-color: var(--gelb); background: rgba(245, 196, 81, 0.08); }
.hinweis-kasten p:last-child { margin-bottom: 0; }

/* Tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--rand); margin-bottom: 20px; overflow-x: auto; }
.tabs a {
  padding: 10px 14px; color: var(--text-2); font-weight: 600; white-space: nowrap;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.aktiv { color: var(--gold); border-bottom-color: var(--gold); }

/* Zeitleiste (Protokoll) */
.zeitleiste { list-style: none; margin: 0; padding: 0; }
.zeitleiste .tag { margin: 22px 0 8px; color: var(--gold); font-weight: 700; font-size: 0.9rem; text-transform: uppercase; letter-spacing: 0.05em; }
.zeitleiste .tag:first-child { margin-top: 0; }
.ereignis {
  display: grid; grid-template-columns: 64px 28px 1fr; gap: 10px; align-items: start;
  padding: 8px 0; border-bottom: 1px solid var(--rand);
}
.ereignis .zeit { color: var(--text-2); font-variant-numeric: tabular-nums; font-size: 0.9rem; }
.ereignis .symbol { text-align: center; font-size: 1.05rem; }
.ereignis .titel { font-weight: 600; }
.ereignis .meta { color: var(--text-2); font-size: 0.85rem; }
.ereignis details { margin-top: 4px; }
.ereignis details summary { cursor: pointer; color: var(--gold); font-size: 0.85rem; }
.ereignis pre { background: #101014; border: 1px solid var(--rand); border-radius: var(--radius-klein); padding: 8px 12px; font-size: 0.82rem; overflow-x: auto; white-space: pre-wrap; word-break: break-word; }

/* Verfügbarkeit */
.balken30 { display: grid; grid-template-columns: repeat(30, 1fr); gap: 3px; align-items: end; height: 64px; }
.balken30 div { background: var(--gruen); border-radius: 2px; min-height: 4px; }
.balken30 div.gelb { background: var(--gelb); }
.balken30 div.rot { background: var(--rot); }
.balken30 div.grau { background: var(--rand-hell); }
.balken30-legende { display: flex; justify-content: space-between; color: var(--text-2); font-size: 0.8rem; margin-top: 6px; }
.verlauf svg { width: 100%; height: 180px; display: block; }
.verlauf polyline { fill: none; stroke: var(--gold); stroke-width: 1.5; }
.verlauf .achse { stroke: var(--rand-hell); stroke-width: 1; }
.verlauf text { fill: var(--text-2); font-size: 11px; }
.verlauf .ausfall { fill: var(--rot); }

/* Fortschritt / Aufgaben */
.fortschritt-panel {
  position: fixed; right: 20px; bottom: 20px; z-index: 30; max-width: 380px; width: calc(100% - 40px);
  background: var(--karte); border: 1px solid var(--gold); border-radius: var(--radius); padding: 14px 18px;
  box-shadow: var(--schatten);
}
.fortschritt-panel h4 { margin: 0 0 4px; color: var(--gold); }
.fortschritt-panel .text { color: var(--text-2); font-size: 0.9rem; }
.fortschritt-panel .laufbalken { height: 4px; background: var(--rand); border-radius: 2px; overflow: hidden; margin-top: 10px; }
.fortschritt-panel .laufbalken span { display: block; height: 100%; width: 40%; background: var(--gold); border-radius: 2px; animation: laufen 1.4s ease-in-out infinite; }
.fortschritt-panel.fehler { border-color: var(--rot); }
.fortschritt-panel.fehler h4 { color: var(--rot); }
.fortschritt-panel.ok { border-color: var(--gruen); }
.fortschritt-panel.ok h4 { color: var(--gruen); }
@keyframes laufen { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

.status-marke { font-weight: 700; }
.status-marke.offen { color: var(--text-2); }
.status-marke.laeuft { color: var(--gold); }
.status-marke.ok { color: var(--gruen); }
.status-marke.fehler { color: var(--rot); }

/* Prüfliste (Sicherheit) */
.pruefliste { list-style: none; margin: 0; padding: 0; }
.pruefliste li { display: grid; grid-template-columns: 24px 1fr; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rand); }
.pruefliste .ampel { margin-top: 6px; }
.pruefliste .empfehlung { color: var(--text-2); font-size: 0.9rem; }

/* Anmeldung */
.anmelden-huelle { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.anmelden { width: 100%; max-width: 400px; }
.anmelden .marke { justify-content: center; margin-bottom: 20px; font-size: 1.15rem; }
.anmelden .marke img { height: 40px; }
.anmelden h1 { font-size: 1.3rem; text-align: center; }

/* Fehlerseite */
.fehlerseite { max-width: 560px; margin: 60px auto; text-align: center; }
.fehlerseite .code { font-size: 4rem; font-weight: 800; color: var(--gold); line-height: 1; }

/* Toast */
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 40;
  background: var(--karte-hell); border: 1px solid var(--rand-hell); color: var(--text);
  padding: 10px 18px; border-radius: 999px; box-shadow: var(--schatten); font-weight: 600;
}
.toast.fehler { border-color: var(--rot); color: var(--rot); }

/* Fußzeile */
.fuss { text-align: center; color: var(--text-2); font-size: 0.85rem; padding: 30px 0 0; }

/* Definitionsliste */
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; }
.dl dt { color: var(--text-2); font-weight: 600; }
.dl dd { margin: 0; }

/* Bericht (Leistungsnachweis) */
.bericht { max-width: 900px; margin: 0 auto; padding: 32px 24px; }
.bericht .werkzeuge { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; align-items: end; }
.bericht header.bericht-kopf { display: flex; justify-content: space-between; align-items: flex-end; border-bottom: 2px solid var(--gold); padding-bottom: 12px; margin-bottom: 24px; }
.bericht .wortmarke { font-size: 1.4rem; font-weight: 800; letter-spacing: 0.01em; }
.bericht .wortmarke span { color: var(--gold); }
.bericht .kennzahlen { grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); }
.bericht h2 { margin-top: 28px; border-bottom: 1px solid var(--rand); padding-bottom: 6px; }
.bericht footer { margin-top: 40px; padding-top: 12px; border-top: 1px solid var(--rand); color: var(--text-2); font-size: 0.85rem; display: flex; justify-content: space-between; }

@media print {
  @page { size: A4; margin: 16mm 14mm; }
  html, body { background: #fff !important; color: #111 !important; font-size: 11pt; font-weight: 400; }
  .kopf, .nav, .werkzeuge, .knopf, .toast, .fortschritt-panel, .kein-druck { display: none !important; }
  .bericht { max-width: none; padding: 0; }
  .bericht header.bericht-kopf { border-bottom-color: #b8891c; }
  .bericht .wortmarke span { color: #b8891c; }
  .kennzahl, .karte { background: #fff !important; border-color: #ccc !important; box-shadow: none !important; color: #111 !important; }
  .kennzahl .wert, .kennzahl .wert.gold { color: #111 !important; }
  .kennzahl .label, .stumm, .bericht footer, .ereignis .zeit, .ereignis .meta { color: #444 !important; }
  h1, h2, h3, h4 { color: #111 !important; }
  .bericht h2 { border-bottom-color: #ccc; page-break-after: avoid; }
  th { background: #f3f3f3 !important; color: #222 !important; }
  th, td { border-bottom-color: #ddd; }
  .ereignis { border-bottom-color: #e5e5e5; page-break-inside: avoid; }
  .zeitleiste .tag { color: #b8891c; }
  a { color: #111; text-decoration: none; }
  .badge { border-color: #999; color: #222; background: none; }
  .balken30 div { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}

/* Responsiv */
@media (max-width: 720px) {
  .kopf-innen { padding: 8px 14px; gap: 10px; }
  .nav a { padding: 6px 9px; font-size: 0.9rem; }
  .inhalt { padding: 16px 14px 50px; }
  h1 { font-size: 1.45rem; }
  .seitenkopf .aktionen { margin-left: 0; }
  .karte { padding: 14px 16px; }
  .ereignis { grid-template-columns: 52px 24px 1fr; gap: 8px; }
  .dl { grid-template-columns: 1fr; gap: 2px 0; }
  .dl dt { margin-top: 8px; }
  .fortschritt-panel { right: 10px; bottom: 10px; width: calc(100% - 20px); }
}
@media (max-width: 400px) {
  .raster { grid-template-columns: 1fr; }
  .seitenkarte .fakten { grid-template-columns: 1fr; }
}

/* Ergänzungen (Formularbreite, QR-Code, Tabellen-Beschriftung) */
.voll { width: 100%; }
.knopf-zeile.mitte { justify-content: center; }
.qr { display: flex; justify-content: center; padding: 12px 0; }
.qr svg { width: 220px; height: 220px; max-width: 100%; background: var(--karte); border-radius: var(--radius-klein); }
table caption { caption-side: top; text-align: left; padding: 12px 0 4px; font-weight: 700; }
.seitenkopf h1 .ampel, h1 .ampel { vertical-align: middle; margin-right: 8px; }
.hinweis-kasten ul, .hinweis-kasten ol { margin: 0 0 0 1.2em; padding: 0; }
.karte ol, .karte ul { padding-left: 1.2em; margin: 0 0 1em; }
.karte li { margin-bottom: 4px; }
.bericht .rechts { text-align: right; }

/* ------------------------------------------------------------------ *
 * Kunden, Verträge, Abbuchungen (SPEC-2 §7 bis §10)                   *
 * ------------------------------------------------------------------ */

.abstand-oben { margin-top: 8px; }
.knopf-zeile.rechts { justify-content: flex-end; }
tfoot th { background: var(--karte-hell); color: var(--text); font-size: 0.9rem; text-transform: none; letter-spacing: 0; }
td .ampel { margin-right: 6px; }

/* Bestätigungsdialoge: alles, was Geld bewegt, läuft hierdurch */
dialog.dialog {
  width: min(560px, calc(100% - 32px));
  border: 1px solid var(--gold);
  border-radius: var(--radius);
  background: var(--karte);
  color: var(--text);
  padding: 20px 22px;
  box-shadow: var(--schatten);
}
dialog.dialog::backdrop { background: rgba(6, 6, 8, 0.72); }
dialog.dialog h2 { color: var(--gold); margin-top: 0; }
dialog.dialog .dl { margin: 12px 0 16px; }
dialog.dialog .knopf-zeile { margin-top: 16px; }
dialog.dialog .hinweis-kasten { margin-bottom: 0; }
/* Rückfall für Browser ohne <dialog>: das Formular steht dann einfach als Kasten da */
dialog.dialog:not([open]) { display: none; }

/* Vertragsvorschau: weißes Papier im dunklen Rahmen */
.vertrag-papier {
  background: #fff;
  color: #111;
  border: 1px solid var(--rand-hell);
  border-radius: var(--radius-klein);
  padding: 28px 32px;
  max-height: 70vh;
  overflow: auto;
  font-size: 0.95rem;
  line-height: 1.55;
}
.vertrag-papier h1, .vertrag-papier h2, .vertrag-papier h3, .vertrag-papier h4 { color: #111; }
.vertrag-papier a { color: #111; text-decoration: underline; }
.vertrag-papier table { color: #111; font-size: 0.9rem; }
.vertrag-papier th, .vertrag-papier td { border-bottom: 1px solid #ddd; background: none; color: #111; position: static; text-transform: none; letter-spacing: 0; }
.vertrag-papier hr { border: none; border-top: 1px solid #ddd; }

/* Vorlagen-Editor */
textarea.quelltext { min-height: 420px; font-family: var(--mono); font-size: 0.85rem; line-height: 1.5; white-space: pre; }

@media (max-width: 720px) {
  .vertrag-papier { padding: 16px 18px; max-height: none; }
  dialog.dialog { padding: 16px; }
}
