:root {
  --bg: #f1f5f9;
  --card-bg: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --primary: #2563eb;
  --positive: #16a34a;
  --negative: #dc2626;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  overscroll-behavior-x: none;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  padding: 0.85rem 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.topbar h1 {
  font-size: 1.05rem;
  margin: 0;
}

:root {
  --tabbar-h: 58px;
  --sidebar-w: 270px;
}

.pager {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  height: calc(100dvh - var(--chrome-h, 54px) - var(--tabbar-h) - env(safe-area-inset-bottom, 0px));
  -webkit-overflow-scrolling: touch;
}

/* --- Seiten-Leiste unten (Handy) ---------------------------------------- */

.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--card-bg);
  border-top: 1px solid var(--border);
}

.tab {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  border: none;
  background: transparent;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  padding: 0.3rem 0.1rem;
}

.tab-icon {
  font-size: 1.15rem;
  line-height: 1;
  filter: grayscale(1);
  opacity: 0.7;
}

.tab-label {
  font-size: 0.68rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.tab.active {
  color: var(--primary);
  font-weight: 600;
}

.tab.active .tab-icon {
  filter: none;
  opacity: 1;
}

.tab:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

/* --- Liste der Seiten und Abschnitte (Menü / Laptop links) --------------- */

.nav-immo {
  padding: 0.2rem 0;
}

.nav-item,
.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  color: var(--text);
  cursor: pointer;
}

.nav-item {
  padding: 0.65rem 1.1rem;
  font-size: 0.95rem;
  font-weight: 600;
}

.nav-sub-item {
  padding: 0.42rem 1.1rem 0.42rem 2.6rem;
  font-size: 0.88rem;
  color: var(--muted);
}

.nav-item:hover,
.nav-sub-item:hover {
  background: var(--bg);
}

.nav-item.active {
  background: #eff6ff;
  color: var(--primary);
  box-shadow: inset 3px 0 0 var(--primary);
}

.nav-item:focus-visible,
.nav-sub-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.nav-icon {
  width: 1.3rem;
  text-align: center;
}

.nav-label {
  flex: 1 1 auto;
  min-width: 0;
}

.nav-state {
  width: 1.1rem;
  text-align: center;
  font-weight: 700;
  color: #cbd5e1;
  flex: 0 0 auto;
}

.nav-state[data-state="ok"],
.group-state[data-state="ok"] {
  color: var(--positive);
}

.nav-state[data-state="teil"],
.group-state[data-state="teil"] {
  color: #d97706;
}

.nav-state[data-state="offen"],
.group-state[data-state="offen"] {
  color: #94a3b8;
}

.nav-count {
  font-size: 0.75rem;
  font-weight: 600;
  color: #d97706;
  background: #fef3c7;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
}

.nav-count:empty {
  display: none;
}

.nav-count[data-state="ok"] {
  color: #166534;
  background: #dcfce7;
}

/* Kopf einer Eingabe-Karte: Titel + ✓ / ● / ○ */
.card-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}

.card-head h2 {
  white-space: normal;
}

.group-state {
  font-weight: 700;
  font-size: 1.05rem;
  line-height: 1;
}

.group-missing {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem 0.6rem;
  margin: -0.35rem 0 0.85rem;
  padding: 0.45rem 0.6rem;
  border-radius: 8px;
  background: #fffbeb;
  color: #92400e;
  font-size: 0.8rem;
}

.group-missing[hidden] {
  display: none;
}

.card.flash {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
}

/* Handy: Fortschritt oben auf der Eingabeseite, öffnet die Liste */
.inputs-status {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0 0 1rem;
  padding: 0.7rem 0.95rem;
  border: 1px solid #fde68a;
  border-radius: 12px;
  background: #fffbeb;
  color: #92400e;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.inputs-status[data-state="ok"] {
  border-color: #bbf7d0;
  background: #f0fdf4;
  color: #166534;
}

.inputs-status-go {
  font-weight: 500;
  white-space: nowrap;
}

.link-btn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: var(--primary);
  text-decoration: underline;
  cursor: pointer;
}


/* --- Unterpunkte: eine Kachel auf einmal, wischen zur nächsten ---------
   Die Seiten sind nur Gruppen; jede Kachel steht in ihrer eigenen .slide. */
.page,
.bereich-fields {
  display: contents;
}

.slide {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  padding: 1rem 1rem 1.5rem;
}

.slide[hidden] {
  display: none;
}

.slide > .card,
.slide > .chart-card {
  margin-bottom: 0.6rem;
}

.slide-note {
  margin: 0 0 0.4rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
}

.slide-steps {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
}

.slide-step {
  max-width: 48%;
  border: none;
  background: none;
  padding: 0.45rem 0.2rem;
  font: inherit;
  font-size: 0.85rem;
  color: var(--primary);
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.slide-step[data-step="1"] {
  margin-left: auto;
  text-align: right;
}

.slide-step:hover {
  text-decoration: underline;
}

/* Leiste unter dem Kopf: Unterpunkte (Handy) + Jahr-Wahl (Ergebnisse) */
.sub-chips {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding: 0.45rem 0.8rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
  flex: 0 0 auto;
}

.sub-chips::-webkit-scrollbar {
  display: none;
}

.sub-chip {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  font: inherit;
  font-size: 0.82rem;
  white-space: nowrap;
  cursor: pointer;
}

.sub-chip[hidden] {
  display: none;
}

.sub-chip .nav-state {
  width: auto;
}

.sub-chip .nav-state:empty {
  display: none;
}

.sub-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.sub-chip.active .nav-state {
  color: #fff;
}

.subbar .blick {
  margin: 0;
  padding: 0.45rem 0.8rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.blick[hidden],
.nav-sub-item[hidden] {
  display: none;
}

/* Liste links: Unterpunkte nur bei der offenen Seite / dem offenen Bereich */
.nav-sub:not(.open) {
  display: none;
}

.legal-body.deck {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  padding: 0;
}

.card,
.chart-card {
  background: var(--card-bg);
  border-radius: 14px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.card h2,
.chart-card h2 {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 0.85rem;
}

label {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 0.7rem;
}

label:last-child {
  margin-bottom: 0;
}

.field {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin-top: 0.3rem;
}

.field input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0.6rem 0.7rem;
  font-size: 1rem;
  outline: none;
  background: transparent;
  color: var(--text);
}

.field input:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}

.field .unit {
  padding: 0 0.7rem;
  color: var(--muted);
  font-size: 0.85rem;
  background: #f8fafc;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--border);
}

.result-row:last-child {
  border-bottom: none;
}

.result-row .label {
  color: var(--muted);
  font-size: 0.9rem;
}

.result-row .label[data-formula] {
  border-bottom: 1px dotted var(--border);
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.formula-tooltip {
  position: fixed;
  z-index: 50;
  max-width: 280px;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.85);
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.72rem;
  line-height: 1.45;
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity 0.15s ease, transform 0.15s ease;
}

.formula-tooltip.visible {
  opacity: 1;
  transform: translateY(0);
}

.formula-tooltip .formula-line {
  font-style: italic;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: 0.3rem;
}

.formula-tooltip .subst-line {
  color: rgba(255, 255, 255, 0.95);
  font-weight: 500;
}

.result-row .value {
  font-weight: 600;
  text-align: right;
}

.result-row.highlight .value {
  font-size: 1.45rem;
  color: var(--primary);
}

.value.positive {
  color: var(--positive);
}

.value.negative {
  color: var(--negative);
}

/* klein unter einem Wert: derselbe Betrag in heutigem Geld bzw. real */
.value .real,
.etf-row .real {
  display: block;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--muted);
}

.result-row.highlight .value .real {
  font-size: 0.78rem;
}

.real-note {
  margin: 0 0 0.4rem;
}

.chart-card canvas {
  width: 100% !important;
  height: 230px !important;
}

.chart-note {
  margin: 0.5rem 0 0;
}

.schnelltest-intro {
  margin: -0.3rem 0 1rem;
  font-size: 0.8rem;
  color: var(--muted);
}

.gauge {
  margin-bottom: 1.35rem;
}

.gauge:last-child {
  margin-bottom: 0;
}

.gauge-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.5rem;
}

.gauge-title {
  font-size: 0.88rem;
  font-weight: 600;
}

.gauge-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.55rem;
  border-radius: 999px;
  white-space: nowrap;
}

.gauge-badge[data-tone="good"] {
  background: #dcfce7;
  color: #15803d;
}

.gauge-badge[data-tone="ok"] {
  background: #fef9c3;
  color: #854d0e;
}

.gauge-badge[data-tone="warn"] {
  background: #ffedd5;
  color: #c2410c;
}

.gauge-badge[data-tone="bad"] {
  background: #fee2e2;
  color: #b91c1c;
}

.gauge-badge[data-tone="neutral"] {
  background: #f1f5f9;
  color: var(--muted);
}

.gauge-badge[data-tone="info"] {
  background: #dbeafe;
  color: #1d4ed8;
}

.gauge-badge[data-tone="teal"] {
  background: #ccfbf1;
  color: #0f766e;
}

.slider-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem 0.5rem;
  margin-top: 0.3rem;
}

.slider-value-edit {
  display: flex;
  align-items: baseline;
  gap: 0.3rem;
}

.slider-value-input {
  font-size: 1.05rem;
  font-weight: 700;
  font-family: inherit;
  color: var(--text);
  background: transparent;
  border: none;
  border-bottom: 1px dashed var(--border);
  padding: 0 1px 1px;
  width: 8ch;
  outline: none;
}

.slider-value-input:focus {
  border-bottom-color: var(--primary);
  border-bottom-style: solid;
}

.slider-value-unit {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.slider-value-pct {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.slider-track-wrap {
  position: relative;
  margin: 0.75rem 0 1.3rem;
}

.slider-input {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 10px;
  border-radius: 6px;
  margin: 0;
  background: #e2e8f0;
  --thumb-color: #0f172a;
}

.slider-input::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 6px;
  background: transparent;
}

.slider-input::-moz-range-track {
  height: 10px;
  border-radius: 6px;
  background: transparent;
}

.slider-input::-moz-range-progress {
  background: transparent;
}

.slider-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  margin-top: -6px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--thumb-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.slider-input::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--thumb-color);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  cursor: pointer;
}

.slider-marker {
  position: absolute;
  top: -8px;
  bottom: -8px;
  width: 2px;
  background: #0f172a;
  opacity: 0.55;
  transform: translateX(-50%);
  pointer-events: none;
  z-index: 1;
}

.slider-marker-label {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  background: #fff;
  padding: 1px 4px;
  border-radius: 3px;
  border: 1px solid var(--border);
}

.slider-zones {
  position: relative;
  height: 32px;
}

.slider-zone {
  position: absolute;
  top: 0;
  font-size: 0.58rem;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--muted);
  text-align: center;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: break-word;
  padding: 0 1px;
}

.gauge-value {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.gauge-value strong {
  color: var(--text);
  font-size: 1rem;
}

.gauge-track-wrap {
  position: relative;
  height: 34px;
  margin-top: 0.65rem;
}

.gauge-track {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 9px;
  border-radius: 5px;
}

.gauge-marker {
  position: absolute;
  top: -3px;
  width: 15px;
  height: 15px;
  margin-left: -7.5px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid #0f172a;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  z-index: 2;
  transition: left 0.2s;
}

.gauge-tick {
  position: absolute;
  top: 13px;
  transform: translateX(-50%);
  text-align: center;
}

.gauge-tick-line {
  display: block;
  width: 1px;
  height: 6px;
  background: #94a3b8;
  margin: 0 auto;
}

.gauge-tick-label {
  display: block;
  font-size: 0.65rem;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
}

.hint {
  text-align: center;
  color: var(--muted);
  font-size: 0.8rem;
  padding: 0.25rem 0 1.25rem;
}

.verhandlung-note {
  margin: 0.85rem 0 0;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.45;
}

.argument-item {
  padding: 0.7rem 0.85rem;
  border-left: 3px solid var(--negative);
  background: #fef2f2;
  border-radius: 8px;
  margin-bottom: 0.7rem;
}

.argument-item:last-child {
  margin-bottom: 0;
}

.argument-title {
  font-weight: 700;
  font-size: 0.88rem;
  color: #b91c1c;
  margin-bottom: 0.3rem;
}

.argument-text {
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.45;
}

/* --- Hamburger-Menü & Rechtliches ------------------------------------ */

.topbar-left {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.menu-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  width: 36px;
  height: 36px;
  margin: -6px 0 -6px -8px;
  padding: 0 8px;
  border: none;
  border-radius: 8px;
  background: transparent;
  cursor: pointer;
}

.menu-btn span {
  display: block;
  height: 2px;
  border-radius: 1px;
  background: var(--text);
}

.menu-btn:hover,
.icon-btn:hover {
  background: var(--bg);
}

.menu-btn:focus-visible,
.icon-btn:focus-visible,
.side-menu-item:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.icon-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  z-index: 30;
  background: rgba(15, 23, 42, 0.4);
}

.side-menu {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 31;
  width: min(280px, 82vw);
  background: var(--card-bg);
  box-shadow: 2px 0 16px rgba(0, 0, 0, 0.15);
  padding: 0.5rem 0 1rem;
  transform: translateX(-105%);
  transition: transform 0.22s ease;
  visibility: hidden;
  overflow-y: auto;
}

.side-menu.open {
  transform: translateX(0);
  visibility: visible;
}

.side-menu-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.3rem 0.6rem 0.6rem 1.1rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 0.4rem;
}

.side-menu-title {
  font-weight: 700;
  font-size: 1rem;
}

.side-menu-item {
  display: block;
  width: 100%;
  padding: 0.85rem 1.1rem;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 0.95rem;
  color: var(--text);
  cursor: pointer;
}

.side-menu-item:hover {
  background: var(--bg);
}

.legal-overlay {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  flex-direction: column;
  background: var(--bg);
}

.legal-overlay[hidden],
.menu-backdrop[hidden],
#settings [hidden] {
  display: none;
}

.legal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.6rem 0.5rem 1.1rem;
  background: var(--card-bg);
  border-bottom: 1px solid var(--border);
}

.legal-head h2 {
  font-size: 1.05rem;
  margin: 0;
}

.legal-body {
  flex: 1;
  overflow-y: auto;
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 1rem 1.1rem 3rem;
  font-size: 0.9rem;
  line-height: 1.55;
}

.legal-body h3 {
  font-size: 0.95rem;
  margin: 1.4rem 0 0.4rem;
}

.legal-body h3:first-child {
  margin-top: 0.3rem;
}

.legal-body p {
  margin: 0 0 0.7rem;
}

.legal-body a {
  color: var(--primary);
  overflow-wrap: anywhere;
}

.legal-stand {
  margin-top: 1.5rem !important;
  color: var(--muted);
  font-size: 0.8rem;
}

/* --- Mehrere Immos, Sync, Kredite (2026-11) ----------------------------- */

.muted {
  color: var(--muted);
}

.small {
  font-size: 0.8rem;
}

.positive {
  color: var(--positive);
}

.negative {
  color: var(--negative);
}

.topbar-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.topbar-titles h1 {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.immo-switch {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 58vw;
  padding: 0;
  border: none;
  background: transparent;
  font: inherit;
  font-weight: 700;
  font-size: 1rem;
  color: var(--text);
  cursor: pointer;
  text-align: left;
}

.immo-switch #immo-switch-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.immo-switch .caret {
  color: var(--muted);
  font-size: 0.75rem;
}

.sync-dot {
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #cbd5e1;
}

.sync-dot[data-state="ok"] {
  background: var(--positive);
}

.sync-dot[data-state="syncing"],
.sync-dot[data-state="pending"] {
  background: #eab308;
}

.sync-dot[data-state="offline"],
.sync-dot[data-state="warn"] {
  background: #f97316;
}

.sync-dot[data-state="error"] {
  background: var(--negative);
}

.sync-status[data-state="error"] {
  color: var(--negative);
}

.sync-status[data-state="ok"] {
  color: var(--positive);
}

.field select,
.field textarea {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0.6rem 0.7rem;
  font: inherit;
  font-size: 1rem;
  background: transparent;
  color: var(--text);
  outline: none;
  resize: vertical;
}

.card-global {
  border-left: 3px solid #a5b4fc;
}

.est-badge {
  display: none;
  font-size: 0.72rem;
  font-weight: 600;
  color: #854d0e;
  background: #fef3c7;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  margin-left: 0.2rem;
}

.is-estimated .est-badge {
  display: inline-block;
}

.is-estimated .field {
  border-color: #fcd34d;
}

.source-box {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.7rem;
  font-size: 0.88rem;
}

.source-head {
  font-size: 0.75rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.source-title {
  font-weight: 600;
  margin-top: 0.2rem;
}

.source-link {
  color: var(--primary);
  display: inline-block;
  margin-top: 0.3rem;
}

.btn,
.btn-small {
  display: inline-block;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

.btn {
  padding: 0.6rem 0.9rem;
  font-size: 0.9rem;
  margin-top: 0.6rem;
}

.btn-small {
  padding: 0.35rem 0.6rem;
  font-size: 0.8rem;
  background: #e0e7ff;
  color: #1e3a8a;
}

.btn-secondary {
  background: #e2e8f0;
  color: var(--text);
}

.btn-danger {
  background: #fee2e2;
  color: #991b1b;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.file-btn {
  margin-bottom: 0;
}

.side-menu-sep {
  height: 1px;
  background: var(--border);
  margin: 0.4rem 0;
}

.chip {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  background: #e2e8f0;
  color: #334155;
  vertical-align: middle;
}

.chip-neu {
  background: #dbeafe;
  color: #1e40af;
}

.chip-beobachten {
  background: #fef3c7;
  color: #854d0e;
}

.chip-verworfen {
  background: #f1f5f9;
  color: #94a3b8;
}

.chip-gekauft,
.chip-good {
  background: #dcfce7;
  color: #166534;
}

.chip-est {
  background: #fef3c7;
  color: #854d0e;
}

.overview-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.8rem;
}

.overview-toolbar .btn {
  margin-top: 0;
}

.overview-toolbar select {
  font: inherit;
  padding: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card-bg);
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0;
  font-size: 0.85rem;
}

.immo-item {
  background: var(--card-bg);
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  margin-bottom: 0.7rem;
  border: 2px solid transparent;
}

.immo-item.current {
  border-color: #93c5fd;
}

.immo-open {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  text-align: left;
  font: inherit;
  color: inherit;
  padding: 0.75rem 0.9rem 0.4rem;
  cursor: pointer;
}

.immo-name {
  font-weight: 700;
}

.immo-facts {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.15rem;
}

.immo-kpis {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.8rem;
  font-size: 0.85rem;
  margin-top: 0.35rem;
}

.offer-ek {
  margin: 0.2rem 0 0.5rem;
}

.offer-ek-head {
  flex-wrap: wrap;
  gap: 0.3rem 0.6rem;
}

.offer-ek-label {
  font-size: 0.78rem;
  width: 100%;
}

.offer-ek.gleich .slider-value-input {
  color: #475569;
}

.lock-btn {
  margin-left: auto;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.85rem;
  line-height: 1.3;
  cursor: pointer;
  align-self: center;
}

.card-head .group-state + .lock-btn {
  margin-left: 0.4rem;
}

.offer-head {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.lock-btn.flash {
  animation: lock-flash 0.9s ease;
}

@keyframes lock-flash {
  0%, 100% { transform: scale(1); box-shadow: none; }
  30% { transform: scale(1.25); box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.25); }
}

.locked .field input,
.locked .field textarea,
.locked .field select,
.locked .slider-input,
.locked .slider-value-input {
  background: #f1f5f9;
  color: #334155;
}

.locked select,
.locked input[type="range"],
.locked input[type="checkbox"] {
  pointer-events: none;
}

.argument-item.stufe-rot .argument-title,
.verhandlung-punkte li.mangel {
  font-weight: 600;
}

.param-links a {
  white-space: nowrap;
}

[data-param-label][hidden] {
  display: none;
}

.wie-inflation {
  display: block;
  margin-top: 0.2rem;
}

.nachf-gruppe {
  border-top: 1px solid var(--border);
  padding: 0.5rem 0;
}

.nachf-gruppe-kopf {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  font-weight: 600;
  font-size: 0.9rem;
}

.nachf-gruppe-kopf [data-confirm-group] {
  margin-left: auto;
}

.nachf-felder {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.nachf-feld {
  cursor: pointer;
  border: 1px solid var(--border);
}

.nachf-fortschritt {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.nachf-balken {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: var(--border);
  overflow: hidden;
}

.nachf-balken span {
  display: block;
  height: 100%;
  background: #16a34a;
}

.nachf-item {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.5rem 0;
  border-top: 1px solid var(--border);
  font-size: 0.9rem;
  cursor: pointer;
}

.nachf-item input {
  margin-top: 0.2rem;
  width: 1.15rem;
  height: 1.15rem;
  flex: none;
}

.nachf-item.erledigt strong {
  color: #15803d;
}

.nachf-text {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.4;
  margin-top: 0.15rem;
}

.ek-aufteilung {
  margin-top: 0.35rem;
  line-height: 1.45;
}

.einmal-st {
  margin: 0.4rem 0 0.6rem;
}

.einmal-st-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr auto;
  gap: 0 0.5rem;
  align-items: end;
}

.einmal-st-row .einmal-st-note {
  grid-column: 1 / -1;
  margin: -0.2rem 0 0.5rem;
}

.link-field {
  display: flex;
  gap: 0.4rem;
  align-items: center;
}

.link-field input {
  flex: 1;
  min-width: 0;
}

.link-open {
  white-space: nowrap;
  text-decoration: none;
}

.immo-switch-row {
  display: flex;
  align-items: center;
  min-width: 0;
}

.topbar-link {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0 0.35rem;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  color: inherit;
  opacity: 0.85;
}

.topbar-link:hover {
  opacity: 1;
  background: rgba(255, 255, 255, 0.15);
}

.topbar-link[hidden],
.link-open[hidden] {
  display: none;
}

.immo-actions a.btn-small {
  text-decoration: none;
}

.immo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0 0.9rem 0.7rem;
}

.stress-table {
  font-size: 0.85rem;
}

.stress-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.8rem;
  padding: 0.4rem 0;
  border-bottom: 1px solid var(--border);
}

.stress-row span:not(:first-child) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.stress-row:last-child {
  border-bottom: none;
}

.stress-row[data-arg="s:alles"] {
  font-weight: 600;
}

.stress-head {
  color: var(--muted);
  font-size: 0.75rem;
}

.offer {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem;
  margin-bottom: 0.7rem;
}

.offer-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 0.6rem;
}

.offer-field {
  font-size: 0.78rem;
  margin-bottom: 0.4rem;
}

.offer-field .field input {
  padding: 0.4rem 0.5rem;
  font-size: 0.9rem;
}

.offer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.3rem;
}

/* Angebote je Bank, Varianten (2026-11-16) */
.offer-group.mehrere {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.5rem 0.5rem 0;
  margin-bottom: 0.9rem;
  background: #f8fafc;
}

.offer-group-head {
  font-weight: 700;
  margin: 0 0 0.5rem 0.2rem;
}

.offer-group.mehrere .offer {
  background: #fff;
}

.offer.variante {
  border-left: 3px solid #93c5fd;
}

.variante-hint {
  margin: 0 0 0.5rem;
}

.link-chip {
  display: inline-block;
  margin: -0.25rem 0 0.4rem;
  border: 1px solid var(--border);
  background: #fff;
  border-radius: 999px;
  font-size: 0.68rem;
  line-height: 1.2;
  padding: 0.05rem 0.45rem;
  color: var(--muted);
  cursor: pointer;
}

.link-chip.gleich {
  color: #1d4ed8;
  border-color: #bfdbfe;
  background: #eff6ff;
}

.offer-field.gleich .field input {
  background: #f1f5f9;
  color: #475569;
}

.offer-field-wrap .offer-field {
  margin-bottom: 0.3rem;
}

.compare-row {
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0;
}

.compare-row:last-child {
  border-bottom: none;
}

.compare-title {
  font-weight: 700;
}

.compare-row .result-row,
.verhandlung-bank .result-row {
  padding: 0.3rem 0;
  font-size: 0.88rem;
}

.verhandlung-bank {
  border-bottom: 1px solid var(--border);
  padding: 0.6rem 0;
}

.verhandlung-bank:last-child {
  border-bottom: none;
}

.verhandlung-punkte {
  margin: 0.4rem 0 0.4rem 1.1rem;
  padding: 0;
  font-size: 0.85rem;
  line-height: 1.45;
}

.compare-facts {
  font-size: 0.85rem;
  margin: 0.25rem 0 0.4rem;
  line-height: 1.5;
}


/* --- Darlehensteile, Konflikte (2026-11-13) -------------------------------- */

.offer-head {
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.teil {
  border-top: 1px dashed var(--border);
  margin-top: 0.4rem;
  padding-top: 0.4rem;
}

.teil-head {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.teil-betrag {
  color: var(--text);
  font-weight: 600;
}

.btn-link {
  border: none;
  background: transparent;
  color: var(--primary);
  font: inherit;
  font-size: 0.8rem;
  cursor: pointer;
  padding: 0;
  margin-left: auto;
  text-decoration: underline;
}

.compare-row.active {
  background: #eff6ff;
  border-radius: 8px;
  padding-left: 0.5rem;
  padding-right: 0.5rem;
}

.compare-effect {
  font-size: 0.82rem;
  margin-bottom: 0.4rem;
}

.chip-warn {
  background: #ffedd5;
  color: #9a3412;
}

.chip-bad {
  background: #fee2e2;
  color: #991b1b;
}

.active-offer-notice {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  margin-bottom: 0.7rem;
}

.active-offer-notice .btn-link {
  margin-left: 0;
}

.is-overridden .field {
  opacity: 0.5;
}

.conflict-banner {
  position: fixed;
  left: 0.6rem;
  right: 0.6rem;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 0.6rem);
  z-index: 25;
  max-height: 45vh;
  overflow-y: auto;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
  padding: 0.7rem 0.8rem;
  font-size: 0.85rem;
}

.conflict-banner[hidden] {
  display: none;
}

.conflict-head {
  font-weight: 700;
  margin-bottom: 0.4rem;
}

.conflict-item {
  border-top: 1px solid #fde68a;
  padding: 0.4rem 0;
}


.field-note {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.25rem;
}


/* --- Exposé-Leser (2026-11-13) ----------------------------------------------- */

.expose-badge {
  display: none;
  font-size: 0.72rem;
  font-weight: 600;
  color: #166534;
  background: #dcfce7;
  border-radius: 999px;
  padding: 0.05rem 0.45rem;
  margin-left: 0.2rem;
}

.is-expose .expose-badge {
  display: inline-block;
}

.est-badge.inline {
  display: inline-block;
}

.expose-box {
  margin-bottom: 0.7rem;
}

.expose-box .btn {
  margin-top: 0.3rem;
}

.expose-hint {
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  margin-bottom: 0.4rem;
}

.expose-hint .btn-link {
  margin-left: 0;
}

.expose-rows {
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0.8rem;
}

.expose-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.1rem 0.6rem;
  align-items: center;
  margin: 0;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
}

.expose-row:last-child {
  border-bottom: none;
}

.expose-row input {
  grid-row: span 2;
}

.expose-row.same {
  color: var(--muted);
}

.expose-name {
  font-weight: 600;
  font-size: 0.88rem;
}

.expose-vals {
  font-size: 0.85rem;
}

.expose-info {
  margin: 0 0 0.8rem;
  padding-left: 1.2rem;
  font-size: 0.88rem;
}


/* --- Favoriten (2026-11-13) ------------------------------------------------ */

.immo-item {
  position: relative;
}

.fav-btn {
  position: absolute;
  top: 0.45rem;
  right: 0.5rem;
  border: none;
  background: transparent;
  font-size: 1.3rem;
  line-height: 1;
  color: #94a3b8;
  cursor: pointer;
  padding: 0.2rem;
}

.fav-btn.on {
  color: #eab308;
}

.immo-open {
  padding-right: 2.5rem;
}


/* --- Rechenweg, Tabellen, Hilfe an den Eingaben (2026-11-13) -------------- */

main .result-row:has(.label[data-formula]),
main .explain-anchor,
.gauge[data-explain] {
  cursor: pointer;
}

main .result-row .label[data-formula]::after,
main .explain-anchor .stress-label::after {
  content: " ⓘ";
  color: #94a3b8;
  font-size: 0.8em;
}

main .result-row.explained,
main .explain-anchor.explained {
  border-bottom-color: transparent;
}

.explain {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  margin: 0.2rem 0 0.6rem;
  font-size: 0.85rem;
  line-height: 1.6;
  cursor: auto;
}

.explain.nested {
  background: var(--card-bg);
  margin: 0.5rem 0 0 0.4rem;
  border-left: 3px solid #bfdbfe;
}

.explain-title {
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.explain-formula {
  color: var(--muted);
  margin-bottom: 0.3rem;
}

.explain-line {
  margin: 0.15rem 0;
}

.explain .op {
  color: var(--muted);
}

.tok {
  display: inline-block;
  border-radius: 6px;
  padding: 0 0.3rem;
  background: #eef2f7;
  font: inherit;
  border: none;
  color: var(--text);
  line-height: 1.6;
}

.tok-label {
  color: var(--muted);
}

button.tok {
  cursor: pointer;
}

.tok-input {
  background: #ecfdf5;
  box-shadow: inset 0 0 0 1px #a7f3d0;
}

.tok-ref {
  background: #eff6ff;
  box-shadow: inset 0 0 0 1px #bfdbfe;
}

.tok-res {
  font-size: 0.95rem;
}

.explain .btn-link {
  margin: 0.2rem 0 0;
  display: inline-block;
}

.help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.15rem;
  height: 1.15rem;
  margin-left: 0.2rem;
  border-radius: 50%;
  border: 1px solid #cbd5e1;
  background: var(--card-bg);
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  vertical-align: middle;
  padding: 0;
}

.param-help {
  background: #f8fafc;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.5rem 0.7rem;
  font-size: 0.85rem;
  line-height: 1.5;
  margin: -0.3rem 0 0.8rem;
}

.param-source {
  margin-top: 0.3rem;
  font-weight: 600;
}

.param-deps {
  margin-top: 0.35rem;
}

.param-deps .tok {
  margin: 0.1rem 0;
}

label.flash .field {
  outline: 3px solid #fbbf24;
  outline-offset: 2px;
  transition: outline-color 0.3s;
}

.table-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.6rem 1rem 0;
}

.table-tabs .btn-small.active {
  background: var(--primary);
  color: #fff;
}

.table-note {
  padding: 0 1rem;
  margin: 0.4rem 0;
}

.table-wrap {
  flex: 1;
  overflow: auto;
  padding: 0 0.5rem 2rem;
}

.calc-table {
  border-collapse: collapse;
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  background: var(--card-bg);
}

.calc-table th,
.calc-table td {
  padding: 0.3rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: right;
}

.calc-table thead th {
  position: sticky;
  top: 0;
  background: #f1f5f9;
  z-index: 1;
}

.calc-table tbody th {
  position: sticky;
  left: 0;
  background: #f8fafc;
}

.calc-table tr.year-end td {
  border-bottom: 2px solid #cbd5e1;
}


/* --- Bestand (2026-11-13) ------------------------------------------------- */

.table-wrap-inline {
  overflow-x: auto;
  margin: 0.3rem 0 0.6rem;
}

.bestand-table {
  width: 100%;
}

.bestand-table tbody th {
  text-align: left;
  white-space: normal;
  position: static;
}

.bestand-table tr.sum th,
.bestand-table tr.sum td {
  font-weight: 700;
  border-top: 2px solid #cbd5e1;
}

.bestand-table tr.neu th,
.bestand-table tr.neu td {
  background: #eff6ff;
}

.bestand-summary {
  margin-bottom: 0.8rem;
}

/* --- Kennzahlen für Jahr … (oben auf "Ergebnisse") ------------------------ */

.blick {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin: 0 0 1rem;
}

.blick-label {
  font-size: 0.8rem;
  color: var(--muted);
  margin-right: 0.2rem;
}

.blick-chip {
  border: 1px solid var(--border);
  background: var(--card-bg);
  color: var(--text);
  border-radius: 999px;
  padding: 0.35rem 0.8rem;
  font: inherit;
  font-size: 0.85rem;
  cursor: pointer;
}

.blick-chip.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.blick-chip:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* --- Immo oder ETF? ------------------------------------------------------- */

.etf-verdict {
  margin: 0 0 0.8rem;
  font-size: 0.95rem;
  line-height: 1.45;
}

.etf-verdict[data-tone="positive"] strong {
  color: var(--positive);
}

.etf-row {
  display: grid;
  grid-template-columns: 1.1fr 1fr 1fr 1fr 0.7fr;
  gap: 0.4rem;
  padding: 0.4rem 0.3rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.82rem;
  font-variant-numeric: tabular-nums;
}

.etf-row span:not(:first-child) {
  text-align: right;
}

.etf-row[data-blick] {
  cursor: pointer;
}

.etf-row.active {
  background: #eff6ff;
  border-radius: 6px;
  font-weight: 600;
}

.etf-head {
  color: var(--muted);
  font-size: 0.72rem;
}

.etf-note {
  margin: 0.8rem 0 0;
  line-height: 1.45;
}

@media (max-width: 420px) {
  .etf-row {
    font-size: 0.74rem;
    gap: 0.25rem;
    padding-inline: 0;
  }
}

.stress-row {
  grid-template-columns: 1fr auto auto auto;
}

/* Überschriften in der Liste: "Diese Immo" / "Für alle Immos" */
.nav-heading {
  padding: 0.8rem 1.1rem 0.3rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.bereich-overlay .legal-body {
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}

/* --- Laptop: Liste immer links, rechts die gewählte Seite -----------------
   Steht am Ende, damit es die Handy-Regeln oben überschreibt. */

@media (min-width: 960px) {
  :root {
    --tabbar-h: 0px;
  }

  .tabbar,
  .menu-btn,
  #menu-close-btn,
  .menu-backdrop,
  .inputs-status,
  .sub-chips {
    display: none !important;
  }

  .side-menu {
    transform: none;
    transition: none;
    visibility: visible;
    width: var(--sidebar-w);
    box-shadow: none;
    border-right: 1px solid var(--border);
    z-index: 15;
  }

  .topbar,
  .pager {
    margin-left: var(--sidebar-w);
  }

  .conflict-banner {
    left: calc(var(--sidebar-w) + 0.6rem);
  }

  /* Profil, Annahmen, Suchkriterien: rechts neben der Liste */
  .bereich-overlay {
    left: var(--sidebar-w);
    z-index: 14;
  }

  .slide {
    padding-left: max(1.5rem, calc((100% - 860px) / 2));
    padding-right: max(1.5rem, calc((100% - 860px) / 2));
  }

  .legal-body.deck .slide {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

/* --- Kredit-Bewertung (2026-11-13) ----------------------------------------- */

.bew-row {
  display: flex;
  gap: 0.6rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.bew-row:last-of-type {
  border-bottom: none;
}

.bew-icon {
  font-size: 1.1rem;
  line-height: 1.4;
}

.bew-title {
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.bew-row p {
  margin: 0.2rem 0;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* --- Kredit-Pruefung: Nachrechnung + Pruefliste (pruefung.js) ------------- */

.teil-sub,
.pruef-teil {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0.5rem 0 0.3rem;
}

.pruef-list {
  list-style: none;
  margin: 0.2rem 0;
  padding: 0;
  font-size: 0.88rem;
  line-height: 1.5;
}

.pruef-list li {
  padding: 0.25rem 0;
}

.pruef-list .small {
  color: var(--muted);
}

.pruef-bad .small {
  color: #991b1b;
}

.pruef-warn .small {
  color: #9a3412;
}

.pruef-details,
.pruefliste {
  margin: 0.3rem 0 0.5rem;
  font-size: 0.88rem;
}

.pruef-details > summary,
.pruefliste > summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.2rem 0;
}

.pruef-frage {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--border);
}

.pruef-frage select {
  flex: none;
  min-width: 4.5rem;
}

/* --- Kapitaldienstfaehigkeit (Bewertung) --------------------------------- */

.kdf-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin: 0.3rem 0;
}

.kdf-table td {
  padding: 0.2rem 0;
  border-bottom: 1px solid var(--border);
}

.kdf-table td.num {
  text-align: right;
  white-space: nowrap;
  padding-left: 0.6rem;
}

.kdf-table .kdf-sum td {
  font-weight: 700;
  border-bottom: none;
}

/* Laufender Balken, solange ein Exposé gelesen wird */
.busy-bar {
  display: block;
  height: 4px;
  margin-bottom: 6px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent 0%, var(--primary) 50%, transparent 100%);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: busy-bar 1.1s linear infinite;
}
@keyframes busy-bar {
  from { background-position: -40% 0; }
  to { background-position: 140% 0; }
}
@media (prefers-reduced-motion: reduce) {
  .busy-bar { animation: none; background: var(--primary); opacity: 0.4; }
}

/* Eigentümer-Ampel */
.ampel-gesamt {
  font-weight: 600;
  margin: 8px 0 4px;
}
.ampel-liste {
  list-style: none;
  padding: 0;
  margin: 0 0 8px;
}
.ampel-liste li {
  padding: 4px 0;
  font-size: 0.92em;
  line-height: 1.4;
}

/* E-Mail-Scanner (Suchkriterien) */
.check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  margin: 8px 0;
}
.check-row input {
  width: 20px;
  height: 20px;
}
.scanner-status {
  border-left: 4px solid var(--border);
  padding: 2px 10px;
  margin: 8px 0;
}
.scanner-status[data-ton="ok"] { border-color: var(--positive); }
.scanner-status[data-ton="warn"] { border-color: #d97706; }
.scanner-status[data-ton="bad"] { border-color: var(--negative); }
.scanner-status ul { margin: 6px 0; padding-left: 18px; }

/* --- swiMMO ------------------------------------------------------------ */
.swimmo-title {
  font-weight: 800;
  letter-spacing: 0.02em;
}
.swimmo-title span {
  color: #e11d48;
}
.swimmo-zaehler {
  margin-left: auto;
  margin-right: 8px;
  color: var(--muted);
  font-size: 0.9em;
}
.swimmo-body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 12px 16px 20px;
  flex: 1;
  min-height: 0;
  box-sizing: border-box;
  overflow: hidden;
}
.swimmo-deck {
  position: relative;
  width: 100%;
  max-width: 420px;
  flex: 1;
  min-height: 380px;
}
.swimmo-card {
  position: absolute;
  inset: 0;
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  padding: 18px;
  overflow-y: auto;
  touch-action: none;
  user-select: none;
  transition: transform 0.22s ease, opacity 0.22s ease;
  transform: scale(0.96) translateY(10px);
}
.swimmo-card.oben {
  transform: none;
  cursor: grab;
}
.swimmo-card.zieht {
  transition: none;
  cursor: grabbing;
}
.swimmo-card.weg-rechts { transform: translate(140%, 0) rotate(18deg) !important; opacity: 0; }
.swimmo-card.weg-links { transform: translate(-140%, 0) rotate(-18deg) !important; opacity: 0; }
.swimmo-card.weg-hoch { transform: translate(0, -140%) !important; opacity: 0; }
.swimmo-name {
  font-size: 1.2em;
  font-weight: 700;
  margin-bottom: 4px;
}
.swimmo-preis {
  font-size: 1.6em;
  font-weight: 800;
  margin: 10px 0;
}
.swimmo-kpis {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.swimmo-kpis div {
  background: var(--bg);
  border-radius: 10px;
  padding: 8px;
}
.swimmo-kpis span {
  display: block;
  font-size: 0.75em;
  color: var(--muted);
}
.swimmo-checks {
  list-style: none;
  padding: 0;
  margin: 0 0 10px;
}
.swimmo-checks li {
  padding: 3px 0;
}
.swimmo-ampel {
  margin-bottom: 10px;
}
.merkmale {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 4px;
}
.immo-item .merkmale {
  gap: 4px;
  margin: 4px 0 2px;
  font-size: 0.8rem;
}
.swimmo-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}
.swimmo-stempel {
  position: absolute;
  top: 22px;
  padding: 4px 10px;
  border: 3px solid;
  border-radius: 8px;
  font-weight: 800;
  font-size: 1.1em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.1s;
}
.swimmo-stempel.ja { left: 18px; color: var(--positive); transform: rotate(-12deg); }
.swimmo-stempel.nein { right: 18px; color: var(--negative); transform: rotate(12deg); }
.swimmo-stempel.fav { left: 50%; transform: translateX(-50%); color: #d97706; }
.swimmo-card[data-zeigt="ja"] .swimmo-stempel.ja,
.swimmo-card[data-zeigt="nein"] .swimmo-stempel.nein,
.swimmo-card[data-zeigt="fav"] .swimmo-stempel.fav {
  opacity: 1;
}
.swimmo-actions {
  display: flex;
  gap: 18px;
  align-items: center;
}
.swimmo-btn {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--card-bg);
  font-size: 1.5em;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.1);
}
.swimmo-btn.undo { width: 44px; height: 44px; font-size: 1.1em; color: var(--muted); }
.swimmo-btn.nein { color: var(--negative); border-color: var(--negative); }
.swimmo-btn.ja { color: var(--positive); border-color: var(--positive); }
.swimmo-btn.fav { color: #d97706; border-color: #d97706; }
.swimmo-btn:disabled { opacity: 0.35; cursor: default; }
.swimmo-hint {
  text-align: center;
  max-width: 420px;
  margin: 0;
}
.swimmo-leer {
  text-align: center;
  padding: 40px 10px;
}
.swimmo-leer-icon {
  font-size: 3em;
}
@media (prefers-reduced-motion: reduce) {
  .swimmo-card { transition: none; }
}

/* Umgezogen: alte Adresse (Render) zeigt nur noch den Hinweis */
.umzug {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.umzug-karte {
  max-width: 460px;
  background: var(--card-bg);
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

/* Stand der App unten im Menü */
.menu-stand {
  padding: 14px 16px 8px;
  line-height: 1.35;
}

/* "Für alle Immos" in der Übersicht */
.overview-global {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  align-items: center;
  margin: 0 0 0.9rem;
  padding: 0.6rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
}

.overview-global-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--muted);
  margin-right: 0.2rem;
}

.chip-btn {
  font: inherit;
  font-size: 0.88rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--text);
  cursor: pointer;
}

.chip-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

/* Felder nebeneinander (Notar | Grundbuch) */
.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 0.7rem;
}

.field-row > label {
  min-width: 0;
}

/* Kaufnebenkosten in Euro unter "Kauf & Nebenkosten" */
.kauf-summe {
  margin-top: 0.4rem;
  padding: 0.6rem 0.75rem;
  border-radius: 10px;
  background: var(--bg);
  font-size: 0.9rem;
}

.kauf-zeile {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.12rem 0;
  font-variant-numeric: tabular-nums;
}

.kauf-gesamt {
  margin-top: 0.25rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
  font-weight: 700;
}

.kauf-abgleich {
  margin-top: 0.45rem;
  font-size: 0.86rem;
  color: #15803d;
}

.kauf-abgleich[data-ok="false"] {
  color: #b45309;
}

/* Suche in "Meine Immos" */
.overview-suche {
  margin-bottom: 0.6rem;
}

.overview-suche input {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--card-bg);
}

/* --- Vorstellung (PDF) --------------------------------------------------- */
.vorst-h { margin: 1rem 0 0.3rem; font-size: 0.95rem; }
.vorst-zeile { display: flex; justify-content: space-between; gap: 1rem; padding: 0.15rem 0; font-size: 0.85rem; }
.vorst-zeile span:last-child { text-align: right; }
.vorst-scroll { overflow-x: auto; }
.vorst-tab { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.vorst-tab th, .vorst-tab td { padding: 0.25rem 0.4rem; text-align: left; white-space: nowrap; }
.vorst-tab .num { text-align: right; font-variant-numeric: tabular-nums; }
.vorst-check { display: flex; align-items: center; gap: 0.5rem; }
.vorst-check input { width: auto; }
.vorst-knoepfe { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0.8rem 0; }
.lage-staedte { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.lage-score { font-size: 1.6rem; color: var(--primary); }

/* Dieselbe Wohnung aus mehreren Anzeigen (Meine Immos) */
.dubletten { grid-column: 1 / -1; flex-basis: 100%; margin: 4px 0.9rem; font-size: 0.85rem; }
.dubletten summary { cursor: pointer; padding: 6px 0; }
.dublette { display: flex; flex-wrap: wrap; gap: 6px; justify-content: space-between; padding: 6px 0; border-top: 1px solid rgba(128, 128, 128, 0.25); }
.chip-btn.dd-ja { background: #bbf7d0; color: #14532d; }
.chip-btn.dd-nein { background: #fecaca; color: #7f1d1d; text-decoration: line-through; }
#dd-karte { margin-top: 10px; }
#dd-karte summary { cursor: pointer; padding: 6px 0; }
.miete-feld { display: flex; gap: 6px; margin: 6px 0; }
.miete-feld input { flex: 1; min-width: 0; max-width: 240px; padding: 6px 8px; font-size: 16px; }
.immo-item > .miete-feld { margin: 4px 0.9rem; }

/* Exposé einlesen: woher ein Wert kommt (📄 Seite, 🧮 berechnet, ≈ geschätzt) */
.herkunft-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0 0.4rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 500;
  vertical-align: 1px;
}

.herkunft-seite {
  background: #dcfce7;
  color: #166534;
}

.herkunft-berechnet {
  background: #e0f2fe;
  color: #075985;
}

.herkunft-geschaetzt {
  background: #fef3c7;
  color: #92400e;
}

.expose-wie {
  display: block;
  font-size: 0.78rem;
  color: var(--muted);
}

.expose-fehlt {
  font-size: 0.85rem;
  margin: 0 0 0.8rem;
}

.expose-hint ul {
  margin: 0.3rem 0 0;
  padding-left: 1.2rem;
}

/* Häkchen weg: eigener Wert statt des gelesenen */
.expose-eigen {
  display: block;
  margin-top: 0.3rem;
  font-size: 0.82rem;
}

.expose-eigen[hidden] {
  display: none;
}

.expose-eigen select {
  width: auto;
  max-width: 100%;
}

.expose-eigen input,
.expose-eigen select {
  min-width: 9rem;
  padding: 0.2rem 0.4rem;
  font-size: 0.85rem;
}

/* ✎ vorläufig: selbst markierter Schätzwert (im ? am Feld) */
.vorl-badge {
  display: none;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0 0.4rem;
  border-radius: 999px;
  background: #ede9fe;
  color: #5b21b6;
}

.is-vorlaeufig .vorl-badge {
  display: inline-block;
}

.is-vorlaeufig .field {
  border-style: dashed;
  border-color: #a78bfa;
}

.vorl-check {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  font-weight: 500;
}

/* Editionen (edition.js): data-nur="server" gibt es nur in der Vollversion
   mit eigenem Server, data-nur="rechner" nur im Rechner zum Verkaufen. */
html[data-edition="rechner"] [data-nur="server"],
html:not([data-edition="rechner"]) [data-nur="rechner"] {
  display: none !important;
}
.btn .schloss { margin-left: 0.3em; font-size: 0.9em; }
