:root {
  --ink: #0d1b2a; --ink2: #415a77; --muted: #6b7a8c; --bg: #f4f8fb; --card: #fff; --line: #dde6ee;
  --brand: #0b4f8a; --brand2: #1d7fd1; --ice: #e6f3fc;
  --good: #1f8a4c; --ok: #c98a06; --bad: #b3261e; --unknown: #8a96a3;
  --r: 14px; --shadow: 0 6px 24px rgba(13, 27, 42, .16);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; color: var(--ink); background: var(--bg); }
a { color: var(--brand); }
button { font: inherit; }
.badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: .82rem; font-weight: 650; color: #fff; white-space: nowrap; }
.q-good { background: var(--good); } .q-ok { background: var(--ok); } .q-bad { background: var(--bad); } .q-unknown { background: var(--unknown); }
.muted { color: var(--muted); font-size: .86rem; }
.groomed { font-size: .9rem; font-weight: 600; color: var(--ink2); }
.notice { margin: 8px 0 0; padding: 8px 10px; background: #fff7e0; border-radius: 10px; font-size: .9rem; }

/* --- Sovellus --- */
body.app { overflow: hidden; }
#map { position: fixed; inset: 0; z-index: 1; background: #e9eef2; }
.topbar { position: fixed; z-index: 500; top: 0; left: 0; right: 0; padding: calc(env(safe-area-inset-top) + 8px) 10px 6px; pointer-events: none; }
.topbar > * { pointer-events: auto; }
.brandrow { display: flex; align-items: center; gap: 8px; }
.logo { display: flex; align-items: center; gap: 6px; background: var(--card); border-radius: 999px; padding: 6px 12px 6px 8px; box-shadow: var(--shadow); font-weight: 800; color: var(--brand); text-decoration: none; font-size: 1rem; }
.logo svg { width: 22px; height: 22px; }
.summary { border: 0; cursor: pointer; font: inherit; background: var(--card); border-radius: 999px; padding: 6px 12px; box-shadow: var(--shadow); font-size: .82rem; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chips { display: flex; gap: 6px; margin-top: 8px; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { border: 0; background: var(--card); color: var(--ink2); padding: 7px 13px; border-radius: 999px; box-shadow: var(--shadow); font-weight: 650; font-size: .9rem; white-space: nowrap; cursor: pointer; }
.summary[aria-pressed="true"] { background: var(--good); color: #fff; font-weight: 700; }
.chip[aria-pressed="true"] { background: var(--brand); color: #fff; }
.mapbtns { position: fixed; z-index: 500; right: 10px; display: flex; flex-direction: column; gap: 8px; }
.mapbtn { width: 44px; height: 44px; border-radius: 12px; border: 0; background: var(--card); box-shadow: var(--shadow); display: grid; place-items: center; cursor: pointer; }
.mapbtn svg { width: 22px; height: 22px; fill: var(--brand); }

.sheet { position: fixed; z-index: 600; left: 0; right: 0; bottom: 0; background: var(--card); border-radius: 18px 18px 0 0; box-shadow: 0 -6px 28px rgba(13,27,42,.18);
  height: 46vh; max-height: calc(100vh - 120px); display: flex; flex-direction: column; transition: height .22s ease; padding-bottom: env(safe-area-inset-bottom); }
.sheet.min { height: 132px; } .sheet.max { height: calc(100vh - 110px); }
.grab { padding: 8px 0 2px; display: grid; place-items: center; cursor: grab; touch-action: none; }
.grab span { width: 44px; height: 5px; background: var(--line); border-radius: 9px; }
.sheet-head { padding: 4px 14px 8px; }
.search { width: 100%; border: 1px solid var(--line); background: var(--bg); border-radius: 12px; padding: 11px 12px; font-size: 1rem; }
.near { margin-top: 8px; width: 100%; border: 0; border-radius: 12px; padding: 11px; background: var(--ice); color: var(--brand); font-weight: 700; cursor: pointer; }
.sheet-body { overflow-y: auto; flex: 1; padding: 0 14px 14px; -webkit-overflow-scrolling: touch; }
.list { list-style: none; margin: 0; padding: 0; }
.item { display: flex; gap: 10px; padding: 11px 2px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: flex-start; }
.item:hover { background: #fafcfe; }
.ico { flex: 0 0 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--ice); font-size: 18px; }
.item-main { flex: 1; min-width: 0; }
.item-name { font-weight: 650; line-height: 1.25; }
.item-sub { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.item-side { text-align: right; font-size: .8rem; color: var(--muted); }
.empty { padding: 18px 4px; color: var(--muted); }
.more { width: 100%; margin-top: 10px; padding: 10px; border: 1px solid var(--line); background: #fff; border-radius: 12px; cursor: pointer; }

.detail h2 { margin: 4px 0 2px; font-size: 1.25rem; line-height: 1.25; }
.detail .where { color: var(--muted); font-size: .9rem; }
.detail .status { margin: 12px 0; line-height: 1.7; }
.back { border: 0; background: none; color: var(--brand); font-weight: 700; padding: 6px 0; cursor: pointer; }
.facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0; padding: 0; list-style: none; }
.facts li { background: var(--bg); border: 1px solid var(--line); border-radius: 999px; padding: 4px 10px; font-size: .85rem; }
.wx { background: var(--ice); border-radius: 12px; padding: 10px 12px; font-size: .9rem; margin: 10px 0; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 12px 0; }
.btn { display: block; text-align: center; padding: 11px; border-radius: 12px; border: 0; background: var(--brand); color: #fff; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn.alt { background: var(--ice); color: var(--brand); }
.fb { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.fb-row { display: flex; gap: 8px; margin-top: 8px; }
.fb-row button { flex: 1; padding: 9px; border-radius: 10px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-weight: 650; }
.fb textarea { width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; padding: 8px; font: inherit; min-height: 64px; }
.src { font-size: .78rem; color: var(--muted); margin-top: 12px; line-height: 1.45; }
.foot { font-size: .78rem; color: var(--muted); padding: 14px 0 4px; line-height: 1.6; }
.foot a { color: var(--muted); }
.leaflet-container { font: inherit; }
.leaflet-control-attribution { font-size: 10px; }
.pin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35); }
.pin.avanto { border-radius: 4px; }
.pin.sel { width: 22px; height: 22px; border-width: 3px; }

@media (min-width: 900px) {
  .sheet { left: 12px; right: auto; top: 118px; bottom: 12px; width: 400px; height: auto !important; max-height: none; border-radius: 18px; }
  .grab { display: none; }
  .mapbtns { bottom: 24px !important; }
}

/* --- SEO-sivut --- */
body.page { background: var(--bg); }
.page header { background: var(--brand); color: #fff; }
.page header .in { max-width: 920px; margin: 0 auto; padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.page header a { color: #fff; text-decoration: none; font-weight: 800; }
.page header .lang { font-weight: 600; font-size: .9rem; opacity: .9; }
.page main { max-width: 920px; margin: 0 auto; padding: 18px 16px 40px; }
.page h1 { font-size: 1.6rem; line-height: 1.2; margin: 6px 0 6px; }
.page h2 { font-size: 1.2rem; margin: 26px 0 8px; }
.crumbs { font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.lead { color: var(--ink2); }
.cta { display: inline-block; margin: 10px 0 4px; padding: 12px 18px; background: var(--brand2); color: #fff; border-radius: 12px; text-decoration: none; font-weight: 700; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; }
.card h3 { margin: 0 0 4px; font-size: 1.02rem; }
.card h3 a { text-decoration: none; color: var(--ink); }
.card .live { font-size: .92rem; line-height: 1.6; }
.stat { display: inline-block; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; margin: 4px 6px 4px 0; }
.stat b { font-size: 1.3rem; color: var(--brand); }
.links { columns: 2; padding-left: 18px; }
.page footer { max-width: 920px; margin: 0 auto; padding: 0 16px 30px; font-size: .82rem; color: var(--muted); line-height: 1.6; }
.faq dt { font-weight: 700; margin-top: 12px; } .faq dd { margin: 4px 0 0; color: var(--ink2); }
