/* Energia-avustuslaskuri – kaikki säännöt .eal-root-nimiavaruudessa */
.eal-root {
	--eal-primary: var(--wp--preset--color--primary, #2F6A00);
	--eal-text: var(--wp--preset--color--contrast, #13201A);
	--eal-muted: var(--wp--preset--color--muted, #44544A);
	--eal-border: var(--wp--preset--color--border, #E3EAE0);
	--eal-surface: var(--wp--preset--color--surface, #F4F7F2);
	--eal-bg: var(--wp--preset--color--base, #FFFFFF);
	--eal-soft: #EEF4EA;
	--eal-warn: #8A5A00;
	--eal-warn-bg: #FFF6E0;
	--eal-stop: #A1260D;
	--eal-stop-bg: #FDECE8;
	--eal-radius: 14px;
	color: var(--eal-text);
	font-size: 1rem;
	line-height: 1.55;
	margin: 0 auto;
	max-width: 860px;
}
.eal-root *, .eal-root *::before, .eal-root *::after { box-sizing: border-box; }

.eal-root .eal-header { margin-bottom: 24px; }
.eal-root .eal-title { margin: 0 0 8px; }
.eal-root .eal-intro { margin: 0; color: var(--eal-muted); font-size: 1.0625rem; }

.eal-root .eal-app {
	background: var(--eal-bg);
	border: 1px solid var(--eal-border);
	border-radius: var(--eal-radius);
	padding: clamp(20px, 4vw, 36px);
}

/* Progress */
.eal-root .eal-progress { height: 6px; background: var(--eal-surface); border-radius: 999px; overflow: hidden; margin-bottom: 14px; }
.eal-root .eal-progress__bar { height: 100%; background: var(--eal-primary); transition: width .25s ease; }
.eal-root .eal-steps { display: flex; flex-wrap: wrap; gap: 4px 14px; list-style: none; padding: 0; margin: 0 0 20px; font-size: .875rem; color: var(--eal-muted); }
.eal-root .eal-steps li.is-current { color: var(--eal-text); font-weight: 600; }
.eal-root .eal-steps button { background: none; border: 0; padding: 0; font: inherit; color: var(--eal-primary); cursor: pointer; text-decoration: underline; }
.eal-root .eal-step-title { margin: 0 0 16px; font-size: 1.5rem; outline: none; }
.eal-root .eal-subtitle { margin: 28px 0 10px; font-size: 1.125rem; }

/* Fields */
.eal-root .eal-field { margin: 0 0 22px; }
.eal-root .eal-label { font-weight: 600; margin-bottom: 6px; }
.eal-root .eal-help { color: var(--eal-muted); font-size: .9375rem; margin: 0 0 10px; }
.eal-root .eal-row { display: flex; flex-wrap: wrap; gap: 0 20px; }
.eal-root .eal-row > .eal-field { flex: 1 1 220px; }
.eal-root .eal-input {
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	border: 1px solid #C9D6C4;
	border-radius: 10px;
	font: inherit;
	color: inherit;
	background: #fff;
}
.eal-root .eal-input--short { max-width: 220px; }
.eal-root .eal-input:focus, .eal-root select:focus { outline: 2px solid var(--eal-primary); outline-offset: 1px; }

/* Choice cards */
.eal-root .eal-choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.eal-root .eal-choice, .eal-root .eal-check {
	display: flex; align-items: flex-start; gap: 10px;
	min-height: 48px;
	padding: 12px 14px;
	border: 1px solid var(--eal-border);
	border-radius: 10px;
	cursor: pointer;
	background: #fff;
	transition: border-color .15s ease, background .15s ease;
}
.eal-root .eal-choice:hover, .eal-root .eal-check:hover { border-color: var(--eal-primary); }
.eal-root .eal-choice.is-selected { border-color: var(--eal-primary); background: var(--eal-soft); box-shadow: inset 0 0 0 1px var(--eal-primary); }
.eal-root .eal-choice input, .eal-root .eal-check input { margin: 3px 0 0; width: 18px; height: 18px; accent-color: var(--eal-primary); flex: none; }
.eal-root .eal-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 8px; }

/* Buildings */
.eal-root .eal-building { position: relative; border: 1px solid var(--eal-border); border-radius: var(--eal-radius); padding: 18px 18px 0; margin: 0 0 18px; }
.eal-root .eal-building legend { font-weight: 700; padding: 0 6px; }
.eal-root .eal-remove { position: absolute; top: 10px; right: 14px; }

/* Measures */
.eal-root .eal-measures { display: grid; gap: 8px; }
.eal-root .eal-measure { border: 1px solid var(--eal-border); border-radius: 10px; background: #fff; }
.eal-root .eal-measure.is-on { border-color: var(--eal-primary); }
.eal-root .eal-measure__head { border: 0; margin: 0; }
.eal-root .eal-measure__head small { display: block; color: var(--eal-muted); font-size: .8125rem; }
.eal-root .eal-measure__body { padding: 0 14px 14px 42px; }
.eal-root .eal-measure__body .eal-check { border: 0; padding: 4px 0; min-height: 0; }

/* Live feedback, pills, notices */
.eal-root .eal-pill { display: inline-block; padding: 6px 12px; border-radius: 8px; background: var(--eal-soft); color: var(--eal-primary); font-weight: 600; font-size: .9375rem; }
.eal-root .eal-pill--no { background: var(--eal-stop-bg); color: var(--eal-stop); }
.eal-root .eal-pill--neutral { background: var(--eal-surface); color: var(--eal-text); font-weight: 500; }
.eal-root .eal-notes { margin: 8px 0 0; padding-left: 18px; color: var(--eal-muted); font-size: .875rem; }
.eal-root .eal-notice { padding: 12px 16px; border-radius: 10px; background: var(--eal-warn-bg); color: var(--eal-warn); margin: 0 0 18px; }
.eal-root .eal-notice--stop { background: var(--eal-stop-bg); color: var(--eal-stop); }
.eal-root .eal-error { padding: 10px 14px; border-radius: 10px; background: var(--eal-stop-bg); color: var(--eal-stop); margin: 0 0 16px; font-weight: 600; outline: none; }

/* Buttons */
.eal-root .eal-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 48px; padding: 12px 22px;
	border: 1px solid var(--eal-primary); border-radius: 10px;
	background: var(--eal-primary); color: #fff !important;
	font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.eal-root .eal-btn:hover { filter: brightness(.9); }
.eal-root .eal-btn--ghost { background: #fff; color: var(--eal-text) !important; border-color: #C9D6C4; }
.eal-root .eal-btn--ghost:hover { background: var(--eal-soft); filter: none; }
.eal-root .eal-link { background: none; border: 0; padding: 0; font: inherit; color: var(--eal-primary); text-decoration: underline; cursor: pointer; }
.eal-root .eal-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--eal-border); }
.eal-root .eal-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-top: 24px; }

/* Result */
.eal-root .eal-status { border-radius: var(--eal-radius); padding: 20px 22px; margin-bottom: 20px; background: var(--eal-surface); border-left: 6px solid var(--eal-muted); }
.eal-root .eal-status--good { border-left-color: #4DAA3A; background: var(--eal-soft); }
.eal-root .eal-status--maybe { border-left-color: #FFD500; background: #FFFBE6; }
.eal-root .eal-status--warn { border-left-color: #F39200; background: var(--eal-warn-bg); }
.eal-root .eal-status--stop { border-left-color: #E30613; background: var(--eal-stop-bg); }
.eal-root .eal-status__label { font-size: .8125rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--eal-muted); }
.eal-root .eal-status__title { font-size: 1.375rem; font-weight: 800; margin: 2px 0 6px; }
.eal-root .eal-status p { margin: 0; }
.eal-root .eal-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin-bottom: 8px; }
.eal-root .eal-figure { border: 1px solid var(--eal-border); border-radius: 12px; padding: 14px 16px; }
.eal-root .eal-figure span { display: block; font-size: .875rem; color: var(--eal-muted); }
.eal-root .eal-figure strong { font-size: 1.375rem; }
.eal-root .eal-figure--main { grid-column: 1 / -1; background: var(--eal-soft); border-color: var(--eal-primary); }
.eal-root .eal-figure--main strong { font-size: 2rem; color: var(--eal-primary); }
.eal-root .eal-list { padding-left: 20px; margin: 0 0 8px; }
.eal-root .eal-list li { margin-bottom: 6px; }
.eal-root .eal-list--stop li { color: var(--eal-stop); }
.eal-root .eal-table-wrap { overflow-x: auto; }
.eal-root .eal-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.eal-root .eal-table th, .eal-root .eal-table td { padding: 8px 10px; border-bottom: 1px solid var(--eal-border); text-align: right; vertical-align: top; }
.eal-root .eal-table th:first-child, .eal-root .eal-table td:first-child { text-align: left; }
.eal-root .eal-table tfoot td { font-weight: 700; border-bottom: 0; }
.eal-root .eal-table .is-excluded td { color: var(--eal-muted); }
.eal-root .eal-eluku { margin: 10px 0 0; }
.eal-root .eal-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin: 28px 0 0; padding: 20px 22px; border-radius: var(--eal-radius); border: 1px solid var(--eal-border); }
.eal-root .eal-cta--strong { background: var(--eal-soft); border-color: var(--eal-primary); }
.eal-root .eal-cta > div { flex: 1 1 320px; }
.eal-root .eal-cta p { margin: 4px 0 0; color: var(--eal-muted); }
.eal-root .eal-contact { flex: 1 1 100%; margin-top: 4px; }
.eal-root .eal-contact .eal-field { margin-bottom: 14px; }
.eal-root .eal-contact .eal-input { background: #fff; }
.eal-root .eal-textarea { min-height: 96px; resize: vertical; }
.eal-root .eal-req { color: var(--eal-stop); }
.eal-root .eal-field-error { margin: 4px 0 0; color: var(--eal-stop); font-size: .875rem; font-weight: 600; }
.eal-root .eal-input[aria-invalid="true"] { border-color: var(--eal-stop); }
.eal-root .eal-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.eal-root .eal-contact--sent { padding: 14px 16px; border-radius: 10px; background: #fff; border: 1px solid var(--eal-primary); }
.eal-root .eal-contact--sent p { margin: 4px 0 0; }
.eal-root .eal-disclaimer { margin-top: 24px; font-size: .8125rem; color: var(--eal-muted); }
.eal-root .eal-print-only { display: none; }
.eal-root .eal-loading { display: flex; align-items: center; gap: 12px; padding: 32px 0; color: var(--eal-muted); font-weight: 600; }
.eal-root .eal-spinner { width: 22px; height: 22px; border: 3px solid var(--eal-border); border-top-color: var(--eal-primary); border-radius: 50%; animation: eal-spin .8s linear infinite; }
@keyframes eal-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .eal-root .eal-spinner { animation: none; } }

@media (max-width: 600px) {
	.eal-root .eal-measure__body { padding-left: 14px; }
	.eal-root .eal-nav .eal-btn { flex: 1; }
	.eal-root .eal-steps { display: none; }
	.eal-root .eal-table thead { display: none; }
	.eal-root .eal-table, .eal-root .eal-table tbody, .eal-root .eal-table tfoot, .eal-root .eal-table tr, .eal-root .eal-table td { display: block; width: 100%; }
	.eal-root .eal-table tr { padding: 10px 0; border-bottom: 1px solid var(--eal-border); }
	.eal-root .eal-table td { border: 0; padding: 2px 0; text-align: left; }
	.eal-root .eal-table td:first-child { font-weight: 600; margin-bottom: 4px; }
	.eal-root .eal-table td[data-label] { display: flex; justify-content: space-between; gap: 12px; }
	.eal-root .eal-table td[data-label]::before { content: attr(data-label); color: var(--eal-muted); }
}

@media print {
	body * { visibility: hidden !important; }
	.eal-root, .eal-root * { visibility: visible !important; }
	.eal-root { position: absolute; left: 0; top: 0; width: 100%; max-width: none; }
	.eal-root .eal-app { border: 0; padding: 0; }
	.eal-root .eal-no-print, .eal-root .eal-header, .eal-root .eal-cta .eal-btn { display: none !important; }
	.eal-root .eal-print-only { display: block; font-weight: 700; margin-bottom: 12px; }
}
