/* v2: suositus ylhäällä. Perustyylit tulevat style.css:stä. */

.search.compact { gap: 12px; }

/* Lisäasetukset kokoon taitettuna */
.more { border-top: 1px solid var(--line); padding-top: 10px; }
.more summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center;
  font-weight: 500; font-size: .95rem; min-height: 32px;
}
.more summary::-webkit-details-marker { display: none; }
.chev { width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
        transform: rotate(45deg) translateY(-3px); transition: transform .15s; }
.more[open] .chev { transform: rotate(-135deg) translateY(-3px); }
.more-body { display: grid; gap: 12px; padding-top: 10px; }

/* ---------- suositus ---------- */
/* .hero ja .alt kantavat .st-luokkaa vain välähdystä varten: kumotaan listarivin asettelu */
.hero.st, .alt.st { grid-template-columns: none; cursor: default; }
.hero.st:hover, .alt.st:hover { background: var(--surface); }
.hero-wrap { margin-top: 18px; display: grid; gap: 10px; }
.hero-wrap:empty { display: none; }
.hero {
  background: var(--surface); border: 2px solid var(--sign); border-radius: var(--radius-lg);
  padding: 18px 18px 14px; display: grid; gap: 6px; cursor: default;
}
.hero.kind-busy, .hero.kind-noprice { border-color: var(--line); }
.hero-k { margin: 0; color: var(--sign); font-weight: 600; font-size: .98rem; }
.hero.kind-busy .hero-k { color: var(--busy); }
.hero.kind-noprice .hero-k { color: var(--muted); }
.hero h2 { margin: 2px 0 0; font: 700 1.6rem/1.15 "Barlow Semi Condensed", sans-serif; }
.hero-op { margin: 0; color: var(--muted); }

.hero-price { display: flex; align-items: flex-end; gap: 14px; margin: 8px 0 4px; }
.hero-price .big {
  font: 700 4.2rem/0.9 "Barlow Semi Condensed", sans-serif; font-variant-numeric: tabular-nums;
  letter-spacing: -.02em;
}
.hero-price .big small { font-size: .45em; margin-left: 3px; }
.hero-price .per { color: var(--muted); font-size: .92rem; line-height: 1.35; padding-bottom: 4px; font-variant-numeric: tabular-nums; }
.hero-price.none .per { font-size: 1.05rem; color: var(--ink); padding: 0; }

.hero-facts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; }
.fact { font-size: .9rem; color: var(--ink); }
.hero-actions { margin-top: 10px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 22px;
  background: var(--sign); color: var(--sign-ink); border-radius: 10px; text-decoration: none;
  font: 600 1.05rem "Barlow", sans-serif;
}
.btn:hover { filter: brightness(1.08); }
@media (max-width: 520px) { .btn { width: 100%; } .hero-price .big { font-size: 3.6rem; } }

/* Lähin vapaa -vertailu */
.alt {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.alt-k { margin: 0; font-size: .88rem; color: var(--muted); }
.alt-name { margin: 2px 0 0; font-weight: 600; }
.alt-name span { font-weight: 500; color: var(--muted); margin-left: 6px; font-variant-numeric: tabular-nums; }

/* ---------- muut vaihtoehdot ---------- */
.v2 .summary { margin-top: 26px; }
.list-h { margin: 0 0 2px; font: 700 1.2rem "Barlow Semi Condensed", sans-serif; color: var(--ink); }
.summary p { margin: 0; }
.delta { font-size: .85rem; margin-top: 5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.delta.up { color: var(--muted); }
.delta.down { color: var(--free); }
.delta.same { color: var(--muted); font-weight: 500; }

/* ---------- mainospaikat (paikanvaraajat) ---------- */
.ad {
  display: grid; gap: 2px; border: 1px dashed var(--line); border-radius: 10px;
  padding: 12px 14px; color: var(--muted); background: transparent;
}
.ad-label { font-size: .75rem; font-weight: 600; color: var(--muted); }
.ad-body { font-size: .9rem; }
.ad-native { margin-top: 12px; background: var(--bg); border-color: transparent; }
.list .ad-inline { background: var(--surface); border: 0; border-radius: 0; padding: 16px 14px; }
.ad-bottom { margin-top: 18px; min-height: 90px; align-content: center; }

/* ---------- kartta: suositus korostettuna ---------- */
.pin.pin-hero {
  background: var(--free); color: var(--on-free); font-size: 14px; padding: 6px 8px; border-width: 3px;
  box-shadow: 0 2px 6px rgba(0,0,0,.4);
}
.pin.sel { outline: 3px solid var(--focus); outline-offset: 1px; }

/* ---------- mobiili: Lista / Kartta ---------- */
.viewtoggle { display: none; }
.mapcard[hidden] { display: none; }
.mapcard {
  position: absolute; left: 12px; right: 12px; bottom: 80px; z-index: 1001;
  background: var(--surface); color: var(--ink); border-radius: var(--radius-lg);
  padding: 14px 16px; box-shadow: 0 4px 18px rgba(0,0,0,.25); display: grid; gap: 4px;
  max-width: 420px; margin: 0 auto;
}
.mapcard p { margin: 0; }
.mc-k { color: var(--free); font-weight: 600; font-size: .9rem; }
.mc-name { font: 700 1.25rem/1.2 "Barlow Semi Condensed", sans-serif; padding-right: 28px; }
.mc-op { color: var(--muted); font-size: .9rem; }
.mc-row { display: flex; align-items: baseline; gap: 12px; }
.mc-price { font: 700 1.8rem/1.1 "Barlow Semi Condensed", sans-serif; font-variant-numeric: tabular-nums; }
.mc-per { color: var(--muted); font-size: .9rem; }
.mapcard .btn { margin-top: 8px; width: 100%; }
.mc-close {
  position: absolute; top: 6px; right: 8px; width: 36px; height: 36px; border: 0; background: none;
  font-size: 1.6rem; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 50%;
}

@media (max-width: 1099px) {
  .viewtoggle {
    display: inline-flex; position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
    z-index: 1002; background: var(--ink); border-radius: 999px; padding: 4px;
    box-shadow: 0 2px 12px rgba(0,0,0,.3);
  }
  .viewtoggle button {
    font: 600 .95rem "Barlow", sans-serif; color: var(--surface); background: transparent;
    border: 0; padding: 0 20px; min-height: 44px; border-radius: 999px; cursor: pointer;
  }
  .viewtoggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); }
  .v2 .panel { padding-bottom: 84px; }  /* tilaa kelluvalle painikkeelle */
  body.mapview .panel { display: none; }
  body.mapview .mapwrap { display: block; position: fixed; top: var(--top-h, 58px); left: 0; right: 0; bottom: 0; }
  body.mapview #map { position: absolute; inset: 0; }
}
.nomap .viewtoggle { display: none !important; }

/* ---------- valittu asema ---------- */
.hero.kind-picked { border-color: var(--ink); }
.hero.kind-picked .hero-k { color: var(--ink); }
.v2 .list .st { cursor: pointer; }
.rectag {
  font: 600 .72rem "Barlow", sans-serif; background: var(--free); color: var(--on-free);
  padding: 2px 6px; border-radius: 4px; vertical-align: 2px; margin-left: 4px;
}
.pk-tune { display: grid; gap: 8px; margin-top: 10px; padding: 12px; background: var(--bg); border-radius: 10px; }
.pk-tune input[type="range"] { touch-action: pan-y; }
.pk-chartwrap { margin: 2px -4px 0; max-width: 440px; }  /* tekstit pysyvät luettavan kokoisina */
.pk-chart { width: 100%; height: auto; display: block; touch-action: none; }
.ch-grid { stroke: var(--line); stroke-width: 1; }
.ch-yl { fill: var(--muted); font: 500 10px "Barlow", sans-serif; text-anchor: end; }
.ch-xl { fill: var(--muted); font: 500 10px "Barlow", sans-serif; text-anchor: middle; }
.ch-xl[text-anchor="end"] { text-anchor: end; }
.ch-line { fill: none; stroke: var(--sign); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.ch-fee { fill: none; stroke: var(--busy); stroke-width: 2.5; stroke-dasharray: 5 3; stroke-linecap: round; }
.ch-guide { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 2 3; }
.ch-dot { fill: var(--sign); stroke: var(--bg); stroke-width: 2; }
.ch-hit { fill: transparent; cursor: ew-resize; }
.pk-cap { margin: 0; font-size: .82rem; color: var(--muted); }
.pk-bd { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 2px 0 0; }
.pk-bd div { display: grid; }
.pk-bd dt { font-size: .78rem; color: var(--muted); }
.pk-bd dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.pk-compare {
  display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line);
}
.pk-compare p { margin: 0; font-size: .92rem; }
.pk-compare.stale p { opacity: .45; }
.linkbtn {
  font: 600 .92rem "Barlow", sans-serif; color: var(--sign); background: none; border: 0;
  padding: 6px 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px;
}
.mapcard .mc-pick { justify-self: center; }
.hero-actions { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
@media (max-width: 520px) { .hero-actions .linkbtn { width: 100%; text-align: center; } }

/* ---------- auton latausteho ---------- */
.pk-power { margin: 0; font-size: .85rem; color: var(--muted); }
.pk-power .linkbtn { font-size: .85rem; padding: 2px 0; margin-left: 2px; }
.pk-pedit { display: grid; gap: 8px; padding-top: 4px; }

.linkbtn.inline { font-size: inherit; padding: 0; margin-left: 4px; }

/* Auton tehon vetopalkki */
.pk-slider { display: grid; gap: 4px; }
.pk-slider input[type="range"] { width: 100%; accent-color: var(--sign); touch-action: pan-y; }
.pk-scale { display: flex; justify-content: space-between; font-size: .78rem; color: var(--muted); margin-top: -2px; }
.hero-power { margin-top: 4px; }
.hero > .pk-pedit { background: var(--bg); border-radius: 10px; padding: 10px 12px; margin-top: 4px; }

/* Perustelu, latausaika, varatut ja Näytä lisää */
.hero-why { margin: -2px 0 0; font-size: .88rem; color: var(--muted); }
.price .dur { font-size: .8rem; color: var(--muted); margin-top: 5px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.list .st.busy .price, .list .st.busy .info { opacity: .6; }
.list .more { background: var(--surface); padding: 6px; }
.morebtn {
  width: 100%; min-height: 48px; border: 0; border-radius: 8px; background: var(--bg); color: var(--sign);
  font: 600 1rem "Barlow", sans-serif; cursor: pointer;
}
.morebtn span { color: var(--muted); font-weight: 500; font-size: .88rem; margin-left: 6px; }
.morebtn:hover { background: color-mix(in srgb, var(--bg) 85%, var(--sign)); }
.hero-parts { margin: -2px 0 4px; font-size: .92rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Mainospaikat piilossa, kunnes mainokset otetaan käyttöön (poista tämä sääntö silloin) */
.ad { display: none !important; }

/* Aseman tiedot -linkit kortissa */
.stlink { color: inherit; text-decoration: none; }
.stlink:hover { text-decoration: underline; }
.btn-ghost { background: transparent; color: var(--sign); border: 1.5px solid var(--sign); }
.btn-ghost:hover { background: var(--sign); color: var(--sign-ink); }
.mc-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- etusivun otsikko ja esittely ---------- */
.intro { margin: 2px 2px 14px; }
.intro h1 { margin: 0; font: 700 1.7rem/1.15 "Barlow Semi Condensed", sans-serif; }
.intro p { margin: 4px 0 0; color: var(--muted); }
@media (max-width: 520px) { .intro h1 { font-size: 1.45rem; } .intro p { font-size: .92rem; } }

.about { margin: 34px 2px 8px; padding-top: 20px; border-top: 1px solid var(--line); }
.about h2 { margin: 0 0 12px; font: 700 1.3rem/1.2 "Barlow Semi Condensed", sans-serif; }
.about h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 600; }
.about p { margin: 0; color: var(--muted); font-size: .92rem; line-height: 1.5; }
.about-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); margin-bottom: 22px; }
.about-links { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 10px !important; }
.about-links a {
  padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line);
  color: var(--ink); text-decoration: none; font-size: .9rem; font-weight: 500;
}
.about-links a:hover { border-color: var(--sign); color: var(--sign); }
.about-more a { color: var(--sign); }
