/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #0d1c3d;
  --bg-dark: #0d1117;
  --card: #111827;
  --gray-bar: #c8cdd6;
  --gray-bar-dark: #9aa0ab;
  --text: #e8eaed;
  --text-muted: #8b98a9;
  --green: #27ae60;
  --red: #e74c3c;
  --blue: #2980b9;
  --shadow: 0 2px 12px rgba(0,0,0,0.1);
  --radius: 10px;
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== SIMULATOR TITLE BAR (hero style, centered) ===== */
.site-header {
  background: #0d1c3d;
  color: white;
  padding: 48px 40px 44px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.site-header::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(206,22,26,0.12) 0%, transparent 55%);
  pointer-events: none;
}
.site-header h1 {
  position: relative;
  z-index: 1;
  font-size: clamp(28px, 4vw, 44px);
  font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  color: white;
  margin: 0;
}
.haushalt-gap {
  display: inline-block;
  background: #e74c3c;
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 12px;
  margin-left: 12px;
  vertical-align: middle;
  position: relative;
  z-index: 1;
}

.header-actions {
  position: absolute;
  top: 20px;
  right: 24px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}

@media (max-width: 640px) {
  .site-header { padding: 36px 20px 32px; }
  .header-actions { top: 14px; right: 14px; }
}

.header-icon-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
  line-height: 1;
}
.header-icon-btn:hover { background: rgba(255,255,255,0.16); }

/* ===== MAIN LAYOUT ===== */
.main {
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

/* ===== INCOME BAR SECTION ===== */
.income-section {
  width: 100%;
  background: transparent;
  padding: 24px 0 20px;
  margin-bottom: 0;
}
.income-inner {
  max-width: 100%;
  padding: 0 24px;
}

.income-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.income-label {
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
}
.income-label span {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.85rem;
  margin-left: 6px;
  opacity: 0.8;
}

.gear-btn {
  background: none;
  border: 1.5px solid #2d3748;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.85rem;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.15s;
  white-space: nowrap;
}
.gear-btn:hover { background: #1a2332; border-color: #4a5568; color: var(--text); }

/* ===== DUAL BAR LAYOUT ===== */
.dual-bars-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.dual-bar-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.dual-bar-label-col {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.einnahmen-bar-clickable {
  width: 100%;
  background: #1a1f2e;
  border-radius: 10px;
  height: 20vh;
  min-height: 70px;
  cursor: pointer;
  border: 2px solid rgba(39,174,96,0.15);
  transition: border-color 0.2s, box-shadow 0.2s;
  position: relative;
  overflow: hidden;
  user-select: none;
}
.einnahmen-bar-clickable:hover {
  border-color: rgba(39,174,96,0.45);
  box-shadow: 0 0 24px rgba(39,174,96,0.12);
}
.einnahmen-bar-fill {
  height: 100%;
  width: 100%;
  background: #0f3d1f;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  transition: width 0.4s ease;
  position: relative;
  overflow: hidden;
}
.einnahmen-bar-fill::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(39,174,96,0.15) 0%, transparent 60%);
  pointer-events: none;
}
.einnahmen-bar-clickable:hover .einnahmen-bar-fill {
  background: #143d22;
}
.einnahmen-bar-amount {
  font-size: 1.5rem;
  font-weight: 800;
  color: #4ade80;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
  position: relative;
}

/* Kreditaufnahme-Segment */
.kredit-segment {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  background: rgba(0,0,0,0.32);
  border-left: 2px dashed rgba(255,255,255,0.2);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 60px;
  padding: 0 12px;
  pointer-events: none;
  transition: width 0.4s ease;
}
.kredit-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.45);
  white-space: nowrap;
}
.kredit-amount {
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255,255,255,0.5);
  white-space: nowrap;
}

/* Rücklage-Segment (einmalige Rücklagenentnahme) */
.reserve-segment {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  background: rgba(210,160,60,0.28);
  border-left: 2px dashed rgba(255,220,140,0.35);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-width: 60px;
  padding: 0 12px;
  pointer-events: none;
  transition: width 0.4s ease, right 0.4s ease;
}
.reserve-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,220,140,0.7);
  white-space: nowrap;
}
.reserve-amount {
  font-size: 0.9rem;
  font-weight: 700;
  color: rgba(255,220,140,0.8);
  white-space: nowrap;
}

/* Drop zone / budget bar */
.budget-bar-wrap {
  position: relative;
  width: 100%;
  background: #2a2d3e;
  border-radius: 10px;
  height: 20vh;
  min-height: 70px;
  overflow: hidden;
  border: 2px solid transparent;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.budget-bar-wrap.drag-over {
  border-color: #3498db;
  background: #0d1f2d;
}
.budget-bar-wrap.drop-hint {
  animation: pulse-border 1s ease-in-out infinite alternate;
}
@keyframes pulse-border {
  from { border-color: transparent; }
  to   { border-color: #4a6070; }
}
.budget-bar-wrap.is-overflow {
  border-color: rgba(231,76,60,0.6);
  box-shadow: 0 0 18px rgba(231,76,60,0.25);
}

.budget-bar-overflow {
  display: none;
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  background: rgba(231,76,60,0.45);
  border-left: 2px solid rgba(231,76,60,0.9);
  align-items: center;
  justify-content: flex-end;
  padding-right: 14px;
  font-size: 0.8rem;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 1px 3px rgba(0,0,0,0.5);
}
.budget-bar-overflow.visible {
  display: flex;
}

.budget-bar-fill {
  display: flex;
  height: 100%;
  transition: width 0.4s ease;
}

.budget-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: white;
  text-shadow: 0 1px 2px rgba(0,0,0,0.3);
  min-width: 2px;
  overflow: hidden;
  white-space: nowrap;
  cursor: pointer;
  transition: filter 0.15s;
}
.budget-segment:hover { filter: brightness(1.1); }

.budget-bar-label {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  font-weight: 600;
  color: rgba(255,255,255,0.45);
  pointer-events: none;
}

.drop-hint-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.3);
  pointer-events: none;
}

/* Status bar */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.status-numbers {
  font-size: 0.85rem;
  color: var(--text-muted);
}
.status-numbers strong {
  color: var(--text);
}

.balance-badge {
  font-size: 0.9rem;
  font-weight: 700;
  padding: 5px 14px;
  border-radius: 20px;
  white-space: nowrap;
}
.balance-badge.deficit { background: rgba(231,76,60,0.15); color: #ff6b6b; border: 1px solid rgba(231,76,60,0.3); }
.balance-badge.surplus { background: rgba(39,174,96,0.15); color: #4ade80; border: 1px solid rgba(39,174,96,0.3); }
.balance-badge.balanced { background: rgba(39,174,96,0.15); color: #4ade80; border: 1px solid rgba(39,174,96,0.3); }

/* ===== BLOCKS POOL ===== */
.pool-section h2 {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
  margin-top: 8px;
}

.blocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}

.block-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 14px 14px 12px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  cursor: grab;
  position: relative;
  transition: transform 0.15s, box-shadow 0.15s, opacity 0.2s;
  border: 2.5px solid rgba(255,255,255,0.06);
  user-select: none;
  -webkit-user-select: none;
}
.block-card:active { cursor: grabbing; }
.block-card.dragging { opacity: 0.5; transform: scale(0.97); }
.block-card.in-budget {
  border-color: currentColor;
  opacity: 0.6;
}
.block-card.in-budget::after {
  content: '✓ im Haushalt';
  position: absolute;
  top: 6px;
  right: 34px;
  font-size: 0.65rem;
  font-weight: 600;
  background: rgba(255,255,255,0.1);
  padding: 2px 6px;
  border-radius: 8px;
}

.block-color-bar {
  height: 4px;
  border-radius: 2px;
  margin-bottom: 10px;
}

.block-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.block-icon { font-size: 1.3rem; line-height: 1; }

.block-name {
  font-size: 0.9rem;
  font-weight: 600;
  flex: 1;
  line-height: 1.3;
}

.block-gear-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px;
  opacity: 0.5;
  transition: opacity 0.15s;
  line-height: 1;
  flex-shrink: 0;
}
.block-gear-btn:hover { opacity: 1; }

.block-mrd {
  margin-top: 8px;
  font-size: 1.25rem;
  font-weight: 700;
}
.block-mrd-orig {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.block-mrd-mod {
  font-size: 0.75rem;
  font-weight: 600;
  margin-left: 4px;
}
.mod-plus { color: var(--red); }
.mod-minus { color: var(--green); }

.block-tap-hint {
  margin-top: 8px;
  font-size: 0.7rem;
  color: var(--text-muted);
}

/* ===== CTA BUTTON ===== */
.cta-wrap {
  text-align: center;
  margin: 32px 0 24px;
}

.btn-cta {
  background: linear-gradient(135deg, #1a6b3a 0%, #27ae60 100%);
  color: white;
  font-size: 1.15rem;
  font-weight: 700;
  padding: 18px 40px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  box-shadow: 0 4px 24px rgba(39,174,96,0.3);
  transition: transform 0.15s, box-shadow 0.15s;
  letter-spacing: 0.01em;
}
.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 32px rgba(39,174,96,0.45);
}
.btn-cta:active { transform: translateY(0); }

@keyframes cta-pulse {
  0%   { transform: scale(1); box-shadow: 0 4px 24px rgba(39,174,96,0.3); }
  30%  { transform: scale(1.07); box-shadow: 0 8px 36px rgba(39,174,96,0.55); }
  60%  { transform: scale(1); box-shadow: 0 4px 24px rgba(39,174,96,0.3); }
  80%  { transform: scale(1.05); box-shadow: 0 8px 32px rgba(39,174,96,0.5); }
  100% { transform: scale(1); box-shadow: 0 4px 24px rgba(39,174,96,0.3); }
}
.btn-cta-pulse {
  animation: cta-pulse 0.9s ease-in-out 3;
}

/* ===== REFORM OVERVIEW ===== */
.reform-zone {
  margin: 32px 0 24px;
}

.reform-overview {
  display: none;
  background: #111827;
  border-radius: 12px;
  padding: 4px 0 8px;
  border: 1px solid #1f2937;
}

.reform-overview-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 16px 20px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.reform-reset-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: none;
  border: none;
  padding: 4px 6px;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  cursor: pointer;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
}
.reform-reset-link:hover { color: var(--text); background: rgba(255,255,255,0.06); }
.reform-reset-link svg { display: block; }

.reform-section {
  padding: 16px 20px 8px;
}
.reform-section + .reform-section {
  border-top: 1px solid #1f2937;
}

.reform-section-title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.reform-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 5px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.reform-row:last-child { border-bottom: none; }

.reform-label {
  font-size: 0.88rem;
  color: var(--text);
  flex: 1;
  line-height: 1.4;
}
a.reform-label { text-decoration: none; transition: color .15s; }
a.reform-label:hover { color: #3498db; text-decoration: underline; }

.reform-delta {
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.delta-pos { color: #27ae60; }
.delta-neg { color: #e74c3c; }

/* ===== ACTIONS ===== */
.actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.btn {
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all 0.15s;
}
.btn-primary { background: var(--bg-dark); color: white; }
.btn-primary:hover { background: #263548; }
.btn-secondary { background: #1a2332; color: var(--text); border: 1.5px solid #2d3748; }
.btn-secondary:hover { background: #263548; }
.btn-share { background: #27ae60; color: white; }
.btn-share:hover { background: #219a52; }

/* ===== LIGHTBOX / MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 1000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: #111827;
  width: 100%;
  max-width: 600px;
  border-radius: 20px 20px 0 0;
  max-height: 85vh;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
  transform: translateY(40px);
  transition: transform 0.25s ease;
}
.modal-overlay.open .modal { transform: translateY(0); }

@media (min-width: 600px) {
  .modal-overlay { align-items: center; padding: 16px; }
  .modal { border-radius: 16px; max-height: 80vh; }
}

.modal-sticky-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid #1f2937;
  flex-shrink: 0;
  background: #111827;
  border-radius: 20px 20px 0 0;
}

@media (min-width: 600px) {
  .modal-sticky-header { border-radius: 16px 16px 0 0; }
}

.modal-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

/* ===== Exclusive-group confirmation dialog ===== */
.excl-confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0, 0, 0, 0.65);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.excl-confirm-card {
  background: #111827;
  color: var(--text);
  border-radius: 14px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
  max-width: 460px;
  width: 100%;
  padding: 24px;
  font-size: 0.92rem;
  line-height: 1.5;
}
.excl-confirm-card h3 {
  font-size: 1.1rem;
  margin: 0 0 12px;
  color: #fff;
}
.excl-confirm-card p { margin: 0 0 12px; }
.excl-confirm-list {
  list-style: none;
  margin: 8px 0 12px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.04);
  border-left: 3px solid #e74c3c;
  border-radius: 6px;
}
.excl-confirm-list li {
  padding: 4px 0;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
.excl-confirm-name { flex: 1; min-width: 0; }
.excl-confirm-delta { color: var(--text-muted); font-variant-numeric: tabular-nums; }
.excl-confirm-net { font-size: 0.9rem; color: var(--text-muted); }
.excl-confirm-net strong { color: var(--text); font-variant-numeric: tabular-nums; }
.excl-confirm-buttons {
  display: flex;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.excl-confirm-keep,
.excl-confirm-replace {
  flex: 1;
  min-width: 140px;
  border: none;
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 0.9rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  color: white;
}
.excl-confirm-keep { background: #27ae60; }
.excl-confirm-keep:hover { background: #219a52; }
.excl-confirm-keep:focus-visible { outline: 2px solid #b0f0d1; outline-offset: 2px; }
.excl-confirm-replace { background: #4a5568; }
.excl-confirm-replace:hover { background: #2d3748; }
.excl-confirm-keep:active,
.excl-confirm-replace:active { transform: scale(0.98); }

.modal-body {
  overflow-y: auto;
  padding: 20px 20px 32px;
  flex: 1;
}
.modal-body p {
  font-size: 0.92rem;
  line-height: 1.75;
  color: var(--text-muted);
  margin-bottom: 14px;
}
.modal-body p:last-child { margin-bottom: 0; }

.modal-handle {
  width: 40px;
  height: 4px;
  background: #2d3748;
  border-radius: 2px;
  margin: 0 auto 16px;
}

.modal-title {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.modal-title h3 { font-size: 1.2rem; font-weight: 700; }
.modal-icon { font-size: 1.5rem; }
.modal-stripe {
  display: block;
  width: 5px;
  height: 26px;
  border-radius: 3px;
  flex-shrink: 0;
  background: #6b7685;
}

.modal-mrd {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.modal-mrd span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }

.modal-desc {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 8px;
}
.modal-desc-short { margin-bottom: 6px; }
.modal-desc-toggle {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #3498db;
  cursor: pointer;
  text-decoration: none;
  font-size: 0.85rem;
}
.modal-desc-toggle:hover { text-decoration: underline; }
.modal-desc-full { margin-top: 8px; }

.modal-source {
  font-size: 0.75rem;
  margin-bottom: 20px;
}
.modal-source a { color: #3498db; text-decoration: none; }
.modal-source a:hover { text-decoration: underline; }

.modal-divider {
  border: none;
  border-top: 1px solid #1f2937;
  margin: 16px 0;
}

.sliders-title {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.slider-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid #1f2937;
  gap: 12px;
}
.slider-item:last-child { border-bottom: none; }

.slider-sub-item {
  background: rgba(39,174,96,0.06);
  border-left: 3px solid rgba(39,174,96,0.4);
  padding-left: 14px;
  margin-left: 12px;
  border-radius: 0 6px 6px 0;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

.slider-info { flex: 1; }
.slider-text {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.slider-detail {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin-bottom: 4px;
}
.slider-delta {
  font-size: 0.8rem;
  font-weight: 700;
}
.slider-delta.plus { color: var(--red); }
.slider-delta.minus { color: var(--green); }
.slider-source {
  font-size: 0.7rem;
}
.slider-source a { color: #3498db; text-decoration: none; }

/* Toggle switch */
.toggle-wrap { flex-shrink: 0; }
.toggle {
  position: relative;
  display: inline-block;
  width: 46px;
  height: 26px;
}
.toggle input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #2d3748;
  border-radius: 26px;
  transition: .2s;
}
.toggle-slider:before {
  content: '';
  position: absolute;
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background: white;
  border-radius: 50%;
  transition: .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.toggle input:checked + .toggle-slider { background: #27ae60; }
.toggle input:checked + .toggle-slider:before { transform: translateX(20px); }

.modal-close {
  background: #27ae60;
  border: none;
  border-radius: 8px;
  padding: 6px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}
.modal-close:hover { background: #2ecc71; }

/* Such-Ergebnisse */
.search-hint {
  color: var(--text-muted);
  font-size: 0.88rem;
  text-align: center;
  padding: 24px 8px;
  line-height: 1.6;
}
.search-ressort {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.search-excluded {
  background: rgba(52, 152, 219, 0.08);
  border: 1px solid rgba(52, 152, 219, 0.35);
  border-radius: 10px;
  padding: 14px 18px;
  margin-bottom: 14px;
}
.search-excluded-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #93c5fd;
  margin-bottom: 6px;
}
.search-excluded p {
  font-size: 0.9rem;
  color: #e4e7eb;
  line-height: 1.55;
  margin: 0 0 10px;
}
.search-excluded-link {
  display: inline-block;
  font-size: 0.9rem;
  font-weight: 700;
  color: #3498db;
  text-decoration: none;
}
.search-excluded-link:hover { color: #6ab7ff; text-decoration: underline; }

/* Weiter-zu-Button am Ende jeder Ressort-/Einnahmen-Lightbox */
.modal-next-btn {
  display: block;
  width: 100%;
  margin: 24px 0 4px;
  padding: 16px 20px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 12px;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}
.modal-next-btn:hover { background: #1d4ed8; }
.modal-next-btn:active { transform: scale(0.99); }

/* ===== BAR TOOLTIP ===== */
#bar-tooltip {
  position: fixed;
  pointer-events: none;
  z-index: 3000;
  background: #1e2a3a;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 8px;
  padding: 7px 13px;
  font-size: 0.85rem;
  color: var(--text);
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.12s, transform 0.12s;
}
#bar-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}
.bar-tooltip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.bar-tooltip-mrd {
  color: var(--text-muted);
  font-size: 0.8rem;
  margin-left: 2px;
}

/* ===== TOAST ===== */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--bg-dark);
  color: white;
  padding: 12px 24px;
  border-radius: 24px;
  font-size: 0.9rem;
  font-weight: 600;
  z-index: 2000;
  transition: transform 0.3s ease;
  white-space: nowrap;
}
.toast.show { transform: translateX(-50%) translateY(0); }

/* ===== EVAL SECTION (hidden until used) ===== */
.eval-section {
  display: none;
  background: var(--card);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.4);
  margin-top: 24px;
}
.eval-section.visible { display: block; }

.eval-title { font-size: 1rem; font-weight: 700; margin-bottom: 16px; }
.eval-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.eval-box {
  background: #0d1117;
  border-radius: 8px;
  padding: 14px;
}
.eval-box-label { font-size: 0.75rem; color: var(--text-muted); margin-bottom: 4px; }
.eval-box-val { font-size: 1.4rem; font-weight: 800; }
.eval-list { margin-top: 16px; }
.eval-list h4 { font-size: 0.85rem; font-weight: 600; color: var(--text-muted); margin-bottom: 8px; }
.eval-list ul { list-style: none; }
.eval-list li {
  font-size: 0.85rem;
  padding: 4px 0;
  border-bottom: 1px solid #1f2937;
  display: flex;
  justify-content: space-between;
}
.eval-list li:last-child { border-bottom: none; }

/* ===== RESPONSIVE ===== */
@media (max-width: 480px) {
  .blocks-grid { grid-template-columns: 1fr 1fr; }
  .block-name { font-size: 0.82rem; }
  .block-mrd { font-size: 1.1rem; }
  .budget-bar-wrap { height: 14vh; min-height: 56px; }
  .einnahmen-bar-clickable { height: 14vh; min-height: 56px; }
  .einnahmen-bar-amount { font-size: 1.1rem; }
  .einnahmen-bar-gear { font-size: 0.72rem; }
  .dual-bar-label-col { font-size: 0.7rem; }
  .income-inner { padding: 0 12px; }
}

@media (min-width: 768px) {
  .blocks-grid { grid-template-columns: repeat(3, 1fr); }
}

/* ===== SHARE-SEKTION (gemeinsamer Rahmen für alle Share-Buttons) ===== */
.share-section {
  border-top: 1px solid #1f2937;
  padding-top: 4px;
}

/* Prominente Top-Buttons (WhatsApp / Facebook / X — nur bei erkannter Herkunft) */
.wa-share-wrap,
.fb-share-wrap-top,
.x-share-wrap-top {
  padding: 12px 20px 0;
  display: block;
}
.btn-wa,
.btn-fb-top,
.btn-x-top {
  display: block;
  width: 100%;
  box-sizing: border-box;
  border: none;
  border-radius: 10px;
  padding: 13px 16px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  line-height: 1.2;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
  color: white;
  white-space: nowrap;
  text-align: center;
}
.btn-wa { background: #25D366; box-shadow: 0 2px 8px rgba(37,211,102,0.25); }
.btn-wa:hover { background: #1fb156; }
.btn-fb-top { background: #1877F2; box-shadow: 0 2px 8px rgba(24,119,242,0.25); }
.btn-fb-top:hover { background: #145ec8; }
.btn-x-top { background: #000; border: 1px solid #2a2a2a; box-shadow: 0 2px 8px rgba(0,0,0,0.35); }
.btn-x-top:hover { background: #1a1a1a; }
.btn-wa:active,
.btn-fb-top:active,
.btn-x-top:active { transform: scale(0.98); }

/* ===== TWO-BUTTON SHARE ROWS (Facebook + LinkedIn, Bluesky + Mastodon) ===== */
.bsky-share-wrap {
  padding: 12px 20px 0;
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.btn-bsky, .btn-mastodon, .btn-fb, .btn-linkedin, .btn-native {
  flex: 1;
  min-width: 120px;
  border: none;
  border-radius: 10px;
  padding: 13px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
  letter-spacing: 0.01em;
  white-space: nowrap;
  color: white;
}
.btn-bsky { background: #0085ff; }
.btn-bsky:hover { background: #0073e0; }
.btn-mastodon { background: #6364ff; }
.btn-mastodon:hover { background: #5253e0; }
.btn-fb { background: #1877f2; }
.btn-fb:hover { background: #145ec8; }
.btn-linkedin { background: #0a66c2; }
.btn-linkedin:hover { background: #0854a3; }
.btn-native { background: #3a76f0; }
.btn-native:hover { background: #2f63cf; }
.btn-bsky:active, .btn-mastodon:active,
.btn-fb:active, .btn-linkedin:active, .btn-native:active { transform: scale(0.98); }

/* ===== "More ways to share" text row ===== */
.fb-share-wrap {
  text-align: center;
  padding: 10px 20px 14px;
  font-size: 0.75rem;
  color: var(--text-muted);
  opacity: 0.6;
  transition: opacity 0.15s;
}
.fb-share-wrap:hover { opacity: 1; }
.more-ways-link {
  color: var(--text-muted);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.15s, text-decoration-color 0.15s;
}
.more-ways-link:hover {
  color: var(--text);
  text-decoration: underline;
}

/* ===== CONFIG CODE BAR ===== */
.config-code-bar {
  background: #000;
  text-align: center;
  padding: 18px 20px;
  margin-top: 40px;
}
.config-code-label {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #444;
  display: block;
  margin-bottom: 8px;
}
.config-code-value {
  font-family: 'Courier New', monospace;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  word-break: break-all;
}
.config-code-value a { color: #6b7685; text-decoration: none; }
.config-code-value a:hover { color: #9aa5b4; text-decoration: underline; }

.beta-badge {
  display: inline-block;
  background: #e74c3c;
  color: #fff;
  font-size: 0.55rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  vertical-align: middle;
  position: relative;
  top: -2px;
  cursor: default;
}
.beta-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #e2e8f0;
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255,255,255,0.1);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  white-space: normal;
  width: 260px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 9000;
}
.beta-badge:hover::after {
  opacity: 1;
}

.crosslink-hint {
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.07);
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 8px 16px;
}
.crosslink-hint a {
  color: #4ade80;
  text-decoration: none;
  font-weight: 600;
}
.crosslink-hint a:hover {
  text-decoration: underline;
}

/* ===== SONDERVERMÖGEN TOGGLE ===== */
.sv-toggle-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.sv-toggle-text {
  font-size: 0.78rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.budget-segment--sv {
  background-image: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 5px,
    rgba(255,255,255,0.12) 5px,
    rgba(255,255,255,0.12) 10px
  ) !important;
  border-left: 2px dashed rgba(255,255,255,0.35);
  position: relative;
}
.budget-segment--sv::after {
  content: 'SV';
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 0.5rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  background: rgba(255,255,255,0.18);
  padding: 1px 4px;
  border-radius: 3px;
  line-height: 1.4;
  pointer-events: none;
}

/* ===== VERGLEICH-FEATURE ===== */
.slider-compare-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  margin-left: 6px;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1;
  background: transparent;
  border: 1px solid #374151;
  border-radius: 6px;
  cursor: pointer;
  vertical-align: middle;
  opacity: 0.6;
  transition: opacity .15s, border-color .15s, background .15s;
}
.slider-compare-btn:hover {
  opacity: 1;
  border-color: #3498db;
  background: rgba(52, 152, 219, 0.12);
}
.vgl-list-group-title {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b7280;
  margin: 10px 0 4px;
  padding: 0 4px;
}
.vgl-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 10px 12px;
  background: #0f172a;
  color: #e4e7eb;
  border: 1px solid #1f2937;
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
  font: inherit;
  transition: border-color .12s, background .12s;
}
.vgl-list-item:hover {
  border-color: #3498db;
  background: #11253f;
}
.vgl-list-text {
  flex: 1;
  font-size: 0.9rem;
  line-height: 1.4;
}
.vgl-list-delta {
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.vgl-list-delta.plus { color: #10b981; }
.vgl-list-delta.minus { color: #ef4444; }
