/* Rendite-Risiko-Rechner – Frontend-Styling
   Bewusst neutral gehalten, damit Beaver-Builder-/Theme-Styles greifen.
   Farben über CSS-Variablen anpassbar. */

.rrr {
	--rrr-accent: #1565c0;
	--rrr-input-bg: #fff9c4;      /* gelbe Eingabefelder wie in Excel */
	--rrr-border: #d9d9d9;
	--rrr-muted: #6b7280;
	max-width: 1100px;
	margin: 0 auto;
	font-size: inherit;   /* übernimmt die Schriftgröße aus Beaver Builder / Theme */
	line-height: inherit;
}

.rrr__intro { margin-bottom: 1rem; }
.rrr__hint { background: var(--rrr-input-bg); padding: 0 .25em; border-radius: 3px; }

.rrr__layout {
	display: grid;
	grid-template-columns: minmax(280px, 360px) 1fr;
	gap: 2rem;
	align-items: start;
}
/* Grid-/Flex-Kinder dürfen schmaler werden als ihr Inhalt -> verhindert, dass breite
   Tabellen die Spalte (und damit die Seite) auf dem Handy seitlich aufziehen. */
.rrr__layout > * { min-width: 0; }
@media (max-width: 800px) {
	.rrr__layout { grid-template-columns: 1fr; }
	.rrr__table th,
	.rrr__table td { padding: .45rem .5rem; }
	.rrr__chartwrap { height: 260px; }
}

.rrr h3 { margin: 0 0 .75rem; font-size: 1.05em; }

/* Eingaben */
.rrr__inputs {
	background: #fafafa;
	border: 1px solid var(--rrr-border);
	border-radius: 8px;
	padding: 1.25rem;
}
.rrr__field {
	display: flex;
	flex-direction: column;
	gap: .25rem;
	margin-bottom: .85rem;
}
.rrr__field > span { font-weight: 500; }
.rrr__inputwrap { position: relative; display: flex; align-items: center; }
.rrr__inputwrap input {
	width: 100%;
	padding: .5rem .6rem;
	border: 1px solid #c7b94a;
	border-radius: 5px;
	background: var(--rrr-input-bg);
	font-size: 1em;
	text-align: right;
}
.rrr__inputwrap input:focus {
	outline: 2px solid var(--rrr-accent);
	outline-offset: 1px;
}
.rrr__inputwrap em {
	position: absolute;
	right: .6rem;
	color: var(--rrr-muted);
	font-style: normal;
	pointer-events: none;
}
.rrr__inputwrap input { padding-right: 1.8rem; }

/* Slider Risikoquote */
.rrr__field--slider > span {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}
.rrr__slidervalue {
	color: var(--rrr-accent);
	font-size: 1.05em;
}
.rrr__field--slider input[type="range"] {
	width: 100%;
	accent-color: var(--rrr-accent);
	margin-top: .25rem;
}

/* Reset-Button */
.rrr__reset {
	margin: .5rem 0 0;
	width: 100%;
	padding: .55rem .8rem;
	border: 1px solid var(--rrr-border);
	border-radius: 5px;
	background: #fff;
	color: var(--rrr-muted);
	font-size: .9em;
	cursor: pointer;
}
.rrr__reset:hover { background: #f3f4f6; color: #111; }

/* Sichtbares, aber nicht editierbares Feld (reine Anzeige) */
.rrr__field--readonly {
	flex-direction: row;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
	padding: .35rem .6rem;
	background: #fff;
	border: 1px dashed var(--rrr-border);
	border-radius: 5px;
}
.rrr__field--readonly strong { color: #111; white-space: nowrap; }

.rrr__chartfallback {
	color: var(--rrr-muted);
	font-style: italic;
	text-align: center;
	padding: 2rem 0;
}

.rrr__derived {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px dashed var(--rrr-border);
}
.rrr__derived > div {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding: .2rem 0;
}
.rrr__derived strong { color: var(--rrr-accent); }

/* Validierungsbereich: historische Renditen */
.rrr__histval {
	margin-top: 1.25rem;
	padding-top: 1rem;
	border-top: 2px solid var(--rrr-border);
}
.rrr__histval h3 { margin-bottom: .5rem; }
.rrr__hist-intro {
	font-size: .85em;
	color: var(--rrr-muted);
	margin: 0 0 .75rem;
}
.rrr__hist-vals { margin-top: .75rem; }

/* Tabellen */
/* Scroll-Container: breite Tabellen scrollen bei Bedarf innerhalb ihres Rahmens
   (statt die ganze Seite seitlich scrollen zu lassen – wichtig auf dem Handy). */
.rrr__tablewrap {
	max-width: 100%;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin-bottom: 1.5rem;
}
.rrr__tablewrap .rrr__table { margin-bottom: 0; }
.rrr__table {
	width: 100%;
	border-collapse: collapse;
	margin-bottom: 1.5rem;
}
.rrr__table th,
.rrr__table td {
	border: 1px solid var(--rrr-border);
	padding: .55rem .7rem;
	text-align: right;
}
.rrr__table thead th {
	background: var(--rrr-accent);
	color: #fff;
	font-weight: 600;
	text-align: right;
}
.rrr__table tbody th { text-align: left; background: #f3f4f6; }
.rrr__table tbody tr:nth-child(even) td { background: #fafafa; }
.rrr__muted { color: var(--rrr-muted); }

.rrr__chartwrap {
	position: relative;
	height: 320px;
	margin-bottom: 1.75rem;
}

/* Ausgabe-Blöcke (Endwert-Abschnitt, Rendite-Abschnitt) – optisch wie der Annahmen-Block */
.rrr__block {
	background: #fafafa;
	border: 1px solid var(--rrr-border);
	border-radius: 8px;
	padding: 1.25rem;
	margin-bottom: 1.5rem;
}
.rrr__block > h3 { margin-top: 0; }
/* letztes Element im Block ohne zusätzlichen Abstand nach unten */
.rrr__block > :last-child,
.rrr__block .rrr__chartwrap:last-child,
.rrr__block .rrr__tablewrap:last-child { margin-bottom: 0; }

/* PDF-Export */
.rrr__pdf {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: .75rem;
	margin-top: 1.5rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--rrr-border);
}
.rrr__pdf-name { display: flex; flex-direction: column; gap: .25rem; flex: 1 1 220px; }
.rrr__pdf-name input {
	padding: .5rem .6rem;
	border: 1px solid var(--rrr-border);
	border-radius: 5px;
	font-size: 1em;
}
.rrr__pdf-btn {
	padding: .6rem 1.1rem;
	border: 0;
	border-radius: 5px;
	background: var(--rrr-accent);
	color: #fff;
	font-size: 1em;
	cursor: pointer;
	white-space: nowrap;
	flex: 0 0 auto;
}
.rrr__pdf-btn:hover { filter: brightness(0.93); }
.rrr__pdf-btn:disabled { opacity: .6; cursor: default; }
.rrr__pdf-status { color: var(--rrr-muted); font-size: .9em; }

.rrr__note {
	font-size: .85em;
	color: var(--rrr-muted);
	border-left: 3px solid var(--rrr-input-bg);
	padding-left: .75rem;
}

.rrr__version {
	margin: 1.25rem 0 0;
	font-size: .75em;
	color: var(--rrr-muted);
	text-align: right;
}
