/* matkavakuutusvertailu.fi
   Ilme: valkoinen pohja, syvä yönsininen teksti, taivaansininen korostus. Edullisin hinta
   korostuskynällä, POP-painikkeet magentalla. Fontti Public Sans (oma kopio). */

@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("fonts/public-sans-latin.woff2") format("woff2-variations");
}

:root {
  --bg: #ffffff; --pinta: #ffffff; --ink: #172033; --muted: #5b6475; --line: #e3e7ee; --line-2: #c9d0db;
  --accent: #155eb8; --accent-soft: #eaf2fc; --soft: #f4f7fb;
  --pop: #d6006f; --pop-dark: #b0005b; --pop-soft: #fdf0f6;
  --mark: #fff09a; --bad: #a3271f; --warn: #7a5200; --focus: #1f5fd1;
  --varjo: 0 1px 2px rgba(23,32,51,.06), 0 12px 32px rgba(21,94,184,.10);
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  color-scheme: light;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.6 "Public Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--accent); text-underline-offset: 3px; text-decoration-thickness: 1px; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.pieni { font-size: .84rem; color: var(--muted); line-height: 1.5; }
.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
mark, .kyna { background: linear-gradient(transparent 55%, var(--mark) 55%, var(--mark) 92%, transparent 92%); color: inherit; padding: 0 .08em; }

/* Yläpalkki */
.yla { background: var(--pinta); border-bottom: 1px solid var(--line); position: relative; z-index: 5; }
.yla .wrap { display: flex; align-items: center; justify-content: space-between; gap: 4px 28px; flex-wrap: wrap; min-height: 62px; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 750; text-decoration: none; color: var(--ink); font-size: 1.08rem; letter-spacing: -.01em; white-space: nowrap; }
.logo svg { width: 26px; height: 26px; flex: none; }
.yla nav { display: flex; gap: 0 22px; overflow-x: auto; white-space: nowrap; font-size: .95rem; scrollbar-width: none; max-width: 100%; }
.yla nav::-webkit-scrollbar { display: none; }
.yla nav a { color: var(--ink); text-decoration: none; padding: 6px 0 4px; display: inline-block; border-bottom: 2px solid transparent; }
.yla nav a:hover { color: var(--accent); }
.yla nav a[aria-current] { border-bottom-color: var(--accent); }

.murupolku { font-size: .84rem; color: var(--muted); margin: 16px 0 0; }
.murupolku a { color: var(--muted); }
h1 { font-size: clamp(2rem, 6.2vw, 3rem); line-height: 1.04; margin: 22px 0 16px; letter-spacing: -.035em; font-weight: 800; }
h2 { font-size: clamp(1.3rem, 3vw, 1.75rem); line-height: 1.2; margin: 0 0 12px; letter-spacing: -.02em; font-weight: 750; }
h3 { font-size: 1.08rem; margin: 22px 0 6px; letter-spacing: -.01em; }
.osio { margin: 56px 0; }
.osio p, .osio li { max-width: 70ch; }
.vastaus { font-size: 1.06rem; }

/* Hero: laskuri + hintataulukko */
.hero-split { display: grid; grid-template-columns: minmax(0, 33rem) minmax(0, 1fr); gap: 24px 64px; align-items: start; }
.hero-side { padding-top: 26px; }
.hero-side h2 { font-size: clamp(1.2rem, 2.4vw, 1.5rem); margin-bottom: 8px; }
.hero-side .vastaus { font-size: 1rem; margin: 0 0 14px; }
@media (max-width: 900px) { .hero-split { grid-template-columns: minmax(0, 1fr); gap: 8px; } .hero-side { padding-top: 34px; } }
@media (max-width: 480px) {
  .wrap { padding: 0 16px; }
  .wizard { padding: 16px 16px 18px; }
  .snap { font-size: .92rem; }
  .snap thead th { padding: 0 4px 8px; white-space: normal; }
  .snap td, .snap th[scope="row"] { padding: 11px 4px; }
  .snap td.num { font-size: .88rem; }
  .snap .rank { width: 1.2rem; }
  .snap .linkki-cta { margin-left: 1.2rem; }
}

/* Laskuri */
.wizard { background: var(--pinta); border: 1px solid var(--line); border-radius: 18px; padding: 18px 22px 22px; box-shadow: var(--varjo); min-height: 400px; display: flex; flex-direction: column; }
.wz-top { display: flex; align-items: center; gap: 14px; min-height: 30px; font-size: .86rem; color: var(--muted); }
.wz-num { white-space: nowrap; }
.wz-prog { flex: 1; height: 4px; background: var(--line); border-radius: 2px; overflow: hidden; }
.wz-prog span { display: block; height: 100%; width: 0; background: var(--accent); transition: width .25s; }
.wz-back { font: inherit; font-weight: 600; background: none; border: 0; color: var(--accent); padding: 4px 0; cursor: pointer; white-space: nowrap; }
.wz-q { border: 0; margin: 14px 0 0; padding: 0; min-width: 0; flex: 1; display: flex; flex-direction: column; }
.wz-q + .wz-q { display: none; }
.wizard.js .wz-q + .wz-q { display: flex; }
.wz-q legend { font-weight: 750; font-size: clamp(1.25rem, 3.6vw, 1.5rem); line-height: 1.25; letter-spacing: -.02em; margin-bottom: 14px; padding: 0; float: left; width: 100%; }
.wz-opts { display: grid; gap: 10px; clear: both; flex: 1; grid-auto-rows: minmax(58px, 1fr); }
.wz-opts button { font: inherit; text-align: left; padding: 12px 16px; border: 1px solid var(--line-2); border-radius: 12px; background: var(--pinta); color: var(--ink); cursor: pointer; display: flex; flex-direction: column; justify-content: center; font-weight: 650; font-size: 1.04rem; line-height: 1.3; transition: border-color .12s, background .12s; }
.wz-opts button small { font-weight: 400; font-size: .86rem; color: var(--muted); margin-top: 2px; }
@media (hover: hover) { .wz-opts button:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); } .wz-opts button:hover small { color: var(--accent); } }
.wz-opts button:active, .wz-opts button[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.wz-tulos { margin-top: 10px; }
.wz-tulos .t-pre { margin: 0; color: var(--muted); font-size: .95rem; }
.wz-tulos .t-pre b { color: var(--ink); }
.t-arvio { font-size: clamp(2.3rem, 8vw, 2.9rem); font-weight: 800; line-height: 1.05; margin: 6px 0 6px; letter-spacing: -.035em; font-variant-numeric: tabular-nums; }
.t-arvio .kyna { padding: 0 .1em; }
.t-arvio small { font-size: 1rem; font-weight: 600; color: var(--muted); letter-spacing: 0; }
.t-selite { font-size: .86rem; color: var(--muted); margin: 0 0 6px; line-height: 1.5; }
.t-list, .t-huom, .t-puute { padding-left: 1.15em; margin: 14px 0 8px; font-size: .96rem; }
.t-list li, .t-huom li, .t-puute li { margin: 3px 0; }
.t-huom li { color: var(--warn); }
.t-puute li { color: var(--bad); font-weight: 600; }
.t-pikku { font-size: .86rem; color: var(--muted); margin: 6px 0 0; }
.t-linkit { font-size: .92rem; margin: 10px 0 4px; }
.wz-alusta { font: inherit; font-size: .9rem; font-weight: 600; background: none; border: 1px solid var(--line-2); border-radius: 999px; padding: 7px 16px; cursor: pointer; color: var(--ink); margin-top: 8px; }

/* Painikkeet */
.cta { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 12px 24px; border-radius: 12px; background: var(--pop); color: #fff; font-weight: 750; font-size: 1.05rem; text-decoration: none; margin-top: 8px; text-align: center; box-shadow: 0 6px 16px rgba(214,0,111,.22); }
.cta::after { content: "→"; font-weight: 600; }
.cta:hover { background: var(--pop-dark); color: #fff; }
.wz-tulos .cta { width: 100%; }
.cta.pieni-cta { min-height: 36px; padding: 6px 12px; font-size: .86rem; margin: 0; border-radius: 9px; box-shadow: none; }
.linkki-cta { font-weight: 700; color: var(--pop); text-decoration: none; white-space: nowrap; }
.linkki-cta::after { content: " →"; }
.linkki-cta:hover { text-decoration: underline; color: var(--pop-dark); }

/* Hintataulukko (hero) */
.snap { width: 100%; border-collapse: collapse; font-size: .98rem; }
.snap thead th { font-size: .8rem; font-weight: 600; color: var(--muted); text-align: left; padding: 0 8px 8px; border-bottom: 1.5px solid var(--ink); white-space: nowrap; }
.snap thead th.num { text-align: right; }
.snap td, .snap th[scope="row"] { padding: 12px 8px; border-bottom: 1px solid var(--line); vertical-align: top; text-align: left; }
.snap th[scope="row"] { font-weight: 650; }
.snap .rank { display: inline-block; width: 1.5rem; color: var(--muted); font-family: var(--mono); font-weight: 400; font-size: .9rem; }
.snap td.num { font-family: var(--mono); font-weight: 600; font-size: 1rem; }
.snap td.num small { font-family: "Public Sans", system-ui, sans-serif; font-weight: 400; font-size: .8rem; color: var(--muted); margin-top: 3px; }
.snap .linkki-cta { display: block; margin: 4px 0 0 1.5rem; font-size: .86rem; }
.snap tr.pop-rivi { background: linear-gradient(90deg, var(--pop-soft), transparent 85%); }
.snap-foot { margin: 10px 0 0; }

/* POP-nosto */
.nosto { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 18px 32px; align-items: center; background: var(--soft); border: 1px solid var(--line); border-radius: 18px; padding: 24px 26px; }
.nosto .merkki { display: inline-block; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--pop); margin-bottom: 6px; }
.nosto h2 { margin-bottom: 12px; }
.nosto .faktat { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px 22px; }
.nosto .faktat li { position: relative; padding-left: 26px; font-size: .97rem; line-height: 1.45; }
.nosto .faktat li::before { content: ""; position: absolute; left: 0; top: .2em; width: 17px; height: 17px; border-radius: 50%; background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.6 2.5L12 5.5' fill='none' stroke='white' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/13px no-repeat; }
.nosto .hinta { text-align: center; min-width: 210px; }
.nosto .hinta b { display: block; font-size: 2.3rem; line-height: 1.05; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.nosto .hinta span { display: block; font-size: .86rem; color: var(--muted); margin: 2px 0 10px; }
.nosto .hinta .cta { width: 100%; }
.nosto .pieni { grid-column: 1 / -1; margin: 0; }
@media (max-width: 760px) { .nosto { grid-template-columns: 1fr; padding: 20px; } .nosto .hinta { text-align: left; } .nosto .hinta .cta { width: 100%; } }

/* Taulukot */
.taulukko { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .93rem; }
.taulukko th, .taulukko td { padding: 12px 10px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.taulukko thead th { font-size: .8rem; font-weight: 600; color: var(--muted); border-bottom: 1.5px solid var(--ink); white-space: nowrap; padding-top: 0; }
.taulukko tbody th { min-width: 9em; font-weight: 650; }
.taulukko tr.pop-rivi { background: var(--pop-soft); }
td small, th small { display: block; color: var(--muted); font-weight: 400; font-size: .8rem; line-height: 1.4; margin-top: 2px; }
.tyhja { color: var(--muted); font-style: italic; }
.lahteet { font-size: .8rem; color: var(--muted); line-height: 1.45; }
.lahteet a { color: var(--muted); }
.lista-muut { padding-left: 1.15em; }

/* Mobiilissa leveät taulukot kortteina */
@media (max-width: 760px) {
  .kortit-mobiili thead { display: none; }
  .kortit-mobiili, .kortit-mobiili tbody, .kortit-mobiili tr, .kortit-mobiili th, .kortit-mobiili td { display: block; width: 100%; }
  .kortit-mobiili tr { border: 1px solid var(--line); border-radius: 14px; padding: 6px 14px 10px; margin: 0 0 12px; background: var(--pinta); }
  .kortit-mobiili tr.pop-rivi { border-color: #f2b8d4; }
  .kortit-mobiili tbody th { font-size: 1.08rem; padding: 10px 0 6px; border-bottom: 1px solid var(--line); min-width: 0; }
  .kortit-mobiili td { display: grid; grid-template-columns: 8.5em minmax(0, 1fr); gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); }
  .kortit-mobiili td:last-child { border-bottom: 0; }
  .kortit-mobiili td::before { content: attr(data-label); font-size: .8rem; color: var(--muted); font-weight: 600; }
  .kortit-mobiili td.toiminto { display: block; padding-top: 10px; }
  .kortit-mobiili td.toiminto::before { content: none; }
  .kortit-mobiili td.toiminto .cta { width: 100%; }
  .kortit-mobiili td.lahteet { display: block; }
  .kortit-mobiili td.lahteet::before { content: none; }
}

/* Usein kysytyt */
.uk { border-top: 1.5px solid var(--ink); padding-top: 18px; }
.uk details { border-bottom: 1px solid var(--line); }
.uk summary { font-weight: 650; cursor: pointer; padding: 14px 32px 14px 0; list-style: none; position: relative; }
.uk summary::-webkit-details-marker { display: none; }
.uk summary::after { content: "+"; position: absolute; right: 4px; top: 10px; font-size: 1.4rem; color: var(--accent); font-weight: 400; }
.uk details[open] summary::after { content: "–"; }
.uk details p { margin: 0 0 16px; }
.luemyos ul { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 10px; }
.luemyos li a { display: block; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; text-decoration: none; font-weight: 650; color: var(--ink); }
.luemyos li a::after { content: " →"; color: var(--accent); }
.luemyos li a:hover { border-color: var(--accent); background: var(--accent-soft); }

.ala { background: var(--soft); border-top: 1px solid var(--line); margin-top: 64px; padding: 30px 0 100px; font-size: .88rem; color: var(--muted); }
.ala .sarakkeet { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.ala ul { list-style: none; padding: 0; margin: 6px 0 0; }
.ala li { margin: 5px 0; }
.ala a { color: var(--muted); }
.ala b { color: var(--ink); }

/* Pieni kiinteä mainospalkki mobiilissa */
.sticky-pop { position: fixed; left: 10px; right: 10px; bottom: 10px; z-index: 20; display: none; align-items: center; gap: 10px; background: var(--pinta); border: 1px solid var(--line); border-radius: 14px; padding: 8px 8px 8px 14px; box-shadow: 0 8px 26px rgba(23,32,51,.18); font-size: .84rem; line-height: 1.3; }
.sticky-pop .sp-teksti { flex: 1; min-width: 0; color: var(--muted); }
.sticky-pop .sp-teksti b { display: block; color: var(--ink); font-size: .9rem; }
.sticky-pop .cta { min-height: 40px; padding: 8px 14px; font-size: .9rem; margin: 0; box-shadow: none; white-space: nowrap; }
.sticky-pop .cta::after { content: none; }
.sticky-pop .sp-sulje { font: inherit; font-size: 1.15rem; line-height: 1; background: none; border: 0; color: var(--muted); padding: 6px 4px; cursor: pointer; }
@media (max-width: 760px) { .sticky-pop.nakyy { display: flex; } }

/* Ehtotaulukko: työpöydällä yhtiöt sarakkeina */
.vain-pieni { display: none; }
@media (max-width: 760px) { .vain-iso { display: none; } .vain-pieni { display: block; } }
.kaannetty { table-layout: fixed; font-size: .9rem; }
.kaannetty thead th { white-space: normal; font-size: 1rem; color: var(--ink); font-weight: 750; vertical-align: bottom; padding: 14px 10px 10px; }
.kaannetty thead th:first-child { width: 11em; }
.kaannetty tbody th { font-size: .8rem; color: var(--muted); font-weight: 600; min-width: 0; }
.kaannetty .pop-sarake { background: var(--pop-soft); }
.kaannetty thead th.pop-sarake { border-radius: 12px 12px 0 0; }
.kaannetty .toimintorivi td { border-bottom: 0; padding-bottom: 16px; }
.kaannetty .toimintorivi td.pop-sarake { border-radius: 0 0 12px 12px; }
.kaannetty td.lahteet a { word-break: break-word; }
.kaannetty td { overflow-wrap: break-word; hyphens: auto; }
.kaannetty .cta.pieni-cta, .snap .cta, td .cta.pieni-cta { white-space: nowrap; }

/* v4: tiivis tulos ilman värikorostuksia */
.wz-tulos .t-pre { margin: 4px 0 0; font-size: .9rem; color: var(--muted); }
.wz-tulos .t-ots { font-size: clamp(1.35rem, 4vw, 1.6rem); margin: 0 0 4px; letter-spacing: -.02em; }
.t-arvio { font-size: clamp(2.2rem, 8vw, 2.7rem); margin: 4px 0 6px; }
.t-rivi { margin: 0 0 2px; font-size: .98rem; }
.wz-tulos .t-list { margin: 10px 0 14px; padding-left: 1.1em; color: var(--ink); }
.t-alin { font-size: .8rem; color: var(--muted); margin: 12px 0 0; display: flex; justify-content: space-between; align-items: baseline; gap: 6px 16px; }
.t-alin > :last-child { white-space: nowrap; }
.t-alin .wz-alusta { border: 0; padding: 0; margin: 0; font-size: .8rem; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-weight: 400; }
