/* Rentenoptimierung im Adminbereich. Das Layout folgt bewusst exakt der
   Tarifoptimierung; nur Inhalte und Klassenpraefix sind rentenspezifisch. */
#roptBox {
  --ropt-navy: #081f3a;
  --ropt-navy-2: #0d3155;
  --ropt-gold: #e8b94f;
  --ropt-gruen: #00713a;
  --ropt-gruen-dunkel: #00582d;
  --ropt-rot: #a12c26;
  --ropt-linie: #d7dfdb;
  --ropt-text-2: #5c6874;
  /* Abgestufte Flaechen innerhalb einer Karte (Kachel / Feld) + gruene Akzentflaeche.
     Dunkelmodus setzt dieselben Namen in manager-ui.css neu. */
  --ropt-flaeche-2: #f7fafb;
  --ropt-flaeche-3: #eaf2f4;
  --ropt-soft: #e4f4ea;
  --ropt-soft-text: #00582d;
  --ropt-shadow: 0 12px 34px rgba(8, 31, 58, .09);
  min-width: 0;
  color: #172330;
}
#roptBox * { box-sizing: border-box; }

.ropt-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.ropt-rechner-cta {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: fit-content;
  min-height: 58px;
  padding: 9px 13px;
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 17px;
  color: #fff;
  background: linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.08));
  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: left;
  font: inherit;
  transition: transform .16s ease, background .16s ease, border-color .16s ease;
}
.ropt-rechner-cta:hover {
  transform: translateY(-2px);
  border-color: rgba(255,255,255,.56);
  background: linear-gradient(135deg, rgba(255,255,255,.24), rgba(255,255,255,.12));
}
.ropt-rechner-cta:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.ropt-rechner-cta-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  color: #063b42;
  background: #8be9e2;
  box-shadow: 0 6px 16px rgba(0,31,35,.2);
}
.ropt-rechner-cta-icon svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.ropt-rechner-cta-text { min-width: 0; }
.ropt-rechner-cta-text strong { display: block; font-size: 14.5px; line-height: 1.2; white-space: nowrap; }
.ropt-rechner-cta-text small {
  display: block;
  margin-top: 2px;
  color: rgba(255,255,255,.78);
  font-size: 10.5px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ropt-rechner-dialog {
  position: relative;
  width: min(1060px, calc(100vw - 24px));
  height: min(900px, calc(100dvh - 24px));
  max-height: calc(100dvh - 24px);
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: #eefbff;
  background: transparent !important;
  box-shadow: none;
  overflow: hidden;
}
.ropt-rechner-dialog::backdrop {
  background: rgba(2,13,18,.76);
  backdrop-filter: blur(8px);
}
.ropt-renten-overlay {
  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;
  background: rgba(2,13,18,.68) !important;
  backdrop-filter: blur(8px);
  box-shadow: none;
  overflow: hidden;
}
.ropt-renten-overlay[open] { display: grid; }
.ropt-renten-overlay .ropt-rechner-shell {
  width: min(1060px, calc(100vw - 24px));
  height: min(900px, calc(100dvh - 24px));
}
.ropt-renten-overlay .ropt-rechner-shell,
.ropt-renten-overlay iframe { background: transparent !important; }
.ropt-renten-overlay iframe { filter: drop-shadow(0 24px 34px rgba(0,0,0,.42)); }
.ropt-rechner-shell { display: flex; flex-direction: column; width: 100%; height: 100%; background: transparent !important; }
.ropt-rechner-kopf {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 70px;
  padding: 12px 16px 12px 22px;
  border-bottom: 1px solid rgba(161,220,235,.14);
  background: linear-gradient(120deg, #0b3039, #08736f);
}
.ropt-rechner-kopf span {
  display: block;
  color: #9bdad9;
  font-size: 10px;
  font-weight: 850;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.ropt-rechner-kopf strong { display: block; margin-top: 2px; color: #fff; font-size: 18px; }
.ropt-rechner-kopf button {
  flex: none;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 12px;
  color: #fff;
  background: rgba(0,26,31,.26);
  cursor: pointer;
  font: 300 28px/1 Arial, sans-serif;
}
.ropt-rechner-kopf button:hover { background: rgba(0,26,31,.46); }
.ropt-rechner-kopf button:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.ropt-rechner-dialog iframe {
  display: block;
  flex: none;
  width: 100%;
  height: 100%;
  min-height: 0;
  border: 0;
  background: transparent !important;
}

/* "Die Rentenreise": zweite Kachel im Kopf, schmaler und ohne Pfeil-Spalte
   (nur Icon + Titel) - Hoehe/Innenabstand/Icon-Groesse bleiben wie beim
   Rechner-Knopf, damit beide Kacheln exakt gleich hoch sind. */
.ropt-video-cta { width: min(190px, 100%); margin-left: auto; grid-template-columns: 36px minmax(0, 1fr); }
.ropt-video-cta .ropt-rechner-cta-icon { color: #3c1108; background: #ffc48b; }
.ropt-video-dialog { height: min(80dvh, 760px); }
.ropt-video-dialog #roptVideoBox { display: flex; flex: 1 1 auto; min-height: 0; }
.ropt-video-dialog video,
.ropt-video-dialog iframe {
  display: block; flex: 1 1 auto; width: 100%; min-height: 0; border: 0; background: #07131a;
}

.ropt-subtabs {
  display: flex;
  gap: 8px;
  margin: 0 0 18px;
  padding: 7px;
  border: 1px solid var(--ropt-linie);
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 7px 22px rgba(8,31,58,.06);
}
.ropt-subtabs button {
  min-height: 42px;
  padding: 9px 18px;
  border: 0;
  border-radius: 11px;
  color: var(--ropt-navy);
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 750;
  transition: .16s ease;
}
.ropt-subtabs button:hover { background: #eef3f6; }
.ropt-subtabs button.an {
  color: #fff;
  background: linear-gradient(135deg, var(--ropt-navy), var(--ropt-navy-2));
  box-shadow: 0 7px 18px rgba(8,31,58,.18);
}

.ropt-karte {
  position: relative;
  min-width: 0;
  margin-bottom: 18px;
  padding: 20px 22px;
  border: 1px solid var(--ropt-linie);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--ropt-shadow);
  overflow-x: auto;
}
.ropt-karte::before {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  top: 0;
  height: 3px;
  border-radius: 0 0 8px 8px;
  background: linear-gradient(90deg, var(--ropt-gruen), transparent 72%);
  opacity: .8;
}
.ropt-karte h3 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 14px;
  color: var(--ropt-navy);
  font-size: 21px;
  line-height: 1.25;
}
.ropt-listenkarte { padding: 22px 24px; }
.ropt-fallkopf { margin-bottom: 4px; background: linear-gradient(135deg, #fff, #f4faf6); }
.ropt-fallkopf h2 { margin: 0 0 6px; font-size: 22px; }

.ropt-tabelle {
  display: table;
  width: 100%;
  min-width: 100%;
  max-width: 100%;
  margin: 10px 0;
  border: 1px solid var(--ropt-linie);
  border-radius: 13px;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  font-size: 14px;
}
.ropt-tabelle th {
  padding: 10px 11px;
  border: 0;
  border-bottom: 1px solid #29425c;
  color: #fff;
  background: var(--ropt-navy);
  text-align: left;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .015em;
  white-space: nowrap;
}
.ropt-tabelle td { padding: 9px 10px; border: 0; border-bottom: 1px solid #e5eae7; vertical-align: top; }
.ropt-tabelle tr:last-child td { border-bottom: none; }
.ropt-tabelle tr:hover td { background-color: #fafcfb; }

.ropt-pill { display: inline-flex; align-items: center; min-height: 24px; border-radius: 999px; padding: 3px 10px; font-size: 11px; font-weight: 850; color: #fff; vertical-align: middle; box-shadow: inset 0 1px 0 rgba(255,255,255,.25); }
.ropt-st-entwurf { background: #6c7680; }
.ropt-st-fertig, .ropt-st-veroeffentlicht, .ropt-st-abgeschlossen { background: #1e7a46; }
.ropt-st-archiviert { color: #46515b; background: #dce1df; }
.ropt-st-widerrufen { background: var(--ropt-rot); }
.ropt-st-neu { background: #b06a00; }
.ropt-st-riester { background: #1f5fa8; }

/* Warnstreifen: Der Fall wird klassisch gerechnet, sieht aber nach Riester aus.
   Bewusst auffaellig und oben im Editor - er verhindert eine falsche Kuendigungs-
   empfehlung (Rueckforderung der Foerderung). */
.ropt-warnstreifen {
  display: grid; grid-template-columns: 30px 1fr auto; gap: 12px; align-items: start;
  margin: 0 0 16px; padding: 14px 16px; border-radius: 14px;
  background: color-mix(in srgb, #d98324 12%, var(--vm-surface));
  border: 1px solid color-mix(in srgb, #d98324 55%, var(--vm-border));
  border-left: 4px solid #d98324;
  font-size: 13px; line-height: 1.55; color: var(--vm-text);
}
.ropt-warnstreifen[hidden] { display: none; }
.ropt-warn-ic {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: 9px; font-size: 16px; font-weight: 900;
  background: color-mix(in srgb, #d98324 25%, transparent); color: #d98324;
}
.ropt-warn-tipp { display: block; margin-top: 6px; color: var(--vm-muted); }
@media (max-width: 720px) {
  .ropt-warnstreifen { grid-template-columns: 30px 1fr; }
  .ropt-warnstreifen > button { grid-column: 2; justify-self: start; }
}

/* Kartentitel der Veroeffentlichung traegt die Status-Pille, Vorschau sitzt rechts. */
.ropt-publish-karte h3 > span:first-child { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* Riester-Foerderblock optisch von den Vertragsdaten abheben. */
.ropt-karte-riester { border-left: 4px solid #1f5fa8; }

/* Telefonate (Gespraechsprotokoll aus dem Telefon-Cockpit) im Fall-Formular. */
.ropt-gespraech { padding: 10px 0; border-top: 1px dashed #e5eae7; }
.ropt-gespraech:first-of-type { border-top: 0; }
.ropt-gespraech-notiz { margin: 6px 0 0; padding: 9px 12px; background: #f6f8f7; border-left: 3px solid #1e7a46; border-radius: 0 8px 8px 0; font-size: 13px; color: #333; white-space: pre-line; }

/* Fallart-Wahl im "Neue Analyse"-Dialog: zwei Karten statt Dropdown, damit beim
   Anlegen sofort klar ist, welche Auswertung entsteht. Farben ueber die
   --vm-*-Variablen, damit die Karten in Hell UND Dunkel funktionieren. */
.ropt-modus-wahl { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
/* Drei Fallarten (klassisch | Riester | Neuberatung). Unter 1080px zweispaltig,
   damit die Beschreibungstexte nicht zu Woerterschlangen werden. */
.ropt-modus-wahl-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 1080px) { .ropt-modus-wahl-3 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .ropt-modus-wahl-3 { grid-template-columns: 1fr; } }
.ropt-modus {
  position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 12px;
  align-items: start; text-align: left; font: inherit; cursor: pointer;
  padding: 14px 44px 14px 14px; border-radius: 14px;
  color: var(--vm-text); background: var(--vm-surface);
  border: 1px solid var(--vm-border);
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.ropt-modus:hover { border-color: color-mix(in srgb, var(--vm-primary) 55%, var(--vm-border)); }
.ropt-modus.an {
  border-color: var(--vm-primary);
  background: color-mix(in srgb, var(--vm-primary) 10%, var(--vm-surface));
  box-shadow: 0 0 0 1px var(--vm-primary) inset;
}
/* Auswahl-Haken oben rechts - nur auf der aktiven Karte. */
.ropt-modus::after {
  content: "✓"; position: absolute; top: 12px; right: 12px;
  width: 22px; height: 22px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 900; color: transparent;
  border: 1px solid var(--vm-border); background: transparent; transition: all .15s;
}
.ropt-modus.an::after { color: #032326; border-color: var(--vm-primary); background: var(--vm-primary); }
.ropt-modus-ic {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; border-radius: 10px; font-size: 17px;
  background: color-mix(in srgb, var(--vm-primary) 14%, transparent);
}
.ropt-modus b { display: block; font-size: 14px; line-height: 1.3; margin-bottom: 4px; }
.ropt-modus span.ropt-modus-txt { display: block; font-size: 12.5px; line-height: 1.5; color: var(--vm-muted); }
@media (max-width: 720px) { .ropt-modus-wahl { grid-template-columns: 1fr; } }

@media (max-width: 720px) {
  .ropt-hero { align-items: stretch; flex-direction: column; gap: 14px; }
  .ropt-rechner-cta { width: 100%; min-height: 68px; }
  .ropt-rechner-dialog {
    width: 100vw;
    height: 100dvh;
    border: 0;
    border-radius: 0;
  }
  .ropt-rechner-kopf { min-height: 62px; padding: 9px 10px 9px 15px; }
  .ropt-rechner-kopf strong { font-size: 16px; }
}

.ropt-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 8px 14px; border: 0; border-radius: 9px;
  color: #fff; background: linear-gradient(135deg, var(--ropt-gruen), #008849);
  box-shadow: 0 5px 13px rgba(0,113,58,.16); cursor: pointer; text-decoration: none;
  font: inherit; font-size: 13px; font-weight: 750; line-height: 1.2;
  transition: transform .14s ease, filter .14s ease, box-shadow .14s ease;
}
.ropt-btn:hover:not(:disabled) { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 7px 18px rgba(0,113,58,.22); }
.ropt-btn.klein { min-height: 32px; padding: 6px 10px; font-size: 12px; }
/* Knopf, der nur das Symbol traegt (Vorschau) - quadratisch statt breit. */
.ropt-btn-nur-icon { padding-inline: 8px; }
.ropt-btn.grau { color: var(--ropt-navy); background: #edf1ef; box-shadow: none; }
.ropt-btn.grau:hover:not(:disabled) { background: #e3e9e6; box-shadow: none; }
.ropt-btn.rot { background: linear-gradient(135deg, #b1201a, #d30000); box-shadow: 0 5px 13px rgba(180,0,0,.15); }
.ropt-btn.gruen { background: var(--ropt-gruen); }
.ropt-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.ropt-btn-icon { flex: none; width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ropt-btn:not(.grau) .ropt-btn-icon { color: #fff !important; }
#roptNeuFall, #roptNeuProdukt { color: var(--ropt-navy); background: linear-gradient(135deg, #f1cb70, #dfa52d); box-shadow: 0 7px 18px rgba(161,111,10,.20); }
.ropt-knoepfe { display: flex; gap: 7px; flex-wrap: wrap; align-items: center; margin: 12px 0 5px; }

/* Schwebt oberhalb der fixen "Speichern"-Leiste am Fußende der Fallseite. */
.ropt-speicherleiste {
  position: fixed;
  z-index: 80;
  left: 50%;
  bottom: 86px;
  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(--ropt-gold);
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--ropt-navy), var(--ropt-navy-2));
  box-shadow: 0 16px 40px rgba(8,31,58,.32);
}
.ropt-speicherleiste[hidden] { display: none; }
.ropt-speicherleiste .ropt-knoepfe { margin: 0; }
.ropt-speicherleiste .ropt-btn.grau { background: #fff; }
.ropt-fallliste th:nth-child(1) { width: 18%; }
/* Art-Spalte nur so breit wie ihr laengster Eintrag; die Marke fuellt sie dann
   ganz aus, damit "Riester" und "Vertrag optimieren" gleich breit wirken.
   Die Aktions-Spalte schrumpft schon ueber wiedervorlage.css auf ihren Inhalt. */
.ropt-fallliste th:nth-child(2), .ropt-fallliste td:nth-child(2) { width: 1%; white-space: nowrap; }
.ropt-fallliste td:nth-child(2) .ropt-art { display: flex; width: 100%; box-sizing: border-box; }
/* Die Knopfzeile bleibt immer einzeilig - Platz kommt aus der Status-Spalte,
   die stattdessen umbrechen darf (siehe wiedervorlage.css). */
.ropt-list-actions { display: flex; gap: 12px; flex-wrap: nowrap; align-items: center; }
.ropt-list-actions-primary, .ropt-list-actions-secondary { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.ropt-list-actions-secondary { padding-left: 12px; border-left: 1px solid #d8e1dc; }

.ropt-hinweis { margin: 7px 0; color: #6a7580; font-size: 12px; line-height: 1.45; }
.ropt-fehler { margin: 7px 0; color: #b00000; font-size: 13px; }
.ropt-ok { margin: 7px 0; color: var(--ropt-gruen); font-size: 13px; font-weight: 700; }
.ropt-fehlerliste { margin: 10px 0; padding: 12px 16px 12px 34px; border: 1px solid #edb7b3; border-left: 5px solid var(--ropt-rot); border-radius: 12px; color: #8f1610; background: #fff1f0; font-size: 13px; }
.ropt-hint { color: #6a7580; font-size: 11px; font-weight: 400; }

.ropt-link { display: inline-flex; align-items: center; min-height: 38px; margin-bottom: 8px; color: var(--ropt-navy); cursor: pointer; font-size: 13px; font-weight: 800; text-decoration: none; }
.ropt-link:hover { color: var(--ropt-gruen); }
/* --- Veroeffentlichung: je eine Kachel pro Kanal (Kunde / Berater) --- */
.ropt-kanal-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); gap: 14px; }
.ropt-kanal {
  display: flex; flex-direction: column; gap: 11px;
  padding: 16px;
  border: 1px solid var(--ropt-linie); border-radius: 13px;
  background: var(--ropt-flaeche-2);
}
.ropt-kanal.an { border-color: color-mix(in srgb, var(--ropt-gruen) 45%, var(--ropt-linie)); }
.ropt-kanal p { margin: 0; }
.ropt-kanal-kopf { display: flex; align-items: center; gap: 10px; }
.ropt-kanal-kopf strong { flex: 1; min-width: 0; font-size: 14.5px; font-weight: 800; }
.ropt-kanal-icon {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border-radius: 10px;
  color: var(--ropt-soft-text); background: var(--ropt-soft);
}
.ropt-kanal-svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Link-Block wird nach unten gedrueckt, damit die Aktionen beider Kacheln fluchten. */
.ropt-kanal-link { display: flex; flex-direction: column; gap: 7px; margin-top: auto; }
.ropt-kanal-linkzeile { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ropt-kanal-linkzeile > span { color: var(--ropt-text-2); font-size: 11px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.ropt-kanal-leer { color: var(--ropt-text-2); font-size: 12.5px; font-style: italic; }
.ropt-kanal-aktionen { display: flex; gap: 7px; flex-wrap: wrap; }
.ropt-kanal code { padding: 1px 4px; border-radius: 4px; background: var(--ropt-flaeche-3); font-size: 12px; }

.ropt-url {
  display: block;
  padding: 9px 11px;
  border: 1px solid var(--ropt-linie); border-radius: 9px;
  color: var(--ropt-soft-text); background: var(--ropt-flaeche-3);
  font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
  font-size: 12.5px; line-height: 1.4;
  overflow-wrap: anywhere; text-decoration: none;
}
.ropt-url:hover { border-color: var(--ropt-gruen); text-decoration: underline; }

.ropt-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;
}
.ropt-pille.an { color: var(--ropt-soft-text); background: var(--ropt-soft); }
.ropt-pille.aus { color: var(--ropt-text-2); background: var(--ropt-flaeche-3); }
.ropt-punkt { width: 7px; height: 7px; flex: none; border-radius: 50%; background: currentColor; }

/* Veroeffentlichungs-Verlauf: eingeklappt, Chips statt Fliesstext. */
.ropt-historie { margin-top: 16px; padding-top: 13px; border-top: 1px solid var(--ropt-linie); }
.ropt-historie summary { display: flex; align-items: center; gap: 7px; color: var(--ropt-text-2); font-size: 12.5px; font-weight: 700; cursor: pointer; list-style: none; }
.ropt-historie summary::-webkit-details-marker { display: none; }
.ropt-historie summary::before { content: "\203A"; display: inline-block; font-size: 15px; transition: transform .16s ease; }
.ropt-historie[open] summary::before { transform: rotate(90deg); }
.ropt-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 11px; }
.ropt-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--ropt-linie); border-radius: 7px;
  color: var(--ropt-text-2); background: var(--ropt-flaeche-2);
  font-size: 11.5px; font-variant-numeric: tabular-nums;
}
.ropt-chip b { color: inherit; font-weight: 800; }
.ropt-chip.an { color: var(--ropt-soft-text); border-color: color-mix(in srgb, var(--ropt-gruen) 45%, var(--ropt-linie)); background: var(--ropt-soft); }

.ropt-feldz {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  align-items: start;
  gap: 12px 16px;
}
.ropt-feldz > .feld { margin-bottom: 0; display: flex; flex-direction: column; }
/* Label darf umbrechen, belegt aber immer zwei Zeilen Hoehe und sitzt unten buendig -
   so beginnen alle Eingabefelder einer Zeile auf derselben Hoehe. */
.ropt-feldz > .feld > label {
  display: flex; align-items: flex-end; min-height: 2.7em; line-height: 1.25;
  white-space: normal; hyphens: auto;
}
.ropt-feldz > .feld > .ropt-hint {
  margin-top: 4px; font-size: 11px; line-height: 1.35; font-weight: 600;
  letter-spacing: 0; text-transform: none; color: #6b7a86;
}
/* Einheit (€, %, Jahre) sitzt im Feld statt als eigene Zeile darunter. */
.feld-eingabe { position: relative; display: block; }
.feld-eingabe .feld-einheit {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-size: 12.5px; font-weight: 700; color: #7b8894; pointer-events: none;
}
.ropt-feldz > .feld > .feld-eingabe.mit-einheit input { padding-right: 42px; }
.ropt-feldz > .feld label,
.ropt-karte > .feld label { display: block; margin: 0 0 5px; color: #4c5965; font-size: 11px; font-weight: 800; letter-spacing: .025em; text-transform: uppercase; }
.ropt-feldz > .feld input,
.ropt-feldz > .feld select,
.ropt-feldz > .feld textarea,
.ropt-karte > .feld input,
.ropt-karte > .feld select,
.ropt-karte > .feld textarea { width: 100%; padding: 10px 11px; border: 1px solid #c8d2cd; border-radius: 9px; color: #172330; background: #fff; font: inherit; font-size: 14px; }
.ropt-feldz input:focus,
.ropt-feldz textarea:focus,
.ropt-feldz select:focus,
.ropt-karte > .feld input:focus,
.ropt-karte > .feld textarea:focus,
.ropt-karte > .feld select:focus { outline: 3px solid rgba(232,185,79,.28); border-color: #b78a22; }

.ropt-calc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.ropt-calc-grid > div { display: flex; flex-direction: column; gap: 4px; }
.ropt-calc-grid b { font-size: 20px; font-variant-numeric: tabular-nums; }
.ropt-vorschau { border-color: #9cc7ae; background: linear-gradient(180deg, #fbfefc, #fff 120px); }
.ropt-pos { color: var(--ropt-gruen); }
.ropt-neg { color: var(--ropt-rot); }

.ropt-kk-zeile { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 0; border-bottom: 1px dashed var(--ropt-linie); }
.ropt-kk-zeile:last-child { border-bottom: none; }
.ropt-kk-zeile > span:last-child { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }

.ropt-email-editor { max-width: 1500px; }
.ropt-email-editor textarea { line-height: 1.55; resize: vertical; }
.ropt-email-editor .ropt-email-haupttext { min-height: 430px; }
.ropt-outlook-bridge {
  display: flex; align-items: center; justify-content: space-between; gap: 18px;
  margin: 16px 0 20px; padding: 14px 16px; border: 1px solid #9cc7ae;
  border-radius: 13px; background: #f4fbf7; color: #243a30; font-size: 13px;
}
.ropt-outlook-bridge code { font-size: 12px; }
.ropt-email-layout {
  display: grid; grid-template-columns: minmax(440px, .9fr) minmax(500px, 1.1fr);
  gap: 24px; align-items: start;
}
.ropt-email-form { display: grid; gap: 14px; min-width: 0; }
.ropt-email-form h4 { margin: 14px 0 0; padding-top: 18px; border-top: 1px solid var(--ropt-linie); }
.ropt-email-platzhalter {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  padding: 13px; border: 1px dashed var(--ropt-linie);
  border-radius: 12px; background: color-mix(in srgb, var(--ropt-gruen) 5%, transparent);
}
.ropt-email-platzhalter > b { width: 100%; color: var(--ropt-text-2); font-size: 12px; }
.ropt-email-preview-wrap {
  position: sticky; top: 16px; min-width: 0; padding: 14px;
  border: 1px solid var(--ropt-linie); border-radius: 14px; background: #eef2f0;
}
.ropt-email-preview-wrap > b { display: block; margin: 0 0 9px; color: #4c5965; font-size: 12px; text-transform: uppercase; }
.ropt-email-preview {
  overflow: hidden; padding: 28px; border: 1px solid #d5d5d5; border-radius: 7px;
  color: #171717; background: #fff; box-shadow: 0 8px 24px rgba(8,31,58,.08);
  font: 15px/1.45 Aptos, Calibri, Arial, sans-serif;
}
.ropt-email-preview-subject { margin: -28px -28px 24px; padding: 13px 18px; border-bottom: 1px solid #ddd; background: #f7f7f7; font-weight: 700; }
.ropt-email-preview-grafik { display: block; width: 100%; height: auto; margin: 12px 0 18px; }
.ropt-email-preview-ertragsbilanz {
  display: inline-block; margin: 4px 0 18px; padding: 22px 26px;
  border: 1.5px solid #c7d3d8; border-radius: 14px; background: #f4f7f8;
}
.ropt-email-preview-ertragsbilanz .titel { font-weight: 700; color: #1c211f; font-size: 15px; }
.ropt-email-preview-ertragsbilanz .sub { margin: 2px 0 12px; color: #5b655f; font-size: 13px; }
.ropt-email-preview-ertragsbilanz .chip {
  display: inline-block; margin: 0 0 14px; padding: 4px 10px;
  border: 1px solid #e9cf9c; border-radius: 5px; background: #fdf3e3;
  color: #a5650f; font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .04em;
}
.ropt-email-preview-ertragsbilanz .num-block {
  display: inline-grid; grid-template-columns: max-content max-content;
  column-gap: 12px; align-items: baseline;
}
.ropt-email-preview-ertragsbilanz .digits,
.ropt-email-preview-ertragsbilanz .einheit {
  font-weight: 800; color: #33495a; font-size: 40px; line-height: 1;
}
.ropt-email-preview-ertragsbilanz .diff-label {
  grid-column: 1; margin-top: 8px; color: #b3432f; font-weight: 700; font-size: 21px;
}
.ropt-email-preview-ertragsbilanz .bezug { margin-top: 16px; color: #1c211f; font-size: 13px; }
.ropt-email-preview-ertragsbilanz .trenner { margin: 14px 0; border-top: 1px dashed #c7d3d8; }
.ropt-email-preview-ertragsbilanz .basis { color: #5b655f; font-size: 12px; }
.ropt-email-preview-gruss { margin-top: 24px; }
.ropt-email-preview-signatur { display: block; width: min(378px, 100%); height: auto; margin: 18px 0 20px; }
.ropt-email-preview-titel { margin: 0 0 26px; font-weight: 800; }
.ropt-email-preview-kontakt { margin-bottom: 28px; }
.ropt-email-preview-recht { margin-bottom: 2px; font-size: 10px; line-height: 1.35; }
.ropt-email-preview a { color: #0000ee; text-decoration: underline; }

/* Gesendete E-Mail: native Dialog-Semantik fuer Fokusfalle, ESC und Tastatur.
   Wird auch von der Tarifoptimierung genutzt (ausserhalb von #roptBox) - deshalb
   hier ueberall Fallback-Werte hinter den --ropt-*-Variablen, sonst laufen sie
   dort ins Leere (transparenter Dialog). */
.ropt-versand-dialog {
  width: min(920px, calc(100vw - 32px));
  max-width: none; max-height: min(92dvh, 980px); margin: auto; padding: 0;
  overflow: hidden; border: 1px solid var(--ropt-linie, #d7dfdb); border-radius: 22px;
  color: #172330; background: var(--ropt-flaeche-2, #f7fafb); box-shadow: 0 32px 90px rgba(0,25,32,.35);
}
.ropt-versand-dialog::backdrop { background: rgba(3,25,31,.66); backdrop-filter: blur(5px); }
.ropt-versand-shell { display: flex; flex-direction: column; max-height: min(92dvh, 980px); }
.ropt-versand-kopf {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 18px;
  padding: 20px 22px 17px; border-bottom: 1px solid var(--ropt-linie, #d7dfdb);
  background: linear-gradient(135deg, var(--ropt-soft, #e4f4ea), #fff);
}
.ropt-versand-kicker {
  color: var(--ropt-gruen, #00713a); font-size: 10px; font-weight: 850;
  letter-spacing: .12em; text-transform: uppercase;
}
.ropt-versand-kopf h2 { margin: 3px 0 4px; color: #123728; font-size: 25px; letter-spacing: -.02em; }
.ropt-versand-kopf p { margin: 0; color: var(--ropt-text-2, #5c6874); font-size: 13px; }
.ropt-versand-kopf-aktionen { display: flex; align-items: center; gap: 8px; }
.ropt-versand-bearbeiten, .ropt-versand-abbrechen, .ropt-versand-speichern {
  min-height: 40px; padding: 0 15px; border: 1px solid var(--ropt-linie, #d7dfdb); border-radius: 11px;
  color: #163a2d; background: #fff; cursor: pointer; font: inherit; font-size: 13px; font-weight: 800;
}
.ropt-versand-bearbeiten:hover, .ropt-versand-abbrechen:hover { border-color: var(--ropt-gruen, #00713a); background: var(--ropt-soft, #e4f4ea); }
.ropt-versand-bearbeiten:focus-visible, .ropt-versand-abbrechen:focus-visible,
.ropt-versand-speichern:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ropt-gruen, #00713a) 38%, transparent); outline-offset: 2px;
}
.ropt-versand-speichern { border-color: var(--ropt-gruen, #00713a); color: #fff; background: var(--ropt-gruen, #00713a); }
.ropt-versand-speichern:hover { filter: brightness(.94); }
.ropt-versand-speichern:disabled { cursor: wait; opacity: .65; }
.ropt-versand-schliessen {
  flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 1px solid var(--ropt-linie, #d7dfdb); border-radius: 12px; color: #263c34;
  background: rgba(255,255,255,.82); cursor: pointer; font: 400 25px/1 Arial, sans-serif;
}
.ropt-versand-schliessen:hover { border-color: var(--ropt-gruen, #00713a); background: #fff; }
.ropt-versand-schliessen:focus-visible { outline: 3px solid color-mix(in srgb, var(--ropt-gruen, #00713a) 38%, transparent); outline-offset: 2px; }
.ropt-versand-inhalt { min-height: 0; overflow-y: auto; padding: 18px; }
.ropt-versand-daten { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
.ropt-versand-daten > div { min-width: 0; padding: 11px 13px; border: 1px solid var(--ropt-linie, #d7dfdb); border-radius: 12px; background: #fff; }
.ropt-versand-daten span { display: block; margin-bottom: 3px; color: var(--ropt-text-2, #5c6874); font-size: 10px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.ropt-versand-daten strong { display: block; overflow-wrap: anywhere; font-size: 13px; }
.ropt-versand-warnung {
  margin-bottom: 14px; padding: 11px 13px; border: 1px solid #e5c372; border-radius: 12px;
  color: #634910; background: #fff8e5; font-size: 12px; line-height: 1.45;
}
.ropt-versand-manuell {
  margin-bottom: 14px; padding: 11px 13px; border: 1px solid #9bcfc1; border-radius: 12px;
  color: #174f40; background: #edf8f4; font-size: 12px; line-height: 1.45;
}
.ropt-versand-email { width: 100%; max-width: 760px; margin: 0 auto; }
.ropt-versand-email .ropt-email-preview-subject { display: grid; gap: 3px; }
.ropt-versand-email .ropt-email-preview-subject span { color: #666; font-size: 10px; letter-spacing: .06em; text-transform: uppercase; }
.ropt-versand-grafik-hinweis, .ropt-versand-bild-hinweis {
  margin: 14px 0; padding: 13px; border: 1px dashed #b9c8c0; border-radius: 9px;
  color: #5d6f66; background: #f4f8f6; font-size: 12px; text-align: center;
}
.ropt-versand-ansicht[hidden], .ropt-versand-form[hidden] { display: none; }
.ropt-versand-form { width: 100%; max-width: 760px; margin: 0 auto; }
.ropt-versand-form h3 { margin: 0 0 6px; color: #123728; font-size: 20px; }
.ropt-versand-form-hinweis { margin: 0 0 18px; color: var(--ropt-text-2, #5c6874); font-size: 12px; line-height: 1.5; }
.ropt-versand-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ropt-versand-form label { display: grid; gap: 6px; min-width: 0; }
.ropt-versand-form label > span {
  color: var(--ropt-text-2, #5c6874); font-size: 10px; font-weight: 850; letter-spacing: .06em; text-transform: uppercase;
}
.ropt-versand-form-breit { margin-top: 13px; }
.ropt-versand-form input, .ropt-versand-form textarea {
  width: 100%; min-width: 0; padding: 11px 12px; border: 1px solid var(--ropt-linie, #d7dfdb); border-radius: 10px;
  color: #172330; background: #fff; font: 14px/1.45 Aptos, Calibri, Arial, sans-serif;
}
.ropt-versand-form textarea { min-height: 330px; resize: vertical; white-space: pre-wrap; }
.ropt-versand-form input:focus, .ropt-versand-form textarea:focus {
  border-color: var(--ropt-gruen, #00713a); outline: 3px solid color-mix(in srgb, var(--ropt-gruen, #00713a) 24%, transparent);
}
.ropt-email-rich-content { overflow-x: auto; }
.ropt-email-rich-content img { max-width: 100%; height: auto; }
.ropt-email-rich-content table { max-width: 100%; border-collapse: collapse; }
.ropt-rich-feld { display: grid; gap: 6px; }
.ropt-rich-label {
  color: var(--ropt-text-2, #5c6874); font-size: 10px; font-weight: 850;
  letter-spacing: .06em; text-transform: uppercase;
}
.ropt-rich-toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding: 7px;
  border: 1px solid var(--ropt-linie, #d7dfdb); border-bottom: 0; border-radius: 11px 11px 0 0;
  background: color-mix(in srgb, var(--ropt-soft, #e4f4ea) 72%, #fff);
}
.ropt-rich-toolbar button {
  min-width: 42px; min-height: 38px; padding: 7px 11px; border: 1px solid var(--ropt-linie, #d7dfdb);
  border-radius: 8px; color: #17372d; background: #fff; cursor: pointer; font: inherit;
  font-size: 13px; font-weight: 750;
}
.ropt-rich-toolbar button:hover { border-color: var(--ropt-gruen, #00713a); background: var(--ropt-soft, #e4f4ea); }
.ropt-rich-toolbar button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--ropt-gruen, #00713a) 28%, transparent); outline-offset: 1px;
}
.ropt-rich-editor {
  min-height: 390px; max-height: 58dvh; overflow: auto; padding: 20px;
  border: 1px solid var(--ropt-linie, #d7dfdb); border-radius: 0 0 11px 11px;
  color: #171717; background: #fff; font: 15px/1.5 Aptos, Calibri, Arial, sans-serif;
  overflow-wrap: anywhere;
}
.ropt-rich-editor:focus {
  border-color: var(--ropt-gruen, #00713a); outline: 3px solid color-mix(in srgb, var(--ropt-gruen, #00713a) 24%, transparent);
}
.ropt-rich-editor img { display: block; max-width: 100%; height: auto; margin: 10px 0; }
.ropt-rich-editor table { max-width: 100%; border-collapse: collapse; }
.ropt-rich-status { min-height: 18px; margin: 0; color: var(--ropt-text-2, #5c6874); font-size: 11px; }
.ropt-versand-form-fehler { min-height: 20px; margin: 10px 0 0; color: #b42318; font-size: 12px; font-weight: 700; }
.ropt-versand-form-aktionen { display: flex; justify-content: flex-end; gap: 9px; margin-top: 8px; }

@media (prefers-reduced-motion: reduce) {
  .ropt-versand-dialog, .ropt-versand-dialog::backdrop { transition: none; }
}

@media (max-width: 1100px) {
  .ropt-email-layout { grid-template-columns: 1fr; }
  .ropt-email-preview-wrap { position: static; }
}

@media (max-width: 720px) {
  .ropt-karte, .ropt-listenkarte { padding: 16px; border-radius: 15px; }
  .ropt-subtabs { overflow-x: auto; }
  .ropt-subtabs button { flex: 1 0 auto; padding-inline: 13px; }
  .ropt-kanal-grid { grid-template-columns: 1fr; }
  .ropt-feldz { grid-template-columns: 1fr; }
  .ropt-tabelle { display: block; overflow-x: auto; }
  .ropt-kk-zeile { align-items: stretch; flex-direction: column; }
  .ropt-kk-zeile > span:last-child { justify-content: flex-start; }
  .ropt-outlook-bridge { align-items: stretch; flex-direction: column; }
  .ropt-versand-dialog { width: 100vw; height: 100dvh; max-height: none; border: 0; border-radius: 0; }
  .ropt-versand-shell { max-height: 100dvh; }
  .ropt-versand-kopf { padding: 16px; }
  .ropt-versand-kopf-aktionen { align-items: stretch; flex-direction: column-reverse; }
  .ropt-versand-bearbeiten { min-height: 36px; }
  .ropt-versand-inhalt { padding: 12px; }
  .ropt-versand-daten { grid-template-columns: 1fr; }
  .ropt-versand-form-grid { grid-template-columns: 1fr; }
  .ropt-versand-form textarea { min-height: 280px; }
  .ropt-rich-editor { min-height: 330px; max-height: none; }
  .ropt-versand-form-aktionen { align-items: stretch; flex-direction: column-reverse; }
  .ropt-versand-email { padding: 20px; }
  .ropt-versand-email .ropt-email-preview-subject { margin: -20px -20px 20px; }
  .ropt-speicherleiste { bottom: 128px; align-items: flex-start; flex-direction: column; }
  .ropt-speicherleiste .ropt-knoepfe { width: 100%; }
  .ropt-speicherleiste .ropt-btn { flex: 1; }
}

/* ---------------------------------------------------------------------------
   Inflation (VPI): Pflegeleiste + Jahresreihe
   Bewusst NICHT .ropt-feldz: dort sind alle Spalten gleich breit (auto-fit 1fr),
   ein vierstelliges Jahr bekaeme dieselbe Breite wie ein Freitextfeld und der
   Button saesse ohne Label oben statt auf Feldhoehe.
   --------------------------------------------------------------------------- */
.ropt-vpi-pflege {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 14px;
  margin-top: 4px;
}
.ropt-vpi-pflege > .feld { margin-bottom: 0; display: flex; flex-direction: column; }
/* Einzeilige Labels: die 2,7em-Mindesthoehe aus .ropt-feldz wuerde hier nur Luft machen. */
.ropt-vpi-pflege > .feld > label { min-height: 0; margin-bottom: 5px; }
.ropt-vpi-pflege > .feld:nth-child(1) input { width: 110px; }
.ropt-vpi-pflege > .feld:nth-child(2) input { width: 190px; }
.ropt-vpi-pflege > .ropt-btn { white-space: nowrap; }
.ropt-vpi-pflege > .ropt-btn[disabled] { opacity: .55; cursor: not-allowed; }

/* Jahr und Index schmal halten, damit "Stand" nicht am rechten Rand klebt. */
.ropt-vpi-tabelle th:nth-child(1), .ropt-vpi-tabelle td:nth-child(1) { width: 90px; }
.ropt-vpi-tabelle th:nth-child(2), .ropt-vpi-tabelle td:nth-child(2) { width: 110px; }
.ropt-vpi-tabelle th:nth-child(4), .ropt-vpi-tabelle td:nth-child(4) { width: 130px; text-align: right; }

@media (max-width: 720px) {
  .ropt-vpi-pflege > .feld { flex: 1 1 100%; }
  .ropt-vpi-pflege > .feld input { width: 100% !important; }
  .ropt-vpi-pflege > .ropt-btn { width: 100%; }
}
