/* Värit: kaikki sivun värit ovat muuttujia tässä. Tummat arvot ovat prefers-color-scheme: dark -lohkossa. */
:root {
  /* Pinnat */
  --page: #f2f4f8;        /* sivun tausta */
  --card: #ffffff;        /* kortit ja otsakepalkki */
  --bg: #fbfcfd;          /* kenttien ja painikkeiden tausta */
  --sel: #e6ecf7;         /* valittu / korostettu rivi */
  --global-bg: color-mix(in srgb, var(--bg) 94%, var(--blue));   /* globaalien valintojen laatikko: bg-väri hieman tummempana ja sinisävyisenä */
  --global-border: color-mix(in srgb, var(--blue) 20%, var(--card));   /* globaalien valintojen laatikon reunus: pääsininen 20 % */
  /* Teksti ja viivat */
  --bodytext: #111;    /* leipätekstin väri (kaikki tekstit) */
  --bodysecondary: #555;  /* toissijainen teksti, esim. "Haetaan…" */
  --muted: #566577;       /* kenttien reunat, ikonit ja apuviivat (ei tekstiä) */
  --line: #d5dce5;
  --track: #e6ebf2;       /* palkkien tausta */
  
  /* Pääväri ja kuvaajien värit */
  --blue: #002c74;
    --blue-50: color-mix(in srgb, var(--blue) 50%, var(--card));   /* pääsininen 50 %, esim. "Muut merkit" -palkki */
    --on-blue: #ffffff;     /* teksti pääväriä vasten */
  --violet: #803481;
  --rose: #ca4978;  
  --orange: #f97864;
  --yellow: #ffb658;
  --green: #00b38b;

  /* Käyttövoimien värit */
  --fuel-electric: #007d59;   /* täyssähkö: vihreä */
  --fuel-phev: #5becc0;       /* ladattava hybridi: turkoosi */
  --fuel-petrol: #ca4978;     /* bensiini: punainen */
  --fuel-diesel: #ffb658;     /* diesel: keltainen */
  --fuel-gas: #002c74;        /* kaasu: sininen */
  /* Muut */
  --focus: #002c74;
  --warn: #CC071E;        /* varoitusväri (esim. korkea hylkäysosuus taulukossa); eri kuin bensiinin punainen */
  --shadow: rgba(0, 0, 0, .18);
}
@media (prefers-color-scheme: dark) {
  :root {
    --page: #0f151c; --card: #172029; --bg: #0f151c; --sel: #223049;
    --bodytext: #e8eef5; --bodysecondary: #94a1b1; --muted: #a3b1c1; --line: #2b3948; --track: #26323f;
    --blue: #7aa7ff; --on-blue: #0f151c; --rose: #7aa7ff; --orange: #ffa05a; --green: #5fcf8d; --violet: #b79bff; --focus: #8ab4ff;
    --fuel-electric: #5fcf8d; --fuel-phev: #4fd1d1; --fuel-petrol: #ff7b7b; --fuel-diesel: #f5c842; --fuel-gas: #7aa7ff;
    --warn: #ff8a80;
    --lamp: #f5c542; --shadow: rgba(0, 0, 0, .18);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--bodytext); font: 400 1rem/1.5 "Inter", system-ui, sans-serif; }
main { max-width: 1600px; margin: 0 auto; padding: 0 24px 48px; }   /* leveys seuraa selainta ja rajoittuu vasta 1600 px:ään; sisältö on valkoisia lohkoja, joiden välissä näkyy sivun taustaväri */
@media (max-width: 959px) { main { padding-left: 12px; padding-right: 12px; } }   /* alle 960 px: sivumarginaali 12 px (24 px leveämmällä) */
@media (max-width: 768px) { main { max-width: none; margin: 0; padding: 0 0 48px; } }   /* mobiilissa lohkot ovat selaimen reunasta reunaan */
h1 { font-size: clamp(1.75rem, 5vw, 2.5rem); line-height: 1.15; margin: 0 0 16px; padding: 32px 24px 0; font-weight: 400; letter-spacing: -.01em; }
h2 { font-size: 1.75rem; line-height: 1.2; margin: 0 0 14px; font-weight: 400; display: flex; align-items: center; gap: 10px; }
a, button, input { font: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.skip { position: absolute; left: -9999px; top: 8px; background: var(--card); color: var(--bodytext); padding: 8px 12px; border-radius: 4px; z-index: 10; }
.skip:focus { left: 8px; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Aluevalinta */
.alue { background: var(--card); padding: 16px 24px; margin-bottom: 24px; }
.alue label { display: block; font-weight: 600; margin-bottom: 6px; }
/* Aluevalinta ja kolme ensimmäistä raporttia ovat samassa valkoisessa laatikossa: raportit ilman omaa korttia, vain värillinen reunaviiva */
/* Leveällä näytöllä kolme raporttia on rinnakkain; muut osiot jäävät niiden alapuolelle */
@media (min-width: 960px) {
  .alue .reports { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; align-items: start; }
  /* Mitä ostetaan: Merkit ja Mallit vierekkäin, sen alla Käyttövoimat ja sähköautojen osuus */
  .kats-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 40px; align-items: start; }
  .new-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: "brand model" "fuel trend" "sales sales"; gap: 0 40px; align-items: start; }
  .n-brand { grid-area: brand; } .n-model { grid-area: model; } .n-fuel { grid-area: fuel; } .n-trend { grid-area: trend; } .n-sales { grid-area: sales; }
}
/* Valintakenttien leveys 300 px; alle 480 px leveällä näytöllä koko leveys */
.combo { width: 300px; max-width: 100%; }
@media (max-width: 480px) { .combo { width: 100%; } }
.alue .report { background: none; border: 0; border-radius: 0; padding: 2px 0; margin: 24px 0 0; }
.combo { position: relative; }
.combo input { width: 100%; min-height: 42px; padding: 8px 88px 8px 12px; color: var(--bodytext); background: var(--bg); border: 1px solid var(--muted); border-radius: 4px; }
.combo .clear, .combo .arrow { position: absolute; top: 0; height: 48px; width: 44px; display: grid; place-items: center; background: none; border: 0; color: var(--bodytext); cursor: pointer; padding: 0; }
.combo .arrow { right: 8px; pointer-events: none; }   /* nuolen oikea reuna 20 px:n päässä reunasta (44 px:n alueessa 20 px:n kuva) */
.combo .clear { right: 50px; }
.combo .clear[hidden] { display: none; }
.combo svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.combo ul { position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px 0; list-style: none; max-height: 340px; overflow: auto; background: var(--card); border: 1px solid var(--muted); border-radius: 4px; box-shadow: 0 8px 24px var(--shadow); }
.combo ul[hidden] { display: none; }
.combo li[role=option] { display: flex; justify-content: space-between; gap: 12px; padding: 10px 14px; min-height: 44px; align-items: center; cursor: pointer; }
.combo li[role=option]:hover { background: var(--sel); }   /* hover: vaaleansininen */
.combo li[role=option][aria-selected=true] { background: var(--sel); font-weight: 600; }   /* valittu: sama tausta + lihavointi, jotta se erottuu hoverista */
.combo li[role=option].act { outline: 2px solid var(--focus); outline-offset: -2px; }
.combo li small { color: var(--bodytext); font-size: .875rem; white-space: nowrap; }
.combo li.grp { padding: 10px 14px 4px; font-size: .8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--bodytext); }
.combo li.none { padding: 12px 14px; color: var(--bodytext); }
.summary { margin: 10px 0 0; color: var(--bodytext); }
.summary b { color: var(--bodytext); font-weight: 600; }

/* Raportit */
.report { background: var(--card); padding: 16px 24px 8px; margin-bottom: 24px; }
.r-brand { --c: var(--blue); } .r-fuel { --c: var(--orange); } .r-age { --c: var(--green); }
.report h2 { color: var(--bodytext); }
.lead { margin: -6px 0 14px; color: var(--bodytext); }
.lead b { color: var(--bodytext); font-weight: 400; }
#c-new-total, #c-new-total b { color: var(--bodysecondary); }   /* "Ostettu … uutta henkilöautoa" toissijaisella värillä, luku lihavoituna */
#c-new-total b { font-weight: 600; }
.bars { list-style: none; margin: 0; padding: 0; }
.bars li { padding: 8px 0 10px; }
.row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; column-gap: 12px; }
.row .v { margin-left: auto; }
.row .n { font-weight: 400; }
.row .v { color: var(--bodytext); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
/* Tilastoluvut tiiviimmiksi */
.row .v, .lead, .summary, .tbl, .rl .rk, .cmp .rk { letter-spacing: -0.3px; }
.row .v b { color: var(--bodytext); font-weight: 400; }
.row .v .u, .row .v b .u, .tbl td .u { font-size: 14px; color: var(--bodysecondary); font-weight: 400; }   /* yksiköt (%, kpl, katsastusta, km/v) */
.track { height: 6px; margin-top: 6px; background: var(--track); border-radius: 2px; overflow: hidden; }
.track i { display: block; height: 100%; background: var(--c); border-radius: 2px; min-width: 2px; transition: width .35s ease; }
.bars li.rest .track i { background: var(--blue-50); }
@media (prefers-reduced-motion: reduce) { .track i { transition: none; } }
/* Merkin logo nimen edessä: yksivärinen SVG piirretään tekstin värillä (toimii myös tummassa teemassa) */
.logo { display: inline-block; flex: none; width: 1.2em; height: 1.2em; margin-right: 6px; vertical-align: -0.22em; background: var(--bodytext); opacity: .85;
  -webkit-mask: var(--l) center / contain no-repeat; mask: var(--l) center / contain no-repeat; }
.logo.none { background: none; }
/* Pitkät listat: haku ja "Näytä lisää" */
/* Hakukentät: harmaa hakuikoni kentän sisällä oikealla (kertoo, että kenttä on hakukenttä) */
.rl-s { position: relative; width: 300px; max-width: 100%; margin: 0 0 10px; }
.rl-s input { width: 100%; min-height: 42px; padding: 8px 48px 8px 12px; color: var(--bodytext); background: var(--bg); border: 1px solid var(--muted); border-radius: 4px; }
.sicon { position: absolute; right: 16px; top: 50%; width: 20px; height: 20px; margin-top: -10px; fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.rl-m { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 6px 0 8px; }
.rl-m:empty { margin: 0; }
.rl { overflow-anchor: none; }   /* sivu ei hypi, kun lista kasvaa */
.rl .rk { display: inline-block; margin-right: 2px; text-align: left; color: var(--bodytext); font-weight: 400; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .rl-s { width: 100%; } }
.r-new, .r-kats { --c: var(--blue); }
.report h2.sub { display: block; font-size: 1.5rem; line-height: 1.25; margin: 18px 0 8px; font-weight: 400; }
.report h2.sub:first-of-type { margin-top: 4px; }
.new-grid { margin-top: 4px; }
.new-grid .cell { margin-bottom: 40px; }
.report h3 { font-size: 1.2rem; font-weight: 400; margin: 24px 0 4px; color: var(--bodytext); }
.two { display: grid; grid-template-columns: 1fr; gap: 0 32px; }
@media (min-width: 720px) { .two { grid-template-columns: 1fr 1fr; } }
.tblwrap { overflow-x: auto; margin: 0 0 14px; }
.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl caption { text-align: left; color: var(--bodytext); padding: 4px 0 6px; }
.tbl th, .tbl td { padding: 8px 10px; border-top: 1px solid var(--line); text-align: right; white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; padding-left: 12px; }
.tbl th:last-child, .tbl td:last-child { padding-right: 12px; white-space:normal; }
.tbl th:first-child, .tbl th:last-child { white-space:normal; }
.tbl thead th { border-top: 0; font-weight: 600; background: var(--sel); padding-top: 12px; padding-bottom: 12px; }   /* otsikkorivi vaaleansinisellä taustalla */
.tbl tbody th { font-weight: 400; }
.tbl tbody tr:hover { background: var(--page); }   /* hover: sivun taustaväri */
.r-cmp { --c: var(--violet); }
.ctl { display: flex; flex-wrap: wrap; gap: 12px 16px; margin: 0 0 12px; }
.ctl > div { flex: 0 1 300px; min-width: 0; }
@media (max-width: 480px) { .ctl > div { flex-basis: 100%; } }
.ctl label { display: block; font-weight: 600; margin-bottom: 4px; }
.ctl .lbl { font-weight: 600; margin-bottom: 4px; }
/* Segmentoitu valitsin: vaihtoehdot vierekkäin, yksi valittuna (radiopainikkeet, näppäimistö ja ruudunlukija toimivat) */
.seg { display: flex; border: 1px solid var(--muted); border-radius: 4px; overflow: hidden; }
.ctl .seg label { flex: 1 1 0; position: relative; margin: 0; font-weight: 400; cursor: pointer; }
.seg + .seg, .seg label + label { border-left: 1px solid var(--muted); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { display: flex; align-items: center; justify-content: center; min-height: 41px; padding: 0 16px; color: var(--bodytext); background: var(--bg); }
.seg input:checked + span { background: var(--blue); color: var(--on-blue); }
.seg input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: -3px; }
.seg input:checked:focus-visible + span { outline-color: var(--on-blue); }   /* valittu segmentti on pääsininen, joten rengas oman värinsä (--focus) olisi näkymätön */
.seg label:hover input:not(:checked) + span { background: var(--sel); }
.ctl select { width: 100%; min-height: 48px; padding: 8px 12px; color: var(--bodytext); background: var(--bg); border: 1px solid var(--muted); border-radius: 4px; }
/* Natiivi select (mobiili): oma nuoli irti reunasta, väri muuttujasta */
.ctl select { -webkit-appearance: none; appearance: none; padding-right: 48px; background-repeat: no-repeat; background-size: 6px 6px, 6px 6px; background-position: right 25px center, right 19px center;
  background-image: linear-gradient(45deg, transparent 50%, var(--bodytext) 50%), linear-gradient(135deg, var(--bodytext) 50%, transparent 50%); }
.combo input[aria-expanded=true] ~ .arrow svg { transform: rotate(180deg); }
/* Valintavalikko (enhanceSelect): sama .combo-komponentti, vain luettava kenttä. Desktopissa se korvaa natiivin selectin */
.ctl .combo.sc { width: 100%; }
.combo.sc input { padding-right: 48px; cursor: pointer; caret-color: transparent; text-overflow: ellipsis; }
.combo.sc li[role=option] { justify-content: flex-start; }
/* Oma valikko vain hiirellä ja tarkalla osoittimella; kosketuslaitteilla (puhelin, tabletti) natiivi select */
@media (hover: hover) and (pointer: fine) { select.has-sc { display: none; } }
@media (hover: none), (pointer: coarse) { .combo.sc { display: none; } }
/* Kapea valinta (esim. vuosi): lyhyt sisältö, joten pienempi leveys */
.ctl > div.narrow { flex: 0 1 160px; }
/* Globaalit valinnat (Mitä ostetaan: Vuosi, Millä ajetaan: Alue): leveämmät ja 2 px pääsininen reunus, jotta ne erottuvat koko näkymää ohjaavina */
.ctl > div.global { flex: 0 1 560px; }
.ctl > div.global.narrow { flex: 0 1 160px; }   /* globaali, mutta kapea (esim. katsastusvuosi) */
.ctl > div.global.w300 { flex: 0 1 300px; }
.alue .combo { width: 560px; max-width: 100%; }
.alue .combo input, .ctl .global .combo.sc input, .ctl .global select { border: 2px solid var(--blue); }
@media (max-width: 480px) { .ctl > div.global, .ctl > div.global.narrow, .ctl > div.global.w300, .ctl > div.narrow { flex-basis: 100%; } .alue .combo { width: 100%; } }
.cmp .rk { display: inline-block; min-width: 2.2em; color: var(--bodytext); font-weight: 400; font-variant-numeric: tabular-nums; }
.more { min-height: 44px; padding: 0 16px; border: 2px solid var(--blue); border-radius: 25px; background: var(--card); color: var(--blue); cursor: pointer; }
ol.bars { list-style: none; margin: 0; padding: 0; }
#cmp-pick { margin: 0 0 12px; }
#cmp-pick label { display: block; font-weight: 600; margin-bottom: 4px; }
.chips { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.chips button { min-height: 44px; padding: 0 12px 0 14px; display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--blue); border-radius: 20px; background: var(--card); color: var(--blue); cursor: pointer; }
.chips svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
/* Latausanimaatio: pyörivä auton ratti ja teksti */
.loader { display: flex; align-items: center; gap: 10px; padding: 4px 0 14px; color: var(--bodysecondary); }
.loader svg { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loader .dots i { font-style: normal; opacity: 0; animation: 1.4s linear infinite; }
.loader .dots i:nth-child(1) { animation-name: dot1; }
.loader .dots i:nth-child(2) { animation-name: dot2; }
.loader .dots i:nth-child(3) { animation-name: dot3; }
@keyframes dot1 { 0%, 9% { opacity: 0; } 10%, 89% { opacity: 1; } 90%, 100% { opacity: 0; } }
@keyframes dot2 { 0%, 39% { opacity: 0; } 40%, 89% { opacity: 1; } 90%, 100% { opacity: 0; } }
@keyframes dot3 { 0%, 69% { opacity: 0; } 70%, 89% { opacity: 1; } 90%, 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .loader svg { animation: none; } .loader .dots i { animation: none; opacity: 1; } }
.busy, .err { padding: 6px 0 14px; color: var(--bodytext); }
.err { color: var(--bodytext); }
.err button { margin-left: 8px; min-height: 44px; padding: 0 16px; border: 2px solid var(--blue); border-radius: 20px; background: var(--card); color: var(--blue); cursor: pointer; }
.more:hover, .err button:hover, .chips button:hover { background: var(--sel); }   /* sama hover-väri kuin pudotusvalikoissa */
.src-top { margin: 0 0 16px; font-size: .9375rem; color: var(--bodysecondary); }
.src a { color: var(--blue); text-decoration: underline; }
.src { color: var(--bodytext); font-size: .9375rem; margin: 8px 0 0; padding: 0 16px; }

/* Headerpalkki (väliaikainen nimi ja logo) */
/* Otsikkopalkki on samanlevyinen valkoinen lohko kuin sisältö (sisällön leveys = main − sivumarginaalit) */
.site { padding: 0 24px; }
.site .in { max-width: 1552px; margin: 0 auto; padding: 0 16px; min-height: 60px; display: flex; align-items: center; background: var(--card); border-bottom: 1px solid var(--line); }
@media (max-width: 959px) { .site { padding: 0 12px; } }   /* sama sivumarginaali kuin sisällöllä */
@media (max-width: 768px) { .site { padding: 0; } .site .in { max-width: none; } }
.brand { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--bodytext); text-decoration: none; font-size: 1.25rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
/* Välilehdet */
.tabs { display: flex; gap: 4px; padding: 0 6px; margin: 12px 0 0; background: linear-gradient(var(--track), var(--track)) bottom / 100% 6px no-repeat; overflow-x: auto; overflow-y: hidden; scrollbar-width: thin; }
/* Desktop: välilehtien ja pääotsikon teksti alkaa samasta kohdasta kuin lohkojen reuna */
@media (min-width: 769px) { .tabs { padding: 0; } h1 { padding-left: 0; padding-right: 0; } }
.tabs [role=tab] { flex: 0 0 auto; white-space: nowrap; min-height: 64px; padding: 0 40px; background: none; border: 0; border-bottom: 6px solid transparent; color: var(--blue); cursor: pointer; font-size: 1.25rem; font-weight: 600; }
.tabs [role=tab][aria-selected=true] { border-bottom-color: var(--blue); }
.tabs [role=tab][aria-selected=false]:hover { border-bottom-color: var(--line); }
@media (max-width: 768px) { .tabs { gap: 0; padding: 0; } .tabs [role=tab] { flex: 1 1 0; justify-content: center; text-align: center; white-space: normal; line-height: 1.2; padding: 0 4px; font-size: 1rem; font-weight: 600; } }   /* mobiilissa välilehdet jakavat rivin kolmeen yhtä leveään osaan, teksti keskitettynä */
[role=tabpanel]:focus { outline: none; }
[role=tabpanel]:focus-visible { outline: 3px solid var(--focus); outline-offset: 4px; }
main:focus { outline: none; }

/* Alle 960 px: valkoisten lohkojen sivupadding 16 px; mobiilissa pääotsikko samalle linjalle lohkojen tekstin kanssa */
@media (max-width: 959px) { .report, .alue { padding-left: 16px; padding-right: 16px; padding-top:0; padding-bottom:0; } }
@media (max-width: 768px) { h1 { padding-left: 16px; padding-right: 16px; } }

/* Globaalit valinnat vaaleansinisessä laatikossa */
.global-box { background: var(--global-bg); border: 1px solid var(--global-border); padding: 16px; margin: 0 0 24px; border-radius: 4px; }
.alue .global-box { margin-bottom: 0; }

/* Mallit/merkit-haku sijaitsee Taso-valinnan oikealla puolella; kaksikko siirtyy rivinvaihdossa yhtenä kokonaisuutena */
.ctl > .ctl-pair { flex: 0 1 616px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 16px; min-width: 0; max-width: 100%; }
.ctl-pair > div { flex: 0 1 300px; min-width: 0; }
.ctl-pair > .ctl-search:empty { display: none; }
.ctl-search .rl-s { margin: 0; }
@media (max-width: 480px) { .ctl > .ctl-pair { flex-basis: 100%; } .ctl-pair > div { flex-basis: 100%; } }

/* Järjestysvalinta yhden listan yläpuolella (esim. Vähiten / Eniten hylättyjä) */
.rl-sort-wrap { margin: 0 0 14px; }
.rl-sort-wrap .lbl { font-weight: 600; margin-bottom: 4px; }
.rl-sort { max-width: 420px; }
.rl-sort label { flex: 1 1 0; position: relative; margin: 0; font-weight: 400; cursor: pointer; }

/* Taulukon otsikko (H3) ja sen alla toissijainen selite */
.tbl-title { font-size: 1rem; font-weight: 400; margin: 16px 0 4px; color: var(--bodytext); }
.note { margin: 0 0 8px; font-size: .9375rem; color: var(--bodysecondary); }

.kats-grid .cell { min-width: 0; margin-bottom: 24px; }

/* Leveimmillä näytöillä (≥1280 px) vuosittainen ostotilasto on vain puolet leveydestä (vasen sarake) */
@media (min-width: 1280px) { .new-grid { grid-template-areas: "brand model" "fuel trend" "sales ."; } }

.tbl td.warn { color: var(--warn); }

/* Valinta, jonka leveys määräytyy sisällön mukaan (teksti pysyy yhdellä rivillä) */
.ctl > div.fit { flex: 0 1 auto; }
.ctl .fit .seg label { flex: 1 1 auto; white-space: nowrap; }

/* Välilehdet ovat linkkejä (haettavat osoitteet), joten linkin oletustyylit poistetaan */
.tabs a[role=tab] { display: flex; align-items: center; text-decoration: none; }

/* Otsikko (H1) on valkoisen sisältöalueen ensimmäinen elementti: välilehtirivin alla alue alkaa otsikosta ja sen selitteestä */
.report > h1, .alue > h1 { padding: 24px 0 12px 0; margin: 0 0 8px; }

/* Alle 768 px: segmentoitujen valintojen teksti 14 px */
@media (max-width: 767px) {
  .seg span { font-size: 14px; }
  /* Segmentoidut valinnat eivät veny koko leveydelle: leveys määräytyy tekstien mukaan, vaihtoehdot yhtä leveitä */
  .seg { display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; width: fit-content; max-width: 100%; }
}

/* Mobiili: h2-otsikoiden yläväli 32 px, paitsi kunkin näkymän ensimmäinen h2 */
@media (max-width: 768px) {
  :is(#p-uutena, #p-ajetaan, #p-katsastus) h2:not(#h-new-brand, #h-brand, #h-k-model) { margin-top: 32px; }
}

/* Ajoneuvon ikä ja käyttövoima -osio alkaa haalealla poikkiviivalla */
#h-k-fuel { margin-top: 0px; padding-top: 24px; border-top: 1px solid var(--line); }

/* Hylkäysprosenttigraafi roosalla */
#c-k-rej { --c: var(--rose); }

/* Mitä ostetaan: Mallit violetilla */
#c-new-model { --c: var(--violet); }

/* Tabien tekstit: pidemmät yli 768 px, lyhyet mobiilissa */
.tabs .t-l { display: none; }
@media (min-width: 769px) { .tabs .t-s { display: none; } .tabs .t-l { display: inline; } }

/* Logo: tekstilogo (SVG), väri pääsininen */
.brand { color: var(--blue); }
.brand svg { display: block; height: 28px; width: auto; }

/* Otsikon yleiskuvaus logon vieressä; mobiilissa logon alla */
.site .tagline { margin: 0 0 0 24px; color: var(--bodysecondary); font-size: 1rem; line-height: 1.3; }
@media (max-width: 768px) {
  .site .in { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .site .tagline { flex-basis: 100%; margin: 6px 0 0; font-size: .875rem; }
}

/* Valkoinen headerpalkki koko leveydelle; sisältö pysyy paikallaan */
.site { background: var(--card); border-bottom: 1px solid var(--line); }
.site .in { background: none; border-bottom: 0; }

/* Katsastusta-selite: alle 480 px lyhenne */
.uk-s { display: none; }
@media (max-width: 480px) { .uk-l { display: none; } .uk-s { display: inline; } }


/* Mallilistan "Viat ▾" -linkki ja avautuva vikataulukko */
.vlink { background: none; border: 0; padding: 12px 0 12px 2px; margin: -12px 0; color: var(--blue); cursor: pointer; text-decoration: none; font-size: 1rem; }
.vlink:hover { color: color-mix(in srgb, var(--blue) 70%, var(--bodytext)); }
.vlink svg { width: 14px; height: 14px; margin-left: 2px; vertical-align: -2px; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.vlink[aria-expanded=true] svg { transform: rotate(180deg); }
.vpanel { margin: 8px 0 4px; padding: 4px 0 8px 12px; border-left: 3px solid var(--line); }
.vpanel .note { margin: 4px 0 6px; }
.vpanel { --c: var(--orange); }
@media (prefers-reduced-motion: reduce) { .vlink svg { transition: none; } }

/* Vikatilasto (Viat-haitari): ohuempi palkki ja tiiviimmät rivit */
.vpanel .track { height: 4px; }
.vpanel .bars li { padding: 6px 0 8px; }

/* Vikatilaston sarakeotsikot katsastusmäärän alla: "Vian syy" vasemmalla, "Vikoja" oikeassa reunassa (leipätekstin väri, semibold) */
.vhead { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: .9375rem; }
.vhead .vk { color: var(--bodytext); font-weight: 600; }

/* Vikatilasto alle 480 px: vian syy rivittyy omassa palstassaan ja luvut pysyvät samalla rivillä oikeassa reunassa */
@media (max-width: 480px) {
  .vpanel .row { flex-wrap: nowrap; align-items: baseline; }
  .vpanel .row .n { flex: 1 1 0; min-width: 0; }
  .vpanel .row .v { flex: 0 0 auto; }
}

/* Vikatilasto: pääkohteet avattavina, tarkemmat kohteet sisennettynä */
.cbtn { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.cbtn svg { width: 14px; height: 14px; margin-left: 4px; vertical-align: -2px; fill: none; stroke: var(--blue); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; transition: transform .15s; }
.cbtn[aria-expanded=true] svg { transform: rotate(180deg); }
.vpanel .subs { margin: 0 8px 4px 24px; padding: 0; }
.vpanel .subs > li { padding: 4px 0; }
@media (prefers-reduced-motion: reduce) { .cbtn svg { transition: none; } }

/* Mallirivi, jolla on Viat-linkki: koko rivi on klikattava; hover taulukon rivin värillä vain tekstirivillä (graafin levyinen, ei palkin päällä eikä alla) */
.row.rx { cursor: pointer; padding: 15px 8px 4px; margin: -15px 0 -6px; }   /* korkeampi hover-alue ylöspäin; tekstin ja palkin paikat eivät muutu (3 px väli edelliseen palkkiin) */
.rl-b > .bars > li:first-child .row.rx { padding-top: 8px; margin-top: -8px; }   /* listan ensimmäinen: ei ulos listan yläreunasta */   /* hover-alue on graafin levyinen ja alareuna kiinni graafissa */
@media (hover: hover) { .row.rx:hover, .row.rc:hover { background: var(--page); } }

/* Vikakategoria: koko rivi on accordion-linkki; hover graafin levyinen ja kiinni kategorian palkissa, 3 px väli edelliseen */
.row.rc { cursor: pointer; padding: 11px 8px 4px; margin: -11px 0 -6px; }
.vpanel .bars > li.cat:first-child > .row.rc { padding-top: 6px; margin-top: -6px; }   /* ensimmäinen: ei otsikkorivin päälle */

/* Tarkat vikasyyt (alakohteet): 15 px eli hieman kategorian nimeä pienempi */
.vpanel .subs .row { font-size: 15px; }

/* Välilehden focus-rengas sisäpuolelle: .tabs leikkaa (overflow) ulkopuolelle jäävän renkaan */
.tabs [role=tab]:focus-visible { outline-offset: -3px; }

/* Haettava combobox (Alueiden vertailu): tekstikursori ja tekstikursori-osoitin */
.combo.sc.srch input { cursor: text; caret-color: auto; }

/* Alueiden vertailun sarakeotsikot (sama tyyli kuin vikatilastossa) */
#c-cmp .vhead { margin: 4px 0 2px; }

/* Käyttövoiman lista alkaa samalta tasolta kuin iän lista (iällä on keski-ikärivi): piilotettu rivi vain kolmen sarakkeen näkymässä */
.lead-sp { display: none; }
@media (min-width: 960px) { .lead-sp { display: block; visibility: hidden; } }
.vhead .vk-s { display: block; font-size: 14px; font-weight: 400; color: var(--bodysecondary); text-align: right; }   /* vertailun mitan tarkennus: osuus alueen omista autoista */

/* "Lisää vertailuun alue" -combobox: leveämpi kenttä, jotta paikkamerkki mahtuu; valintanuoli oikealla */
.combo.cmp-add { width: 420px; max-width: 100%; margin: 0 0 10px; }
.combo.cmp-add input { padding-right: 48px; }
