/*
 * SGB-Rechner Frontend CSS
 * Ausgelagert aus der ursprünglichen Ein-Datei-Version.
 */
/* ===========================================================
       SGB-Calc — Basis-Design-System
       Wird von allen Rechnern (SGB II, SGB XII, …) gemeinsam genutzt.
       Spezifische Rechner-Container: .sgbiicalc, .sgbxiicalc, …
       =========================================================== */

    .sgbiicalc {
      --sgb-card: #ffffff;
      --sgb-bg-soft: #f4f5f7;
      --sgb-line: #e4e7eb;
      --sgb-line-strong: #d1d5db;
      --sgb-accent: #cb0000;
      --sgb-accent-soft: #fee2e2;
      --sgb-success: #16a34a;
      --sgb-success-soft: #dcfce7;
      --sgb-muted: #6b7280;
      --sgb-text: #111827;
      --sgb-text-soft: #374151;
      --sgb-info: #1e40af;
      --sgb-info-soft: #eff6ff;
      --sgb-warn: #92400e;
      --sgb-warn-soft: #fef3c7;

      font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, Noto Sans, Helvetica, Arial;
      color: var(--sgb-text);
      max-width: 1100px;
      margin: 24px auto;
      padding: 0 16px;
    }
    @media (max-width: 520px) {
      .sgbiicalc { margin: 12px auto; padding: 0 10px; }
    }

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

    /* Typo */
    .sgbiicalc .sgbcalc-main-title { font-size: 26px; margin: 0 0 16px; font-weight: 700; line-height: 1.2; color: var(--sgb-text); }
    .sgbiicalc h2 { font-size: 18px; margin: 0 0 14px; font-weight: 700; color: var(--sgb-text); }
    .sgbiicalc h3 { font-size: 15px; margin: 0 0 8px; font-weight: 700; }
    @media (max-width: 520px) {
      .sgbiicalc .sgbcalc-main-title { font-size: 22px; }
      .sgbiicalc h2 { font-size: 17px; }
    }

    /* Grid-Layout (Personen + KdU nebeneinander auf Desktop, untereinander auf Mobile) */
    .sgbcalc-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 16px;
      align-items: start;
    }
    @media (min-width: 960px) {
      .sgbcalc-grid { grid-template-columns: 1fr 1fr; }
      /* Desktop: Zusatzkarten und Aktionsbereich nicht über die ganze Rechnerbreite ziehen */
      #card-add {
        max-width: calc((100% - 16px) / 2);
      }
      #card-actions {
        max-width: calc((100% - 16px) / 2);
      }
    }

    /* Card-System: einheitliches Aussehen, klare Hierarchie */
    .sgbcalc-card {
      background: var(--sgb-card);
      border: 1.5px solid #94a3b8;
      border-radius: 14px;
      padding: 20px;
      box-shadow: 0 2px 6px rgba(0,0,0,.07);
    }
    @media (max-width: 520px) {
      .sgbcalc-card { padding: 16px; border-radius: 12px; }
    }

    /* Container für Personen-Karten: transparent (jede Person ist eigene Card) */
    .sgbcalc-card-container {
      background: transparent;
      border: none;
      box-shadow: none;
      padding: 0;
    }
    .sgbcalc-card-container > h2 { margin-top: 0; }

    /* Personenkarten Abstand */
    .sgbcalc-people > .sgbcalc-card { margin-bottom: 16px; }
    .sgbcalc-people > .sgbcalc-card:last-child { margin-bottom: 0; }

    /* Form-Elemente */
    .sgbiicalc label {
      display: block;
      font-size: 13px;
      color: var(--sgb-text-soft);
      margin-bottom: 6px;
      font-weight: 600;
    }
    .sgbiicalc input[type="text"],
    .sgbiicalc input[type="number"],
    .sgbiicalc select,
    .sgbiicalc textarea {
      width: 100%;
      padding: 10px 12px;
      border: 1px solid var(--sgb-line-strong);
      border-radius: 10px;
      font-size: 15px;
      background: var(--sgb-card);
      font-family: inherit;
      color: var(--sgb-text);
      transition: border-color 0.15s, box-shadow 0.15s;
    }
    .sgbiicalc input:focus,
    .sgbiicalc select:focus,
    .sgbiicalc textarea:focus {
      outline: none;
      border-color: var(--sgb-accent);
      box-shadow: 0 0 0 3px rgba(203,0,0,0.12);
    }
    .sgbiicalc input::placeholder { color: #b0b4bc; }

    /* Checkbox-Labels: klickbare Reihe */
    .sgbcalc-check {
      display: flex;
      gap: 10px;
      align-items: center;
      cursor: pointer;
      font-weight: 500;
      font-size: 14px;
      line-height: 1.35;
      color: var(--sgb-text);
      margin: 0;
      padding: 8px 4px;
      border-radius: 8px;
      transition: background 0.15s;
    }
    .sgbcalc-check:hover { background: var(--sgb-bg-soft); }
    .sgbcalc-check input[type="checkbox"] {
      width: 20px;
      height: 20px;
      margin: 0;
      display: block;
      accent-color: var(--sgb-accent);
      flex: 0 0 20px;
      align-self: center;
      cursor: pointer;
    }
    .sgbcalc-check > span {
      display: inline-flex;
      align-items: center;
      gap: 4px;
      min-width: 0;
    }

    /* Checkbox-Layout: spezifisch genug, damit die globale label-Regel es nicht überschreibt */
    .sgbiicalc label.sgbcalc-check {
      display: flex;
      align-items: center;
      gap: 10px;
      line-height: 1.35;
      width: auto;
      max-width: 100%;
    }
    .sgbiicalc label.sgbcalc-check input[type="checkbox"] {
      margin: 0;
      flex: 0 0 20px;
      width: 20px;
      height: 20px;
      align-self: center;
    }
    .sgbcalc-inline-actions label.sgbcalc-check {
      flex: 0 0 auto;
      width: auto;
      margin: 0;
    }
    .sgbcalc-inline-actions .sgbcalc-btn {
      flex: 0 0 auto;
    }

    /* Row: zweispaltig auf Desktop, einspaltig auf Mobile */
    .sgbcalc-row {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 20px;
    }
    .sgbcalc-row > * { min-width: 0; }
    @media (max-width: 700px) {
      .sgbcalc-row { grid-template-columns: 1fr; gap: 14px; }
    }

    /* Untergeordnete Felder bei „Weitere Angaben" immer einspaltig (lange Labels) */
    .sgbcalc-stack { display: grid; grid-template-columns: 1fr; gap: 14px; }

    /* Haushalt anlegen: schlanke Listenoptik vor den Detailkarten */
    .sgbcalc-household-setup-list {
      display: grid;
      grid-template-columns: 1fr;
      gap: 8px;
      margin-bottom: 14px;
    }
    .sgbcalc-household-person {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 92px 38px;
      gap: 8px;
      align-items: center;
      background: #fff;
      border: 1px solid var(--sgb-line);
      border-radius: 10px;
      padding: 8px 10px;
      box-shadow: 0 1px 2px rgba(15,23,42,.04);
    }
    .sgbcalc-household-person-name {
      min-width: 0;
      font-weight: 700;
      color: var(--sgb-text);
      line-height: 1.2;
    }
    .sgbcalc-household-person-age label {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }
    .sgbcalc-household-person-age input {
      height: 38px;
      padding: 8px 10px;
      text-align: right;
    }
    .sgbcalc-household-person-remove {
      width: 38px;
      height: 38px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      justify-self: end;
      padding: 0;
      font-size: 15px;
    }
    @media (max-width: 520px) {
      .sgbcalc-household-person {
        grid-template-columns: minmax(0, 1fr) 82px 36px;
        padding: 8px;
      }
      .sgbcalc-household-person-age input {
        height: 36px;
        padding: 7px 9px;
      }
      .sgbcalc-household-person-remove {
        width: 36px;
        height: 36px;
      }
    }


    /* KdU-Wohnform: klare Auswahl ohne Dropdown */
    .sgbcalc-housing-switch {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
      margin-bottom: 14px;
    }
    .sgbcalc-housing-option {
      display: flex !important;
      align-items: center !important;
      justify-content: center;
      gap: 8px;
      min-height: 42px;
      padding: 10px 12px !important;
      margin: 0 !important;
      border: 1.5px solid var(--sgb-line-strong);
      border-radius: 10px;
      background: #fff;
      color: var(--sgb-text) !important;
      font-weight: 700 !important;
      cursor: pointer;
      line-height: 1.25;
    }
    .sgbcalc-housing-option input {
      width: 18px;
      height: 18px;
      margin: 0;
      accent-color: var(--sgb-accent);
      flex: 0 0 auto;
    }
    .sgbcalc-housing-option:has(input:checked) {
      border-color: var(--sgb-accent);
      background: #fff;
      color: #7f1d1d !important;
    }
    .sgbcalc-owner-fields { display: none; }
    .sgbcalc-household-column.is-owner .sgbcalc-rent-fields { display: none; }
    .sgbcalc-household-column.is-owner .sgbcalc-owner-fields { display: grid; }
    @media (max-width: 520px) {
      .sgbcalc-housing-switch { grid-template-columns: 1fr; }
    }

    /* KdU-Zusatzangaben: schlank, optional, kein Pflichtbereich */
    .sgbcalc-kdu-refund {
      margin-top: 14px;
      padding-top: 12px;
      border-top: 1px solid var(--sgb-line);
    }
    .sgbcalc-kdu-refund-title {
      margin: 0 0 6px;
      font-size: 14px;
      font-weight: 800;
      color: var(--sgb-text);
    }
    .sgbcalc-kdu-refund-amount {
      margin-top: 8px;
    }
    .sgbcalc-kdu-refund-amount[hidden],
    .sgbcalc-kdu-settlement-details[hidden] {
      display: none !important;
    }
    .sgbcalc-kdu-settlement-details {
      margin-top: 8px;
    }
    .sgbcalc-kdu-settlement-type {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
      margin-top: 8px;
    }
    .sgbcalc-kdu-settlement-option {
      display: flex !important;
      align-items: center !important;
      justify-content: center;
      gap: 8px;
      min-height: 38px;
      padding: 8px 10px !important;
      margin: 0 !important;
      border: 1.5px solid var(--sgb-line-strong);
      border-radius: 10px;
      background: #fff;
      color: var(--sgb-text) !important;
      font-size: 13px !important;
      font-weight: 800 !important;
      cursor: pointer;
      line-height: 1.25;
    }
    .sgbcalc-kdu-settlement-option input {
      width: 18px;
      height: 18px;
      margin: 0;
      accent-color: var(--sgb-accent);
      flex: 0 0 auto;
    }
    .sgbcalc-kdu-settlement-option:has(input:checked) {
      border-color: var(--sgb-accent);
      background: #fff;
      color: #7f1d1d !important;
    }
    @media (max-width: 520px) {
      .sgbcalc-kdu-settlement-type { grid-template-columns: 1fr; }
    }
    .sgbcalc-kdu-mode-card {
      margin-top: 10px;
      padding: 14px 18px;
      border-color: var(--sgb-line-strong);
      box-shadow: 0 1px 3px rgba(15,23,42,.05);
    }
    .sgbcalc-kdu-mode-title {
      margin: 0 0 4px;
      font-size: 13px;
      font-weight: 800;
      color: var(--sgb-text);
    }
    .sgbcalc-kdu-mode-card .sgbcalc-check {
      padding-left: 0;
      padding-bottom: 0;
    }
    .sgbiicalc input:disabled,
    .sgbiicalc select:disabled,
    .sgbiicalc textarea:disabled {
      background: #f3f4f6;
      color: #9ca3af;
      cursor: not-allowed;
    }
    .sgbcalc-housing-option:has(input:disabled),
    .sgbcalc-kdu-settlement-option:has(input:disabled),
    .sgbcalc-check:has(input:disabled) {
      opacity: .62;
      cursor: not-allowed;
    }

    /* Buttons */
    .sgbcalc-btn {
      appearance: none;
      background: var(--sgb-text);
      color: #fff;
      border: none;
      padding: 11px 18px;
      border-radius: 10px;
      cursor: pointer;
      font-weight: 600;
      font-size: 14px;
      font-family: inherit;
      transition: background 0.15s, transform 0.05s;
    }
    .sgbcalc-btn:hover { background: #1f2937; }
    .sgbcalc-btn:active { transform: translateY(1px); }
    .sgbcalc-btn.is-primary { background: var(--sgb-accent); color: #fff; border-color: var(--sgb-accent); }
    .sgbcalc-btn.is-primary:hover { background: #a30000; border-color: #a30000; }
    /* Berechnen: volle Breite, größere Schrift – primärer CTA */
    .sgbcalc-btn.is-cta {
      width: 100%;
      font-size: 17px;
      padding: 14px 20px;
      letter-spacing: 0.01em;
    }
    .sgbcalc-btn.is-add {
      background: #fff;
      color: var(--sgb-text);
      border: 1.5px solid var(--sgb-line-strong);
      font-weight: 700;
    }
    .sgbcalc-btn.is-add:hover { background: var(--sgb-bg-soft); border-color: #94a3b8; }
    /* Sekundäre Aktionen: neutral, damit der rote CTA optisch eindeutig bleibt */
    .sgbcalc-btn.is-secondary {
      background: #fff;
      color: var(--sgb-text);
      border: 1.5px solid var(--sgb-line-strong);
      font-weight: 700;
    }
    .sgbcalc-btn.is-secondary:hover { background: var(--sgb-bg-soft); border-color: #94a3b8; }
    .sgbcalc-btn.is-danger,
    .sgbcalc-btn.is-ghost-danger {
      background: #fff;
      color: #be123c;
      border: 1.5px solid #be123c;
      font-weight: 600;
    }
    .sgbcalc-btn.is-danger:hover,
    .sgbcalc-btn.is-ghost-danger:hover { background: #fff1f2; }

    /* Flex-Row für Buttons */
    .sgbcalc-flex {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
    }
    .sgbcalc-inline-actions {
      display: flex;
      gap: 10px;
      align-items: center;
      flex-wrap: wrap;
      margin-top: 8px;
    }

    /* Chips/Badges im Personen-Header */
    .sgbcalc-chip {
      display: inline-flex;
      align-items: center;
      font-size: 12px;
      padding: 4px 10px;
      border-radius: 999px;
      background: var(--sgb-bg-soft);
      border: 1px solid var(--sgb-line);
      color: var(--sgb-text);
      font-weight: 500;
    }
    .sgbcalc-chip.is-role {
      background: #f8fafc;
      border-color: var(--sgb-line-strong);
      color: var(--sgb-text);
      font-weight: 800;
    }
    .sgbcalc-chip.is-mb {
      background: var(--sgb-warn-soft);
      border-color: #fcd34d;
      color: var(--sgb-warn);
      font-weight: 600;
    }
    .sgbcalc-chip.is-special {
      background: var(--sgb-info-soft);
      border-color: #bfdbfe;
      color: var(--sgb-info);
      font-weight: 600;
    }

    /* Info-Icon: bleibt am Label-Ende, bricht nicht alleine in eine neue Zeile */
    .sgbcalc-info {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 20px;
      height: 20px;
      background: var(--sgb-info-soft);
      color: var(--sgb-info);
      border: 1px solid #bfdbfe;
      border-radius: 50%;
      font-size: 10px;
      font-weight: 700;
      cursor: pointer;
      vertical-align: middle;
      font-style: normal;
      user-select: none;
      position: relative;
      -webkit-tap-highlight-color: transparent;
    }
    /* Touch-Target auf 44×44 px vergrößern ohne Layout zu verschieben */
    .sgbcalc-info::after {
      content: '';
      position: absolute;
      top: 50%; left: 50%;
      transform: translate(-50%, -50%);
      width: 44px;
      height: 44px;
    }
    .sgbcalc-info:hover { background: #dbeafe; }
    label .sgbcalc-info { pointer-events: all; }

    /* Tooltip */
    .sgbcalc-info-tooltip {
      display: none;
      position: fixed;
      z-index: 9999;
      max-width: min(320px, 90vw);
      background: #1f2937;
      color: #f9fafb;
      font-size: 13px;
      font-weight: 400;
      line-height: 1.5;
      padding: 10px 14px;
      border-radius: 10px;
      box-shadow: 0 4px 16px rgba(0,0,0,0.18);
      pointer-events: none;
    }
    .sgbcalc-info-tooltip.is-visible { display: block; }
    /* Overlay: fängt den schließenden Tap ab – kein tap-through auf Elemente darunter */
    .sgbcalc-tip-overlay {
      display: none;
      position: fixed;
      inset: 0;
      z-index: 9998;
      background: transparent;
      -webkit-tap-highlight-color: transparent;
    }
    .sgbcalc-tip-overlay.is-active { display: block; }

    /* Section-Title innerhalb einer Karte */
    .sgbcalc-section-title {
      font-size: 12px;
      color: var(--sgb-muted);
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      margin: 18px 0 10px;
    }
    .sgbcalc-section-title:first-child { margin-top: 0; }

    /* Sub-Sections in „Besondere Angaben": klar getrennte, barriereärmere Karten */
    .sgbcalc-subsection {
      background: #ffffff;
      border: 1.5px solid #cbd5e1;
      border-radius: 12px;
      padding: 16px;
      margin-bottom: 14px;
      box-shadow: 0 1px 2px rgba(15,23,42,.05);
    }
    .sgbcalc-subsection:last-child { margin-bottom: 0; }
    .sgbcalc-subsection-title {
      font-size: 14px;
      font-weight: 800;
      color: var(--sgb-text);
      margin: -2px 0 12px;
      padding-bottom: 8px;
      border-bottom: 1px solid #e2e8f0;
      display: flex;
      align-items: center;
    }

    /* Sonstiges-Einkommen-Zeile */
    .sgbcalc-income-row {
      display: grid;
      grid-template-columns: 1fr 160px 40px;
      gap: 10px;
      align-items: end;
    }
    @media (max-width: 520px) {
      .sgbcalc-income-row { grid-template-columns: 1fr 1fr 40px; }
    }
    /* Jeder Einkommensblock als eigene Karte */
    .sgbcalc-income-block {
      background: #f8fafc;
      border: 1.5px solid #cbd5e1;
      border-radius: 10px;
      padding: 12px;
      margin-top: 10px;
    }
    .sgbcalc-income-block:first-of-type { margin-top: 6px; }

    .sgbcalc-employment-list {
      display: grid;
      grid-template-columns: 1fr;
      gap: 10px;
      margin-top: 8px;
    }
    .sgbcalc-employment-item {
      display: grid;
      grid-template-columns: minmax(0, 1fr) 150px 150px 40px;
      gap: 10px;
      align-items: end;
      background: #ffffff;
      border: 1px solid #dbe3ed;
      border-radius: 10px;
      padding: 12px;
    }
    .sgbcalc-employment-item .sgbcalc-trash {
      width: 40px;
      height: 40px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0;
    }
    .sgbcalc-employment-add {
      margin-top: 10px;
    }
    @media (max-width: 700px) {
      .sgbcalc-employment-item {
        grid-template-columns: 1fr;
      }
      .sgbcalc-employment-item .sgbcalc-trash {
        width: 100%;
      }
    }

    /* Ruhige Leerzustände: erklären den Zustand, ohne die Add-Buttons künstlich aufzublasen */
    .sgbcalc-empty-action {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      background: #f8fafc;
      border: 1px dashed #cbd5e1;
      border-radius: 10px;
      padding: 10px 12px;
      margin-top: 6px;
    }
    .sgbcalc-empty-action span {
      color: var(--sgb-muted);
      font-size: 13px;
      line-height: 1.35;
    }
    .sgbcalc-empty-action .sgbcalc-btn {
      flex: 0 0 auto;
      padding: 8px 12px;
      font-size: 13px;
      border-radius: 9px;
    }
    @media (max-width: 520px) {
      .sgbcalc-empty-action {
        align-items: stretch;
        flex-direction: column;
      }
      .sgbcalc-empty-action .sgbcalc-btn { width: 100%; }
    }

    /* Erwerbseinkommen wie die anderen Einkommensblöcke als klar abgegrenzte Einheit */
    .sgbcalc-earned-block {
      margin-top: 8px;
    }
    .sgbcalc-earned-head {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 10px;
      margin-bottom: 10px;
    }
    .sgbcalc-earned-head .sgbcalc-inline-actions {
      margin-top: 0;
      flex: 1 1 auto;
    }
    .sgbcalc-earned-remove {
      flex: 0 0 40px;
      width: 40px;
      height: 40px;
      padding: 0;
      display: inline-flex;
      align-items: center;
      justify-content: center;
    }
    @media (max-width: 520px) {
      .sgbcalc-earned-head {
        align-items: stretch;
      }
      .sgbcalc-earned-remove {
        align-self: flex-start;
      }
    }
    .sgbcalc-trash {
      background: transparent;
      border: 1px solid var(--sgb-line);
      border-radius: 8px;
      padding: 9px 10px;
      cursor: pointer;
      color: var(--sgb-accent);
      font-size: 16px;
      line-height: 1;
      transition: background 0.15s;
    }
    .sgbcalc-trash:hover { background: var(--sgb-accent-soft); }

    /* Details/Summary (Weitere Angaben) */
    .sgbcalc-details {
      background: var(--sgb-bg-soft);
      border: 1px solid var(--sgb-line);
      border-radius: 12px;
      padding: 14px 16px;
      margin-top: 14px;
    }
    .sgbcalc-details > summary {
      cursor: pointer;
      font-weight: 700;
      font-size: 14px;
      color: var(--sgb-text);
      list-style: none;
      display: flex;
      align-items: center;
      gap: 8px;
    }
    .sgbcalc-details > summary::-webkit-details-marker { display: none; }
    .sgbcalc-details > summary::before {
      content: "▶";
      font-size: 10px;
      color: var(--sgb-muted);
      transition: transform 0.15s;
    }
    .sgbcalc-details[open] > summary::before { transform: rotate(90deg); }
    .sgbcalc-details > .sgbcalc-details-body { margin-top: 14px; }

    /* Hinweis-Boxen — alle einheitlich, dezent */
    .sgbcalc-hint {
      background: var(--sgb-card);
      border: 1px solid var(--sgb-line);
      border-left: 3px solid var(--sgb-muted);
      border-radius: 8px;
      padding: 12px 14px;
      font-size: 13px;
      line-height: 1.5;
      margin-top: 10px;
      color: var(--sgb-text);
    }
    .sgbcalc-hint.is-info { border-left-color: var(--sgb-info); }
    .sgbcalc-hint.is-warn { border-left-color: #d97706; }
    .sgbcalc-hint.is-error {
      background: #fef2f2;
      border-color: #fca5a5;
      border-left: 3px solid var(--sgb-accent);
      color: #991b1b;
    }
    .sgbcalc-hint strong { font-weight: 700; }

    /* Hinweise-Akkordeon (nach Berechnung) */
    .sgbcalc-hints-wrap {
      margin-top: 16px;
      background: #f8fafc;
      border: 1px solid #dbe3ed;
      border-radius: 14px;
      overflow: hidden;
    }
    .sgbcalc-hints-header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      padding: 14px 16px;
      cursor: pointer;
      font-weight: 800;
      font-size: 15px;
      color: var(--sgb-text);
      user-select: none;
    }
    .sgbcalc-hints-header:hover { background: #eef2f7; }
    .sgbcalc-hints-header .toggle-icon {
      font-size: 12px;
      color: var(--sgb-muted);
      transition: transform 0.15s;
    }
    .sgbcalc-hints-wrap.is-open .sgbcalc-hints-header .toggle-icon { transform: rotate(90deg); }
    .sgbcalc-hints-list {
      display: none;
      padding: 0 16px 16px;
    }
    .sgbcalc-hints-wrap.is-open .sgbcalc-hints-list { display: block; }
    .sgbcalc-result-hint-card {
      background: #ffffff;
      border: 1px solid #e2e8f0;
      border-left: 4px solid #64748b;
      border-radius: 12px;
      padding: 14px 16px;
      margin-top: 12px;
      box-shadow: 0 1px 2px rgba(15,23,42,.04);
    }
    .sgbcalc-result-hint-card:first-child { margin-top: 2px; }
    .sgbcalc-result-hint-person {
      color: var(--sgb-muted);
      font-size: 12px;
      font-weight: 800;
      text-transform: uppercase;
      letter-spacing: .04em;
      margin-bottom: 4px;
    }
    .sgbcalc-result-hint-title {
      color: var(--sgb-text);
      font-size: 15px;
      font-weight: 900;
      line-height: 1.35;
      margin-bottom: 8px;
    }
    .sgbcalc-result-hint-body {
      color: var(--sgb-text);
      font-size: 14px;
      line-height: 1.55;
    }
    .sgbcalc-result-hint-body p {
      margin: 0 0 8px;
    }
    .sgbcalc-result-hint-body p:last-child { margin-bottom: 0; }
    .sgbcalc-result-hint-body ul {
      margin: 6px 0 8px 18px;
      padding: 0;
    }
    .sgbcalc-result-hint-body li { margin: 3px 0; }
    @media (max-width: 520px) {
      .sgbcalc-hints-header { font-size: 14px; padding: 13px 14px; }
      .sgbcalc-hints-list { padding: 0 12px 12px; }
      .sgbcalc-result-hint-card { padding: 13px 14px; }
      .sgbcalc-result-hint-body { font-size: 13.5px; }
    }

    /* Personenregister: bleibt innerhalb des Rechners sichtbar und zeigt nur die aktive Person */
    #card-persons {
      scroll-margin-top: 76px;
    }
    @media (min-width: 960px) {
      #card-persons {
        margin-top: 10px !important;
      }
    }
    .sgbcalc-people-sticky {
      position: sticky;
      top: 8px;
      z-index: 30;
      display: flex;
      gap: 8px;
      align-items: center;
      overflow-x: auto;
      overscroll-behavior-x: contain;
      -webkit-overflow-scrolling: touch;
      scrollbar-width: thin;
      padding: 10px 0 12px;
      margin: -4px 0 14px;
      background: rgba(255,255,255,.97);
      border-bottom: 1px solid rgba(203,213,225,.95);
      backdrop-filter: blur(8px);
    }
    .sgbcalc-people-sticky:empty { display: none; }
    .sgbcalc-person-nav-chip {
      appearance: none;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 5px;
      flex: 0 0 auto;
      min-height: 40px;
      padding: 8px 14px;
      border: 1.5px solid var(--sgb-line-strong);
      border-radius: 999px;
      background: #fff;
      color: var(--sgb-text);
      font-family: inherit;
      font-size: 13px;
      font-weight: 850;
      line-height: 1.15;
      cursor: pointer;
      white-space: nowrap;
      transition: background .15s, border-color .15s, color .15s, box-shadow .15s, transform .05s;
    }
    .sgbcalc-person-nav-chip:hover,
    .sgbcalc-person-nav-chip:focus-visible {
      background: #fff5f5;
      border-color: var(--sgb-accent);
      color: #7f1d1d;
      outline: none;
      box-shadow: 0 0 0 3px rgba(203, 0, 0, .10);
    }
    .sgbcalc-person-nav-chip:active { transform: translateY(1px); }
    .sgbcalc-person-nav-chip.is-active {
      background: var(--sgb-accent);
      border-color: var(--sgb-accent);
      color: #fff;
      box-shadow: 0 4px 10px rgba(203, 0, 0, .18);
    }
    .sgbcalc-person-nav-chip.is-active:hover,
    .sgbcalc-person-nav-chip.is-active:focus-visible {
      background: #a30000;
      border-color: #a30000;
      color: #fff;
      box-shadow: 0 0 0 3px rgba(203, 0, 0, .18), 0 4px 10px rgba(203, 0, 0, .20);
    }
    .sgbcalc-person-nav-chip::after {
      content: "";
      display: inline-block;
      width: 0;
      height: 0;
      border-left: 4px solid transparent;
      border-right: 4px solid transparent;
      border-top: 5px solid currentColor;
      opacity: .55;
      margin-left: 2px;
    }
    .sgbcalc-person-card { scroll-margin-top: 88px; }
    .sgbcalc-person-card.is-inactive { display: none; }
    .sgbcalc-person-card.is-active { display: block; }
    .sgbcalc-person-header-actions .sgbcalc-person-toggle { display: none; }
    @media (max-width: 520px) {
      .sgbcalc-people-sticky {
        top: 6px;
        margin-bottom: 10px;
        padding: 8px 0 10px;
        gap: 6px;
      }
      .sgbcalc-person-nav-chip {
        min-height: 36px;
        padding: 7px 11px;
        font-size: 12px;
      }
      .sgbcalc-person-card { scroll-margin-top: 72px; }
    }

    /* Person-Header */
    .sgbcalc-person-header {
      display: flex;
      justify-content: space-between;
      align-items: flex-start;
      gap: 10px;
      flex-wrap: nowrap;
      margin-bottom: 0;
    }
    .sgbcalc-person-header-chips {
      display: flex;
      gap: 6px;
      align-items: center;
      flex-wrap: wrap;
      min-width: 0;
      flex: 1 1 auto;
    }
    .sgbcalc-person-header-actions {
      display: inline-flex;
      align-items: center;
      gap: 6px;
      flex: 0 0 auto;
    }
    .sgbcalc-person-toggle {
      width: 38px;
      height: 38px;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0;
      background: #fff;
      color: var(--sgb-text);
      border: 1px solid var(--sgb-line);
      border-radius: 9px;
      cursor: pointer;
      font-family: inherit;
      font-size: 14px;
      line-height: 1;
      transition: background 0.15s, border-color 0.15s, transform 0.05s;
    }
    .sgbcalc-person-toggle:hover {
      background: var(--sgb-bg-soft);
      border-color: var(--sgb-line-strong);
    }
    .sgbcalc-person-toggle:active { transform: translateY(1px); }
    .sgbcalc-person-toggle-icon {
      display: inline-block;
      color: var(--sgb-muted);
      transform: rotate(90deg);
      transition: transform 0.15s;
    }
    .sgbcalc-person-card.is-collapsed .sgbcalc-person-toggle-icon { transform: rotate(0deg); }
    .sgbcalc-person-body { margin-top: 14px; }
    .sgbcalc-person-card.is-collapsed .sgbcalc-person-body { display: none; }
    @media (max-width: 520px) {
      .sgbcalc-person-header { gap: 8px; }
      .sgbcalc-person-header-chips { gap: 5px; }
      .sgbcalc-person-toggle,
      .sgbcalc-person-header-actions .sgbcalc-trash {
        width: 36px;
        height: 36px;
      }
      .sgbcalc-person-body { margin-top: 12px; }
      .sgbcalc-person-header .sgbcalc-chip {
        font-size: 11px;
        padding: 3px 8px;
      }
    }

    /* Selbstständigen-Untergruppe (visuelle Trennung Einnahmen vs. Abzüge) */
    .sgbcalc-self-group {
      padding: 12px 14px;
      background: var(--sgb-bg-soft);
      border: 1px solid var(--sgb-line);
      border-radius: 10px;
      margin-bottom: 12px;
    }
    .sgbcalc-self-group:last-child { margin-bottom: 0; }
    .sgbcalc-self-group-title {
      font-size: 11px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.05em;
      color: var(--sgb-muted);
      margin-bottom: 10px;
    }

    /* Selbstständige Tätigkeit: symmetrisches Desktop-Grid */
    .sgbcalc-self-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 12px 20px;
      align-items: end;
    }
    .sgbcalc-self-field { min-width: 0; }
    .sgbcalc-self-grid label {
      min-height: 44px;
      display: flex;
      align-items: flex-end;
      gap: 6px;
    }
    @media (max-width: 700px) {
      .sgbcalc-self-grid { grid-template-columns: 1fr; gap: 14px; }
      .sgbcalc-self-grid label { min-height: 0; }
    }

    /* Ergebnisbereich */
    .sgbcalc-result-wrap {
      background: var(--sgb-card);
      border: 1px solid var(--sgb-line);
      border-radius: 16px;
      overflow: hidden;
      box-shadow: 0 1px 2px rgba(0,0,0,.04);
    }
    .sgbcalc-result-head {
      padding: 18px 20px;
      background: linear-gradient(180deg, var(--sgb-accent-soft), #ffffff 80%);
      border-bottom: 1px solid var(--sgb-line);
    }
    .sgbcalc-result-head .sgbcalc-result-title {
      font-weight: 700;
      color: var(--sgb-text-soft);
      font-size: 13px;
      text-transform: uppercase;
      letter-spacing: 0.04em;
      margin-bottom: 6px;
    }
    .sgbcalc-result-head .sgbcalc-result-big {
      font-size: 34px;
      font-weight: 900;
      font-variant-numeric: tabular-nums;
      color: var(--sgb-accent);
      line-height: 1.1;
    }
    .sgbcalc-result-head .sgbcalc-result-sub {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      margin-top: 10px;
      padding-top: 10px;
      border-top: 1px dashed var(--sgb-line);
      font-size: 13px;
      color: var(--sgb-muted);
    }
    .sgbcalc-result-head .sgbcalc-result-sub .v {
      font-variant-numeric: tabular-nums;
      font-weight: 700;
      color: var(--sgb-success);
    }
    .sgbcalc-result-head .sgbcalc-result-total {
      display: flex;
      justify-content: space-between;
      align-items: baseline;
      margin-top: 8px;
      font-size: 14px;
    }
    .sgbcalc-result-head .sgbcalc-result-total .lbl {
      color: var(--sgb-text-soft);
      font-weight: 700;
    }
    .sgbcalc-result-head .sgbcalc-result-total .val {
      font-variant-numeric: tabular-nums;
      font-weight: 900;
      font-size: 20px;
    }
    .sgbcalc-result-actions {
      display: flex;
      gap: 10px;
      flex-wrap: wrap;
      margin-top: 14px;
      padding-top: 12px;
      border-top: 1px solid rgba(148, 163, 184, .35);
    }
    .sgbcalc-result-action-btn {
      appearance: none;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      min-height: 40px;
      padding: 9px 14px;
      border: 1.5px solid var(--sgb-line-strong);
      border-radius: 10px;
      background: #fff;
      color: var(--sgb-text);
      font-family: inherit;
      font-size: 14px;
      font-weight: 800;
      cursor: pointer;
      transition: background .15s, border-color .15s, transform .05s;
    }
    .sgbcalc-result-action-btn:hover {
      background: #f8fafc;
      border-color: #94a3b8;
    }
    .sgbcalc-result-action-btn:active { transform: translateY(1px); }
    .sgbcalc-result-action-btn.is-attention {
      border-color: #94a3b8;
      background: #f8fafc;
    }
    @media (max-width: 520px) {
      .sgbcalc-result-actions { gap: 8px; }
      .sgbcalc-result-action-btn {
        flex: 1 1 140px;
        min-height: 42px;
        padding: 10px 12px;
      }
    }
    .sgbcalc-result-body { padding: 14px 18px; }

    /* Summary-Zeilen */
    .sgbcalc-srow {
      display: flex;
      justify-content: space-between;
      gap: 12px;
      padding: 8px 0;
      border-bottom: 1px solid #eef2f7;
    }
    .sgbcalc-srow:last-child { border-bottom: none; }
    .sgbcalc-srow .k { color: var(--sgb-text-soft); }
    .sgbcalc-srow .v { font-variant-numeric: tabular-nums; font-weight: 700; }
    .sgbcalc-srow.is-danger .v { color: var(--sgb-accent); font-weight: 900; }

    /* Detail-Rendering */
    .sgbcalc-detail-grid {
      display: grid;
      grid-template-columns: 1fr;
      gap: 12px;
      margin-top: 12px;
    }
    @media (min-width: 900px) {
      .sgbcalc-detail-grid { grid-template-columns: 1fr 1fr; }
    }
    .sgbcalc-detail-card {
      background: var(--sgb-bg-soft);
      border: 1px solid var(--sgb-line);
      border-radius: 12px;
      padding: 14px;
    }
    .sgbcalc-detail-card > h3 {
      margin: 0 0 10px;
      font-size: 15px;
      font-weight: 700;
      color: var(--sgb-text);
    }
    .sgbcalc-detail-section { margin-top: 10px; }
    .sgbcalc-detail-section:first-of-type { margin-top: 0; }
    .sgbcalc-detail-label {
      font-size: 11px;
      color: var(--sgb-muted);
      margin-bottom: 6px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.04em;
    }
    .sgbcalc-rtable {
      width: 100%;
      border-collapse: collapse;
      font-size: 14px;
      background: var(--sgb-card);
      border: 1px solid var(--sgb-line);
      border-radius: 10px;
      overflow: hidden;
    }
    .sgbcalc-rtable td {
      border-bottom: 1px solid #eef2f7;
      padding: 8px 12px;
      color: var(--sgb-text);
    }
    .sgbcalc-rtable tr:last-child td { border-bottom: none; }
    .sgbcalc-rtable td:last-child {
      text-align: right;
      font-variant-numeric: tabular-nums;
      white-space: nowrap;
    }
    /* Eingerückte "davon"-Zeilen */
    .sgbcalc-rtable tr.is-sub td:first-child {
      padding-left: 28px;
      color: var(--sgb-muted);
      font-size: 13px;
    }
    .sgbcalc-rtable tr.is-sub td:last-child {
      color: var(--sgb-muted);
      font-size: 13px;
    }
    /* Zwischensummen (fett, mit Trennstrich oben) */
    .sgbcalc-rtable tr.is-sum td {
      font-weight: 700;
      border-top: 1px solid var(--sgb-line-strong);
      background: var(--sgb-bg-soft);
    }
    /* Info-Zeilen (nur Hinweise, kein Betrag) */
    .sgbcalc-rtable tr.is-info td {
      color: var(--sgb-muted);
      font-style: italic;
      font-size: 13px;
    }
    /* Final-Block: Anspruchsberechnung */
    .sgbcalc-detail-final {
      margin-top: 12px;
      padding-top: 10px;
      border-top: 2px solid var(--sgb-line-strong);
    }
    /* Bürgergeld-Anspruch: immer rot + fett, unabhängig davon ob danach noch der Sofortzuschlag-Block folgt */
    .sgbcalc-detail-final .sgbcalc-rtable tr.is-entitle td {
      font-weight: 800;
      color: var(--sgb-accent);
      font-size: 15px;
      border-top: 1px solid var(--sgb-line-strong);
      background: var(--sgb-bg-soft);
    }
    /* Gesamtanspruch (wenn Sofortzuschlag vorhanden): schlichte Summenzeile nach Trennlinie */
    .sgbcalc-detail-final .sgbcalc-rtable tr.is-grand td {
      font-weight: 800;
      color: var(--sgb-accent);
      font-size: 15px;
      border-top: 2px solid var(--sgb-line-strong);
    }
    /* Sofortzuschlag-Zeile: grüner Betrag */
    .sgbcalc-detail-final .sgbcalc-rtable tr.is-sz td:last-child {
      color: var(--sgb-success);
      font-weight: 700;
    }

    /* Muted Text */
    .sgbcalc-muted {
      color: var(--sgb-muted);
      font-size: 12px;
    }


    /* Validierungsfehler: Sprungmarken zu betroffenen Eingaben */
    .sgbcalc-error-actions {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      margin-top: 12px;
    }
    .sgbcalc-error-jump {
      appearance: none;
      border: 1.5px solid var(--sgb-accent);
      background: #fff;
      color: var(--sgb-accent);
      border-radius: 10px;
      padding: 8px 12px;
      font-family: inherit;
      font-size: 13px;
      font-weight: 800;
      cursor: pointer;
      line-height: 1.25;
    }
    .sgbcalc-error-jump:hover,
    .sgbcalc-error-jump:focus-visible {
      background: var(--sgb-accent) !important;
      border-color: var(--sgb-accent) !important;
      color: #fff !important;
      outline: none;
      box-shadow: 0 0 0 3px rgba(203, 0, 0, .18);
    }
    .sgbcalc-jump-highlight {
      outline: 3px solid var(--sgb-accent);
      outline-offset: 4px;
      box-shadow: 0 0 0 6px rgba(203, 0, 0, .10);
    }
    .sgbcalc-field-highlight {
      border-color: var(--sgb-accent) !important;
      box-shadow: 0 0 0 4px rgba(203, 0, 0, .16) !important;
    }
    @media (max-width: 520px) {
      .sgbcalc-error-actions {
        flex-direction: column;
      }
      .sgbcalc-error-jump {
        width: 100%;
        text-align: center;
      }
    }

/* ===========================================================
   Version 1.0.5 – stabile Live-Fassung
   - obere Eingaben bleiben gemeinsam oben: Haushalt links, KdU rechts
   - Personenbereich bleibt darunter in voller Breite
   - Personenregister ohne horizontalen Scrollbalken
   =========================================================== */

.sgbiicalc #card-persons {
  margin-top: 16px !important;
}

@media (min-width: 960px) {
  .sgbiicalc #card-persons {
    margin-top: 12px !important;
  }
}

.sgbiicalc .sgbcalc-people-sticky {
  flex-wrap: wrap;
  align-content: flex-start;
  overflow-x: visible;
  overflow-y: visible;
  scrollbar-width: none;
}

.sgbiicalc .sgbcalc-people-sticky::-webkit-scrollbar {
  display: none;
}

.sgbiicalc .sgbcalc-person-nav-chip {
  flex: 0 0 auto;
  max-width: 100%;
}

@media (max-width: 700px) {
  .sgbiicalc .sgbcalc-people-sticky {
    gap: 7px;
  }
  .sgbiicalc .sgbcalc-person-nav-chip {
    min-height: 36px;
    padding: 7px 10px;
    font-size: 12px;
  }
}

/* ===========================================================
   Version 1.0.6 – geführte Haushaltsanlage
   =========================================================== */

.sgbiicalc .sgbcalc-household-setup {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.sgbiicalc .sgbcalc-household-setup > .sgbcalc-household-setup-list {
  margin-bottom: 0;
}

.sgbiicalc .sgbcalc-household-question {
  border-top: 1px solid var(--sgb-line);
  padding-top: 14px;
}

.sgbiicalc .sgbcalc-household-question-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.sgbiicalc .sgbcalc-household-question-text {
  min-width: 0;
}

.sgbiicalc .sgbcalc-household-question-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--sgb-text);
}

.sgbiicalc .sgbcalc-household-question-sub {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--sgb-muted);
}

.sgbiicalc label.sgbcalc-household-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 56px;
  height: 32px;
  margin: 0;
  padding: 0;
  cursor: pointer;
}

.sgbiicalc .sgbcalc-household-switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.sgbiicalc .sgbcalc-household-switch-track {
  position: relative;
  display: block;
  width: 56px;
  height: 32px;
  border: 1.5px solid var(--sgb-line-strong);
  border-radius: 999px;
  background: #fff;
  transition: background .15s, border-color .15s, box-shadow .15s;
}

.sgbiicalc .sgbcalc-household-switch-track::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid #94a3b8;
  box-shadow: 0 1px 2px rgba(15,23,42,.18);
  transition: transform .16s ease, border-color .15s, background .15s;
}

.sgbiicalc .sgbcalc-household-switch input:checked + .sgbcalc-household-switch-track {
  background: var(--sgb-accent);
  border-color: var(--sgb-accent);
  box-shadow: 0 3px 8px rgba(203,0,0,.16);
}

.sgbiicalc .sgbcalc-household-switch input:checked + .sgbcalc-household-switch-track::before {
  transform: translateX(24px);
  border-color: #fff;
}

.sgbiicalc .sgbcalc-household-switch input:focus-visible + .sgbcalc-household-switch-track {
  box-shadow: 0 0 0 3px rgba(203,0,0,.14);
}

.sgbiicalc .sgbcalc-household-question-list {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.sgbiicalc .sgbcalc-household-add-child {
  justify-self: start;
  min-height: 40px;
  padding: 9px 13px;
}

.sgbiicalc .sgbcalc-household-summary {
  border-top: 1px solid var(--sgb-line);
  padding-top: 12px;
  font-size: 13px;
  line-height: 1.4;
  color: var(--sgb-text-soft);
}

.sgbiicalc .sgbcalc-household-summary span {
  font-weight: 700;
  color: var(--sgb-text);
}

@media (min-width: 960px) {
  .sgbiicalc #card-household-setup {
    min-height: 356px;
  }
}

@media (max-width: 520px) {
  .sgbiicalc .sgbcalc-household-question-row {
    align-items: flex-start;
  }
  .sgbiicalc label.sgbcalc-household-switch,
  .sgbiicalc .sgbcalc-household-switch-track {
    width: 52px;
    height: 30px;
  }
  .sgbiicalc .sgbcalc-household-switch-track::before {
    width: 22px;
    height: 22px;
  }
  .sgbiicalc .sgbcalc-household-switch input:checked + .sgbcalc-household-switch-track::before {
    transform: translateX(22px);
  }
}

/* Version 1.0.8 – Titel ist kein H1 mehr, Haushaltslabels weniger schwer gesetzt. */


/* ===========================================================
   Version 1.0.9 – Personenregister klarer, Rot nur für CTA/Fehler
   =========================================================== */

.sgbiicalc .sgbcalc-active-person-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  margin: -2px 0 14px;
  padding: 10px 14px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #1e40af;
  border-radius: 12px;
  color: #1f2937;
  font-size: 14px;
  line-height: 1.35;
}

.sgbiicalc .sgbcalc-active-person-notice span {
  color: #4b5563;
  font-weight: 600;
}

.sgbiicalc .sgbcalc-active-person-notice strong {
  color: #1e3a8a;
  font-weight: 850;
}

.sgbiicalc .sgbcalc-person-nav-chip {
  border-color: #cbd5e1;
  background: #fff;
  color: #111827 !important;
  box-shadow: none;
}

.sgbiicalc .sgbcalc-person-nav-chip:hover,
.sgbiicalc .sgbcalc-person-nav-chip:focus-visible {
  background: #eff6ff;
  border-color: #2563eb;
  color: #1e3a8a !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .13);
}

.sgbiicalc .sgbcalc-person-nav-chip.is-active,
.sgbiicalc .sgbcalc-person-nav-chip.is-active:hover,
.sgbiicalc .sgbcalc-person-nav-chip.is-active:focus-visible {
  background: #1e40af;
  border-color: #1e40af;
  color: #fff !important;
  box-shadow: 0 5px 14px rgba(30, 64, 175, .22);
}

.sgbiicalc .sgbcalc-person-nav-chip.is-active::after {
  opacity: .8;
}

.sgbiicalc .sgbcalc-result-action-btn,
.sgbiicalc .sgbcalc-result-action-btn:visited {
  background: #fff;
  color: #111827 !important;
  border-color: #cbd5e1;
}

.sgbiicalc .sgbcalc-result-action-btn:hover,
.sgbiicalc .sgbcalc-result-action-btn:focus-visible,
.sgbiicalc .sgbcalc-result-action-btn.is-attention:hover,
.sgbiicalc .sgbcalc-result-action-btn.is-attention:focus-visible {
  background: #eff6ff !important;
  border-color: #2563eb !important;
  color: #1e3a8a !important;
  outline: none;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.sgbiicalc .sgbcalc-result-action-btn:active {
  background: #dbeafe !important;
  color: #1e3a8a !important;
}

@media (max-width: 520px) {
  .sgbiicalc .sgbcalc-active-person-notice {
    align-items: flex-start;
    flex-direction: column;
    gap: 3px;
    padding: 9px 12px;
    font-size: 13px;
  }
}

/* ===========================================================
   Version 1.0.10 – Trust-Box oberhalb des Rechners
   =========================================================== */

.sgbiicalc .sgbcalc-trustbox {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  margin: 0 0 22px;
  padding: 22px 24px;
  background: linear-gradient(180deg, #ffffff 0%, #fbfdff 100%);
  border: 1.5px solid #cbd5e1;
  border-radius: 16px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, .08);
}

.sgbiicalc .sgbcalc-trustbox-icon {
  width: 82px;
  height: 82px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 50%, #cb0000 0%, #b80018 68%, #a00016 100%);
  box-shadow: 0 0 0 13px rgba(203, 0, 0, .07), 0 12px 22px rgba(203, 0, 0, .18);
  color: #fff;
  justify-self: center;
}

.sgbiicalc .sgbcalc-trustbox-icon span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border: 4px solid rgba(255,255,255,.92);
  border-radius: 999px;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.sgbiicalc .sgbcalc-trustbox-overline {
  display: inline-block;
  margin-bottom: 6px;
  color: #b80018;
  font-size: 12px;
  font-weight: 850;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.sgbiicalc .sgbcalc-trustbox-title {
  margin: 0 0 8px;
  color: #0f172a;
  font-size: 25px;
  line-height: 1.16;
  font-weight: 850;
}

.sgbiicalc .sgbcalc-trustbox-text,
.sgbiicalc .sgbcalc-trustbox-note {
  margin: 0;
  color: #334155;
  font-size: 15px;
  line-height: 1.55;
}

.sgbiicalc .sgbcalc-trustbox-note {
  margin-top: 8px;
}

.sgbiicalc .sgbcalc-trustbox-features {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.sgbiicalc .sgbcalc-trustbox-chip {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid #f3c5ce;
  border-radius: 999px;
  background: #fff5f7;
  color: #7f1d1d;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.15;
}

@media (max-width: 700px) {
  .sgbiicalc .sgbcalc-trustbox {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px 16px;
    margin-bottom: 18px;
  }
  .sgbiicalc .sgbcalc-trustbox-icon {
    width: 64px;
    height: 64px;
    justify-self: start;
    box-shadow: 0 0 0 9px rgba(203, 0, 0, .07), 0 8px 16px rgba(203, 0, 0, .14);
  }
  .sgbiicalc .sgbcalc-trustbox-icon span {
    width: 38px;
    height: 38px;
    border-width: 3px;
    font-size: 22px;
  }
  .sgbiicalc .sgbcalc-trustbox-title {
    font-size: 22px;
  }
  .sgbiicalc .sgbcalc-trustbox-text,
  .sgbiicalc .sgbcalc-trustbox-note {
    font-size: 14px;
  }
}


/* ===========================================================
   Version 1.0.11 – sichtbarer Start der Eingabe nach Trust-Box
   =========================================================== */

.sgbiicalc .sgbcalc-input-start {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: -6px 0 18px;
  padding: 14px 18px;
  border: 1.5px solid #bfdbfe;
  border-left: 5px solid #2563eb;
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff 0%, #eff6ff 100%);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .05);
}

.sgbiicalc .sgbcalc-input-start-mark {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #2563eb;
  color: #fff;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: .04em;
}

.sgbiicalc .sgbcalc-input-start-title {
  margin: 0;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 850;
  color: #0f172a;
}

.sgbiicalc .sgbcalc-input-start-text {
  margin-top: 2px;
  color: #475569;
  font-size: 14px;
  line-height: 1.45;
}

.sgbiicalc .sgbcalc-input-start::after {
  content: "↓";
  margin-left: auto;
  color: #2563eb;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
}

@media (max-width: 700px) {
  .sgbiicalc .sgbcalc-input-start {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
    margin: -4px 0 16px;
    padding: 14px 15px;
  }
  .sgbiicalc .sgbcalc-input-start::after {
    display: none;
  }
  .sgbiicalc .sgbcalc-input-start-title {
    font-size: 17px;
  }
  .sgbiicalc .sgbcalc-input-start-text {
    font-size: 13.5px;
  }
}


/* ===========================================================
   Version 1.0.12 – klare Rechnerfläche, keine Blau-Verwechslung mit Anzeigen
   =========================================================== */

.sgbiicalc {
  --sgb-trust: #15803d;
  --sgb-trust-dark: #14532d;
  --sgb-trust-soft: #f0fdf4;
  --sgb-work: #111827;
  --sgb-work-soft: #f8fafc;
}

/* Trust-Box: Grün = Vertrauen/Orientierung, nicht Aktion/Warnung */
.sgbiicalc .sgbcalc-trustbox {
  background: linear-gradient(180deg, #ffffff 0%, #fbfffd 100%);
  border-color: #bbf7d0;
  box-shadow: 0 8px 20px rgba(20, 83, 45, .08);
}

.sgbiicalc .sgbcalc-trustbox-icon {
  background: radial-gradient(circle at 50% 50%, #16a34a 0%, #15803d 68%, #14532d 100%);
  box-shadow: 0 0 0 12px rgba(22, 163, 74, .09), 0 10px 20px rgba(21, 128, 61, .18);
}

.sgbiicalc .sgbcalc-trustbox-overline {
  color: var(--sgb-trust);
}

.sgbiicalc .sgbcalc-trustbox-chip {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #14532d;
}

/* Der blaue Start-Hinweis aus 1.0.11 wird nicht mehr verwendet. */
.sgbiicalc .sgbcalc-input-start {
  display: none !important;
}

/* Sichtbarer Anfang und Rahmen des eigentlichen Rechners */
.sgbiicalc .sgbcalc-calculator-shell {
  margin: 20px 0 0;
  padding: 22px;
  background: #f8fafc;
  border: 1.5px solid #cbd5e1;
  border-radius: 18px;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .06);
}

.sgbiicalc .sgbcalc-calculator-shell-head {
  margin: 0 0 18px;
  padding: 0 0 14px;
  border-bottom: 1px solid #e2e8f0;
}

.sgbiicalc .sgbcalc-calculator-shell-kicker {
  color: #111827;
  font-size: 19px;
  font-weight: 850;
  line-height: 1.25;
}

.sgbiicalc .sgbcalc-calculator-shell-head p {
  margin: 4px 0 0;
  color: #475569;
  font-size: 14px;
  line-height: 1.45;
}

.sgbiicalc .sgbcalc-calculator-shell #card-actions,
.sgbiicalc .sgbcalc-calculator-shell #card-result {
  margin-top: 16px !important;
}

.sgbiicalc .sgbcalc-calculator-shell #card-persons {
  margin-top: 18px !important;
}

/* Aktiver Arbeitskontext: dunkel/neutral statt blau */
.sgbiicalc .sgbcalc-active-person-notice {
  background: #ffffff;
  border-color: #d1d5db;
  border-left-color: #111827;
  color: #111827;
}

.sgbiicalc .sgbcalc-active-person-notice strong {
  color: #111827;
}

.sgbiicalc .sgbcalc-person-nav-chip:hover,
.sgbiicalc .sgbcalc-person-nav-chip:focus-visible {
  background: #f8fafc;
  border-color: #64748b;
  color: #111827 !important;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, .16);
}

.sgbiicalc .sgbcalc-person-nav-chip.is-active,
.sgbiicalc .sgbcalc-person-nav-chip.is-active:hover,
.sgbiicalc .sgbcalc-person-nav-chip.is-active:focus-visible {
  background: #111827;
  border-color: #111827;
  color: #fff !important;
  box-shadow: 0 5px 14px rgba(17, 24, 39, .22);
}

/* Ergebnis-Buttons: kein Blau, kein weißer Text auf hellem Hover */
.sgbiicalc .sgbcalc-result-action-btn:hover,
.sgbiicalc .sgbcalc-result-action-btn:focus-visible,
.sgbiicalc .sgbcalc-result-action-btn.is-attention:hover,
.sgbiicalc .sgbcalc-result-action-btn.is-attention:focus-visible {
  background: #f8fafc !important;
  border-color: #64748b !important;
  color: #111827 !important;
  box-shadow: 0 0 0 3px rgba(100, 116, 139, .16);
}

.sgbiicalc .sgbcalc-result-action-btn:active {
  background: #e5e7eb !important;
  color: #111827 !important;
}

@media (max-width: 700px) {
  .sgbiicalc .sgbcalc-trustbox {
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 12px;
    align-items: start;
    padding: 15px 14px;
    margin-bottom: 14px;
    border-radius: 14px;
  }
  .sgbiicalc .sgbcalc-trustbox-icon {
    width: 48px;
    height: 48px;
    justify-self: start;
    box-shadow: 0 0 0 7px rgba(22, 163, 74, .08), 0 6px 12px rgba(21, 128, 61, .12);
  }
  .sgbiicalc .sgbcalc-trustbox-icon span {
    width: 30px;
    height: 30px;
    border-width: 3px;
    font-size: 18px;
  }
  .sgbiicalc .sgbcalc-trustbox-overline {
    margin-bottom: 4px;
    font-size: 10px;
    letter-spacing: .07em;
  }
  .sgbiicalc .sgbcalc-trustbox-title {
    font-size: 19px;
    line-height: 1.2;
  }
  .sgbiicalc .sgbcalc-trustbox-text,
  .sgbiicalc .sgbcalc-trustbox-note {
    font-size: 13.5px;
    line-height: 1.48;
  }
  .sgbiicalc .sgbcalc-trustbox-features {
    gap: 6px;
    margin-top: 10px;
  }
  .sgbiicalc .sgbcalc-trustbox-chip {
    min-height: 28px;
    padding: 5px 8px;
    font-size: 11.5px;
  }
  .sgbiicalc .sgbcalc-calculator-shell {
    margin-top: 16px;
    padding: 14px 10px;
    border-radius: 14px;
  }
  .sgbiicalc .sgbcalc-calculator-shell-head {
    margin-bottom: 14px;
    padding-bottom: 12px;
  }
  .sgbiicalc .sgbcalc-calculator-shell-kicker {
    font-size: 17px;
  }
  .sgbiicalc .sgbcalc-calculator-shell-head p {
    font-size: 13.5px;
  }
}

/* V1.0.13 – kompakter Einstieg in Einkommen/Zuflüsse */
.sgbcalc-income-gate-action {
  margin-top: 8px;
}

.sgbcalc-child-income-hint {
  margin: -4px 0 8px;
  font-size: 13px;
  line-height: 1.4;
}

/* V1.0.14 – einklappbarer Bereich für Einkommen/Zuflüsse */
.sgbcalc-income-gate {
  margin-top: 18px;
}

.sgbcalc-income-gate-toggle {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 14px;
  min-height: 58px;
  margin-top: 8px;
  padding: 12px 14px;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  background: #f8fafc;
  color: var(--sgb-text);
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .15s, border-color .15s, box-shadow .15s;
}

.sgbcalc-income-gate-toggle:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
}

.sgbcalc-income-gate-toggle:focus-visible {
  outline: none;
  border-color: var(--sgb-text);
  box-shadow: 0 0 0 3px rgba(17,24,39,.12);
}

.sgbcalc-income-gate-text {
  color: var(--sgb-muted);
  font-size: 14px;
  line-height: 1.35;
}

.sgbcalc-income-gate-action-label {
  color: var(--sgb-text);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.sgbcalc-income-gate-switch {
  position: relative;
  width: 54px;
  height: 30px;
  border: 2px solid #cbd5e1;
  border-radius: 999px;
  background: #fff;
  flex: 0 0 auto;
  transition: border-color .15s, background .15s;
}

.sgbcalc-income-gate-switch span {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid #94a3b8;
  box-shadow: 0 1px 2px rgba(15,23,42,.18);
  transition: transform .15s, border-color .15s;
}

.sgbcalc-income-gate-toggle.is-open {
  border-style: solid;
  background: #ffffff;
}

.sgbcalc-income-gate-toggle.is-open .sgbcalc-income-gate-switch {
  border-color: var(--sgb-accent);
  background: var(--sgb-accent);
}

.sgbcalc-income-gate-toggle.is-open .sgbcalc-income-gate-switch span {
  transform: translateX(24px);
  border-color: #fff;
}

@media (max-width: 520px) {
  .sgbcalc-income-gate-toggle {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    padding: 12px;
  }
  .sgbcalc-income-gate-action-label {
    grid-column: 1 / -1;
    grid-row: 2;
  }
  .sgbcalc-income-gate-switch {
    grid-column: 2;
    grid-row: 1;
  }
}
