/* Uusi etusivu (testiversio /uusi) */
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.doc:has(.nh) { max-width: 1280px; }
.nh { display: grid; gap: 14px; }
.nh-side { display: grid; gap: 12px; align-content: start; }
.nh h1 { margin: 0 !important; }
.nh-test { margin: 0; font-size: .88rem; background: var(--warn-bg); color: var(--warn-ink); padding: 8px 12px; border-radius: 8px; }
.nh-test a { color: inherit; font-weight: 600; }

.nh-search { display: flex; gap: 8px; }
.nh-combo { position: relative; flex: 1; min-width: 0; }
.nh-combo input { width: 100%; box-sizing: border-box; min-height: 46px; padding: 0 12px; font: 1rem "Barlow", sans-serif;
  border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.nh-combo input:focus { outline: 3px solid var(--focus); outline-offset: 1px; }
.nh-menu { position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px 0; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 20px rgba(21,33,44,.18);
  max-height: 320px; overflow: auto; }
.nh-menu li { padding: 10px 12px; cursor: pointer; }
.nh-menu li[aria-selected="true"], .nh-menu li:hover { background: var(--bg); }
.nh-loc { display: inline-flex; align-items: center; gap: 6px; min-height: 46px; padding: 0 14px; border: 1px solid var(--sign);
  border-radius: 10px; background: var(--surface); color: var(--sign); font: 600 .95rem "Barlow", sans-serif; cursor: pointer; white-space: nowrap; }
.nh-loc:hover { background: var(--sign); color: var(--sign-ink); }
.nh-err { margin: -4px 0 0; font-size: .9rem; color: var(--busy); }
.nh-err:empty { display: none; }

.nh-filters { display: flex; gap: 10px 14px; align-items: center; flex-wrap: wrap; }
.nh-seg { display: flex; gap: 6px; }
.nh-seg button { font: 600 .95rem "Barlow", sans-serif; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; }
.nh-seg button[aria-pressed="true"] { background: var(--ink); color: var(--surface); border-color: var(--ink); }
.nh-check { display: inline-flex; align-items: center; gap: 8px; font-weight: 500; min-height: 40px; cursor: pointer; }
.nh-check input { width: 18px; height: 18px; accent-color: var(--sign); }

.nh-hero .hero-mini { margin: 0; }
.nh-hero .note { margin: 2px 0 0; }
.nh-act { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.nh-act .btn, .nh-act .btn-sec { min-height: 44px; display: inline-flex; align-items: center; }
.nh-hint p:last-child { color: var(--muted); }

.nh-mapsec { display: grid; gap: 6px; }
.nh-mapbox { position: relative; }
.nh-map { height: 380px; border-radius: var(--radius-lg); border: 1px solid var(--line); overflow: hidden; background: var(--line); }
.nh-full { position: absolute; left: 10px; top: 10px; z-index: 3; display: inline-flex; align-items: center; gap: 6px;
  min-height: 40px; padding: 0 12px; border: 0; border-radius: 8px; background: #fff; color: #15212c;
  font: 600 .9rem "Barlow", sans-serif; box-shadow: 0 1px 4px rgba(21,33,44,.3); cursor: pointer; }
.nh-zoomhint { position: absolute; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 2; margin: 0;
  background: #15212c; color: #fff; border-radius: 999px; padding: 7px 14px; font-size: .88rem; font-weight: 600;
  white-space: nowrap; pointer-events: none; }
.nh-mapbox.full { position: fixed; inset: 0; z-index: 100; background: var(--bg); }
.nh-mapbox.full .nh-map { height: 100%; border-radius: 0; border: 0; }
html.nh-lock, html.nh-lock body { overflow: hidden; }

.nh-legend { margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; font-size: .85rem; color: var(--muted); }
.nh-legend .lg { display: inline-block; min-width: 22px; height: 14px; box-sizing: border-box; border-radius: 999px; border: 2px solid;
  margin-left: 10px; vertical-align: -2px; font: 700 .7rem/10px "Barlow", sans-serif; text-align: center; padding: 0 4px; }
.nh-legend .lg.best { box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0a5ca8; margin: 0 4px 0 14px; }
.nh-legend .lg:first-child { margin-left: 0; }
.lg.ok { background: #1b7f4f; border-color: #1b7f4f; color: #fff; }
.lg.busy { background: #fff; border-color: #b06a00; color: #15212c; }
.lg.unk { background: #fff; border-color: #8a939b; color: #5b6874; }

/* hintamerkit */
/* Ei position-arvoa: MapLibre sijoittaa merkin itse (position: absolute). Oma arvo siirtäisi merkit väärille paikoille. */
.nhpin { font: 700 13px/1.25 "Barlow", sans-serif; font-variant-numeric: tabular-nums; padding: 2px 7px;
  border-radius: 999px; border: 2px solid; cursor: pointer; white-space: nowrap; box-shadow: 0 1px 3px rgba(21,33,44,.3); }
.nhpin::after { content: ""; position: absolute; left: 50%; bottom: -8px; transform: translateX(-50%);
  border: 5px solid transparent; border-top: 6px solid; border-top-color: inherit; border-bottom: 0; }
.nhpin.ok { background: #1b7f4f; border-color: #1b7f4f; color: #fff; }
.nhpin.busy { background: #fff; border-color: #b06a00; color: #15212c; }
.nhpin.unk { background: #fff; border-color: #8a939b; color: #5b6874; }
.nhpin.noprice { font-weight: 600; font-size: 12px; }
.nhpin.best { font-size: 15px; padding: 3px 9px; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #0a5ca8; z-index: 5; }
.nhpin:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.nh-pn { color: #5b6874; }

.nh-listsec { margin: 0; }
.nh-listsec .cheapmore { margin-top: 10px; }

/* tietokone: lista ja suositus vasemmalla, kartta oikealla */
@media (min-width: 1000px) {
  .nh { grid-template-columns: 420px 1fr; grid-template-areas: "side map" "list map"; column-gap: 20px; align-items: start; }
  .nh-side { grid-area: side; }
  .nh-listsec { grid-area: list; }
  .nh-mapsec { grid-area: map; position: sticky; top: 12px; }
  .nh-map { height: calc(100vh - 60px); min-height: 520px; }
}

/* asetukset */
.nh-setbtn { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 12px; margin-left: auto;
  border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink);
  font: 600 .95rem "Barlow", sans-serif; cursor: pointer; }
.nh-setbtn[aria-expanded="true"] { border-color: var(--ink); }
.nh-settings { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 12px 14px;
  display: grid; gap: 6px; }
.nh-settings[hidden] { display: none; }
.nh-members { border: 0; margin: 6px 0 0; padding: 10px 0 0; border-top: 1px solid var(--line); display: grid; gap: 2px; }
.nh-members legend { font-weight: 600; padding: 0; margin-bottom: 4px; }
#nhMemberList { display: grid; }
.nh-help { margin: 0; font-size: .85rem; color: var(--muted); font-weight: 400; }
.nh-members .nh-check .nh-help { margin-left: 4px; }
.nh-settings .btn-sec { justify-self: start; margin-top: 6px; }
.nh-active { margin: -2px 0 0; font-size: .9rem; color: var(--sign); font-weight: 600; }
.nh-active[hidden] { display: none; }
.nh-mtag { font: 600 .8rem "Barlow", sans-serif; color: var(--sign); background: var(--bg); border-radius: 4px; padding: 1px 6px;
  vertical-align: 2px; white-space: nowrap; }
.nhpin.mem::before { content: ""; position: absolute; right: -4px; top: -4px; width: 9px; height: 9px; border-radius: 50%;
  background: #0a5ca8; border: 2px solid #fff; }
.nhpin.closed { opacity: .75; border-style: dashed; }

/* valittu asema ja laskuri */
.nh-hhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.nh-back, .nh-calcl { background: none; border: 0; padding: 4px 0; color: var(--sign); font: 500 .88rem "Barlow", sans-serif;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.nh-calcl.go { text-decoration: none; }
.nh-calcl.go:hover { text-decoration: underline; }
.nh-plinks { display: flex; gap: 14px; align-items: center; }
.nh-act button.btn-sec { cursor: pointer; font: 600 .95rem "Barlow", sans-serif; }
.nh-calc { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.nh-calc[hidden] { display: none; }
.nh-kwhrow { display: grid; gap: 6px; }
.nh-kl { font-weight: 600; font-size: .95rem; }
.nh-kwh { display: flex; gap: 6px; flex-wrap: wrap; }
.nh-kwh button { font: 600 .95rem "Barlow", sans-serif; min-height: 40px; padding: 0 12px; border-radius: 8px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; font-variant-numeric: tabular-nums; }
.nh-kwh button[aria-pressed="true"] { background: var(--sign); color: var(--sign-ink); border-color: var(--sign); }
.nh-range { display: grid; gap: 2px; font-size: .9rem; color: var(--muted); }
.nh-range input { width: 100%; accent-color: var(--sign); }
.nh-total { margin: 0; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.nh-total b { font: 700 2rem/1 "Barlow Semi Condensed", sans-serif; font-variant-numeric: tabular-nums; }
.nh-total span { color: var(--muted); }
.nh-parts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px 14px; }
.nh-parts div { display: grid; }
.nh-parts dt { font-size: .82rem; color: var(--muted); }
.nh-parts dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.nh-range { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; color: var(--ink); }
.nh-kv { display: inline-flex; align-items: baseline; gap: 8px; }
.nh-kv output { font: 700 1.25rem "Barlow Semi Condensed", sans-serif; font-variant-numeric: tabular-nums; }
.nh-kv span { color: var(--muted); font-size: .9rem; }
#nhKwhR { width: 100%; height: 32px; accent-color: var(--sign); margin: -4px 0 0; }
.nh-members .nh-check { min-height: 44px; }
/* latauskerran hinnat */
.nh-mode { display: flex; justify-content: space-between; align-items: center; gap: 4px 12px; flex-wrap: wrap;
  background: var(--sign); color: var(--sign-ink); border-radius: 10px; padding: 8px 12px; font-size: .95rem; }
.nh-mode[hidden] { display: none; }
.nh-mode .nh-back { color: inherit; font-weight: 600; }
.nh-cmp { justify-self: start; cursor: pointer; font: 600 .95rem "Barlow", sans-serif; min-height: 44px; }
.nh-cmpon { margin: 0; font-size: .9rem; color: var(--sign); font-weight: 600; }
.nh-tsub { color: var(--muted); font-size: .9rem; }
.nh-res { display: grid; gap: 10px; }
.nh-switch { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 10px 12px; border: 1px solid var(--line);
  border-radius: 10px; background: var(--bg); font-weight: 600; }
.nh-switch input { appearance: none; flex: none; width: 40px; height: 24px; margin: 0; border-radius: 999px; background: #8a939b;
  position: relative; cursor: pointer; transition: background .15s; }
.nh-switch input::after { content: ""; position: absolute; left: 3px; top: 3px; width: 18px; height: 18px; border-radius: 50%;
  background: #fff; transition: transform .15s; }
.nh-switch input:checked { background: var(--sign); }
.nh-switch input:checked::after { transform: translateX(16px); }
.nh-switch input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.nh-switch span { display: grid; gap: 2px; }
.nh-switch small { font-weight: 400; font-size: .85rem; color: var(--muted); }
/* valinnat kahdella rivillä: lataustapa koko leveydeltä, alla vain vapaat ja asetukset */
.nh-filters { display: grid; gap: 8px; }
.nh-seg button { flex: 1; }
.nh-row2 { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.nh-row2 .nh-setbtn { margin-left: 0; }
/* piilotettu pysyy piilossa, vaikka luokka asettaisi display-arvon (esim. .btn-sec) */
.nh [hidden] { display: none !important; }
/* merkki, jonka tiedot ovat auki */
.nhpin.open { outline: 3px solid #15212c; outline-offset: 2px; z-index: 6; }
/* tietoikkuna aina kaikkien merkkien päällä (myös korostetun suosituksen) */
.nh-map .maplibregl-popup { z-index: 20; }
.nh-total2 { margin: -6px 0 0; color: var(--muted); font-size: .95rem; }

/* "Näin Lataushinta toimii" ja paikkakuntalinkit */
.nh-about { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); display: grid; gap: 10px; }
.nh-listsec[hidden] { display: none; }
.nh-about h2 { margin: 0; }
.nh-about h3 { font: 700 1.05rem "Barlow Semi Condensed", sans-serif; margin: 0 0 4px; }
.nh-about p { margin: 0; color: var(--muted); }
.nh-about-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.nh-places { display: flex; flex-wrap: wrap; gap: 6px 14px; }
.nh-places a, .nh-more a { color: var(--sign); }
@media (min-width: 1000px) {
}
