/* ============================================================
   FinanzHub — Rechner (editorial sheet)
   Sidebar inputs left, KPIs + chart + breakdown + scenarios right
   ============================================================ */

.rechner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 24px;
  padding: 28px 32px 56px;
  min-height: 100vh;
}
@media (max-width: 980px) {
  .rechner { grid-template-columns: 1fr; padding: 22px 18px 40px; }
}

/* Sidebar */
.r-sidebar {
  background: rgba(8,8,10,.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  height: fit-content;
  position: sticky;
  top: 24px;
}
.r-side-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 18px;
}
.r-section {
  margin-bottom: 22px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.r-section:last-of-type { border-bottom: 0; padding-bottom: 0; }
.r-plans-hint {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-mute);
  margin: -4px 0 12px;
  font-family: var(--font-italic);
  font-style: normal;
}

/* Jahres-Tabelle — aufklappbar unter dem Chart */
.r-jahrestabelle {
  margin: 18px 0 8px;
  border: 0.5px solid var(--line, rgba(255,255,255,.08));
  border-radius: 10px;
  padding: 4px 16px;
  background: rgba(0,0,0,.18);
}
.r-jahrestabelle summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 10px 0;
  user-select: none;
  list-style: none;
}
.r-jahrestabelle summary::-webkit-details-marker { display: none; }
.r-jahrestabelle summary::before {
  content: '▸';
  display: inline-block;
  margin-right: 8px;
  transition: transform .2s;
  color: var(--accent);
}
.r-jahrestabelle[open] summary::before { transform: rotate(90deg); }
.r-jahrestabelle summary:hover { color: var(--ink); }
.r-jahrestabelle-wrap { overflow-x: auto; max-height: 480px; overflow-y: auto; }
.r-jahrestabelle table {
  width: 100%;
  font-size: 13px;
  border-collapse: collapse;
  margin-top: 8px;
}
.r-jahrestabelle th {
  text-align: left;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-mute);
  padding: 8px 10px;
  border-bottom: 0.5px solid rgba(255,255,255,.12);
  font-weight: 600;
  position: sticky;
  top: 0;
  background: var(--bg, #0d0e12);
  z-index: 1;
}
.r-jahrestabelle th.num { text-align: right; }
.r-jahrestabelle td {
  padding: 7px 10px;
  border-bottom: 0.5px solid rgba(255,255,255,.05);
  color: var(--ink-soft);
}
.r-jahrestabelle td.num {
  text-align: right;
  font-family: var(--font-mono, 'JetBrains Mono', monospace);
  font-feature-settings: "tnum" 1;
}
.r-jahrestabelle td.num.pos { color: #6db98a; }
.r-jahrestabelle td.num.neg { color: #e24b4a; }
.r-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-mute);
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}
.r-section-label::after {
  content: "";
  flex: 1; height: 1px; background: var(--line);
}
.r-section-label-row::after { display: none; }
.r-section-label-row { justify-content: space-between; }
.r-section-label-row > span:first-child {
  display: inline-flex; align-items: center; gap: 8px;
}
.r-section-label-row > span:first-child::after {
  content: ""; display: inline-block; width: 22px; height: 1px;
  background: var(--line); margin-left: 2px;
}
.r-reset-btn {
  font-size: 10px; font-weight: 700; letter-spacing: .12em;
  text-transform: uppercase;
  background: transparent;
  border: 1px solid var(--line);
  color: var(--ink-mute);
  padding: 5px 10px; border-radius: 999px;
  cursor: pointer; font-family: inherit;
  transition: border-color .15s, color .15s, background .15s;
}
.r-reset-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(255,255,255,.02);
}

.r-content {
  display: flex; flex-direction: column;
  gap: 22px;
  min-width: 0;
}

/* Sheet header inside rechner */
.r-head {
  display: flex; align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 4px 4px 12px;
  border-bottom: 1px solid var(--line);
}
.r-head h1 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(36px, 4vw, 56px);
  text-transform: uppercase;
  letter-spacing: -.01em;
  line-height: .92;
}
.r-head h1 .it {
  font-family: var(--font-italic);
  font-style: normal;
  font-weight: 500;
  text-transform: none;
  font-size: .68em;
  color: var(--ink-soft);
}
.r-head .meta {
  font-family: var(--font-italic);
  font-style: normal;
  color: var(--ink-soft);
  font-size: 14px;
  text-align: right;
  max-width: 32ch;
  line-height: 1.5;
}

/* KPI layout — Rendite-Hero oben + 2x2-Grid darunter */
.r-kpi-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.r-kpi-sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 540px) {
  .r-kpi-sub-grid { grid-template-columns: 1fr; }
}
.r-kpi {
  background: var(--surface, rgba(13,14,18,.86));
  border: 1px solid var(--divider, var(--line));
  border-radius: var(--radius-lg);
  padding: 18px;
  transition: border-color .2s, transform .2s, background .2s;
}

/* Hero KPI — Rendite gesamt */
.r-kpi-hero {
  padding: 26px 28px;
  background: linear-gradient(135deg, var(--accent-soft, rgba(255,255,255,0.12)) 0%, var(--surface, rgba(13,14,18,.86)) 70%);
  border: 1.5px solid var(--accent-soft, var(--line-hi));
}
.r-kpi-hero-num {
  font-family: 'Inter', system-ui, sans-serif;
  font-weight: 800;
  font-size: clamp(40px, 5vw, 64px);
  letter-spacing: -2px;
  line-height: 1;
  color: var(--accent);
  margin: 12px 0 8px;
  font-variant-numeric: tabular-nums;
}
.r-kpi-hero-sub {
  font-family: 'Inter', sans-serif;
  font-style: normal;
  font-size: 15px;
  color: var(--text-muted, var(--ink-soft));
  line-height: 1.4;
}
.r-kpi:hover { border-color: var(--line-hi); transform: translateY(-2px); }
.r-kpi-tag {
  display: inline-block;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .22em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: 999px;
  margin-bottom: 14px;
  background: var(--accent-soft);
  color: var(--accent);
  /* Verhindert Worttrennung mitten im Wort wie "NACH STEU-ERN" */
  white-space: nowrap;
  word-break: keep-all;
  hyphens: none;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.r-kpi-tag.pos    { background: rgba(124,252,154,.10); color: var(--pos); }
.r-kpi-tag.warn   { background: rgba(255,255,255,.06); color: var(--heat-ink-soft, #999); }
.r-kpi-tag.neg    { background: rgba(210,132,132,.12); color: var(--neg); }
.r-kpi-tag.muted  { background: rgba(255,255,255,.06); color: var(--ink-soft); }
.r-kpi-num {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 24px;
  letter-spacing: -.01em;
  line-height: 1;
}
.r-kpi-num .cur { color: var(--accent); font-size: .7em; vertical-align: .18em; margin-right: .06em; font-weight: 700; }
.r-kpi-sub {
  font-size: 11px;
  color: var(--ink-mute);
  margin-top: 8px;
  line-height: 1.4;
}

/* Chart card + bottom grid */
.r-card {
  background: rgba(13,14,18,.86);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 22px 24px 26px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.r-card-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.r-card-title {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 18px;
  letter-spacing: -.005em;
  text-transform: uppercase;
}
.r-card-sub {
  font-family: var(--font-italic);
  font-style: normal;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 4px;
}
.r-chart-wrap { position: relative; }
.r-chart-wrap .r-chart { width: 100%; height: auto; display: block; }
.r-chart-legend {
  display: flex; flex-wrap: wrap; gap: 14px 22px;
  font: 600 11px/1.2 Manrope, Inter, sans-serif;
  color: rgba(250, 250, 247, .68);
  letter-spacing: .02em;
  padding: 0 0 12px;
}
.r-legend-item { display: inline-flex; align-items: center; gap: 7px; }
.r-legend-dot { width: 12px; height: 3px; border-radius: 2px; display: inline-block; }
.r-legend-dot.dashed {
  background: transparent !important;
  background-image: linear-gradient(90deg, var(--heat-ink-soft, #999) 50%, transparent 50%) !important;
  background-size: 6px 3px !important;
}

.r-bottom { display: grid; grid-template-columns: 1fr 1.6fr; gap: 22px; }
@media (max-width: 1100px) { .r-bottom { grid-template-columns: 1fr; } }

/* Breakdown bars */
.r-breakdown { display: flex; flex-direction: column; gap: 14px; }
.r-bd-row {}
.r-bd-meta { display: flex; justify-content: space-between; margin-bottom: 6px; }
.r-bd-label { font-size: 12px; color: var(--ink-soft); }
.r-bd-val {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--ink);
}
.r-bd-bg {
  height: 6px;
  background: var(--surface-3);
  border-radius: 3px;
  overflow: hidden;
}
.r-bd-fill {
  height: 100%;
  border-radius: 3px;
  transition: width .8s cubic-bezier(.4,0,.2,1);
}

/* Scenarios */
.r-sc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 760px) { .r-sc-grid { grid-template-columns: 1fr; } }
.r-sc {
  background: rgba(0,0,0,.32);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  transition: border-color .15s;
}
.r-sc:hover { border-color: var(--line-hi); }
.r-sc-head {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 14px;
}
.r-sc-name {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 14px;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.r-sc-badge {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
}
.r-sc-badge.pess { background: rgba(210,132,132,.15); color: var(--neg); }
.r-sc-badge.real { background: var(--accent-soft);    color: var(--accent); }
.r-sc-badge.opt  { background: rgba(124,252,154,.15); color: var(--pos); }
.r-sc-row {
  display: flex; justify-content: space-between;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  font-size: 12px;
}
.r-sc-row:last-child { border: 0; }
.r-sc-k { color: var(--ink-mute); }
.r-sc-v { font-weight: 600; font-family: var(--font-mono); }

/* Saved plans */
.r-plans-head {
  display: flex; gap: 8px; margin-bottom: 14px;
}
.r-plans-head input {
  flex: 1;
  padding: 10px 12px;
  background: rgba(0,0,0,.32);
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  font-size: 13px;
  outline: none;
}
.r-plans-head input:focus { border-color: var(--accent); }
.r-plan {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  background: rgba(0,0,0,.20);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s;
  margin-bottom: 6px;
}
.r-plan:hover { border-color: var(--accent); background: var(--accent-soft); }
.r-plan-name { font-size: 13px; font-weight: 500; }
.r-plan-meta { font-size: 11px; color: var(--ink-mute); margin-top: 2px; font-family: var(--font-mono); }
.r-plan-del {
  color: var(--ink-mute);
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all .15s;
}
.r-plan-del:hover { color: var(--neg); background: rgba(210,132,132,.1); }
.r-no-plans {
  font-size: 12px;
  color: var(--ink-mute);
  font-family: var(--font-italic);
  font-style: normal;
  text-align: center;
  padding: 14px 0;
}

.r-disclaimer {
  font-size: 11px;
  color: var(--ink-mute);
  text-align: center;
  margin-top: 10px;
  line-height: 1.6;
  font-family: var(--font-italic);
  font-style: normal;
}
