/* ==========================================================================
   immobilien-rechner.eu — Portfolio Design System V2
   ========================================================================== */

/* ---------- Self-hosted Fonts (GDPR compliant) ---------- */

@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('/fonts/lexend-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Lexend';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url('/fonts/lexend-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/source-sans-3-latin.woff2') format('woff2');
}

@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400 500;
  font-display: swap;
  src: url('/fonts/source-sans-3-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'IBM Plex Mono';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/ibm-plex-mono-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF;
}

/* ---------- Reset & Global ---------- */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

::selection { background: #BFDBFE; }

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

.ar-body {
  background: radial-gradient(ellipse at top, #EFF6FF 0%, #F8FAFC 50%);
  min-height: 100vh;
  font-family: 'Source Sans 3', system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #0F172A;
}

h1, h2, h3, h4 { font-family: 'Lexend', system-ui, sans-serif; }
code, pre, .font-mono { font-family: 'IBM Plex Mono', monospace; }

a { color: #2563EB; text-decoration: none; transition: color 150ms ease; }
a:hover { color: #1E3A8A; text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ---------- Utility ---------- */

.max-w-4xl { max-width: 56rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.text-center { text-align: center; }
.hidden { display: none; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.my-8 { margin-top: 2rem; margin-bottom: 2rem; }
.pt-6 { padding-top: 1.5rem; }
.pb-4 { padding-bottom: 1rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.gap-2 { gap: 0.5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.font-heading { font-family: 'Lexend', system-ui, sans-serif; }
.leading-relaxed { line-height: 1.625; }
.tracking-tight { letter-spacing: -0.025em; }
.relative { position: relative; }
.z-10 { z-index: 10; }
.z-20 { z-index: 20; }
.w-4 { width: 1rem; }
.h-4 { height: 1rem; }

@media (min-width: 640px) {
  .sm\:px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
  .sm\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 768px) {
  .md\:text-3xl { font-size: 1.875rem; }
  .md\:text-lg { font-size: 1.125rem; }
  .md\:pt-8 { padding-top: 2rem; }
  .md\:pb-6 { padding-bottom: 1.5rem; }
  .md\:-mt-8 { margin-top: -2rem; }
  .md\:flex-row { flex-direction: row; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- Flex / Grid helpers ---------- */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.grid { display: grid; }
.grid-cols-1 { grid-template-columns: 1fr; }

/* ---------- 1. Hero Section ---------- */

.hero-section {
  background: linear-gradient(135deg, #1E3A8A 0%, #2563EB 50%, #3B82F6 100%);
  position: relative;
  overflow: hidden;
}

.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.05;
  background-image:
    radial-gradient(circle at 20% 50%, white 1px, transparent 1px),
    radial-gradient(circle at 80% 20%, white 1px, transparent 1px),
    radial-gradient(circle at 50% 80%, white 1px, transparent 1px);
  background-size: 60px 60px, 80px 80px, 40px 40px;
}

/* ---------- 2. Pill Navigation ---------- */

.nav-pills {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: center;
  padding-bottom: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 9999px;
  font-size: 14px;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  text-decoration: none;
  white-space: nowrap;
  transition: all 200ms ease;
  border: 1px solid transparent;
}

.nav-pill:hover {
  color: #fff;
  background: rgba(255,255,255,0.1);
  text-decoration: none;
}

.nav-pill--active {
  color: #fff;
  background: rgba(255,255,255,0.2);
  border-color: rgba(255,255,255,0.15);
}

.nav-pill-icon {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .nav-pills { gap: 4px; padding-left: 8px; padding-right: 8px; }
  .nav-pill { padding: 6px 12px; font-size: 13px; }
  .nav-pill-icon { display: none; }
}

/* ---------- 3. Calculator Card ---------- */

.calc-card {
  background: #FFFFFF;
  border-radius: 20px;
  border-top: 4px solid #3B82F6;
  box-shadow: 0 20px 60px rgba(0,0,0,0.12), 0 8px 20px rgba(0,0,0,0.08);
  padding: 28px 24px;
  position: relative;
}

@media (min-width: 640px) {
  .calc-card { padding: 36px 32px; border-radius: 24px; }
}

.calc-heading {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.calc-heading-icon {
  width: 28px;
  height: 28px;
  color: #3B82F6;
}

.calc-heading h2 {
  font-size: 1.25rem;
  font-weight: 600;
  color: #0F172A;
}

/* ---------- 4. Input Fields ---------- */

.input-group { margin-bottom: 16px; }

.input-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: #475569;
  margin-bottom: 6px;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.input-wrap { position: relative; }

.input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: #94A3B8;
  pointer-events: none;
}

.ar-input {
  width: 100%;
  height: 48px;
  padding: 0 16px 0 42px;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  color: #0F172A;
  background: #FFFFFF;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.ar-input:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.ar-input::placeholder { color: #94A3B8; }

/* Input without icon */
.ar-input--no-icon { padding-left: 16px; }

/* Input with suffix */
.input-suffix-wrap { position: relative; }
.input-suffix {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #94A3B8;
  pointer-events: none;
}

/* Select styled */
.ar-select {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1.5px solid #E2E8F0;
  border-radius: 12px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  color: #0F172A;
  background: #FFFFFF;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2394A3B8' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.ar-select:focus {
  outline: none;
  border-color: #3B82F6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

/* Slider */
.ar-slider {
  width: 100%;
  height: 6px;
  -webkit-appearance: none;
  appearance: none;
  background: #E2E8F0;
  border-radius: 3px;
  outline: none;
}

.ar-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E3A8A, #3B82F6);
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(30, 58, 138, 0.3);
}

.ar-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E3A8A, #3B82F6);
  cursor: pointer;
  border: none;
}

/* Collapsible "Erweiterte Einstellungen" */
.collapsible-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
  font-size: 14px;
  font-weight: 500;
  color: #2563EB;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
}

.collapsible-trigger:hover { color: #1E3A8A; }

.collapsible-chevron {
  width: 16px;
  height: 16px;
  transition: transform 200ms ease;
}

.collapsible-trigger[aria-expanded="true"] .collapsible-chevron {
  transform: rotate(180deg);
}

.collapsible-content {
  overflow: hidden;
  max-height: 0;
  transition: max-height 300ms ease;
}

.collapsible-content.is-open { max-height: 500px; }

/* CTA Button */
.btn-primary {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #1E3A8A, #2563EB);
  color: #FFFFFF;
  font-family: 'Lexend', sans-serif;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: all 200ms ease;
  margin-top: 8px;
}

.btn-primary:hover {
  box-shadow: 0 4px 12px rgba(30, 58, 138, 0.3);
  transform: translateY(-1px);
}

.btn-primary:active { transform: translateY(0); }

/* Outline Button */
.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border: 1.5px solid #3B82F6;
  border-radius: 12px;
  background: transparent;
  color: #2563EB;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
}

.btn-outline:hover { background: #EFF6FF; }

/* ---------- 5. Result Section ---------- */

.result-card {
  background: linear-gradient(135deg, #F0FDF4 0%, #DCFCE7 100%);
  border-left: 4px solid #059669;
  border-radius: 14px;
  padding: 24px;
  margin-top: 20px;
  transition: all 300ms ease;
}

.result-card--loss {
  background: linear-gradient(135deg, #FEF2F2 0%, #FECACA 100%);
  border-left-color: #DC2626;
}

.result-card--neutral {
  background: linear-gradient(135deg, #EFF6FF 0%, #DBEAFE 100%);
  border-left-color: #2563EB;
}

.result-card--amber {
  background: linear-gradient(135deg, #FFFBEB 0%, #FEF3C7 100%);
  border-left-color: #D97706;
}

.result-label {
  font-size: 13px;
  font-weight: 500;
  color: #6B7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 4px;
}

.result-number {
  font-family: 'Lexend', sans-serif;
  font-weight: 700;
  font-size: 2rem;
  color: #059669;
  line-height: 1.2;
}

.result-number--loss { color: #DC2626; }
.result-number--blue { color: #2563EB; }
.result-number--amber { color: #D97706; }

@media (min-width: 640px) {
  .result-number { font-size: 2.5rem; }
}

/* Breakdown pills */
.result-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.result-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 500;
}

.result-pill--green { background: rgba(5,150,105,0.1); color: #047857; }
.result-pill--red { background: rgba(220,38,38,0.1); color: #DC2626; }
.result-pill--amber { background: rgba(217,119,6,0.1); color: #B45309; }
.result-pill--blue { background: rgba(37,99,235,0.1); color: #1D4ED8; }

.result-breakdown {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 14px;
  background: rgba(37, 99, 235, 0.1);
  border-radius: 9999px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  color: #1D4ED8;
}

.result-breakdown:empty { display: none; }

.copy-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 6px 16px;
  border-radius: 9999px;
  background: #FFFFFF;
  border: 1px solid #BFDBFE;
  color: #2563EB;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 150ms ease;
}

.copy-pill:hover { background: #EFF6FF; border-color: #2563EB; }

/* Cross-link CTA after result */
.result-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding: 8px 16px;
  border-radius: 10px;
  background: #EFF6FF;
  border: 1px solid #BFDBFE;
  color: #1D4ED8;
  font-size: 14px;
  font-weight: 500;
  text-decoration: none;
  transition: all 150ms ease;
}

.result-cta:hover { background: #DBEAFE; text-decoration: none; }

/* ---------- 6. Donut Chart (CSS-only) ---------- */

.donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 20px;
}

.donut {
  width: 180px;
  height: 180px;
  border-radius: 50%;
  position: relative;
}

@media (max-width: 480px) {
  .donut { width: 140px; height: 140px; }
}

.donut-center {
  position: absolute;
  inset: 25%;
  background: #FFFFFF;
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.donut-center-value {
  font-family: 'Lexend', sans-serif;
  font-weight: 700;
  font-size: 1.125rem;
  color: #0F172A;
}

.donut-center-label {
  font-size: 11px;
  color: #64748B;
}

.donut-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 16px;
  font-size: 13px;
  color: #475569;
}

.donut-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  display: inline-block;
}

/* ---------- 7. Bar Chart (Tilgungsplan) ---------- */

.bar-chart {
  display: flex;
  align-items: stretch;
  gap: 2px;
  height: 200px;
  padding: 0 4px;
  margin-top: 16px;
}

@media (min-width: 640px) {
  .bar-chart { height: 260px; gap: 3px; }
}

.bar-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
}

.bar-segment {
  width: 100%;
  border-radius: 2px 2px 0 0;
  transition: opacity 150ms ease;
}

.bar-segment:hover { opacity: 0.8; }

.bar-segment--interest { background: #FCD34D; }
.bar-segment--principal { background: #3B82F6; }

.bar-chart-legend {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 12px;
  font-size: 13px;
  color: #475569;
}

.bar-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-dot--interest { background: #FCD34D; }
.legend-dot--principal { background: #3B82F6; }
.legend-dot--restschuld { background: #94A3B8; }

/* ---------- 8. Result Table ---------- */

.result-table-wrap {
  overflow-x: auto;
  margin-top: 16px;
  border-radius: 12px;
  border: 1px solid #E2E8F0;
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.result-table th {
  background: #1E3A8A;
  color: #FFFFFF;
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
  font-size: 13px;
  padding: 12px 16px;
  text-align: right;
  white-space: nowrap;
  position: sticky;
  top: 0;
}

.result-table th:first-child { text-align: left; }

.result-table td {
  padding: 10px 16px;
  text-align: right;
  border-bottom: 1px solid #F1F5F9;
  white-space: nowrap;
}

.result-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: #475569;
}

.result-table tr:nth-child(even) { background: #F8FAFC; }
.result-table tr:hover { background: #EFF6FF; }

.result-table td.cell-interest { background: #FFFBEB; }
.result-table td.cell-principal { background: #EFF6FF; }

/* Highlight row for comparison table */
.result-table tr.row-highlight { background: #EFF6FF; font-weight: 600; }
.result-table tr.row-highlight td { font-weight: 600; color: #1E3A8A; }
.result-table tr.row-cheapest td:last-child { color: #059669; }
.result-table tr.row-expensive td:last-child { color: #DC2626; }

.table-toggle {
  display: block;
  width: 100%;
  padding: 10px;
  text-align: center;
  background: #F8FAFC;
  border: none;
  border-top: 1px solid #E2E8F0;
  color: #2563EB;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  border-radius: 0 0 12px 12px;
}

.table-toggle:hover { background: #EFF6FF; }

/* ---------- 9. Content Cards ---------- */

.content-card {
  background: #FFFFFF;
  border-radius: 16px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.04);
  padding: 28px 24px;
  margin-bottom: 24px;
}

@media (min-width: 640px) {
  .content-card { padding: 36px 32px; }
}

/* ---------- 10. Formula Blocks ---------- */

.formula-block {
  background: #1E3A8A;
  color: #FFFFFF;
  border-radius: 12px;
  padding: 24px;
  overflow-x: auto;
  border-left: 4px solid #3B82F6;
}

.formula-block code {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 15px;
  white-space: pre;
  color: #FFFFFF;
}

.formula-block--compact {
  padding: 16px 24px;
  text-align: center;
}

.formula-block--compact code { font-size: 18px; font-weight: 500; }

/* ---------- 11. Example Cards ---------- */

.example-card {
  position: relative;
  padding: 20px;
  border-radius: 12px;
  margin-bottom: 16px;
}

.example-card--blue { background: #EFF6FF; border-left: 4px solid #3B82F6; }
.example-card--green { background: #F0FDF4; border-left: 4px solid #059669; }
.example-card--amber { background: #FFFBEB; border-left: 4px solid #D97706; }

/* ---------- 12. FAQ Accordion ---------- */

.faq-list { border-top: 1px solid #E2E8F0; }

.faq-item { border-bottom: 1px solid #E2E8F0; }

.faq-question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  color: #0F172A;
  gap: 12px;
}

.faq-question::-webkit-details-marker { display: none; }

.faq-chevron {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #94A3B8;
  transition: transform 200ms ease;
}

details[open] .faq-chevron { transform: rotate(180deg); }

.faq-answer {
  padding: 0 0 16px 0;
  color: #475569;
  line-height: 1.6;
}

/* ---------- 13. Steps List ---------- */

.steps-list { position: relative; padding-left: 20px; }

.steps-list::before {
  content: '';
  position: absolute;
  left: 35px;
  top: 20px;
  bottom: 20px;
  width: 2px;
  background: linear-gradient(to bottom, #3B82F6, #93C5FD);
  border-radius: 1px;
}

.step-item {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 12px 0;
  position: relative;
}

.step-number {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1E3A8A, #3B82F6);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Lexend', sans-serif;
  font-weight: 700;
  font-size: 14px;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

/* ---------- 14. Related Rechner Cards ---------- */

.rechner-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

@media (min-width: 640px) {
  .rechner-cards { grid-template-columns: repeat(2, 1fr); }
}

.rechner-card {
  display: block;
  padding: 20px;
  background: #FFFFFF;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  text-decoration: none;
  transition: all 200ms ease;
  text-align: center;
}

.rechner-card:hover {
  border-color: #3B82F6;
  box-shadow: 0 4px 12px rgba(59,130,246,0.12);
  text-decoration: none;
  transform: translateY(-2px);
}

.rechner-card-icon { font-size: 2rem; margin-bottom: 8px; }

.rechner-card h3 {
  font-size: 1rem;
  font-weight: 600;
  color: #0F172A;
  margin-bottom: 4px;
}

.rechner-card p { font-size: 0.875rem; color: #64748B; }

/* ---------- 15. Wohnfläche: Room List ---------- */

.room-row {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr auto;
  gap: 8px;
  align-items: end;
  padding: 12px 0;
  border-bottom: 1px solid #F1F5F9;
}

@media (max-width: 640px) {
  .room-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
  .room-row .input-group { margin-bottom: 0; }
}

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

.room-remove {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 8px;
  background: #FEF2F2;
  color: #DC2626;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 150ms ease;
  margin-bottom: 16px;
}

.room-remove:hover { background: #FECACA; }

/* ---------- 16. Rendite Badge ---------- */

.rendite-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 10px;
  font-family: 'Lexend', sans-serif;
  font-weight: 600;
  font-size: 14px;
  margin-top: 12px;
}

.rendite-badge--good { background: #F0FDF4; color: #059669; border: 1px solid #A7F3D0; }
.rendite-badge--ok { background: #EFF6FF; color: #2563EB; border: 1px solid #BFDBFE; }
.rendite-badge--low { background: #FFFBEB; color: #D97706; border: 1px solid #FDE68A; }

/* ---------- 17. Footer ---------- */

.ar-footer {
  background: linear-gradient(135deg, #1E3A8A, #0F172A);
  margin-top: 48px;
}

.ar-footer a {
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  position: relative;
}

.ar-footer a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 1px;
  background: rgba(255, 255, 255, 0.5);
  transition: width 200ms ease;
}

.ar-footer a:hover { color: #FFFFFF; text-decoration: none; }
.ar-footer a:hover::after { width: 100%; }

/* ---------- Color tokens ---------- */

.text-green-400 { color: #4ADE80; }
.text-gain { color: #059669; }
.text-loss { color: #DC2626; }
.text-interest { color: #D97706; }
.text-principal { color: #2563EB; }
.text-muted { color: #64748B; }
.text-white\/85 { color: rgba(255,255,255,0.85); }
.text-white\/90 { color: rgba(255,255,255,0.9); }
.text-white\/70 { color: rgba(255,255,255,0.7); }
.text-white\/60 { color: rgba(255,255,255,0.6); }
.text-white\/50 { color: rgba(255,255,255,0.5); }
.text-white\/40 { color: rgba(255,255,255,0.4); }
.text-white { color: #FFFFFF; }
.border-white\/10 { border-color: rgba(255,255,255,0.1); }
.border-t { border-top-width: 1px; border-top-style: solid; }

/* ---------- Immobilien-specific color tokens ---------- */

.bg-kaufpreis { background: #2563EB; }
.bg-nebenkosten { background: #D97706; }
.bg-eigenkapital { background: #059669; }
.bg-restschuld { background: #DC2626; }
.bg-rendite-gut { background: #059669; }
.bg-rendite-ok { background: #2563EB; }
.bg-rendite-maessig { background: #D97706; }
.bg-flaeche-voll { background: #3B82F6; }
.bg-flaeche-anteil { background: #93C5FD; }
.bg-flaeche-null { background: #E2E8F0; }
.bg-zinsen { background: #FCD34D; }
.bg-tilgung { background: #3B82F6; }

/* ---------- Accessibility ---------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- Print ---------- */

@media print {
  .hero-section, .ar-footer, .copy-pill, .nav-pills, .donut-wrap, .bar-chart {
    display: none;
  }
  .content-card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}
