/* Kotisi Sähköpalvelu – perustyylit
   Tokenit vastaavat Design Systemiä (Claude Design: "Kotisi Sähköpalvelu").
   Järjestys: tokenit, perusta, komponentit, sivuston osiot, lomakkeet, laskuri, lataus. */

:root {
  /* Värit */
  --white: #ffffff;
  --wall: #f3f5f6;          /* vuorotteleva osiotausta, kuvien pohjat */
  --ink: #15212c;           /* teksti */
  --ink-soft: #4a5866;      /* toissijainen teksti */
  --rule: #d8dee3;          /* pillerien, vaihtoehtojen ja hintakortin reuna */
  --rule-soft: #e6eaed;     /* erotinviivat ja korttien reunat */
  --rule-faint: #eef1f3;    /* listarivien väliviivat */
  --field-border: #8a96a1;  /* lomakekentät (3:1 valkoisella) */
  --blue: #008df8;          /* logon sininen: kohdistusrengas ja koristeet */
  --blue-deep: #0063b5;     /* päätoiminto ja linkit */
  --blue-hover: #004f91;
  --blue-tint: #e6f2fc;
  --phase: #7b4a2d;         /* vaihejohdin */
  --earth-g: #2f9b4b;       /* suojamaadoitus */
  --earth-y: #f0c419;
  --warn-bg: #fff4cc;
  --warn-ink: #5c4700;
  --ok-bg: #e3f4e8;
  --ok-ink: #1d6b35;
  --error: #b42318;
  --error-bg: #fbe9e7;
  --ink-text-soft: #c3ccd4; /* teksti tummalla pohjalla */
  --solar-tint: #e6eef6;

  /* Typografia */
  --font: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  --step--1: 0.875rem;  /* 14px */
  --step-0: 1.0625rem;  /* 17px */
  --step-1: 1.25rem;    /* 20px */
  --step-2: 1.75rem;    /* 28px */
  --step-3: clamp(1.75rem, 1.3rem + 1.9vw, 2.5rem);   /* h2: 28–40px */
  --step-4: clamp(2.25rem, 1.4rem + 3.6vw, 4rem);     /* etusivun h1: 36–64px */

  /* Mitat */
  --gutter: clamp(1rem, 4vw, 2.5rem);
  --max: 1280px;
  --measure: 62ch;
  --radius-xs: 10px;
  --radius-sm: 12px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-2xl: 28px;
  --radius: var(--radius-lg); /* vanha nimi, käytössä ylläpidossa */
  --shadow-card: 0 6px 20px rgba(21, 33, 44, .10);
  --shadow-pop: 0 8px 24px rgba(21, 33, 44, .16);
  --shadow-bar: 0 -4px 16px rgba(21, 33, 44, .08);
  --section: clamp(3.5rem, 8vw, 6rem);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 6rem; }

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: var(--blue-deep); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
  border-radius: 4px;
}

h1, h2, h3 {
  margin: 0;
  font-stretch: 112%;
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: -0.015em;
  text-wrap: balance;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.6vw, 3rem); line-height: 1.06; }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-1); line-height: 1.25; }

p { margin: 0 0 1em; max-width: var(--measure); }
p:last-child { margin-bottom: 0; }

.wrap {
  width: 100%;
  max-width: var(--max);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.lead { font-size: 1.1875rem; color: var(--ink-soft); line-height: 1.55; }
.note { color: var(--ink-soft); }
.num { font-variant-numeric: tabular-nums; }

.skip {
  position: absolute; left: -999px; top: 0;
  background: var(--ink); color: var(--white); padding: .6rem 1rem; z-index: 100;
}
.skip:focus { left: 1rem; top: 1rem; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Painikkeet ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5em;
  min-height: 48px;
  padding: 0 1.5rem;
  border-radius: 999px;
  border: 1px solid var(--blue-deep);
  background: var(--blue-deep);
  color: var(--white);
  font: inherit;
  font-size: 1rem;
  font-weight: 600;
  font-stretch: 106%;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color .15s, border-color .15s, color .15s;
}
.btn:hover { background: var(--blue-hover); border-color: var(--blue-hover); color: var(--white); }
.btn svg { width: 1.15em; height: 1.15em; flex: none; }
.btn:disabled { opacity: .6; cursor: default; }

.btn--ghost { background: var(--white); color: var(--ink); border-color: var(--ink); }
.btn--ghost:hover { background: var(--wall); color: var(--ink); border-color: var(--ink); }
.btn--lg { min-height: 56px; font-size: 1.0625rem; }

.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; }
/* Allekkain olevat napit, esim. asentajan soitto ja WhatsApp */
.btn-row--stack { flex-direction: column; align-items: stretch; max-width: 20rem; }

/* Suodatin- ja valintapilleri */
.pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: .9375rem;
  font-weight: 600;
  cursor: pointer;
}
.pill[aria-selected="true"], .pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--white); }

.tag {
  display: inline-flex;
  align-items: center;
  padding: .15rem .6rem;
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: .8125rem;
  font-weight: 600;
  white-space: nowrap;
}

/* ---------- Ylätunniste ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--white);
  border-bottom: 1px solid var(--rule-soft);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 80px;
}
.brand img { width: 112px; height: 56px; }

.nav ul {
  display: flex;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav a {
  display: block;
  padding: .6rem .9rem;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  font-size: .9375rem;
  font-weight: 550;
  white-space: nowrap;
}
.nav a:hover { background: var(--wall); }
.nav a[aria-current] { background: var(--wall); color: var(--blue-deep); }

.header-actions { display: flex; align-items: center; gap: .5rem; }
.header-phone {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .6rem .75rem;
  color: var(--ink);
  font-size: .9375rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.header-phone svg { width: 18px; height: 18px; }
.header-phone:hover { color: var(--blue-deep); }

.nav-toggle {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle svg { width: 18px; height: 18px; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 1180px) {
  .site-header .wrap { flex-wrap: wrap; min-height: 64px; gap: .75rem; }
  .brand img { width: 88px; height: 44px; }
  .header-actions { margin-left: auto; }
  .header-actions .btn { display: none; }
  .header-phone { width: 44px; height: 44px; padding: 0; justify-content: center; border: 1px solid var(--rule); border-radius: 50%; }
  .header-phone span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .nav-toggle { display: grid; }
  .nav { display: none; width: 100%; padding-bottom: 1rem; }
  .nav.is-open { display: block; }
  .nav ul { flex-direction: column; }
  .nav a { font-size: 1.0625rem; padding: .85rem .5rem; border-radius: 0; border-bottom: 1px solid var(--rule-faint); }
  .nav a[aria-current] { background: none; }
}

/* ---------- Osiot ---------- */

.section { padding-block: var(--section); }
.section--white { background: var(--white); }
.section--wall { background: var(--wall); }

.section-head { display: grid; gap: .75rem; max-width: 46rem; margin-bottom: clamp(2rem, 4vw, 2.5rem); }
.section-head p { margin: 0; }
.section-head--row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: end; gap: 1.5rem; max-width: none; }
.section-head--row > div { display: grid; gap: .75rem; max-width: 40rem; }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: center;
}
.split--top { align-items: start; }
.split img { border-radius: var(--radius-lg); width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; }
  .split img { aspect-ratio: 4 / 3; }
}

/* ---------- Etusivun hero ---------- */

.hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(2rem, 5vw, 3.5rem);
  align-items: center;
  padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 4vw, 3rem);
}
.hero-copy { display: grid; gap: 1.5rem; }
.eyebrow { margin: 0; font-size: .9375rem; font-weight: 600; color: var(--blue-deep); }
.hero h1 { font-size: var(--step-4); line-height: 1.02; font-stretch: 118%; }
.hero .lead { margin: 0; font-size: 1.25rem; max-width: 34em; }

.hero-media { position: relative; }
.hero-media img { width: 100%; aspect-ratio: 4 / 4.4; object-fit: cover; border-radius: var(--radius-2xl); }
.hero-badge {
  position: absolute;
  left: 1.5rem;
  bottom: 1.5rem;
  display: flex;
  align-items: center;
  gap: .9rem;
  max-width: calc(100% - 3rem);
  padding: 1rem 1.25rem;
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-pop);
  font-size: .875rem;
  line-height: 1.35;
}
.hero-badge strong { display: block; font-size: .9375rem; }
.hero-badge span { color: var(--ink-soft); }
.check-dot { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--blue-deep); flex: none; }
.check-dot svg { width: 20px; height: 20px; }

/* Hakupalkki: palvelun valinta ja hinta yhdessä pillerissä */
.finder {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  max-width: 600px;
  padding: 8px;
  border: 1px solid var(--rule);
  border-radius: 40px;
  background: var(--white);
  box-shadow: var(--shadow-card);
}
.finder-field {
  position: relative;
  flex: 1 1 220px;
  display: grid;
  gap: 2px;
  padding: .5rem 1.5rem;
  border-radius: 999px;
}
.finder-field:hover { background: var(--wall); }
.finder-label { font-size: .75rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; }
.finder select {
  appearance: none;
  width: 100%;
  padding: 0 1.5rem 0 0;
  border: 0;
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5866' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") right center / 16px no-repeat;
  color: var(--ink-soft);
  font: inherit;
  font-size: .9375rem;
  cursor: pointer;
}
.finder select:focus-visible { outline: none; }
.finder-field:focus-within { box-shadow: inset 0 0 0 2px var(--ink); }
.finder-price { flex: 0 1 140px; padding: .5rem 1rem; display: grid; gap: 2px; border-left: 1px solid var(--rule); }
.finder-price strong { font-size: .9375rem; font-variant-numeric: tabular-nums; }
.finder .btn { min-height: 56px; padding: 0 1.6rem; }
@media (max-width: 560px) {
  .finder { border-radius: var(--radius-2xl); flex-direction: column; align-items: stretch; }
  .finder-field { background: var(--wall); border-radius: var(--radius-lg); }
  .finder-price { border-left: 0; padding: .25rem 1.5rem; }
  .finder-field, .finder-price { flex: none; }
}

.trust { display: flex; flex-wrap: wrap; gap: .5rem 1.75rem; margin: 0; padding: 0; list-style: none; font-size: .9375rem; color: var(--ink-soft); }
.trust li { display: inline-flex; align-items: center; gap: .4rem; }
.trust strong { color: var(--ink); }
.trust svg { width: 18px; height: 18px; color: var(--earth-y); }

@media (max-width: 860px) {
  .hero .wrap { grid-template-columns: 1fr; }
  .hero-media img { aspect-ratio: 16 / 11; }
}

/* ---------- Palvelukortit ---------- */

.service-cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.service-card { position: relative; display: grid; gap: .85rem; align-content: start; }
.service-card-media { overflow: hidden; aspect-ratio: 1; border-radius: var(--radius-lg); background: var(--wall); }
.service-card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.service-card-media--contain img { object-fit: contain; padding: 12%; }
.service-card-media--solar { background: var(--solar-tint); }
.service-card h3 { font-size: 1.1875rem; }
.service-card h3 a { color: inherit; text-decoration: none; }
.service-card h3 a::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-lg); }
.service-card p { margin: 0; font-size: .9375rem; line-height: 1.45; color: var(--ink-soft); }
.service-card .price { font-size: .9375rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.service-card:hover .service-card-media img { transform: scale(1.03); }
.service-card:hover h3 a { text-decoration: underline; }
@media (max-width: 1000px) { .service-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) {
  .service-cards { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: .25rem; }
  .service-card { scroll-snap-align: start; }
}

/* Laskurien valikko */
.calc-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.calc-card { display: flex; flex-direction: column; gap: .85rem; padding: 1.75rem; border-radius: var(--radius-xl); background: var(--white); }
.calc-card h3 { font-size: 1.3125rem; }
.calc-card p { margin: 0; font-size: .9375rem; line-height: 1.5; color: var(--ink-soft); }
.calc-card p strong { color: var(--ink); font-weight: 600; }
.calc-card .price { display: flex; flex-wrap: wrap; align-items: baseline; gap: .5rem; margin-top: auto; padding-top: .5rem; font-size: 1.375rem; font-weight: 700; font-stretch: 112%; color: var(--ink); font-variant-numeric: tabular-nums; }
@media (max-width: 1000px) { .calc-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .calc-cards { grid-template-columns: 1fr; } }

/* ---------- Prosessi: vaiheet yhdistää kolme johdinta ---------- */

.process { position: relative; }
.process-wires { position: absolute; left: 28px; right: 28px; top: 26px; display: grid; gap: 3px; }
.process-wires span { height: 3px; border-radius: 2px; }
.wire-phase { background: var(--phase); }
.wire-neutral { background: var(--blue); }
.wire-earth { background: repeating-linear-gradient(90deg, var(--earth-g) 0 14px, var(--earth-y) 14px 28px); }
.process ol { position: relative; display: grid; grid-template-columns: repeat(var(--steps, 6), minmax(0, 1fr)); gap: 1.5rem; margin: 0; padding: 0; list-style: none; counter-reset: step; }
.process li { counter-increment: step; display: grid; gap: .85rem; align-content: start; }
.process li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border: 2px solid var(--ink);
  border-radius: 50%;
  background: var(--white);
  font-size: 1.25rem;
  font-weight: 700;
  font-stretch: 118%;
}
.section--wall .process li::before { background: var(--wall); }
.process h3 { font-size: 1.125rem; line-height: 1.3; }
.process p { margin: 0; font-size: .9375rem; line-height: 1.5; color: var(--ink-soft); }
@media (max-width: 900px) {
  .process-wires { display: none; }
  .process ol { grid-template-columns: 1fr; gap: 0; }
  .process li { grid-template-columns: 44px minmax(0, 1fr); column-gap: 1rem; row-gap: .25rem; position: relative; padding-bottom: 1.5rem; }
  .process li::before { width: 44px; height: 44px; font-size: 1rem; grid-row: span 2; }
  .process li::after { content: ""; position: absolute; left: 20.5px; top: 46px; bottom: 0; width: 3px; background: var(--wire, var(--blue)); }
  .process li:nth-child(4n+1) { --wire: var(--phase); }
  .process li:nth-child(4n+2) { --wire: var(--blue); }
  .process li:nth-child(4n+3) { --wire: var(--earth-g); }
  .process li:nth-child(4n+4) { --wire: var(--earth-y); }
  .process li:last-child::after { display: none; }
  .process h3 { padding-top: .55rem; }
}

/* Pystysuuntaiset vaiheet palvelusivuilla */
.steps { counter-reset: step; margin: 0; padding: 0; list-style: none; max-width: 46rem; }
.steps li { counter-increment: step; position: relative; padding: 0 0 2rem 4rem; }
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: -.15rem;
  display: grid;
  place-items: center;
  width: 2.75rem; height: 2.75rem;
  border-radius: 50%;
  background: var(--white);
  border: 2px solid var(--ink);
  font-weight: 700;
  font-stretch: 118%;
  z-index: 1;
}
.section--wall .steps li::before { background: var(--wall); }
.steps li::after {
  content: "";
  position: absolute;
  left: calc(1.375rem - 1.5px);
  top: 2.6rem;
  bottom: .1rem;
  width: 3px;
  background: var(--wire, var(--blue));
}
.steps li:nth-child(4n+1) { --wire: var(--phase); }
.steps li:nth-child(4n+2) { --wire: var(--blue); }
.steps li:nth-child(4n+3) { --wire: var(--earth-g); }
.steps li:nth-child(4n+4) { --wire: var(--earth-y); }
.steps li:last-child { padding-bottom: 0; }
.steps li:last-child::after { display: none; }
.steps h3 { margin-bottom: .35rem; font-size: 1.125rem; padding-top: .45rem; }
.steps p { color: var(--ink-soft); font-size: .9375rem; }
.steps--compact li { padding-bottom: 1.5rem; }

/* ---------- Tekijät ---------- */

.people { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.person {
  display: grid;
  grid-template-columns: 168px minmax(0, 1fr);
  gap: 1.75rem;
  align-items: start;
  padding: 1.75rem;
  border-radius: var(--radius-xl);
  background: var(--white);
}
.person img { width: 168px; height: 168px; border-radius: var(--radius-lg); object-fit: cover; }
.person h3 { font-size: 1.5rem; }
.person .role { margin: .35rem 0 .6rem; color: var(--blue-deep); font-weight: 600; font-size: .9375rem; }
.person p { color: var(--ink-soft); font-size: .9375rem; }
.person .btn-row { margin-top: 1rem; gap: .6rem; }
.person .btn { min-height: 44px; padding: 0 1.1rem; font-size: .9375rem; }
@media (max-width: 960px) { .people { grid-template-columns: 1fr; } }
@media (max-width: 520px) {
  .person { grid-template-columns: 72px minmax(0, 1fr); gap: 1rem; padding: 1.25rem; }
  .person img { width: 72px; height: 72px; border-radius: 50%; }
  .person h3 { font-size: 1.1875rem; }
  .person > div > p:not(.role), .person .btn-row { grid-column: 1 / -1; }
}

/* ---------- Arvostelut ---------- */

.rating-head { display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem 2rem; margin-bottom: 2.5rem; }
.rating-score { font-size: clamp(2.75rem, 2rem + 3vw, 4.5rem); line-height: 1; font-weight: 700; font-stretch: 118%; }
.rating-head h2 { font-size: var(--step-2); }
.rating-head .btn { margin-left: auto; }
.stars { display: inline-flex; gap: 2px; color: var(--earth-y); }
.stars svg { width: 22px; height: 22px; }
.review-stars svg { width: 18px; height: 18px; }
.stars svg.is-empty { color: var(--rule); }

.reviews { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 3rem 3.5rem; margin: 0; padding: 0; list-style: none; }
.review { display: grid; gap: .9rem; align-content: start; margin: 0; }
.review figcaption { display: flex; align-items: center; gap: .9rem; }
.review figcaption strong { display: block; font-size: 1rem; }
.review figcaption strong a { color: inherit; text-decoration: none; }
.review figcaption strong a:hover { text-decoration: underline; }
.review figcaption span:not(.avatar) { font-size: .875rem; color: var(--ink-soft); }
.review blockquote { margin: 0; font-size: 1rem; line-height: 1.6; }
.review blockquote { white-space: pre-line; }
.review-more { justify-self: start; padding: 0; border: 0; background: none; color: var(--blue-deep); font: inherit; font-size: .875rem; font-weight: 600; text-decoration: underline; text-underline-offset: .18em; cursor: pointer; }
.avatar { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--avatar, var(--blue-deep)); color: var(--white); font-weight: 700; font-size: 1.125rem; flex: none; }
.reviews li:nth-child(4n+2) .avatar { --avatar: var(--phase); }
.reviews li:nth-child(4n+3) .avatar { --avatar: var(--ink); }
.reviews li:nth-child(4n+4) .avatar { --avatar: var(--ok-ink); }
@media (max-width: 1000px) { .reviews { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .reviews { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 85%; overflow-x: auto; scroll-snap-type: x mandatory; gap: 1rem; }
  .review { scroll-snap-align: start; padding: 1.25rem; border: 1px solid var(--rule-soft); border-radius: var(--radius-lg); }
  .rating-head .btn { margin-left: 0; }
}

/* ---------- Alueet ---------- */

.areas { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.5rem 0 0; padding: 0; list-style: none; }
.areas li {
  padding: .4rem .9rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: var(--white);
  font-size: var(--step--1);
}

/* ---------- Palvelusivut ---------- */

.page-hero .wrap {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
  padding-block: clamp(1.5rem, 4vw, 2.5rem) clamp(2.5rem, 6vw, 4.5rem);
}
.page-hero .wrap > div:first-child { display: grid; gap: 1.1rem; align-content: start; }
.page-hero .lead { margin: 0; }
.page-hero .btn-row { margin-top: .75rem; }
.page-hero-media img { border-radius: var(--radius-2xl); width: 100%; aspect-ratio: 5 / 4; object-fit: cover; }
@media (max-width: 860px) {
  .page-hero .wrap { grid-template-columns: 1fr; }
  .page-hero-media img { aspect-ratio: 16 / 10; }
}

/* Tuotesivun yläosan toiminnot (sivupohjat/hero-toiminnot.html): pääpainike ja yhteyshenkilö numeroineen */
.hero-actions { display: grid; gap: .5rem; justify-items: start; margin-top: .5rem; }
.hero-actions-question { margin: 0; font-weight: 650; color: var(--ink); }
.hero-contact { display: grid; gap: .6rem; max-width: 34rem; padding-top: 1.1rem; border-top: 1px solid var(--rule-soft); }
.hero-contact-lead { margin: 0; font-size: var(--step--1); color: var(--ink-soft); }
.hero-person { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: .9rem; }
.hero-person[hidden] { display: none; }
.hero-person img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; }
.hero-person-body { display: grid; gap: .1rem; line-height: 1.3; }
.hero-person-body span { font-size: var(--step--1); color: var(--ink-soft); }
/* Numero näkyy tekstinä niillekin, jotka eivät halua painaa linkkiä */
.hero-person-number { font-size: 1.125rem; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink); text-decoration: none; }
.hero-person-number:hover { text-decoration: underline; }
.hero-person-actions { display: flex; gap: .5rem; }
.btn--compact { min-height: 44px; padding: 0 1.1rem; font-size: .9375rem; }
@media (max-width: 520px) {
  .hero-person { grid-template-columns: 56px minmax(0, 1fr); }
  .hero-person img { width: 56px; height: 56px; }
  .hero-person-actions { grid-column: 1 / -1; }
  .hero-person-actions .btn { flex: 1; }
}
/* Laskuri heti yläosan jälkeen: vähemmän väliä, jotta "Laske hinta" vie lähelle */
.page-hero:has(+ .calc-section) .wrap { padding-bottom: clamp(1.5rem, 3vw, 2.5rem); }
.page-hero + .calc-section { padding-top: clamp(1rem, 3vw, 2rem); }

.breadcrumb { margin: 0; font-size: var(--step--1); color: var(--ink-soft); }
.breadcrumb a { color: var(--ink-soft); }

.meta-row { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; margin: 0; padding: 0; list-style: none; font-size: .9375rem; color: var(--ink-soft); }
.meta-row li { display: inline-flex; align-items: center; gap: .35rem; }
.meta-row strong { color: var(--ink); }
.meta-row svg { width: 16px; height: 16px; color: var(--earth-y); }

/* Sisältölista: tarkistusmerkit */
.checklist { margin: 0; padding: 0; list-style: none; display: grid; gap: 1.1rem; }
.checklist li { position: relative; padding-left: 2.6rem; max-width: var(--measure); line-height: 1.5; }
.checklist li::before {
  content: "";
  position: absolute;
  left: 0; top: -.05em;
  width: 1.75rem; height: 1.75rem;
  border-radius: 50%;
  background: var(--blue-tint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230063b5' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 12.5l4 4 8-9'/%3E%3C/svg%3E") center / 58% no-repeat;
}
.checklist--columns { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem 2.5rem; }
@media (max-width: 1000px) { .checklist--columns { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .checklist--columns { grid-template-columns: 1fr; } }

/* Tarjouslaatikko (aurinkopaneelipaketti) */
.offer {
  display: grid;
  gap: 1.25rem;
  padding: clamp(1.5rem, 4vw, 2rem);
  border: 1px solid var(--rule);
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-card);
}
.offer-price { font-size: clamp(2.5rem, 2rem + 2vw, 3.25rem); font-weight: 700; font-stretch: 118%; line-height: 1; font-variant-numeric: tabular-nums; }
.offer-price small { display: block; margin-top: .6rem; font-size: var(--step-0); font-weight: 600; font-stretch: 105%; color: var(--ink-soft); }
.offer h2 { font-size: var(--step-1); margin-bottom: .75rem; }
.offer ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.offer li { margin-bottom: .35rem; }

/* Kohdelinkit (esim. latausasema omakotitaloon) */
.target-links { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; margin: 0; padding: 0; list-style: none; }
.target-links a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  min-height: 4.5rem;
  padding: 1rem 1.4rem;
  border: 1px solid var(--rule);
  border-radius: 16px;
  color: var(--ink);
  text-decoration: none;
}
.target-links a:hover { border-color: var(--ink); }
.target-links strong { display: block; font-size: 1.0625rem; }
.target-links span { font-size: .875rem; color: var(--ink-soft); }
.target-links svg { width: 20px; height: 20px; flex: none; }
@media (max-width: 640px) { .target-links { grid-template-columns: 1fr; } }

/* Kalustesarjat */

/* UKK */
.faq { max-width: 52rem; border-top: 1px solid var(--rule-soft); }
.faq details { border-bottom: 1px solid var(--rule-soft); }
.faq summary {
  display: flex;
  justify-content: space-between;
  gap: 1.5rem;
  padding: 1.25rem 0;
  font-size: 1.125rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "";
  flex: none;
  width: 1.5rem; height: 1.5rem;
  margin-top: .05rem;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2315212c' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E") center / contain no-repeat;
  transition: transform .2s;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .answer { padding: 0 0 1.5rem; color: var(--ink-soft); }

/* Toimintakehote: tumma pyöristetty laatikko */
.cta-band { padding-block: 0 var(--section); }
.cta-band .wrap > .cta-box,
.cta-box {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  padding: clamp(1.75rem, 5vw, 3.5rem);
  border-radius: 32px;
  background: var(--ink);
  color: var(--white);
}
.cta-box h2 { max-width: 20ch; }
.cta-box p { margin: .75rem 0 0; color: var(--ink-text-soft); }
.cta-box .btn { min-height: 56px; background: var(--white); border-color: var(--white); color: var(--ink); }
.cta-box .btn:hover { background: var(--wall); border-color: var(--wall); color: var(--ink); }
.cta-box .btn--ghost { background: transparent; color: var(--white); border-color: var(--white); }
.cta-box .btn--ghost:hover { background: rgba(255, 255, 255, .1); color: var(--white); }

/* Yhteystiedot */
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; }
.info-grid h3 { margin-bottom: .75rem; }
.info-grid dl { margin: 0; display: grid; gap: .5rem; }
.info-grid dt { font-size: var(--step--1); color: var(--ink-soft); }
.info-grid dd { margin: 0 0 .25rem; font-weight: 550; overflow-wrap: anywhere; }
@media (max-width: 860px) { .info-grid { grid-template-columns: 1fr; } }

/* ---------- Pitkä teksti (artikkelit ja tietosuojaseloste) ---------- */

.prose > * { max-width: 46rem; }
.prose { font-size: 1.0625rem; line-height: 1.7; }
.prose h2 { font-size: var(--step-2); margin: 2.5rem 0 .75rem; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin: 1.75rem 0 .5rem; }
.prose ul { margin: 0 0 1em; padding-left: 1.25rem; max-width: var(--measure); }
.prose li { margin-bottom: .35rem; }
.prose code { font-size: .9em; overflow-wrap: anywhere; }

.article-layout { display: grid; grid-template-columns: 240px minmax(0, 720px); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
.toc { position: sticky; top: 6.5rem; display: grid; gap: 2px; }
.toc-title { margin: 0 0 .5rem; padding: 0 .75rem; font-size: .8125rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-soft); }
.toc a { padding: .5rem .75rem; border-radius: 10px; color: var(--ink); text-decoration: none; font-size: .9375rem; }
.toc a:hover { background: var(--wall); }
@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; }
  .toc { position: static; display: flex; gap: .5rem; overflow-x: auto; padding-bottom: .25rem; }
  .toc-title { display: none; }
  .toc a { flex: none; border: 1px solid var(--rule); border-radius: 999px; font-size: .875rem; white-space: nowrap; }
}
.callout { margin: .5rem 0 1.5rem; padding: 1.5rem; border-radius: var(--radius-lg); background: var(--wall); }
.callout p:last-child { margin: 0; }
.inline-cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; margin: 1.5rem 0; padding: 1.5rem; border: 1px solid var(--rule); border-radius: var(--radius-lg); }
.inline-cta strong { font-size: 1.125rem; }

.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 3rem 0 0; border: 1px solid var(--rule-soft); border-radius: var(--radius-lg); overflow: hidden; }
.facts div { padding: 1.4rem 1.5rem; border-right: 1px solid var(--rule-soft); }
.facts div:last-child { border-right: 0; }
.facts dt { font-size: .875rem; color: var(--ink-soft); }
.facts dd { margin: .25rem 0 0; font-size: 1.125rem; font-weight: 650; }
@media (max-width: 760px) {
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts div:nth-child(2n) { border-right: 0; }
  .facts div:nth-child(-n+2) { border-bottom: 1px solid var(--rule-soft); }
}

.related { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; margin: 0; padding: 0; list-style: none; }
.related a { display: grid; gap: .75rem; color: var(--ink); text-decoration: none; }
.related img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 18px; }
.related h3 { font-size: 1.1875rem; }
.related p { margin: 0; font-size: .9375rem; color: var(--ink-soft); }
.related a:hover h3 { text-decoration: underline; }
@media (max-width: 860px) { .related { grid-template-columns: 1fr; } }

.table-scroll { overflow-x: auto; margin: 1rem 0 1.5rem; }
.data-table { width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--rule-soft); font-size: var(--step--1); }
.data-table th, .data-table td { padding: .7rem .9rem; border-bottom: 1px solid var(--rule-soft); text-align: left; vertical-align: top; }
.data-table th { color: var(--ink-soft); font-weight: 600; }

/* ---------- Alatunniste ---------- */

.site-footer { background: var(--wall); color: var(--ink-soft); font-size: .9375rem; }
.site-footer::before {
  /* kolme johdinta alatunnisteen yläreunassa */
  content: "";
  display: block;
  height: 9px;
  background:
    linear-gradient(var(--phase) 0 3px, var(--blue) 3px 6px, transparent 6px),
    repeating-linear-gradient(90deg, var(--earth-g) 0 14px, var(--earth-y) 14px 28px);
  background-size: 100% 100%, 100% 3px;
  background-position: 0 0, 0 100%;
  background-repeat: no-repeat;
}
.site-footer .wrap { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 2rem; padding-block: 3rem 2rem; }
.site-footer h2 { font-size: 1rem; color: var(--ink); margin-bottom: .75rem; }
.site-footer ul { margin: 0; padding: 0; list-style: none; display: grid; gap: .4rem; }
.site-footer a { color: var(--ink); }
.site-footer a:hover { color: var(--blue-deep); }
.site-footer p { margin-bottom: .4rem; }
.site-footer .footer-social { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: .75rem; }
.site-footer .footer-social a { display: inline-flex; align-items: center; gap: .4rem; }
.footer-social-icon { width: 1.1em; height: 1.1em; flex: none; }
.footer-base { grid-column: 1 / -1; padding-top: 1.5rem; border-top: 1px solid var(--rule-soft); max-width: none; }
@media (max-width: 760px) { .site-footer .wrap { grid-template-columns: 1fr; } }

/* Mobiilin kiinteä toimintopalkki (soita / laske hinta) */
.action-bar { display: none; }
@media (max-width: 760px) {
  .action-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 55;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
    padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom, 0px));
    background: var(--white);
    border-top: 1px solid var(--rule-soft);
    box-shadow: var(--shadow-bar);
  }
  .has-action-bar { padding-bottom: 5.5rem; }
}

/* ---------- Evästesuostumus ---------- */

.consent {
  position: fixed;
  left: 1rem; right: 1rem; bottom: 1rem;
  z-index: 100;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  max-width: 60rem;
  margin-inline: auto;
  padding: 1.25rem 1.5rem;
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-pop);
  font-size: var(--step--1);
}
.consent[hidden] { display: none; }
.consent p { flex: 1 1 28rem; margin: 0; }
.consent-actions { display: flex; gap: .5rem; flex-wrap: wrap; }
.consent .btn { min-height: 44px; padding: 0 1.2rem; }

.footer-link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: .18em;
  cursor: pointer;
}
.footer-link-button:hover { color: var(--blue-deep); }

/* ---------- Lomakkeet ---------- */

.form-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 900px) { .form-layout { grid-template-columns: 1fr; } }

.form-panel { padding: clamp(1.25rem, 4vw, 2.5rem); background: var(--white); border: 1px solid var(--rule-soft); border-radius: var(--radius-xl); }

.site-form { display: grid; gap: 1.5rem; }
.form-required-note { margin: 0; font-size: var(--step--1); color: var(--ink-soft); }

.field { display: grid; gap: .4rem; margin: 0; padding: 0; border: 0; min-width: 0; }
.field > label, .field > legend { padding: 0; font-size: .9375rem; font-weight: 600; }
.field > legend { margin-bottom: .6rem; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.field-row[hidden] { display: none; }
.field-optional { font-weight: 400; color: var(--ink-soft); }
@media (max-width: 560px) { .field-row { grid-template-columns: 1fr; } }

.site-form input:not([type="checkbox"]):not([type="radio"]),
.site-form select,
.site-form textarea {
  width: 100%;
  min-height: 52px;
  padding: .75rem 1rem;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}
.site-form textarea { resize: vertical; min-height: 8rem; }
.site-form input:focus-visible, .site-form select:focus-visible, .site-form textarea:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 1px;
  border-color: var(--blue-deep);
}
.site-form [aria-invalid="true"] { border-color: var(--error); }

/* Kohteen sijainnin ehdotukset (lomake.js): kentän levyinen valikko */
.place-combo { position: relative; }
.place-menu { position: absolute; z-index: 20; top: calc(100% + .5rem); left: 0; right: 0; max-height: min(22rem, 60vh); overflow-y: auto; padding: .5rem; background: var(--white); border: 1px solid var(--rule-soft); border-radius: var(--radius-xl); box-shadow: var(--shadow-pop); }
.place-menu[hidden] { display: none; }
.place-menu-title { margin: 0; padding: .4rem .75rem .35rem; font-size: .8125rem; font-weight: 600; letter-spacing: .02em; text-transform: uppercase; color: var(--ink-soft); }
.place-menu ul { display: grid; gap: .15rem; margin: 0; padding: 0; list-style: none; }
.place-option { display: flex; align-items: center; gap: .75rem; padding: .5rem .75rem; border-radius: var(--radius-md); cursor: pointer; }
.place-option-icon { display: grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 50%; background: var(--blue-tint); color: var(--blue-deep); }
.place-option-icon svg { width: 17px; height: 17px; }
.place-option:hover, .place-option[aria-selected="true"] { background: var(--blue-tint); }
.place-option:hover .place-option-icon, .place-option[aria-selected="true"] .place-option-icon { background: var(--blue-deep); color: var(--white); }
.place-option-text { display: grid; gap: .1rem; min-width: 0; }
.place-option-text strong { font-weight: 600; font-size: 1rem; }
.place-option-text strong mark { background: none; color: inherit; font-weight: 800; }
.place-option-text span { font-size: .875rem; color: var(--ink-soft); }
.place-option + .place-menu-title { margin-top: .4rem; padding-top: .8rem; border-top: 1px solid var(--rule-soft); }
.place-option--other .place-option-icon { background: var(--warn-bg); color: var(--warn-ink); }
.place-option--muted .place-option-icon { background: var(--ok-bg); color: var(--ok-ink); }
.place-option--muted .place-option-text span { color: var(--ok-ink); }
.place-option--muted:hover .place-option-icon, .place-option--muted[aria-selected="true"] .place-option-icon { background: var(--ok-ink); color: var(--white); }
.place-option--other .place-option-text span { color: var(--warn-ink); }
.place-option--other:hover, .place-option--other[aria-selected="true"] { background: var(--wall); }
.place-option--other:hover .place-option-icon, .place-option--other[aria-selected="true"] .place-option-icon { background: var(--warn-ink); color: var(--white); }

.choice-list { display: grid; gap: .6rem; }
.choice { display: flex; align-items: flex-start; gap: .7rem; font-weight: 400; cursor: pointer; }
.choice input { width: 1.25rem; height: 1.25rem; margin: .2rem 0 0; flex: none; accent-color: var(--blue-deep); }

.field-hint { margin: 0; font-size: var(--step--1); color: var(--ink-soft); }
.field-note { margin: .25rem 0 0; padding: .75rem 1rem; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn-ink); font-size: var(--step--1); line-height: 1.5; }
.field-note[hidden] { display: none; }
.field-note strong { display: block; }
.field-note { max-width: none; }
.field-note a { color: inherit; font-weight: 600; white-space: nowrap; }
.field-error { margin: 0; font-size: var(--step--1); color: var(--error); }
.field-error:empty { display: none; }
.form-status { margin: 0; min-height: 1.5em; }
.form-status.is-error { color: var(--error); }
.form-privacy { margin: 0; font-size: var(--step--1); color: var(--ink-soft); }
.site-form .btn { justify-self: start; }

/* Piilokenttä botteja varten */
.hp-field { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.form-success { padding: 1rem 0; }
.form-success h2 { margin-bottom: .75rem; }
.form-success p { white-space: pre-line; font-size: var(--step-1); }
.form-success:focus { outline: none; }

.form-aside h2 { font-size: var(--step-2); margin-bottom: 1.5rem; }
.form-aside .note { margin-top: 1rem; }

/* ---------- Hintalaskuri ---------- */

.calc-layout { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: clamp(2rem, 4vw, 3.5rem); align-items: start; }
.calc-form { gap: 1rem; }
.calc-questions { display: grid; gap: 1rem; counter-reset: calc-q; }
.calc-loading, .calc-error { color: var(--ink-soft); }

/* Kysymyskortti */
.calc-question {
  position: relative;
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 1.75rem;
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-lg);
  background: var(--white);
  min-width: 0;
}
.calc-question[hidden] { display: none; }
.calc-question:not([hidden]) { counter-increment: calc-q; }
.calc-question > legend { float: left; width: 100%; padding: 0; }
.calc-question > legend + * { clear: both; }
.calc-head { position: relative; display: flex; gap: 1rem; align-items: flex-start; }
.calc-head > div { padding-top: 3px; }
.calc-head::before {
  content: counter(calc-q);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--white);
  font-size: .875rem;
  font-weight: 700;
  flex: none;
}
.calc-title { display: inline; padding-top: 3px; font-size: 1.1875rem; line-height: 1.3; font-weight: 650; font-stretch: 112%; }
.calc-question .field-hint { margin: .3rem 0 0; font-size: .9375rem; max-width: 60ch; }
.calc-body { padding-left: 48px; display: grid; gap: .25rem; }
@media (max-width: 640px) {
  .calc-question { padding: 1.25rem 0; border: 0; border-bottom: 1px solid var(--rule-faint); border-radius: 0; }
  .calc-head::before { width: 28px; height: 28px; font-size: .8125rem; }
  .calc-title { font-size: 1.125rem; }
  .calc-body { padding-left: 0; }
}

/* Vaihtoehdot */
.option-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .6rem; }
.option-grid--images { grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr)); gap: .75rem; }
@media (max-width: 640px) {
  .option-grid { grid-template-columns: 1fr; }
  .option-grid--images { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
.option { position: relative; display: flex; }
.option-card {
  position: relative;
  display: flex;
  align-items: center;
  gap: .75rem;
  width: 100%;
  min-height: 56px;
  padding: .75rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--white);
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.option--tip .option-card { padding-right: 3rem; }
.option-card:hover { border-color: var(--ink); }
.option-card input { position: absolute; opacity: 0; pointer-events: none; }
.option-card:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: #f7f8f9; }
.option-card:has(input:focus-visible) { outline: 3px solid var(--blue); outline-offset: 2px; }
.option-label { display: flex; gap: .75rem; align-items: center; font-weight: 550; line-height: 1.35; }
.option-label::before {
  content: "";
  flex: none;
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  border-radius: 50%;
}
.option-card:has(input:checked) .option-label::before { background: var(--ink); box-shadow: inset 0 0 0 4px var(--white); }
.option-tip { position: absolute; right: .9rem; top: 50%; transform: translateY(-50%); }

.option-grid--images .option-card { flex-direction: column; align-items: stretch; gap: .6rem; padding: .6rem .6rem .8rem; border-radius: 16px; }
.option-grid--images .option-label { font-size: var(--step--1); font-weight: 600; }
.option-grid--images .option-label::before { display: none; }
.option-image { display: block; aspect-ratio: 1; border-radius: var(--radius-xs); overflow: hidden; background: var(--wall); }
.option-image img { width: 100%; height: 100%; object-fit: contain; }

/* Kappalemäärät */
.quantity-list { display: grid; }
.quantity-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--rule-faint);
}
.quantity-row:last-child { border-bottom: 0; }
.quantity-row label { font-weight: 450; }
.stepper { display: flex; align-items: center; gap: .35rem; flex: none; }
.stepper-btn {
  flex: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--field-border);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.stepper-btn:hover { border-color: var(--ink); }
.site-form .stepper input[type="number"] {
  width: 3.25rem;
  min-height: 44px;
  padding: .4rem .25rem;
  border-color: transparent;
  text-align: center;
  font-size: 1.125rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
}
.site-form .stepper input[type="number"]:hover { border-color: var(--rule); }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* Tooltip */
.tip-btn {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin: -10px -8px -10px -6px;
  padding: 0;
  border: 0;
  background: none;
  vertical-align: middle;
  cursor: pointer;
}
.tip-btn span {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--ink-soft);
  border-radius: 50%;
  background: var(--white);
  color: var(--ink-soft);
  font: italic 700 13px/1 Georgia, serif;
}
.tip-btn:hover span, .tip-btn[aria-expanded="true"] span { border-color: var(--ink); background: var(--ink); color: var(--white); }
.tip {
  position: absolute;
  z-index: 30;
  bottom: calc(100% + 8px);
  left: 0;
  display: grid;
  gap: .6rem;
  width: min(320px, calc(100vw - 2rem));
  padding: .9rem 2.75rem .9rem 1rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-pop);
  font-size: .875rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--ink);
  text-align: left;
}
.tip[hidden] { display: none; }
.tip--below { bottom: auto; top: calc(100% + 8px); }
.option .tip { left: auto; right: 0; }
.tip img { width: 100%; border-radius: var(--radius-xs); background: var(--wall); }
.tip-close {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
}
.tip-close:hover { background: var(--wall); color: var(--ink); }
.tip-close svg { width: 14px; height: 14px; }
@media (max-width: 640px) { .option .tip, .tip { left: 0; right: 0; width: auto; } }

/* Yhteystiedot laskurin jälkeen */
.calc-contact { display: grid; gap: 1.5rem; margin-top: 1.5rem; padding: clamp(1.25rem, 4vw, 2rem); border-radius: var(--radius-lg); background: var(--wall); }
.calc-contact[hidden] { display: none; }
.calc-contact h3 { font-size: 1.5rem; }
.calc-contact .form-required-note { margin-top: -.75rem; }

/* Hintakortti. Kortti mahtuu aina näytön korkeuteen: hinta ja painike pysyvät näkyvissä,
   ja pitkä valintalista vierittyy kortin sisällä. */
.calc-summary {
  position: sticky;
  top: 6.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  max-height: calc(100vh - 8rem);
  max-height: calc(100dvh - 8rem);
  padding: 1.75rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-card);
}
.calc-summary > * { flex: none; }
.calc-summary-label { margin: 0; color: var(--ink-soft); font-size: .9375rem; }
.calc-total { margin: 0; font-size: 3rem; font-weight: 700; font-stretch: 118%; line-height: 1; font-variant-numeric: tabular-nums; }
/* Hinta lasketaan hetken (laskuri.js), ja ilman riittäviä valintoja näytetään kehotus */
.calc-total.is-calculating { font-size: 1.5rem; line-height: 2; color: var(--ink-soft); }
.calc-bar-price .is-calculating { color: var(--ink-soft); font-weight: 600; }
.calc-pending { margin: 0; font-size: .9375rem; color: var(--ink-soft); }
.calc-pending[hidden] { display: none; }
.calc-note { margin: 0; color: var(--ink-soft); font-size: var(--step--1); line-height: 1.5; }
.calc-summary .btn { min-height: 56px; }
/* Valinnat tiiviisti: kysymys vasemmalla, vastaus oikealla */
.calc-summary .calc-choices {
  flex: 0 1 auto;
  min-height: 4rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  margin-right: -.75rem;
  padding-right: .75rem;
}
.calc-choices {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: .45rem 1rem;
  align-content: start;
  margin: 0;
  padding-top: 1rem;
  border-top: 1px solid var(--rule-soft);
  font-size: .8125rem;
  line-height: 1.35;
}
.calc-choices:empty { display: none; }
.calc-choices > strong { grid-column: 1 / -1; margin-bottom: .15rem; font-size: .875rem; }
.calc-choices dt { color: var(--ink-soft); }
.calc-choices dd { margin: 0; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
/* Matalilla näytöillä hintakortti tiiviimmäksi */
@media (max-height: 820px) {
  .calc-summary { top: 5.5rem; max-height: calc(100vh - 6.5rem); max-height: calc(100dvh - 6.5rem); gap: .8rem; padding: 1.25rem 1.4rem; }
  .calc-total { font-size: 2.4rem; }
  .calc-total.is-calculating { font-size: 1.5rem; line-height: 1.6; }
  .calc-summary .btn { min-height: 48px; }
}

.calc-bar { display: none; }

@media (max-width: 900px) {
  .calc-layout { grid-template-columns: 1fr; }
  .calc-summary { position: static; max-height: none; }
  .calc-summary .calc-choices { overflow: visible; margin-right: 0; padding-right: 0; }
  .calc-bar {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 60;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
    padding: .75rem var(--gutter) calc(.75rem + env(safe-area-inset-bottom, 0px));
    background: var(--white);
    border-top: 1px solid var(--rule-soft);
    box-shadow: var(--shadow-bar);
    transform: translateY(110%);
    transition: transform .2s ease-out;
  }
  .calc-bar-price { display: grid; }
  .calc-bar-price span { font-size: .8125rem; color: var(--ink-soft); }
  .calc-bar-price strong { font-size: 1.5rem; font-stretch: 118%; line-height: 1.1; font-variant-numeric: tabular-nums; }
  .calc-bar.is-visible { transform: none; }
  .calc-section { padding-bottom: 7rem; }
}
@media (prefers-reduced-motion: reduce) { .calc-bar { transition: none; } }

/* ---------- Latausanimaatio (assets/js/lataus.js) ---------- */

.loader {
  display: inline-block;
  flex: none;
  width: 3.6em;
  height: 1.5em;
  margin-right: .7em;
  vertical-align: -.4em;
  overflow: hidden;
}
.loader-cable { fill: none; stroke: var(--blue); stroke-width: 2.4; stroke-linecap: round; }
.loader-body { fill: var(--ink); }
.loader-pins { fill: none; stroke: #8a97a3; stroke-width: 2; stroke-linecap: round; }
.loader-socket { fill: var(--blue-deep); }
.loader-spark { fill: none; stroke: var(--earth-y); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: 0; }

@media (prefers-reduced-motion: no-preference) {
  .loader-plug { animation: loader-plug 1.3s cubic-bezier(.65, 0, .35, 1) infinite; }
  .loader-spark { animation: loader-spark 1.3s linear infinite; }
}
/* Ilman animaatioita tulppa näytetään kytkettynä */
@media (prefers-reduced-motion: reduce) {
  .loader-plug { transform: translateX(3px); }
  .loader-spark { opacity: 1; }
}
@keyframes loader-plug {
  0%, 10% { transform: translateX(-6px); }
  45%, 72% { transform: translateX(3px); }
  100% { transform: translateX(-6px); }
}
@keyframes loader-spark {
  0%, 44% { opacity: 0; }
  48%, 66% { opacity: 1; }
  72%, 100% { opacity: 0; }
}

.is-loading { display: inline-flex; align-items: center; color: var(--ink-soft); }

/* Iso, keskitetty lataus näkymille ja lähetyksille */
.loading-block {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1.1rem;
  width: 100%;
  min-height: 14rem;
  padding: 2.5rem 1rem;
  text-align: center;
  font-size: var(--step-1);
  font-weight: 600;
  font-stretch: 105%;
  color: var(--ink);
}
.loading-block .loader { width: min(16rem, 70vw); height: auto; aspect-ratio: 48 / 20; margin: 0; }
.site-form .form-status.loading-block { min-height: 11rem; padding: 1.5rem 0; }

/* Mobiilissa valikko avautuu otsakerivin alle */
@media (max-width: 1180px) { .site-header .nav { order: 3; } }
.split .section-head img { aspect-ratio: 4 / 3; }
.page-hero .wrap.page-facts { display: block; padding-block: 0 clamp(2rem, 5vw, 3rem); }
.page-facts .facts { margin: 0; }

/* Monivalinta (valintaruudut): neliö pyöreän valintapisteen sijaan */
.option-card:has(input[type="checkbox"]) .option-label::before { border-radius: 4px; }

/* Asiakkaan tarjoussivu /tarjous/<tunniste> (assets/js/tarjous.js) */
/* Yläosa tiiviinä: tarjous ja hyväksyntä näkyvät heti (osion oletuspehmuste on iso) */
.quote-hero { padding-block: clamp(1.5rem, 3.5vw, 2.25rem); }
.quote-hero .wrap { display: grid; gap: .75rem; }
.quote-hero .eyebrow { font-size: .875rem; }
.quote-hero h1 { margin: .2rem 0 .35rem; max-width: 30ch; font-size: clamp(1.625rem, 3.2vw, 2.25rem); line-height: 1.12; text-wrap: balance; }
.quote-hero .lead { margin: 0; max-width: 62ch; font-size: 1.0625rem; }
.quote-body { padding-top: clamp(1.75rem, 4vw, 2.5rem); }
.quote-chips { display: flex; flex-wrap: wrap; gap: .6rem; margin: 0; padding: 0; list-style: none; }
.quote-chips li { padding: .35rem .8rem; border-radius: 999px; border: 1px solid var(--rule); background: var(--white); font-size: .875rem; font-weight: 600; }
.quote-preview-note { margin: 0; padding: .75rem 1rem; border-radius: var(--radius-md); background: var(--warn-bg); color: var(--warn-ink); font-weight: 600; }
.quote-thanks { display: flex; gap: 1rem; align-items: flex-start; }
.quote-thanks > .quote-check { width: 2.75rem; height: 2.75rem; }
.quote-layout { display: grid; grid-template-columns: minmax(0, 1fr) 25rem; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
.quote-main { display: grid; gap: 3rem; min-width: 0; }
.quote-main h2 { margin: 0 0 1rem; font-size: clamp(1.5rem, 3vw, 1.75rem); }
.quote-lines { display: grid; }
.quote-line { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--rule-faint); }
.quote-line > span:first-child { display: grid; gap: .2rem; }
.quote-line strong { font-weight: 600; }
.quote-line-detail { color: var(--ink-soft); font-size: .9375rem; }
.quote-line-amount { white-space: nowrap; font-variant-numeric: tabular-nums; }
.quote-line--discount { color: var(--ok-ink); font-weight: 600; }
.quote-line--total { border-bottom: 0; border-top: 1px solid var(--rule-soft); font-size: 1.125rem; font-weight: 700; }
.quote-line--total .quote-line-detail { font-weight: 400; font-size: .875rem; }
.quote-message-text { margin: 0 0 .75rem; padding: 1.5rem; border-radius: var(--radius-lg); background: var(--wall); font-size: 1.0625rem; line-height: 1.6; }
.quote-small { margin: 0; color: var(--ink-soft); font-size: .9375rem; }
.quote-includes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; margin: 0; padding: 0; list-style: none; }
.quote-includes li { display: flex; align-items: center; gap: .75rem; }
.quote-check { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%; background: var(--blue-tint); color: var(--blue-deep); }
.quote-check svg { width: 55%; height: 55%; }
.quote-review { display: grid; gap: .9rem; margin: 0; padding: 2rem; border-radius: var(--radius-lg); border: 1px solid var(--rule-soft); }
.quote-review blockquote { margin: 0; font-size: 1.25rem; line-height: 1.5; font-weight: 500; }
.quote-review figcaption { color: var(--ink-soft); font-size: .875rem; font-weight: 600; }
.quote-terms { padding-top: 1.25rem; border-top: 1px solid var(--rule-soft); }
.quote-terms summary { min-height: 44px; display: flex; align-items: center; font-weight: 650; font-size: 1.125rem; cursor: pointer; }
.quote-terms p { max-width: 62ch; color: var(--ink-soft); line-height: 1.6; }
.quote-side { position: sticky; top: 6rem; display: grid; gap: 1.25rem; padding: 2rem; border-radius: var(--radius-xl); border: 1px solid var(--rule); background: var(--white); box-shadow: var(--shadow-card); }
.quote-sum { display: grid; gap: .35rem; }
.quote-total { font-size: 3rem; line-height: 1; font-weight: 700; font-stretch: 118%; font-variant-numeric: tabular-nums; }
.quote-accept { display: grid; gap: 1rem; }
.quote-check-row { display: flex; gap: .75rem; align-items: flex-start; font-size: .9375rem; line-height: 1.5; cursor: pointer; }
.quote-check-row input { width: 1.375rem; height: 1.375rem; margin: 0; flex: none; accent-color: var(--ink); }
.quote-state { display: flex; gap: .75rem; align-items: center; margin: 0; padding: 1rem; border-radius: var(--radius-md); background: var(--wall); }
.quote-state--ok { background: var(--ok-bg); color: var(--ok-ink); font-weight: 600; }
.quote-state--ok .quote-check { background: var(--white); color: var(--ok-ink); }
.quote-contact { display: grid; gap: 1rem; padding-top: 1.25rem; border-top: 1px solid var(--rule-soft); }
.quote-person { display: flex; align-items: center; gap: .9rem; }
.quote-person img, .quote-avatar { width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex: none; }
.quote-avatar { display: flex; align-items: center; justify-content: center; background: var(--phase); color: var(--white); font-weight: 700; font-size: 1.25rem; }
.quote-person div { display: grid; gap: .15rem; }
.quote-person a { font-weight: 600; }
.quote-message { display: grid; gap: 1rem; max-width: 46rem; }
.quote-message h1 { margin: 0; }
.quote-bar { display: none; }
@media (max-width: 960px) {
  .quote-layout { grid-template-columns: 1fr; }
  .quote-side { position: static; scroll-margin-top: 5rem; }
  .quote-page:has(.quote-bar) { padding-bottom: 5.5rem; }
  .quote-bar { position: fixed; inset: auto 0 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .75rem 1rem calc(.75rem + env(safe-area-inset-bottom)); background: var(--white); box-shadow: 0 -4px 16px rgba(21, 33, 44, .08); }
  .quote-bar div { display: grid; }
  .quote-bar strong { font-size: 1.5rem; font-stretch: 118%; font-variant-numeric: tabular-nums; }
  .quote-bar .btn { flex: 1; max-width: 16rem; }
  .quote-bar.is-hidden { display: none; }
}
@media (max-width: 640px) {
  .quote-includes { grid-template-columns: 1fr; }
  .quote-total { font-size: 2.5rem; }
  .quote-side { padding: 1.5rem; }
}
.quote-pay-choices { display: grid; gap: .6rem; margin: 0; padding: 0; border: 0; }
.quote-pay-choices legend { margin-bottom: .6rem; font-weight: 650; }
.quote-pay-choice { display: flex; gap: .75rem; align-items: flex-start; padding: .9rem 1rem; border-radius: var(--radius-md); border: 1px solid var(--rule); cursor: pointer; }
.quote-pay-choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.quote-pay-choice input { width: 1.25rem; height: 1.25rem; margin: .1rem 0 0; flex: none; accent-color: var(--ink); }
.quote-pay-choice span { display: grid; gap: .15rem; }
.quote-pay-split { display: grid; gap: .5rem; padding: 1rem; border-radius: var(--radius-md); background: var(--wall); font-size: .9375rem; }
.quote-pay-split div { display: flex; justify-content: space-between; gap: 1rem; }
.quote-pay-split div:last-child { color: var(--ink-soft); }
.quote-pay-note { text-align: center; }
.quote-accepted { display: grid; gap: .75rem; }
.quote-accepted .btn, .quote-receipts .btn { justify-content: center; }
.quote-receipts { margin-top: 1.25rem; }
