/* Tarifoptimierung im Adminbereich – Premium-Optik der Kundenseite,
   dabei weiterhin als kompakte Arbeitsoberfläche nutzbar. */
#toptBox {
  --topt-navy: #081f3a;
  --topt-navy-2: #0d3155;
  --topt-gold: #e8b94f;
  --topt-gold-hell: #fff6dc;
  --topt-gruen: #00713a;
  --topt-gruen-dunkel: #00582d;
  --topt-rot: #a12c26;
  --topt-alt: #fff2f1;
  --topt-neu: #edf8f1;
  --topt-linie: #d7dfdb;
  --topt-text-2: #5c6874;
  --topt-shadow: 0 12px 34px rgba(8, 31, 58, .09);
  min-width: 0;
  color: #172330;
}

#toptBox * { box-sizing: border-box; }

.topt-subtabs {
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
  padding: 7px;
  border: 1px solid var(--topt-linie);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(8,31,58,.06);
}
.topt-subtabs button {
  min-height: 42px;
  padding: 9px 18px;
  border: 0;
  border-radius: 11px;
  color: var(--topt-navy);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  transition: .16s ease;
}
.topt-subtabs button:hover { background: #eef3f6; }
.topt-subtabs button.an {
  color: #fff;
  background: linear-gradient(135deg, var(--topt-navy), var(--topt-navy-2));
  box-shadow: 0 7px 18px rgba(8,31,58,.18);
}

.topt-karte {
  position: relative;
  min-width: 0;
  overflow-x: auto;
  margin-bottom: 18px;
  padding: 20px 22px;
  border: 1px solid var(--topt-linie);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--topt-shadow);
}
.topt-karte::before {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: 0;
  height: 3px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, var(--topt-gruen), transparent 72%);
  opacity: .8;
}
.topt-karte h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--topt-navy);
  font-size: 21px;
  line-height: 1.25;
}
.topt-listenkarte { padding: 22px 24px; }
.topt-vorlagen-filter {
  display: grid; grid-template-columns: minmax(180px, 240px) minmax(280px, 420px);
  justify-content: start; gap: 12px; align-items: start; margin-bottom: 12px;
}
.topt-vorlagen-filter label { display: grid; grid-template-rows: auto 48px; gap: 5px; }
.topt-vorlagen-filter label > span {
  color: var(--topt-text-2); font-size: 11px; font-weight: 800;
  letter-spacing: .025em; text-transform: uppercase;
}
.topt-vorlagen-filter select,
.topt-vorlagen-filter input {
  width: 100%; height: 48px; min-width: 0; box-sizing: border-box; margin: 0 !important; padding: 10px 11px;
  border: 1px solid var(--topt-linie); border-radius: 9px;
  color: var(--vm-text, var(--topt-navy)); background: var(--vm-surface, #fff); font: inherit;
}
.topt-fallkopf {
  background: linear-gradient(135deg, #fff, #f4faf6);
}
.topt-fallkopf-haupt {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}
.topt-fallart-label {
  display: inline-flex; align-items: center; min-height: 34px; padding: 5px 13px;
  border-radius: 999px; font-size: 14px; font-weight: 850; line-height: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.25);
}
.topt-fallart-tarifoptimierung { color: #fff; background: var(--topt-gruen); }
.topt-fallart-angebot { color: var(--topt-navy); background: var(--topt-gold); }
.topt-fallart-umdeckung { color: #fff; background: var(--topt-navy); }
/* Kleinere Variante fuer die Fallliste - dort steht das Label in einer Zelle. */
.topt-fallart-klein { min-height: 26px; padding: 3px 10px; font-size: 12px; white-space: nowrap; }
/* Typ-Kennzeichen der Umdeckungs-Vorlage in der Bibliotheksliste. */
.topt-tag-umdeckung { color: #fff; background: var(--topt-navy); }

/* Schalter: Jahresbetraege statt rechnerischer Monatswerte. */
.topt-jahresschalter {
  display: flex; align-items: center; gap: 10px; margin: 14px 0 4px; padding: 11px 14px;
  border: 1px solid var(--topt-linie); border-radius: 12px; background: #fff; cursor: pointer;
}
.topt-jahresschalter input { width: 18px; height: 18px; flex: 0 0 auto; }
.topt-jahresschalter span { font-size: 14px; }
.topt-jahresschalter i { color: var(--topt-gruen); font-style: normal; font-weight: 700; }

/* ---------------------------------------------------------------------------
   Umdeckung: Gesellschafts-Bibliothek, Logo-Auswahl und Wertung je Zeile.
   --------------------------------------------------------------------------- */
.topt-editor-umdeckung { border-left: 4px solid var(--topt-navy); }
.topt-editor-bereich-fremd { background: #f6f8fa; }
/* Auswahl und Logo stehen nebeneinander - stuende das Logo darunter, waere das
   Feld hoeher als seine Nachbarn und die ganze Zeile liefe auseinander. */
#teFremdGes { display: flex; align-items: center; gap: 10px; }
#teFremdGes select { flex: 1 1 auto; min-width: 0; }
.topt-fremdlogo { flex: 0 0 auto; display: flex; align-items: center; max-width: 120px; }
.topt-fremdlogo img { width: auto; max-width: 120px; height: 26px; object-fit: contain; }
.topt-fremdlogo .topt-hinweis { font-size: 11px; line-height: 1.25; }

/* Wertungsspalte: vier Stufen, immer nur eine aktiv. */
.topt-wertungsspalte { width: 148px; }
.topt-wertungszelle { vertical-align: middle; }
.topt-wertung { display: inline-flex; gap: 3px; }
.topt-wertung-btn {
  min-width: 30px; min-height: 30px; padding: 3px 6px; border: 1px solid var(--topt-linie);
  border-radius: 8px; background: #fff; color: #52606d; font: inherit; font-size: 14px;
  font-weight: 800; line-height: 1; cursor: pointer;
}
.topt-wertung-btn:hover { border-color: var(--topt-navy); }
.topt-wertung-btn.aktiv { color: #fff; background: var(--topt-navy); border-color: var(--topt-navy); }
.topt-wertung-top.aktiv { color: var(--topt-navy); background: var(--topt-gold); border-color: #c99a2c; }
.topt-wertung-besser.aktiv { background: var(--topt-gruen); border-color: var(--topt-gruen); }
.topt-wertung-schlechter.aktiv { background: #962d27; border-color: #962d27; }
.topt-bilanz-hinweis { margin-top: 8px; }

.topt-gesellschaft-neu { align-items: flex-end; }
.topt-gesellschaft-suche { max-width: 520px; margin-top: 14px; }
.topt-gesellschaftsliste { min-width: 1050px; table-layout: fixed; }
.topt-gesellschaftsliste .topt-ges-col-logo { width: 110px; }
.topt-gesellschaftsliste .topt-ges-col-aktionen { width: 650px; }
.topt-gesellschaftsliste td { vertical-align: middle; }
.topt-gesellschaftsliste td.topt-knoepfe {
  flex-wrap: nowrap;
  white-space: nowrap;
  margin: 0;
}
.topt-gesellschaftsliste td.topt-knoepfe .topt-btn { flex: 0 0 auto; }
.topt-gesellschaft-logo img { width: auto; max-width: 100px; height: 28px; object-fit: contain; }
.topt-gesellschaft-name { width: 100%; }
/* Datei-Auswahl sieht aus wie ein Knopf, das echte Feld bleibt unsichtbar. */
.topt-datei-knopf { display: inline-flex; align-items: center; cursor: pointer; }
.topt-vertragskarte {
  overflow: hidden;
  border-left: 4px solid var(--topt-gruen);
}
.topt-vertragskarte::before { display: none; }
.topt-vertragskarte.aktiv {
  margin-bottom: 8px;
  border-color: var(--topt-gold);
  border-left-color: var(--topt-gruen);
  box-shadow: 0 10px 28px rgba(8,31,58,.13), 0 0 0 3px rgba(232,185,79,.12);
}
#tvEditor:empty { display: none; }
#tvEditor .topt-editor { margin-top: 0; }
.topt-importkarte {
  background: linear-gradient(145deg, #fff, #f8fbfa);
}
.topt-produkt-hinzufuegen { margin: 14px 0 22px; }
.topt-editor-fallart {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-left: 4px solid var(--topt-gruen);
  border-radius: 0 8px 8px 0;
  background: var(--topt-neu);
}
.topt-editor {
  border: 2px solid #9cc7ae;
  background: linear-gradient(180deg, #fbfefc, #fff 120px);
  box-shadow: 0 18px 45px rgba(8,31,58,.14);
}
.topt-editor::before {
  left: 0;
  right: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--topt-gruen), var(--topt-gold));
  opacity: 1;
}
.topt-editor-titel {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 16px;
}
.topt-editor-titel h3 { margin: 2px 0 0; font-size: 25px; }
.topt-editor-kicker {
  color: var(--topt-gruen);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.topt-editor-bereich {
  margin: 12px 0;
  padding: 15px 16px 16px;
  border: 1px solid #d8e1dc;
  border-radius: 16px;
  background: linear-gradient(135deg, #fff, #f8fbf9);
  box-shadow: 0 6px 18px rgba(8,31,58,.055);
}
.topt-editor-bereich-kopf {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}
.topt-editor-bereich-kopf > span {
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  color: #fff;
  background: var(--topt-navy);
  font-size: 10px;
  font-weight: 900;
}
.topt-editor-bereich-kopf b { display: block; color: var(--topt-navy); font-size: 14px; }
.topt-editor-bereich-kopf small { display: block; margin-top: 1px; color: var(--topt-text-2); font-size: 10px; }
.topt-editor-bereich .topt-feldz { margin: 8px 0 0; }
.topt-editor-bereich .f { display: flex; min-width: 0; flex-direction: column; }
.topt-editor-bereich .f label {
  display: flex;
  min-height: 20px;
  align-items: flex-end;
  margin-bottom: 5px;
  white-space: nowrap;
}
.topt-editor-bereich input,
.topt-editor-bereich select { min-height: 48px; }
.topt-editor-bereich-tarif {
  background: linear-gradient(90deg, rgba(255,242,241,.72), #fff 42%, #fff 58%, rgba(237,248,241,.82));
}
.topt-alt-feld input { border-color: #e5bdb9; background: #fff9f8; }
.topt-neu-feld input { border-color: #abd3b9; background: #f7fcf9; }
.topt-final-feld input {
  border: 2px solid #6eae87;
  color: var(--topt-gruen-dunkel);
  background: #effaf3;
  font-weight: 850;
}
.topt-tarifpfeil {
  display: grid;
  width: 42px;
  height: 48px;
  align-self: end;
  place-items: center;
  border-radius: 14px;
  color: var(--topt-navy);
  background: linear-gradient(135deg, #f5d681, var(--topt-gold));
  box-shadow: 0 6px 14px rgba(166,112,5,.18);
  font-size: 20px;
  font-weight: 900;
}
.topt-beitragsbilanz {
  margin: 12px 0 0;
  padding: 10px 12px;
  border-left: 4px solid var(--topt-gold);
  border-radius: 0 10px 10px 0;
  color: var(--topt-text-2);
  background: #fff9ea;
  font-size: 12px;
}

.topt-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);
}
.topt-st-entwurf { background: #6c7680; }
.topt-st-aktiv, .topt-st-veroeffentlicht { background: var(--topt-gruen); }
.topt-st-archiviert { color: #46515b; background: #dce1df; }
.topt-st-widerrufen { background: var(--topt-rot); }
.topt-st-abgeschlossen { background: #1e7a46; }
/* Abgeschlossene Faelle: Zeile leicht gruen, Button deaktiviert-gruen */
.topt-fallliste tr.topt-zeile-fertig td { background: #e8f5ec; }
/* Aktionsknoepfe in der Fallliste immer in einer Flucht, egal wie viele
   optionale Knoepfe (z.B. Info) in der jeweiligen Zeile dazukommen. */
.topt-aktionen { display: flex; align-items: center; gap: 6px; flex-wrap: nowrap; white-space: nowrap; }
.topt-btn-fertig[disabled] { opacity: 1; color: #1e7a46; background: #d3ecda; border-color: #b3dcc0; cursor: default; }

/* Tabellen bleiben horizontal scrollbar, nutzen auf großen Bildschirmen aber
   die volle Arbeitsbreite. */
.topt-tabelle {
  display: table;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  margin: 10px 0;
  border: 1px solid var(--topt-linie);
  border-radius: 13px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-size: 14px;
  scrollbar-color: #9aa9a1 #eef2f0;
}
.topt-tabelle th {
  padding: 10px 11px;
  border: 0;
  border-bottom: 1px solid #29425c;
  color: #fff;
  background: var(--topt-navy);
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .015em;
  white-space: nowrap;
}
.topt-tabelle td {
  padding: 9px 10px;
  border: 0;
  border-bottom: 1px solid #e5eae7;
  vertical-align: top;
}
.topt-tabelle tr:last-child td { border-bottom: 0; }
.topt-tabelle tr:hover td { background-color: #fafcfb; }
.topt-tabelle th.topt-th-resize {
  position: relative;
  min-width: 120px;
  max-width: none;
  overflow: visible;
  padding-right: 18px;
}
.topt-spalten-griff {
  position: absolute;
  z-index: 4;
  top: 0;
  right: -6px;
  bottom: 0;
  width: 13px;
  cursor: col-resize;
  touch-action: none;
}
.topt-spalten-griff::before {
  content: "";
  position: absolute;
  top: 7px;
  bottom: 7px;
  left: 6px;
  width: 2px;
  border-radius: 2px;
  background: rgba(255,255,255,.72);
  box-shadow: 0 0 0 1px rgba(8,31,58,.18);
}
.topt-spalten-griff:hover::before,
.topt-spalten-griff:active::before { width: 4px; left: 5px; background: var(--topt-gold); }
body.topt-spalten-ziehen,
body.topt-spalten-ziehen * { cursor: col-resize !important; user-select: none !important; }
.topt-tabelle th.topt-th-fix { white-space: nowrap; }
.topt-vergleichstabelle th.topt-sortierspalte {
  width: 128px;
  min-width: 128px;
  max-width: 128px;
  position: sticky;
  z-index: 8;
  left: 0;
}
.topt-vergleichstabelle td.topt-sortierzelle {
  width: 128px;
  min-width: 128px;
  max-width: 128px;
  display: flex;
  align-items: flex-start;
  flex-wrap: nowrap;
  gap: 4px;
  white-space: nowrap;
  position: sticky;
  z-index: 6;
  left: 0;
  background: #fff;
}
.topt-sortierzelle .topt-btn {
  flex: 0 0 34px;
  width: 34px;
  min-width: 34px;
  padding-right: 0;
  padding-left: 0;
}
/* Drag-Griff zum Zeilen-Verschieben */
.topt-zeilen-griff {
  flex: 0 0 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  min-height: 34px;
  cursor: grab;
  color: #9aa8a1;
  font-size: 16px;
  line-height: 1;
  border-radius: 6px;
  touch-action: none;
  user-select: none;
}
.topt-zeilen-griff:hover { color: var(--topt-gruen); background: #eef4f0; }
.topt-zeilen-griff:active { cursor: grabbing; }
/* Zeile darunter einfügen + löschen */
.topt-vergleichstabelle td.topt-aktionszelle {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  white-space: nowrap;
}
.topt-aktionszelle .topt-btn { width: 100%; }
.topt-btn.gruen {
  background: linear-gradient(135deg, var(--topt-gruen), #008849);
  box-shadow: 0 5px 13px rgba(0,113,58,.15);
  color: #fff;
}
/* Feedback beim Ziehen */
body.topt-zeilen-ziehen, body.topt-zeilen-ziehen * { cursor: grabbing !important; user-select: none !important; }
.topt-vergleichstabelle tr.topt-zeile-zieht td { opacity: .45; }
.topt-vergleichstabelle tr.topt-drop-ziel td { box-shadow: inset 0 3px 0 var(--topt-gold); }
.topt-tabelle input[type="text"],
.topt-tabelle textarea,
.topt-tabelle select {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid #c8d2cd;
  border-radius: 8px;
  background: #fff;
  font: inherit;
  font-size: 14px;
}
.topt-tabelle textarea { min-height: 54px; resize: vertical; }
.topt-tabelle input:focus,
.topt-tabelle textarea:focus,
.topt-tabelle select:focus,
.topt-feldz input:focus,
.topt-feldz textarea:focus,
.topt-feldz select:focus {
  outline: 3px solid rgba(232,185,79,.28);
  border-color: #b78a22;
}

.topt-aenderungstabelle th:first-child { min-width: 250px; }
.topt-aenderungstabelle th:nth-child(5) { min-width: 260px; }
.topt-aenderungstabelle th:nth-child(6) { min-width: 220px; }
.topt-aend-bezeichnung select,
.topt-bildzelle select { margin-bottom: 6px; background: #fff; }
.topt-bildzelle { min-width: 220px; }
.topt-bildzelle input[type="file"] { display: block; width: 100%; margin: 7px 0; font-size: 12px; }
.topt-videoquelle { min-width: 290px; }
.topt-videoquelle select,
.topt-videoquelle > input[type="text"] { margin-bottom: 7px; }
.topt-video-upload {
  display: block;
  color: var(--topt-text-2);
  font-size: 12px;
  font-weight: 700;
}
.topt-video-upload input[type="file"] {
  display: block;
  width: 100%;
  margin-top: 5px;
  font-size: 12px;
}
.topt-video-upload-knopf {
  position: relative;
  display: inline-block; width: auto; margin: 2px 0 7px; padding: 8px 13px;
  border-radius: 9px; background: var(--vm-primary, var(--topt-gruen)); color: #fff;
  font-weight: 700; cursor: pointer;
}
.topt-video-upload-knopf:hover { background: var(--vm-primary-strong, var(--topt-gruen-dunkel)); }
.topt-video-upload-knopf input[type="file"] {
  position: absolute; width: 1px; height: 1px; margin: 0; opacity: 0; pointer-events: none;
}
.topt-videoquelle small {
  display: block;
  margin-top: 5px;
  color: var(--topt-text-2);
  white-space: normal;
}
.topt-video-vorschaubild {
  display: grid;
  grid-template-columns: 92px minmax(100px, 1fr);
  align-items: center;
  gap: 7px 10px;
  margin-top: 8px;
}
.topt-video-vorschaubild img {
  width: 92px;
  aspect-ratio: 16 / 9;
  grid-row: 1 / 3;
  border: 1px solid var(--topt-linie);
  border-radius: 7px;
  background: #000;
  object-fit: contain;
}
.topt-video-vorschaubild small { margin: 0; overflow-wrap: anywhere; }
.topt-video-vorschaubild .topt-btn { justify-self: start; }
.topt-bildzelle small {
  display: block;
  max-width: 210px;
  margin: 4px 0;
  overflow: hidden;
  color: var(--topt-text-2);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.topt-bildvorschau {
  display: block;
  width: 210px;
  max-width: 100%;
  height: 110px;
  margin-bottom: 7px;
  border: 1px solid var(--topt-linie);
  border-radius: 10px;
  background: #f7f7f4;
  object-fit: contain;
}
.topt-vergleichstabelle th:nth-child(2) { min-width: 280px; }
.topt-vergleichstabelle { table-layout: fixed; }
.topt-vergleichstabelle td:nth-child(2) {
  position: sticky;
  z-index: 5;
  left: 100px;
  background: #fff;
}
.topt-vergleichstabelle th.topt-th-leistung-fix {
  width: 380px;
  min-width: 120px;
  z-index: 7;
  background: var(--topt-navy);
}
.topt-vergleichstabelle th:nth-child(3),
.topt-vergleichstabelle th:nth-child(4) { min-width: 180px; }
.topt-vergleichstabelle th:nth-child(3),
.topt-vergleichstabelle th:nth-child(4) { width: 240px; }
.topt-vergleichstabelle th:last-child,
.topt-vergleichstabelle td:last-child {
  width: 42px !important;
  min-width: 42px !important;
  max-width: 42px !important;
  overflow: hidden;
  padding-right: 0;
  padding-left: 0;
  text-align: center;
  white-space: nowrap;
}
.topt-vergleichstabelle td:last-child .topt-btn { width: 42px; min-width: 42px; padding-right: 0; padding-left: 0; }
.topt-vergleichstabelle th:nth-child(3) { color: #742721; background: #f0cbc8; }
.topt-vergleichstabelle th:nth-child(4) { color: var(--topt-gruen-dunkel); background: #cce8d5; }
.topt-vergleichstabelle td:nth-child(3) { background: var(--topt-alt); }
.topt-vergleichstabelle td:nth-child(4) { color: var(--topt-gruen-dunkel); background: var(--topt-neu); font-weight: 700; }
/* Produkt-Steckbrief: nur eine Wertspalte -> Spalte 3 ist der neue Wert. */
.topt-vergleichstabelle.topt-nur-neu th:nth-child(3) { color: var(--topt-gruen-dunkel); background: #cce8d5; }
.topt-vergleichstabelle.topt-nur-neu td:nth-child(3) { color: var(--topt-gruen-dunkel); background: var(--topt-neu); font-weight: 700; }

.topt-feldz {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 10px 0;
}
.topt-feldz .f { flex: 1; min-width: 170px; }
.topt-feldz .f.klein { flex: 0 1 140px; min-width: 110px; }
.topt-feldz .topt-neuer-fall-art { flex: 0 0 230px; min-width: 230px; }
.topt-feldz label {
  display: block;
  margin: 0 0 5px;
  color: #4c5965;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .025em;
  text-transform: uppercase;
}
.topt-feldz input,
.topt-feldz select,
.topt-feldz textarea {
  width: 100%;
  padding: 10px 11px;
  border: 1px solid #c8d2cd;
  border-radius: 9px;
  color: #172330;
  background: #fff;
  font: inherit;
  font-size: 14px;
}
.topt-feldz textarea { resize: vertical; }

/* Pflege des persoenlichen Nachlass-Kontingents im Kundenfall. */
.topt-kontingent-pflege {
  margin: 16px 0;
  padding: 18px;
  border: 1px solid #e7c66e;
  border-radius: 16px;
  background: linear-gradient(135deg, #fffdf7, #fff6dd);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.9);
}
.topt-kontingent-pflege-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.topt-kontingent-kicker {
  display: block;
  margin-bottom: 4px;
  color: #936600;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.topt-kontingent-pflege h4 { margin: 0; color: var(--topt-navy); font-size: 19px; }
.topt-kontingent-pflege-kopf p { margin: 4px 0 0; color: var(--topt-text-2); font-size: 12px; }
.topt-kontingent-schalter {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 13px;
  border: 1px solid #d8b85d;
  border-radius: 999px;
  color: var(--topt-gruen-dunkel);
  background: #fff;
  font-size: 12px;
  font-weight: 850;
  cursor: pointer;
  white-space: nowrap;
}
.topt-kontingent-schalter input { width: 19px; height: 19px; accent-color: var(--topt-gruen); }
.topt-kontingent-felder {
  display: grid;
  grid-template-columns: minmax(150px, .45fr) minmax(235px, .8fr) minmax(240px, 1fr);
  gap: 12px;
  align-items: end;
  margin-top: 14px;
}
.topt-kontingent-felder .f label {
  display: block; margin: 0 0 5px; color: #4c5965;
  font-size: 11px; font-weight: 800; letter-spacing: .025em; text-transform: uppercase;
}
.topt-kontingent-felder input {
  width: 100%; min-height: 42px; padding: 9px 11px;
  border: 1px solid #c8d2cd; border-radius: 9px; color: #172330; background: #fff; font: inherit;
}
.topt-kontingent-felder input:disabled { color: #8a9299; background: #f3f4f3; }
.topt-kontingent-info {
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--topt-gruen-dunkel);
  background: rgba(0,113,58,.08);
}
.topt-kontingent-info strong { white-space: nowrap; }
.topt-kontingent-info span { color: #52606d; font-size: 12px; }
.topt-kontingent-hinweis { margin: 10px 0 0; color: #735815; font-size: 12px; }
.topt-beitragskopf label {
  min-height: 30px;
  display: flex;
  align-items: flex-end;
  line-height: 1.15;
  overflow-wrap: anywhere;
  white-space: normal;
}

/* Allgemeine Rabattierung: Vertrags-, Beitrags- und Erklaerungsdaten bleiben
   in drei klaren Ebenen lesbar. Kfz-spezifische Felder werden nur dort gezeigt. */
.topt-rabatt-liste {
  display: grid;
  gap: 12px;
  width: 100%;
  margin: 10px 0;
}
.topt-rabatt-fahrzeug {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--topt-linie);
  border-radius: 13px;
  background: #fff;
}
.topt-rabatt-ebene {
  display: grid;
  min-width: 0;
  gap: 10px;
  padding: 12px;
}
.topt-rabatt-stammdaten {
  grid-template-columns: minmax(175px,.9fr) minmax(260px,1.6fr) minmax(150px,.8fr) minmax(170px,.9fr);
  background: #f8faf9;
}
.topt-rabatt-beitrag {
  grid-template-columns: repeat(4, minmax(135px,.75fr)) minmax(160px,.8fr) minmax(245px,1.35fr);
  align-items: end;
  border-top: 1px solid var(--topt-linie);
}
.topt-rabatt-zusatz {
  grid-template-columns: minmax(155px,.75fr) minmax(140px,.65fr) minmax(260px,1.5fr) minmax(220px,1fr) 82px 46px;
  align-items: end;
  border-top: 1px solid var(--topt-linie);
}
.topt-rabatt-feld,
.topt-rabatt-ersparnis,
.topt-rabatt-zeigen { min-width: 0; }
.topt-rabatt-feld > span,
.topt-rabatt-ersparnis > span {
  display: block;
  margin: 0 0 5px;
  color: var(--topt-text-2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .025em;
  text-transform: uppercase;
}
.topt-rabatt-stammdaten .topt-rabatt-feld > span {
  min-height: 2.7em;
  display: flex;
  align-items: flex-end;
  line-height: 1.2;
}
.topt-rabatt-feld input,
.topt-rabatt-feld select {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 8px 9px;
  border: 1px solid #c8d2cd;
  border-radius: 8px;
  background: #fff;
  font: inherit;
}
.topt-rabatt-ersparnis {
  min-height: 42px;
  padding: 2px 0;
}
.topt-rabatt-ersparnis strong { color: var(--topt-gruen-dunkel); font-size: 16px; }
.topt-rabatt-anrechnung {
  min-height: 58px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 8px 11px;
  border: 1px solid var(--topt-linie);
  border-radius: 9px;
  background: #f7faf9;
}
.topt-rabatt-anrechnung strong { font-size: 12px; }
.topt-rabatt-anrechnung span { color: var(--topt-text-2); font-size: 11px; line-height: 1.35; }
.topt-rabatt-anrechnung.ist-enthalten { border-color: #8bb8ca; background: #eef8fb; }
.topt-rabatt-anrechnung.ist-zusaetzlich { border-color: #8dc8a9; background: #eff9f3; }
.topt-rabatt-anrechnung.ist-offen { border-color: #d9b55d; background: #fff9e9; }
.topt-rabatt-zeigen {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding-bottom: 7px;
  font-size: 12px;
  font-weight: 750;
}
.topt-rabatt-zeigen input { width: 18px; height: 18px; }
.topt-rabatt-loeschen { width: 44px; min-width: 44px; height: 44px; padding: 0; }
.topt-rabatt-fehler { margin: 0; padding: 0 12px 12px; }
.topt-feldz.topt-editor-grid { display: grid; align-items: end; }
.topt-editor-grid .f,
.topt-editor-grid .f.klein { min-width: 0; }
.topt-stammdaten { grid-template-columns: minmax(260px, 1.5fr) minmax(190px, .9fr) minmax(90px, .38fr) minmax(280px, 1.45fr); }
.topt-tarifdaten { grid-template-columns: minmax(210px, 1.25fr) minmax(120px, .55fr) 42px minmax(210px, 1.25fr) minmax(120px, .55fr) minmax(170px, .75fr); }
.topt-beitragsdaten { grid-template-columns: minmax(240px, 1.35fr) minmax(260px, 1.45fr) repeat(3, minmax(150px, .7fr)); }
.topt-beitragskopf { grid-template-columns: minmax(210px, 1.05fr) minmax(240px, 1.2fr) repeat(3, minmax(145px, .72fr)); }
/* Umdeckung: bisheriger Versicherer + Wechseltermine, je Sektion eine Zeile. */
.topt-fremddaten { grid-template-columns: minmax(220px, 1fr) minmax(220px, 1.2fr) minmax(140px, .6fr); }
.topt-wechseltermine { grid-template-columns: repeat(3, minmax(150px, 1fr)); }

.topt-btn {
  min-height: 38px;
  padding: 8px 14px;
  border: 0;
  border-radius: 9px;
  color: #fff;
  background: linear-gradient(135deg, var(--topt-gruen), #008849);
  box-shadow: 0 5px 13px rgba(0,113,58,.16);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease;
}
.topt-btn:hover:not(:disabled) {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 7px 18px rgba(0,113,58,.22);
}
.topt-btn.grau {
  color: var(--topt-navy);
  background: #edf1ef;
  box-shadow: none;
}
.topt-btn.grau:hover:not(:disabled) { background: #e3e9e6; box-shadow: none; }
.topt-btn.rot { background: linear-gradient(135deg, #b1201a, #d30000); box-shadow: 0 5px 13px rgba(180,0,0,.15); }
.topt-btn.klein { min-height: 32px; padding: 6px 10px; font-size: 12px; }
.topt-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
/* Knopf, der nur ein Symbol traegt (interne Vorschau): quadratisch statt breit. */
.topt-btn-nur-icon { display: inline-flex; align-items: center; justify-content: center; padding-inline: 8px; }
.topt-btn-icon { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.topt-btn:not(.grau) .topt-btn-icon { color: #fff; }
.topt-knoepfe { display: flex; flex-wrap: wrap; gap: 7px; margin: 12px 0 5px; }
.topt-karte h3 .topt-knoepfe { margin: 0; }
#toptNeuFall, #tvlNeu, #tfPublish {
  color: var(--topt-navy);
  background: linear-gradient(135deg, #f1cb70, #dfa52d);
  box-shadow: 0 7px 18px rgba(161,111,10,.20);
}

.topt-speicherleiste {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(760px, calc(100% - 28px));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 13px 15px;
  border: 2px solid var(--topt-gold);
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--topt-navy), var(--topt-navy-2));
  box-shadow: 0 16px 40px rgba(8,31,58,.32);
}
.topt-speicherleiste[hidden] { display: none; }
.topt-speicherleiste .topt-knoepfe { margin: 0; }
.topt-speicherleiste .topt-btn.grau { background: #fff; }

.topt-paste {
  margin: 12px 0;
  padding: 18px;
  border: 2px dashed #6fa888;
  border-radius: 14px;
  color: #28543d;
  background:
    linear-gradient(135deg, rgba(255,255,255,.72), transparent),
    var(--topt-neu);
  outline: 0;
  text-align: center;
  font-size: 14px;
  transition: .16s ease;
}
.topt-paste:hover, .topt-paste:focus {
  border-color: var(--topt-gold);
  border-style: solid;
  box-shadow: 0 0 0 4px rgba(232,185,79,.14);
}
.topt-paste.klein { padding: 12px; font-size: 13px; }

.topt-hinweis { margin: 7px 0; color: #6a7580; font-size: 12px; line-height: 1.45; }
.topt-spalten-hinweis {
  margin: 10px 0 6px;
  color: #52606d;
  font-size: 12px;
  font-weight: 650;
}
.topt-fehler { margin: 7px 0; color: #b00000; font-size: 13px; }
.topt-ok { margin: 7px 0; color: var(--topt-gruen); font-size: 13px; font-weight: 700; }
.topt-warn { margin: 7px 0; color: #956300; font-size: 13px; }
.topt-fehlerliste {
  margin: 10px 0;
  padding: 12px 16px 12px 34px;
  border: 1px solid #edb7b3;
  border-left: 5px solid var(--topt-rot);
  border-radius: 12px;
  color: #8f1610;
  background: #fff1f0;
  font-size: 13px;
}
.topt-tag {
  display: inline-block;
  margin: 1px 2px;
  padding: 3px 8px;
  border: 1px solid #c7ded0;
  border-radius: 999px;
  color: var(--topt-gruen-dunkel);
  background: var(--topt-neu);
  font-size: 11px;
  font-weight: 750;
}
.topt-tag-neu {
  border-color: #e3c98c;
  color: #5c4405;
  background: #fff5d9;
}

/* Umschalter: Tarifumstellung (alt -> neu) oder reine Produktvorstellung. */
.topt-modus {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 12px 0 6px;
  padding: 5px;
  border: 1px solid var(--topt-linie);
  border-radius: 13px;
  background: #f6f8fa;
}
.topt-modus button {
  min-height: 38px;
  padding: 8px 15px;
  border: 0;
  border-radius: 9px;
  color: var(--topt-navy);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  transition: .16s ease;
}
.topt-modus button:hover { background: #e7eef3; }
.topt-modus button.an {
  color: #fff;
  background: linear-gradient(135deg, var(--topt-navy), var(--topt-navy-2));
  box-shadow: 0 5px 14px rgba(8,31,58,.18);
}
.topt-editor-produkt .topt-editor-kicker { color: #8a6a08; }

.topt-summen {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin: 15px 0;
}
.topt-summe {
  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: 14px 12px;
  border: 1px solid var(--topt-linie);
  border-radius: 13px;
  background: #fff;
  box-shadow: 0 7px 18px rgba(8,31,58,.06);
  text-align: left;
}
.topt-summe::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--topt-navy);
}
.topt-summe .l { color: var(--topt-text-2); font-size: 11px; }
.topt-summe .w {
  margin-top: 4px;
  color: var(--topt-navy);
  font-size: 19px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.topt-summe .w.plus { color: var(--topt-rot); }
.topt-summe .w.minus { color: var(--topt-gruen-dunkel); }
.topt-summe-angebot { max-width: 340px; border-color: color-mix(in srgb, var(--topt-gold) 60%, var(--topt-linie)); }
.topt-summe-angebot::before { background: var(--topt-gold); }


.topt-vertragkopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  cursor: pointer;
}
.topt-link {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-bottom: 8px;
  color: var(--topt-navy);
  cursor: pointer;
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}
.topt-link:hover { color: var(--topt-gruen); }
.topt-linkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 9px 0;
  padding: 11px 13px;
  border: 1px solid #bcd6c6;
  border-radius: 11px;
  color: #254d38;
  background: var(--topt-neu);
  font-size: 13px;
  word-break: break-all;
}

/* --- Veroeffentlichung: je eine Kachel pro Kanal (Kunde / Berater) ---
   Aufbau bewusst identisch zur Rentenoptimierung, nur mit topt-Variablen. */
.topt-kanal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 14px; }
.topt-kanal {
  display: flex; flex-direction: column; gap: 11px;
  padding: 16px;
  border: 1px solid var(--topt-linie); border-radius: 13px;
  background: var(--topt-flaeche-2, #f7fafb);
}
.topt-kanal.an { border-color: color-mix(in srgb, var(--topt-gruen) 45%, var(--topt-linie)); }
.topt-kanal p { margin: 0; }
.topt-kanal-kopf { display: flex; align-items: center; gap: 10px; }
.topt-kanal-kopf strong { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 800; }
.topt-kanal-icon {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  color: var(--topt-soft-text, #00582d); background: var(--topt-soft, #e4f4ea);
}
.topt-kanal-svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Link-Block nach unten druecken, damit die Aktionen beider Kacheln fluchten. */
.topt-kanal-link { display: flex; flex-direction: column; gap: 7px; margin-top: auto; }
.topt-kanal-linkzeile { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.topt-kanal-linkzeile > span { color: var(--topt-text-2); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.topt-kanal-leer { color: var(--topt-text-2); font-size: 12.5px; font-style: italic; }
.topt-kanal-aktionen { display: flex; gap: 7px; flex-wrap: wrap; }
.topt-kanal code { padding: 1px 4px; border-radius: 4px; background: var(--topt-flaeche-3, #eaf2f4); font-size: 12px; }

.topt-url {
  display: block;
  padding: 9px 11px;
  border: 1px solid var(--topt-linie); border-radius: 9px;
  color: var(--topt-soft-text, #00582d); background: var(--topt-flaeche-3, #eaf2f4);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px; line-height: 1.4;
  overflow-wrap: anywhere; text-decoration: none;
}
.topt-url:hover { border-color: var(--topt-gruen); text-decoration: underline; }

.topt-pille {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 11.5px; font-weight: 750; white-space: nowrap;
}
.topt-pille.an { color: var(--topt-soft-text, #00582d); background: var(--topt-soft, #e4f4ea); }
.topt-pille.aus { color: var(--topt-text-2); background: var(--topt-flaeche-3, #eaf2f4); }
.topt-punkt { width: 7px; height: 7px; flex: none; border-radius: 50%; background: currentColor; }

/* Veroeffentlichungs-Verlauf: eingeklappt, Chips statt Fliesstext. */
.topt-historie { margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--topt-linie); }
.topt-historie summary { display: flex; align-items: center; gap: 7px; color: var(--topt-text-2); font-size: 12.5px; font-weight: 700; cursor: pointer; list-style: none; }
.topt-historie summary::-webkit-details-marker { display: none; }
.topt-historie summary::before { content: "\203A"; display: inline-block; font-size: 15px; transition: transform .16s ease; }
.topt-historie[open] summary::before { transform: rotate(90deg); }
.topt-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }
.topt-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--topt-linie); border-radius: 7px;
  color: var(--topt-text-2); background: var(--topt-flaeche-2, #f7fafb);
  font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.topt-chip b { color: inherit; font-weight: 800; }
.topt-chip.an { color: var(--topt-soft-text, #00582d); border-color: color-mix(in srgb, var(--topt-gruen) 45%, var(--topt-linie)); background: var(--topt-soft, #e4f4ea); }

/* Rabattmassnahmen auch im Backend als bewusstes Highlight. */
.topt-kfz-backend {
  isolation: isolate;
  overflow: hidden;
  border: 1px solid #d6a331;
  background:
    radial-gradient(circle at 92% 8%, rgba(255,255,255,.92), transparent 20%),
    linear-gradient(135deg, #fffaf0, #f8e2aa);
  box-shadow: 0 16px 42px rgba(145,99,7,.16);
}
/* Glanz-Animation nur auf der Kundenseite, nicht im Backend. */
.topt-kfz-backend::before { content: none; }
.topt-kfz-backend h3::before { content: "✦"; margin-right: 3px; color: #b67f0c; }
.topt-kfz-backend h3,
.topt-publish-karte h3 { justify-content: flex-start; }
.topt-kfz-backend h3 .topt-hinweis { margin-left: auto; }

.topt-publish-karte {
  border-color: #b7c6d2;
  background: linear-gradient(135deg, #fff, #f5f9fc);
}
.topt-publish-karte::before {
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--topt-navy), var(--topt-gold));
  opacity: 1;
}
.topt-publish-karte h3::before { content: "↗"; margin-right: 8px; color: var(--topt-gruen); }

/* Erinnerungs-Popup: liegt ausserhalb von #toptBox in der Browser-Top-Layer. */
.topt-kontingent-dialog {
  width: min(940px, calc(100% - 28px));
  max-height: calc(100vh - 28px);
  overflow: auto;
  padding: 0;
  border: 0;
  border-radius: 22px;
  color: #172330;
  background: #fff;
  box-shadow: 0 28px 90px rgba(8,31,58,.35);
}
.topt-kontingent-dialog::backdrop { background: rgba(8,31,58,.72); backdrop-filter: blur(5px); }
.topt-kontingent-dialog-kopf {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  align-items: center;
  gap: 20px;
  padding: 26px 30px;
  border-bottom: 1px solid #efd794;
  background: radial-gradient(circle at 10% 30%, rgba(0,113,58,.10), transparent 28%), linear-gradient(135deg, #fffdf8, #fff4d7);
}
.topt-kontingent-dialog.dringend .topt-kontingent-dialog-kopf { background: radial-gradient(circle at 10% 30%, rgba(0,113,58,.13), transparent 28%), linear-gradient(135deg, #fffaf0, #ffe7a8); }
.topt-kontingent-dialog-siegel {
  width: 106px;
  height: 106px;
  display: grid;
  place-items: center;
  border: 8px solid #f1c34f;
  border-radius: 50%;
  color: #fff;
  background: #008f4b;
  text-align: center;
  box-shadow: 0 12px 28px rgba(0,113,58,.18);
}
.topt-kontingent-dialog-siegel strong { display: block; font-size: 29px; line-height: .95; }
.topt-kontingent-dialog-siegel span { display: block; margin-top: 7px; font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.topt-kontingent-dialog-kicker { display: block; margin-bottom: 5px; color: #936600; font-size: 11px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.topt-kontingent-dialog-kopf h2 { margin: 0; color: #081f3a; font-size: clamp(23px, 3vw, 31px); line-height: 1.12; }
.topt-kontingent-dialog-kopf p { margin: 8px 0 0; color: #5c6874; line-height: 1.5; }
.topt-kontingent-dialog-zu {
  align-self: start;
  width: 44px;
  height: 44px;
  border: 1px solid #d4dad7;
  border-radius: 50%;
  color: #081f3a;
  background: rgba(255,255,255,.9);
  cursor: pointer;
  font-size: 25px;
  line-height: 1;
}
.topt-kontingent-dialog-body { padding: 24px 30px 28px; }
.topt-kontingent-fakten { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-bottom: 20px; }
.topt-kontingent-fakt { min-width: 0; padding: 13px 14px; border: 1px solid #dce3df; border-radius: 12px; background: #f8faf9; }
.topt-kontingent-fakt span { display: block; margin-bottom: 4px; color: #6a7580; font-size: 10px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.topt-kontingent-fakt strong { display: block; overflow-wrap: anywhere; color: #081f3a; font-size: 14px; }
.topt-kontingent-mail { padding: 18px; border: 1px solid #bfd8c9; border-radius: 15px; background: #f4faf6; }
.topt-kontingent-mail h3 { margin: 0 0 4px; color: #00582d; font-size: 18px; }
.topt-kontingent-mail > p { margin: 0 0 13px; color: #5c6874; font-size: 12px; }
.topt-kontingent-mail label { display: block; margin: 10px 0 5px; color: #4c5965; font-size: 10px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.topt-kontingent-mail input,
.topt-kontingent-mail textarea {
  width: 100%; padding: 10px 11px; border: 1px solid #c7d3cc; border-radius: 9px; color: #172330; background: #fff; font: inherit;
}
.topt-kontingent-mail textarea { min-height: 210px; resize: vertical; line-height: 1.5; }
.topt-kontingent-vorlage { margin-top: 14px; padding-top: 12px; border-top: 1px solid #cee0d5; }
.topt-kontingent-vorlage summary { color: #00582d; cursor: pointer; font-size: 13px; font-weight: 850; }
.topt-kontingent-vorlage textarea { min-height: 180px; }
.topt-kontingent-platzhalter { color: #6a7580; font-size: 11px; line-height: 1.5; }
.topt-kontingent-dialog-aktionen { display: flex; align-items: center; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.topt-kontingent-dialog-aktionen button {
  min-height: 44px; padding: 10px 15px; border: 0; border-radius: 10px; cursor: pointer; font: inherit; font-size: 13px; font-weight: 800;
}
.topt-kontingent-dialog-aktionen .haupt { color: #fff; background: linear-gradient(135deg, #00713a, #008d49); box-shadow: 0 7px 18px rgba(0,113,58,.20); }
.topt-kontingent-dialog-aktionen .sekundaer { color: #081f3a; background: #edf1ef; }
.topt-kontingent-dialog-aktionen .gold { color: #081f3a; background: linear-gradient(135deg, #f1cb70, #dfa52d); }
.topt-kontingent-dialog-status { margin-left: auto; color: #00582d; font-size: 12px; font-weight: 750; }

@media (max-width: 760px) {
  .topt-vorlagen-filter { grid-template-columns: 1fr; }
  .topt-subtabs { overflow-x: auto; }
  .topt-subtabs button { flex: 1 0 auto; padding-inline: 13px; }
  .topt-karte, .topt-listenkarte { padding: 16px; border-radius: 15px; }
  .topt-karte::before { left: 14px; right: 14px; }
  .topt-feldz .f { min-width: 100%; }
  .topt-feldz.topt-editor-grid { grid-template-columns: 1fr; }
  .topt-editor-titel { align-items: center; }
  .topt-editor-bereich { padding: 13px; }
  .topt-editor-bereich .f label { min-height: 0; white-space: normal; }
  .topt-tarifpfeil { display: none; }
  .topt-speicherleiste { align-items: flex-start; flex-direction: column; }
  .topt-speicherleiste .topt-knoepfe { width: 100%; }
  .topt-speicherleiste .topt-btn { flex: 1; }
  .topt-linkbox { align-items: stretch; flex-direction: column; }
  .topt-kontingent-pflege-kopf { align-items: flex-start; flex-direction: column; }
  .topt-kontingent-felder { grid-template-columns: 1fr; }
  .topt-kontingent-info { align-items: flex-start; flex-direction: column; }
  .topt-kontingent-dialog-kopf { grid-template-columns: 82px minmax(0, 1fr) auto; gap: 12px; padding: 20px; }
  .topt-kontingent-dialog-siegel { width: 78px; height: 78px; border-width: 6px; }
  .topt-kontingent-dialog-siegel strong { font-size: 22px; }
  .topt-kontingent-dialog-siegel span { margin-top: 4px; font-size: 8px; }
  .topt-kontingent-dialog-body { padding: 18px 20px 22px; }
  .topt-kontingent-fakten { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topt-kontingent-dialog-status { width: 100%; margin-left: 0; }

  /* Vergleichszeilen mobil als Karten statt als breite Eingabetabelle. */
  .topt-editor { overflow-x: visible; }
  .topt-vergleichstabelle {
    display: block;
    width: 100% !important;
    min-width: 0 !important;
    border: 0;
    border-radius: 0;
    background: transparent;
  }
  .topt-vergleichstabelle tbody { display: grid; gap: 10px; }
  .topt-vergleichstabelle tr:first-child { display: none; }
  .topt-vergleichstabelle tr:not(:first-child) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    overflow: hidden;
    border: 1px solid #b7c5bd;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 5px 15px rgba(8,31,58,.06);
  }
  .topt-vergleichstabelle tr:not(:first-child):hover td { background-color: inherit; }
  .topt-vergleichstabelle td {
    display: block;
    width: auto !important;
    min-width: 0;
    max-width: none;
    position: static;
    padding: 10px;
    border: 0;
  }
  .topt-vergleichstabelle td::before {
    display: block;
    margin-bottom: 4px;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .06em;
    text-transform: uppercase;
  }
  .topt-vergleichstabelle td:nth-child(2) {
    grid-column: 1 / -1;
    order: 1;
    border-bottom: 1px solid #d8dfdb;
    background: #fff;
  }
  .topt-vergleichstabelle td:nth-child(2)::before { content: "Leistung"; color: var(--topt-navy); }
  .topt-vergleichstabelle td:nth-child(3) { order: 2; background: var(--topt-alt); }
  .topt-vergleichstabelle td:nth-child(3)::before { content: "Alter Tarif"; color: #7a2923; }
  .topt-vergleichstabelle td:nth-child(4) { order: 3; background: var(--topt-neu); }
  .topt-vergleichstabelle td:nth-child(4)::before { content: "Neuer Tarif"; color: var(--topt-gruen-dunkel); }
  .topt-vergleichstabelle.topt-nur-neu td:nth-child(3) { background: var(--topt-neu); }
  .topt-vergleichstabelle.topt-nur-neu td:nth-child(3)::before { content: "Ihr Schutz"; color: var(--topt-gruen-dunkel); }
  .topt-vergleichstabelle td:first-child,
  .topt-vergleichstabelle td:last-child {
    display: flex;
    align-items: center;
    gap: 4px;
    order: 5;
    border-top: 1px solid #d8dfdb;
    background: #f7f9f8;
  }
  .topt-vergleichstabelle td:first-child { grid-column: 1; }
  .topt-vergleichstabelle td:last-child { grid-column: 2; justify-content: flex-end; }
}

@media (min-width: 761px) and (max-width: 1150px) {
  .topt-feldz.topt-editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topt-tarifpfeil { display: none; }
}

@media (max-width: 900px) {
  .topt-rabatt-stammdaten,
  .topt-rabatt-beitrag { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topt-rabatt-fahrzeugname { grid-column: 1 / -1; }
  .topt-rabatt-zusatz { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
  .topt-rabatt-ersparnis { grid-column: 1 / -1; }
  .topt-rabatt-zeigen { justify-content: flex-start; }
}

@media (max-width: 520px) {
  .topt-rabatt-stammdaten,
  .topt-rabatt-beitrag,
  .topt-rabatt-zusatz { grid-template-columns: minmax(0,1fr); }
  .topt-rabatt-fahrzeugname,
  .topt-rabatt-ersparnis { grid-column: auto; }
  .topt-rabatt-loeschen { width: 100%; }
  .topt-kontingent-dialog-kopf { grid-template-columns: 72px minmax(0, 1fr); }
  .topt-kontingent-dialog-zu { position: absolute; right: 10px; top: 10px; }
  .topt-kontingent-dialog-kopf > div:nth-child(2) { padding-right: 25px; }
  .topt-kontingent-fakten { grid-template-columns: 1fr; }
  .topt-kontingent-dialog-aktionen button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  #toptBox *, #toptBox *::before, #toptBox *::after { animation: none !important; transition: none !important; }
}
