/**
 * Uno Lainalaskuri - styles
 *
 * Everything is namespaced under .ulc and driven by custom properties on the
 * mount element, so the calculator keeps its own look inside whatever theme
 * WordPress happens to be running, and a theme can still retint it by
 * overriding a handful of variables.
 */

/**
 * DM Sans is supplied by the Uno child theme, not by this plugin.
 *
 * Typography is a theme concern, and shipping a second copy here would mean the
 * calculator page downloaded the same font twice from two URLs. The stack below
 * falls back to system faces, so the plugin still looks reasonable on a theme
 * that does not provide DM Sans.
 */

/**
 * Palette and shapes follow unoscore.no, so the two properties read as one
 * brand: lavender ground, violet actions, white 24px cards on a soft low
 * shadow, pill buttons, DM Sans.
 */
[data-uno-calculator] {
	--ulc-bg: #e7e7ff;
	--ulc-card: #ffffff;
	--ulc-card-2: #f6f6ff;
	--ulc-ink: #2d4156;
	--ulc-ink-2: #5a6b7d;
	--ulc-ink-3: #8b98a6;
	--ulc-line: #e3e3f6;
	--ulc-line-2: #eeeefb;

	--ulc-accent: #6b4eff;
	--ulc-accent-2: #5538ee;
	--ulc-accent-ink: #ffffff;
	--ulc-accent-soft: rgba( 107, 78, 255, 0.1 );

	/* The three cost components. Principal takes the brand violet; the other two
	   are far enough away in hue to stay separable in the donut, including for
	   most kinds of colour blindness. */
	--ulc-principal: #6b4eff;
	--ulc-interest: #ffb323;
	--ulc-fees: #f2545b;

	/* Market data and success states. Deliberately NOT the action colour - the
	   Euribor history is information, not something to click. */
	--ulc-data: #0e9f7e;

	--ulc-warn: #b42318;
	--ulc-warn-bg: #fef3f2;

	--ulc-radius: 24px;
	--ulc-radius-sm: 12px;
	--ulc-shadow: 0 1px 12px 2px rgba( 20, 20, 20, 0.08 );

	--ulc-font: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

/**
 * Dark theme. unoscore.no ships light only, so this is an extrapolation rather
 * than a match: the violet is lifted toward #8b74ff because #6b4eff on a dark
 * ground fails contrast, and the lavender ground becomes a deep indigo-navy so
 * the hue family still reads as the same brand.
 */
@media ( prefers-color-scheme: dark ) {
	[data-uno-calculator]:not( [data-ulc-theme="light"] ) {
		--ulc-bg: #12122a;
		--ulc-card: #1b1b38;
		--ulc-card-2: #212145;
		--ulc-ink: #ececfa;
		--ulc-ink-2: #b0b3cc;
		--ulc-ink-3: #7c80a0;
		--ulc-line: #2c2c55;
		--ulc-line-2: #252547;

		--ulc-accent: #8b74ff;
		--ulc-accent-2: #a08fff;
		--ulc-accent-ink: #14043a;
		--ulc-accent-soft: rgba( 139, 116, 255, 0.16 );

		--ulc-principal: #8b74ff;
		--ulc-interest: #ffc555;
		--ulc-fees: #ff7a86;
		--ulc-data: #2ed3a7;

		--ulc-warn: #fca5a5;
		--ulc-warn-bg: rgba( 220, 38, 38, 0.14 );

		--ulc-shadow: 0 1px 12px 2px rgba( 0, 0, 0, 0.45 );
	}
}

[data-uno-calculator][data-ulc-theme="dark"] {
	--ulc-bg: #12122a;
	--ulc-card: #1b1b38;
	--ulc-card-2: #212145;
	--ulc-ink: #ececfa;
	--ulc-ink-2: #b0b3cc;
	--ulc-ink-3: #7c80a0;
	--ulc-line: #2c2c55;
	--ulc-line-2: #252547;
	--ulc-accent: #8b74ff;
	--ulc-accent-2: #a08fff;
	--ulc-accent-ink: #14043a;
	--ulc-accent-soft: rgba( 139, 116, 255, 0.16 );
	--ulc-principal: #8b74ff;
	--ulc-interest: #ffc555;
	--ulc-fees: #ff7a86;
	--ulc-data: #2ed3a7;
	--ulc-warn: #fca5a5;
	--ulc-warn-bg: rgba( 220, 38, 38, 0.14 );
	--ulc-shadow: 0 1px 12px 2px rgba( 0, 0, 0, 0.45 );
}

/**
 * Escape a narrow theme content column.
 *
 * Block themes cap article width at around 600px, roughly half what the
 * two-column layout needs. Rather than out-!important-ing the theme, the
 * shortcode adds WordPress's own "alignfull" class, which the core constrained
 * -layout rule deliberately exempts from both the max-width clamp and its
 * forced auto margins. The calculator then centres itself on .ulc's own
 * max-width, so it is never actually edge-to-edge.
 */
.uno-calculator-mount--wide {
	padding-inline: 20px;
}

/* The lavender ground is what makes the block read as UnoScore rather than as a
   widget dropped onto a white page. Full-bleed band, content still centred on
   .ulc's own max-width.
   Only on the full-width version: the simple one sits inside a card that
   supplies its own background, where a band would show as a stray block. */
.uno-calculator-mount--wide {
	background: var( --ulc-bg );
	padding-block: 40px;
}

@media ( max-width: 900px ) {
	.uno-calculator-mount--wide { padding-block: 28px; }
}

.ulc,
.ulc *,
.ulc *::before,
.ulc *::after {
	box-sizing: border-box;
}

.ulc {
	font-family: var( --ulc-font );
	color: var( --ulc-ink );
	max-width: 1120px;
	margin: 0 auto;
	padding: 8px 0 0;
	line-height: 1.5;
	/* Lining, fixed-width digits. Without this every animated figure jitters as
	   the glyph widths change from frame to frame. */
	font-variant-numeric: tabular-nums;
	-webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------- simple (landing) */

/*
 * The two-slider version that sits in a landing-page hero column. Sized to a
 * sidebar rather than the full grid, so it never gets the width breakout.
 */
.ulc-simple { max-width: none; padding: 0; }

.ulc-simple .ulc-field + .ulc-field {
	margin-top: 18px;
	padding-top: 18px;
}

.ulc-simple-hero {
	display: flex;
	align-items: baseline;
	justify-content: center;
	gap: 6px;
	margin: 24px 0 4px;
	padding-top: 22px;
	border-top: 1px solid var( --ulc-line-2 );
}

.ulc-simple-approx {
	font-size: 14px;
	color: var( --ulc-ink-3 );
}

.ulc-simple-value {
	font-size: clamp( 30px, 4.4vw, 40px );
	font-weight: 750;
	letter-spacing: -0.03em;
	line-height: 1.05;
	color: var( --ulc-ink );
}

.ulc-simple-per {
	font-size: 16px;
	font-weight: 600;
	color: var( --ulc-ink-3 );
}

.ulc-simple-rows { margin-top: 18px; }

.ulc-simple-rows p {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	margin: 0;
	padding: 10px 0;
	font-size: 14px;
	color: var( --ulc-ink-2 );
	border-bottom: 1px solid var( --ulc-line-2 );
}

.ulc-simple-figure {
	font-weight: 700;
	color: var( --ulc-ink );
	white-space: nowrap;
}

/* The APR is the row that matters, so it is the one that is coloured. */
.ulc-simple-rows p:first-child .ulc-simple-figure { color: var( --ulc-accent ); }

.ulc-simple-cta {
	display: block;
	margin-top: 20px;
	text-align: center;
	text-decoration: none;
}

.ulc-simple-note { margin-top: 14px; font-size: 11.5px; }

/* ------------------------------------------------------------------ header */

.ulc-head {
	text-align: center;
	margin-bottom: 28px;
}

/* Their h1 is 48/56 at 700 with no negative tracking - DM Sans is already
   compact, and tightening it further makes it look squeezed. */
.ulc-title {
	font-size: clamp( 30px, 4.4vw, 48px );
	line-height: 1.16;
	letter-spacing: -0.01em;
	font-weight: 700;
	margin: 0 0 12px;
	color: var( --ulc-ink );
}

.ulc-lead {
	margin: 0 auto;
	max-width: 60ch;
	color: var( --ulc-ink-2 );
	font-size: 16.5px;
	line-height: 1.65;
}

/* -------------------------------------------------------------------- grid */

.ulc-grid {
	display: grid;
	grid-template-columns: minmax( 0, 1fr ) minmax( 0, 1.05fr );
	gap: 20px;
	align-items: start;
}

@media ( max-width: 900px ) {
	.ulc-grid { grid-template-columns: 1fr; }
}

/* Borderless, as on unoscore.no - on the lavender ground the shadow alone
   separates the card, and an outline would only make it look boxed in. */
.ulc-panel {
	background: var( --ulc-card );
	border: 0;
	border-radius: var( --ulc-radius );
	box-shadow: var( --ulc-shadow );
	padding: 28px;
}

/* ------------------------------------------------------------------ fields */

.ulc-field + .ulc-field {
	margin-top: 22px;
	padding-top: 22px;
	border-top: 1px solid var( --ulc-line-2 );
}

.ulc-field[hidden] { display: none; }

.ulc-field-top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 12px;
}

.ulc-label {
	font-size: 14px;
	font-weight: 600;
	color: var( --ulc-ink-2 );
}

.ulc-input-wrap {
	display: flex;
	align-items: center;
	gap: 6px;
	background: var( --ulc-card-2 );
	border: 1px solid var( --ulc-line );
	border-radius: var( --ulc-radius-sm );
	padding: 4px 10px;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.ulc-input-wrap:focus-within {
	border-color: var( --ulc-accent );
	box-shadow: 0 0 0 3px var( --ulc-accent-soft );
}

.ulc-input {
	width: 7ch;
	border: 0;
	background: transparent;
	color: var( --ulc-ink );
	font: inherit;
	font-size: 17px;
	font-weight: 650;
	text-align: right;
	padding: 4px 0;
	font-variant-numeric: tabular-nums;
}

.ulc-input:focus { outline: none; }

/* Chrome/Safari add spinners that fight with the slider for the same job. */
.ulc-input::-webkit-outer-spin-button,
.ulc-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.ulc-unit {
	font-size: 13px;
	font-weight: 600;
	color: var( --ulc-ink-3 );
	white-space: nowrap;
}

.ulc-unit-toggle {
	display: flex;
	gap: 2px;
	background: var( --ulc-line-2 );
	border-radius: 7px;
	padding: 2px;
}

.ulc-unit-btn {
	border: 0;
	background: transparent;
	color: var( --ulc-ink-3 );
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	padding: 3px 8px;
	border-radius: 5px;
	cursor: pointer;
	transition: background 0.15s, color 0.15s;
}

.ulc-unit-btn.is-on {
	background: var( --ulc-card );
	color: var( --ulc-accent );
	box-shadow: 0 1px 2px rgba( 0, 0, 0, 0.12 );
}

/* ----------------------------------------------------------------- sliders */

.ulc-slider {
	--ulc-fill: 50%;
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	height: 22px;
	background: transparent;
	cursor: pointer;
	display: block;
	margin: 0;
}

/* The filled portion of the track is painted with a gradient stop at the thumb
   position, which native range inputs cannot express on their own. */
.ulc-slider::-webkit-slider-runnable-track {
	height: 6px;
	border-radius: 999px;
	background: linear-gradient( to right, var( --ulc-accent ) 0 var( --ulc-fill ), var( --ulc-line ) var( --ulc-fill ) 100% );
}

.ulc-slider::-moz-range-track {
	height: 6px;
	border-radius: 999px;
	background: linear-gradient( to right, var( --ulc-accent ) 0 var( --ulc-fill ), var( --ulc-line ) var( --ulc-fill ) 100% );
}

.ulc-slider::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 20px;
	height: 20px;
	margin-top: -7px;
	border-radius: 50%;
	background: var( --ulc-card );
	border: 3px solid var( --ulc-accent );
	box-shadow: 0 1px 4px rgba( 13, 21, 38, 0.25 );
	transition: transform 0.12s ease, box-shadow 0.12s ease;
}

.ulc-slider::-moz-range-thumb {
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var( --ulc-card );
	border: 3px solid var( --ulc-accent );
	box-shadow: 0 1px 4px rgba( 13, 21, 38, 0.25 );
	transition: transform 0.12s ease;
}

.ulc-slider:hover::-webkit-slider-thumb { transform: scale( 1.12 ); }
.ulc-slider:active::-webkit-slider-thumb { transform: scale( 1.2 ); }
.ulc-slider:hover::-moz-range-thumb { transform: scale( 1.12 ); }

.ulc-slider:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 5px var( --ulc-accent-soft ); }
.ulc-slider:focus { outline: none; }

.ulc-scale {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: var( --ulc-ink-3 );
	margin-top: 2px;
}

/* --------------------------------------------------------- segmented control */

.ulc-seg {
	display: flex;
	gap: 3px;
	background: var( --ulc-line-2 );
	border-radius: var( --ulc-radius-sm );
	padding: 3px;
}

.ulc-seg-btn {
	flex: 1;
	border: 0;
	background: transparent;
	color: var( --ulc-ink-2 );
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	padding: 8px 6px;
	border-radius: 7px;
	cursor: pointer;
	white-space: nowrap;
	transition: background 0.16s, color 0.16s, box-shadow 0.16s;
}

.ulc-seg-btn:hover { color: var( --ulc-ink ); }

.ulc-seg-btn.is-on {
	background: var( --ulc-card );
	color: var( --ulc-accent );
	box-shadow: 0 1px 3px rgba( 13, 21, 38, 0.14 );
}

.ulc-seg-sm .ulc-seg-btn { font-size: 12px; padding: 6px 12px; flex: 0 0 auto; }

.ulc-field-method .ulc-label { display: block; margin-bottom: 10px; }

.ulc-help {
	margin: 8px 0 0;
	font-size: 12.5px;
	color: var( --ulc-ink-3 );
}

/* ----------------------------------------------------------------- buttons */

/* Fully rounded, as on unoscore.no - the pill is the most recognisable single
   element of that design. */
.ulc-btn {
	border: 1px solid transparent;
	background: var( --ulc-accent );
	color: var( --ulc-accent-ink );
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	padding: 12px 28px;
	border-radius: 999px;
	cursor: pointer;
	transition: transform 0.12s, background 0.15s, color 0.15s, border-color 0.15s;
}

.ulc-btn:hover { background: var( --ulc-accent-2 ); }
.ulc-btn:active { transform: translateY( 1px ); }
.ulc-btn:focus-visible { outline: 3px solid var( --ulc-accent-soft ); outline-offset: 2px; }

.ulc-btn-ghost {
	background: var( --ulc-card );
	color: var( --ulc-ink-2 );
	border-color: var( --ulc-line );
}

.ulc-btn-ghost:hover {
	background: var( --ulc-card );
	color: var( --ulc-accent );
	border-color: var( --ulc-accent );
}

/* Success, not brand - a violet "copied" state on a violet button reads as
   nothing having happened. */
.ulc-btn.is-done,
.ulc-btn.is-done:hover { background: var( --ulc-data ); color: #fff; }

.ulc-actions {
	margin-top: 22px;
	padding-top: 18px;
	border-top: 1px solid var( --ulc-line-2 );
	display: flex;
	justify-content: flex-end;
}

/* ----------------------------------------------------------------- results */

.ulc-results {
	background: linear-gradient( 180deg, var( --ulc-card-2 ), var( --ulc-card ) 180px );
}

.ulc-hero {
	text-align: center;
	padding: 6px 0 22px;
}

.ulc-hero-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var( --ulc-ink-3 );
	margin-bottom: 6px;
}

.ulc-hero-value {
	display: block;
	font-size: clamp( 38px, 6.5vw, 56px );
	line-height: 1.05;
	font-weight: 750;
	letter-spacing: -0.03em;
	color: var( --ulc-ink );
}

.ulc-hero-sub {
	display: block;
	margin-top: 8px;
	font-size: 13.5px;
	color: var( --ulc-ink-3 );
}

.ulc-warn {
	margin: 0 0 18px;
	padding: 10px 14px;
	border-radius: var( --ulc-radius-sm );
	background: var( --ulc-warn-bg );
	color: var( --ulc-warn );
	font-size: 13.5px;
	font-weight: 600;
}

.ulc-warn[hidden] { display: none; }

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

.ulc-stat {
	background: var( --ulc-card-2 );
	border: 1px solid var( --ulc-line-2 );
	border-radius: var( --ulc-radius-sm );
	padding: 12px 10px;
	text-align: center;
	min-width: 0;
}

/* The APR is the whole point of the calculator, so it is tinted rather than
   sitting anonymously among the other two figures. */
.ulc-stat:first-child {
	border-color: var( --ulc-accent );
	background: var( --ulc-accent-soft );
}

.ulc-stat-label {
	display: block;
	font-size: 11.5px;
	font-weight: 600;
	color: var( --ulc-ink-3 );
	margin-bottom: 4px;
	line-height: 1.3;
}

.ulc-stat-value {
	display: block;
	font-size: clamp( 16px, 2.2vw, 20px );
	font-weight: 700;
	letter-spacing: -0.015em;
	color: var( --ulc-ink );
}

.ulc-stat:first-child .ulc-stat-value { color: var( --ulc-accent ); }

/* ------------------------------------------------------------------- donut */

.ulc-split {
	display: flex;
	align-items: center;
	gap: 22px;
	padding: 20px 0;
	border-top: 1px solid var( --ulc-line-2 );
}

.ulc-donut {
	position: relative;
	flex: 0 0 148px;
	width: 148px;
	height: 148px;
}

.ulc-donut-svg {
	width: 100%;
	height: 100%;
	transform: rotate( -90deg );
}

.ulc-donut-track {
	fill: none;
	stroke: var( --ulc-line-2 );
	stroke-width: 14;
}

.ulc-arc {
	fill: none;
	stroke-width: 14;
	stroke-linecap: butt;
	transition: stroke-dasharray 0.45s cubic-bezier( 0.22, 1, 0.36, 1 ), stroke-dashoffset 0.45s cubic-bezier( 0.22, 1, 0.36, 1 );
}

.ulc-arc-principal { stroke: var( --ulc-principal ); }
.ulc-arc-interest { stroke: var( --ulc-interest ); }
.ulc-arc-fees { stroke: var( --ulc-fees ); }

.ulc-donut-center {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	pointer-events: none;
}

.ulc-donut-center span {
	font-size: 11px;
	font-weight: 600;
	color: var( --ulc-ink-3 );
	letter-spacing: 0.03em;
}

.ulc-donut-center strong {
	font-size: 19px;
	font-weight: 750;
	letter-spacing: -0.02em;
	color: var( --ulc-ink );
}

.ulc-legend {
	list-style: none;
	margin: 0;
	padding: 0;
	flex: 1 1 auto;
	min-width: 0;
}

.ulc-legend-item {
	display: flex;
	align-items: center;
	gap: 9px;
	padding: 7px 0;
}

.ulc-legend-item + .ulc-legend-item { border-top: 1px solid var( --ulc-line-2 ); }

.ulc-swatch {
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	border-radius: 3px;
}

.ulc-swatch-principal { background: var( --ulc-principal ); }
.ulc-swatch-interest { background: var( --ulc-interest ); }
.ulc-swatch-fees { background: var( --ulc-fees ); }

.ulc-legend-label {
	flex: 1 1 auto;
	font-size: 13.5px;
	color: var( --ulc-ink-2 );
}

.ulc-legend-value {
	font-size: 14px;
	font-weight: 680;
	color: var( --ulc-ink );
	white-space: nowrap;
}

/* ---------------------------------------------------- rate type + euribor */

.ulc-field-rate .ulc-label { display: block; margin-bottom: 10px; }

.ulc-sublabel {
	display: block;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var( --ulc-ink-3 );
	margin-bottom: 7px;
}

.ulc-euribor-pick { margin-top: 14px; }
.ulc-euribor-pick[hidden] { display: none; }

/* Each maturity button carries its own current rate, so the picker doubles as a
   snapshot of the yield curve. */
.ulc-term-name { display: block; }

.ulc-term-rate {
	display: block;
	font-size: 12px;
	font-weight: 700;
	color: var( --ulc-ink-3 );
	margin-top: 1px;
}

.ulc-seg-btn.is-on .ulc-term-rate { color: var( --ulc-accent ); }
.ulc-field-rate .ulc-seg-sm .ulc-seg-btn { flex: 1 1 0; padding: 7px 4px; }

.ulc-rate-sum {
	margin: 12px 0 0;
	padding: 9px 12px;
	border-radius: var( --ulc-radius-sm );
	background: var( --ulc-accent-soft );
	font-size: 12.5px;
	color: var( --ulc-ink-2 );
	line-height: 1.5;
}

.ulc-rate-sum strong {
	color: var( --ulc-accent );
	font-size: 14px;
	font-weight: 750;
	white-space: nowrap;
}

/* ------------------------------------------------------------ stress test */

.ulc-stress {
	margin-bottom: 22px;
	padding-bottom: 20px;
	border-bottom: 1px solid var( --ulc-line-2 );
}

.ulc-stress[hidden] { display: none; }

.ulc-stress-row {
	display: grid;
	grid-template-columns: repeat( 4, minmax( 0, 1fr ) );
	gap: 8px;
}

.ulc-stress-cell {
	text-align: center;
	padding: 10px 6px;
	border-radius: var( --ulc-radius-sm );
	background: var( --ulc-card-2 );
	border: 1px solid var( --ulc-line-2 );
	min-width: 0;
}

/* The "now" column is the reader's anchor - every other column is only
   meaningful as a distance from it. */
.ulc-stress-cell.is-now {
	background: var( --ulc-accent-soft );
	border-color: var( --ulc-accent );
}

.ulc-stress-head {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var( --ulc-ink-3 );
}

.ulc-stress-rate {
	display: block;
	font-size: 11.5px;
	color: var( --ulc-ink-3 );
	margin: 2px 0 3px;
}

.ulc-stress-val {
	display: block;
	font-size: clamp( 14px, 1.9vw, 17px );
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var( --ulc-ink );
}

.ulc-stress-cell.is-now .ulc-stress-val { color: var( --ulc-accent ); }

/* ------------------------------------------------------- euribor statistics */

.ulc-euribor-wrap { margin-top: 20px; }
.ulc-euribor { margin-top: 14px; }
.ulc-euribor[hidden] { display: none; }

.ulc-euribor-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	flex-wrap: wrap;
	margin-bottom: 18px;
}

.ulc-euribor-title {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
	letter-spacing: -0.02em;
	color: var( --ulc-ink );
}

.ulc-euribor-stats {
	display: grid;
	grid-template-columns: repeat( 6, minmax( 0, 1fr ) );
	gap: 10px;
	margin-bottom: 22px;
}

@media ( max-width: 780px ) {
	.ulc-euribor-stats { grid-template-columns: repeat( 3, minmax( 0, 1fr ) ); }
}

@media ( max-width: 420px ) {
	.ulc-euribor-stats { grid-template-columns: repeat( 2, minmax( 0, 1fr ) ); }
	.ulc-stress-row { grid-template-columns: repeat( 2, minmax( 0, 1fr ) ); }
}

/* Direction of travel, not good/bad - a falling rate is good for a borrower and
   bad for a saver, and this page does not know which the reader is. */
.ulc-stat-value.is-up { color: var( --ulc-fees ); }
.ulc-stat-value.is-down { color: var( --ulc-data ); }

.ulc-chart-svg--tall { height: 200px; }

/* Doubled class deliberately: the base .ulc-area / .ulc-line rules live further
   down the file, so at equal specificity they would otherwise win and the
   Euribor history would render in the loan chart's colour. */
.ulc-area.ulc-area--eb { fill: var( --ulc-data ); opacity: 0.13; }
.ulc-line.ulc-line--eb { stroke: var( --ulc-data ); }

.ulc-yaxis {
	position: absolute;
	inset: 0;
	pointer-events: none;
}

.ulc-yaxis span {
	position: absolute;
	left: 0;
	transform: translateY( -50% );
	font-size: 10.5px;
	line-height: 1;
	color: var( --ulc-ink-3 );
	background: var( --ulc-card );
	padding: 1px 4px 1px 0;
}

.ulc-zeroline {
	stroke: var( --ulc-ink-3 );
	stroke-width: 1;
	opacity: 0.5;
}

/* ------------------------------------------------------------------- chart */

.ulc-chart {
	border-top: 1px solid var( --ulc-line-2 );
	padding-top: 18px;
}

.ulc-chart-title {
	display: block;
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var( --ulc-ink-3 );
	margin-bottom: 10px;
}

.ulc-plot {
	position: relative;
	touch-action: pan-y;
}

.ulc-chart-svg {
	display: block;
	width: 100%;
	height: 150px;
	overflow: visible;
}

.ulc-gridline { stroke: var( --ulc-line-2 ); stroke-width: 1; }

.ulc-area {
	fill: var( --ulc-accent );
	opacity: 0.14;
	transition: d 0.3s ease;
}

.ulc-line {
	fill: none;
	stroke: var( --ulc-accent );
	stroke-width: 2.5;
	stroke-linejoin: round;
}

.ulc-cursor {
	stroke: var( --ulc-ink-3 );
	stroke-width: 1;
	stroke-dasharray: 3 3;
	transition: opacity 0.15s;
}

.ulc-axis {
	display: flex;
	justify-content: space-between;
	font-size: 11px;
	color: var( --ulc-ink-3 );
	margin-top: 6px;
}

.ulc-tip {
	position: absolute;
	top: 4px;
	display: flex;
	flex-direction: column;
	gap: 1px;
	background: var( --ulc-ink );
	color: var( --ulc-card );
	padding: 7px 11px;
	border-radius: 9px;
	font-size: 12px;
	pointer-events: none;
	white-space: nowrap;
	box-shadow: 0 6px 20px -6px rgba( 0, 0, 0, 0.45 );
	z-index: 2;
}

.ulc-tip[hidden] { display: none; }
.ulc-tip strong { font-size: 14px; font-weight: 700; }
.ulc-tip-head,
.ulc-tip-sub { opacity: 0.7; font-size: 11px; }

/* ------------------------------------------------------------------- table */

.ulc-table-wrap { margin-top: 20px; }

.ulc-table-bar {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}

.ulc-table-scroll {
	margin-top: 14px;
	max-height: 460px;
	overflow: auto;
	border: 1px solid var( --ulc-line );
	border-radius: var( --ulc-radius );
	background: var( --ulc-card );
	box-shadow: var( --ulc-shadow );
	-webkit-overflow-scrolling: touch;
}

.ulc-table-scroll[hidden] { display: none; }

.ulc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13.5px;
	font-variant-numeric: tabular-nums;
}

.ulc-table th {
	position: sticky;
	top: 0;
	z-index: 1;
	background: var( --ulc-card-2 );
	color: var( --ulc-ink-3 );
	font-size: 11.5px;
	font-weight: 650;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-align: left;
	padding: 11px 14px;
	border-bottom: 1px solid var( --ulc-line );
	white-space: nowrap;
}

.ulc-table td {
	padding: 9px 14px;
	border-bottom: 1px solid var( --ulc-line-2 );
	color: var( --ulc-ink-2 );
	white-space: nowrap;
}

.ulc-table tbody tr:hover td { background: var( --ulc-accent-soft ); }
.ulc-table td:first-child { color: var( --ulc-ink ); font-weight: 600; }
.ulc-table .ulc-num { text-align: right; }

/* ------------------------------------------------------------------ footer */

.ulc-foot { margin-top: 22px; }

.ulc-foot-actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.ulc-note {
	margin: 16px 0 0;
	font-size: 12px;
	line-height: 1.6;
	color: var( --ulc-ink-3 );
	max-width: 80ch;
}

/* --------------------------------------------------- sticky mobile summary */

.ulc-bar { display: none; }

@media ( max-width: 900px ) {
	.ulc-bar {
		position: sticky;
		bottom: 0;
		z-index: 20;
		display: flex;
		gap: 8px;
		margin: 20px -4px 0;
		padding: 11px 16px;
		background: var( --ulc-card );
		border: 1px solid var( --ulc-line );
		border-radius: var( --ulc-radius );
		box-shadow: 0 -6px 24px -12px rgba( 13, 21, 38, 0.4 );
	}

	.ulc-bar-item {
		flex: 1 1 0;
		min-width: 0;
		display: flex;
		flex-direction: column;
	}

	.ulc-bar-item + .ulc-bar-item {
		border-left: 1px solid var( --ulc-line-2 );
		padding-left: 12px;
	}

	.ulc-bar-label {
		font-size: 10.5px;
		font-weight: 600;
		letter-spacing: 0.04em;
		text-transform: uppercase;
		color: var( --ulc-ink-3 );
	}

	.ulc-bar-value {
		font-size: 17px;
		font-weight: 750;
		letter-spacing: -0.02em;
		color: var( --ulc-ink );
	}

	.ulc-panel { padding: 20px 18px; }
	.ulc-split { flex-direction: column; align-items: stretch; gap: 16px; }
	.ulc-donut { margin: 0 auto; }
}

@media ( max-width: 420px ) {
	.ulc-stats { grid-template-columns: 1fr; }
	.ulc-stat { display: flex; align-items: baseline; justify-content: space-between; text-align: left; }
	.ulc-stat-label { margin-bottom: 0; }
}

/* ------------------------------------------------------------------ motion */

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

/* ------------------------------------------------------------------- print */

@media print {
	.ulc-bar,
	.ulc-foot-actions,
	.ulc-actions,
	.ulc-table-bar,
	.ulc-slider,
	.ulc-scale { display: none !important; }

	.ulc-panel { box-shadow: none; border-color: #ccc; break-inside: avoid; }
	.ulc-grid { grid-template-columns: 1fr 1fr; }
	.ulc-table-scroll { max-height: none; overflow: visible; box-shadow: none; }
	.ulc-table th { position: static; }
}
