/* Hostadum Tarjouslaskuri
   Ulkoasu noudattaa Hostadumin omaa hintalaskuria (hostadum.fi/kotisivujen-hinta):
   valkoinen kortti, numeroidut vaiheet, indigoreunaiset valintakortit,
   laventelinen hintapaneeli ja kultainen toimintapainike. Fontti peritään teemasta (Mulish).
   Asiakkaan sivuilla värit vaihdetaan lohkon Värit-paneelista (Korostusväri = painike,
   Pohjaväri = tekstit ja summa) tai alla olevista muuttujista. */

.hdtl-calc,
.hdtl-offer {
	--hdtl-ink: #0d1b48;
	--hdtl-accent: #f3b63f; /* kulta */
	--hdtl-indigo: #2d28a0;
	--hdtl-lav: #eeeeff;
	--hdtl-panel: #f2f4ff;
	--hdtl-line: #e3e5f5;
	--hdtl-line-strong: #cdd0e6;
	--hdtl-paper: #ffffff;
	--hdtl-muted: #5b6386;
	--hdtl-radius: 16px;
	--hdtl-radius-lg: 26px;
	--hdtl-ring: 0 0 0 3px rgba(45, 40, 160, .1), 0 16px 32px -20px rgba(45, 40, 160, .85);
	box-sizing: border-box;
	color: var(--hdtl-ink);
	font-variant-numeric: tabular-nums;
}
.hdtl-calc *,
.hdtl-offer * { box-sizing: border-box; }

/* ---------- Card layout ---------- */
.hdtl-layout {
	display: grid;
	grid-template-columns: minmax(0, 1.25fr) minmax(300px, 1fr);
	background: var(--hdtl-paper);
	border: 1px solid var(--hdtl-line);
	border-radius: var(--hdtl-radius-lg);
	box-shadow: 0 40px 70px -50px rgba(13, 27, 72, .45);
	overflow: hidden;
}
.hdtl-questions { padding: clamp(22px, 3.5vw, 40px); counter-reset: hdtl-step; }
.hdtl-calc .hdtl-questions > * { margin-top: 0; margin-bottom: 0; }
.hdtl-calc .hdtl-questions > * + * { margin-top: 26px; }

/* Section headings get Hostadum's numbered step badge */
.hdtl-calc .hdtl-questions > h2,
.hdtl-calc .hdtl-questions > h3,
.hdtl-calc .hdtl-questions > h4 {
	counter-increment: hdtl-step;
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 40px;
	font-size: 1.15em;
	font-weight: 800;
	line-height: 1.3;
	color: var(--hdtl-ink);
}
.hdtl-calc .hdtl-questions > h2::before,
.hdtl-calc .hdtl-questions > h3::before,
.hdtl-calc .hdtl-questions > h4::before {
	content: counter(hdtl-step);
	display: grid;
	place-content: center;
	flex: 0 0 28px;
	height: 28px;
	border-radius: 9px;
	background: var(--hdtl-lav);
	color: var(--hdtl-indigo);
	font-size: .75em;
	font-weight: 800;
}
.hdtl-calc .hdtl-questions > :first-child { margin-top: 0; }
.hdtl-calc .hdtl-questions > h2 + *,
.hdtl-calc .hdtl-questions > h3 + *,
.hdtl-calc .hdtl-questions > h4 + * { margin-top: 16px; }
.hdtl-calc .hdtl-questions > .hdtl-field--lisatyo + .hdtl-field--lisatyo { margin-top: 10px; }

/* ---------- Fields ---------- */
.hdtl-field { padding: 0; border: 0; min-width: 0; margin-left: 0; margin-right: 0; }
.hdtl-label {
	display: block;
	margin: 0 0 10px;
	padding: 0;
	font-weight: 800;
	font-size: 1em;
	line-height: 1.35;
	color: var(--hdtl-ink);
}
.hdtl-help {
	display: block;
	margin: -4px 0 12px;
	font-size: .88em;
	line-height: 1.5;
	color: var(--hdtl-muted);
	max-width: 62ch;
}

/* Stepper */
.hdtl-num {
	display: inline-flex;
	align-items: stretch;
	border: 1.5px solid var(--hdtl-line-strong);
	border-radius: 14px;
	background: var(--hdtl-paper);
	overflow: hidden;
}
.hdtl-num input {
	width: 6.5ch;
	min-width: 0;
	border: 0;
	margin: 0;
	padding: 10px 4px 10px 12px;
	font: inherit;
	font-size: 1.3em;
	font-weight: 800;
	text-align: right;
	color: var(--hdtl-ink);
	background: transparent;
	-moz-appearance: textfield;
	appearance: textfield;
}
.hdtl-num input::-webkit-outer-spin-button,
.hdtl-num input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.hdtl-num__unit { display: flex; align-items: center; padding: 0 12px 0 6px; font-weight: 700; color: var(--hdtl-muted); }
.hdtl-calc .hdtl-num__btn {
	width: 46px;
	border: 0;
	border-radius: 0;
	margin: 0;
	padding: 0;
	background: var(--hdtl-lav);
	color: var(--hdtl-indigo);
	font: inherit;
	font-size: 1.35em;
	font-weight: 800;
	line-height: 1;
	cursor: pointer;
	box-shadow: none;
}
.hdtl-calc .hdtl-num__btn:hover { background: #e2e2fb; }
.hdtl-num:focus-within { border-color: var(--hdtl-indigo); box-shadow: 0 0 0 3px rgba(45, 40, 160, .15); }
.hdtl-num input:focus { outline: none; }

/* Option cards (radio) */
.hdtl-options { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.hdtl-option { position: relative; display: block; margin: 0; cursor: pointer; }
.hdtl-option input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.hdtl-option > span {
	position: relative;
	display: flex;
	align-items: center;
	min-height: 58px;
	height: 100%;
	padding: 12px 14px 12px 44px;
	border: 1.5px solid var(--hdtl-line);
	border-radius: var(--hdtl-radius);
	background: var(--hdtl-paper);
	font-weight: 700;
	line-height: 1.35;
	transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.hdtl-option > span::before {
	content: "";
	position: absolute;
	left: 14px;
	top: 50%;
	width: 20px;
	height: 20px;
	margin-top: -10px;
	border: 1.5px solid var(--hdtl-line-strong);
	border-radius: 50%;
	background: var(--hdtl-paper);
}
.hdtl-option:hover > span { border-color: var(--hdtl-line-strong); }
.hdtl-option input:checked + span {
	border-color: var(--hdtl-indigo);
	background: #fbfbff;
	box-shadow: var(--hdtl-ring);
}
.hdtl-option input:checked + span::before {
	border-color: var(--hdtl-indigo);
	background: var(--hdtl-indigo) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-6.5' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.hdtl-option input:focus-visible + span { outline: 3px solid var(--hdtl-indigo); outline-offset: 2px; }

/* Add-on card (checkbox) */
.hdtl-field--lisatyo .hdtl-check {
	padding: 14px 16px;
	border: 1.5px solid var(--hdtl-line);
	border-radius: var(--hdtl-radius);
	background: var(--hdtl-paper);
	transition: border-color .15s, box-shadow .15s;
}
.hdtl-field--lisatyo .hdtl-check:hover { border-color: var(--hdtl-line-strong); }
.hdtl-field--lisatyo .hdtl-check:has(input:checked) { border-color: var(--hdtl-indigo); box-shadow: var(--hdtl-ring); }
.hdtl-check { display: flex; gap: 14px; align-items: flex-start; cursor: pointer; margin: 0; }
.hdtl-check input {
	appearance: none;
	-webkit-appearance: none;
	flex: 0 0 20px;
	width: 20px;
	height: 20px;
	margin: 1px 0 0;
	border: 1.5px solid var(--hdtl-line-strong);
	border-radius: 6px;
	background: var(--hdtl-paper);
	cursor: pointer;
}
.hdtl-check input:checked {
	border-color: var(--hdtl-indigo);
	background: var(--hdtl-indigo) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5.5 10.5l3 3 6-6.5' fill='none' stroke='%23fff' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.hdtl-check input:focus-visible { outline: 3px solid var(--hdtl-indigo); outline-offset: 2px; }
.hdtl-check__label { display: block; font-weight: 800; line-height: 1.35; }
.hdtl-check .hdtl-help { margin: 4px 0 0; }

/* ---------- Summary panel: "Hintavuori" ----------
   Tumma yötaivas kuten Hostadumin herossa. Vuoret kuvaavat hinnan rakennetta:
   työ (sininen huippu), materiaalit (indigo), muut kulut (laventeli).
   Lumihuippu = kotitalousvähennys. */
.hdtl-summary {
	--hdtl-pad: clamp(22px, 3.5vw, 40px);
	position: relative;
	padding: var(--hdtl-pad);
	background:
		radial-gradient(120% 70% at 100% 0%, rgba(40, 35, 160, .95) 0%, rgba(40, 35, 160, 0) 62%),
		radial-gradient(90% 60% at 0% 100%, rgba(0, 145, 220, .28) 0%, rgba(0, 145, 220, 0) 60%),
		#0a1941;
	color: #fff;
	overflow: hidden;
}
.hdtl-summary::before {
	/* faint stars */
	content: "";
	position: absolute;
	inset: 0;
	background-image:
		radial-gradient(1.2px 1.2px at 18% 14%, rgba(255,255,255,.7), transparent 60%),
		radial-gradient(1px 1px at 62% 9%, rgba(255,255,255,.55), transparent 60%),
		radial-gradient(1.4px 1.4px at 84% 22%, rgba(255,255,255,.6), transparent 60%),
		radial-gradient(1px 1px at 38% 26%, rgba(255,255,255,.45), transparent 60%),
		radial-gradient(1px 1px at 92% 6%, rgba(255,255,255,.5), transparent 60%);
	pointer-events: none;
}
.hdtl-summary__inner { position: sticky; top: calc(24px + var(--wp-admin--admin-bar--height, 0px)); }
.hdtl-summary p { margin: 0; }
.hdtl-summary__title {
	font-size: 12px;
	font-weight: 800;
	letter-spacing: 1.8px;
	text-transform: uppercase;
	color: #8fd0ff;
}
.hdtl-summary__total {
	margin-top: 10px !important;
	font-size: clamp(2em, 3.6vw, 2.9em);
	font-weight: 900;
	line-height: 1.05;
	letter-spacing: -.035em;
	white-space: nowrap;
	background: linear-gradient(180deg, #ffcd6f 0%, #e59c14 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.hdtl-summary__vat { margin-top: 6px !important; font-size: .85em; color: rgba(255, 255, 255, .65); }

.hdtl-mtn {
	position: relative;
	height: clamp(128px, 14vw, 170px);
	margin: 18px calc(-1 * var(--hdtl-pad)) 16px;
}
.hdtl-mtn svg { display: block; width: 100%; height: 100%; }
.hdtl-mtn__muu { fill: #9e9ae6; opacity: .45; }
.hdtl-mtn__materiaali { fill: url(#hdtl-g-mat); }
.hdtl-mtn__tyo { fill: url(#hdtl-g-tyo); }
.hdtl-mtn__snow { fill: #fff; filter: drop-shadow(0 0 6px rgba(255, 255, 255, .45)); }
.hdtl-mtn__ground { fill: rgba(255, 255, 255, .18); }
.hdtl-mtn:empty { background: linear-gradient(0deg, rgba(255,255,255,.12) 0 2px, transparent 2px); }

/* legacy bar (editor preview in older versions) */
.hdtl-bars { display: none; }

.hdtl-summary__rows { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; margin: 0; font-size: .92em; }
.hdtl-summary__rows dt,
.hdtl-summary__rows dd { margin: 0; }
.hdtl-summary__rows dd { text-align: right; font-weight: 800; }
.hdtl-cat { display: flex; align-items: center; gap: 9px; }
.hdtl-cat::before { content: ""; width: 10px; height: 10px; flex: 0 0 10px; clip-path: polygon(50% 0, 100% 100%, 0 100%); }
dt.hdtl-cat--tyo::before { background: linear-gradient(#0091dc, #2823a0); }
dt.hdtl-cat--materiaali::before { background: #6f6af0; }
dt.hdtl-cat--muu::before { background: #9e9ae6; }

.hdtl-summary__kv {
	margin-top: 18px !important;
	padding: 14px 16px;
	background: rgba(255, 255, 255, .07);
	border: 1px solid rgba(255, 255, 255, .14);
	border-radius: 14px;
	font-size: .88em;
	line-height: 1.45;
}
.hdtl-summary__kv strong { display: block; font-size: 1.05em; margin-bottom: 4px; color: #fff; }
.hdtl-summary__kv span { color: rgba(255, 255, 255, .72); }
.hdtl-summary__note { margin-top: 16px !important; font-size: .8em; line-height: 1.5; color: rgba(255, 255, 255, .6); }

/* ---------- Buttons (Hostadum pill + gold) ---------- */
.hdtl-calc .hdtl-btn,
.hdtl-offer .hdtl-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 14px 26px;
	border: 0;
	border-radius: 32px;
	background: linear-gradient(180deg, #e59c14 0%, #ffcd6f 100%);
	color: #0a1941;
	font: inherit;
	font-weight: 900;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	box-shadow: 0 14px 28px -16px #e59c14;
	transition: transform .15s, box-shadow .15s;
}
.hdtl-summary .hdtl-btn { width: 100%; margin-top: 22px; }
.hdtl-calc .hdtl-btn:hover,
.hdtl-offer .hdtl-btn:hover { transform: translateY(-2px); box-shadow: 0 18px 30px -14px #e59c14; }
.hdtl-calc .hdtl-btn:focus-visible,
.hdtl-offer .hdtl-btn:focus-visible { outline: 3px solid #8fd0ff; outline-offset: 3px; }
.hdtl-calc .hdtl-btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; transform: none; }
.hdtl-calc .hdtl-btn--ghost,
.hdtl-offer .hdtl-btn--ghost {
	background: var(--hdtl-paper);
	color: var(--hdtl-indigo);
	border: 1.5px solid var(--hdtl-line-strong);
	box-shadow: none;
}

/* Custom accent / ink from block settings override the defaults */
.hdtl-calc[style*="--hdtl-accent"] .hdtl-btn { background: var(--hdtl-accent); }
.hdtl-calc[style*="--hdtl-ink"] .hdtl-summary { background: var(--hdtl-ink); }

/* ---------- Nousu: ländärin aikajana nousee portaittain huipulle ----------
   Käyttö: lisää Sarakkeet-lohkolle lisä-CSS-luokka "hdtl-route". */
.hdtl-route { position: relative; }
@media (min-width: 782px) {
	.hdtl-route > .wp-block-column:nth-child(1) { transform: translateY(54px); }
	.hdtl-route > .wp-block-column:nth-child(2) { transform: translateY(36px); }
	.hdtl-route > .wp-block-column:nth-child(3) { transform: translateY(18px); }
	.hdtl-route { padding-bottom: 54px; }
}
.hdtl-route .cg-tl { position: relative; }
.hdtl-route .cg-tl::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	top: -4px;
	height: 4px;
	border-radius: 3px;
	background: linear-gradient(90deg, #e59c14, #ffcd6f);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform .55s cubic-bezier(.3, .7, .2, 1);
}
.hdtl-route > .wp-block-column:nth-child(2) .cg-tl::after { transition-delay: .45s; }
.hdtl-route > .wp-block-column:nth-child(3) .cg-tl::after { transition-delay: .9s; }
.hdtl-route > .wp-block-column:nth-child(4) .cg-tl::after { transition-delay: 1.35s; }
.hdtl-route.is-inview .cg-tl::after { transform: scaleX(1); }
.hdtl-route > .wp-block-column:last-child .cg-tl > :first-child::after {
	/* summit flag after the last step's title */
	content: "";
	display: inline-block;
	width: 16px;
	height: 18px;
	margin-left: 8px;
	vertical-align: -2px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 18'%3E%3Cpath d='M2 1v16' stroke='%230a1941' stroke-width='2' stroke-linecap='round'/%3E%3Cpath d='M3 2h10l-3 3.5L13 9H3z' fill='%23e59c14'/%3E%3C/svg%3E") no-repeat center / contain;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity .35s ease 1.8s, transform .35s ease 1.8s;
}
.hdtl-route.is-inview > .wp-block-column:last-child .cg-tl > :first-child::after { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
	.hdtl-route .cg-tl::after,
	.hdtl-route > .wp-block-column:last-child .cg-tl > :first-child::after { transition: none; }
}

/* ---------- Contact form ---------- */
.hdtl-contact {
	margin-top: 28px;
	padding: clamp(22px, 3.5vw, 40px);
	background: var(--hdtl-paper);
	border: 1px solid var(--hdtl-line);
	border-radius: var(--hdtl-radius-lg);
}
.hdtl-contact__title { margin: 0 0 20px; font-weight: 800; }
.hdtl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 20px; }
.hdtl-contact p { margin: 0 0 16px; }
.hdtl-contact label { display: block; font-weight: 800; margin-bottom: 6px; }
.hdtl-contact input:not([type="checkbox"]),
.hdtl-contact select,
.hdtl-contact textarea {
	width: 100%;
	min-height: 48px;
	padding: 10px 14px;
	border: 1.5px solid var(--hdtl-line-strong);
	border-radius: 12px;
	background: var(--hdtl-paper);
	font: inherit;
	color: inherit;
}
.hdtl-contact input:focus,
.hdtl-contact select:focus,
.hdtl-contact textarea:focus { border-color: var(--hdtl-indigo); outline: none; box-shadow: 0 0 0 3px rgba(45, 40, 160, .15); }
.hdtl-consent label { display: flex; gap: 10px; align-items: flex-start; font-weight: 400; }
.hdtl-consent input { margin-top: 3px; width: 18px; height: 18px; accent-color: var(--hdtl-indigo); }
.hdtl-hp { position: absolute !important; left: -9999px !important; }
.hdtl-error { color: #b42318; font-weight: 800; }
.hdtl-success {
	margin-top: 28px;
	padding: 24px 28px;
	background: var(--hdtl-panel);
	border: 1.5px solid var(--hdtl-indigo);
	border-radius: var(--hdtl-radius-lg);
	font-weight: 700;
}
.hdtl-success p { margin: 0; }
.hdtl-success:focus { outline: none; }

/* ---------- Demo: what the business receives ---------- */
.hdtl-demo {
	margin-top: 28px;
	padding: clamp(22px, 3.5vw, 40px);
	background: var(--hdtl-panel);
	border-radius: var(--hdtl-radius-lg);
}
.hdtl-demo:focus { outline: none; }
.hdtl-demo__title { margin: 0 0 8px; font-weight: 800; }
.hdtl-demo__lead { margin: 0 0 28px; max-width: 64ch; color: var(--hdtl-muted); }
.hdtl-demo__steps {
	list-style: none;
	counter-reset: hdtl-dstep;
	margin: 0 0 24px;
	padding: 0;
	display: grid;
	grid-template-columns: minmax(0, .9fr) minmax(0, 1.4fr) minmax(0, .8fr);
	gap: 18px;
	align-items: start;
}
.hdtl-demo__step { counter-increment: hdtl-dstep; margin: 0; min-width: 0; }
.hdtl-demo__stepname { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; font-weight: 800; }
.hdtl-demo__stepname::before {
	content: counter(hdtl-dstep);
	display: grid;
	place-content: center;
	flex: 0 0 28px;
	height: 28px;
	border-radius: 9px;
	background: var(--hdtl-paper);
	color: var(--hdtl-indigo);
	font-size: .8em;
}
.hdtl-demo__card {
	padding: 16px;
	background: var(--hdtl-paper);
	border: 1px solid var(--hdtl-line);
	border-radius: var(--hdtl-radius);
	font-size: .9em;
	line-height: 1.45;
}
.hdtl-demo__card p { margin: 0; }
.hdtl-demo__subject { font-weight: 800; padding-bottom: 10px; margin-bottom: 10px !important; border-bottom: 1px solid var(--hdtl-line); }
.hdtl-demo__dl { margin: 0; }
.hdtl-demo__dl dt { margin: 8px 0 0; font-size: .9em; color: var(--hdtl-muted); }
.hdtl-demo__dl dt:first-child { margin-top: 0; }
.hdtl-demo__dl dd { margin: 0; font-weight: 700; }
.hdtl-demo__sum { margin-top: 12px !important; font-weight: 800; }
.hdtl-demo__note { color: var(--hdtl-muted); font-size: .95em; }
.hdtl-demo__card > .hdtl-demo__note:first-child { margin-bottom: 10px !important; }
.hdtl-demo__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hdtl-demo__table { width: 100%; min-width: 420px; border-collapse: collapse; margin: 0; font-size: .95em; }
.hdtl-demo__table th { text-align: left; font-weight: 700; color: var(--hdtl-muted); padding: 4px 8px 6px 0; border-bottom: 1px solid var(--hdtl-line); }
.hdtl-demo__table td { padding: 6px 8px 6px 0; border-bottom: 1px solid var(--hdtl-line); vertical-align: top; }
.hdtl-demo__table .num { text-align: right; white-space: nowrap; }
.hdtl-demo__totals { display: grid; grid-template-columns: 1fr auto; gap: 4px 16px; margin: 12px 0 0; }
.hdtl-demo__totals dt, .hdtl-demo__totals dd { margin: 0; }
.hdtl-demo__totals dd { text-align: right; }
.hdtl-demo__totals .grand { font-weight: 800; padding-top: 6px; border-top: 1.5px solid var(--hdtl-ink); }
.hdtl-demo__card--accept { border: 1.5px solid var(--hdtl-indigo); box-shadow: var(--hdtl-ring); }
.hdtl-demo__fakebtn {
	display: block;
	margin: 14px 0;
	padding: 12px 14px;
	background: linear-gradient(180deg, #e59c14 0%, #ffcd6f 100%);
	color: #0a1941;
	border-radius: 32px;
	font-weight: 900;
	text-align: center;
}
.hdtl-demo--simple .hdtl-demo__title { font-size: 1.1em; }
.hdtl-demo--simple .hdtl-demo__lead { margin-bottom: 18px; }
@media (max-width: 1000px) {
	.hdtl-demo__steps { grid-template-columns: 1fr; }
}

/* ---------- Mobile price bar ---------- */
.hdtl-bar { display: none; }

@media (max-width: 900px) {
	.hdtl-layout { grid-template-columns: 1fr; }
	.hdtl-summary__inner { position: static; }
	.hdtl-grid { grid-template-columns: 1fr; }
	.hdtl-bar {
		display: flex;
		position: fixed;
		left: 12px;
		right: 12px;
		bottom: calc(12px + env(safe-area-inset-bottom, 0px));
		z-index: 999;
		justify-content: space-between;
		align-items: center;
		gap: 12px;
		padding: 14px 18px;
		background: var(--hdtl-ink);
		color: #fff;
		border-radius: 16px;
		box-shadow: 0 16px 30px -12px rgba(13, 27, 72, .6);
		transform: translateY(150%);
		transition: transform .25s ease;
		cursor: pointer;
	}
	.hdtl-bar.is-visible { transform: translateY(0); }
	.hdtl-bar__label { font-size: .8em; font-weight: 800; letter-spacing: 1.2px; text-transform: uppercase; opacity: .8; }
	.hdtl-bar__total { font-weight: 900; color: #ffcd6f; white-space: nowrap; }
}

@media (prefers-reduced-motion: reduce) {
	.hdtl-bar,
	.hdtl-bars__seg,
	.hdtl-option > span,
	.hdtl-field--lisatyo .hdtl-check { transition: none; }
}

/* ---------- Quote page ---------- */
.hdtl-offer {
	max-width: 880px;
	padding: clamp(22px, 4vw, 44px);
	background: var(--hdtl-paper);
	border: 1px solid var(--hdtl-line);
	border-radius: var(--hdtl-radius-lg);
	box-shadow: 0 40px 70px -50px rgba(13, 27, 72, .45);
}
.hdtl-offer p { margin: 0; }
.hdtl-offer__head {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 20px;
	padding-bottom: 20px;
	margin-bottom: 20px;
	border-bottom: 1px solid var(--hdtl-line);
}
.hdtl-offer__from { font-size: 1.3em; font-weight: 800; }
.hdtl-offer__to { text-align: right; }
.hdtl-offer__small { font-size: .9em; color: var(--hdtl-muted); line-height: 1.5; }
.hdtl-offer__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.hdtl-offer__table { width: 100%; min-width: 520px; border-collapse: collapse; margin: 0; }
.hdtl-offer__table th { text-align: left; font-size: .8em; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--hdtl-indigo); padding: 8px 10px 8px 0; border-bottom: 1px solid var(--hdtl-line); }
.hdtl-offer__table td { padding: 12px 10px 12px 0; border-bottom: 1px solid var(--hdtl-line); vertical-align: top; }
.hdtl-offer .num { text-align: right; white-space: nowrap; }
.hdtl-offer__cat { display: block; font-size: .8em; color: var(--hdtl-muted); }
.hdtl-offer__totals { display: grid; grid-template-columns: 1fr auto; gap: 8px 24px; max-width: 380px; margin: 24px 0 0 auto; }
.hdtl-offer__totals dt,
.hdtl-offer__totals dd { margin: 0; }
.hdtl-offer__totals dd { text-align: right; }
.hdtl-offer__grand { padding-top: 10px; border-top: 1.5px solid var(--hdtl-ink); font-size: 1.25em; font-weight: 800; }
.hdtl-offer__kv,
.hdtl-offer__notes,
.hdtl-offer__terms { margin-top: 24px !important; line-height: 1.6; }
.hdtl-offer__kv { padding: 16px 18px; background: var(--hdtl-panel); border-radius: 14px; }
.hdtl-offer__terms { font-size: .9em; color: var(--hdtl-muted); }
.hdtl-offer__flash { margin-bottom: 24px !important; padding: 16px 20px; background: var(--hdtl-panel); border-radius: 14px; font-weight: 800; }
.hdtl-offer__flash--ok { border: 1.5px solid var(--hdtl-indigo); box-shadow: var(--hdtl-ring); }
.hdtl-offer__decide { margin-top: 32px; padding: 24px; background: var(--hdtl-panel); border-radius: var(--hdtl-radius); }
.hdtl-offer__decide > p + p { margin-top: 16px; }
.hdtl-offer__decide .hdtl-check input { background-color: var(--hdtl-paper); }
.hdtl-offer__decline { margin-top: 20px; }
.hdtl-offer__decline summary { cursor: pointer; color: var(--hdtl-indigo); font-weight: 700; }
.hdtl-offer__decline p { margin-top: 12px; }
.hdtl-offer__decline textarea { width: 100%; padding: 10px 14px; border: 1.5px solid var(--hdtl-line-strong); border-radius: 12px; font: inherit; }
.hdtl-offer__print { margin-top: 24px !important; }
.hdtl-offer__empty { font-weight: 700; }

@media (max-width: 600px) {
	.hdtl-offer__to { text-align: left; }
}

@media print {
	body * { visibility: hidden; }
	.hdtl-offer, .hdtl-offer * { visibility: visible; }
	.hdtl-offer { position: absolute; left: 0; top: 0; width: 100%; max-width: none; border: 0; box-shadow: none; }
	.hdtl-offer__decide, .hdtl-offer__print { display: none; }
	.hdtl-offer__table { min-width: 0; }
}

/* ---------- Ländäri: "Viesti vs. laskuri" -vertailu ----------
   Rakennettu tavallisista lohkoista; luokat lisätään lohkojen Lisä-CSS-luokkiin.
   Kun osio tulee näkyviin, puuttuvat tiedot kuittautuvat yksi kerrallaan ja
   täyttyvät tarjouspyyntökorttiin. Ilman JavaScriptiä kaikki näkyy valmiina. */
.hdtl-compare { position: relative; max-width: 440px; margin-inline: auto; }
.hdtl-compare p { margin: 0; }
.hdtl-sms__meta { font-size: 12px; color: #6b7593; text-align: center; margin-bottom: 8px !important; }
.hdtl-sms {
	position: relative;
	max-width: 88%;
	padding: 14px 18px;
	background: #e9ebf3;
	border-radius: 22px 22px 22px 6px;
	font-size: 16px;
	line-height: 1.45;
	color: #0a1941;
}
.hdtl-compare__label {
	margin-top: 18px !important;
	font-size: 12px;
	font-weight: 900;
	letter-spacing: 1.6px;
	text-transform: uppercase;
	color: #6b7593;
}
.hdtl-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hdtl-chip {
	padding: 6px 12px;
	border: 1.5px dashed #b9bfd6;
	border-radius: 99px;
	font-size: 14px;
	font-weight: 700;
	color: #6b7593;
	background: #fff;
	transition: background-color .35s, border-color .35s, color .35s;
}
.hdtl-chip { position: relative; padding-left: 28px !important; }
.hdtl-chip::before,
.hdtl-chip::after { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font-weight: 900; transition: opacity .3s ease; }
.hdtl-chip::before { content: "?"; }
.hdtl-chip::after { content: "✓"; left: 10px; color: #e59c14; opacity: 0; }
.hdtl-anim-ready.is-inview .hdtl-chip::before { opacity: 0; }
.hdtl-anim-ready.is-inview .hdtl-chip::after { opacity: 1; }
.hdtl-compare__arrow {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 22px 0 12px !important;
	font-weight: 900;
	color: #2823a0;
}
.hdtl-compare__arrow::before {
	content: "";
	width: 34px;
	height: 34px;
	flex: 0 0 34px;
	border-radius: 50%;
	background: #eeeeff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M10 4v12M5 11l5 5 5-5' fill='none' stroke='%232823a0' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
}
.hdtl-req {
	padding: 20px 22px;
	border-radius: 22px;
	background:
		radial-gradient(120% 90% at 100% 0%, rgba(40, 35, 160, .9) 0%, rgba(40, 35, 160, 0) 60%),
		#0a1941;
	color: #fff;
	box-shadow: 0 30px 50px -30px rgba(10, 25, 65, .7);
}
.hdtl-req__kicker { font-size: 12px; font-weight: 900; letter-spacing: 1.6px; text-transform: uppercase; color: #8fd0ff; margin-bottom: 12px !important; }
.hdtl-row {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 0;
	border-bottom: 1px solid rgba(255, 255, 255, .12);
	font-size: 15px;
	color: rgba(255, 255, 255, .75);
}
.hdtl-row strong { color: #fff; font-weight: 800; text-align: right; }
.hdtl-req__sum {
	margin-top: 14px !important;
	font-size: 20px;
	font-weight: 900;
	background: linear-gradient(180deg, #ffcd6f 0%, #e59c14 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}

/* animation (only when JS has marked it ready) */
.hdtl-anim-ready .hdtl-row { opacity: 0; transform: translateX(-10px); transition: opacity .4s ease, transform .4s ease; }
.hdtl-anim-ready .hdtl-req__sum { opacity: 0; transition: opacity .5s ease 2.3s; }
.hdtl-anim-ready.is-inview .hdtl-row,
.hdtl-anim-ready.is-inview .hdtl-req__sum { opacity: 1; transform: none; }
.hdtl-anim-ready.is-inview .hdtl-chip { border-style: solid; border-color: #e59c14; background: #fff6e2; color: #0a1941; }
.hdtl-anim-ready .hdtl-chip:nth-child(1), .hdtl-anim-ready .hdtl-row:nth-of-type(2) { transition-delay: .3s; }
.hdtl-anim-ready .hdtl-chip:nth-child(2), .hdtl-anim-ready .hdtl-row:nth-of-type(3) { transition-delay: .7s; }
.hdtl-anim-ready .hdtl-chip:nth-child(3), .hdtl-anim-ready .hdtl-row:nth-of-type(4) { transition-delay: 1.1s; }
.hdtl-anim-ready .hdtl-chip:nth-child(4), .hdtl-anim-ready .hdtl-row:nth-of-type(5) { transition-delay: 1.5s; }
.hdtl-anim-ready .hdtl-chip:nth-child(5), .hdtl-anim-ready .hdtl-row:nth-of-type(6) { transition-delay: 1.9s; }
@media (prefers-reduced-motion: reduce) {
	.hdtl-anim-ready .hdtl-row, .hdtl-anim-ready .hdtl-req__sum, .hdtl-chip { transition: none !important; }
}

/* ---------- Ländäri: "Laskuri kysyy sen, minkä kysyisit itse" ---------- */
.hdtl-spec { counter-reset: none; }
.hdtl-spec .hdtl-spec__n {
	font-size: 2.2rem;
	font-weight: 900;
	line-height: 1;
	margin: 0 0 10px !important;
	background: linear-gradient(90deg, #2823a0 0%, #0091dc 100%);
	-webkit-background-clip: text;
	background-clip: text;
	color: transparent;
}
.hdtl-spec .hdtl-spec__t { font-size: 17px; font-weight: 900; margin: 0 0 6px !important; }
.hdtl-spec .hdtl-spec__p { font-size: 15.5px; line-height: 1.55; color: #4d5a72; margin: 0 !important; }
.hdtl-spec .wp-block-column { padding-top: 18px; border-top: 1px solid #e1e4f3; }

/* ---------- Ländäri: kotitalousvähennyksen laskuesimerkki ---------- */
.hdtl-kvcard {
	padding: 24px 26px;
	border-radius: 22px;
	background: #f2f4ff;
}
.hdtl-kvcard p { margin: 0; }
.hdtl-kvcard .hdtl-req__kicker { color: #2823a0; }
.hdtl-kvcard .hdtl-row { color: #4d5a72; border-bottom-color: #dfe2f5; }
.hdtl-kvcard .hdtl-row strong { color: #0a1941; }
.hdtl-kvcard .hdtl-kvcard__total { margin-top: 12px !important; display: flex; justify-content: space-between; font-weight: 900; font-size: 18px; color: #0a1941; }
.hdtl-kvcard .hdtl-kvcard__note { margin-top: 12px !important; font-size: 13.5px; color: #4d5a72; line-height: 1.5; }

/* ---------- Laskurin elävät yksityiskohdat ---------- */
.hdtl-summary__inner { isolation: isolate; }
.hdtl-delta {
	position: absolute;
	right: 0;
	margin-top: -2.4em;
	padding: 4px 10px;
	border-radius: 99px;
	font-size: 13px;
	font-weight: 900;
	opacity: 0;
	transform: translateY(6px);
	pointer-events: none;
	transition: opacity .25s ease, transform .25s ease;
}
.hdtl-delta.is-up { background: rgba(255, 205, 111, .16); color: #ffcd6f; }
.hdtl-delta.is-down { background: rgba(143, 208, 255, .16); color: #8fd0ff; }
.hdtl-delta.is-on { opacity: 1; transform: none; }

.hdtl-flake {
	position: absolute;
	top: 0;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 0 6px rgba(255, 255, 255, .8);
	opacity: 0;
	animation: hdtl-snow 1.6s ease-in forwards;
	pointer-events: none;
}
@keyframes hdtl-snow {
	0% { opacity: 0; transform: translate(0, -6px); }
	15% { opacity: 1; }
	100% { opacity: 0; transform: translate(var(--hdtl-drift, 0), 70px); }
}

.hdtl-mtn__flagin {
	transform: scaleY(0);
	transform-origin: 0 0;
	transform-box: fill-box;
	opacity: 0;
	transition: transform .5s cubic-bezier(.3, 1.4, .5, 1), opacity .2s;
}
.hdtl-mtn.is-flag .hdtl-mtn__flagin { transform: scaleY(1); opacity: 1; }
.hdtl-mtn.is-flag .hdtl-mtn__flagin path:last-child { animation: hdtl-wave 2.4s ease-in-out .5s infinite; transform-box: fill-box; transform-origin: 0 50%; }
@keyframes hdtl-wave { 0%, 100% { transform: skewY(0); } 50% { transform: skewY(-6deg); } }

@media (prefers-reduced-motion: reduce) {
	.hdtl-flake { display: none; }
	.hdtl-mtn__flagin, .hdtl-delta { transition: none; }
	.hdtl-mtn.is-flag .hdtl-mtn__flagin path:last-child { animation: none; }
}

/* ---------- Ländäri: vuorenharjanne tummien osioiden yläreunaan ----------
   Lisää tummalle ryhmälle Lisä-CSS-luokka "hdtl-ridge". */
.hdtl-ridge { position: relative; }
.hdtl-ridge::before {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: calc(100% - 1px);
	height: clamp(40px, 6vw, 84px);
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 90' preserveAspectRatio='none'%3E%3Cpath d='M0 90V70l90-26 70 18 120-52 80 34 60-16 140 58 110-40 90 20 150-66 70 40 100-22 120 48 90-30 150 36V90Z' fill='%230a1941'/%3E%3Cpath d='M910 0L948 22L935 18L922 26L905 19L890 25L860 22ZM280 10L322 28L310 25L298 31L284 24L268 30L238 28Z' fill='%23dfe4f5'/%3E%3C/svg%3E") bottom / 100% 100% no-repeat;
	pointer-events: none;
}


/* ---------- Ländäri: Matin keskustelu ---------- */
.hdtl-chat { display: flex; align-items: center; gap: 10px; flex-wrap: nowrap !important; margin-bottom: 12px; position: relative; }
.hdtl-chat .hdtl-chat__avatar {
	display: grid;
	place-content: center;
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	background: linear-gradient(160deg, #0091dc 0%, #2823a0 100%);
	color: #fff;
	font-weight: 900;
	font-size: 16px;
}
.hdtl-chat .hdtl-chat__name { font-size: 12.5px; line-height: 1.3; color: #6b7593; }
.hdtl-chat .hdtl-chat__name strong { font-size: 15px; color: #0a1941; font-weight: 900; }
.hdtl-sms + .hdtl-sms { margin-top: 6px !important; border-radius: 6px 22px 22px 22px; }

/* typing dots under Matti's name, then the two messages */
.hdtl-anim-ready .hdtl-chat::after {
	content: "";
	position: absolute;
	left: 0;
	top: calc(100% + 12px);
	width: 58px;
	height: 30px;
	border-radius: 18px 18px 18px 6px;
	background: #e9ebf3 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 8'%3E%3Ccircle cx='4' cy='4' r='3' fill='%238a91ab'/%3E%3Ccircle cx='15' cy='4' r='3' fill='%238a91ab'/%3E%3Ccircle cx='26' cy='4' r='3' fill='%238a91ab'/%3E%3C/svg%3E") center / 30px 8px no-repeat;
	opacity: 0;
}
.hdtl-anim-ready.is-inview .hdtl-chat::after { animation: hdtl-typing .9s ease forwards; }
@keyframes hdtl-typing { 0% { opacity: 0; } 15%, 80% { opacity: 1; } 100% { opacity: 0; } }
.hdtl-anim-ready .hdtl-sms { opacity: 0; transform: translateY(6px) scale(.97); transform-origin: 0 100%; transition: opacity .35s ease .9s, transform .35s ease .9s; }
.hdtl-anim-ready .hdtl-sms + .hdtl-sms { transition-delay: 1.5s; }
.hdtl-anim-ready.is-inview .hdtl-sms { opacity: 1; transform: none; }

/* chips and rows fill after the messages */
.hdtl-anim-ready .hdtl-chip:nth-child(1), .hdtl-anim-ready .hdtl-chip:nth-child(1)::before, .hdtl-anim-ready .hdtl-chip:nth-child(1)::after, .hdtl-anim-ready .hdtl-row:nth-of-type(2) { transition-delay: 2.1s; }
.hdtl-anim-ready .hdtl-chip:nth-child(2), .hdtl-anim-ready .hdtl-chip:nth-child(2)::before, .hdtl-anim-ready .hdtl-chip:nth-child(2)::after, .hdtl-anim-ready .hdtl-row:nth-of-type(3) { transition-delay: 2.4s; }
.hdtl-anim-ready .hdtl-chip:nth-child(3), .hdtl-anim-ready .hdtl-chip:nth-child(3)::before, .hdtl-anim-ready .hdtl-chip:nth-child(3)::after, .hdtl-anim-ready .hdtl-row:nth-of-type(4) { transition-delay: 2.7s; }
.hdtl-anim-ready .hdtl-chip:nth-child(4), .hdtl-anim-ready .hdtl-chip:nth-child(4)::before, .hdtl-anim-ready .hdtl-chip:nth-child(4)::after, .hdtl-anim-ready .hdtl-row:nth-of-type(5) { transition-delay: 3s; }
.hdtl-anim-ready .hdtl-chip:nth-child(5), .hdtl-anim-ready .hdtl-chip:nth-child(5)::before, .hdtl-anim-ready .hdtl-chip:nth-child(5)::after, .hdtl-anim-ready .hdtl-row:nth-of-type(6) { transition-delay: 3.3s; }
.hdtl-anim-ready .hdtl-row:nth-of-type(7) { transition-delay: 3.6s; }
.hdtl-anim-ready .hdtl-req__sum { transition-delay: 3.95s; }
@media (prefers-reduced-motion: reduce) {
	.hdtl-anim-ready .hdtl-sms { transition: none; opacity: 1; transform: none; }
	.hdtl-anim-ready .hdtl-chat::after { display: none; }
}

/* ---------- Ländäri: pohjien kysymyslistat tummassa osiossa ---------- */
.hdtl-asks { list-style: none; margin: 0 !important; padding: 0 !important; }
.hdtl-asks li {
	position: relative;
	padding: 9px 0 9px 26px;
	border-top: 1px solid rgba(255, 255, 255, .12);
	color: #fff;
	font-size: 15.5px;
}
.hdtl-asks li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 50%;
	width: 12px;
	height: 10px;
	margin-top: -5px;
	background: linear-gradient(#8fd0ff, #0091dc);
	clip-path: polygon(50% 0, 100% 100%, 0 100%);
}
.hdtl-asks li:first-child::before { background: linear-gradient(#ffcd6f, #e59c14); }
/* hide instantly; animate only on the way in */
.hdtl-anim-ready:not(.is-inview) .hdtl-row,
.hdtl-anim-ready:not(.is-inview) .hdtl-sms,
.hdtl-anim-ready:not(.is-inview) .hdtl-req__sum { transition: none !important; }
.hdtl-row strong { white-space: nowrap; }

/* ---------- Kuvat tarjouspyyntöön ---------- */
.hdtl-files { margin: 0 0 16px; }
.hdtl-files > label { display: block; font-weight: 800; margin-bottom: 4px; }
.hdtl-files__opt { font-weight: 400; color: var(--hdtl-muted); }
.hdtl-files .hdtl-help { margin: 0 0 10px; }
.hdtl-contact .hdtl-files__drop {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 64px;
	padding: 14px;
	border: 1.5px dashed var(--hdtl-line-strong);
	border-radius: 14px;
	background: var(--hdtl-paper);
	color: var(--hdtl-indigo);
	font-weight: 800;
	cursor: pointer;
	text-align: center;
	transition: border-color .15s, background-color .15s;
}
.hdtl-contact .hdtl-files__drop::before {
	content: "";
	width: 22px;
	height: 22px;
	flex: 0 0 22px;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232d28a0' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h3l2-3h6l2 3h3v11H4z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E") center / contain no-repeat;
}
.hdtl-contact .hdtl-files__drop:hover { border-color: var(--hdtl-indigo); background: #fbfbff; }
.hdtl-files__drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.hdtl-files__drop:focus-within { outline: 3px solid var(--hdtl-indigo); outline-offset: 2px; }
.hdtl-files.is-full .hdtl-files__drop { display: none; }
.hdtl-files__list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.hdtl-files__list:empty { display: none; }
.hdtl-files__item { position: relative; width: 92px; height: 92px; border-radius: 12px; overflow: hidden; border: 1px solid var(--hdtl-line); }
.hdtl-files__item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hdtl-calc .hdtl-files__rm {
	position: absolute;
	top: 4px;
	right: 4px;
	width: 26px;
	height: 26px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(10, 25, 65, .78);
	color: #fff;
	font-size: 16px;
	line-height: 26px;
	cursor: pointer;
}


/* Theme safety: some themes add a large bottom margin to the last paragraph of a group. */
.hdtl-compare p:last-child,
.hdtl-req p:last-child,
.hdtl-kvcard p:last-child,
.hdtl-chat p:last-child,
.hdtl-chips p:last-child { margin-bottom: 0 !important; }
.hdtl-compare .hdtl-chips { gap: 8px !important; justify-content: flex-start !important; align-items: center; }
.hdtl-compare .hdtl-chat { gap: 10px !important; }
.hdtl-chips > .hdtl-chip,
.hdtl-chat > p { margin: 0 !important; }

/* ---------- v0.1.1: kotitalousvähennys välähtää vihreänä kun se kasvaa ---------- */
.hdtl-summary__kv.is-flash { animation: hdtl-kvflash 1.2s ease; }
@keyframes hdtl-kvflash {
	0% { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); }
	25% { background: rgba(46, 204, 138, .22); border-color: rgba(46, 204, 138, .7); }
	100% { background: rgba(255, 255, 255, .07); border-color: rgba(255, 255, 255, .14); }
}

/* ---------- Ländäri: Matin keskustelu puhelimessa (cg-phone + hdtl-phonechat) ---------- */
.hdtl-phonechat { max-width: none !important; }
.hdtl-phonechat .hdtl-status { display: flex; justify-content: space-between; font-size: 12px; color: #8a8a8a; margin-bottom: 12px !important; }
.hdtl-phonechat .hdtl-status p { margin: 0 !important; }
.hdtl-phonechat .hdtl-sms { font-size: 14.5px; max-width: 86%; padding: 11px 15px; }
.hdtl-phonechat .hdtl-sms + .hdtl-sms { margin-top: 6px !important; }
.hdtl-phonechat .hdtl-sms--me {
	margin: 10px 0 0 auto !important;
	background: linear-gradient(160deg, #2823a0 0%, #0091dc 100%);
	color: #fff;
	border-radius: 22px 22px 6px 22px !important;
	transform-origin: 100% 100%;
}
.hdtl-phonechat .hdtl-compare__label { text-align: center; font-size: 11px; letter-spacing: 1.2px; margin: 18px 0 10px !important; }
.hdtl-phonechat .hdtl-req { padding: 16px 16px 14px; border-radius: 18px; }
.hdtl-phonechat .hdtl-req__kicker { display: flex; align-items: center; gap: 8px; margin-bottom: 8px !important; }
.hdtl-phonechat .hdtl-req__kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #ffcd6f; box-shadow: 0 0 0 4px rgba(255, 205, 111, .25); }
.hdtl-phonechat .hdtl-row { font-size: 13px; padding: 6px 0; }
.hdtl-phonechat .hdtl-req__sum { font-size: 17px; margin-top: 10px !important; }

/* sequence: typing → Matti → Matti → yrittäjä → "hetken päästä" → tarjouspyyntö */
.hdtl-anim-ready.hdtl-phonechat .hdtl-sms--me { transition-delay: 2.2s !important; }
.hdtl-anim-ready.hdtl-phonechat .hdtl-compare__label { opacity: 0; transition: opacity .35s ease 2.9s; }
.hdtl-anim-ready.hdtl-phonechat .hdtl-req { opacity: 0; transform: translateY(18px) scale(.98); transition: opacity .45s ease 3.2s, transform .45s cubic-bezier(.2, .9, .3, 1.2) 3.2s; }
.hdtl-anim-ready.hdtl-phonechat.is-inview .hdtl-compare__label,
.hdtl-anim-ready.hdtl-phonechat.is-inview .hdtl-req { opacity: 1; transform: none; }
.hdtl-anim-ready.hdtl-phonechat .hdtl-row:nth-of-type(2) { transition-delay: 3.6s; }
.hdtl-anim-ready.hdtl-phonechat .hdtl-row:nth-of-type(3) { transition-delay: 3.85s; }
.hdtl-anim-ready.hdtl-phonechat .hdtl-row:nth-of-type(4) { transition-delay: 4.1s; }
.hdtl-anim-ready.hdtl-phonechat .hdtl-row:nth-of-type(5) { transition-delay: 4.35s; }
.hdtl-anim-ready.hdtl-phonechat .hdtl-row:nth-of-type(6) { transition-delay: 4.6s; }
.hdtl-anim-ready.hdtl-phonechat .hdtl-row:nth-of-type(7) { transition-delay: 4.85s; }
.hdtl-anim-ready.hdtl-phonechat .hdtl-req__sum { transition-delay: 5.2s; }
.hdtl-anim-ready.hdtl-phonechat:not(.is-inview) .hdtl-compare__label,
.hdtl-anim-ready.hdtl-phonechat:not(.is-inview) .hdtl-req { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
	.hdtl-anim-ready.hdtl-phonechat .hdtl-req,
	.hdtl-anim-ready.hdtl-phonechat .hdtl-compare__label { transition: none; opacity: 1; transform: none; }
	.hdtl-summary__kv.is-flash { animation: none; }
}

/* ---------- v0.1.2 Ländäri: muistilaput kokoontuvat tarjouspyynnöksi (hdtl-mess) ---------- */
.hdtl-mess {
	position: relative;
	max-width: none !important;
	min-height: 560px;
	padding: 24px 22px 26px;
	border-radius: 26px;
	background:
		radial-gradient(120% 80% at 100% 0%, rgba(40, 35, 160, .95) 0%, rgba(40, 35, 160, 0) 62%),
		radial-gradient(90% 60% at 0% 100%, rgba(0, 145, 220, .3) 0%, rgba(0, 145, 220, 0) 60%),
		#0a1941;
	overflow: hidden;
	box-shadow: 0 40px 70px -45px rgba(10, 25, 65, .8);
}
.hdtl-mess .hdtl-note {
	position: absolute;
	z-index: 1;
	width: 47%;
	margin: 0 !important;
	padding: 12px 14px;
	border-radius: 4px 14px 14px 14px;
	background: #ffffff;
	color: #0a1941;
	font-size: 13.5px;
	font-weight: 700;
	line-height: 1.35;
	box-shadow: 0 14px 26px -14px rgba(0, 0, 0, .6);
	transform: rotate(var(--r, 0deg));
}
.hdtl-mess .hdtl-note:nth-of-type(1) { top: 26px; left: 5%; --r: -6deg; --dx: 40px; --dy: 250px; background: #fff6e2; }
.hdtl-mess .hdtl-note:nth-of-type(2) { top: 62px; right: 5%; --r: 5deg; --dx: -40px; --dy: 220px; }
.hdtl-mess .hdtl-note:nth-of-type(3) { top: 138px; left: 8%; --r: 3deg; --dx: 30px; --dy: 170px; background: #eeeeff; }
.hdtl-mess .hdtl-note:nth-of-type(4) { top: 168px; right: 7%; --r: -4deg; --dx: -30px; --dy: 150px; background: #fff6e2; }
.hdtl-mess .hdtl-mess__cap {
	position: absolute;
	z-index: 1;
	top: 70px;
	left: 0;
	right: 0;
	margin: 0 !important;
	text-align: center;
	font-size: 13px;
	font-weight: 900;
	letter-spacing: 1.6px;
	text-transform: uppercase;
	color: #ffcd6f;
}
.hdtl-mess .hdtl-req {
	position: relative;
	z-index: 2;
	margin-top: 200px !important;
	background: #ffffff;
	color: #0a1941;
	box-shadow: 0 30px 50px -28px rgba(0, 0, 0, .75);
}
.hdtl-mess .hdtl-req__kicker { color: #2823a0; display: flex; align-items: center; gap: 8px; }
.hdtl-mess .hdtl-req__kicker::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: #e59c14; box-shadow: 0 0 0 4px rgba(229, 156, 20, .2); }
.hdtl-mess .hdtl-row { color: #4d5a72; border-bottom-color: #e3e5f5; font-size: 14px; }
.hdtl-mess .hdtl-row strong { color: #0a1941; }
.hdtl-mess .hdtl-req__sum { background: linear-gradient(90deg, #2823a0 0%, #0091dc 100%); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* animation */
.hdtl-anim-ready.hdtl-mess .hdtl-note { opacity: 0; }
.hdtl-anim-ready.hdtl-mess .hdtl-mess__cap { opacity: 0; transform: translateY(8px); }
.hdtl-anim-ready.hdtl-mess .hdtl-req { opacity: 0; transform: translateY(40px) scale(.96); }
.hdtl-anim-ready.hdtl-mess.is-inview .hdtl-note { animation: hdtl-note-life 3.4s ease both; }
.hdtl-anim-ready.hdtl-mess.is-inview .hdtl-note:nth-of-type(2) { animation-delay: .25s; }
.hdtl-anim-ready.hdtl-mess.is-inview .hdtl-note:nth-of-type(3) { animation-delay: .5s; }
.hdtl-anim-ready.hdtl-mess.is-inview .hdtl-note:nth-of-type(4) { animation-delay: .75s; }
.hdtl-anim-ready.hdtl-mess.is-inview .hdtl-req { animation: hdtl-card-in .7s cubic-bezier(.2, .9, .3, 1.15) 2s both; }
.hdtl-anim-ready.hdtl-mess.is-inview .hdtl-mess__cap { animation: hdtl-cap-in .5s ease 4.6s both; }
@keyframes hdtl-note-life {
	0% { opacity: 0; transform: translateY(-30px) rotate(calc(var(--r) * 2)); }
	14% { opacity: 1; transform: translateY(0) rotate(var(--r)); }
	62% { opacity: 1; transform: translateY(0) rotate(var(--r)); }
	100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(.35) rotate(0deg); }
}
@keyframes hdtl-card-in { from { opacity: 0; transform: translateY(40px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes hdtl-cap-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.hdtl-anim-ready.hdtl-mess .hdtl-row:nth-of-type(2) { transition-delay: 2.7s; }
.hdtl-anim-ready.hdtl-mess .hdtl-row:nth-of-type(3) { transition-delay: 2.95s; }
.hdtl-anim-ready.hdtl-mess .hdtl-row:nth-of-type(4) { transition-delay: 3.2s; }
.hdtl-anim-ready.hdtl-mess .hdtl-row:nth-of-type(5) { transition-delay: 3.45s; }
.hdtl-anim-ready.hdtl-mess .hdtl-row:nth-of-type(6) { transition-delay: 3.7s; }
.hdtl-anim-ready.hdtl-mess .hdtl-row:nth-of-type(7) { transition-delay: 3.95s; }
.hdtl-anim-ready.hdtl-mess .hdtl-req__sum { transition-delay: 4.3s; }
/* without JS: tidy final state (notes hidden behind a readable card) */
.hdtl-mess:not(.hdtl-anim-ready) .hdtl-note { display: none; }
@media (prefers-reduced-motion: reduce) {
	.hdtl-anim-ready.hdtl-mess .hdtl-note { display: none; }
	.hdtl-anim-ready.hdtl-mess .hdtl-req,
	.hdtl-anim-ready.hdtl-mess .hdtl-mess__cap { animation: none; opacity: 1; transform: none; }
}

/* ---------- v0.1.3: summa näkyy aina ---------- */
/* Hintapaneeli pysähtyy sivuston oman yläpalkin alle (JS asettaa --hdtl-sticky-top). */
.hdtl-summary__inner { top: var(--hdtl-sticky-top, calc(24px + var(--wp-admin--admin-bar--height, 0px))); }
/* Tiiviimpi paneeli, jotta se mahtuu kannettavan näytölle kokonaan. */
.hdtl-summary { padding-top: 28px; padding-bottom: 28px; }
.hdtl-summary__total { font-size: clamp(1.8em, 3vw, 2.5em); margin-top: 6px !important; }
.hdtl-mtn { height: clamp(80px, 8vw, 110px); margin-top: 12px; margin-bottom: 12px; }
.hdtl-summary__rows { gap: 6px 12px; font-size: .9em; }
.hdtl-summary__kv { margin-top: 14px !important; padding: 12px 14px; font-size: .84em; }
.hdtl-summary__note { margin-top: 12px !important; }
.hdtl-summary .hdtl-btn { margin-top: 16px; }

/* Hintapalkki alareunassa kaikilla näytöillä, kun summa ei näy. */
.hdtl-calc .hdtl-bar {
	display: flex;
	position: fixed;
	z-index: 9999;
	left: 50%;
	right: auto;
	bottom: calc(16px + env(safe-area-inset-bottom, 0px));
	width: min(620px, calc(100% - 24px));
	align-items: center;
	gap: 14px;
	padding: 10px 10px 10px 22px;
	background: #0a1941;
	color: #fff;
	border-radius: 99px;
	box-shadow: 0 18px 40px -14px rgba(10, 25, 65, .7);
	transform: translate(-50%, 160%);
	transition: transform .3s cubic-bezier(.2, .9, .3, 1.1);
	cursor: pointer;
}
.hdtl-calc .hdtl-bar.is-visible { transform: translate(-50%, 0); }
.hdtl-calc .hdtl-bar__label { flex: 1 1 auto; min-width: 0; font-size: 11px; font-weight: 900; letter-spacing: 1.4px; text-transform: uppercase; color: #8fd0ff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hdtl-calc .hdtl-bar__total { font-size: 1.15em; font-weight: 900; color: #ffcd6f; white-space: nowrap; }
.hdtl-calc .hdtl-bar__delta { font-size: 12px; font-weight: 900; padding: 3px 8px; border-radius: 99px; opacity: 0; transition: opacity .25s; white-space: nowrap; }
.hdtl-calc .hdtl-bar__delta.is-on { opacity: 1; }
.hdtl-calc .hdtl-bar__delta.is-up { background: rgba(255, 205, 111, .16); color: #ffcd6f; }
.hdtl-calc .hdtl-bar__delta.is-down { background: rgba(143, 208, 255, .16); color: #8fd0ff; }
.hdtl-calc .hdtl-bar__cta {
	flex: 0 0 auto;
	margin: 0;
	padding: 10px 18px;
	border: 0;
	border-radius: 99px;
	background: linear-gradient(180deg, #e59c14 0%, #ffcd6f 100%);
	color: #0a1941;
	font: inherit;
	font-size: .9em;
	font-weight: 900;
	cursor: pointer;
	box-shadow: none;
}
@media (max-width: 600px) {
	.hdtl-calc .hdtl-bar { gap: 10px; padding-left: 16px; }
	.hdtl-calc .hdtl-bar__label { display: none; }
	.hdtl-calc .hdtl-bar__total { font-size: 1em; }
	.hdtl-calc .hdtl-bar__cta { padding: 9px 14px; font-size: .85em; }
}
@media (prefers-reduced-motion: reduce) {
	.hdtl-calc .hdtl-bar { transition: none; }
}

/* ---------- v0.1.5: hintapaneeli seuraa vieritystä ---------- */
/* overflow:hidden esti position:sticky -toiminnan. Kulmat pyöristetään nyt paneelista itsestään. */
.hdtl-layout { overflow: visible; }
/* Paneelin oma overflow:hidden teki siitä vierityssäiliön; clip rajaa sisällön ilman sitä. */
.hdtl-summary { overflow: visible; overflow: clip; }
.hdtl-summary { border-radius: 0 var(--hdtl-radius-lg) var(--hdtl-radius-lg) 0; }
.hdtl-questions { border-radius: var(--hdtl-radius-lg) 0 0 var(--hdtl-radius-lg); }
@media (min-width: 901px) {
	/* Tietokoneella hintapaneeli liukuu mukana, joten alapalkkia ei tarvita. */
	.hdtl-calc .hdtl-bar { display: none !important; }
}
@media (max-width: 900px) {
	.hdtl-summary { border-radius: 0 0 var(--hdtl-radius-lg) var(--hdtl-radius-lg); }
	.hdtl-questions { border-radius: var(--hdtl-radius-lg) var(--hdtl-radius-lg) 0 0; }
}

/* ---------- v0.1.8: välilehdet (esim. demolaskurin alat) ---------- */
.hdtl-tabs { gap: 10px !important; margin-bottom: 1.75rem !important; flex-wrap: wrap; }
.hdtl-tabs .wp-block-button__link {
	background: #ffffff !important;
	color: #0a1941 !important;
	border: 1.5px solid #cdd0e6 !important;
	border-radius: 99px !important;
	padding: 10px 22px !important;
	font-weight: 800 !important;
	box-shadow: none !important;
	transition: background-color .15s, color .15s, border-color .15s;
}
.hdtl-tabs .wp-block-button__link:hover { border-color: #2823a0 !important; }
.hdtl-tabs .wp-block-button__link.is-active {
	background: #0a1941 !important;
	color: #ffffff !important;
	border-color: #0a1941 !important;
}

/* v0.1.9: teemojen syöttökenttätyylit eivät saa kaventaa lukukenttää */
.hdtl-calc .hdtl-num input { padding: 10px 4px 10px 8px !important; min-width: 4.4em; height: auto !important; border: 0 !important; box-shadow: none !important; background: transparent !important; }

/* ---------- v0.2.1: mobiilikorjaukset ---------- */
@media (max-width: 900px) {
	/* 1fr venyi sisällön levyiseksi ja laskuri valui näytön yli */
	.hdtl-layout { grid-template-columns: minmax(0, 1fr); }
	.hdtl-questions { padding-left: 16px; padding-right: 16px; }
	.hdtl-summary { --hdtl-pad: 16px; padding-left: 16px; padding-right: 16px; }
}
/* Teeman painiketyylit eivät saa leventää +/- -painikkeita */
.hdtl-calc .hdtl-num { max-width: 100%; }
.hdtl-calc .hdtl-num .hdtl-num__btn { flex: 0 0 46px !important; width: 46px !important; min-width: 0 !important; padding: 0 !important; border-radius: 0 !important; }
@media (max-width: 600px) {
	/* Palkki vasempaan reunaan, jotta oikean alakulman chat-painikkeelle jää tilaa */
	.hdtl-calc .hdtl-bar { left: 12px; right: 84px; width: auto; transform: translateY(160%); gap: 8px; padding: 8px 8px 8px 14px; }
	.hdtl-calc .hdtl-bar.is-visible { transform: none; }
	.hdtl-calc .hdtl-bar__delta { display: none; }
	.hdtl-calc .hdtl-bar__total { flex: 1 1 auto; font-size: .95em; }
	.hdtl-calc .hdtl-bar .hdtl-bar__cta { padding: 8px 12px !important; font-size: .8em !important; min-width: 0 !important; width: auto !important; }
}

/* ---------- v0.2.4: erittely riveittäin + vuoriston selite ---------- */
.hdtl-summary__rows dt { font-weight: 600; line-height: 1.35; }
.hdtl-summary__rows dd { white-space: nowrap; }
.hdtl-calc .hdtl-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: -4px 0 14px !important; font-size: .78em; color: #a9b6d8; }
.hdtl-legend .hdtl-cat { gap: 7px; }
.hdtl-legend .hdtl-cat::before { width: 9px; height: 9px; flex-basis: 9px; }
.hdtl-legend .hdtl-cat--tyo::before { background: linear-gradient(#0091dc, #2823a0); }
.hdtl-legend .hdtl-cat--materiaali::before { background: #6f6af0; }
.hdtl-legend .hdtl-cat--muu::before { background: #9e9ae6; }
