:root {
  --bg: #edf3f7;
  --surface: rgba(255,255,255,.96);
  --surface-solid: #ffffff;
  --surface-soft: #f5f8fb;
  --text: #102a43;
  --muted: #65758b;
  --line: #d9e3ec;
  --accent: #147d92;
  --accent-strong: #0b6477;
  --accent-soft: #e4f5f7;
  --nav: #14532d;
  --warning: #a15c00;
  --danger: #a82626;
  --shadow: 0 16px 44px rgba(16, 42, 67, .16);
  --shadow-soft: 0 8px 24px rgba(16, 42, 67, .11);
  --radius: 18px;
  --topbar-h: 64px;
  --rail-w: 72px;
  --drawer-w: 370px;
  --sheet-w: 430px;
  --mobile-nav-h: 70px;
  --font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* 3.0.38: reittivalinta, Digiroad-aloitus ja selaimessa toimiva navigointi */
.visually-hidden{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
.route-preference-buttons{display:grid;grid-template-columns:repeat(3,1fr);gap:6px;margin:8px 0 12px}
.route-preference-buttons button{min-height:38px;border:1px solid var(--border,#cbd5e1);border-radius:9px;background:var(--surface,#fff);color:var(--text,#17212b);font-weight:750;cursor:pointer}
.route-preference-buttons button.active{background:#0b6f8f;color:#fff;border-color:#0b6f8f;box-shadow:0 0 0 2px rgba(11,111,143,.18)}
.digiroad-welcome{position:absolute;top:18px;left:50%;z-index:8;transform:translateX(-50%);width:min(520px,calc(100% - 32px));padding:14px 42px 14px 16px;border:1px solid rgba(11,111,143,.28);border-radius:14px;background:rgba(255,255,255,.96);box-shadow:0 12px 32px rgba(15,23,42,.20);color:#17212b}
.digiroad-welcome p{margin:5px 0 10px;font-size:13px}.digiroad-welcome>div{display:flex;gap:7px;flex-wrap:wrap}.digiroad-welcome>div button{border:1px solid #8db8c6;border-radius:8px;background:#eef9fc;color:#075d78;padding:7px 10px;font-weight:700}.digiroad-welcome .close-button{position:absolute;right:8px;top:8px}
.navigation-view{position:absolute;z-index:18;top:12px;left:50%;transform:translateX(-50%);width:min(720px,calc(100% - 32px));border:1px solid rgba(91,174,209,.5);border-radius:16px;background:rgba(12,28,41,.95);color:#f4fbff;box-shadow:0 14px 42px rgba(0,0,0,.3);padding:12px;backdrop-filter:blur(10px)}
.navigation-view[hidden]{display:none}.navigation-instruction{display:grid;grid-template-columns:1fr auto;gap:2px 12px}.navigation-instruction small{grid-column:1/-1;color:#9bdcf3;font-weight:800;font-size:10px}.navigation-instruction strong{font-size:clamp(17px,2.4vw,24px)}.navigation-instruction span{font-size:20px;font-weight:800;color:#65d5a2}.navigation-stats{display:grid;grid-template-columns:repeat(4,1fr);gap:7px;margin:10px 0}.navigation-stats div{padding:7px;border-radius:9px;background:rgba(255,255,255,.08)}.navigation-stats span{display:block;font-size:10px;color:#b8d6e2}.navigation-stats strong{font-size:15px}.navigation-status{font-size:11px;color:#b8d6e2;margin:2px 0 8px}.navigation-controls{display:flex;gap:6px;flex-wrap:wrap}.navigation-controls button{min-height:34px;border:1px solid rgba(255,255,255,.24);border-radius:8px;background:#183f57;color:#fff;font-weight:750;padding:5px 10px}.navigation-controls button[aria-pressed=true]{background:#087e68}.navigation-controls button.danger{margin-left:auto;background:#8c2831}
.navigation-position-marker{width:22px;height:22px;border:4px solid #fff;border-radius:50%;background:#0c88c9;box-shadow:0 0 0 7px rgba(12,136,201,.25),0 3px 12px rgba(0,0,0,.35)}
.map-base-name-control{padding:3px 6px!important;font-size:10px!important;font-weight:750!important;color:var(--text,#17212b)!important;background:var(--surface,#fff)!important}
body.navigation-active .drawer,body.navigation-active .mobile-nav{display:none!important}
html[data-theme=dark] .digiroad-welcome{background:rgba(28,47,61,.97);color:#f4fbff;border-color:#477b92}html[data-theme=dark] .route-preference-buttons button{background:#263f50;color:#f2f8fb;border-color:#547083}
html[data-theme=dark] .traffic-sidebar,html[data-theme=dark] .traffic-panel,html[data-theme=dark] .traffic-layers,html[data-theme=dark] .traffic-filters{color:#f2f8fb}html[data-theme=dark] .traffic-sidebar button,html[data-theme=dark] .traffic-sidebar input,html[data-theme=dark] .traffic-sidebar select{color:#f5fbff;border-color:#617d8e;background:#294555}html[data-theme=dark] .traffic-sidebar label,html[data-theme=dark] .traffic-sidebar small{color:#d8e8ef}
@media(max-width:760px){.navigation-view{top:8px;width:calc(100% - 16px);padding:10px}.navigation-stats{grid-template-columns:repeat(4,1fr);gap:4px}.navigation-stats div{padding:5px}.navigation-controls{display:grid;grid-template-columns:repeat(4,1fr)}.navigation-controls button{padding:4px;font-size:11px}.navigation-controls button.danger{margin:0}.digiroad-welcome{top:8px}.route-settings-wrap[open]>summary{margin-bottom:4px}}

html[data-theme="dark"] {
  --bg: #0c1722;
  --surface: rgba(15, 28, 40, .97);
  --surface-solid: #0f1c28;
  --surface-soft: #162635;
  --text: #e8f0f6;
  --muted: #9eb0bf;
  --line: #2c3d4b;
  --accent: #55bdd0;
  --accent-strong: #79ccda;
  --accent-soft: #153844;
  --nav: #58b67e;
  --warning: #e6a34b;
  --danger: #ef7373;
  --shadow: 0 16px 44px rgba(0,0,0,.38);
  --shadow-soft: 0 8px 24px rgba(0,0,0,.28);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { font-family: var(--font); color: var(--text); background: var(--bg); }
button, input, select { font: inherit; }
button { color: inherit; }
svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
[hidden] { display: none !important; }

.app-shell { width: 100%; height: 100%; }
.topbar {
  position: relative;
  z-index: 50;
  height: var(--topbar-h);
  display: grid;
  grid-template-columns: minmax(230px, 320px) minmax(260px, 680px) minmax(230px, 1fr);
  align-items: center;
  gap: 20px;
  padding: 0 18px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}
.brand { display: flex; align-items: center; gap: 11px; border: 0; background: transparent; padding: 0; cursor: pointer; text-align: left; min-width: 0; }
.admin-secret-entry { position:absolute; z-index:6; top:0; left:0; width:18px; height:18px; margin:0; padding:0; border:0; outline:0; background:transparent; opacity:0; cursor:default; user-select:none; -webkit-tap-highlight-color:transparent; }
.brand-mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-weight: 850; letter-spacing: -.04em; color: white; background: linear-gradient(145deg, #102a43, #147d92); box-shadow: 0 7px 16px rgba(20,125,146,.26); flex: 0 0 auto; }
.brand-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.13; }
.brand-text strong { font-size: 1rem; white-space: nowrap; }
.brand-text small { font-size: .72rem; color: var(--muted); margin-top: 3px; white-space: nowrap; }
.global-search { height: 42px; max-width: 680px; width: 100%; justify-self: center; display: grid; grid-template-columns: 34px 1fr auto; align-items: center; padding-left: 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-soft); transition: border-color .18s, box-shadow .18s, background .18s; }
.global-search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 16%, transparent); background: var(--surface-solid); }
.global-search svg { color: var(--muted); width: 18px; }
.global-search input { min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); padding: 0 8px 0 2px; height: 40px; }
.global-search button { height: 34px; margin-right: 4px; padding: 0 14px; border: 0; border-radius: 10px; background: var(--accent); color: white; cursor: pointer; font-weight: 720; }
.top-actions { justify-self: end; display: flex; align-items: center; gap: 8px; }
.icon-button { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 12px; display: grid; place-items: center; background: var(--surface-solid); cursor: pointer; transition: transform .15s, border-color .15s, background .15s; }
.icon-button:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--accent-soft); }
.status { display: inline-flex; align-items: center; height: 32px; padding: 0 10px; border-radius: 999px; font-size: .75rem; font-weight: 750; white-space: nowrap; background: var(--surface-soft); border: 1px solid var(--line); color: var(--muted); }
.status-loading { color: var(--accent-strong); background: var(--accent-soft); }
.status-ok { color: #24653d; background: #e8f7ed; border-color: #b9e2c7; }
.status-error { color: var(--danger); background: #fff0f0; border-color: #f2c3c3; }
html[data-theme="dark"] .status-ok { color: #8cdbab; background: #173729; border-color: #2d5b40; }
html[data-theme="dark"] .status-error { color: #ff9c9c; background: #3a1f23; border-color: #633039; }

.workspace { position: relative; width: 100%; height: calc(100% - var(--topbar-h)); }
.map-shell { position: absolute; inset: 0; overflow: hidden; background: #dbe5ec; }
#map { position: absolute; inset: 0; }
.maplibregl-map { font-family: var(--font); }
.maplibregl-ctrl-group { border-radius: 12px !important; overflow: hidden; box-shadow: var(--shadow-soft) !important; border: 1px solid var(--line); }
.maplibregl-ctrl-group button { background-color: var(--surface-solid) !important; }
.maplibregl-ctrl-attrib { font-size: 10px; background: color-mix(in srgb, var(--surface-solid) 82%, transparent) !important; color: var(--muted); }
.maplibregl-ctrl-attrib a { color: inherit; }
.maplibregl-popup-content { border-radius: 14px; padding: 14px; color: var(--text); background: var(--surface-solid); box-shadow: var(--shadow); min-width: 210px; }
.maplibregl-popup-close-button { font-size: 20px; color: var(--muted); }

.tool-rail { position: absolute; z-index: 35; top: 12px; left: 12px; width: var(--rail-w); display: flex; flex-direction: column; gap: 7px; padding: 8px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); backdrop-filter: blur(14px); box-shadow: var(--shadow-soft); }
.rail-button, .mobile-nav-button { border: 0; background: transparent; cursor: pointer; color: var(--muted); }
.rail-button { min-height: 54px; border-radius: 12px; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 3px; font-size: .66rem; font-weight: 720; }
.rail-button svg { width: 21px; height: 21px; }
.rail-button:hover { color: var(--text); background: var(--surface-soft); }
.rail-button.active { color: var(--accent-strong); background: var(--accent-soft); }

.drawer { position: absolute; z-index: 34; top: 12px; bottom: 12px; left: calc(12px + var(--rail-w) + 10px); width: var(--drawer-w); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); backdrop-filter: blur(18px); box-shadow: var(--shadow); transform: translateX(calc(-100% - var(--rail-w) - 40px)); opacity: 0; pointer-events: none; transition: transform .24s ease, opacity .2s ease; overflow: hidden; }
.drawer.open { transform: translateX(0); opacity: 1; pointer-events: auto; }
.drawer-header { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 12px 18px; border-bottom: 1px solid var(--line); }
.drawer-header h2, .info-panel-header h2 { margin: 1px 0 0; font-size: 1.06rem; letter-spacing: -.02em; }
.eyebrow { display: block; font-size: .62rem; letter-spacing: .11em; font-weight: 800; color: var(--accent-strong); }
.close-button { width: 36px; height: 36px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); cursor: pointer; font-size: 1.45rem; line-height: 1; color: var(--muted); }
.drawer-scroll { height: calc(100% - 72px); overflow: auto; overscroll-behavior: contain; padding: 16px 16px 24px; }
.panel-view { display: none; }
.panel-view.active { display: block; }

.field-group { margin-bottom: 14px; }
.field-group label, .route-field label { display: block; font-size: .76rem; font-weight: 760; color: var(--muted); margin-bottom: 6px; }
input, select { width: 100%; height: 42px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-solid); color: var(--text); padding: 0 11px; outline: none; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.input-action-row { display: grid; grid-template-columns: 1fr auto; gap: 7px; }
.button { min-height: 40px; border-radius: 11px; border: 1px solid transparent; padding: 0 13px; cursor: pointer; font-weight: 760; transition: transform .15s, filter .15s, background .15s; }
.button:hover { transform: translateY(-1px); }
.button.primary { color: white; background: var(--accent); }
.button.navigation { color: white; background: var(--nav); }
.button.secondary { color: var(--text); border-color: var(--line); background: var(--surface-solid); }
.button.ghost { color: var(--muted); border-color: var(--line); background: transparent; }
.button.full { width: 100%; margin-top: 8px; }
.mini-button { min-width: 58px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); color: var(--muted); cursor: pointer; font-size: .72rem; font-weight: 720; }
.panel-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 4px; }
.hint { margin: 6px 0 0; font-size: .72rem; line-height: 1.45; color: var(--muted); }
.section-divider { height: 1px; background: var(--line); margin: 18px 0; }
.field-grid { display: grid; gap: 10px; }
.field-grid.two { grid-template-columns: 1fr 1fr; }

.result-list { display: grid; gap: 8px; margin: 12px 0; }
.search-result { width: 100%; padding: 11px 12px; text-align: left; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-solid); cursor: pointer; }
.search-result:hover { border-color: var(--accent); background: var(--accent-soft); }
.search-result strong { display: block; font-size: .85rem; margin-bottom: 2px; }
.search-result span { display: block; color: var(--muted); font-size: .72rem; line-height: 1.3; }
.info-callout { margin-top: 16px; padding: 13px 14px; border-radius: 13px; border: 1px solid color-mix(in srgb, var(--accent) 24%, var(--line)); background: var(--accent-soft); }
.info-callout.warning { border-color: #efd1a7; background: #fff7e8; }
html[data-theme="dark"] .info-callout.warning { border-color: #624821; background: #322617; }
.info-callout strong { font-size: .8rem; }
.info-callout p { margin: 5px 0 0; color: var(--muted); font-size: .73rem; line-height: 1.45; }

.legend { display: grid; gap: 7px; margin-top: 12px; }
.legend-row { display: grid; grid-template-columns: 30px 1fr; gap: 9px; align-items: center; font-size: .72rem; color: var(--muted); }
.legend-line { display: block; width: 30px; height: 5px; border-radius: 999px; }
.switch-row { display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; margin: 11px 0; cursor: pointer; }
.switch-row input { width: 18px; height: 18px; margin-top: 2px; accent-color: var(--accent); box-shadow: none; }
.switch-row span { min-width: 0; }
.switch-row strong { display: block; font-size: .8rem; line-height: 1.3; }
.switch-row small { display: block; margin-top: 2px; font-size: .68rem; color: var(--muted); line-height: 1.35; }

.route-fields { position: relative; }
.route-field { display: grid; grid-template-columns: 32px minmax(0,1fr) auto; gap: 8px; align-items: end; position: relative; }
.route-field > div { min-width: 0; }
.route-dot { align-self: center; width: 26px; height: 26px; display: grid; place-items: center; border-radius: 999px; font-size: .7rem; font-weight: 850; z-index: 2; }
.route-dot.start { background: var(--accent); color: white; }
.route-dot.end { background: var(--nav); color: white; }
.route-connector { width: 2px; height: 20px; margin: -1px 0 -1px 12px; background: repeating-linear-gradient(to bottom,var(--line) 0 4px,transparent 4px 7px); }
.waypoint-list { margin: 8px 0; }
.waypoint-chip { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface-soft); font-size: .72rem; }
.waypoint-chip button { border: 0; background: transparent; color: var(--danger); cursor: pointer; }
.route-result { margin-top: 14px; }
.route-summary { display: grid; grid-template-columns: repeat(3,1fr); gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 13px; background: var(--surface-soft); }
.route-summary div { min-width: 0; }
.route-summary span { display: block; color: var(--muted); font-size: .62rem; line-height: 1.2; }
.route-summary strong { display: block; margin-top: 4px; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route-steps-wrap { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.route-steps-wrap summary { cursor: pointer; font-size: .78rem; font-weight: 780; }
.route-steps { padding-left: 28px; margin: 10px 0 0; display: grid; gap: 10px; }
.route-steps li { padding-left: 2px; font-size: .75rem; line-height: 1.35; color: var(--muted); }
.route-steps li strong { color: var(--text); font-weight: 720; }
.route-check { margin-top: 12px; border-radius: 13px; border: 1px solid var(--line); overflow: hidden; }
.route-check-head { padding: 10px 12px; background: var(--surface-soft); }
.route-check-head strong { display: block; font-size: .78rem; }
.route-check-head span { display: block; margin-top: 3px; color: var(--muted); font-size: .68rem; line-height: 1.35; }
.route-check-list { margin: 0; padding: 8px 12px 10px 30px; max-height: 220px; overflow: auto; }
.route-check-list li { margin: 6px 0; font-size: .7rem; line-height: 1.35; color: var(--muted); }
.route-check.red { border-color: #e6abab; }
.route-check.yellow { border-color: #e7c58e; }
.route-check.green { border-color: #a9d5b6; }

.info-panel { position: absolute; z-index: 37; top: 12px; bottom: 12px; right: 12px; width: var(--sheet-w); border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); backdrop-filter: blur(18px); box-shadow: var(--shadow); transform: translateX(calc(100% + 30px)); opacity: 0; pointer-events: none; transition: transform .24s ease, opacity .2s ease; overflow: hidden; }
.info-panel.open { transform: translateX(0); opacity: 1; pointer-events: auto; }
.sheet-handle { display: none; }
.info-panel-header { height: 72px; padding: 14px 14px 12px 18px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.info-content { height: calc(100% - 72px); overflow: auto; padding: 15px 16px 26px; }
.info-hero { padding: 13px; border-radius: 14px; background: linear-gradient(145deg, var(--surface-soft), var(--accent-soft)); border: 1px solid var(--line); margin-bottom: 12px; }
.info-hero-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.chip, .profile-chip { display: inline-flex; align-items: center; min-height: 26px; padding: 0 8px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-solid); color: var(--muted); font-size: .66rem; font-weight: 700; }
.info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.info-item { min-width: 0; padding: 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-solid); }
.info-item.wide { grid-column: 1 / -1; }
.info-item span { display: block; color: var(--muted); font-size: .62rem; margin-bottom: 3px; }
.info-item strong { display: block; font-size: .76rem; line-height: 1.35; overflow-wrap: anywhere; }
.info-actions { display: flex; gap: 7px; flex-wrap: wrap; margin: 12px 0; }
.raw-details { margin-top: 12px; }
.raw-details summary { cursor: pointer; font-size: .75rem; font-weight: 760; }
.raw-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: .66rem; }
.raw-table th, .raw-table td { border-bottom: 1px solid var(--line); padding: 5px 4px; text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.raw-table th { width: 42%; color: var(--muted); font-weight: 650; }

.driveability-card { margin-top: 12px; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.driveability-summary { display: grid; grid-template-columns: 36px 1fr; gap: 10px; padding: 12px; background: var(--surface-soft); }
.driveability-symbol { width: 34px; height: 34px; border-radius: 999px; display: grid; place-items: center; font-weight: 900; background: var(--surface-solid); border: 1px solid var(--line); }
.driveability-title { margin: 0; font-size: .78rem; font-weight: 810; line-height: 1.3; }
.driveability-subtitle { margin: 4px 0 0; font-size: .68rem; line-height: 1.4; color: var(--muted); }
.profile-inline { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.driveability-list { margin: 0; padding: 8px 12px 9px 30px; }
.driveability-list li { margin: 7px 0; color: var(--muted); font-size: .68rem; line-height: 1.4; }
.driveability-list li strong { color: var(--text); display: block; }
.driveability-meta { padding: 9px 12px; background: var(--surface-soft); border-top: 1px solid var(--line); font-size: .64rem; line-height: 1.4; color: var(--muted); }
.status-red { border-color: #e3aaaa; }
.status-yellow { border-color: #e4c487; }
.status-green { border-color: #acd7b8; }
.sev-red::marker { color: var(--danger); }
.sev-yellow::marker { color: var(--warning); }
.sev-green::marker, .sev-info::marker { color: var(--accent); }

.context-menu { position: absolute; z-index: 80; min-width: 250px; max-width: min(320px, calc(100vw - 24px)); padding: 7px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-solid); box-shadow: var(--shadow); }
.context-menu-header { padding: 8px 9px 9px; border-bottom: 1px solid var(--line); margin-bottom: 5px; }
.context-menu-header strong { display: block; font-size: .78rem; }
.context-menu-header span { display: block; margin-top: 3px; font-size: .65rem; color: var(--muted); line-height: 1.3; }
.context-menu button { width: 100%; min-height: 35px; padding: 0 9px; text-align: left; border: 0; border-radius: 8px; background: transparent; cursor: pointer; font-size: .73rem; }
.context-menu button:hover { background: var(--surface-soft); }
.context-menu button.danger { color: var(--danger); }
.context-menu-separator { height: 1px; background: var(--line); margin: 5px 3px; }
.context-menu-note { padding: 7px 9px 3px; color: var(--muted); font-size: .61rem; line-height: 1.3; }
.context-menu-group { display: grid; gap: 2px; padding: 5px 0; border-bottom: 1px solid var(--line); }
.context-menu-group:last-of-type { border-bottom: 0; }
.context-menu-group > strong { padding: 2px 9px; color: var(--muted); font-size: .59rem; letter-spacing: .08em; text-transform: uppercase; }

.map-notice, .map-error, .pick-mode-banner { position: absolute; z-index: 28; left: 50%; transform: translateX(-50%); border-radius: 12px; box-shadow: var(--shadow-soft); backdrop-filter: blur(12px); }
.map-notice { top: 14px; padding: 8px 12px; background: var(--surface); border: 1px solid var(--line); color: var(--muted); font-size: .72rem; }
.map-error { top: 14px; max-width: min(680px, calc(100% - 32px)); padding: 10px 13px; background: #fff1f1; border: 1px solid #e6b5b5; color: #8f2828; font-size: .72rem; line-height: 1.4; }
html[data-theme="dark"] .map-error { background: #381e22; color: #ffacac; border-color: #6d343c; }
.pick-mode-banner { top: 14px; display: flex; align-items: center; gap: 10px; padding: 8px 9px 8px 12px; background: var(--surface); border: 1px solid var(--accent); font-size: .73rem; }
.pick-mode-banner button { border: 0; border-radius: 8px; padding: 5px 8px; background: var(--accent-soft); color: var(--accent-strong); cursor: pointer; font-weight: 750; }
.map-scale-meta { position: absolute; z-index: 20; left: 12px; bottom: 42px; display: flex; align-items: center; gap: 6px; max-width: min(420px, calc(100% - 24px)); padding: 5px 8px; border: 1px solid color-mix(in srgb, var(--line) 80%, transparent); border-radius: 8px; background: color-mix(in srgb, var(--surface-solid) 86%, transparent); color: var(--muted); font-size: .61rem; line-height: 1.2; backdrop-filter: blur(8px); pointer-events: none; }
.map-scale-meta strong { color: var(--text); font-size: inherit; white-space: nowrap; }
.map-scale-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.navigation-banner { position: absolute; z-index: 60; top: 12px; left: 50%; transform: translateX(-50%); width: min(760px, calc(100% - 40px)); min-height: 84px; display: grid; grid-template-columns: 54px minmax(0,1fr) auto auto auto; align-items: center; gap: 10px; padding: 10px 11px; border-radius: 17px; background: #123d29; color: white; box-shadow: 0 16px 40px rgba(0,0,0,.3); }
.nav-maneuver-icon { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 13px; background: rgba(255,255,255,.12); font-size: 1.7rem; font-weight: 800; }
.nav-main { min-width: 0; }
.nav-distance { display: block; font-size: .72rem; color: #bde3c8; font-weight: 720; }
.nav-main strong { display: block; margin-top: 2px; font-size: .98rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-main small { display: block; margin-top: 2px; color: #c7decf; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav-side { text-align: right; min-width: 72px; }
.nav-side span { display: block; font-weight: 800; }
.nav-side small { display: block; color: #c7decf; margin-top: 2px; }
.nav-icon-button { min-height: 40px; border: 1px solid rgba(255,255,255,.2); border-radius: 10px; background: rgba(255,255,255,.1); color: white; cursor: pointer; padding: 0 10px; font-size: .7rem; font-weight: 750; }
.nav-icon-button.danger { background: #7b2323; }

.mobile-nav { display: none; }

.route-marker { width: 30px; height: 30px; border-radius: 999px; display: grid; place-items: center; color: white; font-weight: 850; font-size: .72rem; border: 3px solid white; box-shadow: 0 4px 14px rgba(0,0,0,.24); }
.route-marker.start { background: var(--accent); }
.route-marker.end { background: var(--nav); }
.route-marker.waypoint { background: #7c5eb5; }
.user-nav-marker { width: 22px; height: 22px; border: 4px solid white; border-radius: 999px; background: #2387e8; box-shadow: 0 0 0 5px rgba(35,135,232,.22), 0 4px 12px rgba(0,0,0,.28); }

@media (max-width: 1280px) {
  :root { --drawer-w: 345px; --sheet-w: 395px; }
  .topbar { grid-template-columns: minmax(210px, 270px) minmax(250px, 560px) minmax(170px, 1fr); gap: 12px; }
  .brand-text small { display: none; }
  .status { display: none; }
}

@media (max-width: 1024px) {
  :root { --drawer-w: min(370px, calc(100vw - 116px)); --sheet-w: min(420px, calc(100vw - 36px)); }
  .topbar { grid-template-columns: auto 1fr auto; padding: 0 12px; }
  .brand-text { display: none; }
  .brand-mark { width: 36px; height: 36px; }
  .desktop-only { display: none; }
  .drawer { box-shadow: 0 18px 50px rgba(0,0,0,.2); }
  .info-panel { top: auto; height: min(66vh, 650px); }
}

@media (max-width: 760px) {
  :root { --topbar-h: 48px; --mobile-nav-h: 56px; }
  .topbar { grid-template-columns: auto 1fr auto; gap: 6px; padding: env(safe-area-inset-top, 0) 6px 0; height: calc(var(--topbar-h) + env(safe-area-inset-top, 0)); }
  .workspace { height: calc(100% - var(--topbar-h) - env(safe-area-inset-top, 0)); }
  .brand-mark { width: 30px; height: 30px; border-radius: 9px; font-size: .86rem; }
  .global-search { height: 34px; border-radius: 10px; grid-template-columns: 27px 1fr; padding-left: 4px; }
  .global-search input { height: 32px; font-size: .80rem; }
  .global-search button { display: none; }
  .top-actions { gap: 5px; }
  .top-actions .icon-button { width: 32px; height: 32px; border-radius: 9px; }
  #themeBtn { display: none; }
  .tool-rail { display: none; }
  .mobile-nav { position: absolute; z-index: 55; left: 0; right: 0; bottom: 0; height: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0)); display: grid; grid-template-columns: repeat(6,1fr); padding: 4px 5px env(safe-area-inset-bottom, 0); background: var(--surface); border-top: 1px solid var(--line); backdrop-filter: blur(18px); }
  .mobile-nav-button { min-height: 44px; border-radius: 9px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; font-size: .59rem; font-weight: 720; }
  .mobile-nav-button svg { width: 18px; height: 18px; }
  .mobile-nav-button.active { background: var(--accent-soft); color: var(--accent-strong); }
  .drawer { z-index: 58; left: 6px; right: 6px; top: auto; bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0) + 6px); width: auto; height: min(72vh, 650px); border-radius: 19px; transform: translateY(calc(100% + var(--mobile-nav-h) + 20px)); }
  .drawer.open { transform: translateY(0); }
  .drawer-header { height: 62px; padding: 10px 13px 9px 15px; }
  .drawer-scroll { height: calc(100% - 62px); padding: 14px 14px 22px; }
  .info-panel { z-index: 59; left: 6px; right: 6px; bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0) + 6px); top: auto; width: auto; height: min(62vh, 590px); border-radius: 20px; transform: translateY(calc(100% + var(--mobile-nav-h) + 30px)); }
  .info-panel.open { transform: translateY(0); }
  .sheet-handle { display: block; width: 42px; height: 4px; margin: 7px auto -3px; border-radius: 999px; background: var(--line); }
  .info-panel-header { height: 62px; padding: 8px 12px 8px 15px; }
  .info-content { height: calc(100% - 66px); padding: 12px 13px 22px; }
  .maplibregl-ctrl-bottom-right { bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0) + 8px); }
  .maplibregl-ctrl-bottom-left { bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0) + 2px); }
  .map-scale-meta { left: 8px; bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0) + 37px); font-size: .56rem; }
  .map-notice, .map-error, .pick-mode-banner { top: 8px; max-width: calc(100% - 18px); }
  .navigation-banner { top: 7px; width: calc(100% - 12px); min-height: 74px; border-radius: 15px; grid-template-columns: 46px minmax(0,1fr) auto auto; gap: 7px; padding: 8px; }
  .nav-maneuver-icon { width: 44px; height: 44px; font-size: 1.45rem; }
  .nav-main strong { font-size: .86rem; }
  .nav-side { display: none; }
  .nav-icon-button { min-height: 36px; padding: 0 8px; font-size: .64rem; }
  .field-grid.two { grid-template-columns: 1fr 1fr; }
  .context-menu { position: fixed; left: 8px !important; right: 8px; bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0) + 8px); top: auto !important; max-width: none; width: auto; border-radius: 17px; }
}

@media (max-width: 430px) {
  .global-search input { font-size: .78rem; }
  .top-actions #routeQuickBtn { display: none; }
  .route-summary { grid-template-columns: 1fr 1fr; }
  .route-summary div:last-child { grid-column: 1 / -1; }
  .info-grid { grid-template-columns: 1fr; }
  .info-item.wide { grid-column: auto; }
  .vehicle-grid { grid-template-columns: 1fr 1fr !important; }
}

@media (max-height: 650px) and (orientation: landscape) and (max-width: 1000px) {
  .drawer { left: 6px; top: 6px; bottom: calc(var(--mobile-nav-h) + 6px); width: min(380px, 48vw); height: auto; right: auto; transform: translateX(calc(-100% - 20px)); }
  .drawer.open { transform: translateX(0); }
  .info-panel { right: 6px; left: auto; top: 6px; bottom: calc(var(--mobile-nav-h) + 6px); width: min(410px, 48vw); height: auto; transform: translateX(calc(100% + 20px)); }
  .info-panel.open { transform: translateX(0); }
  .sheet-handle { display: none; }
  .navigation-banner { width: min(660px, calc(100% - 24px)); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .001ms !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; }
}
.field-note { display:block; margin-top:6px; color:var(--muted); font-size:.68rem; line-height:1.4; }


/* v2.1.0 – kartta ensisijaiseksi, kompakti ulkoinen navigointi ja yläpalkin karttaselite */
.version-badge {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: .65rem;
  font-weight: 800;
  letter-spacing: .01em;
  white-space: nowrap;
}
.top-action-button {
  height: 40px;
  min-width: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-solid);
  color: var(--text);
  cursor: pointer;
  font-size: .72rem;
  font-weight: 760;
  transition: transform .15s, border-color .15s, background .15s;
}
.top-action-button:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); background: var(--accent-soft); }
.top-action-button svg { width: 18px; height: 18px; }
.top-actions a.top-action-button { text-decoration: none; }
.map-view-nav-link { color: var(--accent-strong); border-color: color-mix(in srgb, var(--accent) 38%, var(--line)); }
.info-action { color: var(--accent-strong); }

.legend-info-panel {
  position: absolute;
  z-index: 47;
  top: 12px;
  right: 12px;
  width: min(390px, calc(100vw - 24px));
  max-height: calc(100% - 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.legend-info-header {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px 11px 16px;
  border-bottom: 1px solid var(--line);
}
.legend-info-header h2 { margin: 1px 0 0; font-size: 1.05rem; letter-spacing: -.02em; }
.legend-info-scroll { max-height: calc(100vh - var(--topbar-h) - 108px); overflow: auto; overscroll-behavior: contain; padding: 14px 15px 18px; }
.legend-section + .legend-section { border-top: 1px solid var(--line); margin-top: 15px; padding-top: 15px; }
.legend-section h3 { margin: 0 0 10px; font-size: .82rem; }
.legend-section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.legend-mode-chip { max-width: 55%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 4px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: .62rem; font-weight: 780; }
.expanded-legend { grid-template-columns: 1fr; gap: 6px; }
.expanded-legend .legend-row { min-height: 24px; }
.symbol-legend-row, .status-legend-row { display: grid; grid-template-columns: 42px 1fr; align-items: center; gap: 10px; margin: 9px 0; }
.symbol-legend-row strong, .status-legend-row strong { display: block; font-size: .74rem; }
.symbol-legend-row small, .status-legend-row small { display: block; margin-top: 2px; color: var(--muted); font-size: .66rem; line-height: 1.35; }
.speed-demo { width: 34px; height: 34px; display: grid; place-items: center; border: 3px solid #d72b2b; border-radius: 50%; background: white; color: #111; font-size: .72rem; font-weight: 850; }
.direction-demo { width: 36px; text-align: center; font-size: 1.35rem; font-weight: 850; color: var(--accent-strong); }
.status-dot { width: 15px; height: 15px; margin-left: 9px; border-radius: 50%; border: 2px solid color-mix(in srgb, currentColor 25%, transparent); }
.status-dot.green { color: #2c8a4b; background: #2c8a4b; }
.status-dot.yellow { color: #b77900; background: #d89b1d; }
.status-dot.red { color: #b72929; background: #c93a3a; }
.legend-note p { margin: 0; color: var(--muted); font-size: .69rem; line-height: 1.5; }

.external-route-intro, .route-safety-note {
  border: 1px solid var(--line);
  border-radius: 13px;
  padding: 11px 12px;
  background: var(--surface-soft);
  margin-bottom: 14px;
}
.external-route-intro strong, .route-safety-note strong { display: block; font-size: .78rem; }
.external-route-intro p, .route-safety-note p { margin: 5px 0 0; color: var(--muted); font-size: .69rem; line-height: 1.45; }
.route-safety-note { margin: 14px 0 0; border-color: color-mix(in srgb, var(--warning) 35%, var(--line)); }
.compact-route-fields .route-field { min-height: 58px; }
.compact-actions { margin-top: 8px; }
.compact-actions .button { flex: 1 1 120px; }
.external-nav-button { min-height: 46px; margin-top: 12px; }

@media (max-width: 1440px) {
  .top-action-button span { display: none; }
  .top-action-button { width: 40px; padding: 0; }
}

@media (max-width: 1024px) {
  .version-badge { height: 22px; padding: 0 6px; font-size: .61rem; }
  .desktop-nav-action { display: none; }
  .legend-info-panel { width: min(370px, calc(100vw - 24px)); }
}

@media (max-width: 760px) {
  .version-badge { height: 20px; padding: 0 5px; font-size: .58rem; }
  .info-action span { display: none; }
  .info-action { width: 36px; height: 36px; padding: 0; }
  .legend-info-panel {
    z-index: 61;
    left: 6px;
    right: 6px;
    top: auto;
    bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0) + 6px);
    width: auto;
    max-height: min(70vh, 640px);
    border-radius: 20px;
  }
  .legend-info-scroll { max-height: calc(min(70vh, 640px) - 68px); }
  .map-scale-meta { display: none; }
  .external-route-intro { padding: 10px 11px; }
}

@media (max-width: 430px) {
  .brand { gap: 6px; }
  .brand-mark { width: 32px; height: 32px; }
  .version-badge { padding: 0 4px; font-size: .55rem; }
  .top-actions { gap: 4px; }
  .top-actions #locateBtn, .top-actions #legendQuickBtn { width: 34px; height: 34px; }
  .compact-actions { display: grid; grid-template-columns: 1fr 1fr; }
  .compact-actions .button:last-child { grid-column: 1 / -1; }
}

@media (max-width: 360px) {
  .brand-mark { display: none; }
  .global-search { min-width: 0; }
  .global-search input::placeholder { color: transparent; }
}

/* v2.1.1 */
.internal-route-intro { border-color: color-mix(in srgb, var(--accent) 32%, var(--line)); }
#calculateRouteBtn + #openGoogleMapsRouteBtn { margin-top: 7px; }

/* v2.1.2 – reititys ilman sisäistä turn-by-turn-navigointia ja mobiilin viimeistely */
.field-grid > *, .vehicle-grid > *, .field-group, .route-field > div { min-width: 0; }
.field-grid.two, .vehicle-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.vehicle-grid input, .vehicle-grid select, .field-grid input, .field-grid select { min-width: 0; max-width: 100%; }
.info-content, .drawer-scroll, .legend-info-scroll { overflow-x: hidden; }
.info-item strong, .driveability-list li, .driveability-title, .driveability-subtitle, .route-check-list li { overflow-wrap: anywhere; word-break: normal; }
.route-result .external-nav-button { margin-top: 10px; }

@media (max-width: 760px) {
  .drawer-scroll { padding-bottom: calc(26px + env(safe-area-inset-bottom, 0)); }
  .info-content { padding-bottom: calc(28px + env(safe-area-inset-bottom, 0)); }
  .legend-info-scroll { padding-bottom: calc(22px + env(safe-area-inset-bottom, 0)); }
  .route-field { grid-template-columns: 28px minmax(0,1fr) auto; gap: 7px; }
  .route-field .mini-button { min-width: 54px; padding-inline: 7px; }
}

@media (max-width: 520px) {
  .field-grid.two, .vehicle-grid { grid-template-columns: 1fr !important; }
  .field-grid .field-group, .vehicle-grid .field-group { margin-bottom: 8px; }
  .info-actions { display: grid; grid-template-columns: 1fr; }
  .info-actions .button { width: 100%; }
  .route-field { grid-template-columns: 26px minmax(0,1fr); align-items: center; }
  .route-field .mini-button { grid-column: 2; justify-self: start; margin-top: -1px; }
  .route-connector { margin-left: 11px; }
}

@media (max-width: 430px) {
  .vehicle-grid { grid-template-columns: 1fr !important; }
  .drawer { left: 4px; right: 4px; bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0) + 4px); height: min(74vh, 680px); }
  .info-panel { left: 4px; right: 4px; bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0) + 4px); height: min(68vh, 640px); }
  .legend-info-panel { left: 4px; right: 4px; bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0) + 4px); }
  .drawer-scroll { padding-left: 12px; padding-right: 12px; }
  .global-search { grid-template-columns: 26px minmax(0,1fr); }
  .global-search svg { width: 16px; }
  .global-search input { min-width: 0; padding-right: 2px; }
  .version-badge { flex-shrink: 0; }
}

@media (max-width: 360px) {
  .topbar { grid-template-columns: auto minmax(0,1fr) auto; gap: 5px; padding-left: 5px; padding-right: 5px; }
  .global-search { height: 36px; }
  .global-search input { height: 34px; font-size: .76rem; }
  .top-actions #locateBtn { display: none; }
  .top-actions #legendQuickBtn { width: 32px; height: 32px; }
  .version-badge { height: 18px; font-size: .52rem; }
  .mobile-nav { padding-left: 2px; padding-right: 2px; }
  .mobile-nav-button { font-size: .58rem; }
}

@media (max-height: 520px) and (orientation: landscape) and (max-width: 1000px) {
  .drawer-scroll, .info-content, .legend-info-scroll { scrollbar-gutter: stable; }
  .drawer { width: min(420px, 58vw); }
  .info-panel { width: min(430px, 58vw); }
}

/* v2.1.3 – kartan lataustila pois yläpalkista ja näkyvä heartbeat-indikaattori kartalle */
.data-activity-bar {
  position: absolute;
  z-index: 34;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  overflow: hidden;
  pointer-events: none;
  opacity: 0;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  transition: opacity .18s ease;
}
.data-activity-bar.active { opacity: 1; }
.data-activity-bar span {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 42%;
  border-radius: 999px;
  background: linear-gradient(90deg, #147d92 0%, #20a06b 38%, #e3a21a 67%, #147d92 100%);
  box-shadow: 0 0 12px color-mix(in srgb, var(--accent) 55%, transparent);
  animation: data-loader-sweep 1.15s cubic-bezier(.45,.05,.55,.95) infinite;
}
@keyframes data-loader-sweep {
  0% { transform: translateX(-120%); opacity: .55; }
  42% { opacity: 1; }
  100% { transform: translateX(340%); opacity: .7; }
}

.map-data-status {
  position: absolute;
  z-index: 35;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  max-width: min(520px, calc(100% - 32px));
  padding: 7px 13px 7px 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
  color: var(--text);
  box-shadow: 0 10px 28px rgba(16,42,67,.17);
  backdrop-filter: blur(16px);
  pointer-events: none;
}
.map-data-status[hidden] { display: none !important; }
.status-heartbeat {
  flex: 0 0 auto;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  background: var(--muted);
}
.status-copy { min-width: 0; display: flex; flex-direction: column; line-height: 1.18; }
.status-copy strong { font-size: .74rem; font-weight: 820; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status-copy small { margin-top: 3px; color: var(--muted); font-size: .64rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.map-data-status.status-loading {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  background: color-mix(in srgb, var(--accent-soft) 90%, var(--surface-solid));
  color: var(--accent-strong);
}
.map-data-status.status-loading .status-heartbeat {
  background: var(--accent);
  animation: data-heartbeat 1.05s ease-in-out infinite;
}
@keyframes data-heartbeat {
  0%, 100% { transform: scale(.82); box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 42%, transparent); }
  35% { transform: scale(1.15); box-shadow: 0 0 0 7px color-mix(in srgb, var(--accent) 0%, transparent); }
  48% { transform: scale(.95); }
  62% { transform: scale(1.1); box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 0%, transparent); }
}
.map-data-status.status-ok { border-color: #a9d8b8; background: color-mix(in srgb, #e8f7ed 92%, var(--surface-solid)); color: #215f39; }
.map-data-status.status-ok .status-heartbeat { background: #2c8a4b; }
.map-data-status.status-error { border-color: #e3aaaa; background: color-mix(in srgb, #fff0f0 92%, var(--surface-solid)); color: var(--danger); }
.map-data-status.status-error .status-heartbeat { background: #c93a3a; }
html[data-theme="dark"] .map-data-status.status-ok { background: #173729; color: #9fe0b6; border-color: #315e42; }
html[data-theme="dark"] .map-data-status.status-error { background: #3a1f23; color: #ffaaaa; border-color: #633039; }

/* Varsinaiset virhe- ja zoom-ilmoitukset tulevat latausindikaattorin alle eivätkä päälle. */
.map-error, .map-notice { top: 66px; }

@media (max-width: 760px) {
  .map-data-status {
    top: 8px;
    min-height: 42px;
    max-width: calc(100% - 18px);
    padding: 6px 11px 6px 9px;
    border-radius: 13px;
  }
  .status-copy strong { font-size: .71rem; }
  .status-copy small { font-size: .61rem; }
  .map-error, .map-notice { top: 58px; }
}

@media (max-width: 430px) {
  .map-data-status { width: calc(100% - 18px); justify-content: center; }
  .status-copy { max-width: calc(100% - 28px); }
}

@media (prefers-reduced-motion: reduce) {
  .data-activity-bar span, .map-data-status.status-loading .status-heartbeat { animation: none !important; }
}


/* v2.1.7 – hakutuloksen karttamerkki ja hover-kohdetiedot */
.search-location-marker {
  position: relative;
  width: 42px;
  height: 50px;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: pointer;
  overflow: visible;
  filter: drop-shadow(0 5px 10px rgba(0,0,0,.24));
}
.search-location-pin {
  position: absolute;
  left: 5px;
  top: 2px;
  width: 32px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #fff;
  transform-origin: 50% 100%;
  transition: transform .16s ease;
}
.search-location-pin svg { width: 32px; height: 38px; overflow: visible; }
.search-location-pin path { fill: var(--accent); stroke: #fff; stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.search-location-pin circle { fill: #fff; stroke: none; }
.search-location-halo {
  position: absolute;
  left: 10px;
  bottom: 3px;
  width: 22px;
  height: 9px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 34%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 64%, transparent);
  animation: search-location-pulse 1.9s ease-out infinite;
}
.search-location-marker:hover .search-location-pin,
.search-location-marker:focus-visible .search-location-pin,
.search-location-marker.active .search-location-pin { transform: translateY(-2px) scale(1.08); }
.search-location-marker:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 3px; border-radius: 14px; }
@keyframes search-location-pulse {
  0% { transform: scale(.65); opacity: .95; }
  70%,100% { transform: scale(1.8); opacity: 0; }
}
.search-location-popup .maplibregl-popup-content { min-width: 250px; max-width: 330px; padding: 14px 14px 12px; }
.search-location-popup .maplibregl-popup-close-button {
  position: absolute; top: 8px; right: 8px; width: 30px; height: 30px;
  display: grid; place-items: center; padding: 0; border: 1px solid var(--line); border-radius: 10px;
  background: color-mix(in srgb, var(--surface-solid) 96%, transparent); color: var(--text);
  font-size: 22px; line-height: 1; font-weight: 500; box-shadow: 0 2px 8px rgba(18,38,55,.12); cursor: pointer;
}
.search-location-popup .maplibregl-popup-close-button:hover,
.search-location-popup .maplibregl-popup-close-button:focus-visible { background: var(--accent-soft); color: var(--accent-strong); outline: none; }
.search-popup-card { min-width: 0; }
.search-popup-title { display: block; padding-right: 38px; font-size: .84rem; line-height: 1.3; overflow-wrap: anywhere; }
.search-popup-coords { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-top: 8px; padding: 7px 8px; border-radius: 9px; background: var(--accent-soft); }
.search-popup-coords span { color: var(--muted); font-size: .61rem; font-weight: 760; }
.search-popup-coords b { font-size: .69rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.search-popup-details { margin: 9px 0 0; }
.search-popup-details div { display: grid; grid-template-columns: 82px minmax(0,1fr); gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.search-popup-details div:last-child { border-bottom: 0; }
.search-popup-details dt { color: var(--muted); font-size: .62rem; }
.search-popup-details dd { margin: 0; font-size: .67rem; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.search-popup-source { margin-top: 8px; color: var(--muted); font-size: .58rem; line-height: 1.3; }
@media (max-width: 430px) {
  .search-location-popup .maplibregl-popup-content { min-width: 220px; max-width: min(290px, calc(100vw - 44px)); }
  .search-popup-details div { grid-template-columns: 72px minmax(0,1fr); }
  .search-popup-coords { align-items: flex-start; flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .search-location-halo { animation: none; opacity: .5; }
}


/* v2.1.7 – hakukohteen popup aina passiivisen latausilmaisimen päällä ja mobiilin pysyvä tievalinta */
.search-location-popup { z-index: 36 !important; }

.selected-road-hint {
  display: none;
}

@media (max-width: 760px) {
  .selected-road-hint:not([hidden]) {
    position: absolute;
    z-index: 54;
    left: 8px;
    right: 8px;
    bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0) + 9px);
    min-height: 52px;
    display: grid;
    grid-template-columns: 7px minmax(0,1fr) auto 30px;
    align-items: center;
    gap: 9px;
    padding: 7px 7px 7px 9px;
    border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
    border-radius: 15px;
    background: color-mix(in srgb, var(--surface-solid) 95%, transparent);
    box-shadow: 0 9px 28px rgba(16,42,67,.18);
    backdrop-filter: blur(16px);
  }
  .selected-road-hint-mark {
    width: 7px;
    align-self: stretch;
    min-height: 34px;
    border-radius: 999px;
    background: #59d4e5;
    box-shadow: 0 0 0 2px rgba(11,23,32,.72), 0 0 12px rgba(89,212,229,.42);
  }
  .selected-road-hint-copy { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .selected-road-hint-copy small { color: var(--muted); font-size: .59rem; font-weight: 760; line-height: 1.1; }
  .selected-road-hint-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .72rem; line-height: 1.25; }
  .selected-road-hint-open {
    min-height: 34px;
    padding: 0 10px;
    border: 1px solid color-mix(in srgb, var(--accent) 42%, var(--line));
    border-radius: 10px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: .66rem;
    font-weight: 800;
    cursor: pointer;
  }
  .selected-road-hint-clear {
    width: 30px;
    height: 30px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--muted);
    font-size: 1.15rem;
    line-height: 1;
    cursor: pointer;
  }
  .selected-road-hint-clear:hover,
  .selected-road-hint-clear:focus-visible { background: var(--surface-soft); color: var(--text); }
}

@media (max-width: 390px) {
  .selected-road-hint:not([hidden]) { grid-template-columns: 6px minmax(0,1fr) auto 28px; gap: 7px; padding-left: 8px; }
  .selected-road-hint-open { padding-inline: 8px; }
  .selected-road-hint-copy strong { font-size: .68rem; }
}

/* v2.1.7 – MapLibre-karttakontrollien kontrasti mobiilissa ja tummassa käyttöjärjestelmäteemassa */
.maplibregl-ctrl-group {
  color-scheme: light !important;
  background: #ffffff !important;
  border-color: #cbd8e2 !important;
}
.maplibregl-ctrl-group button {
  appearance: none;
  -webkit-appearance: none;
  width: 36px;
  height: 36px;
  padding: 0;
  background-color: #ffffff !important;
  color: #102a43 !important;
  border-color: #d7e1e9 !important;
}
.maplibregl-ctrl-group button:hover,
.maplibregl-ctrl-group button:focus-visible {
  background-color: #eaf5f7 !important;
}
.maplibregl-ctrl-group button:focus-visible {
  outline: 3px solid rgba(20,125,146,.28) !important;
  outline-offset: -3px;
}
.maplibregl-ctrl button .maplibregl-ctrl-icon {
  opacity: 1 !important;
  filter: none !important;
}
.maplibregl-ctrl-geolocate-active,
.maplibregl-ctrl-geolocate-background {
  background-color: #e4f5f7 !important;
}
.maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon {
  opacity: .7 !important;
}
.icon-button.location-active {
  border-color: var(--accent);
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.tieinfo-user-location {
  display: block;
  width: 17px;
  height: 17px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  background: #168fee;
  box-shadow: 0 0 0 2px rgba(29,115,190,.45), 0 2px 8px rgba(16,42,67,.36);
  pointer-events: none;
}
.icon-button.location-loading svg,
.tieinfo-location-control .maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon {
  animation: tieinfo-location-wait 1.05s ease-in-out infinite;
}
@keyframes tieinfo-location-wait {
  0%, 100% { opacity: 1; }
  50% { opacity: .42; }
}
@media (prefers-reduced-motion: reduce) {
  .icon-button.location-loading svg,
  .tieinfo-location-control .maplibregl-ctrl-geolocate-waiting .maplibregl-ctrl-icon {
    animation: none;
  }
}

@media (max-width: 760px) {
  .maplibregl-ctrl-bottom-right .maplibregl-ctrl-group {
    border-radius: 14px !important;
    box-shadow: 0 8px 22px rgba(16,42,67,.22) !important;
  }
  .maplibregl-ctrl-group button {
    width: 36px;
    height: 36px;
  }
  .maplibregl-ctrl button .maplibregl-ctrl-icon {
    transform: scale(1.08);
    transform-origin: center;
  }
}

@media (max-width: 390px) {
  .maplibregl-ctrl-group button {
    width: 36px;
    height: 36px;
  }
}

/* v2.2.0 — Info / palvelutiedot */
.info-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-solid) 88%, transparent);
}
.info-tab {
  min-height: 36px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font: inherit;
  font-size: .72rem;
  font-weight: 780;
}
.info-tab:hover { background: var(--surface-soft); color: var(--text); }
.info-tab.active {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  background: var(--accent-soft);
  color: var(--accent-strong);
}
.info-tab:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent); outline-offset: 1px; }
.legend-info-scroll { max-height: calc(100vh - var(--topbar-h) - 150px); }

.about-hero {
  padding: 2px 0 4px;
}
.about-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--accent-strong);
  font-size: .62rem;
  font-weight: 850;
  letter-spacing: .08em;
}
.about-hero h3 { margin: 0; font-size: 1rem; line-height: 1.25; letter-spacing: -.015em; }
.about-hero p, .about-text, .source-footnote, .about-notice p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: .7rem;
  line-height: 1.55;
}
.about-notice p + p { margin-top: 10px; }
.about-notice strong { color: var(--text); }

.service-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 7px;
}
.service-status-item {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}
.service-status-item span {
  display: block;
  color: var(--muted);
  font-size: .59rem;
  line-height: 1.25;
}
.service-status-item strong {
  display: block;
  margin-top: 3px;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: .69rem;
  line-height: 1.3;
}

.source-list { display: grid; gap: 7px; }
.source-card {
  display: block;
  padding: 10px 11px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, transform .15s ease;
}
.source-card:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--accent) 42%, var(--line));
  background: var(--accent-soft);
}
.source-card:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 38%, transparent); outline-offset: 1px; }
.source-card strong { display: block; font-size: .75rem; }
.source-card span { display: block; margin-top: 3px; color: var(--muted); font-size: .66rem; line-height: 1.4; }
.source-card small { display: block; margin-top: 5px; color: var(--accent-strong); font-size: .61rem; font-weight: 720; line-height: 1.35; }
.source-footnote { padding: 8px 2px 0; }

/* MapLibre-attribuutio pidetään luettavana myös mobiilissa. */
.maplibregl-ctrl-attrib { max-width: min(78vw, 620px); }
.maplibregl-ctrl-attrib a { text-underline-offset: 2px; }

@media (max-width: 760px) {
  .legend-info-panel { max-height: min(74vh, 680px); }
  .legend-info-scroll { max-height: calc(min(74vh, 680px) - 112px); }
  .info-tabs { padding: 7px 9px; }
  .info-tab { min-height: 38px; }
  .service-status-grid { grid-template-columns: 1fr; }
  .about-hero h3 { font-size: .94rem; }
  .about-hero p, .about-text, .source-footnote, .about-notice p { font-size: .72rem; }
  .source-card span { font-size: .68rem; }
}

@media (max-width: 390px) {
  .legend-info-panel { max-height: min(76vh, 700px); }
  .legend-info-scroll { max-height: calc(min(76vh, 700px) - 110px); padding-left: 12px; padding-right: 12px; }
  .info-tab { font-size: .69rem; }
  .service-status-item { padding: 8px 9px; }
}

/* v2.2.0 — lisenssilinkit ja näkyvä kartta-attribuutio */
.source-license-links {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.source-license-links a { color: var(--accent); font-weight: 700; }
.maplibregl-ctrl-attrib:not(.maplibregl-compact) {
  max-width: min(72vw, 760px);
  white-space: normal;
  line-height: 1.25;
}
@media (max-width: 760px) {
  .maplibregl-ctrl-attrib:not(.maplibregl-compact) {
    max-width: calc(100vw - 118px);
    font-size: 9px;
    line-height: 1.15;
  }
}

/* v2.2.3 — kartta-attribuution kevyt mobiili- ja työpöytäesitys */
.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib {
  margin-bottom: 8px;
}
.maplibregl-ctrl-attrib.maplibregl-compact {
  max-width: none !important;
  background: color-mix(in srgb, var(--surface-solid) 90%, transparent) !important;
  border: 1px solid color-mix(in srgb, var(--line) 88%, transparent);
  border-radius: 12px;
  box-shadow: var(--shadow-soft);
  overflow: hidden;
  backdrop-filter: blur(10px);
}
.maplibregl-ctrl-attrib.maplibregl-compact button {
  min-width: 30px;
  height: 30px;
  padding: 0;
  display: grid;
  place-items: center;
  background: transparent !important;
}
.maplibregl-ctrl-attrib.maplibregl-compact button::after {
  content: "i";
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  line-height: 1;
}
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button {
  font-size: 0;
  color: transparent;
}
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner,
.maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-inner * {
  font-size: 11px;
  line-height: 1.3;
}
.maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show {
  max-width: min(62vw, 460px) !important;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--surface-solid) 95%, transparent) !important;
}
.maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show button {
  position: absolute;
  top: 6px;
  right: 6px;
}
.maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {
  padding-right: 20px;
}

/* Kartan mittakaava ja aineistolähteet eivät peitä toisiaan. */
.maplibregl-ctrl-bottom-left { display:flex; align-items:flex-end; gap:6px; }
.maplibregl-ctrl-bottom-left > .maplibregl-ctrl { float:none; margin:0 0 8px 8px; }
.maplibregl-ctrl-scale { order:-2; flex:0 0 auto; }
.map-base-name-control { order:-1; max-width:180px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
@media (max-width: 760px) {
  .maplibregl-ctrl-bottom-left { bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0) + 6px); }
  .maplibregl-ctrl-attrib.maplibregl-compact { border-radius: 11px; }
  .maplibregl-ctrl-attrib.maplibregl-compact button { min-width: 28px; height: 28px; }
  .maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show {
    max-width: min(68vw, 320px) !important;
    font-size: 10px;
  }
}

/* MML- ja muut pistekyselyt avautuvat kartan sivuun/alareunaan ilman estävää modaalitaustaa. */
.map-query-panel {
  position:absolute; z-index:88; top:12px; right:12px; width:min(350px,calc(100% - 24px)); max-height:calc(100% - 24px);
  overflow:hidden; border:1px solid var(--line); border-radius:15px; background:var(--surface-solid); color:var(--text); box-shadow:var(--shadow);
}
.map-query-panel[hidden] { display:none; }
.map-query-panel > header { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:10px 12px; border-bottom:1px solid var(--line); background:var(--surface-soft); }
.map-query-panel > header small,.map-query-panel > header strong { display:block; }
.map-query-panel > header small { color:var(--muted); font-size:.58rem; letter-spacing:.09em; }
.map-query-panel > header strong { margin-top:2px; font-size:.82rem; }
.map-query-panel > header button { width:34px; height:34px; border:1px solid var(--line); border-radius:10px; background:var(--surface-solid); color:var(--text); font-size:1.25rem; cursor:pointer; }
.map-query-panel-scroll { max-height:calc(100dvh - var(--topbar-h) - 64px); overflow:auto; padding:12px; }
.coordinate-copy-actions { display:flex; flex-wrap:wrap; gap:6px; margin-top:10px; }

/* Havaintoilmoitus pysyy kartan reunassa; valittu karttapiste jää näkyviin. */
@media (min-width:761px) {
  .observation-modal { inset:var(--topbar-h) 0 0 auto !important; width:390px; padding:12px !important; place-items:stretch !important; background:transparent !important; pointer-events:none; }
  .observation-dialog { width:100% !important; max-height:100% !important; pointer-events:auto; box-shadow:-8px 0 28px rgba(15,23,42,.22) !important; }
}
@media (max-width:760px) {
  .map-query-panel { position:fixed; top:auto; right:8px; bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom,0px) + 8px); left:8px; width:auto; max-height:min(58dvh,480px); border-radius:17px; }
  .map-query-panel-scroll { max-height:min(48dvh,390px); }
  .observation-modal { align-items:end !important; padding:0 8px calc(var(--mobile-nav-h) + env(safe-area-inset-bottom,0px) + 8px) !important; background:transparent !important; pointer-events:none; }
  .observation-dialog { width:100% !important; max-height:min(68dvh,620px) !important; pointer-events:auto; border-radius:18px 18px 12px 12px !important; box-shadow:0 -10px 34px rgba(15,23,42,.25) !important; }
}


/* v2.2.3 — toiminnallisten tieluokkien suodatus ja selkeämpi lähizoom */
.legend-row-hidden { opacity: .38; }
.legend-row-hidden .legend-line { filter: grayscale(.65); }
.road-class-filter-section { display: grid; gap: 10px; }
.road-class-filter-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.road-class-filter-head strong { display: block; font-size: .76rem; }
.road-class-filter-head small { display: block; margin-top: 3px; color: var(--muted); font-size: .65rem; line-height: 1.35; }
.filter-count { flex: 0 0 auto; padding: 4px 7px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-soft); color: var(--muted); font-size: .61rem; font-weight: 760; white-space: nowrap; }
.road-class-presets { display: flex; flex-wrap: wrap; gap: 6px; }
.road-class-filter { display: grid; grid-template-columns: 1fr; gap: 5px; }
.road-class-option { min-height: 34px; display: grid; grid-template-columns: 18px 14px 24px 1fr; align-items: center; gap: 7px; padding: 5px 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-soft); cursor: pointer; }
.road-class-option:hover { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); }
.road-class-option input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.road-class-swatch { width: 14px; height: 14px; border-radius: 999px; box-shadow: 0 0 0 1px rgba(255,255,255,.72), 0 0 0 2px rgba(15,23,42,.12); }
.road-class-code { font-size: .68rem; font-weight: 820; color: var(--text); }
.road-class-label { min-width: 0; font-size: .68rem; color: var(--muted); line-height: 1.25; }
@media (min-width: 520px) and (max-width: 760px) { .road-class-filter { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media (max-width: 390px) {
  .road-class-filter-head { display: grid; }
  .filter-count { justify-self: start; }
  .road-class-option { grid-template-columns: 18px 14px 22px 1fr; padding-left: 7px; padding-right: 7px; }
}

/* v2.2.5 — täsmällinen tielinkki-hover ja mobiilikohdistus */
.road-hover-info {
  position: absolute;
  z-index: 74;
  width: min(290px, calc(100vw - 28px));
  padding: 10px 12px;
  border: 1px solid color-mix(in srgb, var(--line) 82%, transparent);
  border-radius: 12px;
  background: color-mix(in srgb, var(--surface-solid) 96%, transparent);
  color: var(--text);
  box-shadow: 0 8px 24px rgba(15,23,42,.18);
  backdrop-filter: blur(10px);
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transform: none;
  transition: opacity .10s ease, visibility .10s ease;
}
.road-hover-info.flip-x { transform: none; }
.road-hover-info.show { opacity: 1; visibility: visible; }
.road-hover-top { display: grid; grid-template-columns: 11px minmax(0,1fr); gap: 9px; align-items: start; }
.road-hover-swatch { width: 11px; height: 34px; border-radius: 999px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.45); }
.road-hover-top strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .79rem; line-height: 1.2; }
.road-hover-top span:not(.road-hover-swatch) { display: block; margin-top: 3px; font-size: .68rem; line-height: 1.3; color: var(--muted); }
.road-hover-meta { margin-top: 7px; font-size: .68rem; font-weight: 700; color: var(--text); }
.road-hover-style { margin-top: 5px; display: flex; align-items: center; gap: 6px; font-size: .64rem; color: var(--muted); }
.road-hover-mini-swatch { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.road-hover-hint { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); font-size: .61rem; color: var(--muted); }
@media (pointer: coarse), (max-width: 760px) {
  .road-hover-info { display: none !important; }
}

/* v2.2.5 — mobiilin tähtäin, rauhallisempi pitkäpainallus ja selkeä toimintovalikko */
.context-menu-header {
  display: grid;
  grid-template-columns: minmax(0,1fr) 34px;
  align-items: start;
  gap: 8px;
}
.context-menu-header-copy { min-width: 0; }
.context-menu-close {
  width: 34px !important;
  min-height: 34px !important;
  padding: 0 !important;
  display: grid !important;
  place-items: center;
  border: 1px solid var(--line) !important;
  border-radius: 10px !important;
  background: var(--surface-soft) !important;
  color: var(--text) !important;
  font-size: 1.35rem !important;
  line-height: 1 !important;
  text-align: center !important;
}
.context-menu-close:hover,
.context-menu-close:focus-visible { background: var(--accent-soft) !important; color: var(--accent-strong) !important; }

.mobile-center-target,
.mobile-center-road-info { display: none; }
.mobile-center-target {
  position: absolute;
  z-index: 46;
  width: 36px;
  height: 36px;
  transform: translate(-50%,-50%);
  pointer-events: none;
  --target-color: var(--accent);
}
.mobile-center-target-ring {
  position: absolute;
  inset: 5px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  box-shadow: 0 0 0 2px var(--target-color), 0 2px 9px rgba(15,23,42,.36);
  transition: box-shadow .12s ease, transform .12s ease;
}
.mobile-center-target::before,
.mobile-center-target::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  background: #ffffff;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--target-color) 88%, #0f172a 12%);
  transform: translate(-50%,-50%);
}
.mobile-center-target::before { width: 34px; height: 2px; }
.mobile-center-target::after { width: 2px; height: 34px; }
.mobile-center-target-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 6px;
  height: 6px;
  transform: translate(-50%,-50%);
  border-radius: 999px;
  background: var(--target-color);
  box-shadow: 0 0 0 2px #ffffff;
}
.mobile-center-target.has-road .mobile-center-target-ring { transform: scale(1.08); }

.mobile-center-road-info {
  position: absolute;
  z-index: 47;
  left: 50%;
  top: 76px;
  transform: translateX(-50%);
  width: min(390px, calc(100% - 22px));
  grid-template-columns: 10px minmax(0,1fr) auto;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid color-mix(in srgb, var(--line) 84%, transparent);
  border-radius: 13px;
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent);
  color: var(--text);
  box-shadow: 0 7px 22px rgba(15,23,42,.18);
  backdrop-filter: blur(12px);
  text-align: left;
}
.mobile-center-road-swatch {
  width: 8px;
  height: 34px;
  border-radius: 999px;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.48);
}
.mobile-center-road-copy { min-width: 0; display: block; }
.mobile-center-road-copy strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .75rem;
  line-height: 1.2;
}
.mobile-center-road-copy small {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--muted);
  font-size: .62rem;
  line-height: 1.25;
}
.mobile-center-road-action {
  padding: 5px 7px;
  border-radius: 8px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: .61rem;
  font-weight: 800;
}

/* MapLibre-attribuutio: avattu lähdetieto on aina vaalea ja korkean kontrastin kortti. */
.maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show,
html[data-theme="dark"] .maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show {
  background: rgba(255,255,255,.97) !important;
  color: #132438 !important;
  border-color: #c8d4df !important;
}
.maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show .maplibregl-ctrl-attrib-inner,
.maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show .maplibregl-ctrl-attrib-inner *,
html[data-theme="dark"] .maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show .maplibregl-ctrl-attrib-inner,
html[data-theme="dark"] .maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show .maplibregl-ctrl-attrib-inner * {
  color: #132438 !important;
}
.maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show a,
html[data-theme="dark"] .maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show a {
  color: #006c78 !important;
  font-weight: 700;
}
.maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show button::after,
html[data-theme="dark"] .maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show button::after { color: #132438 !important; }

@media (max-width: 760px), (pointer: coarse) {
  .mobile-center-target.enabled { display: block; }
  .mobile-center-road-info:not([hidden]) { display: grid; }
}

@media (max-width: 760px) {
  .context-menu {
    max-height: calc(100dvh - var(--topbar-h) - var(--mobile-nav-h) - env(safe-area-inset-bottom, 0) - 24px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .context-menu-header {
    position: sticky;
    top: -7px;
    z-index: 3;
    margin: -1px -1px 5px;
    padding: 10px 10px 9px;
    background: color-mix(in srgb, var(--surface-solid) 98%, transparent);
    border-radius: 16px 16px 0 0;
  }
  .context-menu button:not(.context-menu-close) { min-height: 43px; font-size: .76rem; }
  .mobile-center-road-info { top: 74px; }
}

@media (max-width: 390px) {
  .mobile-center-road-info {
    top: 68px;
    width: calc(100% - 16px);
    grid-template-columns: 8px minmax(0,1fr) auto;
    gap: 7px;
    padding: 8px 9px;
  }
  .mobile-center-road-copy small { font-size: .59rem; }
  .mobile-center-road-action { padding-inline: 6px; }
}

/* v2.3.2 — käyttäjähavainnot */
.observation-add-center { margin-top: 10px; }
.observation-modal {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  background: rgba(8,20,32,.58);
  backdrop-filter: blur(5px);
}
.observation-modal[hidden] { display: none !important; }
.observation-dialog {
  width: min(520px, 100%);
  max-height: min(760px, calc(100dvh - 36px));
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: 0 22px 70px rgba(0,0,0,.28);
}
.observation-dialog-header {
  min-height: 72px;
  padding: 14px 16px 12px 18px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.observation-dialog-header h2 { margin: 2px 0 0; font-size: 1.08rem; }
.observation-dialog-scroll { padding: 16px; overflow: auto; overscroll-behavior: contain; }
.observation-location-card {
  display: grid;
  gap: 3px;
  padding: 11px 12px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--surface-soft);
}
.observation-location-card strong { font-size: .82rem; }
.observation-location-card span, .observation-location-card small { color: var(--muted); font-size: .7rem; }
.observation-official-check {
  display: grid;
  gap: 4px;
  padding: 10px 11px;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: .72rem;
  line-height: 1.4;
}
.observation-official-check span, .observation-official-check small { color: var(--muted); }
.observation-official-check.status-checking { background: var(--accent-soft); border-color: color-mix(in srgb,var(--accent) 35%,var(--line)); }
.observation-official-check.status-found { background: #fff3e0; border-color: #efc47e; color: #613b00; }
.observation-official-check.status-clear { background: #ecf8f0; border-color: #b5ddc2; color: #1f5e34; }
.observation-official-check.status-neutral { background: var(--surface-soft); }
html[data-theme="dark"] .observation-official-check.status-found { background: #3b2a13; border-color: #70501e; color: #ffd899; }
html[data-theme="dark"] .observation-official-check.status-clear { background: #183326; border-color: #315c45; color: #a7dfb8; }
textarea {
  width: 100%;
  min-height: 88px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-solid);
  color: var(--text);
  padding: 10px 11px;
  outline: none;
  font: inherit;
}
textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb,var(--accent) 14%,transparent); }
.observation-unit {
  min-width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
  color: var(--muted);
  font-weight: 800;
}
.observation-notice {
  padding: 11px 12px;
  margin: 4px 0 14px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.observation-notice strong { font-size: .76rem; }
.observation-notice p { margin: 5px 0 0; color: var(--muted); font-size: .69rem; line-height: 1.45; }
.observation-actions { justify-content: flex-end; }
.observation-popup { min-width: 240px; max-width: 310px; }
.observation-popup-head { display: flex; align-items: center; gap: 9px; margin-bottom: 9px; }
.observation-popup-head > div { display: grid; gap: 2px; }
.observation-popup-head strong { font-size: .82rem; }
.observation-popup-head small { color: var(--muted); font-size: .65rem; }
.observation-popup-symbol { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 999px; background: #b91c1c; color: #fff; font-weight: 900; }
.observation-popup-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.observation-popup-grid > div { padding: 7px 8px; border-radius: 9px; background: var(--surface-soft); }
.observation-popup-grid span { display: block; color: var(--muted); font-size: .58rem; }
.observation-popup-grid strong { display: block; margin-top: 2px; font-size: .67rem; }
.observation-popup-description { margin: 9px 0; font-size: .72rem; line-height: 1.45; }
.observation-popup-trust { padding: 8px 9px; border-radius: 9px; background: #fff7e8; color: #714500; font-size: .65rem; line-height: 1.4; }
html[data-theme="dark"] .observation-popup-trust { background: #3c2a10; color: #ffd991; }
.observation-popup-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 9px; }
.observation-popup-actions .button { min-height: 35px; padding: 5px 8px; font-size: .64rem; }
.observation-popup-source { display: block; margin-top: 8px; color: var(--muted); font-size: .57rem; }

/* Havaintojen ylläpito */
.admin-page { min-height: 100vh; background: var(--bg); color: var(--text); }
.admin-shell { width: min(1100px, calc(100% - 28px)); margin: 0 auto; padding: 28px 0 60px; }
.admin-shell > header { display:flex; justify-content:space-between; gap:20px; align-items:flex-start; margin-bottom:20px; }
.admin-shell h1 { margin: 5px 0 0; font-size: 1.35rem; }
.admin-shell header a { color: var(--accent-strong); font-weight: 700; }
.admin-auth { padding: 15px; border:1px solid var(--line); border-radius:15px; background:var(--surface-solid); margin-bottom:14px; }
.admin-auth label { display:block; margin-bottom:6px; font-size:.72rem; font-weight:800; color:var(--muted); }
.admin-observation-list { display:grid; gap:10px; margin-top:14px; }
.admin-observation-card { padding:14px; border:1px solid var(--line); border-radius:15px; background:var(--surface-solid); }
.admin-observation-head { display:flex; justify-content:space-between; gap:12px; }
.admin-observation-head > div { display:grid; gap:3px; }
.admin-observation-head small,.admin-observation-meta { color:var(--muted); font-size:.66rem; }
.admin-observation-card p { margin:10px 0; font-size:.74rem; }
.admin-observation-actions { display:flex; flex-wrap:wrap; gap:7px; margin-top:11px; }
.observation-status { padding:4px 7px; border-radius:999px; font-size:.61rem; font-weight:800; background:var(--surface-soft); }
.observation-status.status-confirmed { background:#eaf7ee; color:#1e6838; }
.observation-status.status-reported { background:#fff4dc; color:#785000; }
.observation-status.status-resolved,.observation-status.status-expired { background:#eef1f4; color:#52606d; }
.observation-status.status-rejected { background:#fdebec; color:#9c1c25; }
.button.danger { background:#b4232d; color:#fff; border-color:#b4232d; }

@media (max-width:760px) {
  .observation-modal { padding: 0; align-items: end; }
  .observation-dialog { width:100%; max-height:88dvh; border-radius:20px 20px 0 0; border-bottom:0; }
  .observation-dialog-scroll { padding:14px 14px calc(18px + env(safe-area-inset-bottom,0)); }
  .observation-popup-actions { grid-template-columns:1fr; }
  .observation-actions { display:grid; grid-template-columns:1fr 1fr; }
  .observation-actions .button { width:100%; }
  .admin-shell > header { flex-direction:column; }
  .admin-observation-head { flex-direction:column; }
}
.observation-legend-dot { width:22px; height:22px; border-radius:999px; display:grid; place-items:center; color:#fff; font-size:.68rem; font-weight:900; box-shadow:0 0 0 2px #fff,0 0 0 3px var(--line); }
.observation-legend-dot.reported { background:#d97706; }
.observation-legend-dot.confirmed { background:#b91c1c; }
.observation-legend-line { width:30px; height:5px; border-radius:999px; background:repeating-linear-gradient(90deg,#d97706 0 7px,transparent 7px 11px); box-shadow:0 0 0 1px color-mix(in srgb,#d97706 40%,transparent); }

/* v2.3.2 — reitin käyttäjähavainnot */
#routeObservationResult { margin-top: 9px; }
.route-observation-check .route-check-head strong::before { content: "Käyttäjähavainnot · "; font-weight: 800; }

/* v2.3.2 — ylläpitopaneeli */
.admin-topbar { align-items:center !important; }
.admin-top-actions { display:flex; flex-wrap:wrap; align-items:center; gap:9px; }
.admin-auth h2 { margin:0 0 8px; font-size:1rem; }
.admin-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:14px 0; }
.admin-metrics .metric-card { padding:13px 14px; border:1px solid var(--line); border-radius:14px; background:var(--surface-solid); }
.admin-metrics .metric-card span { display:block; color:var(--muted); font-size:.68rem; font-weight:700; }
.admin-metrics .metric-card strong { display:block; margin-top:4px; font-size:1.35rem; }
.admin-toolbar { padding:14px; border:1px solid var(--line); border-radius:15px; background:var(--surface-solid); }
.admin-filter-grid { display:grid; grid-template-columns:minmax(220px,1.5fr) repeat(3,minmax(150px,1fr)); gap:9px; }
.admin-filter-grid label,.admin-edit-label,.admin-edit-grid label { display:grid; gap:5px; color:var(--muted); font-size:.68rem; font-weight:760; }
.admin-toolbar-actions { display:flex; flex-wrap:wrap; gap:7px; align-items:center; margin-top:10px; }
.admin-settings { margin:12px 0; border:1px solid var(--line); border-radius:14px; background:var(--surface-solid); overflow:hidden; }
.admin-settings > summary { cursor:pointer; padding:12px 14px; font-weight:780; }
.admin-settings-body { padding:0 14px 14px; }
.admin-result-count { margin:12px 2px 5px; color:var(--muted); font-size:.68rem; }
.admin-observation-flags { display:flex; flex-wrap:wrap; gap:6px; margin:9px 0; }
.admin-observation-flags span { padding:4px 7px; border-radius:999px; background:var(--surface-soft); color:var(--muted); font-size:.61rem; }
.admin-observation-card textarea { width:100%; resize:vertical; min-height:58px; border:1px solid var(--line); border-radius:10px; background:var(--surface-solid); color:var(--text); padding:8px 10px; font:inherit; }
.admin-edit-grid { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin:9px 0; }
.admin-edit-label { margin:9px 0; }
.admin-map-link { text-decoration:none; display:inline-flex; align-items:center; justify-content:center; }
@media (max-width:900px) {
  .admin-metrics { grid-template-columns:1fr 1fr; }
  .admin-filter-grid { grid-template-columns:1fr 1fr; }
}
@media (max-width:600px) {
  .admin-shell { width:min(100% - 18px,1100px); padding-top:16px; }
  .admin-metrics,.admin-filter-grid,.admin-edit-grid { grid-template-columns:1fr; }
  .admin-observation-actions .button,.admin-observation-actions .admin-map-link { flex:1 1 100%; }
}

/* v2.3.2 — vaihtoehtoiset reitit ja karttakohdistus */
.route-alternatives { display: grid; gap: 8px; margin-bottom: 10px; }
.route-option {
  width: 100%; text-align: left; border: 1px solid var(--line); border-radius: 13px;
  background: var(--surface-solid); color: var(--text); padding: 10px 11px; cursor: pointer;
  transition: border-color .15s, background .15s, transform .15s;
}
.route-option:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--accent) 46%, var(--line)); background: var(--surface-soft); }
.route-option.selected { border-color: color-mix(in srgb, #1e9d63 68%, var(--line)); background: color-mix(in srgb, #1e9d63 9%, var(--surface-solid)); box-shadow: inset 3px 0 0 #1e9d63; }
.route-option-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.route-option-head strong { font-size: .77rem; }
.route-option-head em { font-style: normal; font-size: .61rem; font-weight: 800; color: #166a43; background: #e6f5ed; border-radius: 999px; padding: 3px 7px; }
.route-option-metrics { display: flex; gap: 14px; margin-top: 5px; }
.route-option-metrics b { font-size: .78rem; font-weight: 760; }
.route-option small { display: block; margin-top: 4px; color: var(--muted); font-size: .65rem; }
.route-option-note { padding: 8px 10px; border-radius: 11px; background: var(--surface-soft); color: var(--muted); font-size: .66rem; line-height: 1.35; }
.route-map-actions { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; margin: 0 0 10px; }
.route-map-actions .button { min-width: 0; padding-inline: 8px; }
html[data-theme="dark"] .route-option-head em { color: #9de0bd; background: #173c2b; }
@media (max-width: 520px) {
  .route-map-actions { grid-template-columns: 1fr 1fr; }
  .route-map-actions .button.danger { grid-column: auto; }
}
@media (max-width: 390px) {
  .route-map-actions { grid-template-columns: 1fr; }
  .route-map-actions .button.danger { grid-column: auto; }
  .route-option-metrics { gap: 10px; }
}

.route-map-return {
  position: absolute; z-index: 37; left: 50%; bottom: 18px; transform: translateX(-50%);
  display: flex; flex-wrap: wrap; justify-content: center; gap: 7px; padding: 6px; border: 1px solid var(--line); border-radius: 14px;
  background: color-mix(in srgb, var(--surface-solid) 94%, transparent); box-shadow: var(--shadow-soft); backdrop-filter: blur(12px);
}
.route-map-return[hidden] { display: none !important; }
.route-map-return .button { min-height: 36px; white-space: nowrap; }
.route-alternative-hint { flex: 1 1 100%; width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 9px; padding: 5px 6px 6px; border-bottom: 1px solid var(--line); }
.route-alternative-hint[hidden] { display: none !important; }
.route-alternative-hint > span { min-width: 0; display: flex; align-items: center; gap: 7px; }
.route-alternative-hint i { width: 22px; height: 4px; flex: 0 0 22px; border-radius: 999px; background: repeating-linear-gradient(90deg,#7652c8 0 7px,transparent 7px 11px); }
.route-alternative-hint.previewing i { background: repeating-linear-gradient(90deg,#23a9a1 0 7px,transparent 7px 11px); }
.route-alternative-hint strong { color: var(--text); font-size: .62rem; line-height: 1.25; }
.route-alternative-hint .button { min-height: 30px; flex: 0 0 auto; padding: 4px 8px; font-size: .59rem; }
@media (max-width: 760px) {
  .route-map-return { bottom: calc(var(--mobile-nav-h) + env(safe-area-inset-bottom, 0) + 14px); width: calc(100vw - 28px); max-width: 460px; }
  .route-map-return .button { min-height: 40px; padding-inline: 11px; }
  .route-map-return .route-focus-button { flex: 1 1 28%; min-width: 88px; }
  .route-map-return .button.danger { flex-basis: 100%; }
  .route-alternative-hint { padding-inline: 3px; }
  .route-alternative-hint strong { font-size: .59rem; }
}

/* v2.8.0 — käyttäjähavaintojen tarkempi karttasuodatus */
.sub-switch-row {
  margin-left: 18px;
  padding-top: 7px;
  padding-bottom: 7px;
  opacity: .92;
}
.sub-switch-row strong { font-size: .78rem; }
.sub-switch-row small { font-size: .67rem; }
@media (max-width: 760px) {
  .sub-switch-row { margin-left: 10px; }
}
@media (min-width: 1100px) {
  .admin-metrics { grid-template-columns: repeat(6, minmax(0,1fr)); }
}

/* v2.8.0 — ylläpidon kartta, moderointi ja loki */
.admin-contact { color: var(--muted); font-size: .72rem; user-select: text; }
.warning-button { background: #fff7ed; border-color: #fdba74; color: #9a3412; }
html[data-theme="dark"] .warning-button { background:#3a2819; border-color:#7c4a1e; color:#fdba74; }
.admin-map-panel { margin: 14px 0; padding: 12px; border:1px solid var(--line); border-radius:15px; background:var(--surface-solid); }
.admin-section-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:10px; }
.admin-section-head > div { display:grid; gap:3px; }
.admin-section-head small { color:var(--muted); font-size:.67rem; }
.admin-map { width:100%; height:min(52vh,520px); min-height:320px; border-radius:13px; overflow:hidden; border:1px solid var(--line); }
.admin-moderation-list,.admin-audit-list { display:grid; gap:8px; margin-top:8px; }
.admin-moderation-row { display:flex; justify-content:space-between; gap:12px; align-items:center; padding:9px 10px; border:1px solid var(--line); border-radius:11px; background:var(--surface-soft); }
.admin-moderation-row > div { display:grid; gap:3px; min-width:0; }
.admin-moderation-row span,.admin-audit-row span { color:var(--muted); font-size:.66rem; line-height:1.4; overflow-wrap:anywhere; }
.admin-audit-row { display:grid; grid-template-columns:150px 1fr; gap:10px; padding:8px 0; border-bottom:1px solid var(--line); }
.admin-audit-row:last-child { border-bottom:0; }
.admin-audit-row time { color:var(--muted); font-size:.65rem; }
.admin-audit-row > div { display:grid; gap:3px; }
@media (max-width:760px){
  .admin-section-head,.admin-moderation-row { align-items:stretch; flex-direction:column; }
  .admin-audit-row { grid-template-columns:1fr; gap:3px; }
  .admin-map { min-height:360px; height:48vh; }
}

/* v3.0.20 — ylläpidon yksityisyyttä säästävä käyttökooste. */
.admin-usage-details>summary{color:var(--accent-strong)}.admin-usage-heading{margin:0 0 12px}.admin-usage-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:9px}.admin-usage-card{padding:11px 12px;border:1px solid var(--line);border-radius:11px;background:var(--surface-soft)}.admin-usage-card span{display:block;color:var(--muted);font-size:.68rem;font-weight:730}.admin-usage-card strong{display:block;margin-top:4px;color:var(--text);font-size:1.28rem}.admin-usage-groups{display:grid;grid-template-columns:1fr 1fr;gap:15px 18px;margin-top:16px}.admin-usage-groups>section{min-width:0}.admin-usage-groups h3{margin:0 0 8px;color:var(--text);font-size:.78rem}.admin-usage-breakdown,.admin-usage-days{display:grid;gap:7px}.admin-usage-row{display:grid;grid-template-columns:minmax(88px,1.2fr) minmax(52px,1fr) 34px;align-items:center;gap:7px}.admin-usage-row span{overflow:hidden;color:var(--muted);font-size:.68rem;text-overflow:ellipsis;white-space:nowrap}.admin-usage-row strong{text-align:right;font-size:.7rem}.admin-usage-row progress{width:100%;height:8px;overflow:hidden;border:0;border-radius:999px;background:var(--surface-soft);accent-color:var(--accent)}.admin-usage-row progress::-webkit-progress-bar{border-radius:999px;background:var(--surface-soft)}.admin-usage-row progress::-webkit-progress-value{border-radius:999px;background:var(--accent)}.admin-usage-row progress::-moz-progress-bar{border-radius:999px;background:var(--accent)}.admin-usage-day{display:grid;grid-template-columns:1fr 1fr 1fr;gap:6px;padding:5px 0;border-bottom:1px solid var(--line);font-size:.65rem}.admin-usage-day:last-child{border-bottom:0}.admin-usage-day time,.admin-usage-day span{color:var(--muted)}.admin-usage-day strong{text-align:right}.admin-usage-note{margin:14px 0 0;color:var(--muted);font-size:.66rem;line-height:1.45}
@media(max-width:760px){.admin-secret-entry{width:22px;height:22px}.admin-usage-metrics{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.admin-usage-card{padding:9px}.admin-usage-card strong{font-size:1.12rem}.admin-usage-groups{grid-template-columns:1fr;gap:14px}.admin-usage-row{grid-template-columns:minmax(108px,1.2fr) minmax(50px,1fr) 34px}.admin-usage-day{font-size:.63rem}}

/* v2.8.0 — reittien turvallisuusvertailu ja havaintoduplikaatit */
.route-option-safety { display:block; margin-top:7px; padding:4px 7px; border-radius:8px; font-size:.65rem; font-weight:760; text-align:left; }
.route-option-safety.ok { background:#e8f7ed; color:#24653d; }
.route-option-safety.warn,.route-option-safety.checking { background:#fff7df; color:#8a5a00; }
.route-option-safety.danger { background:#fff0f0; color:#a02222; }
.route-option-safety.neutral { background:var(--surface-soft); color:var(--muted); }
html[data-theme="dark"] .route-option-safety.ok { background:#173729; color:#8cdbab; }
html[data-theme="dark"] .route-option-safety.warn,html[data-theme="dark"] .route-option-safety.checking { background:#3a3117; color:#f2cf78; }
html[data-theme="dark"] .route-option-safety.danger { background:#3a1f23; color:#ff9c9c; }
.route-option-head > span { display:flex; gap:5px; align-items:center; flex-wrap:wrap; justify-content:flex-end; }
.recommended-tag { background:var(--accent-soft); color:var(--accent-strong); border:1px solid color-mix(in srgb,var(--accent) 30%,var(--line)); }
.route-check-actions { display:flex; gap:8px; margin-top:10px; flex-wrap:wrap; }
.observation-duplicate-check { margin:10px 0 12px; padding:11px 12px; border:1px solid #f0b35a; border-radius:12px; background:#fff8e8; color:#5f430c; }
.observation-duplicate-check > strong,.observation-duplicate-check > span,.observation-duplicate-check > small { display:block; }
.observation-duplicate-check > span { margin-top:4px; font-size:.75rem; }
.observation-duplicate-check > small { margin-top:4px; font-size:.67rem; line-height:1.4; }
.observation-duplicate-actions { display:flex; gap:7px; flex-wrap:wrap; margin-top:9px; }
html[data-theme="dark"] .observation-duplicate-check { background:#362d19; border-color:#7c5b20; color:#f4d58c; }
.plain-email { user-select:text; font-weight:700; }
@media (max-width:760px){
  .observation-duplicate-actions .button { flex:1 1 100%; }
}
.admin-duplicate-suggestions { margin-top:9px; padding:9px 10px; border:1px solid #f0b35a; border-radius:11px; background:#fff8e8; display:flex; gap:6px; align-items:center; flex-wrap:wrap; }
.admin-duplicate-suggestions > strong { font-size:.68rem; color:#7a4b00; margin-right:3px; }
html[data-theme="dark"] .admin-duplicate-suggestions { background:#362d19; border-color:#7c5b20; }
html[data-theme="dark"] .admin-duplicate-suggestions > strong { color:#f4d58c; }

/* v2.8.0 — tiiviimpi reitityspaneeli ja muokattavat välietapit */
@media (min-width: 761px) {
  .drawer.route-open { width: min(450px, calc(100vw - 116px)); }
  .drawer.route-open .drawer-scroll { padding-top: 12px; }
  .drawer.route-open .route-alternatives { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
  .drawer.route-open .route-option-note { grid-column: 1 / -1; }
}
.route-panel-compact { padding-bottom: 2px; }
.route-compact-intro {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  margin: -2px 0 8px; padding: 0 2px 8px; border-bottom: 1px solid var(--line);
}
.route-compact-intro strong { font-size: .78rem; white-space: nowrap; }
.route-compact-intro span { color: var(--muted); font-size: .64rem; text-align: right; line-height: 1.3; }
.route-panel-compact .compact-route-fields .route-field { min-height: 50px; }
.route-panel-compact .route-field label { margin-bottom: 3px; font-size: .69rem; }
.route-panel-compact .route-field input { height: 38px; }
.route-panel-compact .route-connector { height: 12px; }
.route-waypoint-head {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  margin: 7px 0 4px; padding-top: 5px; border-top: 1px solid var(--line);
}
.route-waypoint-head strong { font-size: .71rem; color: var(--muted); }
.route-add-waypoint { min-height: 30px; }
.waypoint-list { display: grid; gap: 5px; margin: 4px 0 6px; }
.waypoint-empty { padding: 3px 2px; color: var(--muted); font-size: .64rem; }
.waypoint-editor {
  display: grid; grid-template-columns: 28px minmax(0, 1fr) auto 30px; gap: 6px; align-items: end;
  padding: 6px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft);
}
.route-dot.waypoint { width: 24px; height: 24px; align-self: center; background: #7652c8; color: #fff; }
.waypoint-input-wrap { min-width: 0; }
.waypoint-input-wrap label { display: block; margin: 0 0 2px; color: var(--muted); font-size: .64rem; font-weight: 740; }
.waypoint-input-wrap input { height: 34px; padding-inline: 9px; font-size: .75rem; }
.waypoint-editor .mini-button { min-height: 34px; padding-inline: 8px; font-size: .65rem; }
.waypoint-remove {
  width: 30px; height: 34px; border: 0; border-radius: 8px; background: transparent;
  color: var(--danger); cursor: pointer; font-size: 1.15rem; line-height: 1;
}
.waypoint-remove:hover { background: color-mix(in srgb, var(--danger) 9%, transparent); }
.route-quick-actions { display: grid; grid-template-columns: 1fr 1fr auto; gap: 6px; margin: 6px 0; }
.route-quick-actions .button.compact { min-height: 34px; padding: 0 8px; font-size: .68rem; }
.route-primary-actions { display: grid; grid-template-columns: 1.45fr 1fr; gap: 7px; margin: 7px 0; }
.route-primary-actions .button { min-height: 42px; margin: 0; }
.route-settings-wrap, .route-checks-wrap, .route-legs-wrap {
  margin-top: 7px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-solid); overflow: hidden;
}
.route-settings-wrap > summary, .route-checks-wrap > summary, .route-legs-wrap > summary {
  cursor: pointer; padding: 8px 10px; font-size: .71rem; font-weight: 780; background: var(--surface-soft);
}
.route-settings-wrap[open] > summary, .route-checks-wrap[open] > summary, .route-legs-wrap[open] > summary { border-bottom: 1px solid var(--line); }
.route-setting-grid { padding: 9px 9px 0; gap: 7px; }
.route-setting-grid .field-group { margin-bottom: 7px; }
.route-setting-grid input, .route-setting-grid select { height: 36px; }
.compact-switch { margin: 3px 9px 9px; }
.compact-switch strong { font-size: .72rem; }
.compact-switch small { font-size: .63rem; }
.route-result { margin-top: 9px; }
.route-result-intro { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 7px; padding: 0 2px 7px; border-bottom: 1px solid var(--line); }
.route-result-intro strong { font-size: .76rem; }
.route-result-intro span { color: var(--muted); font-size: .61rem; text-align: right; line-height: 1.3; }
.drawer.route-results-only .route-planner-controls { display: none; }
.drawer.route-results-only .route-result { margin-top: 0; }
.route-result .route-alternatives { margin-bottom: 7px; }
.route-result .route-option { padding: 8px 9px; }
.route-result .route-option-safety { margin-top: 5px; padding: 3px 6px; }
.route-map-actions { margin-bottom: 7px; }
.route-map-actions .button { min-height: 34px; font-size: .67rem; }
.route-summary { padding: 8px; gap: 5px; }
.route-summary strong { margin-top: 2px; font-size: .82rem; }
.route-legs { display: grid; gap: 0; }
.route-leg-row { display: grid; grid-template-columns: 24px minmax(0,1fr); gap: 7px; align-items: center; padding: 7px 9px; border-bottom: 1px solid var(--line); }
.route-leg-row:last-child { border-bottom: 0; }
.route-leg-index { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 999px; background: var(--accent-soft); color: var(--accent-strong); font-size: .63rem; font-weight: 820; }
.route-leg-row strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .69rem; }
.route-leg-row small { display: block; margin-top: 2px; color: var(--muted); font-size: .64rem; }
.route-leg-note { margin: 0; padding: 7px 9px; border-top: 1px solid var(--line); color: var(--muted); font-size: .61rem; line-height: 1.35; }
.route-checks-wrap #routeRestrictionResult .route-check:first-child,
.route-checks-wrap #routeObservationResult .route-check:first-child { margin-top: 7px; margin-left: 7px; margin-right: 7px; }
.route-checks-wrap #routeObservationResult .route-check:last-child { margin-bottom: 7px; }
.route-steps-wrap { margin-top: 7px; padding-top: 0; border: 1px solid var(--line); border-radius: 11px; overflow: hidden; }
.route-steps-wrap summary { padding: 8px 10px; background: var(--surface-soft); }
.route-steps { margin: 0; padding: 9px 10px 10px 30px; max-height: 280px; overflow: auto; gap: 7px; }
.route-safety-details { margin: 8px 0 0; padding: 0; }
.route-safety-details > summary { cursor: pointer; padding: 8px 10px; font-size: .7rem; font-weight: 780; }
.route-safety-details p { margin: 0; padding: 0 10px 9px; }

@media (max-width: 760px) {
  .drawer.route-open { width: auto; }
  .route-compact-intro span { display: none; }
  .waypoint-editor { grid-template-columns: 26px minmax(0,1fr) 30px; align-items: center; }
  .waypoint-editor .mini-button { grid-column: 2; justify-self: start; min-height: 30px; margin-top: -1px; }
  .waypoint-remove { grid-column: 3; grid-row: 1 / span 2; }
  .route-primary-actions { grid-template-columns: 1.35fr 1fr; }
  .route-quick-actions { grid-template-columns: 1fr 1fr auto; }
  .route-result-intro { display: block; }
  .route-result-intro span { display: block; margin-top: 2px; text-align: left; }
}
@media (max-width: 390px) {
  .route-quick-actions { grid-template-columns: 1fr 1fr; }
  .route-quick-actions #clearRouteBtn { grid-column: 1 / -1; min-height: 30px; }
  .route-primary-actions { grid-template-columns: 1fr; }
}
.route-checks-wrap > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.route-checks-status { flex: 0 0 auto; padding: 2px 6px; border-radius: 999px; font-size: .56rem; font-weight: 850; letter-spacing: .03em; }
.route-checks-status.yellow { color: #8a5a00; background: #fff1c7; }
.route-checks-status.red { color: #a02222; background: #ffe0e0; }
html[data-theme="dark"] .route-checks-status.yellow { color: #f2cf78; background: #3a3117; }
html[data-theme="dark"] .route-checks-status.red { color: #ff9c9c; background: #3a1f23; }
.pwa-install-section .button { width: 100%; margin-top: 7px; }
.pwa-install-section small { display: block; margin-top: 7px; color: var(--muted); font-size: .64rem; line-height: 1.4; }


/* v2.8.0 — haun popupin selkeä sulkeminen ja reitin karttapoisto */
.search-location-popup .maplibregl-popup-close-button { z-index: 2; }

/* v2.8.0 — admin-näkymän itsenäinen sivuvieritys */
html.admin-document,
html.admin-document body.admin-page {
  height: auto !important;
  min-height: 100%;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior-y: auto;
}
html.admin-document body.admin-page {
  min-height: 100vh;
  min-height: 100dvh;
  -webkit-overflow-scrolling: touch;
}
html.admin-document .admin-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}
html.admin-document #adminApp {
  min-width: 0;
}
html.admin-document .admin-map-panel {
  min-width: 0;
}
html.admin-document .admin-map {
  display: block;
  max-width: 100%;
}
@media (max-width: 760px) {
  html.admin-document .admin-map {
    min-height: 300px;
    height: min(52dvh, 440px);
  }
  html.admin-document .admin-shell {
    padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
  }
}

/* v2.8.0 — MML-palveluasetukset ja karttatasot */
.mml-map-controls { margin-top: 10px; }
.admin-service-settings { margin-top: 14px; }
.admin-service-settings .admin-section-head { margin-bottom: 10px; }
.admin-service-settings .compact-switch { margin: 0; padding: 9px 10px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface-soft); }
.admin-service-settings code { font-size: .72rem; overflow-wrap: anywhere; }

/* v2.8.0 — MML paikkatieto- ja kiinteistöpopupit */
.mml-info-popup .maplibregl-popup-content { min-width: 235px; max-width: 310px; padding: 13px 14px 12px; }
.mml-info-popup .maplibregl-popup-close-button { width: 30px; height: 30px; margin: 4px; border-radius: 9px; font-size: 21px; line-height: 1; }
.mml-popup-card { min-width: 0; padding-right: 20px; }
.mml-popup-card > strong { display: block; font-size: .83rem; line-height: 1.3; margin-bottom: 7px; }
.mml-popup-card > p { margin: 5px 0 7px; font-size: .67rem; line-height: 1.4; color: var(--muted); }
.mml-popup-card dl { margin: 0; }
.mml-popup-card dl > div { display: grid; grid-template-columns: 80px minmax(0,1fr); gap: 8px; padding: 4px 0; border-bottom: 1px solid var(--line); }
.mml-popup-card dl > div:last-child { border-bottom: 0; }
.mml-popup-card dt { color: var(--muted); font-size: .61rem; }
.mml-popup-card dd { margin: 0; font-size: .68rem; font-weight: 680; line-height: 1.35; overflow-wrap: anywhere; }
.mml-popup-card > small { display: block; margin-top: 7px; color: var(--muted); font-size: .57rem; }
.mini-popup-button { margin-top: 8px; min-height: 30px; padding: 0 9px; border: 1px solid var(--line); border-radius: 9px; background: var(--surface-soft); color: var(--text); font-size: .62rem; font-weight: 720; cursor: pointer; }
@media (max-width:760px){
  .mml-info-popup .maplibregl-popup-content { min-width: 215px; max-width: min(285px, calc(100vw - 40px)); }
  .mml-popup-card dl > div { grid-template-columns: 72px minmax(0,1fr); }
}


/* v2.8.0 — ajoneuvoprofiili myös reittiasetuksissa */
.route-vehicle-dimensions { margin: 8px 0 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-soft); overflow: hidden; }
.route-vehicle-dimensions > summary { cursor: pointer; padding: 9px 11px; font-size: .76rem; font-weight: 760; color: var(--text); }
.route-dimension-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 7px; padding: 0 10px 8px; }
.route-dimension-grid label { min-width: 0; font-size: .66rem; color: var(--muted); font-weight: 700; }
.route-dimension-grid input { margin-top: 4px; height: 34px; padding: 0 8px; border-radius: 9px; }
.route-profile-note { display: block; padding: 0 10px 10px; color: var(--muted); font-size: .64rem; line-height: 1.35; }
.route-vehicle-summary { margin: 7px 0 9px; padding: 7px 9px; border-radius: 10px; background: var(--surface-soft); color: var(--muted); font-size: .69rem; line-height: 1.35; }
@media (max-width:760px){ .route-dimension-grid{grid-template-columns:repeat(2,minmax(0,1fr));} }


/* v2.8.0 — Digiroad-rajoitteiden hover ja kiinnitettävä popup */
.road-hover-info.restriction-hover {
  border-color: color-mix(in srgb, #b3261e 34%, var(--line));
}
.road-hover-info.restriction-hover .road-hover-meta {
  white-space: normal;
  max-width: 250px;
}
.restriction-info-popup .maplibregl-popup-content {
  min-width: 220px;
  max-width: 280px;
  padding: 13px 14px 12px;
}
.restriction-info-popup .maplibregl-popup-close-button {
  width: 30px;
  height: 30px;
  margin: 4px;
  border-radius: 9px;
  font-size: 21px;
  line-height: 1;
  z-index: 2;
}
.restriction-popup-card { padding-right: 20px; }
.restriction-popup-head { display:flex; gap:9px; align-items:center; }
.restriction-popup-head > div { min-width:0; }
.restriction-popup-head strong { display:block; font-size:.82rem; line-height:1.25; }
.restriction-popup-head span { display:block; margin-top:2px; color:var(--muted); font-size:.67rem; }
.restriction-popup-dot { flex:0 0 auto; width:12px; height:12px; border-radius:999px; box-shadow:0 0 0 2px #fff,0 0 0 3px color-mix(in srgb,var(--line) 80%,transparent); }
.restriction-popup-card p { margin:9px 0 0; font-size:.72rem; line-height:1.4; }
.restriction-popup-close-action { width:100%; margin-top:10px; min-height:34px; }
@media (max-width:760px) {
  .restriction-info-popup .maplibregl-popup-content { min-width:200px; max-width:min(270px,76vw); }
  .restriction-popup-card p { font-size:.70rem; }
}

/* v2.8.0 — Digiroad-aineiston laatu */
.quality-nav-link { text-decoration:none; color:inherit; }
.traffic-nav-link {
  position: relative;
  isolation: isolate;
  border-color: rgba(198, 40, 40, .45);
  background: color-mix(in srgb, #c62828 7%, var(--surface-solid));
  color: color-mix(in srgb, #bd2424 84%, var(--text));
  box-shadow: inset 0 0 0 1px rgba(198, 40, 40, .15), 0 0 0 1px rgba(198, 40, 40, .12), 0 0 8px rgba(198, 40, 40, .14);
  animation: traffic-nav-breathe 4.6s ease-in-out infinite;
}
.traffic-nav-link svg { color: #d75353; }
.traffic-nav-link:hover,
.traffic-nav-link:focus-visible {
  border-color: rgba(198, 40, 40, .86);
  background: color-mix(in srgb, #c62828 16%, var(--surface-solid));
}
@keyframes traffic-nav-breathe {
  0%, 58%, 100% { border-color: rgba(198, 40, 40, .38); background: color-mix(in srgb, #c62828 6%, var(--surface-solid)); box-shadow: inset 0 0 0 1px rgba(198, 40, 40, .12), 0 0 0 1px rgba(198, 40, 40, .10), 0 0 7px rgba(198, 40, 40, .12); }
  16% { border-color: rgba(198, 40, 40, .84); background: color-mix(in srgb, #c62828 18%, var(--surface-solid)); box-shadow: inset 0 0 0 1px rgba(198, 40, 40, .38), 0 0 0 3px rgba(198, 40, 40, .25), 0 0 19px rgba(198, 40, 40, .46); }
  25% { border-color: rgba(198, 40, 40, .55); background: color-mix(in srgb, #c62828 11%, var(--surface-solid)); box-shadow: inset 0 0 0 1px rgba(198, 40, 40, .22), 0 0 0 2px rgba(198, 40, 40, .16), 0 0 12px rgba(198, 40, 40, .24); }
  34% { border-color: rgba(198, 40, 40, .74); background: color-mix(in srgb, #c62828 15%, var(--surface-solid)); box-shadow: inset 0 0 0 1px rgba(198, 40, 40, .31), 0 0 0 3px rgba(198, 40, 40, .20), 0 0 16px rgba(198, 40, 40, .36); }
}
@keyframes traffic-nav-calm-breathe {
  0%, 100% { background: color-mix(in srgb, #c62828 7%, var(--surface-solid)); box-shadow: inset 0 0 0 1px rgba(198, 40, 40, .15), 0 0 9px rgba(198, 40, 40, .17); }
  50% { background: color-mix(in srgb, #c62828 13%, var(--surface-solid)); box-shadow: inset 0 0 0 1px rgba(198, 40, 40, .26), 0 0 14px rgba(198, 40, 40, .29); }
}
@media (prefers-reduced-motion: reduce) {
  .traffic-nav-link { animation: traffic-nav-calm-breathe 7.2s ease-in-out infinite !important; animation-duration: 7.2s !important; animation-iteration-count: infinite !important; }
}
.quality-panel-link { margin-top:7px; text-decoration:none; text-align:center; }
.quality-legend-dot { width:14px; height:14px; border-radius:999px; display:inline-block; box-shadow:0 0 0 2px #fff,0 0 0 3px var(--line); }
.quality-legend-dot.high, .qdot.high { background:#c62828; }
.quality-legend-dot.medium, .qdot.medium { background:#d98200; }
.quality-legend-dot.low, .qdot.low { background:#2672a5; }
.road-hover-info.quality-hover { border-color:color-mix(in srgb,#2672a5 42%,var(--line)); }
.road-hover-info.quality-hover .road-hover-meta { max-width:260px; white-space:normal; }
.quality-info-popup .maplibregl-popup-content { min-width:235px; max-width:340px; padding:13px 14px 12px; }
.quality-info-popup .maplibregl-popup-close-button { width:30px; height:30px; margin:4px; border-radius:9px; font-size:21px; line-height:1; z-index:2; }
.quality-popup-card { padding-right:20px; min-width:0; }
.quality-popup-card > strong { display:block; font-size:.84rem; line-height:1.3; margin-bottom:7px; }
.quality-selected-context{display:flex;align-items:center;gap:6px;margin:0 0 7px;color:var(--muted);font-size:.59rem;font-weight:760}
.quality-selected-context i{width:9px;height:9px;border-radius:999px;background:#2672a5}
.quality-selected-context.impact-high i{background:#c62828}.quality-selected-context.impact-medium i{background:#d98200}.quality-selected-context.impact-low i{background:#2672a5}
.quality-selected-marker{position:relative;display:block;width:17px;height:17px;border:3px solid #fff;border-radius:999px;background:var(--quality-selected-color,#2672a5);box-shadow:0 0 0 2px #102a43,0 0 0 5px rgba(255,255,255,.95);pointer-events:none}
.quality-selected-marker::after{position:absolute;inset:-10px;border:2px solid var(--quality-selected-color,#2672a5);border-radius:999px;content:""}
.quality-selected-marker.impact-high{--quality-selected-color:#c62828}.quality-selected-marker.impact-medium{--quality-selected-color:#d98200}.quality-selected-marker.impact-low{--quality-selected-color:#2672a5}
.quality-popup-card > p { margin:7px 0; font-size:.69rem; line-height:1.42; }
.quality-popup-badges { display:flex; flex-wrap:wrap; gap:5px; margin:4px 0 8px; }
.quality-popup-badges span { padding:3px 6px; border-radius:999px; background:var(--surface-soft); color:var(--muted); font-size:.58rem; font-weight:760; }
.quality-popup-badges .impact-high { color:#a32020; background:#ffe1e1; }
.quality-popup-badges .impact-medium { color:#815100; background:#fff0c8; }
.quality-popup-badges .impact-low { color:#165a7f; background:#dff2ff; }
html[data-theme="dark"] .quality-popup-badges .impact-high { color:#ff9b9b; background:#3c2020; }
html[data-theme="dark"] .quality-popup-badges .impact-medium { color:#ffd47c; background:#3b3119; }
html[data-theme="dark"] .quality-popup-badges .impact-low { color:#8fd5ff; background:#193246; }
.quality-evidence { padding:6px 8px; border-radius:9px; background:var(--surface-soft); color:var(--muted); }
.quality-popup-link { margin-top:9px; text-decoration:none; text-align:center; }
.quality-popup-note { display:block; margin-top:8px; color:var(--muted); font-size:.57rem; line-height:1.35; }
.route-quality-check .route-check-actions { margin-top:8px; }
.route-quality-check .route-check-actions a { text-decoration:none; }

html.quality-document,
html.quality-document body.quality-page { height:auto !important; min-height:100%; overflow:auto !important; }
body.quality-page { margin:0; background:var(--bg); color:var(--text); }
.quality-shell { min-height:100vh; min-height:100dvh; display:flex; flex-direction:column; }
.quality-topbar { min-height:68px; display:flex; align-items:center; justify-content:space-between; gap:18px; padding:10px 18px; background:var(--surface-solid); border-bottom:1px solid var(--line); position:sticky; top:0; z-index:20; }
.quality-brand { display:flex; align-items:center; gap:14px; min-width:0; }
.quality-brand h1 { margin:1px 0 0; font-size:1.18rem; }
.quality-brand small { color:var(--muted); font-size:.69rem; }
.quality-back { flex:0 0 auto; text-decoration:none; color:var(--accent-strong); font-weight:760; font-size:.76rem; padding:7px 9px; border:1px solid var(--line); border-radius:10px; background:var(--surface-soft); }
.quality-topmeta { display:flex; align-items:center; gap:9px; color:var(--muted); font-size:.65rem; white-space:nowrap; }
.quality-workspace { flex:1; min-height:0; display:grid; grid-template-columns:minmax(320px,410px) minmax(0,1fr); }
.quality-sidebar { min-width:0; padding:13px; border-right:1px solid var(--line); background:var(--surface-solid); overflow:auto; max-height:calc(100dvh - 104px); }
.quality-intro-card { padding:11px 12px; border:1px solid var(--line); border-radius:12px; background:var(--surface-soft); }
.quality-intro-card strong { display:block; font-size:.8rem; }
.quality-intro-card p { margin:5px 0 0; color:var(--muted); font-size:.66rem; line-height:1.45; }
.quality-actions { display:grid; grid-template-columns:1.25fr 1fr; gap:7px; margin:10px 0; }
.quality-actions .button { margin:0; min-height:38px; }
.quality-restriction-switch { margin:0 0 10px; border:1px solid var(--line); border-radius:11px; padding:8px 9px; background:var(--surface-soft); }
.quality-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:6px; margin-bottom:10px; }
.quality-metrics > div { min-width:0; padding:8px 7px; border:1px solid var(--line); border-radius:10px; background:var(--surface-soft); }
.quality-metrics span { display:block; color:var(--muted); font-size:.55rem; line-height:1.2; }
.quality-metrics strong { display:block; margin-top:3px; font-size:1rem; }
.quality-metrics .high strong { color:#c62828; }.quality-metrics .medium strong { color:#a76800; }.quality-metrics .low strong { color:#2672a5; }
.quality-filters { display:grid; grid-template-columns:1fr 1fr; gap:7px; margin-bottom:9px; }
.quality-filters label { min-width:0; color:var(--muted); font-size:.61rem; font-weight:700; }
.quality-filters select { width:100%; height:34px; margin-top:3px; border:1px solid var(--line); border-radius:9px; background:var(--surface-solid); color:var(--text); padding:0 7px; font-size:.65rem; }
.quality-load-state { margin:7px 0; padding:8px 9px; border-radius:9px; background:var(--surface-soft); color:var(--muted); font-size:.63rem; line-height:1.4; }
.quality-load-state.loading { color:#815100; background:#fff3d6; }.quality-load-state.ok { color:#17633a; background:#e3f6eb; }.quality-load-state.error { color:#9b2626; background:#ffe5e5; }
html[data-theme="dark"] .quality-load-state.loading { color:#f7d78c; background:#3b321e; } html[data-theme="dark"] .quality-load-state.ok { color:#9bd8b6; background:#183126; } html[data-theme="dark"] .quality-load-state.error { color:#ffabab; background:#3b2020; }
.quality-list { display:grid; gap:6px; padding-bottom:30px; }
.quality-list-item { width:100%; display:flex; align-items:flex-start; justify-content:space-between; gap:8px; text-align:left; padding:9px 9px 9px 11px; border:1px solid var(--line); border-left-width:4px; border-radius:10px; background:var(--surface-solid); color:var(--text); cursor:pointer; }
.quality-list-item:hover { background:var(--surface-soft); }
.quality-list-item.impact-high { border-left-color:#c62828; }.quality-list-item.impact-medium { border-left-color:#d98200; }.quality-list-item.impact-low { border-left-color:#2672a5; }
.quality-list-main { min-width:0; }
.quality-list-main strong { display:block; font-size:.7rem; line-height:1.3; }
.quality-list-main small { display:block; margin-top:3px; color:var(--muted); font-size:.58rem; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.quality-list-badges { flex:0 0 auto; display:flex; flex-direction:column; align-items:flex-end; gap:3px; }
.quality-list-badges i { font-style:normal; padding:2px 5px; border-radius:999px; background:var(--surface-soft); color:var(--muted); font-size:.52rem; font-weight:760; }
.quality-list-badges i.status { max-width:125px; white-space:normal; text-align:right; color:var(--accent-strong); }
.quality-empty { padding:18px 10px; color:var(--muted); text-align:center; font-size:.7rem; }
.quality-map-wrap { position:relative; min-width:0; min-height:520px; }
.quality-map { position:absolute; inset:0; }
.quality-map-legend { position:absolute; z-index:3; left:10px; bottom:25px; display:flex; gap:8px; padding:7px 9px; border-radius:10px; background:color-mix(in srgb,var(--surface-solid) 92%,transparent); box-shadow:0 3px 14px rgba(15,23,42,.14); font-size:.59rem; }
.quality-map-legend span { display:flex; align-items:center; gap:4px; }.qdot { width:8px; height:8px; border-radius:999px; display:inline-block; }
.quality-footer { min-height:36px; display:flex; justify-content:space-between; gap:12px; align-items:center; padding:7px 14px; border-top:1px solid var(--line); background:var(--surface-solid); color:var(--muted); font-size:.57rem; }
.quality-popup-card dl { margin:8px 0 0; }.quality-popup-card dl>div { display:grid; grid-template-columns:70px minmax(0,1fr); gap:7px; padding:4px 0; border-bottom:1px solid var(--line); }.quality-popup-card dt { color:var(--muted); font-size:.58rem; }.quality-popup-card dd { margin:0; font-size:.64rem; font-weight:700; overflow-wrap:anywhere; }
.quality-vote { margin-top:10px; padding-top:8px; border-top:1px solid var(--line); }.quality-vote>small,.quality-admin-actions>small { display:block; color:var(--muted); font-size:.58rem; margin-bottom:5px; }.quality-vote>div,.quality-admin-actions>div { display:flex; flex-wrap:wrap; gap:5px; }.quality-vote button,.quality-admin-actions button { border:1px solid var(--line); border-radius:8px; background:var(--surface-soft); color:var(--text); padding:6px 7px; font-size:.58rem; font-weight:700; cursor:pointer; }.quality-vote b { margin-left:3px; }
.quality-admin-actions { margin-top:9px; padding-top:8px; border-top:1px dashed var(--line); }

@media (max-width:900px){
  .quality-workspace { grid-template-columns:1fr; }
  .quality-sidebar { max-height:none; overflow:visible; border-right:0; border-bottom:1px solid var(--line); }
  .quality-map-wrap { min-height:55dvh; }
  .quality-map { position:absolute; }
}
@media (max-width:600px){
  .quality-topbar { position:relative; padding:9px 10px; align-items:flex-start; }
  .quality-topmeta { flex-direction:column; align-items:flex-end; gap:3px; }
  .quality-brand { gap:8px; }.quality-back { font-size:.65rem; padding:6px 7px; }
  .quality-brand h1 { font-size:1rem; }.quality-brand small { font-size:.6rem; }
  .quality-sidebar { padding:9px; }
  .quality-metrics { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .quality-actions { grid-template-columns:1fr; }
  .quality-filters { grid-template-columns:1fr 1fr; }
  .quality-map-wrap { min-height:62dvh; }
  .quality-footer { flex-direction:column; align-items:flex-start; }
  .quality-info-popup .maplibregl-popup-content { max-width:min(310px,82vw); }
}
.route-check.info { border-color:#9cc9e2; }
html[data-theme="dark"] .route-check.info { border-color:#315c73; }
.quality-community-signal { margin:8px 0 0 !important; padding:7px 8px; border-radius:9px; font-size:.62rem !important; }
.quality-community-signal.wrong { background:#fff0e8; color:#8a3a13; }
.quality-community-signal.correct { background:#e8f6ed; color:#21613b; }
html[data-theme="dark"] .quality-community-signal.wrong { background:#3a261e; color:#ffbd93; }
html[data-theme="dark"] .quality-community-signal.correct { background:#1d3426; color:#9ed9b3; }

.quality-mobile-link { text-decoration:none; }
.map-view-mobile-link { text-decoration:none; color:var(--accent-strong); }
@media (max-width:760px) {
  .digiroad-page .mobile-nav { grid-template-columns:repeat(7,1fr); padding-left:3px; padding-right:3px; }
  .digiroad-page .mobile-nav-button { min-width:0; font-size:.55rem; }
}
.quality-official-note { margin-top:7px !important; padding-top:7px; border-top:1px solid var(--line); font-size:.61rem !important; color:var(--muted); }
.quality-official-note a { color:var(--accent-strong); }
.quality-review-state { padding:5px 7px; border-radius:8px; background:var(--surface-soft); color:var(--accent-strong); font-weight:750; }
.route-checks-wrap #routeQualityResult .route-check { margin:7px; }
.quality-filter-search { grid-column:1/-1; }

/* v2.8.0 — aineiston laadun osoitehaku ja popupien näkyvyys */
.quality-place-search {
  position: relative;
  margin: 10px 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-soft);
}
.quality-place-search > label {
  display: block;
  margin-bottom: 5px;
  color: var(--text);
  font-size: .64rem;
  font-weight: 760;
}
.quality-place-search-row {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto;
  gap: 6px;
}
.quality-place-search-row input {
  min-width: 0;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface-solid);
  color: var(--text);
  padding: 0 9px;
  font-size: .67rem;
}
.quality-place-search-row .button {
  min-height: 36px;
  margin: 0;
  padding-inline: 12px;
}
.quality-place-search > small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: .56rem;
  line-height: 1.35;
}
.quality-search-results {
  position: absolute;
  z-index: 35;
  left: 9px;
  right: 9px;
  top: 69px;
  max-height: min(320px, 45dvh);
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface-solid);
  box-shadow: 0 10px 28px rgba(15,23,42,.18);
}
.quality-search-result {
  width: 100%;
  display: block;
  padding: 8px 9px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}
.quality-search-result:last-child { border-bottom: 0; }
.quality-search-result:hover { background: var(--surface-soft); }
.quality-search-result strong,
.quality-search-result span { display: block; }
.quality-search-result strong { font-size: .66rem; line-height: 1.3; }
.quality-search-result span { margin-top: 2px; color: var(--muted); font-size: .55rem; line-height: 1.3; }
.quality-search-state { padding: 10px; color: var(--muted); font-size: .62rem; }
.quality-search-state.error { color: #9b2626; }
html[data-theme="dark"] .quality-search-state.error { color: #ffabab; }

/* v2.8.0 — laatupopup: sulkemispainike pysyy aina yläkulmassa.
   Vain kortin sisältö vierii; MapLibren oma close-button ei ole vieritysalueella. */
.quality-info-popup .maplibregl-popup-content {
  max-height: none;
  overflow: hidden;
  position: relative;
  padding: 0;
}
.quality-info-popup .quality-popup-card {
  box-sizing: border-box;
  max-height: 390px; /* JS pienentää tämän valitun ankkurisuunnan vapaan tilan mukaan */
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 13px 42px 12px 14px;
}
.quality-info-popup .maplibregl-popup-close-button {
  position: absolute;
  float: none;
  top: 7px;
  right: 7px;
  width: 31px;
  height: 31px;
  margin: 0;
  z-index: 20;
  border-radius: 9px;
  background: var(--surface-solid);
  box-shadow: 0 1px 6px rgba(15,23,42,.16);
}
.quality-low-note { display:flex; gap:8px; align-items:flex-start; margin:8px 0 10px; padding:9px 10px; border:1px solid var(--line); border-radius:10px; background:var(--surface-soft); color:var(--muted); font-size:.61rem; line-height:1.4; }
.quality-low-note strong { color:var(--text); white-space:nowrap; }
@media (max-width:600px){
  .quality-search-results { max-height: 38dvh; }
  .quality-info-popup .quality-popup-card { max-height: 300px; }
  .quality-low-note { display:block; }
  .quality-low-note strong { display:block; margin-bottom:3px; }
}


/* v2.8.0 — laatupopup ankkuroidaan aina sille puolelle pistettä, jossa on enemmän tilaa.
   Kortin korkeus lasketaan JS:ssä kartan todellisen vapaan tilan mukaan. */
.quality-info-popup { max-width: calc(100% - 16px); }
.quality-info-popup .quality-popup-card { scrollbar-width: thin; }

/* v2.8.0 — Aineiston laatu: näkyvä analyysin eteneminen kartalla. */
.quality-analysis-progress {
  position:absolute;
  top:14px;
  left:50%;
  transform:translateX(-50%);
  width:min(520px,calc(100% - 32px));
  z-index:14;
  box-sizing:border-box;
  padding:11px 13px 10px;
  border:1px solid rgba(148,163,184,.34);
  border-radius:14px;
  background:var(--surface-solid);
  box-shadow:0 8px 28px rgba(15,23,42,.18);
  backdrop-filter:blur(10px);
}
.quality-analysis-progress[hidden]{display:none!important;}
.quality-analysis-progress-head{display:grid;grid-template-columns:26px minmax(0,1fr) auto;gap:9px;align-items:center;}
.quality-progress-icon{width:18px;height:18px;border-radius:50%;border:3px solid rgba(14,116,144,.18);border-top-color:#0e7490;box-sizing:border-box;animation:qualityProgressSpin .85s linear infinite;}
.quality-analysis-progress.ok .quality-progress-icon{border:0;background:#16834b;animation:none;position:relative;}
.quality-analysis-progress.ok .quality-progress-icon::after{content:"";position:absolute;left:5px;top:3px;width:5px;height:9px;border:solid #fff;border-width:0 2px 2px 0;transform:rotate(45deg);}
.quality-analysis-progress.error .quality-progress-icon{border:0;background:#b42318;animation:none;position:relative;}
.quality-analysis-progress.error .quality-progress-icon::before,.quality-analysis-progress.error .quality-progress-icon::after{content:"";position:absolute;left:8px;top:3px;width:2px;height:12px;background:#fff;border-radius:2px;transform:rotate(45deg);}
.quality-analysis-progress.error .quality-progress-icon::after{transform:rotate(-45deg);}
.quality-progress-copy{min-width:0;}
.quality-progress-copy strong{display:block;font-size:.75rem;line-height:1.25;}
.quality-progress-copy small{display:block;margin-top:1px;color:var(--muted);font-size:.58rem;line-height:1.25;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.quality-progress-percent{font-size:.68rem;font-variant-numeric:tabular-nums;color:var(--text);}
.quality-progress-track{height:5px;margin-top:9px;overflow:hidden;border-radius:999px;background:var(--surface-soft);}
.quality-progress-track span{display:block;height:100%;width:0;border-radius:inherit;background:#0e7490;transition:width .22s ease;position:relative;overflow:hidden;}
.quality-analysis-progress.loading .quality-progress-track span::after{content:"";position:absolute;inset:0;background:linear-gradient(90deg,transparent,rgba(255,255,255,.65),transparent);transform:translateX(-100%);animation:qualityProgressShimmer 1.15s ease-in-out infinite;}
.quality-analysis-progress.ok .quality-progress-track span{background:#16834b;}
.quality-analysis-progress.error .quality-progress-track span{background:#b42318;}
.quality-progress-stage{margin-top:5px;color:var(--muted);font-size:.54rem;line-height:1.2;}
@keyframes qualityProgressSpin{to{transform:rotate(360deg)}}
@keyframes qualityProgressShimmer{to{transform:translateX(100%)}}
@media (prefers-reduced-motion:reduce){.quality-progress-icon,.quality-analysis-progress.loading .quality-progress-track span::after{animation:none!important}.quality-progress-track span{transition:none}}
@media(max-width:600px){.quality-analysis-progress{top:10px;width:calc(100% - 20px);padding:10px 11px 9px}.quality-progress-copy strong{font-size:.69rem}.quality-progress-copy small{font-size:.54rem}.quality-progress-stage{font-size:.51rem}}

/* v2.8.0 — popup avautuu aina sisältönsä alkuun. */
.quality-info-popup .quality-popup-card{scroll-behavior:auto;overflow-anchor:none;}

/* v3.0.15 — laadun analysointi rajataan selkeästi paikalliseen kartta-alueeseen. */
.quality-area-hint{display:flex;flex-direction:column;gap:3px;margin:0 0 8px;padding:9px 11px;border:1px solid transparent;border-radius:10px;font-size:.65rem;line-height:1.4}
.quality-area-hint strong{font-size:.68rem}
.quality-area-hint.warning{color:#855300;background:#fff4da;border-color:#f0cf83}
.quality-area-hint.ready{color:#17633a;background:#e8f6ed;border-color:#abd5b8}
.quality-load-state.warning{color:#855300;background:#fff4da}
.quality-actions .button:disabled{cursor:not-allowed;opacity:.58}
.quality-actions .button.is-analyzing{cursor:progress;opacity:.86}
.quality-actions .button.is-analyzing::before{content:"";display:inline-block;width:12px;height:12px;margin-right:7px;vertical-align:-2px;border:2px solid rgba(255,255,255,.4);border-top-color:#fff;border-radius:50%;animation:qualityProgressSpin .85s linear infinite}
html[data-theme="dark"] .quality-area-hint.warning,html[data-theme="dark"] .quality-load-state.warning{color:#f7d78c;background:#3b321e;border-color:#786230}
html[data-theme="dark"] .quality-area-hint.ready{color:#9bd8b6;background:#183126;border-color:#345d43}
@media(prefers-reduced-motion:reduce){.quality-actions .button.is-analyzing::before{animation:none}}

/* v3.0.17 — mobiilissa laatukartta on ensisijainen ja työkalut avautuvat alapaneeliin. */
.quality-sheet-handle,.quality-mobile-tools{display:none}
.quality-sheet-content,.quality-settings-panel{display:contents}
@media(max-width:900px){
  html.quality-document,html.quality-document body.quality-page{height:100%!important;min-height:0;overflow:hidden!important}
  .quality-shell{height:100dvh;min-height:0;overflow:hidden}
  .quality-topbar{position:relative;z-index:20;flex:0 0 auto;min-height:54px;padding:6px 9px;gap:8px;align-items:center}
  .quality-brand{gap:7px}.quality-brand .eyebrow,.quality-brand small{display:none}.quality-brand h1{margin:0;font-size:.95rem}
  .quality-topmeta{gap:3px;font-size:.53rem}.quality-topmeta .version-badge{font-size:.52rem}.quality-back{padding:6px 7px;font-size:.64rem}
  .quality-workspace{position:relative;display:block;flex:1 1 auto;min-height:0;overflow:hidden}
  .quality-map-wrap{position:absolute;inset:0;min-height:0}.quality-map{position:absolute;inset:0}
  .quality-sidebar{position:absolute;z-index:12;right:0;bottom:0;left:0;display:grid;grid-template-rows:49px minmax(0,1fr);height:min(48%,380px);max-height:calc(100% - 8px);padding:0;border:1px solid var(--line);border-bottom:0;border-radius:17px 17px 0 0;background:var(--surface-solid);box-shadow:0 -8px 28px rgba(15,23,42,.16);overflow:hidden;transition:height .22s ease}
  .quality-sidebar.sheet-peek{height:52px}.quality-sidebar.sheet-half{height:min(48%,380px)}.quality-sidebar.sheet-full{height:min(84%,calc(100% - 8px))}
  .quality-sheet-handle{position:relative;display:flex;width:100%;height:49px;align-items:center;justify-content:center;gap:9px;padding:6px 10px 2px;border:0;background:linear-gradient(180deg,var(--surface-soft) 0,var(--surface-solid) 96%);color:var(--text);cursor:pointer;touch-action:none}
  .quality-sheet-handle>span{position:absolute;top:4px;left:calc(50% - 18px);width:36px;height:3px;border-radius:999px;background:#8fa8b9}
  .quality-sheet-handle i{display:grid;flex:0 0 29px;width:29px;height:29px;place-items:center;border-radius:50%;background:#173f5f;color:#fff;font-size:19px;font-style:normal;font-weight:800}
  .quality-sheet-handle strong{display:grid;gap:2px;text-align:left;font-size:.71rem;line-height:1.12}.quality-sheet-handle strong em{width:max-content;padding:2px 7px;border-radius:999px;background:#e7f0f6;color:#173f5f;font-size:.61rem;font-style:normal;font-weight:800}
  .quality-sheet-handle b{display:grid;min-width:25px;height:23px;padding:0 6px;place-items:center;border-radius:999px;background:#dfeaf2;color:#173f5f;font-size:.67rem}
  .quality-sheet-content{display:flex;min-height:0;flex-direction:column;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;padding:0 10px calc(8px + env(safe-area-inset-bottom))}
  .quality-actions{order:1;grid-template-columns:1fr;margin:4px 0 6px}.quality-actions .button{min-height:40px}.quality-actions #qualityFitBtn{display:none}.quality-sidebar.has-results .quality-actions{grid-template-columns:1.15fr 1fr}.quality-sidebar.has-results .quality-actions #qualityFitBtn{display:block}
  .quality-area-hint{order:2;margin:0 0 5px;padding:6px 8px;font-size:.59rem}.quality-area-hint strong{font-size:.63rem}
  .quality-load-state{order:3;margin:0 0 6px;padding:6px 8px;font-size:.58rem}
  .quality-mobile-tools{order:4;display:flex;flex:0 0 auto;gap:6px;margin:0 0 7px}.quality-mobile-tools button{flex:1;min-height:35px;padding:5px 6px;border:1px solid var(--line);border-radius:9px;background:var(--surface-soft);color:var(--text);font-size:.61rem;font-weight:740}.quality-mobile-tools button[aria-expanded=true]{border-color:#173f5f;background:#173f5f;color:#fff}
  .quality-intro-card{order:5}.quality-settings-panel{order:5}.quality-place-search{order:5}.quality-filters{order:6}.quality-low-note{order:7}.quality-metrics{order:8}.quality-sheet-content>.admin-result-count{order:9}.quality-list{order:10}
  .quality-mobile-panel{display:none}.quality-mobile-panel.is-open{display:block}.quality-filters.quality-mobile-panel.is-open{display:grid}.quality-settings-panel.is-open{display:block}
  .quality-low-note{display:none}.quality-low-note.is-open{display:block}.quality-metrics,.quality-sheet-content>.admin-result-count,.quality-list{display:none}.quality-sidebar.has-results .quality-metrics{display:grid;grid-template-columns:repeat(4,minmax(0,1fr))}.quality-sidebar.has-results .quality-sheet-content>.admin-result-count{display:block}.quality-sidebar.has-results .quality-list{display:grid}
  .quality-metrics>div{padding:6px 5px}.quality-metrics span{font-size:.51rem}.quality-metrics strong{font-size:.85rem}.quality-list{padding-bottom:12px}
  .quality-map-legend{bottom:calc(48% + 8px);font-size:.55rem}.quality-sheet-peek .quality-map-legend{bottom:60px}.quality-sheet-full .quality-map-legend{opacity:0;pointer-events:none}
  .quality-analysis-progress{top:9px;width:calc(100% - 18px)}.quality-footer{display:none}
}
@media(max-width:390px){.quality-topmeta .version-badge{display:none}.quality-brand h1{font-size:.85rem}.quality-mobile-tools button{font-size:.57rem}}
@media(prefers-reduced-motion:reduce){.quality-sidebar{transition:none}}

/* v3.0.31 — yhtenäinen näkymävalinta ja selkeä, turvallisen alueen sisällä pysyvä mobiilipaneeli. */
.quality-topbar.unified-page-topbar{display:grid;grid-template-columns:auto minmax(0,1fr) auto}
.page-view-switcher{display:flex;min-width:0;align-items:center;justify-content:center;gap:6px}
.page-view-switcher a,.page-view-switcher button{display:flex;min-height:38px;align-items:center;justify-content:center;padding:0 11px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft);color:var(--accent-strong);text-decoration:none;font-size:.69rem;font-weight:760;white-space:nowrap;cursor:pointer}
.page-view-switcher a:hover,.page-view-switcher a:focus-visible,.page-view-switcher button:hover,.page-view-switcher button:focus-visible{outline:none;border-color:var(--accent);background:var(--surface-solid)}
.page-view-switcher .active{border-color:#173f5f;background:#173f5f;color:#fff;box-shadow:0 2px 8px rgba(15,23,42,.18)}

@media(max-width:900px){
  .quality-shell{height:var(--tieinfo-visual-height,100svh)}
  .quality-topbar.unified-page-topbar{grid-template-columns:auto minmax(0,1fr) auto;height:58px;min-height:58px;padding:5px 6px;gap:5px;overflow:hidden}
  .quality-brand{min-width:70px}.quality-brand h1{font-size:.78rem}.quality-brand .eyebrow{display:block;font-size:.43rem}
  .quality-view-switcher{justify-content:flex-start;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none}
  .quality-view-switcher::-webkit-scrollbar{display:none}
  .page-view-switcher a,.page-view-switcher button{min-height:38px;padding:0 9px;border-radius:9px;font-size:.62rem}
  .quality-topmeta #qualityAnalyzedAt{display:none}.quality-topmeta{gap:0}.quality-topmeta .version-badge{font-size:.48rem}
  .quality-sidebar{--quality-sheet-lift:max(env(safe-area-inset-bottom,0px),8px);bottom:var(--quality-sheet-lift);grid-template-rows:64px minmax(0,1fr);border:1px solid var(--line);border-radius:18px;box-shadow:0 -10px 32px rgba(15,23,42,.25)}
  .quality-sidebar.sheet-peek{height:72px}
  .quality-sheet-handle{height:64px;gap:10px;padding:12px 10px 5px;border-bottom:1px solid var(--line);background:linear-gradient(180deg,#e8f2f8 0,var(--surface-solid) 92%)}
  .quality-sheet-handle>span{top:5px;left:calc(50% - 31px);width:62px;height:7px;background:#27678f;box-shadow:0 1px 0 rgba(255,255,255,.8)}
  .quality-sheet-handle i{flex:0 0 38px;width:38px;height:38px;background:#102a43;font-size:24px}
  .quality-sheet-handle strong{font-size:.75rem}.quality-sheet-handle strong em{font-size:.57rem}
  .quality-sheet-handle b{min-width:29px;height:26px;font-size:.7rem}
  .quality-sheet-peek .quality-map-legend{bottom:calc(80px + max(env(safe-area-inset-bottom,0px),8px))}
}

/* v3.0.22 — laatuhavainto pysyy kokonaan näkyvissä mobiilissa. */
@media(max-width:900px){
  .quality-info-popup{
    top:10px!important;
    right:10px!important;
    bottom:auto!important;
    left:10px!important;
    width:auto!important;
    max-width:none!important;
    transform:none!important;
    z-index:16!important;
  }
  .quality-info-popup .maplibregl-popup-tip{display:none}
  .quality-info-popup .maplibregl-popup-content{width:100%;min-width:0;max-width:none}
  .quality-info-popup .quality-popup-card{width:100%;min-width:0;padding:11px 39px 10px 12px}
  .quality-info-popup .quality-popup-card>strong{font-size:.8rem;line-height:1.25}
  .quality-info-popup .quality-popup-card>p{margin:6px 0;font-size:.66rem}
  .quality-info-popup .quality-popup-card dl{margin-top:6px}
  .quality-info-popup .quality-popup-card dl>div{padding:3px 0}
  body.quality-finding-open .quality-map .maplibregl-ctrl-top-right{top:auto!important;right:0!important;bottom:74px!important;z-index:7!important}
  body.quality-finding-open .quality-map .maplibregl-ctrl-bottom-right{right:52px!important;bottom:58px!important}
  .quality-list,.quality-list-item{min-width:0;max-width:100%;overflow-x:hidden}
  .quality-list-item{display:grid;grid-template-columns:minmax(0,1fr) auto}
  .quality-list-main small{white-space:normal;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;line-clamp:2}
  .quality-list-link-id{display:none}
  .quality-list-badges{min-width:0;max-width:92px}
  .quality-list-badges i{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}

/* v3.0.18 — sivukohtaiset käyttöohjeet ja päivitetty palvelunäkymien yhteenveto. */
.page-guide{border:1px solid var(--line);border-radius:10px;background:var(--surface-soft)}
.page-guide>summary{display:flex;min-height:37px;align-items:center;justify-content:space-between;padding:7px 10px;color:var(--accent-strong);font-size:.68rem;font-weight:790;cursor:pointer;list-style:none}
.page-guide>summary::-webkit-details-marker{display:none}.page-guide>summary::after{content:"+";font-size:1rem;font-weight:800}.page-guide[open]>summary::after{content:"−"}
.page-guide>summary:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:9px}
.page-guide-content{padding:0 10px 9px;color:var(--muted)}.page-guide-content ol{margin:2px 0 0;padding-left:17px}.page-guide-content li{margin:0 0 7px;padding-left:2px;font-size:.64rem;line-height:1.46}.page-guide-content li:last-child{margin-bottom:0}.page-guide-content strong{color:var(--text)}
.legend-info-panel:not([hidden]){display:flex;flex-direction:column}.legend-info-header,.info-tabs{flex:0 0 auto}.legend-info-scroll{flex:1 1 auto;min-height:0}
.main-page-guide{flex:0 0 auto;margin:8px 10px 0}.main-page-guide[open] .page-guide-content{max-height:min(35dvh,310px);overflow-y:auto;overscroll-behavior:contain}
.quality-page-guide{margin:0 0 8px}.about-view-list{display:grid;gap:7px}.about-view-card{display:block;padding:9px 10px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft);color:var(--text);text-decoration:none}.about-view-card strong,.about-view-card span{display:block}.about-view-card strong{font-size:.72rem}.about-view-card span{margin-top:3px;color:var(--muted);font-size:.63rem;line-height:1.42}.about-view-card[href]:hover,.about-view-card[href]:focus-visible{border-color:var(--accent);background:var(--accent-soft)}
@media(max-width:900px){.quality-page-guide{order:4;margin:0 0 6px}.quality-mobile-tools{order:5}.quality-intro-card,.quality-settings-panel,.quality-place-search{order:6}.quality-filters{order:7}.quality-low-note{order:8}.quality-metrics{order:9}.quality-sheet-content>.admin-result-count{order:10}.quality-list{order:11}.quality-page-guide>summary{min-height:32px;padding:5px 8px;font-size:.62rem}.quality-page-guide .page-guide-content li{font-size:.61rem}.main-page-guide{margin:6px 8px 0}}

/* v3.0.25 — sama karttakäyttöliittymä kahdessa aineistotilassa. */
.basic-page .digiroad-only{display:none!important}
.current-map-view{border-color:var(--accent)!important;background:var(--accent-soft)!important;color:var(--accent-strong)!important}
.basic-map-mode-note{margin:0 0 10px}
.basic-map-mode-note a{color:var(--accent-strong);font-weight:760}
@media(max-width:760px){
  .basic-page .mobile-nav{grid-template-columns:repeat(7,minmax(0,1fr));padding-left:3px;padding-right:3px}
  .basic-page .mobile-nav-button{min-width:0;font-size:.54rem}
}

/* v3.0.26 — reitin tausta-analyysi, huomiot ja reittiviivan muokkaus. */
.route-advisory-status{position:absolute;z-index:31;top:12px;left:50%;display:flex;min-height:24px;max-width:min(310px,calc(100% - 28px));align-items:center;gap:6px;padding:3px 8px 3px 6px;border:1px solid var(--line);border-radius:999px;background:color-mix(in srgb,var(--surface-solid) 94%,transparent);color:var(--muted);box-shadow:0 3px 12px rgba(15,23,42,.13);transform:translateX(-50%);backdrop-filter:blur(10px);font-size:.58rem;font-weight:760;white-space:nowrap}
.route-advisory-status[hidden]{display:none!important}.route-advisory-status i{width:8px;height:8px;flex:0 0 8px;border-radius:50%;background:#2f9e57;box-shadow:0 0 0 0 rgba(47,158,87,.42)}
.route-advisory-status.analyzing i{animation:route-advisory-pulse 1.15s ease-out infinite}.route-advisory-status.findings{color:#8a4d00;border-color:#dfb96f;background:color-mix(in srgb,#fff4dc 94%,var(--surface-solid))}.route-advisory-status.findings i,.route-advisory-status.partial i{background:#d97706}.route-advisory-status.editing i{background:#2672a5}.route-advisory-status b{display:grid;min-width:18px;height:18px;place-items:center;padding:0 5px;border-radius:999px;background:#d97706;color:#fff;font-size:.56rem}
html[data-theme="dark"] .route-advisory-status.findings{color:#f4d18b;border-color:#775b29;background:#382b14}
@keyframes route-advisory-pulse{0%{box-shadow:0 0 0 0 rgba(47,158,87,.55)}75%,100%{box-shadow:0 0 0 7px rgba(47,158,87,0)}}
.route-advisory-hover{position:absolute;z-index:38;width:min(285px,calc(100% - 20px));display:flex;gap:8px;padding:8px 9px;border:1px solid var(--line);border-radius:11px;background:var(--surface-solid);box-shadow:0 8px 24px rgba(15,23,42,.18);pointer-events:none;transform:translate(12px,12px)}.route-advisory-hover[hidden]{display:none!important}.route-advisory-hover.flip-x{transform:translate(calc(-100% - 12px),12px)}.route-advisory-hover>span,.route-advisory-popup-head>i{width:9px;flex:0 0 9px;border-radius:999px;background:#2672a5}.route-advisory-hover>span.warning,.route-advisory-popup-head>i.warning{background:#d97706}.route-advisory-hover>span.critical,.route-advisory-popup-head>i.critical{background:#c62828}.route-advisory-hover div{min-width:0}.route-advisory-hover strong,.route-advisory-hover small,.route-advisory-hover em{display:block}.route-advisory-hover strong{font-size:.67rem}.route-advisory-hover small{margin-top:2px;color:var(--muted);font-size:.58rem;line-height:1.35}.route-advisory-hover em{margin-top:3px;color:var(--accent-strong);font-size:.54rem;font-style:normal;font-weight:760}
.route-advisory-popup{z-index:39!important}.route-advisory-popup .maplibregl-popup-content{padding:11px 12px;max-height:min(360px,55dvh);overflow-y:auto}.route-advisory-popup-head{display:flex;gap:8px;padding-right:25px}.route-advisory-popup-head i{min-height:31px}.route-advisory-popup-head strong,.route-advisory-popup-head span{display:block}.route-advisory-popup-head strong{font-size:.76rem}.route-advisory-popup-head span{margin-top:2px;color:var(--muted);font-size:.58rem}.route-advisory-popup-card>p{margin:9px 0;font-size:.67rem;line-height:1.45}.route-advisory-popup-card dl{margin:0}.route-advisory-popup-card dl>div{display:flex;justify-content:space-between;gap:10px;padding:4px 0;border-top:1px solid var(--line);font-size:.6rem}.route-advisory-popup-card dt{color:var(--muted)}.route-advisory-popup-card dd{margin:0;text-align:right;font-weight:700}.route-advisory-popup-card>small{display:block;margin-top:8px;color:var(--muted);font-size:.54rem;line-height:1.35}
.route-advisory-summary,.route-advisory-suggestion{margin:8px 0;padding:9px;border:1px solid var(--line);border-radius:12px;background:var(--surface-soft)}.route-advisory-summary-head strong,.route-advisory-summary-head small{display:block}.route-advisory-summary-head strong{font-size:.72rem}.route-advisory-summary-head small{margin-top:2px;color:var(--muted);font-size:.58rem}.route-advisory-summary-list{display:grid;gap:5px;margin-top:8px}.route-advisory-summary-list button{display:grid;grid-template-columns:7px minmax(0,1fr);gap:8px;width:100%;padding:6px 7px;border:1px solid var(--line);border-radius:9px;background:var(--surface-solid);color:var(--text);text-align:left;cursor:pointer}.route-advisory-summary-list i{min-height:30px;border-radius:999px;background:#2672a5}.route-advisory-summary-list i.warning{background:#d97706}.route-advisory-summary-list i.critical{background:#c62828}.route-advisory-summary-list strong,.route-advisory-summary-list small{display:block}.route-advisory-summary-list strong{font-size:.64rem}.route-advisory-summary-list small{margin-top:2px;color:var(--muted);font-size:.56rem;line-height:1.35}.route-advisory-suggestion{border-color:#8fc5a3;background:color-mix(in srgb,#e8f7ed 86%,var(--surface-solid))}.route-advisory-suggestion strong{font-size:.72rem}.route-advisory-suggestion p{margin:4px 0 0;color:var(--muted);font-size:.61rem;line-height:1.4}.route-advisory-suggestion-actions{display:flex;gap:6px;margin-top:8px}.route-advisory-suggestion-actions .button{min-height:34px;flex:1;padding:5px 7px;font-size:.59rem}
body.route-edit-mode .maplibregl-canvas{cursor:grab!important}body.route-edit-mode .route-map-return{border-color:#78b899}.route-map-return #routeEditMapBtn.active{background:#1e9d63;color:#fff;border-color:#1e9d63}
@media(max-width:760px){.route-advisory-status{top:9px;max-width:calc(100% - 18px);font-size:.55rem}.route-advisory-hover{display:none!important}.route-advisory-popup .maplibregl-popup-content{max-width:min(300px,calc(100vw - 34px));max-height:42dvh}.route-map-return{flex-wrap:wrap;justify-content:center}.route-map-return #routeEditMapBtn{flex:1 1 44%}.route-advisory-summary-list{max-height:210px;overflow-y:auto}}
@media(prefers-reduced-motion:reduce){.route-advisory-status.analyzing i{animation:none}}

/* v3.0.27 — reitin lähtö- ja määränpäähaun ehdotukset. */
.route-field:focus-within{z-index:24}.route-location-field{position:relative;min-width:0}.route-address-search{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:stretch}.route-address-search input{min-width:0;border-radius:10px 0 0 10px}.route-address-search .route-address-search-button{grid-column:auto;min-width:54px;height:38px;margin:0;border-left:0;border-radius:0 10px 10px 0;justify-self:stretch;padding:0 8px}.route-address-search .route-address-search-button.found{border-color:#16834b;background:#e7f6ed;color:#126338}.route-location-suggestions{position:absolute;z-index:48;top:calc(100% + 4px);right:0;left:0;max-height:230px;overflow-y:auto;border:1px solid var(--line);border-radius:11px;background:var(--surface-solid);box-shadow:0 12px 28px rgba(15,23,42,.2)}.route-location-suggestions[hidden]{display:none!important}.route-location-suggestions button{display:block;width:100%;padding:8px 9px;border:0;border-bottom:1px solid var(--line);background:transparent;color:var(--text);text-align:left;cursor:pointer}.route-location-suggestions button:last-child{border-bottom:0}.route-location-suggestions button:hover,.route-location-suggestions button:focus-visible{background:var(--accent-soft);outline:0}.route-location-suggestions strong,.route-location-suggestions small{display:block}.route-location-suggestions strong{font-size:.66rem}.route-location-suggestions small{margin-top:2px;color:var(--muted);font-size:.56rem;line-height:1.3}.route-location-suggestion-state{padding:9px;color:var(--muted);font-size:.6rem}.route-location-suggestion-state.empty{color:#8a4d00}
.route-location-search-hint{margin:4px 0 7px 40px;color:var(--muted);font-size:.56rem;line-height:1.35}
@media(max-width:520px){.route-address-search .route-address-search-button{grid-column:auto;justify-self:stretch;margin:0}.route-location-suggestions{max-height:190px}}

/* v3.0.32 — kaikkien karttasivujen yhteinen yläpalkki. */
.common-map-nav{display:flex;min-width:0;align-items:center;justify-content:flex-end;gap:6px;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none}
.common-map-nav::-webkit-scrollbar{display:none}
.common-map-nav .common-map-action{flex:0 0 auto}
.common-map-nav .current-map-view{border-color:var(--accent)!important;background:var(--accent-soft)!important;color:var(--accent-strong)!important;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 35%,transparent)}
.common-map-nav .icon-button.location-active{border-color:#2387e8;background:#e5f3ff;color:#1267ac}
.common-map-nav .icon-button.location-loading{cursor:progress;opacity:.7}
.common-user-location-marker{display:block;width:18px;height:18px;border:3px solid #fff;border-radius:999px;background:#2387e8;box-shadow:0 0 0 4px rgba(35,135,232,.25),0 3px 10px rgba(0,0,0,.3)}
@media(max-width:1650px){.common-map-nav .top-action-button span{display:none}.common-map-nav .top-action-button{width:40px;padding:0}}
@media(max-width:1024px){
  :root{--topbar-h:58px}
  .common-map-topbar{grid-template-columns:auto minmax(0,1fr);height:calc(var(--topbar-h) + env(safe-area-inset-top,0));padding:env(safe-area-inset-top,0) 6px 0}
  .common-map-topbar .global-search{display:none}
  .common-map-topbar .common-map-nav{grid-column:2;justify-content:flex-start;width:100%;gap:5px}
  .common-map-nav .top-action-button,.common-map-nav .icon-button{display:inline-flex!important;width:auto;min-width:38px;height:40px;padding:0 9px;border-radius:10px}
  .common-map-nav .top-action-button span{display:inline;font-size:.61rem}
  .common-map-nav .icon-button{width:40px;padding:0}
  .mobile-nav{grid-template-columns:repeat(4,minmax(0,1fr))!important}
}
@media(max-width:520px){
  .common-map-topbar .brand{min-width:34px;padding:0}.common-map-topbar .brand-text,.common-map-topbar .version-badge{display:none}
  .common-map-nav .top-action-button{padding:0 8px}.common-map-nav .top-action-button span{font-size:.58rem}
}

html[data-theme="dark"] .common-map-nav .icon-button.location-active{border-color:#70bfff;background:#173f5f;color:#b9ddf7}

/* v3.0.33 — mobiilin pysyvä karttanavigointi ja väljä ylätyökalurivi. */
.mobile-header-only{display:none!important}
@media(max-width:760px){
  .common-map-nav{justify-content:flex-end!important;gap:4px;overflow:visible}
  .common-map-nav .view-action,.common-map-nav .route-action{display:none!important}
  .common-map-nav .mobile-header-only{display:inline-flex!important}
  .common-map-nav .guide-action span,.common-map-nav .info-action span,.common-map-nav .search-action span{display:none!important}
  .common-map-nav .top-action-button,.common-map-nav .icon-button{width:38px!important;min-width:38px!important;height:40px;padding:0!important}
  .common-map-topbar .common-map-nav{justify-content:flex-end!important;overflow:visible}
  .mobile-nav{z-index:70!important;grid-template-columns:repeat(6,minmax(0,1fr))!important}
  .mobile-nav-button{min-width:0;color:var(--muted);text-decoration:none}
  .mobile-nav-button svg{fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
  .quality-workspace{position:relative}
  .quality-sidebar{--quality-sheet-lift:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom,0px) + 6px);bottom:var(--quality-sheet-lift);max-height:calc(100% - var(--mobile-nav-h) - env(safe-area-inset-bottom,0px) - 12px)}
  .quality-sidebar.sheet-full{height:min(84%,calc(100% - var(--mobile-nav-h) - env(safe-area-inset-bottom,0px) - 12px))}
  .quality-sheet-peek .quality-map-legend{bottom:calc(var(--mobile-nav-h) + 80px + env(safe-area-inset-bottom,0px))}
  body.quality-finding-open .quality-map .maplibregl-ctrl-top-right{bottom:calc(var(--mobile-nav-h) + 74px)!important}
}
@media(max-width:390px){
  .common-map-nav{gap:3px}
  .common-map-nav .top-action-button,.common-map-nav .icon-button{width:36px!important;min-width:36px!important;height:38px}
  .mobile-nav-button{font-size:.52rem}
}

/* v3.0.39 — ehjä sivupaneeli, selkeä reittivalinta ja Digiroad-alueen tallennus. */
.drawer-header-actions{display:flex;flex:0 0 auto;align-items:center;gap:7px}
.drawer.route-open .drawer-scroll{overflow-x:hidden}
.route-preference-buttons{grid-template-columns:repeat(3,minmax(0,1fr));max-width:100%;padding:0 2px}
.route-preference-buttons button{min-width:0;padding:0 5px;font-size:.72rem;line-height:1.15;overflow-wrap:anywhere;white-space:normal}
.digiroad-welcome{z-index:36;width:min(610px,calc(100% - 32px));padding:15px 44px 14px 17px}
.digiroad-welcome.ready{border-color:#72b98d;box-shadow:0 12px 32px rgba(25,105,59,.18)}
.digiroad-welcome>strong{display:block;padding-right:6px;font-size:.9rem}
.digiroad-welcome>small{display:block;margin-top:9px;color:var(--muted);font-size:.68rem}
.digiroad-welcome .save-area-button{border-color:#2c9460;background:#e7f7ed;color:#17683e}
.digiroad-welcome .remove-area-button{border-color:#d5a0a0;background:#fff2f2;color:#9c2f2f}
html[data-theme=dark] .digiroad-welcome .save-area-button{border-color:#4c9b70;background:#173a29;color:#a7e2bc}
html[data-theme=dark] .digiroad-welcome .remove-area-button{border-color:#765052;background:#3b2428;color:#ffb7b7}
.digiroad-page.digiroad-welcome-active .map-data-status{top:var(--digiroad-welcome-bottom,172px)}

@media(max-width:760px){
  .route-preference-buttons{gap:4px;padding:0}
  .route-preference-buttons button{min-height:34px;padding:0 3px;font-size:.65rem}
  .digiroad-welcome{width:calc(100% - 16px);padding:12px 40px 12px 13px}
  .digiroad-welcome>strong{font-size:.78rem}.digiroad-welcome p{font-size:.68rem;line-height:1.35}
  .digiroad-welcome-actions{gap:5px!important}.digiroad-welcome-actions button{padding:6px 8px!important;font-size:.66rem}
  .digiroad-page.digiroad-welcome-active .map-data-status{top:var(--digiroad-welcome-bottom,182px)}
}

/* v3.0.40 — reittipaneelin pysyvät päävalinnat ja suljetut lisäasetukset. */
.route-choice-section{margin:0 0 8px;padding:10px;border:1px solid color-mix(in srgb,var(--accent) 42%,var(--line));border-radius:12px;background:color-mix(in srgb,var(--accent-soft) 58%,var(--surface-solid))}
.route-choice-heading{display:flex;align-items:baseline;justify-content:space-between;gap:10px}
.route-choice-heading strong{font-size:.75rem;color:var(--text)}
.route-choice-heading small{color:var(--muted);font-size:.59rem;text-align:right;line-height:1.3}
.route-choice-section .route-preference-buttons{margin:8px 0 0;padding:0}
.route-choice-section .route-preference-buttons button{background:var(--surface-solid)}
.route-choice-section .route-preference-buttons button.active{background:var(--accent);border-color:var(--accent);color:#fff}
.route-travel-buttons{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin-top:7px;padding-top:7px;border-top:1px solid var(--line)}
.route-travel-buttons button{display:flex;min-width:0;min-height:47px;flex-direction:column;align-items:center;justify-content:center;gap:2px;padding:5px 4px;border:1px solid var(--line);border-radius:9px;background:var(--surface-solid);color:var(--text);cursor:pointer}
.route-travel-buttons button strong{font-size:.7rem;line-height:1.1}.route-travel-buttons button small{display:block;max-width:100%;overflow:hidden;color:var(--muted);font-size:.55rem;line-height:1.15;text-overflow:ellipsis;white-space:nowrap}
.route-travel-buttons button.active{border-color:var(--accent);background:var(--accent-soft);color:var(--accent-strong);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 35%,transparent)}
.route-travel-buttons button.active small{color:inherit}
.lipas-service-link{text-decoration:none}.lipas-service-link::after{content:"↗";margin-left:auto;color:var(--accent);font-weight:850}
.guide-dialog-content .traffic-source-info{position:static;width:auto;box-shadow:none}.guide-dialog-content .traffic-source-heading button{display:none}
.route-vehicle-settings{margin:0 0 10px;border:1px solid var(--line);border-radius:12px;background:var(--surface-solid);overflow:hidden}
.route-vehicle-settings>summary{display:flex;align-items:center;min-height:47px;padding:7px 11px;cursor:pointer;background:var(--surface-soft);color:var(--text)}
.route-vehicle-settings>summary>span{display:flex;min-width:0;flex:1;align-items:center;justify-content:space-between;gap:10px}
.route-vehicle-settings>summary strong{font-size:.73rem}
.route-vehicle-settings>summary small{overflow:hidden;color:var(--accent-strong);font-size:.65rem;font-weight:760;text-overflow:ellipsis;white-space:nowrap}
.route-vehicle-settings[open]>summary{border-bottom:1px solid var(--line)}
.route-vehicle-settings-content{padding:10px 10px 2px}
.route-vehicle-settings-content>.field-group{margin-bottom:7px}
.route-vehicle-settings-content .route-vehicle-dimensions{margin:7px 0}
.route-vehicle-settings-content .compact-switch{margin:4px 0 7px}
.route-panel-compact .route-planner-controls>.compact-route-fields{margin-top:3px}

@media(max-width:760px){
  .route-choice-section{padding:8px;margin-bottom:7px}
  .route-choice-heading small{display:none}
  .route-choice-section .route-preference-buttons{margin-top:6px}
  .route-travel-buttons{gap:4px;margin-top:6px;padding-top:6px}.route-travel-buttons button{min-height:43px}.route-travel-buttons button strong{font-size:.66rem}.route-travel-buttons button small{font-size:.5rem}
  .route-vehicle-settings{margin-bottom:8px}
  .route-vehicle-settings>summary{min-height:42px;padding:6px 9px}
}

/* v3.0.41 — mobiilin ilmoituspino ja alareunan navigointikortti. */
.route-primary-actions .route-start-navigation{grid-column:1/-1;min-height:44px}
.route-start-navigation:disabled{cursor:not-allowed;filter:saturate(.35);opacity:.52}
.navigation-controls button{display:flex;align-items:center;justify-content:center;gap:6px}
.navigation-controls button>span{font-size:1.15rem;font-weight:850;line-height:1}
.navigation-controls button>small{color:inherit;font-size:.62rem;font-weight:740;line-height:1.1}
body.navigation-active .route-advisory-status{display:none!important}
body.navigation-active .mobile-center-target,
body.navigation-active .mobile-center-road-info,
body.navigation-active .selected-road-hint,
body.navigation-active .route-map-return,
body.navigation-active .map-data-status,
body.navigation-active .digiroad-welcome{display:none!important}
.digiroad-page.digiroad-welcome-active .mobile-center-road-info{top:var(--digiroad-welcome-bottom,182px)}
.digiroad-page.digiroad-welcome-active.mobile-center-info-visible .map-data-status{top:var(--mobile-center-info-bottom,250px)}

@media(max-width:760px){
  .navigation-view{top:auto;bottom:max(8px,env(safe-area-inset-bottom,0px));width:calc(100% - 16px);max-height:calc(100dvh - var(--topbar-h) - 18px);padding:10px;overflow-y:auto;border-radius:17px}
  .navigation-instruction{gap:2px 9px}
  .navigation-instruction strong{font-size:clamp(16px,4.7vw,21px);line-height:1.16}
  .navigation-instruction span{font-size:19px}
  .navigation-stats{margin:8px 0 7px}
  .navigation-stats span{font-size:9px}.navigation-stats strong{font-size:14px}
  .navigation-status{margin:2px 0 7px;font-size:10px}
  .navigation-controls{grid-template-columns:repeat(4,minmax(0,1fr));gap:5px}
  .navigation-controls button{min-width:0;min-height:54px;flex-direction:column;gap:3px;padding:4px 2px;font-size:inherit}
  .navigation-controls button>span{font-size:1.35rem}
  .navigation-controls button>small{font-size:.55rem;white-space:nowrap}
}

/* v3.0.42 — selkeä reitinhaku ja yhtenäinen alareunan navigointi. */
.route-map-navigation{order:-1;flex:1 1 100%;min-height:42px;background:#087e68!important;border-color:#087e68!important;color:#fff!important;font-weight:820}
.navigation-view{inset:auto 12px 12px auto!important;top:auto!important;left:auto!important;transform:none!important;width:min(720px,calc(100% - 24px));max-height:calc(100dvh - var(--topbar-h) - 24px);overflow-y:auto}
.navigation-controls{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:6px}
.navigation-controls button.danger{margin:0}
@media(max-width:760px){
  .route-map-navigation{flex-basis:100%;min-height:40px}
  .navigation-view{inset:auto 8px max(8px,env(safe-area-inset-bottom,0px)) 8px!important;width:auto;max-height:calc(100dvh - var(--topbar-h) - 18px)}
  .navigation-controls{grid-template-columns:repeat(3,minmax(0,1fr))}
}

/* v3.0.43 — karttapainikkeet yläreunaan ja suuntavalinnat irti navigointikortista. */
.navigation-orientation-controls{position:absolute;z-index:39;top:12px;right:54px;display:grid;gap:6px}
.navigation-orientation-controls[hidden]{display:none!important}
.navigation-orientation-controls button{display:flex;align-items:center;justify-content:flex-start;gap:7px;min-width:106px;min-height:40px;padding:5px 9px;border:1px solid rgba(255,255,255,.28);border-radius:9px;background:rgba(16,49,69,.95);box-shadow:0 6px 18px rgba(0,0,0,.24);color:#fff;font-weight:780;backdrop-filter:blur(8px)}
.navigation-orientation-controls button>span{min-width:20px;font-size:1.12rem;font-weight:900;text-align:center}
.navigation-orientation-controls button>small{font-size:.62rem;color:inherit}
.navigation-orientation-controls button[aria-pressed=true]{border-color:#65d5a2;background:#087e68;box-shadow:0 0 0 2px rgba(101,213,162,.24),0 6px 18px rgba(0,0,0,.24)}
.navigation-controls{grid-template-columns:repeat(4,minmax(0,1fr))}
.navigation-view{width:min(620px,calc(100% - 24px))}
.maplibregl-ctrl-top-right{top:10px;right:10px}
@media(max-width:760px){
  .navigation-orientation-controls{top:8px;right:70px;gap:5px}
  .navigation-orientation-controls button{min-width:92px;min-height:38px;padding:4px 7px}
  .navigation-orientation-controls button>small{font-size:.56rem}
  .navigation-controls{grid-template-columns:repeat(4,minmax(0,1fr))}
}

/* v3.0.44 — reittihaun historia ja navigoinnin etenemäsuojaus. */
.route-history-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:7px 9px;border-bottom:1px solid var(--line);background:var(--surface-soft)}
.route-history-heading>strong{font-size:.63rem;color:var(--text)}
.route-history-heading>button{min-height:28px;padding:3px 7px;border:1px solid var(--line);border-radius:7px;background:var(--surface-solid);color:var(--muted);font-size:.56rem;font-weight:700;cursor:pointer}
@media(min-width:761px){.navigation-orientation-controls{right:62px}}

/* v3.0.47 — navigoinnin pistevalinnat, reittikooste ja viisi aiempaa reittiä. */
.navigation-controls{grid-template-columns:repeat(6,minmax(0,1fr))}
.recent-routes-wrap{margin:10px 0;border:1px solid var(--line);border-radius:12px;background:var(--surface-solid);overflow:hidden}
.recent-routes-wrap>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 11px;cursor:pointer;color:var(--text);font-size:.7rem;font-weight:790;background:var(--surface-soft)}
.recent-routes-wrap>summary span{display:grid;place-items:center;min-width:22px;height:22px;border-radius:999px;background:var(--accent-soft);color:var(--accent-strong);font-size:.6rem}
.recent-routes-list{display:grid;gap:6px;padding:8px}.recent-routes-list>p{margin:2px;color:var(--muted);font-size:.63rem}
.recent-route-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:6px;padding:8px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft)}
.recent-route-row>div{min-width:0}.recent-route-row strong,.recent-route-row small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.recent-route-row strong{font-size:.65rem;color:var(--text)}.recent-route-row small{margin-top:3px;font-size:.56rem;color:var(--muted)}
.recent-route-row button{min-height:31px;padding:4px 8px;border:1px solid var(--line);border-radius:8px;background:var(--surface-solid);color:var(--text);font-size:.58rem;font-weight:740}.recent-route-row button:last-child{min-width:31px;padding:4px;color:#a32630}
.navigation-summary-modal{position:fixed;z-index:150;inset:0;display:grid;place-items:center;padding:18px;background:rgba(8,20,32,.58);backdrop-filter:blur(5px)}
.navigation-summary-modal[hidden]{display:none!important}
.navigation-summary-dialog{width:min(540px,100%);max-height:calc(100dvh - 36px);overflow:hidden;border:1px solid rgba(91,174,209,.55);border-radius:20px;background:var(--surface-solid);color:var(--text);box-shadow:0 22px 70px rgba(0,0,0,.32)}
.navigation-summary-dialog>header{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-bottom:1px solid var(--line);background:var(--surface-soft)}
.navigation-summary-dialog>header small{color:var(--accent-strong);font-size:.58rem;font-weight:850}.navigation-summary-dialog>header h2{margin:3px 0 0;font-size:1.08rem}
.navigation-summary-content{padding:16px;overflow:auto}.navigation-summary-route{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;gap:8px;padding:10px;border:1px solid var(--line);border-radius:12px;background:var(--surface-soft)}
.navigation-summary-route span{min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:.68rem;font-weight:750}.navigation-summary-route span:last-child{text-align:right}.navigation-summary-route b{color:var(--accent-strong)}
.navigation-summary-grid{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px}.navigation-summary-grid>div{padding:9px;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft)}.navigation-summary-grid span{display:block;color:var(--muted);font-size:.59rem}.navigation-summary-grid strong{display:block;margin-top:3px;font-size:.82rem}.navigation-summary-content>p{margin:10px 2px 0;color:var(--muted);font-size:.62rem}
@media(max-width:760px){
  .navigation-controls{grid-template-columns:repeat(6,minmax(0,1fr));gap:4px}
  .navigation-controls button{min-height:45px;gap:2px;padding:3px 1px}
  .navigation-controls button>span{font-size:1.05rem}.navigation-controls button>small{font-size:.46rem;letter-spacing:-.01em}
  .navigation-summary-modal{align-items:end;padding:0}.navigation-summary-dialog{width:100%;max-height:88dvh;border-radius:20px 20px 0 0;border-bottom:0}.navigation-summary-content{padding:14px 14px calc(18px + env(safe-area-inset-bottom,0px))}
}

/* v3.0.47 — karttapainikkeille varattu tila, LIPAS-taso ja Laatu-kartan koko Suomi. */
.map-shell .maplibregl-ctrl-top-left,.quality-map .maplibregl-ctrl-top-left{right:10px!important;left:auto!important}
.map-shell .maplibregl-ctrl-top-right,.quality-map .maplibregl-ctrl-top-right{top:10px;right:10px}
.quality-reset-view{position:absolute;z-index:38;top:10px;left:10px;min-height:36px;padding:0 10px;border:1px solid #91a8b8;border-radius:7px;background:rgba(255,255,255,.97);color:#123f5e;box-shadow:0 3px 12px rgba(10,35,52,.23);font-size:.66rem;font-weight:790;cursor:pointer}
.quality-reset-view:hover,.quality-reset-view:focus-visible{outline:none;background:#eaf4f9}
html[data-theme=dark] .quality-reset-view{border-color:#577386;background:#1d3648;color:#fff}
.lipas-popup-card{display:grid;gap:5px;min-width:180px;color:#173345}.lipas-popup-card>strong{font-size:.82rem}.lipas-popup-card>span{color:#0f766e;font-size:.65rem;font-weight:800}.lipas-popup-card p{margin:0;font-size:.64rem;line-height:1.35}.lipas-popup-card a{color:#126b91;font-size:.63rem;font-weight:750}.lipas-popup-card small{margin-top:3px;color:#647785;font-size:.55rem}
@media(max-width:760px){
  .map-data-status,.mobile-center-road-info,.digiroad-welcome{right:74px!important;left:8px!important;width:auto!important;max-width:none!important;transform:none!important}
  .map-data-status{justify-content:flex-start!important;text-align:left}
  .mobile-center-road-info{grid-template-columns:minmax(0,1fr) auto}
  .digiroad-welcome{padding-right:40px}
  .quality-reset-view{top:10px;left:10px;min-height:34px;padding:0 9px;font-size:.61rem}
}

/* v3.0.49 — tähtäimen vapaa alue, alhaalta avautuva laatupaneeli ja näkyvä reititys. */
@media(max-width:760px){
  .basic-page .mobile-route-nav,.digiroad-page .mobile-route-nav{color:var(--accent-strong);background:color-mix(in srgb,var(--accent-soft) 68%,transparent);box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--accent) 24%,transparent)}
  .basic-page .mobile-route-nav.active,.digiroad-page .mobile-route-nav.active{background:var(--accent-strong);color:#fff;box-shadow:none}
  .digiroad-page .digiroad-welcome{margin:0;padding-top:10px;padding-bottom:10px}
  .digiroad-page .mobile-center-road-info{padding-top:7px;padding-bottom:7px}
  .digiroad-page .map-data-status{top:auto!important;right:8px!important;bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom,0px) + 78px)!important;left:auto!important;width:min(285px,calc(100% - 132px))!important;min-height:35px;padding:5px 9px;border-radius:12px}
  .digiroad-page .map-data-status .status-copy strong{font-size:.66rem}
  .digiroad-page .map-data-status .status-copy small{display:none}
  .digiroad-page .map-data-status .status-heartbeat{width:10px;height:10px}
  .quality-sidebar.sheet-peek{height:72px!important;grid-template-rows:64px 0}
  .quality-sidebar.sheet-peek .quality-sheet-content{display:none}
  .quality-sidebar.sheet-half{height:auto;max-height:min(58%,500px);grid-template-rows:64px minmax(0,auto)}
  .quality-sidebar.sheet-half .quality-sheet-content{max-height:calc(min(58dvh,500px) - 64px)}
  .quality-sidebar.sheet-full{grid-template-rows:64px minmax(0,1fr)}
  .quality-sheet-handle{flex-shrink:0}
}
/* Valinnainen tarkka osoitin näyttää nuolen kärjen kohdistuspisteen ja molemmat koordinaattimuodot. */
.maplibregl-canvas{cursor:default!important}
body.coordinate-cursor-active:not(.measure-mode):not(.map-pick-mode):not(.route-edit-mode) .maplibregl-canvas,
body.coordinate-cursor-active:not(.measure-mode):not(.map-pick-mode):not(.route-edit-mode) .maplibregl-canvas:active{cursor:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='38' height='54' viewBox='0 0 38 54'%3E%3Cpath d='M3 3l5 42 10-10 9 18 8-4-9-18 13-2z' fill='white' stroke='%23082f49' stroke-width='3' stroke-linejoin='round'/%3E%3Ccircle cx='3' cy='3' r='3' fill='%23e11d48' stroke='white' stroke-width='2'/%3E%3C/svg%3E") 3 3,default!important}
body.measure-mode .maplibregl-canvas,body.map-pick-mode .maplibregl-canvas{cursor:crosshair!important}
body.route-edit-mode .maplibregl-canvas{cursor:default!important}
.context-menu-kicker{display:block;margin-bottom:3px;color:var(--accent-strong);font-size:.54rem!important;font-weight:850;letter-spacing:.1em;text-transform:uppercase}
.pointer-coordinate-readout{position:absolute;z-index:32;pointer-events:none;min-width:210px;padding:7px 9px;border:1px solid rgba(175,207,221,.9);border-radius:9px;background:rgba(15,48,65,.94);box-shadow:0 8px 24px rgba(8,30,43,.2);color:#fff;font-size:.64rem;line-height:1.3;white-space:nowrap}
.pointer-coordinate-readout strong,.pointer-coordinate-readout span{display:block}.pointer-coordinate-readout span{margin-top:2px;color:#c9e5ef}
@media(hover:none),(pointer:coarse){.pointer-coordinate-readout{display:none!important}}

/* v3.0.54 — koordinaattikohdistin karttakontrollina. */
.digiroad-page #openGoogleMapsRouteBtn{display:none!important}
.quality-page #qualityInfoToggle{display:none!important}
@media(max-width:760px){
  .quality-page .quality-analysis-progress{top:52px!important;left:8px!important;right:62px!important;width:auto!important;transform:none!important;padding:8px!important}
  #routePanel .route-field{grid-template-columns:24px minmax(0,1fr) auto!important;gap:6px!important}
  #routePanel .route-field>.mini-button{grid-column:auto!important;min-height:36px!important;padding:4px 7px!important;font-size:.6rem!important}
  #routePanel .route-preference-buttons button,#routePanel .route-travel-buttons button{min-height:38px!important;padding:5px!important}
  #routePanel .route-location-search-hint{font-size:.55rem!important;margin:3px 0 6px!important}
}
.tieinfo-coordinate-control{position:relative;overflow:visible!important}.tieinfo-coordinate-button{display:grid;width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;padding:0!important;place-items:center;border:0;background:var(--surface-solid,#fff);color:var(--text,#15394d);cursor:pointer}.tieinfo-coordinate-button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.tieinfo-coordinate-button:hover,.tieinfo-coordinate-button:focus-visible{background:var(--surface-soft,#edf4f7);color:var(--accent,#087f9c)}.tieinfo-coordinate-button[aria-pressed=true]{background:var(--accent-strong,#087f9c);color:#fff}.tieinfo-coordinate-menu{position:absolute;top:0;right:42px;display:grid;width:max-content;min-width:184px;max-width:min(244px,calc(100vw - 68px));gap:5px;padding:8px;border:1px solid var(--line);border-radius:9px;background:var(--surface-solid);box-shadow:0 10px 32px rgba(8,30,43,.24);color:var(--text);font-size:.62rem;line-height:1.2}.tieinfo-coordinate-menu[hidden]{display:none}.tieinfo-coordinate-menu strong{font-size:.66rem;white-space:nowrap}.tieinfo-coordinate-menu fieldset{display:grid;gap:1px;margin:0;padding:5px 6px 6px;border:1px solid var(--line);border-radius:7px;min-width:0}.tieinfo-coordinate-menu legend{padding:0 3px;color:var(--muted);font-size:.54rem;white-space:nowrap}.tieinfo-coordinate-menu label{display:flex;align-items:center;gap:6px;min-height:28px;margin:0;padding:2px 3px;white-space:nowrap;cursor:pointer}.tieinfo-coordinate-menu input[type=checkbox],.tieinfo-coordinate-menu input[type=radio]{box-sizing:border-box;flex:0 0 14px!important;width:14px!important;height:14px!important;min-width:14px!important;min-height:14px!important;max-width:14px!important;max-height:14px!important;margin:0!important;padding:0!important;accent-color:var(--accent-strong,#087f9c)}@media(max-width:760px){.tieinfo-coordinate-button{width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important}.tieinfo-coordinate-button svg{width:17px;height:17px}.tieinfo-coordinate-menu{right:40px;min-width:182px;padding:7px}.tieinfo-coordinate-menu label{min-height:30px}}.digiroad-page #startNavigationBtn,.digiroad-page #startNavigationFloatingBtn{display:none!important}

/* Reitin tärkeimmät kentät ja toiminnot pysyvät näkyvillä; harvemmin muutettavat valinnat avautuvat erikseen. */
.route-planning-settings{margin:0 0 8px;border:1px solid var(--line);border-radius:12px;background:var(--surface-soft);overflow:hidden}.route-planning-settings>summary{display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:40px;padding:7px 10px;cursor:pointer;font-size:.68rem;font-weight:800}.route-planning-settings>summary strong{color:var(--accent-strong);font-size:.61rem;text-align:right}.route-planning-settings-content{padding:8px}.route-planning-settings .route-choice-section{margin:0}.route-planning-settings .route-vehicle-settings{margin-top:7px}
@media(max-width:760px){.route-planning-settings>summary{min-height:36px;padding:5px 8px}.route-planning-settings-content{padding:6px}.route-planning-settings .route-choice-grid button{min-height:34px;padding:4px;font-size:.61rem}.route-planning-settings .travel-mode-button small{font-size:.49rem}.route-panel .route-field{margin-bottom:5px}.route-panel .route-field input{min-height:36px}.route-panel .route-point-actions button{min-height:34px}.route-primary-actions{position:sticky;z-index:4;bottom:0;padding:6px;background:linear-gradient(transparent,var(--surface-solid) 18%)}.route-panel .route-waypoint-section{margin-top:5px}.route-panel .route-results{margin-top:7px}}

/* Yhtenäinen, kevyt alapaneeli Laatu- ja Liikenne-näkymiin. */
.quality-page-guide[hidden],.traffic-page-guide[hidden]{display:none!important}
@media(max-width:760px){
  .quality-page-guide,.traffic-page-guide,.quality-info-toggle,.traffic-source-toggle,#trafficExpandList{display:none!important}
  .quality-sidebar,.traffic-sidebar{font-size:.86rem!important}
  .quality-sidebar{grid-template-rows:50px minmax(0,1fr)!important}.quality-sidebar.sheet-peek{height:54px!important;grid-template-rows:50px 0!important}.quality-sidebar.sheet-half{height:min(46dvh,430px)!important;max-height:none!important}.quality-sidebar.sheet-full{height:calc(100dvh - var(--topbar-h) - var(--mobile-nav-h) - env(safe-area-inset-bottom,0px) - 12px)!important}
  .quality-sheet-handle,.traffic-sheet-handle{height:50px!important;min-height:50px!important;padding:10px 12px 4px!important;gap:8px!important;color:var(--text)!important;background:var(--surface-solid)!important}
  .quality-sheet-handle>span,.traffic-sheet-handle>span{top:5px!important;width:42px!important;height:4px!important;background:var(--accent-strong)!important}
  .quality-sheet-handle i,.traffic-sheet-handle i{display:none!important}.quality-sheet-handle strong,.traffic-sheet-handle strong{font-size:.68rem!important}.quality-sheet-handle strong em,.traffic-sheet-handle strong em{font-size:.52rem!important;color:var(--muted)!important;background:transparent!important;padding:0!important}.quality-sheet-handle b,.traffic-sheet-handle b{min-width:25px!important;height:23px!important;font-size:.62rem!important}
  .quality-sheet-content{padding:7px 10px calc(10px + env(safe-area-inset-bottom,0px))!important}.quality-actions{grid-template-columns:minmax(0,1.3fr) minmax(0,1fr)!important;gap:6px!important}.quality-actions .button{min-height:36px!important;padding:5px!important;font-size:.66rem!important}.quality-load-state{padding:7px!important;font-size:.61rem!important}.quality-progress{padding:7px!important}.quality-mobile-tools{gap:5px!important;margin-bottom:5px!important}.quality-mobile-tools button{min-height:32px!important;font-size:.57rem!important}.quality-metrics{gap:5px!important}.quality-metric{padding:6px!important}.quality-metric span{font-size:.53rem!important}.quality-metric strong{font-size:.75rem!important}
  .traffic-sidebar{bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom,0px))!important;border-radius:18px 18px 0 0!important}.traffic-sidebar.sheet-peek{height:54px!important}.traffic-sidebar.sheet-half{height:min(45dvh,430px)!important}.traffic-sidebar.sheet-full{height:calc(100dvh - var(--topbar-h) - var(--mobile-nav-h) - env(safe-area-inset-bottom,0px) - 10px)!important}.traffic-sidebar-head{padding:7px 10px!important}.traffic-sidebar-head h2{font-size:.8rem!important}.traffic-mobile-tools{gap:5px!important;padding:0 8px 6px!important}.traffic-mobile-tools button{min-height:32px!important;padding:4px!important;font-size:.58rem!important}.traffic-list-search{padding:7px 10px!important}.traffic-search-input input{min-height:36px!important;font-size:.68rem!important}.traffic-type-filters{gap:5px!important;padding:6px 10px!important;overflow-x:auto!important;flex-wrap:nowrap!important}.traffic-type-filters button{min-height:33px!important;padding:4px 8px!important;white-space:nowrap!important;font-size:.59rem!important}.traffic-list{padding:7px 10px!important}.traffic-event-card{padding:8px 10px!important}.traffic-event-card strong{font-size:.7rem!important}
}


/* v3.0.54 — koordinaattivalikko portaalina aina kartan muiden elementtien päälle. */
.tieinfo-coordinate-menu-portal{position:fixed!important;right:auto!important;z-index:220!important}
.tieinfo-coordinate-menu-portal[hidden]{display:none!important}

/* v3.0.57 — käyttäjähavaintojen kompakti listaus, haku ja suodatus. */
.observation-layer-actions{display:grid;grid-template-columns:1fr 1fr;gap:7px;margin-top:10px}.observation-layer-actions .button{margin:0}.observation-list-panel{position:fixed;z-index:205;inset:var(--topbar-h,70px) 0 0 auto;width:min(420px,calc(100vw - 16px));padding:10px;display:flex;justify-content:flex-end;pointer-events:none}.observation-list-panel[hidden]{display:none!important}.observation-list-shell{width:100%;height:100%;display:grid;grid-template-rows:auto auto minmax(0,1fr);overflow:hidden;border:1px solid var(--line);border-radius:16px;background:var(--surface-solid);box-shadow:-12px 0 34px rgba(8,30,43,.24);pointer-events:auto}.observation-list-header{display:flex;align-items:flex-start;justify-content:space-between;gap:10px;padding:12px 12px 8px;border-bottom:1px solid var(--line)}.observation-list-header h2{margin:1px 0 2px;font-size:1rem}.observation-list-header small{color:var(--muted);font-size:.62rem}.observation-list-tools{display:grid;gap:7px;padding:8px 10px;border-bottom:1px solid var(--line);background:var(--surface-soft)}.observation-list-search{height:36px;display:grid;grid-template-columns:20px minmax(0,1fr) 26px;align-items:center;gap:5px;padding:0 7px;border:1px solid var(--line);border-radius:10px;background:var(--surface-solid)}.observation-list-search svg{width:16px;height:16px;fill:none;stroke:var(--muted);stroke-width:1.8}.observation-list-search input{min-width:0!important;width:100%!important;height:32px!important;min-height:32px!important;padding:0!important;border:0!important;background:transparent!important;color:var(--text)!important;font:inherit;font-size:.68rem!important;outline:none!important}.observation-list-search button{width:26px;height:26px;padding:0;border:0;border-radius:7px;background:transparent;color:var(--muted);font-size:1rem;cursor:pointer}.observation-list-filter-row{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr) 82px;gap:5px}.observation-list-filter-row select{width:100%;min-width:0;min-height:32px;padding:4px 24px 4px 7px;border:1px solid var(--line);border-radius:8px;background:var(--surface-solid);color:var(--text);font-size:.59rem}.observation-list-visible-toggle{display:flex;align-items:center;gap:6px;min-height:24px;color:var(--muted);font-size:.59rem}.observation-list-visible-toggle input{width:15px!important;height:15px!important;min-width:15px!important;min-height:15px!important;margin:0!important;accent-color:var(--accent-strong)}.observation-list-content{overflow:auto;overscroll-behavior:contain;padding:8px 9px calc(12px + env(safe-area-inset-bottom,0px))}.observation-list-group{display:grid;gap:5px;margin:0 0 10px}.observation-list-group h3{display:flex;align-items:center;justify-content:space-between;margin:2px 2px 3px;color:var(--muted);font-size:.62rem;text-transform:uppercase;letter-spacing:.04em}.observation-list-group h3 span{font-size:.58rem}.observation-list-card{display:grid;width:100%;grid-template-columns:30px minmax(0,1fr) auto;align-items:start;gap:8px;padding:8px;border:1px solid var(--line);border-radius:11px;background:var(--surface-solid);color:var(--text);text-align:left;cursor:pointer}.observation-list-card:hover,.observation-list-card:focus-visible{border-color:color-mix(in srgb,var(--accent) 52%,var(--line));background:color-mix(in srgb,var(--accent-soft) 40%,var(--surface-solid));outline:none}.observation-list-symbol{width:28px;height:28px;display:grid;place-items:center;border-radius:999px;background:#d97706;color:#fff;font-size:.65rem;font-weight:900}.observation-list-card-main{min-width:0;display:grid;gap:2px}.observation-list-card-main strong{font-size:.68rem}.observation-list-card-main>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:.6rem}.observation-list-card-main small{display:-webkit-box;overflow:hidden;-webkit-line-clamp:2;-webkit-box-orient:vertical;color:var(--text);font-size:.59rem;line-height:1.35}.observation-list-card time{white-space:nowrap;color:var(--muted);font-size:.54rem}.observation-list-empty{margin:20px 8px;color:var(--muted);font-size:.68rem;text-align:center}
@media(max-width:760px){.observation-layer-actions{grid-template-columns:1fr}.observation-list-panel{inset:0;padding:0;align-items:end;width:100%;background:rgba(8,30,43,.18);pointer-events:auto}.observation-list-shell{height:min(72dvh,650px);border-radius:18px 18px 0 0;border-bottom:0;box-shadow:0 -12px 34px rgba(8,30,43,.28)}.observation-list-header{padding:10px 12px 7px}.observation-list-header h2{font-size:.9rem}.observation-list-tools{gap:6px;padding:7px 9px}.observation-list-search{height:34px}.observation-list-search input{height:30px!important;min-height:30px!important;font-size:.65rem!important}.observation-list-filter-row{grid-template-columns:minmax(0,1fr) minmax(0,.9fr) 72px}.observation-list-filter-row select{min-height:30px;font-size:.56rem}.observation-list-content{padding:7px 8px calc(var(--mobile-nav-h,64px) + env(safe-area-inset-bottom,0px) + 8px)}.observation-list-card{grid-template-columns:28px minmax(0,1fr);gap:7px;padding:7px}.observation-list-symbol{width:26px;height:26px}.observation-list-card time{grid-column:2;margin-top:1px}.observation-list-card-main strong{font-size:.65rem}.observation-list-card-main>span,.observation-list-card-main small{font-size:.57rem}}
.observation-list-card time em{display:block;margin-top:3px;color:var(--accent-strong);font-style:normal;font-size:.5rem;font-weight:800}.observation-list-card[data-status="expired"] time em,.observation-list-card[data-status="resolved"] time em{color:var(--muted)}

/* v3.0.57 – Laatu: havainnot etusijalle ja karttamerkkien kontrasti */
.quality-secondary-tools{margin:8px 0 0;border:1px solid var(--line);border-radius:10px;background:var(--surface-soft);overflow:hidden}
.quality-secondary-tools>summary{min-height:34px;display:flex;align-items:center;justify-content:space-between;padding:6px 9px;color:var(--text);font-size:.64rem;font-weight:780;cursor:pointer;list-style:none}
.quality-secondary-tools>summary::-webkit-details-marker{display:none}
.quality-secondary-tools>summary::after{content:"+";font-size:.9rem;line-height:1;color:var(--muted)}
.quality-secondary-tools[open]>summary::after{content:"−"}
.quality-secondary-tools[open]>summary{border-bottom:1px solid var(--line)}
.quality-secondary-tools .quality-filters{margin:0;padding:8px}
.quality-secondary-tools .quality-settings-panel{padding:8px}
.quality-secondary-tools .quality-restriction-switch:last-child{margin-bottom:0}
.quality-secondary-tools .quality-low-note{margin:0 8px 8px}
.quality-sidebar.has-results .quality-metrics{margin-top:3px;margin-bottom:6px}
.quality-sidebar.has-results>.quality-sheet-content>.admin-result-count{margin:0 2px 5px}
.quality-sidebar.has-results .quality-list{max-height:min(38vh,410px);overflow-y:auto;overscroll-behavior:contain;padding-bottom:4px;scrollbar-gutter:stable}
.quality-list-item.impact-medium{border-left-color:#ff9f0a}
.quality-metrics .medium strong{color:#c76f00}
.quality-legend-dot.medium,.qdot.medium{background:#ff9f0a;box-shadow:0 0 0 1px #102a43,0 0 0 2px rgba(255,255,255,.78)}

@media(max-width:900px){
  .quality-secondary-tools{display:contents;margin:0;border:0;background:transparent;overflow:visible}
  .quality-secondary-tools>summary{display:none}
  .quality-intro-card{order:5}
  .quality-metrics{order:6}
  .quality-sheet-content>.admin-result-count{order:7}
  .quality-list{order:8}
  .quality-place-search{order:9}
  #qualityFiltersDetails{order:10}
  #qualitySettingsDetails{order:11}
  .quality-sidebar.has-results .quality-list{max-height:min(34dvh,330px);overflow-y:auto;padding-bottom:5px}
  .quality-settings-panel.is-open{display:block}
  .quality-filters.quality-mobile-panel.is-open{display:grid}
}
.quality-secondary-tools .quality-settings-panel{display:block}


/* v3.0.57 — Digiroad-käyttäjähavainnon tietokortti ei saa jäädä aloituskortin alle. */
.digiroad-welcome{transition:opacity .14s ease,transform .14s ease,visibility .14s linear}
.digiroad-page.digiroad-observation-popup-open .digiroad-welcome{
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transform:translate(-50%,-10px);
}
.digiroad-page.digiroad-observation-popup-open .maplibregl-popup{z-index:48}
@media (prefers-reduced-motion:reduce){
  .digiroad-welcome{transition:none}
}


/* v3.0.61 — PWA/mobiili: samat Digiroad-toiminnot ja päällekkäisyyksien esto. */
.tieinfo-observation-list-button{display:grid;width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;padding:0!important;place-items:center;border:0;background:var(--surface-solid,#fff);color:var(--text,#15394d);cursor:pointer}
.tieinfo-observation-list-button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tieinfo-observation-list-button:hover,.tieinfo-observation-list-button:focus-visible{background:var(--surface-soft,#edf4f7);color:var(--accent,#087f9c)}
.tieinfo-coordinate-menu-portal{z-index:10020!important}
body.coordinate-menu-open .mobile-center-target,body.coordinate-menu-open .mobile-center-road-info{visibility:hidden!important;pointer-events:none!important}
@media(max-width:760px),(pointer:coarse){
  .tieinfo-observation-list-button{width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important}
  .tieinfo-observation-list-button svg{width:17px;height:17px}
  .digiroad-page.mobile-center-info-visible .digiroad-welcome{opacity:0!important;visibility:hidden!important;pointer-events:none!important;transform:translateY(-8px)!important}
  .digiroad-page.mobile-center-info-visible .mobile-center-road-info{top:8px!important}
  .digiroad-page.coordinate-menu-open .digiroad-welcome{opacity:0!important;visibility:hidden!important;pointer-events:none!important}
}
@media(display-mode:standalone){
  .tieinfo-coordinate-menu-portal{z-index:12020!important}
}

/* v3.0.61 — PWA/mobiili: valitun koordinaattimuodon arvo keskitähtäimen yhteyteen. */
.mobile-center-coordinate-readout{
  position:absolute;
  left:50%;
  top:calc(100% + 9px);
  z-index:2;
  display:grid;
  width:max-content;
  max-width:min(300px,calc(100vw - 92px));
  gap:1px;
  transform:translateX(-50%);
  padding:5px 8px;
  border:1px solid rgba(190,220,231,.88);
  border-radius:8px;
  background:rgba(13,43,60,.92);
  box-shadow:0 5px 15px rgba(8,30,43,.24);
  color:#fff;
  font-size:.58rem;
  font-weight:700;
  line-height:1.2;
  letter-spacing:.01em;
  text-align:center;
  white-space:nowrap;
  backdrop-filter:blur(8px);
  pointer-events:none;
}
.mobile-center-coordinate-readout[hidden]{display:none!important}
.mobile-center-coordinate-readout strong{font-size:.53rem;color:#bfeaf4;font-weight:800}
.mobile-center-coordinate-readout span{display:block}
@media (hover:hover) and (pointer:fine){.mobile-center-coordinate-readout{display:none!important}}
@media (max-width:390px){
  .mobile-center-coordinate-readout{max-width:calc(100vw - 76px);padding:4px 6px;font-size:.54rem}
}


/* v3.0.61 — koordinaatit aina tie-hoverin yläpuolelle, aluevalitsin palautettavaksi ja Info/Ohje vakaaksi. */
.pointer-coordinate-readout{z-index:96!important}
.mobile-center-target.coordinates-visible{z-index:96!important}
.mobile-center-target.coordinates-visible .mobile-center-coordinate-readout{z-index:4!important;box-shadow:0 6px 18px rgba(8,30,43,.32),0 0 0 1px rgba(255,255,255,.16)}
.tieinfo-area-button{display:grid;width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;padding:0!important;place-items:center;border:0;background:var(--surface-solid,#fff);color:var(--text,#15394d);cursor:pointer}
.tieinfo-area-button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tieinfo-area-button:hover,.tieinfo-area-button:focus-visible{background:var(--surface-soft,#edf4f7);color:var(--accent,#087f9c)}
#legendInfoPanel .main-page-guide{display:none!important}
.legend-info-panel:not([hidden]){display:flex!important;min-height:0;flex-direction:column}
.legend-info-panel .legend-info-scroll{flex:1 1 auto;min-height:0;max-height:none!important}
@media(max-width:760px),(pointer:coarse){
  .tieinfo-area-button{width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important}
  .tieinfo-area-button svg{width:17px;height:17px}
  .legend-info-panel{top:auto!important;left:6px!important;right:6px!important;bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom,0px) + 6px)!important;width:auto!important;max-height:min(72dvh,680px)!important;border-radius:18px!important}
  .legend-info-header{min-height:58px;padding:9px 11px 8px 13px}
  .legend-info-header h2{font-size:.92rem;line-height:1.16}
  .legend-info-scroll{padding:10px 11px calc(16px + env(safe-area-inset-bottom,0px))!important}
}
@media(display-mode:standalone){
  .legend-info-panel{max-height:min(70dvh,660px)!important}
}

/* v3.0.61: Digiroad-aineiston päivitystieto yläpalkissa */
.digiroad-freshness-badge{display:inline-flex;align-items:center;gap:6px;min-width:0;max-width:190px;height:34px;padding:0 10px;border:1px solid var(--line);border-radius:11px;background:var(--surface-soft);color:var(--text);font:inherit;font-size:.61rem;font-weight:800;white-space:nowrap;cursor:pointer;box-shadow:none}
.digiroad-freshness-badge:hover,.digiroad-freshness-badge:focus-visible{border-color:color-mix(in srgb,var(--accent) 55%,var(--line));background:var(--accent-soft);outline:none}
.digiroad-freshness-badge:disabled{opacity:.65;cursor:wait}
.digiroad-freshness-dot{width:8px;height:8px;flex:0 0 8px;border-radius:999px;background:#d08a00;box-shadow:0 0 0 3px color-mix(in srgb,#d08a00 16%,transparent)}
.digiroad-freshness-badge[data-state="known"] .digiroad-freshness-dot{background:#1f9d67;box-shadow:0 0 0 3px color-mix(in srgb,#1f9d67 16%,transparent)}
@media(max-width:900px){.digiroad-freshness-badge{position:absolute;left:50%;bottom:3px;transform:translateX(-50%);height:21px;max-width:126px;padding:0 7px;border-radius:8px;font-size:.51rem;z-index:3}.digiroad-freshness-dot{width:6px;height:6px;flex-basis:6px}.digiroad-page .common-map-topbar .brand,.digiroad-page .common-map-topbar .common-map-nav{padding-bottom:13px}}
@media(max-width:420px){.digiroad-freshness-badge{max-width:112px;font-size:.48rem}}

/* v3.0.63: Digiroad update badge belongs to the top bar, never over the map/tool rail. */
.digiroad-page .common-map-topbar .digiroad-freshness-badge{
  position:static!important;left:auto!important;right:auto!important;bottom:auto!important;top:auto!important;
  transform:none!important;flex:0 1 auto;align-self:center;z-index:auto!important;
  max-width:190px;height:32px;margin:0 4px;padding:0 9px;
}
@media(max-width:900px){
  .digiroad-page .common-map-topbar .digiroad-freshness-badge{position:static!important;transform:none!important;height:30px;max-width:128px;margin:0 2px;padding:0 7px;font-size:.5rem}
  .digiroad-page .common-map-topbar .brand,.digiroad-page .common-map-topbar .common-map-nav{padding-bottom:0!important}
}
@media(max-width:560px){
  .digiroad-page .common-map-topbar .digiroad-freshness-badge{max-width:92px;height:28px;font-size:.47rem;overflow:hidden}
  .digiroad-page .common-map-topbar .digiroad-freshness-badge strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
}

/* Digiroad traffic bulletins */
.digiroad-traffic-popup .maplibregl-popup-content{padding:0;border-radius:16px;overflow:hidden}
.digiroad-traffic-card{width:min(390px,76vw);padding:14px 15px;background:var(--surface-solid);color:var(--text)}
.digiroad-traffic-head{display:flex;align-items:flex-start;gap:9px}.digiroad-traffic-head i{width:11px;height:11px;border-radius:999px;flex:0 0 11px;margin-top:5px}.digiroad-traffic-head div{display:grid;gap:2px}.digiroad-traffic-head span{color:var(--muted);font-size:.6rem;font-weight:800;text-transform:uppercase;letter-spacing:.04em}.digiroad-traffic-head strong{font-size:.88rem;line-height:1.22}
.digiroad-traffic-card p{margin:10px 0;font-size:.66rem;line-height:1.45}.digiroad-traffic-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px}.digiroad-traffic-grid div{padding:7px 8px;border-radius:9px;background:var(--surface-soft)}.digiroad-traffic-grid dt{margin:0 0 2px;color:var(--muted);font-size:.51rem;font-weight:900;text-transform:uppercase}.digiroad-traffic-grid dd{margin:0;font-size:.62rem;font-weight:800}.digiroad-traffic-effects{margin-top:10px;padding-top:8px;border-top:1px solid var(--line)}.digiroad-traffic-effects strong{font-size:.62rem}.digiroad-traffic-effects ul{margin:5px 0 0;padding-left:17px;font-size:.61rem;line-height:1.4}

/* Keep map legend, scale and attribution in separate responsive lanes. */
.digiroad-page .maplibregl-ctrl-bottom-left{display:grid!important;grid-auto-flow:column;grid-auto-columns:max-content;align-items:end;gap:6px;max-width:calc(100% - 16px)}
.digiroad-page .maplibregl-ctrl-bottom-left>.maplibregl-ctrl{margin:0 0 8px 8px!important}
.digiroad-page .maplibregl-ctrl-bottom-left .map-base-name-control{order:1}.digiroad-page .maplibregl-ctrl-bottom-left .maplibregl-ctrl-scale{order:0}.digiroad-page .maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib{order:2}
.quality-map-wrap .maplibregl-ctrl-bottom-left{padding-right:170px;box-sizing:border-box;max-width:100%}
.quality-map-wrap .quality-map-legend{left:auto;right:10px;bottom:10px;z-index:5}
@media(max-width:760px){
  .digiroad-page .maplibregl-ctrl-bottom-left{grid-auto-flow:row;gap:2px;bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom,0px) + 5px)!important}
  .digiroad-page .maplibregl-ctrl-bottom-left>.maplibregl-ctrl{margin:0 0 2px 8px!important}
  .quality-map-wrap .maplibregl-ctrl-bottom-left{padding-right:0}.quality-map-wrap .quality-map-legend{right:8px;bottom:calc(var(--mobile-nav-h) + env(safe-area-inset-bottom,0px) + 54px)}
}


/* v3.0.65: Digiroad update status is structurally inside the brand, never a separate topbar grid item. */
.digiroad-page .brand-text .digiroad-brand-meta{display:flex;align-items:center;gap:7px;min-width:0;margin-top:2px}
.digiroad-page .brand-text .digiroad-brand-meta>small{margin:0;min-width:0}
.digiroad-page .brand-text .digiroad-freshness-badge{position:static!important;inset:auto!important;transform:none!important;display:inline-flex!important;align-items:center;gap:4px;flex:0 0 auto;width:auto;max-width:none;height:auto;min-height:0;margin:0;padding:0;border:0;border-radius:0;background:transparent;box-shadow:none;color:var(--muted);font-size:.56rem;font-weight:800;line-height:1.1;cursor:default}
.digiroad-page .brand-text .digiroad-freshness-badge:hover{background:transparent;border-color:transparent}
.digiroad-page .brand-text .digiroad-freshness-dot{width:6px;height:6px;flex:0 0 6px;box-shadow:none}
@media(max-width:1240px){.digiroad-page .brand-text .digiroad-brand-meta>small{display:none!important}.digiroad-page .brand-text .digiroad-brand-meta{margin-top:1px}.digiroad-page .brand-text .digiroad-freshness-badge{font-size:.5rem}}
@media(max-width:760px){.digiroad-page .brand-text .digiroad-brand-meta{display:flex!important}.digiroad-page .brand-text .digiroad-freshness-badge{max-width:92px!important;font-size:.46rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.digiroad-page .brand-text .digiroad-freshness-dot{width:5px;height:5px;flex-basis:5px}}

/* v3.0.65: long traffic/closure cards must stay inside the current map viewport. */
.digiroad-traffic-popup .maplibregl-popup-content{max-height:none!important;overflow:hidden!important}
.digiroad-traffic-popup .digiroad-traffic-card{box-sizing:border-box;overscroll-behavior:contain;scrollbar-gutter:stable}
@media(max-width:760px){.digiroad-traffic-popup .digiroad-traffic-card{width:min(360px,calc(100vw - 44px))}}


/* v3.0.66: valinnaiset Digiroad-lisäkohteet ja kohteiden tarkemmat tiedot */
.digiroad-extra-layers { margin: 8px 0 10px; border: 1px solid var(--line); border-radius: 12px; background: color-mix(in srgb, var(--panel) 86%, transparent); overflow: hidden; }
.digiroad-extra-layers > summary { cursor: pointer; list-style: none; padding: 10px 12px; font-size: .8rem; font-weight: 750; display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.digiroad-extra-layers > summary::-webkit-details-marker { display: none; }
.digiroad-extra-layers > summary::after { content: "+"; flex: 0 0 auto; font-size: 1rem; line-height: 1; color: var(--muted); }
.digiroad-extra-layers[open] > summary::after { content: "–"; }
.digiroad-extra-layers > summary small { margin-left: auto; font-weight: 500; color: var(--muted); font-size: .65rem; text-align: right; }
.digiroad-extra-layers-body { padding: 0 12px 4px; border-top: 1px solid var(--line); }
.restriction-popup-details { margin-top: 10px; border-top: 1px solid var(--line); padding-top: 8px; }
.restriction-popup-details > summary { cursor: pointer; font-size: .72rem; font-weight: 750; color: var(--text); }
.restriction-popup-details dl { margin: 8px 0 0; display: grid; gap: 6px; }
.restriction-popup-details dl > div { display: grid; grid-template-columns: minmax(88px, .8fr) minmax(0, 1.2fr); gap: 8px; font-size: .67rem; line-height: 1.32; }
.restriction-popup-details dt { color: var(--muted); font-weight: 650; }
.restriction-popup-details dd { margin: 0; overflow-wrap: anywhere; }
.restriction-popup-links { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.restriction-popup-links a { display: inline-flex; align-items: center; min-height: 32px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 9px; background: color-mix(in srgb, var(--panel) 82%, white 18%); color: var(--accent); text-decoration: none; font-size: .67rem; font-weight: 750; }
@media (max-width: 720px) {
  .digiroad-extra-layers > summary { align-items: flex-start; }
  .digiroad-extra-layers > summary small { max-width: 46%; }
  .restriction-info-popup .maplibregl-popup-content { max-width: min(330px, 88vw); }
  .restriction-popup-details dl > div { grid-template-columns: 1fr; gap: 1px; }
}


/* v3.0.67: päivitystiedot, karttapohjan pikavaihto ja selkeä hover-sijoittelu */
.quality-topmeta{display:flex!important;align-items:center;justify-content:flex-end;gap:8px;min-width:0}.quality-freshness-copy{display:grid;min-width:0;text-align:right}.quality-freshness-copy span,.quality-freshness-copy small{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.quality-refresh-button{display:inline-flex;align-items:center;gap:5px;min-height:32px;padding:0 9px;border:1px solid var(--line);border-radius:10px;background:var(--surface-solid);color:var(--text);font:inherit;font-size:.59rem;font-weight:800;cursor:pointer}.quality-refresh-button:hover,.quality-refresh-button:focus-visible{border-color:var(--accent);background:var(--accent-soft);color:var(--accent-strong);outline:none}.quality-refresh-button:disabled{opacity:.55;cursor:wait}.quality-refresh-button span{font-size:.9rem;line-height:1}.tieinfo-basemap-button{display:grid;width:34px!important;height:34px!important;min-width:34px!important;min-height:34px!important;padding:0!important;place-items:center;border:0;background:var(--surface-solid,#fff);color:var(--text,#15394d);cursor:pointer}.tieinfo-basemap-button svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.tieinfo-basemap-button:hover,.tieinfo-basemap-button:focus-visible{background:var(--surface-soft,#edf4f7);color:var(--accent,#087f9c)}@media(max-width:760px){.tieinfo-basemap-control{display:none!important}.quality-topmeta{max-width:150px!important;gap:4px}.quality-freshness-copy small{display:none}.quality-refresh-button{min-width:31px;width:31px;padding:0;justify-content:center}.quality-refresh-button strong{display:none}}

/* v3.0.72 — päivitystiedot, Digiroad-rajoitteiden selkokielinen esitys ja mobiili/PWA-yläpalkit. */
.digiroad-brand-zone{display:flex;min-width:0;align-items:center;gap:10px;grid-column:1!important;justify-self:start!important}
.digiroad-brand-zone .brand{grid-column:auto!important;justify-self:auto!important;min-width:0}
.digiroad-freshness-button{display:inline-flex;min-width:0;max-width:250px;align-items:center;gap:7px;padding:6px 9px;border:1px solid var(--line);border-radius:11px;background:var(--surface-solid);color:var(--text);box-shadow:0 1px 4px rgba(15,23,42,.08);font:inherit;cursor:pointer;text-align:left}
.digiroad-freshness-button:hover,.digiroad-freshness-button:focus-visible{border-color:var(--accent);background:var(--accent-soft);outline:none;box-shadow:0 3px 12px rgba(15,23,42,.12)}
.digiroad-freshness-button:disabled{opacity:.6;cursor:wait}
.digiroad-freshness-copy{display:grid;min-width:0;gap:1px;line-height:1.08}
.digiroad-freshness-copy>span{color:var(--muted);font-size:.52rem;font-weight:720;white-space:nowrap}
.digiroad-freshness-copy>strong{overflow:hidden;color:var(--text);font-size:.58rem;font-weight:820;text-overflow:ellipsis;white-space:nowrap}
.digiroad-freshness-action{display:grid;flex:0 0 22px;width:22px;height:22px;place-items:center;border-left:1px solid var(--line);font-size:.85rem;font-weight:900}
.digiroad-freshness-button[data-state="known"] .digiroad-freshness-dot{background:#1f9d67}
.digiroad-freshness-button[data-state="unknown"] .digiroad-freshness-dot{background:#d08a00}

.restriction-popup-details dl>div{align-items:start}
.restriction-popup-details dt{line-height:1.25}
.restriction-popup-details dd{font-weight:650;line-height:1.35}
.restriction-popup-time-note{margin:8px 0 0!important;padding-top:7px;border-top:1px dashed var(--line);color:var(--muted);font-size:.58rem!important;line-height:1.4!important}
.restriction-popup-links{margin-top:12px}
.restriction-popup-links a{gap:8px;justify-content:center;min-height:36px;padding:7px 11px;border:1px solid color-mix(in srgb,var(--accent) 55%,var(--line));border-radius:10px;background:var(--surface-solid);box-shadow:0 1px 4px rgba(15,23,42,.08)}
.restriction-popup-links a:hover,.restriction-popup-links a:focus-visible{border-color:var(--accent);background:var(--accent-soft);outline:none}

@media(min-width:761px){
  .digiroad-page .common-map-topbar .digiroad-brand-zone{max-width:min(520px,40vw)}
}

@media(max-width:760px){
  .digiroad-brand-zone{gap:5px;max-width:46vw}
  .digiroad-brand-zone .brand{gap:4px!important}
  .digiroad-freshness-button{max-width:155px;min-height:34px;padding:4px 6px;gap:5px;border-radius:9px}
  .digiroad-freshness-copy>span{font-size:.43rem}
  .digiroad-freshness-copy>strong{font-size:.48rem}
  .digiroad-freshness-action{flex-basis:18px;width:18px;height:18px;font-size:.72rem}
  .common-map-topbar .header-version-badge,.shared-page-brand .header-version-badge{display:inline-flex!important;min-height:20px!important;padding:2px 5px!important;font-size:.47rem!important;line-height:1!important}
  .basic-page .common-map-topbar .brand-text small{display:none!important}
  .digiroad-page .common-map-topbar .brand-text small{display:none!important}
}
@media(max-width:480px){
  .digiroad-brand-zone{max-width:52vw}
  .digiroad-freshness-button{max-width:122px}
  .digiroad-freshness-copy>span{display:none}
  .digiroad-freshness-copy>strong{font-size:.46rem}
}

/* v3.0.73 — Digiroad ladataan käyttäjän pyynnöstä, aluevalitsimen palautusvihje. */
.digiroad-welcome .digiroad-load-button{
  border-color:#16835b!important;
  background:#e9f7ef!important;
  color:#12633f!important;
  box-shadow:0 1px 4px rgba(18,99,63,.08);
}
.digiroad-welcome .digiroad-load-button:not(:disabled):hover,
.digiroad-welcome .digiroad-load-button:not(:disabled):focus-visible{
  border-color:#0f704b!important;
  background:#dff3e8!important;
  outline:none;
}
.digiroad-welcome .digiroad-load-button:disabled{
  border-color:var(--line)!important;
  background:var(--surface-soft)!important;
  color:var(--muted)!important;
  opacity:.72;
  cursor:not-allowed;
  box-shadow:none;
}
#digiroadLoadHint{display:block;margin-top:8px;color:var(--muted);font-size:.67rem;line-height:1.35}
.tieinfo-area-control{position:relative}
.tieinfo-area-control.area-hint-active::before{
  content:attr(data-hint);
  position:absolute;
  right:calc(100% + 9px);
  top:50%;
  transform:translateY(-50%);
  width:max-content;
  max-width:min(220px,62vw);
  padding:7px 10px;
  border:1px solid color-mix(in srgb,var(--accent) 45%,var(--line));
  border-radius:9px;
  background:var(--surface-solid,#fff);
  color:var(--text,#15394d);
  box-shadow:0 6px 18px rgba(15,23,42,.18);
  font-size:.66rem;
  font-weight:800;
  line-height:1.25;
  pointer-events:none;
  z-index:30;
  animation:tieinfoAreaHintIn .18s ease-out both;
}
.tieinfo-area-control.area-hint-active .tieinfo-area-button{
  outline:2px solid color-mix(in srgb,var(--accent) 70%,transparent);
  outline-offset:2px;
  animation:tieinfoAreaPulse .85s ease-in-out 3;
}
.digiroad-freshness-button[data-state="fetched"] .digiroad-freshness-dot{background:#2f7fb5}
@keyframes tieinfoAreaHintIn{from{opacity:0;transform:translate(8px,-50%)}to{opacity:1;transform:translate(0,-50%)}}
@keyframes tieinfoAreaPulse{0%,100%{box-shadow:none}50%{box-shadow:0 0 0 5px color-mix(in srgb,var(--accent) 18%,transparent)}}
@media(max-width:760px){
  .tieinfo-area-control.area-hint-active::before{max-width:180px;padding:6px 8px;font-size:.61rem}
  #digiroadLoadHint{font-size:.62rem}
}
@media(prefers-reduced-motion:reduce){
  .tieinfo-area-control.area-hint-active::before,
  .tieinfo-area-control.area-hint-active .tieinfo-area-button{animation:none}
}

/* v3.0.74 — STUK/FMI-säteilyasemat ja Digiroad-päivitysajan luettavuus. */
.stuk-popup{min-width:230px;color:var(--text,#17384b)}
.stuk-popup-head{display:flex;align-items:center;gap:9px;margin-bottom:9px}
.stuk-popup-head>div{display:grid;gap:1px}
.stuk-popup-head strong{font-size:.82rem;line-height:1.2}
.stuk-popup-head span:not(.stuk-popup-symbol){color:var(--muted,#657786);font-size:.62rem;line-height:1.25}
.stuk-popup-symbol{display:grid;flex:0 0 29px;width:29px;height:29px;place-items:center;border:1px solid color-mix(in srgb,#5b5bd6 45%,var(--line,#d5e0e6));border-radius:50%;background:color-mix(in srgb,#5b5bd6 10%,white);color:#4747b8;font-size:1rem}
.stuk-popup-value{margin:4px 0 10px;font-size:1.22rem;font-weight:850;letter-spacing:-.02em}
.stuk-popup-meta{display:grid;gap:5px;margin:0;padding:9px 0;border-top:1px solid var(--line,#d5e0e6);border-bottom:1px solid var(--line,#d5e0e6)}
.stuk-popup-meta>div{display:grid;grid-template-columns:82px 1fr;gap:8px}
.stuk-popup-meta dt{color:var(--muted,#657786);font-size:.58rem;font-weight:750}
.stuk-popup-meta dd{margin:0;font-size:.61rem;font-weight:700}
.stuk-popup-note{margin:9px 0 0;color:var(--muted,#657786);font-size:.55rem;line-height:1.35}
@media(min-width:761px){
  .digiroad-page .common-map-topbar .digiroad-brand-zone{max-width:none!important}
  .digiroad-page .digiroad-freshness-button{max-width:none!important;width:auto;min-width:270px}
  .digiroad-page .digiroad-freshness-copy>strong{overflow:visible;text-overflow:clip}
}


/* v3.0.75: sää- ja olosuhdekerrokset */
.weather-layer-options{display:grid;grid-template-columns:auto minmax(90px,140px) auto;align-items:center;gap:8px 10px}.weather-layer-options .field-note{grid-column:1/-1}.weather-layer-options select{min-height:34px;padding:5px 28px 5px 9px}.weather-popup-source,.lightning-popup-card>span{display:block;margin-top:2px;color:#64748b;font-size:.78rem}.weather-popup-grid{display:grid;grid-template-columns:1fr 1fr;gap:6px;margin:10px 0}.weather-popup-grid>div{padding:7px 8px;border:1px solid rgba(20,106,138,.16);border-radius:8px;background:rgba(232,245,255,.72)}.weather-popup-grid span{display:block;color:#64748b;font-size:.72rem}.weather-popup-grid strong{display:block;margin-top:2px}.lightning-popup-card dl{display:grid;gap:5px;margin:10px 0}.lightning-popup-card dl div{display:flex;justify-content:space-between;gap:14px;border-bottom:1px solid rgba(100,116,139,.14);padding-bottom:4px}.lightning-popup-card dt{color:#64748b}.lightning-popup-card dd{margin:0;font-weight:700;text-align:right}@media(max-width:720px){.weather-layer-options{grid-template-columns:1fr auto}.weather-layer-options label{grid-column:1/-1}.weather-layer-options .mini-button{white-space:nowrap}.weather-popup-grid{grid-template-columns:1fr 1fr}}
