/*
 * Tuottolaskuri Core – Vuokratuottolaskuri.
 * Loaded only with this calculator, after tlc-core.css, tlc-investment-return.css and
 * tlc-dividend.css (shared tabbed-calculator styles).
 */

.tlc-rent .tlc-rent-hero .tlc-hero__img { object-position: right 40%; }

/* Mode A: income and cost bars */
.tlc-rent .tlc-rent-bars__list { display: grid; gap: .55rem; margin: .75rem 0 0; padding: 0; list-style: none; }

.tlc-rent .tlc-rent-bar {
	display: grid;
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
	align-items: center;
	gap: .75rem;
	margin: 0;
	font-size: .875rem;
	color: var(--tlc-text);
}

.tlc-rent .tlc-rent-bar__track { height: 12px; overflow: hidden; border-radius: 999px; background: #e3eaf4; }
.tlc-rent .tlc-rent-bar__fill { display: block; height: 100%; border-radius: 999px; background: var(--tlc-primary); }
.tlc-rent .tlc-rent-bar--cost .tlc-rent-bar__fill { background: #e5484d; }
.tlc-rent .tlc-rent-bar--net .tlc-rent-bar__fill { background: var(--tlc-positive); }
.tlc-rent .tlc-rent-bar--loss .tlc-rent-bar__fill { background: #b42318; }
.tlc-rent .tlc-rent-bar__value { min-width: 6.5rem; text-align: right; font-variant-numeric: tabular-nums; color: var(--tlc-navy); }
.tlc-rent .tlc-rent-bar--net { font-weight: 700; }
.tlc-rent .tlc-rent-bar--net .tlc-rent-bar__value { color: var(--tlc-positive-text); }
.tlc-rent .tlc-rent-bar--loss .tlc-rent-bar__value { color: var(--tlc-negative-text); }

@container tlc-results (max-width: 420px) {
	.tlc-rent .tlc-rent-bar { grid-template-columns: minmax(0, 1fr) auto; }
	.tlc-rent .tlc-rent-bar__track { grid-column: 1 / -1; grid-row: 2; }
}

/* Mode B: stress test */
.tlc-rent .tlc-rent-stress { container: tlc-stress / inline-size; }
.tlc-rent .tlc-rent-stress__grid { display: grid; gap: 1.25rem 2rem; }

@container tlc-stress (min-width: 820px) {
	.tlc-rent .tlc-rent-stress__grid { grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); align-items: start; }
}

.tlc-rent .tlc-rent-stress__inputs { container: tlc-settings / inline-size; }
.tlc-rent .tlc-rent-stress__inputs .tlc-field--slider:first-child { margin-top: 0; }
.tlc-rent .tlc-rent-stress__inputs .tlc-fields-2 { margin-top: 1.4rem; }
.tlc-rent .tlc-rent-stress__results { container: tlc-results / inline-size; transition: opacity .15s ease; }
.tlc-rent .tlc-rent-stress__results.is-stale { opacity: .45; }

.tlc-rent .tlc-rent-scards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; }

@container tlc-results (min-width: 560px) {
	.tlc-rent .tlc-rent-scards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

.tlc-rent .tlc-rent-scard { padding: .8rem .85rem; }
.tlc-rent .tlc-rent-scard .tlc-kpi__label { min-height: 0; }
.tlc-rent .tlc-rent-scard .tlc-kpi__value { font-size: clamp(1.15rem, .8rem + 1.6cqi, 1.45rem); }

.tlc-rent .tlc-rent-stress__flag {
	margin: .85rem 0 0;
	padding: .6rem .85rem;
	border-radius: 10px;
	background: #e2f4ef;
	color: var(--tlc-positive-text);
	font-size: .875rem;
	font-weight: 600;
}

.tlc-rent .tlc-rent-stress__flag.is-negative { background: #fdecea; color: var(--tlc-negative-text); }
.tlc-rent .tlc-rent-stress__chart { margin-top: 1rem; }

/* Stress chart: base = green line, stress = red line. */
.tlc-rent .tlc-rent-stress__chart .tlc-chart__line--contrib { stroke: #e5484d; }
.tlc-rent .tlc-rent-stress__chart .tlc-chart__end--contrib,
.tlc-rent .tlc-rent-stress__chart .tlc-chart__dot--contrib { fill: #e5484d; }
.tlc-rent .tlc-rent-stress__chart .tlc-chart__pill--contrib rect { fill: #c9363b; }
.tlc-rent .tlc-rent-stress__chart .tlc-chart__tooltip-row--contrib span::before { background: #e5484d; }
.tlc-rent .tlc-rent-legend--stress::before { width: 12px; height: 12px; border-radius: 50%; background: #e5484d; }
.tlc-rent .tlc-chart__zero-line { stroke: #94a3b8; stroke-width: 1.25; }
