/* ============================================================
   BITCOIN-RECHNER
   Ergänzt das zentrale Website-Design. Farben, Flächen, Schatten,
   Typografie, Navigation und Footer kommen aus den gemeinsamen CSS-Dateien.
   ============================================================ */
.calculator-page {
  --border-orange: rgba(247, 147, 26, 0.34);
  --green: #57cf83;
  --red: #ff6b78;
  --blue: #6aa9ff;
  --radius: 18px;
}

:root[data-theme="light"] .calculator-page {
  --border-orange: rgba(160, 91, 8, 0.30);
  --green: #16864a;
  --red: #c43a4a;
  --blue: #236fc9;
}

.calculator-shell button,
.calculator-shell input,
.calculator-shell select {
  font: inherit;
}

.calculator-shell {
  width: min(1240px, calc(100% - 32px));
  padding: 28px 0 64px;
}





.calculator-disclaimer {
  margin-top: 26px;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(145deg, var(--panel), var(--panel-warm));
  color: var(--muted);
  text-align: center;
  font-size: 0.82rem;
  box-shadow: var(--shadow), 0 0 18px rgba(247, 147, 26, 0.08);
}

.calculator-page .calculator-hero {
  min-height: auto;
  padding: 64px 0 48px;
}

.calculator-page .calculator-hero h1 {
  max-width: 100%;
  font-size: clamp(2.25rem, 5vw, 4.8rem);
  letter-spacing: -0.075em;
}

.calculator-page .hero-emblem {
  background:
    linear-gradient(145deg, rgba(247,147,26,0.13), rgba(247,147,26,0.025) 54%, transparent),
    var(--panel);
}

.calculator-page .floating-card,
.calculator-page .historical-value,
.calculator-page .comparison-card,
.calculator-page .method-stat {
  background: color-mix(in srgb, var(--panel) 90%, transparent);
}

.calculator-page .field label {
  color: var(--text);
}

.calculator-page .panel,
.calculator-page .metric,
.calculator-page .legal-callout,
.calculator-page .comparison-card,
.calculator-page .historical-value,
.calculator-page .method-stat {
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.calculator-page .panel:hover,
.calculator-page .metric:hover,
.calculator-page .legal-callout:hover,
.calculator-page .comparison-card:hover,
.calculator-page .historical-value:hover,
.calculator-page .method-stat:hover,
.calculator-page .panel.in-view,
.calculator-page .metric.in-view,
.calculator-page .legal-callout.in-view,
.calculator-page .comparison-card.in-view,
.calculator-page .historical-value.in-view,
.calculator-page .method-stat.in-view {
  transform: translateY(-8px);
  border-color: rgba(247, 147, 26, 0.72);
  box-shadow: var(--shadow), 0 0 38px rgba(247, 147, 26, 0.34);
}

@media (max-width: 820px) {
  .calculator-page .calculator-hero {
    padding: 42px 0 34px;
  }

  .calculator-page .calculator-hero h1 {
    font-size: clamp(2.1rem, 10vw, 2.55rem);
    line-height: 0.94;
  }
}

@media (max-width: 700px) {
  .calculator-shell {
    width: calc(100% - 24px);
  }
}





.calculator-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
  align-items: center;
  gap: 42px;
  margin-bottom: 34px;
}

.calculator-hero h1 {
  margin: 0;
  max-width: 780px;
  font-size: clamp(2.7rem, 6.6vw, 6.2rem);
  line-height: 0.89;
  letter-spacing: -0.07em;
  text-transform: uppercase;
}

.calculator-hero h1 span {
  color: var(--orange);
}

.calculator-hero .hero-copy {
  max-width: 700px;
  margin: 22px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.hero-visual {
  position: relative;
  min-height: 330px;
  display: grid;
  place-items: center;
}

.hero-emblem {
  width: min(310px, 76vw);
  aspect-ratio: 1;
  display: grid;
  align-content: center;
  justify-items: center;
  position: relative;
  border: 1px solid var(--border-orange);
  border-radius: 34px;
  background:
    linear-gradient(145deg, rgba(247,147,26,0.13), rgba(247,147,26,0.025) 54%, rgba(255,255,255,0.015)),
    var(--panel);
  box-shadow: 0 34px 90px rgba(0,0,0,0.45), inset 0 0 0 1px rgba(255,255,255,0.025);
  overflow: hidden;
  transform: rotate(2deg);
}

.hero-emblem::before,
.hero-emblem::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(247,147,26,0.18);
  border-radius: 50%;
}

.hero-emblem::before { width: 260px; height: 260px; right: -110px; top: -100px; }
.hero-emblem::after { width: 170px; height: 170px; left: -78px; bottom: -62px; }

.hero-emblem-number {
  color: var(--orange);
  font-size: clamp(6.8rem, 18vw, 10.8rem);
  line-height: 0.75;
  font-weight: 950;
  letter-spacing: -0.10em;
  position: relative;
  z-index: 1;
}

.hero-emblem-label {
  margin-top: 22px;
  color: var(--text);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.24em;
  text-align: center;
  text-transform: uppercase;
  position: relative;
  z-index: 1;
}

.floating-card {
  position: absolute;
  padding: 12px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  font-size: 0.83rem;
  color: var(--muted);
}

.floating-card strong {
  display: block;
  color: var(--text);
  font-size: 1rem;
  margin-top: 2px;
}

.floating-card.one { left: 0; top: 35px; }
.floating-card.two { right: 0; bottom: 30px; }

.app-grid {
  display: grid;
  grid-template-columns: 390px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.panel {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 85% 10%, rgba(247, 147, 26, 0.10), transparent 13rem),
    linear-gradient(145deg, var(--panel), var(--panel-warm));
  box-shadow: var(--shadow), 0 0 18px rgba(247, 147, 26, 0.10);
}

.settings-panel {
  padding: 24px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  overscroll-behavior: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(247, 147, 26, 0.55) rgba(255, 255, 255, 0.04);
}

.settings-panel::-webkit-scrollbar {
  width: 10px;
}

.settings-panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.035);
  border-radius: 999px;
}

.settings-panel::-webkit-scrollbar-thumb {
  background: rgba(247, 147, 26, 0.48);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.settings-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(247, 147, 26, 0.72);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}

.panel-heading h2,
.section-title h2 {
  margin: 0;
  font-size: 1.22rem;
  letter-spacing: -0.025em;
}

.panel-heading p,
.section-title p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.input-grid {
  display: grid;
  gap: 15px;
}

.field label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 7px;
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 700;
}

.field label span {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.78rem;
}

.input-wrap {
  position: relative;
}

input[type="number"],
input[type="month"] {
  width: 100%;
  height: 50px;
  padding: 0 48px 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  color: var(--text);
  background: var(--bg-soft);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
  appearance: textfield;
}

/* Leicht graue Beispielwerte: native Platzhalter verschwinden automatisch,
   sobald der Besucher einen eigenen Wert eingibt. */
.calculator-page input::placeholder {
  color: color-mix(in srgb, var(--muted) 82%, transparent);
  opacity: 1;
  font-style: italic;
}

.calculator-page input[type="number"]:placeholder-shown {
  border-style: dashed;
  border-color: color-mix(in srgb, var(--line) 72%, var(--muted));
  background: color-mix(in srgb, var(--bg-soft) 82%, #a9adb3 18%);
}

.calculator-page input[type="number"]:not(:placeholder-shown) {
  border-style: solid;
  background: var(--bg-soft);
}

.input-example {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.7rem;
  line-height: 1.4;
}

.input-wrap:focus-within + .input-example {
  color: var(--orange-light);
}

.input-wrap:has(input:not(:placeholder-shown)) + .input-example {
  display: none;
}

.model-selector,
.goal-selector {
  display: grid;
  gap: 9px;
  margin-bottom: 2px;
}

.model-selector {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.goal-selector {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.model-option,
.goal-option {
  position: relative;
}

.model-option input,
.goal-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.model-option label,
.goal-option label {
  min-height: 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
  margin: 0;
  padding: 12px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--bg-soft);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.model-option label strong,
.goal-option label strong {
  color: var(--text);
  font-size: 0.84rem;
}

.model-option label small,
.goal-option label small {
  color: var(--muted);
  font-size: 0.69rem;
  line-height: 1.35;
  font-weight: 500;
}

.model-option input:checked + label,
.goal-option input:checked + label {
  border-color: rgba(247, 147, 26, 0.85);
  background: rgba(247, 147, 26, 0.10);
  box-shadow: 0 0 0 3px rgba(247, 147, 26, 0.08);
}

.model-option input:focus-visible + label,
.goal-option input:focus-visible + label {
  outline: 2px solid var(--orange-light);
  outline-offset: 2px;
}

.model-option label:hover,
.goal-option label:hover {
  transform: translateY(-1px);
  border-color: rgba(255,255,255,0.18);
}

.model-fields {
  display: grid;
  gap: 15px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.018);
}

.model-fields[hidden] {
  display: none;
}


.calculated-withdrawal {
  padding: 16px;
  border: 1px solid var(--border-orange);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(247,147,26,0.12), rgba(247,147,26,0.035));
}

.calculated-withdrawal[hidden] {
  display: none;
}

.calculated-withdrawal span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.calculated-withdrawal strong {
  display: block;
  margin-top: 5px;
  color: var(--orange-light);
  font-size: 1.7rem;
  letter-spacing: -0.04em;
}

.calculated-withdrawal small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.start-capital-preview {
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--orange) 42%, var(--line));
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(247,147,26,0.10), rgba(255,255,255,0.018));
}

.start-capital-preview span {
  display: block;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.start-capital-preview strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  font-size: clamp(1.12rem, 2.5vw, 1.5rem);
  line-height: 1.2;
  letter-spacing: -0.035em;
}

.start-capital-preview small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.5;
}

[hidden] {
  display: none !important;
}

.model-explanation {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.45;
}

.model-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid rgba(247,147,26,0.24);
  border-radius: 999px;
  color: var(--orange-light);
  background: rgba(247,147,26,0.08);
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
  appearance: none;
  margin: 0;
}

input[type="number"]:focus,
input[type="month"]:focus {
  border-color: rgba(247, 147, 26, 0.85);
  box-shadow: 0 0 0 4px rgba(247, 147, 26, 0.12);
}

input.invalid {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(255, 101, 119, 0.10);
}

.unit {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 0.82rem;
  pointer-events: none;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 20px;
}

.primary-button,
.secondary-button {
  min-height: 50px;
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  font-weight: 800;
  transition: transform 160ms ease, filter 160ms ease, border-color 160ms ease;
}

.primary-button {
  padding: 0 18px;
  color: #1b0d00;
  background: linear-gradient(135deg, var(--orange-light), var(--orange));
  box-shadow: 0 14px 35px rgba(247, 147, 26, 0.22);
}

.secondary-button {
  width: 50px;
  color: var(--muted);
  background: var(--bg-soft);
  border: 1px solid var(--line);
  font-size: 1.1rem;
}

.primary-button:hover,
.secondary-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.07);
}

.primary-button:active,
.secondary-button:active {
  transform: translateY(0);
}

.assumption {
  margin: 16px 0 0;
  padding: 12px 13px;
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255,255,255,0.025);
  font-size: 0.78rem;
}

.results {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 24px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  min-width: 0;
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 85% 10%, rgba(247, 147, 26, 0.10), transparent 11rem),
    linear-gradient(145deg, var(--panel), var(--panel-warm));
  box-shadow: var(--shadow), 0 0 18px rgba(247, 147, 26, 0.10);
  text-align: left;
}

.metric-label {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.metric-value {
  margin-top: 8px;
  font-size: clamp(1.25rem, 2.3vw, 1.9rem);
  font-weight: 850;
  letter-spacing: -0.04em;
  overflow-wrap: anywhere;
}

.metric-sub {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.metric.status-ok .metric-value { color: var(--green); }
.metric.status-bad .metric-value { color: var(--red); }

.chart-panel,
.table-panel {
  padding: 24px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 20px;
}

/* Auf- und zuklappbare Jahresübersicht */
.annual-overview-toggle {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 12px;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: margin-bottom 0.2s ease, background-color 0.2s ease;
}

.annual-overview-toggle:hover {
  background: rgba(247, 147, 26, 0.055);
}

.annual-overview-toggle:focus-visible {
  outline: 2px solid var(--orange);
  outline-offset: 7px;
}

.annual-overview-toggle[aria-expanded="false"] {
  margin-bottom: 0;
}

.annual-overview-heading {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.annual-overview-title {
  color: var(--text);
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.annual-overview-subtitle {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
}

.annual-overview-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.annual-overview-chevron {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--orange);
  background: rgba(247, 147, 26, 0.08);
  transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.annual-overview-chevron svg {
  width: 17px;
  height: 17px;
}

.annual-overview-toggle.is-open .annual-overview-chevron {
  transform: rotate(180deg);
  border-color: rgba(247, 147, 26, 0.55);
  background: rgba(247, 147, 26, 0.14);
}

.annual-overview-content[hidden] {
  display: none;
}

@media (max-width: 620px) {
  .annual-overview-toggle {
    align-items: center;
  }

  .annual-overview-actions .model-badge {
    display: none;
  }

  .annual-overview-subtitle {
    font-size: 0.82rem;
  }
}

.legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.legend-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--orange);
}

.legend-dot.blue { background: var(--blue); }

.chart-wrap {
  position: relative;
  height: 350px;
  border: 1px solid var(--line);
  border-radius: 18px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255,255,255,0.02), transparent);
}

canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
}

.calculator-page .calculator-shell table {
  width: 100%;
  border-collapse: collapse;
  min-width: 660px;
}

.calculator-page .calculator-shell th,
.calculator-page .calculator-shell td {
  padding: 14px 16px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

.calculator-page .calculator-shell th:first-child,
.calculator-page .calculator-shell td:first-child {
  text-align: left;
}

.calculator-page .calculator-shell th {
  position: sticky;
  top: 0;
  color: var(--muted);
  background: var(--panel);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.calculator-page .calculator-shell td {
  font-size: 0.88rem;
}

.calculator-page .calculator-shell tbody tr:hover {
  background: rgba(255,255,255,0.025);
}

.calculator-page .calculator-shell tbody tr:last-child td {
  border-bottom: 0;
}

.calculator-page .calculator-shell details {
  margin-top: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(255,255,255,0.018);
}

.calculator-page .calculator-shell summary {
  cursor: pointer;
  padding: 15px 17px;
  color: var(--text);
  font-weight: 750;
  list-style: none;
}

.calculator-page .calculator-shell summary::-webkit-details-marker { display: none; }

.calculator-page .calculator-shell summary::after {
  content: "+";
  float: right;
  color: var(--orange);
  font-size: 1.2rem;
}

.calculator-page .calculator-shell details[open] summary::after { content: "−"; }

.monthly-log {
  max-height: 340px;
  overflow: auto;
  padding: 0 17px 16px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.78rem;
}

.monthly-row {
  display: grid;
  grid-template-columns: 80px repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

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

.empty-state {
  min-height: 300px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--muted);
}


.panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(247,147,26,0.55), transparent);
  pointer-events: none;
}

.legal-callout {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 15px;
  align-items: start;
  margin: 0 0 28px;
  padding: 17px 19px;
  border: 1px solid var(--border-orange);
  border-radius: 16px;
  background: rgba(247,147,26,0.065);
}

.legal-callout-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #0a0a0a;
  background: var(--orange);
  font-weight: 950;
}

.legal-callout strong {
  display: block;
  margin-bottom: 3px;
  color: var(--text);
  font-size: 0.91rem;
}

.legal-callout p {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.historical-defaults {
  padding: 14px;
  border: 1px solid var(--border-orange);
  border-radius: 14px;
  background: rgba(247,147,26,0.055);
}

.historical-defaults-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

.historical-defaults-head strong {
  font-size: 0.82rem;
}

.historical-defaults-head span {
  color: var(--orange-light);
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.historical-values {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}

.historical-value {
  padding: 9px 7px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--bg) 68%, transparent);
  text-align: center;
}

.historical-value strong {
  display: block;
  color: var(--orange-light);
  font-size: 0.91rem;
}

.historical-value small {
  color: var(--muted);
  font-size: 0.62rem;
}

.historical-defaults p {
  margin: 0;
  color: var(--muted);
  font-size: 0.71rem;
  line-height: 1.5;
}

.inline-button {
  width: 100%;
  min-height: 38px;
  margin-top: 11px;
  border: 1px solid var(--border-orange);
  border-radius: 10px;
  color: var(--orange-light);
  background: rgba(247,147,26,0.06);
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 850;
}

.inline-button:hover { background: rgba(247,147,26,0.11); }

.bear-editor {
  margin: 13px 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg) 62%, transparent);
}

.bear-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.bear-editor-head strong {
  display: block;
  font-size: 0.78rem;
}

.bear-editor-head small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.64rem;
  line-height: 1.4;
}

.bear-bottom-rows {
  display: grid;
  gap: 7px;
}

.bear-bottom-row {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(70px, 0.65fr) 34px;
  gap: 7px;
  align-items: end;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255,255,255,0.018);
}

.bear-bottom-index {
  grid-column: 1 / -1;
  align-self: center;
  color: var(--orange-light);
  font-size: 0.66rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.bear-bottom-row label {
  margin: 0;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bear-bottom-row input {
  width: 100%;
  min-height: 36px;
  margin-top: 4px;
  padding: 7px 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: color-mix(in srgb, var(--bg) 72%, transparent);
  font: inherit;
  font-size: 0.72rem;
  color-scheme: inherit;
}

.bear-bottom-row input:focus {
  outline: none;
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(247,147,26,0.11);
}

.bear-bottom-remove {
  width: 34px;
  height: 36px;
  border: 1px solid rgba(255,110,110,0.22);
  border-radius: 8px;
  color: #ff9b9b;
  background: rgba(255,80,80,0.055);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
}

.bear-bottom-remove:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.bear-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
  margin-top: 9px;
}

.bear-editor-action {
  min-height: 36px;
  border: 1px solid var(--border-orange);
  border-radius: 9px;
  color: var(--orange-light);
  background: rgba(247,147,26,0.045);
  cursor: pointer;
  font-size: 0.68rem;
  font-weight: 850;
}

.bear-editor-action.secondary {
  color: var(--muted);
  border-color: var(--line);
  background: rgba(255,255,255,0.018);
}

.bear-bottom-status {
  min-height: 1.4em;
  margin: 9px 0 0 !important;
  color: var(--muted) !important;
  font-size: 0.66rem !important;
}

.bear-bottom-status.is-error { color: #ff9b9b !important; }
.bear-bottom-status.is-success { color: #9bd3a8 !important; }

@media (max-width: 560px) {
  .bear-bottom-row {
    grid-template-columns: minmax(0, 1.35fr) minmax(70px, 0.65fr) 34px;
  }
  .bear-editor-actions { grid-template-columns: 1fr; }
}

.comparison-panel {
  padding: 24px;
}

.comparison-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.comparison-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255,255,255,0.018);
}

.comparison-card.is-active {
  border-color: var(--border-orange);
  background: rgba(247,147,26,0.065);
  box-shadow: inset 0 0 0 1px rgba(247,147,26,0.08);
}

.comparison-card span {
  display: block;
  color: var(--muted);
  font-size: 0.7rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.comparison-card strong {
  display: block;
  margin-top: 7px;
  color: var(--orange-light);
  font-size: 1.35rem;
  letter-spacing: -0.035em;
}

.comparison-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.45;
}

.method-panel {
  padding: 24px;
}

.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.method-stat {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255,255,255,0.018);
}

.method-stat span {
  display: block;
  color: var(--muted);
  font-size: 0.67rem;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.method-stat strong {
  display: block;
  margin-top: 6px;
  color: var(--orange-light);
  font-size: 1.15rem;
}

.method-copy {
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.65;
}

.method-copy a {
  color: var(--orange-light);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.history-table-wrap {
  margin-top: 16px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

.history-table-wrap table { min-width: 560px; }
.history-table-wrap th,
.history-table-wrap td { padding: 10px 12px; font-size: 0.75rem; }

.calculator-disclaimer {
  margin-top: 30px;
  text-align: center;
  color: var(--muted);
  font-size: 0.78rem;
}

@media (max-width: 1050px) {
  .calculator-hero { grid-template-columns: 1fr 330px; }
  .app-grid { grid-template-columns: 340px minmax(0, 1fr); }
  .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 820px) {
  .calculator-shell { width: min(100% - 22px, 720px); padding-top: 18px; }
  .calculator-hero { grid-template-columns: 1fr; gap: 12px; }
  .calculator-hero .hero-visual { min-height: 240px; margin: 4px 0 18px; }
  .hero-emblem { width: 220px; border-radius: 26px; }
  .hero-emblem-number { font-size: 7.5rem; }
  .hero-emblem-label { margin-top: 16px; font-size: 0.65rem; }
  .floating-card.one { left: 5%; top: 18px; }
  .floating-card.two { right: 4%; bottom: 14px; }
  .app-grid { grid-template-columns: 1fr; }
  .settings-panel {
    position: static;
    max-height: none;
    overflow: visible;
    scrollbar-gutter: auto;
  }
  .chart-wrap { height: 300px; }
}

@media (max-width: 540px) {
  .calculator-hero h1 { font-size: 2.8rem; }

  /* Auf Smartphones stehen die Ergebnis-Karten bewusst untereinander. */
  .summary-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .metric {
    min-height: 0;
    padding: 18px 19px;
    border-radius: 17px;
  }

  .metric-value {
    margin-top: 7px;
    font-size: clamp(1.45rem, 7vw, 1.72rem);
  }

  .metric-sub {
    margin-top: 6px;
    font-size: 0.8rem;
    line-height: 1.5;
  }

  .results { gap: 18px; }
  .chart-panel, .table-panel, .settings-panel,
  .comparison-panel, .method-panel { padding: 18px; }
  .section-title { display: block; }
  .legend { margin-top: 12px; }
  .chart-wrap { height: 260px; }
  .floating-card { font-size: 0.72rem; }
  .floating-card strong { font-size: 0.86rem; }
  .model-selector,
  .goal-selector,
  .comparison-grid { grid-template-columns: 1fr; }
  .model-option label,
  .goal-option label { min-height: 70px; }
  .historical-values, .method-grid { grid-template-columns: 1fr; }
  .legal-callout { grid-template-columns: 1fr; }
  .monthly-row { grid-template-columns: 92px 1fr; }
  .monthly-row span:nth-child(3),
  .monthly-row span:nth-child(4) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}


/*
 * Touch-Geräte bekommen keinen klassischen Browser-Hover. Große Rechnerkarten
 * leuchten bereits auf, sobald ihr oberer Bereich ins Sichtfeld kommt. Kleine
 * Karten werden erst in der Bildschirmmitte betont. Ohne translateY flackert
 * die Darstellung beim Scrollen deutlich weniger.
 */
@media (hover: none), (pointer: coarse) {
  .calculator-page .panel,
  .calculator-page .metric,
  .calculator-page .legal-callout,
  .calculator-page .comparison-card,
  .calculator-page .historical-value,
  .calculator-page .method-stat {
    -webkit-tap-highlight-color: transparent;
    transform: none !important;
    will-change: border-color, box-shadow;
  }

  .calculator-page .panel:hover,
  .calculator-page .metric:hover,
  .calculator-page .legal-callout:hover,
  .calculator-page .comparison-card:hover,
  .calculator-page .historical-value:hover,
  .calculator-page .method-stat:hover {
    transform: none !important;
  }

  /* Große Karten: früher und ruhiger aktiv, solange ein Teil sichtbar ist. */
  .calculator-page .touch-large-card {
    transition: border-color 0.26s ease, box-shadow 0.26s ease, background-color 0.26s ease;
  }

  .calculator-page .touch-large-card.in-view,
  .calculator-page .touch-large-card:active,
  .calculator-page .touch-large-card:focus-within {
    border-color: rgba(247, 147, 26, 0.76);
    box-shadow: var(--shadow), 0 0 32px rgba(247, 147, 26, 0.28);
  }

  /* Kleine Karten: dezenter Glow ohne Positionssprung. */
  .calculator-page .touch-small-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  }

  .calculator-page .touch-small-card.in-view,
  .calculator-page .touch-small-card:active,
  .calculator-page .touch-small-card:focus-within {
    border-color: rgba(247, 147, 26, 0.72);
    box-shadow: var(--shadow), 0 0 24px rgba(247, 147, 26, 0.24);
  }
}


/* 3/4-%-Regel und Monte-Carlo */
.withdrawal-rule-fields { border-color: color-mix(in srgb, var(--orange) 38%, var(--line)); }
.rate-presets { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin:0 0 10px; }
.rate-presets button,.mc-rerun-button { min-height:38px; padding:7px 10px; border:1px solid var(--line); border-radius:11px; color:var(--text); background:var(--bg-soft); cursor:pointer; font-weight:800; transition:border-color .18s ease,background-color .18s ease,color .18s ease,transform .18s ease; }
.rate-presets button:hover,.rate-presets button.is-active,.mc-rerun-button:hover { border-color:rgba(247,147,26,.76); color:var(--orange-light); background:rgba(247,147,26,.10); }
.rate-presets button:active,.mc-rerun-button:active { transform:translateY(1px); }
.safe-withdrawal-box { border-color:rgba(106,169,255,.48); background:linear-gradient(145deg,rgba(106,169,255,.11),rgba(247,147,26,.035)); }
.safe-withdrawal-box strong { color:color-mix(in srgb,var(--blue) 72%,var(--text)); }
.monte-carlo-settings { gap:12px; }
.monte-carlo-toggle-row { display:flex; align-items:center; justify-content:space-between; gap:14px; }
.monte-carlo-toggle-row>div { display:grid; gap:4px; }
.monte-carlo-toggle-row strong { color:var(--text); font-size:.9rem; }
.monte-carlo-toggle-row small { color:var(--muted); font-size:.72rem; line-height:1.35; }
.switch { flex:0 0 auto; position:relative; width:48px; height:27px; margin:0!important; cursor:pointer; }
.switch input { position:absolute; opacity:0; pointer-events:none; }
.switch span { position:absolute; inset:0; border:1px solid var(--line); border-radius:999px; background:var(--bg-soft); transition:background-color .2s ease,border-color .2s ease; }
.switch span::after { content:""; position:absolute; width:19px; height:19px; left:3px; top:3px; border-radius:50%; background:var(--muted); transition:transform .2s ease,background-color .2s ease; }
.switch input:checked+span { border-color:rgba(247,147,26,.72); background:rgba(247,147,26,.18); }
.switch input:checked+span::after { transform:translateX(21px); background:var(--orange); }
.switch input:focus-visible+span { outline:2px solid var(--orange-light); outline-offset:3px; }
.monte-carlo-inputs { display:grid; gap:12px; }
.monte-carlo-inputs.is-disabled { display:none; }
.monte-carlo-panel { padding:24px; }
.mc-rerun-button { white-space:nowrap; color:var(--orange-light); }
.monte-carlo-grid { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:12px; margin-bottom:18px; }
.mc-metric { min-width:0; padding:16px; border:1px solid var(--line); border-radius:15px; background:rgba(255,255,255,.018); }
.mc-metric span { display:block; color:var(--muted); font-size:.68rem; font-weight:850; letter-spacing:.065em; line-height:1.4; text-transform:uppercase; }
.mc-metric strong { display:block; margin-top:8px; color:var(--orange-light); font-size:clamp(1.25rem,2.5vw,1.75rem); letter-spacing:-.04em; overflow-wrap:anywhere; }
.mc-metric small { display:block; margin-top:6px; color:var(--muted); font-size:.7rem; line-height:1.4; }
.mc-chart-wrap { height:310px; border:1px solid var(--line); border-radius:16px; overflow:hidden; background:linear-gradient(180deg,rgba(255,255,255,.02),transparent); }
.mc-note { margin:14px 0 0; color:var(--muted); font-size:.76rem; line-height:1.55; }
@media(max-width:1050px){.monte-carlo-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:540px){.goal-selector{grid-template-columns:1fr}.monte-carlo-panel{padding:18px}.monte-carlo-grid{grid-template-columns:1fr}.mc-chart-wrap{height:250px}.mc-rerun-button{width:100%;margin-top:12px}}


/* BTC-/Satoshi-Umschalter am Bestandsfeld */
.bitcoin-amount-field .field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.bitcoin-amount-field .field-label-row > label {
  margin-bottom: 0;
  flex: 1 1 auto;
}

.amount-unit-switch {
  display: inline-grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: color-mix(in srgb, var(--bg-soft) 78%, var(--bg) 22%);
}

.amount-unit-switch input {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.amount-unit-switch label {
  min-width: 48px;
  min-height: 30px;
  margin: 0;
  padding: 5px 10px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  transition: color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.amount-unit-switch input:checked + label {
  color: #111;
  background: var(--orange);
  box-shadow: 0 4px 14px color-mix(in srgb, var(--orange) 30%, transparent);
}

.amount-unit-switch input:focus-visible + label {
  outline: 2px solid var(--orange-light);
  outline-offset: 2px;
}

.amount-equivalent {
  display: block;
  margin-top: 6px;
  color: var(--orange-light);
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
}

.amount-equivalent[hidden] {
  display: none;
}

@media (max-width: 520px) {
  .bitcoin-amount-field .field-label-row {
    align-items: flex-end;
  }

  .bitcoin-amount-field .field-label-row > label {
    display: block;
  }

  .bitcoin-amount-field .field-label-row > label span {
    display: block;
    margin-top: 2px;
  }

  .amount-unit-switch label {
    min-width: 45px;
    min-height: 32px;
    padding-inline: 8px;
  }
}


/* ============================================================
   POWER-LAW-ERKLÄRUNG UND INTERAKTIVE MONTE-CARLO-GRAFIK
   ============================================================ */
.power-law-explanation { display: grid; gap: 12px; }
.power-law-explanation > p { margin: 0; color: var(--muted); font-size: .78rem; line-height: 1.55; }
.power-law-explanation > p strong { color: var(--orange-light); }
.power-law-direction {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}
.power-law-direction > span {
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--bg-soft) 82%, transparent);
}
.power-law-direction > span.is-standard {
  border-color: rgba(247,147,26,.48);
  background: rgba(247,147,26,.075);
}
.power-law-direction strong,
.power-law-direction small { display: block; }
.power-law-direction strong { color: var(--text); font-size: .72rem; line-height: 1.3; }
.power-law-direction small { margin-top: 4px; color: var(--muted); font-size: .64rem; line-height: 1.4; }
.power-law-impact {
  padding: 11px 12px;
  border-left: 3px solid var(--orange);
  border-radius: 0 10px 10px 0;
  background: rgba(247,147,26,.07);
  color: var(--text) !important;
  font-variant-numeric: tabular-nums;
}

.mc-chart-guide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 10px;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.45;
}
.mc-chart-guide strong { color: var(--text); }
.mc-chart-legend { display: flex; align-items: center; justify-content: flex-end; gap: 12px; flex-wrap: wrap; }
.mc-chart-legend span,
.mc-chart-tooltip span { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.mc-chart-legend i,
.mc-chart-tooltip i { width: 9px; height: 9px; border-radius: 50%; background: #6aa9ff; }
.mc-chart-legend i.p50,
.mc-chart-tooltip i.p50 { background: #f7931a; }
.mc-chart-legend i.p10,
.mc-chart-tooltip i.p10 { border: 2px solid #6aa9ff; background: transparent; }
.mc-chart-legend i.p90,
.mc-chart-tooltip i.p90 { background: #6aa9ff; }
.mc-chart-wrap { position: relative; touch-action: pan-y; }
.mc-chart-wrap canvas { display: block; width: 100%; height: 100%; cursor: crosshair; outline: none; }
.mc-chart-wrap canvas:focus-visible { box-shadow: inset 0 0 0 2px var(--orange); }
.mc-chart-tooltip {
  position: absolute;
  z-index: 4;
  top: 14px;
  left: 14px;
  display: grid;
  gap: 7px;
  min-width: 190px;
  padding: 11px 12px;
  border: 1px solid rgba(247,147,26,.42);
  border-radius: 11px;
  background: rgba(16,18,22,.94);
  box-shadow: 0 16px 35px rgba(0,0,0,.38);
  color: #f3f4f6;
  pointer-events: none;
  backdrop-filter: blur(10px);
}
.mc-chart-tooltip[hidden] { display: none; }
.mc-chart-tooltip.is-right { right: 14px; left: auto; }
.mc-chart-tooltip strong { color: var(--orange-light); font-size: .75rem; }
.mc-chart-tooltip span { justify-content: space-between; color: #aeb5c1; font-size: .68rem; }
.mc-chart-tooltip b { margin-left: auto; color: #fff; font-size: .7rem; font-variant-numeric: tabular-nums; }
:root[data-theme="light"] .mc-chart-tooltip { background: rgba(247,244,239,.96); color: #222; box-shadow: 0 14px 32px rgba(55,44,31,.18); }
:root[data-theme="light"] .mc-chart-tooltip span { color: #625b52; }
:root[data-theme="light"] .mc-chart-tooltip b { color: #1c1a18; }

@media (max-width: 760px) {
  .power-law-direction { grid-template-columns: 1fr; }
  .mc-chart-guide { align-items: flex-start; flex-direction: column; }
  .mc-chart-legend { justify-content: flex-start; gap: 9px; }
  .mc-chart-tooltip { min-width: 164px; padding: 9px 10px; }
}


.mc-withdrawal-result {
  display:grid;
  grid-template-columns:minmax(180px,.7fr) minmax(0,1.3fr);
  gap:18px;
  align-items:center;
  margin:-2px 0 18px;
  padding:16px 18px;
  border:1px solid rgba(247,147,26,.42);
  border-radius:16px;
  background:linear-gradient(135deg,rgba(247,147,26,.12),rgba(247,147,26,.035));
  box-shadow:0 12px 34px rgba(247,147,26,.08);
}
.mc-withdrawal-result[hidden] { display:none; }
.mc-withdrawal-result>div { display:grid; gap:5px; }
.mc-withdrawal-result span {
  color:var(--muted);
  font-size:.7rem;
  font-weight:850;
  letter-spacing:.07em;
  text-transform:uppercase;
}
.mc-withdrawal-result strong {
  color:var(--orange-light);
  font-size:clamp(1.35rem,2.5vw,1.9rem);
  letter-spacing:-.04em;
}
.mc-withdrawal-result p { margin:0; color:var(--muted); font-size:.78rem; line-height:1.6; }
.field-note { display:block; margin-top:7px; color:var(--muted); font-size:.68rem; line-height:1.45; }

@media(max-width:640px){
  .mc-withdrawal-result{grid-template-columns:1fr;gap:10px;padding:15px}
}


/* ============================================================
   DCA-ZEITLINIE, MONATSDETAILS UND INTERAKTIVER PORTFOLIO-CHART
   ============================================================ */
.legend-swatch.dca {
  width: 17px;
  height: 9px;
  border: 1px solid rgba(98,168,255,.55);
  border-radius: 3px;
  background: rgba(98,168,255,.13);
}

.portfolio-chart-guide {
  margin: -4px 0 10px;
  color: var(--muted);
  font-size: .72rem;
  line-height: 1.45;
}

.portfolio-chart-wrap {
  touch-action: pan-y;
}

.portfolio-chart-wrap canvas {
  cursor: crosshair;
  outline: none;
}

.portfolio-chart-wrap canvas:focus-visible {
  box-shadow: inset 0 0 0 2px var(--orange);
}

.portfolio-chart-tooltip i.portfolio { background: #f7931a; }
.portfolio-chart-tooltip i.btc { background: #62a8ff; }
.portfolio-chart-tooltip i.price { background: transparent; border: 2px solid #f0b35d; }
.portfolio-chart-tooltip i.action { background: transparent; border: 2px solid #8bc0ff; }
.portfolio-chart-tooltip #portfolioTooltipActionRow[hidden] { display: none; }

.monthly-log {
  padding-top: 0;
}

.monthly-row {
  grid-template-columns: minmax(76px,.72fr) minmax(96px,.85fr) minmax(105px,1fr) minmax(120px,1.12fr) minmax(120px,1.15fr) minmax(190px,1.55fr);
  align-items: center;
}

.monthly-row-header {
  position: sticky;
  z-index: 2;
  top: 0;
  padding: 10px 0 8px;
  border-top: 0;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  color: var(--muted);
  font-family: Inter, system-ui, sans-serif;
  font-size: .64rem;
  font-weight: 850;
  letter-spacing: .055em;
  text-transform: uppercase;
}

.monthly-row-header span:not(:first-child) { text-align: right; }
.monthly-row .monthly-phase { text-align: left !important; font-family: Inter, system-ui, sans-serif; font-weight: 800; }
.monthly-row-accumulation .monthly-phase { color: #80b9ff; }
.monthly-row-retirementStart { background: rgba(247,147,26,.075); }
.monthly-row-retirementStart .monthly-phase { color: var(--orange-light); }
.monthly-row-retirement .monthly-phase { color: var(--text); }
.monthly-action { color: var(--text); font-family: Inter, system-ui, sans-serif; font-size: .72rem; }
.monthly-row-accumulation .monthly-action { color: #80b9ff; }
.monthly-row-retirement .monthly-action { color: #f2b66b; }
.monthly-empty { padding: 18px 0; color: var(--muted); }

@media (max-width: 760px) {
  .chart-wrap { height: 315px; }
  .portfolio-chart-guide { font-size: .68rem; }
  .monthly-row-header { display: none; }
  .monthly-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px 12px;
    padding: 12px 0;
  }
  .monthly-row span {
    display: grid !important;
    grid-template-columns: minmax(72px,.75fr) minmax(0,1.25fr);
    gap: 8px;
    text-align: right !important;
    white-space: normal;
  }
  .monthly-row span::before {
    content: attr(data-label);
    color: var(--muted);
    font-family: Inter, system-ui, sans-serif;
    font-size: .62rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-align: left;
    text-transform: uppercase;
  }
  .monthly-row .monthly-phase,
  .monthly-row .monthly-action {
    grid-column: 1 / -1;
  }
}

@media (max-width: 470px) {
  .monthly-row { grid-template-columns: 1fr; }
  .monthly-row .monthly-phase,
  .monthly-row .monthly-action { grid-column: auto; }
  .portfolio-chart-tooltip { min-width: 178px; }
}


/* Große Monte-Carlo-Beträge bleiben einzeilig und skalieren in ihrer Karte. */
.mc-metric { container-type: inline-size; }
.mc-metric strong,
.mc-metric small.metric-number-long {
  white-space: nowrap;
  overflow-wrap: normal;
  font-variant-numeric: tabular-nums;
}
.mc-metric strong.metric-number-long {
  font-size: clamp(.98rem, 6.8cqw, 1.42rem);
  letter-spacing: -.055em;
}
.mc-metric strong.metric-number-very-long {
  font-size: clamp(.82rem, 5.5cqw, 1.14rem);
  letter-spacing: -.065em;
}
.mc-metric small.metric-number-long {
  font-size: clamp(.58rem, 3.7cqw, .69rem);
  letter-spacing: -.025em;
}
.mc-metric small.metric-number-very-long {
  font-size: clamp(.52rem, 3.2cqw, .62rem);
}

/* Jahresübersicht einschließlich DCA-Ansparphase. */
.year-phase {
  display: inline-flex;
  align-items: center;
  min-width: max-content;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255,255,255,.025);
  font-size: .66rem;
  font-weight: 800;
}
.year-row-ansparen .year-phase { color: #80b9ff; border-color: rgba(98,168,255,.35); background: rgba(98,168,255,.08); }
.year-row-uebergang .year-phase,
.year-row-rentenstart .year-phase { color: var(--orange-light); border-color: rgba(247,147,26,.38); background: rgba(247,147,26,.09); }
.year-row-rente .year-phase { color: var(--text); }


/* ============================================================
   RECHENWÄHRUNG UND LIVE-PREIS
   ============================================================ */
.currency-price-field .field-label-row {
  align-items: flex-start;
}

.currency-unit-switch {
  flex: 0 0 auto;
}

.live-price-helper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.live-price-helper .input-example {
  margin-top: 0;
}

.live-price-button {
  flex: 0 0 auto;
  padding: 5px 9px;
  font-size: 0.7rem;
  white-space: nowrap;
}

.live-price-button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.live-price-source {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.4;
}

#btcShare {
  min-width: 0;
  font-size: clamp(0.62rem, 1.35vw, 0.76rem);
  letter-spacing: -0.015em;
  white-space: nowrap;
}

@media (max-width: 540px) {
  .currency-price-field .field-label-row {
    align-items: stretch;
  }

  .currency-unit-switch {
    align-self: flex-start;
  }

  .live-price-helper {
    display: block;
  }

  .live-price-button {
    margin-top: 8px;
  }

  #btcShare {
    font-size: clamp(0.62rem, 2.8vw, 0.72rem);
    line-height: 1.35;
  }
}


/* ============================================================
   KOMPAKTER LIVE-PREIS, NOMINALER DCA UND GETRENNTE SCROLL-KARTEN
   ============================================================ */
.live-price-helper {
  align-items: center;
}

.live-price-helper .input-example {
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.38;
}

.live-price-button {
  box-sizing: border-box;
  flex: 0 0 86px;
  width: 86px;
  min-width: 86px;
  max-width: 86px;
  min-height: 44px;
  height: 44px;
  margin-top: 0;
  padding: 5px 8px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  overflow: hidden;
  border-radius: 9px;
  font-size: 0.63rem;
  line-height: 1.12;
  letter-spacing: 0;
  text-align: center;
  white-space: normal;
}

.live-price-button span {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  text-align: center;
  white-space: nowrap;
}

/* Beide Rechnerseiten sind auf großen Bildschirmen eigenständige Scrollkarten. */
.results-scroll-panel {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  overscroll-behavior-y: auto;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(247, 147, 26, 0.55) rgba(255, 255, 255, 0.04);
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    radial-gradient(circle at 88% 4%, rgba(247, 147, 26, 0.10), transparent 15rem),
    linear-gradient(145deg, var(--panel), var(--panel-warm));
  box-shadow: var(--shadow), 0 0 18px rgba(247, 147, 26, 0.10);
}

.results-scroll-panel::-webkit-scrollbar,
.settings-panel::-webkit-scrollbar {
  width: 10px;
}

.results-scroll-panel::-webkit-scrollbar-track,
.settings-panel::-webkit-scrollbar-track {
  background: rgba(255, 255, 255, 0.035);
  border-radius: 999px;
}

.results-scroll-panel::-webkit-scrollbar-thumb,
.settings-panel::-webkit-scrollbar-thumb {
  background: rgba(247, 147, 26, 0.48);
  border: 2px solid transparent;
  border-radius: 999px;
  background-clip: padding-box;
}

.results-scroll-panel::-webkit-scrollbar-thumb:hover,
.settings-panel::-webkit-scrollbar-thumb:hover {
  background: rgba(247, 147, 26, 0.72);
  border: 2px solid transparent;
  background-clip: padding-box;
}

.results-scroll-heading {
  position: sticky;
  z-index: 8;
  top: -20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: -20px -20px 18px;
  padding: 15px 18px 13px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--panel) 96%, transparent);
  backdrop-filter: blur(12px);
}

.results-scroll-heading strong,
.results-scroll-heading small {
  display: block;
}

.results-scroll-heading strong {
  color: var(--text);
  font-size: 0.82rem;
  letter-spacing: -0.01em;
}

.results-scroll-heading small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1.35;
}

.results-scroll-heading > span {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-orange);
  border-radius: 9px;
  color: var(--orange-light);
  background: rgba(247,147,26,0.07);
  font-size: 0.78rem;
}

/* Der Hinweis unter dem Restbestand darf die Karte nicht dominieren. */
#btcShare {
  font-size: clamp(0.58rem, 1.08vw, 0.72rem);
  line-height: 1.35;
  white-space: normal;
  text-wrap: balance;
}

@media (max-width: 820px) {
  .results-scroll-panel {
    position: static;
    max-height: none;
    overflow: visible;
    overscroll-behavior: auto;
    scrollbar-gutter: auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .results-scroll-heading {
    position: static;
    margin: 0 0 14px;
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: linear-gradient(145deg, var(--panel), var(--panel-warm));
    backdrop-filter: none;
  }
}

@media (max-width: 540px) {
  .live-price-helper {
    display: flex;
    align-items: center;
  }

  .live-price-button {
    flex: 0 0 82px;
    width: 82px;
    min-width: 82px;
    max-width: 82px;
    height: 44px;
    margin-top: 0;
  }

  #btcShare {
    font-size: clamp(0.59rem, 2.65vw, 0.69rem);
  }
}

@media (max-width: 380px) {
  .live-price-helper {
    align-items: flex-start;
  }

  .live-price-button {
    flex-basis: 78px;
    width: 78px;
    min-width: 78px;
    max-width: 78px;
    height: 44px;
    padding-inline: 5px;
    font-size: 0.59rem;
  }
}


/* ============================================================
   LIVE-PREIS-BUTTON UNTER DEM EINGABEFELD
   ============================================================ */
.currency-price-field .live-price-helper {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 7px;
  width: 100%;
  margin-top: 9px;
}

.currency-price-field .live-price-button {
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  max-width: none;
  min-height: 42px;
  height: auto;
  margin: 0;
  padding: 9px 14px;
  overflow: visible;
  font-size: 0.82rem;
  font-weight: 750;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-align: center;
  white-space: normal;
}

.currency-price-field .live-price-helper .input-example {
  display: block;
  width: 100%;
  margin: 0;
  line-height: 1.45;
}

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

@media (max-width: 540px) {
  .currency-price-field .live-price-helper {
    display: flex;
    align-items: stretch;
  }

  .currency-price-field .live-price-button {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 42px;
    height: auto;
    margin: 0;
    padding: 9px 12px;
    font-size: 0.8rem;
  }
}

@media (max-width: 380px) {
  .currency-price-field .live-price-helper {
    align-items: stretch;
  }

  .currency-price-field .live-price-button {
    width: 100%;
    min-width: 0;
    max-width: none;
    min-height: 42px;
    height: auto;
    padding-inline: 10px;
    font-size: 0.78rem;
  }
}

.currency-price-field .live-price-button:disabled {
  opacity: 0.65;
}


/* ============================================================
   SCROLL-VERKETTUNG AM OBEREN RAND DER RECHNERKARTEN
   ============================================================ */
/* Erreicht eine Karte ihren oberen Rand, darf weiteres Hochscrollen
   wieder die komplette Seite bewegen. */
.settings-panel,
.results-scroll-panel {
  overscroll-behavior-y: auto;
}


/* Monte-Carlo-Zielauswahl */
.mc-target-settings {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid color-mix(in srgb, var(--blue) 30%, var(--line));
  border-radius: 14px;
  background: color-mix(in srgb, var(--blue) 5%, transparent);
}

.mc-target-selector {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.mc-target-option {
  position: relative;
}

.mc-target-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.mc-target-option label {
  min-height: 104px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  margin: 0;
  padding: 12px;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--bg-soft);
  transition: border-color 160ms ease, background 160ms ease, transform 160ms ease;
}

.mc-target-option label strong {
  color: var(--text);
  font-size: .78rem;
  line-height: 1.3;
}

.mc-target-option label small {
  color: var(--muted);
  font-size: .66rem;
  line-height: 1.4;
  font-weight: 500;
}

.mc-target-option input:checked + label {
  border-color: rgba(247, 147, 26, .85);
  background: rgba(247, 147, 26, .10);
  box-shadow: 0 0 0 3px rgba(247, 147, 26, .08);
}

.mc-target-option input:focus-visible + label {
  outline: 2px solid var(--orange-light);
  outline-offset: 2px;
}

.mc-target-option label:hover {
  transform: translateY(-1px);
  border-color: rgba(247, 147, 26, .48);
}

.mc-metric.is-target {
  border-color: rgba(247, 147, 26, .78);
  background: rgba(247, 147, 26, .08);
  box-shadow: 0 0 0 3px rgba(247, 147, 26, .055);
}

.mc-metric.is-target span::after {
  content: " · ausgewähltes Ziel";
  color: var(--orange-light);
}

@media (max-width: 540px) {
  .mc-target-selector { grid-template-columns: 1fr; }
  .mc-target-option label { min-height: 86px; }
}


/* Direkte Zugänge zu den beiden ausführlichen Anleitungsseiten. */
.calculator-guide-actions {
  margin-top: 22px;
}

@media (max-width: 700px) {
  .calculator-guide-actions {
    margin-top: 18px;
  }
}


/* Gemeinsame Navigation statt calculator-eigener Kopfzeile. */
.calculator-local-note {
  width: fit-content;
  max-width: 100%;
  margin: 14px 0 0;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--muted);
  font-size: 0.74rem;
  line-height: 1.35;
}

:root[data-theme="light"] .calculator-local-note {
  background: rgba(255, 255, 255, 0.48);
}

@media (max-width: 540px) {
  .calculator-local-note {
    width: 100%;
    border-radius: 12px;
    text-align: center;
  }
}
