/* Trafikkpilot: reference-led design tokens. No paid fonts or component libraries. */
:root{color-scheme:light dark;--tp-bg:#f3f5f8;--tp-surface:#fff;--tp-soft:#edf0f4;--tp-text:#101b2b;--tp-muted:#546174;--tp-line:#d7dce4;--tp-primary:#123553;--tp-on-primary:#fff;--tp-accent:#ffc247;--tp-accent-text:#17202d;--tp-danger:#b51f35;--tp-danger-bg:#ffebef;--tp-warning:#8a4800;--tp-warning-bg:#fff2d5;--tp-info:#185ea5;--tp-info-bg:#e8f2ff;--tp-success:#14613e;--tp-success-bg:#e4f5eb;--tp-shadow:0 6px 28px #152b4814;--tp-radius:24px;--tp-control:16px;--tp-font:system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){--tp-bg:#091322;--tp-surface:#142033;--tp-soft:#1d2b40;--tp-text:#f1f5fc;--tp-muted:#b4c0d2;--tp-line:#394a61;--tp-primary:#3073bc;--tp-on-primary:#fff;--tp-accent:#ffc247;--tp-danger:#ff91a3;--tp-danger-bg:#401e2b;--tp-warning:#ffd28a;--tp-warning-bg:#392b16;--tp-info:#a3ccff;--tp-info-bg:#172f4d;--tp-success:#8bdfb4;--tp-success-bg:#17372d;--tp-shadow:0 8px 30px #0004}}
:root[data-theme=dark]{--tp-bg:#091322;--tp-surface:#142033;--tp-soft:#1d2b40;--tp-text:#f1f5fc;--tp-muted:#b4c0d2;--tp-line:#394a61;--tp-primary:#3073bc;--tp-on-primary:#fff;--tp-accent:#ffc247;--tp-danger:#ff91a3;--tp-danger-bg:#401e2b;--tp-warning:#ffd28a;--tp-warning-bg:#392b16;--tp-info:#a3ccff;--tp-info-bg:#172f4d;--tp-success:#8bdfb4;--tp-success-bg:#17372d;--tp-shadow:0 8px 30px #0004}
html{font-family:var(--tp-font);background:var(--tp-bg);color:var(--tp-text)}body{background:var(--tp-bg);color:var(--tp-text)}.sr-only{position:absolute;width:1px;height:1px;padding:0;overflow:hidden;clip-path:inset(50%);white-space:nowrap;border:0}.tp-icon{width:24px;height:24px;flex:none;vertical-align:middle;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
#app-shell{max-width:760px;margin:auto;background:var(--tp-surface);min-height:100dvh;color:var(--tp-text);padding-bottom:calc(88px + env(safe-area-inset-bottom))}#app-shell *{box-sizing:border-box}#app-shell button,#app-shell input,#app-shell select{font-family:var(--tp-font);font-size:16px}#app-shell button{min-height:48px;padding:12px 16px;border-radius:var(--tp-control);background:var(--tp-primary);color:var(--tp-on-primary);font-weight:650;display:inline-flex;align-items:center;justify-content:center;gap:8px;line-height:1.25;transition:none;transform:none}#app-shell button:disabled{opacity:.5;cursor:not-allowed}#app-shell button:active{transform:none}#app-shell button.secondary{background:var(--tp-soft);color:var(--tp-text)}#app-shell button.accent{background:var(--tp-accent);color:var(--tp-accent-text)}#app-shell button.icon-button{width:48px;padding:12px;flex:none}#app-shell :focus-visible{outline:3px solid var(--tp-info);outline-offset:3px}#app-shell input:not([type=checkbox]),#app-shell select{min-height:50px;padding:12px;border:1px solid var(--tp-line);border-radius:14px;color:var(--tp-text);background:var(--tp-surface);max-width:100%}#app-shell input[type=checkbox]{width:22px;height:22px;accent-color:var(--tp-primary);vertical-align:middle;margin-right:8px}#app-shell a{color:var(--tp-info);text-underline-offset:3px}#app-shell p{color:var(--tp-muted);font-size:15px;line-height:1.55}#app-shell .note{font-size:13px}#app-shell h1,#app-shell h2,#app-shell h3{letter-spacing:-.035em;color:var(--tp-text)}#app-shell h1{font-size:32px;line-height:1.12;margin:8px 0 12px}#app-shell h2{font-size:24px;line-height:1.2;margin:0 0 12px}#app-shell h3{font-size:19px;margin:20px 0 12px}#app-shell .eyebrow{font-size:12px;letter-spacing:.08em;color:var(--tp-muted);font-weight:650}#app-shell .app-header{padding:calc(18px + env(safe-area-inset-top)) 20px 14px;min-height:92px;background:var(--tp-surface);color:var(--tp-text);gap:12px}#app-shell .app-header strong{font-size:28px;letter-spacing:-.04em;font-weight:780}#app-shell .app-header small{font-size:15px;color:var(--tp-muted);margin-top:4px;letter-spacing:0}#app-shell .pill{background:var(--tp-soft);color:var(--tp-text);font-size:11px;letter-spacing:.07em;font-weight:750;padding:7px 10px}#app-shell main{max-width:none;padding:0;margin:0}#app-shell .panel{border-radius:0;box-shadow:none;padding:24px 20px;margin:0;background:var(--tp-surface)}#app-shell .panel:not(.active){display:none!important}#app-shell #map{padding:0}#app-shell .page-lead{margin-top:0}.section-card{padding:20px;border:1px solid var(--tp-line);border-radius:var(--tp-radius);margin:20px 0;background:var(--tp-surface)}.section-card>:first-child{margin-top:0!important}.section-card>:last-child{margin-bottom:0}.empty-state{padding:32px 20px;text-align:center;background:var(--tp-soft);border-radius:var(--tp-radius);margin:20px 0}.empty-state>.tp-icon{width:38px;height:38px;color:var(--tp-info);margin-bottom:16px}.empty-state strong{font-size:19px;display:block}.empty-state p{margin-bottom:0}.badge{display:inline-flex;align-items:center;gap:6px;padding:6px 10px;border-radius:99px;font-size:12px;font-weight:650;background:var(--tp-soft);color:var(--tp-muted)}.badge .tp-icon{height:16px;width:16px}.badge.warning{border:0;margin:0;background:var(--tp-warning-bg);color:var(--tp-warning);font-size:12px;padding:6px 10px}.badge.danger{background:var(--tp-danger-bg);color:var(--tp-danger)}.badge.info{background:var(--tp-info-bg);color:var(--tp-info)}.badge.success{background:var(--tp-success-bg);color:var(--tp-success)}.tp-alert{padding:18px;border-radius:20px;background:var(--tp-info-bg);color:var(--tp-info);display:flex;gap:12px;margin:16px 0}.tp-alert p{color:inherit!important;font-size:14px!important;margin:4px 0 0}.tp-alert strong{display:block}.tp-alert.warning{border:0;background:var(--tp-warning-bg);color:var(--tp-warning)}.tp-alert.danger{border:0;background:var(--tp-danger-bg);color:var(--tp-danger)}
/* Five primary destinations, separate from the report action. */
#app-shell .tabs{position:fixed;bottom:0;left:50%;transform:translateX(-50%);width:min(100%,760px);margin:0;padding:8px 8px calc(8px + env(safe-area-inset-bottom));gap:0;z-index:1005;border-top:1px solid var(--tp-line);background:var(--tp-surface)}#app-shell .tabs button{background:transparent;color:var(--tp-muted);border-radius:12px;min-width:0;flex:1;padding:7px 3px;min-height:65px;display:flex;flex-direction:column;gap:5px;font-size:11px;font-weight:550;text-align:center;line-height:1.18}#app-shell .tabs button span{max-width:96px;min-height:26px;display:flex;align-items:center;justify-content:center}#app-shell .tabs button.active{color:var(--tp-text);background:var(--tp-soft);font-weight:750}#app-shell .tabs button.active:after{content:"";height:3px;width:25px;background:var(--tp-text);border-radius:2px;position:absolute;bottom:5px}
/* Map first: reference header, full map, white sheet and amber report button. */
.map-stage{position:relative;height:max(360px,calc(100dvh - 174px - env(safe-area-inset-bottom) - env(safe-area-inset-top)));background:var(--tp-soft);overflow:hidden}#app-shell #realmap{position:absolute;inset:0;height:100%;width:100%;border-radius:0;margin:0;z-index:0}.map-search{position:absolute!important;top:16px;left:16px;right:78px;z-index:400;justify-content:flex-start!important;background:var(--tp-surface)!important;color:var(--tp-muted)!important;box-shadow:var(--tp-shadow);font-weight:500!important}.map-controls{position:absolute;right:16px;top:16px;z-index:410;display:flex;flex-direction:column;gap:10px}.map-controls button{background:var(--tp-surface)!important;color:var(--tp-text)!important;box-shadow:var(--tp-shadow);border:1px solid var(--tp-line)}#app-shell .gps-status{position:absolute;top:78px;left:16px;right:78px;z-index:400;border-radius:12px;padding:8px 12px;background:var(--tp-surface);box-shadow:var(--tp-shadow);font-size:12px;color:var(--tp-muted)}.gps-status #gps{font-weight:700;color:var(--tp-text);font-size:12px;margin-right:6px}.gps-status #coords{display:block;font-size:11px;color:var(--tp-muted);line-height:1.4}.map-sheet{position:absolute;bottom:0;left:0;right:0;background:var(--tp-surface);border-radius:26px 26px 0 0;padding:12px 20px 18px;z-index:450;box-shadow:0 -5px 28px #10213b1a}.sheet-handle{height:5px;width:44px;border-radius:8px;background:var(--tp-line);margin:0 auto 16px}.map-sheet-content{display:flex;align-items:center;gap:12px}.map-sheet-content .sheet-text{flex:1;min-width:0}.map-sheet-content h2{font-size:19px!important;margin:7px 0!important;letter-spacing:-.025em!important}.map-sheet-content p{font-size:13px!important;margin:0}.map-sheet-content>.tp-icon{width:32px;height:32px;color:var(--tp-warning)}#app-shell .report-fab{min-height:48px;padding:12px 16px;flex:none}.map-sheet .note{margin:12px 0 0;font-size:11px!important}#app-shell #warning{position:absolute;left:16px;right:78px;bottom:205px;z-index:460;background:var(--tp-warning-bg);color:var(--tp-warning);padding:16px;border:1px solid var(--tp-warning);border-radius:20px;font-size:15px;box-shadow:var(--tp-shadow)}.leaflet-control-zoom{margin-top:135px!important}.leaflet-control-attribution{font-size:10px!important;max-width:75%;margin-bottom:188px!important}.leaflet-popup-content-wrapper,.leaflet-popup-tip{background:var(--tp-surface)!important;color:var(--tp-text)!important}.tp-map-marker{background:var(--tp-accent);border:2px solid #fff;border-radius:13px;box-shadow:0 2px 8px #10213b55;color:#16212f;display:flex;align-items:center;justify-content:center}.tp-map-marker .tp-icon{width:23px;height:23px}.tp-map-marker.danger{background:#bf2840;color:#fff}.tp-map-marker.info{background:#175d9b;color:#fff}.tp-map-marker.success{background:#19734b;color:#fff}.tp-map-marker .marker-count{font-size:14px;font-weight:800}.tp-position-marker{display:flex;align-items:center;justify-content:center;background:white;color:#1672f5;border-radius:50%;box-shadow:0 3px 14px #10213b44;border:2px solid #fff}.tp-position-marker .tp-icon{fill:#1672f5;stroke:#1672f5;width:25px;height:25px}
/* Report screen mirrors the approved two-column category grid. */
#app-shell #report h1{font-size:34px;margin-top:22px}#app-shell .choices{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:24px 0}#app-shell .choices button{min-height:112px;background:var(--tp-surface);color:var(--tp-text);border:1px solid var(--tp-line);border-radius:19px;display:flex;flex-direction:column;gap:12px;padding:16px 8px}#app-shell .choices .tp-icon{width:36px;height:36px;stroke-width:1.7}#app-shell .choices span{font-size:15px;margin:0}.position-row{background:var(--tp-soft);border-radius:15px;padding:15px;display:flex;gap:10px;align-items:center;color:var(--tp-text);font-size:14px}.page-back{background:transparent!important;color:var(--tp-text)!important;border:0!important;padding-left:0!important}.page-back .tp-icon{width:25px}.profile-form label{font-size:14px;font-weight:600}.profile-form label:has(input[type=checkbox]){display:flex;align-items:center;min-height:48px}#app-shell .profile-form input:not([type=checkbox]),#app-shell .profile-form select,#app-shell .destination-card input,#app-shell .destination-card select,#app-shell #travel .search-row input,#app-shell #energy-product{background:var(--tp-surface);color:var(--tp-text);border-color:var(--tp-line)}#app-shell .destination-card{margin:0}.destination-card summary{font-size:15px!important}.search-row{align-items:stretch}.search-row button{flex:none}#app-shell .favorite-shortcuts{gap:8px;min-height:16px;padding:12px 0}#app-shell .favorite-shortcuts button,#app-shell .search-results button{background:var(--tp-soft);color:var(--tp-text)}#app-shell .selected-place{background:var(--tp-soft);color:var(--tp-text)}#app-shell .banner{background:var(--tp-warning-bg);color:var(--tp-warning);font-size:13px;border-radius:14px;padding:14px;line-height:1.5}.quick-links{display:flex;gap:8px;flex-wrap:wrap;margin:20px 0}.quick-links button{font-size:13px!important;background:var(--tp-soft)!important;color:var(--tp-text)!important}.route-start{display:flex;gap:12px;padding:16px;border-radius:16px;background:var(--tp-soft);margin-bottom:16px}.route-start small{display:block;color:var(--tp-muted);font-size:12px}.route-start strong{font-size:15px}.cost-total{font-size:30px!important;font-weight:750;color:var(--tp-text)!important;letter-spacing:-.04em}.metric-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}.metric-grid>div{padding:16px;background:var(--tp-soft);border-radius:17px}.metric-grid strong{display:block;font-size:25px;font-variant-numeric:tabular-nums;margin:7px 0}.metric-grid small{color:var(--tp-muted);font-size:12px}.departure-time{font-size:38px!important;letter-spacing:-.04em;font-weight:750;color:var(--tp-text)!important;margin:12px 0!important}.energy-card{background:var(--tp-surface);border:1px solid var(--tp-line);border-radius:22px;padding:20px;margin:16px 0}.energy-card h3{margin:0!important}.energy-card .energy-amount{color:var(--tp-text)!important;font-size:32px!important;font-variant-numeric:tabular-nums}.energy-card p{margin:9px 0}#app-shell .event{border-color:var(--tp-line);padding:18px 0}#app-shell .event button{background:var(--tp-soft);color:var(--tp-text);font-size:13px;padding:10px;min-height:44px}.setting-row{padding:16px 0;border-bottom:1px solid var(--tp-line);display:flex;align-items:center;justify-content:space-between;gap:12px}.setting-row label{font-weight:650;font-size:15px}.setting-row small{display:block;font-weight:400;color:var(--tp-muted);font-size:12px;margin-top:5px}.setting-row select{max-width:140px!important}.data-quality{border-left:3px solid var(--tp-info);padding:0 0 0 16px;margin:20px 0}.data-quality p{font-size:14px!important}.tp-modal{width:min(460px,calc(100% - 24px));max-height:85dvh;overflow:auto;background:var(--tp-surface);color:var(--tp-text);border:1px solid var(--tp-line);border-radius:26px;padding:22px;box-shadow:var(--tp-shadow)}.tp-modal::backdrop{background:#0713218c}.tp-modal h2{margin-top:0}.tp-modal .map-layer-controls{background:var(--tp-surface);padding:0}.tp-modal .map-layer-controls label{min-height:44px;display:flex;align-items:center;padding:8px 0;color:var(--tp-text)}.tp-modal .map-layer-controls select{width:100%;margin:12px 0}.dialog-close{float:right;margin:-7px -7px 8px 8px}#app-shell .map-layer-controls{background:var(--tp-soft)}.design-palette{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:16px 0}.design-palette>div{padding:16px;border-radius:16px;min-height:72px;font-weight:650}.design-palette .danger{background:var(--tp-danger-bg);color:var(--tp-danger)}.design-palette .warning{background:var(--tp-warning-bg);color:var(--tp-warning);border:0;margin:0}.design-palette .info{background:var(--tp-info-bg);color:var(--tp-info)}.design-palette .success{background:var(--tp-success-bg);color:var(--tp-success)}
/* Driving layout is a foreground visual test, not active navigation. */
.drive-hud{display:none;position:absolute;top:16px;left:16px;right:78px;z-index:430;padding:14px 16px;background:var(--tp-surface);border-radius:20px;box-shadow:var(--tp-shadow)}.speed-row{display:flex;align-items:center;justify-content:space-between;gap:12px}.speed-value{font-size:48px;line-height:1;font-weight:800;font-variant-numeric:tabular-nums;letter-spacing:-.06em}.speed-unit{font-size:13px;color:var(--tp-muted);display:block;margin-top:5px}.speed-limit{width:68px;height:68px;border:5px solid var(--tp-line);border-radius:50%;display:flex;align-items:center;justify-content:center;font-size:30px;font-weight:750;color:var(--tp-muted);background:var(--tp-surface)}.drive-hud p{font-size:12px!important;margin:10px 0 0!important}.drive-mode #app-shell{padding-bottom:0}.drive-mode .app-header,.drive-mode .tabs{display:none!important}.drive-mode .map-stage{height:100dvh}.drive-mode .map-search,.drive-mode .gps-status{display:none!important}.drive-mode .drive-hud{display:block}.drive-mode .map-controls{top:16px}.drive-mode .leaflet-control-zoom{display:none}.drive-mode .map-sheet{padding-bottom:calc(20px + env(safe-area-inset-bottom))}.drive-mode .map-sheet h2{font-size:23px!important}.drive-mode .leaflet-control-attribution{margin-bottom:205px!important}.drive-mode #report.active{min-height:100dvh}.drive-mode #report .page-back{margin-top:env(safe-area-inset-top)}
@media(min-width:761px){#app-shell{box-shadow:0 0 70px #10243a18}.app-header{border-left:1px solid var(--tp-line);border-right:1px solid var(--tp-line)}}@media(max-width:350px){#app-shell .app-header{padding-left:16px;padding-right:16px}#app-shell .app-header strong{font-size:25px}#app-shell .tabs button{font-size:10px}.map-sheet{padding-left:16px;padding-right:16px}.map-sheet-content{gap:9px}.map-sheet-content h2{font-size:17px!important}#app-shell .report-fab{padding:12px;font-size:14px}.map-sheet-content>.tp-icon{display:none}.metric-grid{grid-template-columns:1fr}.search-row{flex-wrap:wrap}.search-row input{flex-basis:65%}}
@media(prefers-reduced-motion:reduce){#app-shell *,#app-shell *:before,#app-shell *:after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}
/* QA only: same application in a fixed phone-sized review frame. */
body.design-review #app-shell{width:var(--review-width,390px);height:var(--review-height,844px);min-height:var(--review-height,844px);overflow:auto;position:relative;padding-bottom:84px}body.design-review .tabs{position:sticky;left:auto;bottom:0;transform:none;width:100%;margin-top:auto}body.design-review .map-stage{height:calc(var(--review-height,844px) - 176px)}body.design-review.drive-mode #app-shell{padding:0}body.design-review.drive-mode .map-stage{height:var(--review-height,844px)}
:root[data-theme=light]{color-scheme:light}:root[data-theme=dark]{color-scheme:dark}
body.design-review #app-shell{scrollbar-width:none}body.design-review #app-shell::-webkit-scrollbar{display:none}body.design-review #app-shell .tabs{position:fixed;left:50%;transform:translateX(-50%);width:var(--review-width,390px);bottom:max(0px,calc(100dvh - var(--review-height,844px)));margin:0}

:root[data-theme=dark] #realmap .leaflet-tile-pane{filter:brightness(.72) saturate(.7)}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]) #realmap .leaflet-tile-pane{filter:brightness(.72) saturate(.7)}}
#app-shell #start.gps-active{background:var(--tp-info-bg)!important;color:var(--tp-info)!important}

@media(max-height:650px){.map-controls{flex-direction:row;top:136px}.map-search{right:16px}.gps-status{right:16px!important}.drive-mode .map-controls{flex-direction:column;top:16px}.drive-mode .gps-status{display:none}}
.review-short:not(.drive-mode) .map-controls{flex-direction:row;top:136px}.review-short:not(.drive-mode) .map-search{right:16px}.review-short:not(.drive-mode) .gps-status{right:16px!important}
body.review-narrow #app-shell .app-header strong{font-size:25px}body.review-narrow #app-shell .tabs button{font-size:10px}body.review-narrow .map-sheet-content>.tp-icon{display:none}body.review-narrow .map-sheet-content h2{font-size:17px!important}

.report-mode #app-shell .app-header,.report-mode #app-shell .tabs{display:none!important}.report-mode #app-shell{padding-bottom:0}#app-shell #report .choices button:last-child{grid-column:1/-1;min-height:64px;flex-direction:row}#app-shell #report{padding-top:calc(16px + env(safe-area-inset-top))}
#app-shell .destination-card small,#app-shell .event small{color:var(--tp-muted)}#app-shell th{background:var(--tp-soft);color:var(--tp-text)}#app-shell td,#app-shell th{border-color:var(--tp-line)}#app-shell label.secondary{display:inline-flex;align-items:center;padding:12px;min-height:48px;border-radius:16px;background:var(--tp-soft);color:var(--tp-text);font-size:14px;cursor:pointer}

#app-shell .gps-status #gps{color:var(--tp-text)}#app-shell .gps-status #coords{color:var(--tp-muted)}

#app-shell .cost-total{font-size:26px;font-weight:750;color:var(--tp-text);padding-top:16px;border-top:1px solid var(--tp-line)}
