:root {
  --bg: #f3f4f1; --card: #fff; --text: #17242b; --muted: #596a72; --line: #dfe3e0; --line-strong: #c9cfcc; --accent: #1f4e5f; --spark: #f08a6c;
  --open-fg: #3d7552; --open-bg: #e2eee6;
  --convoy-fg: #8a5a12; --convoy-bg: #f7ead0; --dot-moderate: #dba21a;
  --closed-fg: #a2402f; --closed-bg: #f6e0db;
  --winter-fg: #425b78; --winter-bg: #e4eaf2;
  --unknown-fg: #4a5560; --unknown-bg: #eceef0;
  --temp-warm: #b3001b; --cold: #1d5fb4;
  --radius: 8px; --bar-h: 56px;
  --sky: #d9ebf5; /* toppen av banneret og stripen bak statuslinjen */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #10233a; --card: #0a1829; --text: #eef3f8; --muted: #9fb1c4; --line: #1c3048; --line-strong: #2c4662; --accent: #7cc6e0;
    --open-fg: #80d6a2; --open-bg: #113428;
    --convoy-fg: #f8c66c; --convoy-bg: #3a2d12; --dot-moderate: #f8c66c;
    --closed-fg: #ff9f8f; --closed-bg: #43191d;
    --winter-fg: #acc9f0; --winter-bg: #17304f;
    --unknown-fg: #b8c3d0; --unknown-bg: #1d2b3d;
    --temp-warm: #ff9a8e; --cold: #8ec6f2;
    --sky: #255688;
  }
}
* { box-sizing: border-box; }
/* touch-action: manipulation = knipezoom virker (tilgjengelighet, WCAG 1.4.4), men ikke utilsiktet dobbelttrykk-zoom. */
/* Tekststørrelse følger telefonen: alle skriftstørrelser er rem med 17 px som utgangspunkt (iPhones standard for brødtekst).
   iPhone: Dynamic Type via -apple-system-body. Ellers: 106,25 % av nettleserens egen størrelse (17 px ved standard 16 px). */
html { -webkit-text-size-adjust: 100%; touch-action: manipulation; font-size: 106.25%; }
@supports (font: -apple-system-body) { html { font: -apple-system-body; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 0.9412rem/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  padding-bottom: calc(var(--bar-h) + env(safe-area-inset-bottom));
}
/* Knapper og navigasjon skal ikke kunne markeres (langt trykk gir ellers blå markering og iOS-meny). Innholdet i detaljene kan fortsatt kopieres. */
.top, .row, .day, .pill, .tabbtn, .bar, .star { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.wrap { max-width: 640px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left)); padding-right: max(16px, env(safe-area-inset-right)); }
.top { background: linear-gradient(180deg, var(--sky), var(--bg)); color: var(--accent); padding-top: max(12px, calc(env(safe-area-inset-top) + 26px)); padding-bottom: 12px; }
@media (prefers-color-scheme: dark) { .top { color: #e8eef0; } }
/* Fast stripe i bannerfargen bak statuslinjen: iOS tonet ellers blur-effekten med sidens lyse bakgrunn. */
html { background: var(--bg); }
body { min-height: 100vh; min-height: 100dvh; }
body::before { content: ""; position: fixed; z-index: 30; top: 0; left: 0; right: 0; height: env(safe-area-inset-top); background: var(--sky); }
@media (prefers-color-scheme: dark) { html { background: var(--sky); } }
.brand { display: flex; align-items: center; gap: 12px; }
.top { position: relative; overflow: hidden; }
.top .wrap { position: relative; }
.art { position: absolute; right: max(0px, calc((100% - 640px) / 2)); top: 0; width: min(70%, 320px); height: 100%; pointer-events: none; opacity: .55; -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%); mask-image: linear-gradient(90deg, transparent, #000 45%); }
@media (min-width: 680px) { .art { -webkit-mask-image: linear-gradient(90deg, transparent, #000 35%, #000 70%, transparent); mask-image: linear-gradient(90deg, transparent, #000 35%, #000 70%, transparent); } }
h1 { margin: 0; font-size: 1.3529rem; line-height: 1.1; letter-spacing: -.02em; font-weight: 300; }
h1 span { font-weight: 600; }
.fresh { margin: 3px 0 0; font-size: 0.7353rem; font-weight: 400; color: var(--muted); }
.fresh::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--accent); vertical-align: 1px; }
@media (prefers-color-scheme: dark) { .art { opacity: .32; filter: hue-rotate(8deg); } .fresh { color: inherit; } .fresh::before { background: var(--accent); } }

.banner { margin: 14px 0 0; padding: 12px 14px; border-radius: 8px; background: var(--convoy-bg); color: var(--convoy-fg); font-weight: 600; }
.banner[data-kind="error"] { background: var(--closed-bg); color: var(--closed-fg); }

.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

.days { display: flex; margin: 8px 0 14px; border-bottom: 1px solid var(--line-strong); }
/* Fast høyde før app.js har lagt inn fanene og filtrene, så lista ikke hopper ned. --chips-h er plassen over lista sist (outline.js), ellers filterraden. */
.days:empty { box-sizing: border-box; min-height: 48px; }
.chiprow:empty { box-sizing: border-box; height: var(--chips-h, 40px); }
.day { flex: 1; position: relative; min-height: 48px; background: none; color: var(--muted); border: 0; border-bottom: 3px solid transparent; margin-bottom: -1px; font-family: inherit; font-size: 0.8824rem; font-weight: 500; cursor: pointer; }
.day + .day::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 1px; background: var(--line-strong); }
.day[aria-pressed="true"] { color: var(--text); border-bottom-color: var(--accent); font-weight: 600; }
.day:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

.chiprow { display: flex; gap: 8px; margin: 0 -16px 14px; padding: 2px 16px; overflow-x: auto; scrollbar-width: none; -webkit-mask-image: linear-gradient(90deg, #000 90%, transparent); mask-image: linear-gradient(90deg, #000 90%, transparent); }
.chiprow::-webkit-scrollbar { display: none; }
.chiprow[hidden] { display: none; }
.chiprow .pill { flex: none; }

.pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 8px; border-radius: 6px;
  font-weight: 600; font-size: 0.7941rem; white-space: nowrap;
}
.pill svg { width: 20px; height: 20px; flex: none; }
[data-status="open"] .pill, .pill[data-status="open"] { background: var(--open-bg); color: var(--open-fg); }
[data-status="convoy"] .pill, .pill[data-status="convoy"] { background: var(--convoy-bg); color: var(--convoy-fg); }
[data-status="closed"] .pill, .pill[data-status="closed"] { background: var(--closed-bg); color: var(--closed-fg); }
[data-status="winter_closed"] .pill, .pill[data-status="winter_closed"] { background: var(--winter-bg); color: var(--winter-fg); }
[data-status="unknown"] .pill, .pill[data-status="unknown"] { background: var(--unknown-bg); color: var(--unknown-fg); }

.pill-filter { border: 2px solid transparent; font-family: inherit; cursor: pointer; min-height: 36px; }
.pill-filter[aria-pressed="true"] { border-color: currentColor; }
.pill-filter:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.pill-all { background: var(--card); color: var(--text); border: 2px solid var(--line-strong); font-family: inherit; cursor: pointer; min-height: 36px; padding-left: 12px; }
.pill-all[aria-pressed="true"] { border-color: var(--text); }
.pill-all:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

[data-status="partial"] .pill, .pill[data-status="partial"] { background: var(--convoy-bg); color: var(--convoy-fg); }
.riskline { display: block; margin-top: 4px; font-size: 0.7647rem; color: var(--muted); }
/* Rett under pillen (uten undertekst imellom) trenger risikolinjen like mye luft over seg som under. */
.statusline + .riskline { margin-top: 9px; }

.list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.list[hidden] { display: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }

.row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; width: 100%;
  min-height: 72px; padding: 12px 8px 12px 14px; background: none; border: 0; color: inherit; font: inherit; text-align: left; cursor: pointer;
}
.row:focus-visible, .star:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.main { display: block; min-width: 0; }
/* Veinummeret er en liten innrammet tagg foran navnet (ingen egen kolonne), og været står på statuslinjen. */
.tag { display: inline-block; margin-right: 8px; padding: 0 6px; vertical-align: 1px; border: 1.5px solid var(--text); border-radius: 5px; font-size: 0.7059rem; font-weight: 600; line-height: 1.5; }
/* Værkolonne som flyter til høyre: ikon og temperatur på pillens linje, vinden under; teksten flyter rundt. */
.wxcol { float: right; display: flex; flex-direction: column; align-items: flex-end; margin: 4px 0 0 10px; }
/* Min tur i Mine: været ved målet, med «ved ankomst» under så det ikke leses som været nå. */
.wxnote { font-size: 0.62rem; color: var(--muted); white-space: nowrap; }
/* Været ved ankomst i Min tur står som på overgangskortene, og et trykk åpner yr. */
.wxlink { float: right; margin: 0 0 4px 10px; color: inherit; text-decoration: none; }
.wxlink .wxcol { float: none; margin: 0; }
/* Min tur: været ved målet når du kommer fram, i prognoselinjens stil med værikonet i stedet for prikk. */
.riskline.arrive { display: flex; align-items: center; gap: 6px; }
.arrive img { width: 22px; height: 22px; flex: none; margin: -3px 0; }
.arrive b { font-weight: 600; }
.arrive b.cold { color: var(--cold); }
.arrive b.warm { color: var(--temp-warm); }
.arrive a { color: inherit; }
.arrive + .riskline { margin-top: 4px; }
.arrive .wind { margin: 0; font-size: inherit; vertical-align: middle; }
.arrive .wind svg { width: 13px; height: 13px; }
.wx { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; font-size: 0.8824rem; font-weight: 600; }
.wx img { display: block; width: 32px; height: 32px; }
.temp.warm { color: var(--temp-warm); }
.temp.cold { color: var(--cold); }
.wind { display: inline-flex; align-items: center; gap: 3px; margin-top: -2px; white-space: nowrap; font-size: 0.8235rem; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.wind b { color: var(--text); font-weight: 600; }
.wind svg { width: 16px; height: 16px; flex: none; margin-left: 2px; fill: none; stroke: var(--text); stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.nextline { display: block; margin-top: 6px; }
.name { display: block; font-weight: 600; font-size: 1rem; line-height: 1.2; }
.statusline { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 6px; }
.sub { font-size: 0.8235rem; color: var(--muted); }
.detail .sub { margin: 0; }
.chev { width: 22px; height: 22px; color: var(--muted); transition: transform .15s; }
.row[aria-expanded="true"] .chev { transform: rotate(180deg); }

.detail { padding: 4px 16px 16px 16px; border-top: 1px solid var(--line); }
.detail h3 { margin: 14px 0 5px; font-size: 0.7647rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.detail p { margin: 0 0 6px; }
.facts { display: grid; gap: 6px; margin: 12px 0 0; padding: 0; list-style: none; }
.facts li { display: flex; justify-content: space-between; gap: 12px; }
.facts span:first-child { color: var(--muted); }
.passlink { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; color: var(--accent); font-weight: 600; text-decoration: none; }
.passlink svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.passlink:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.times { display: flex; flex-wrap: wrap; gap: 2px 14px; margin: 0 0 6px; padding: 9px 12px 10px; border-radius: 6px; background: var(--bg); font-weight: 600; }
.times .t { white-space: nowrap; }
/* Detaljene (26. nov 2026): hver seksjon er overskrift og én boks («I dag»/«Neste endring», «Føre og vær»), handlingene samlet nederst. */
/* Overskriften hører til boksen under: tett ned til den, mer luft opp til boksen over. */
.detail .dbox + h3 { margin-top: 24px; }
.dbox { margin: 0 0 4px; padding: 4px 14px; border: 1px solid var(--line); border-radius: var(--radius); }
.dbox > :first-child { margin-top: 8px; }
.dbox > .lead { margin: 8px 0 4px; font-weight: 600; font-size: 1.0588rem; }
.dbox > .note { margin: 0 0 8px; }
.dbox > .callout { margin: 8px 0; }
.dbox .facts { margin: 10px 0 6px; padding: 0; border: 0; border-radius: 0; background: none; }
/* Inni rammen er rammen eneste strek; radene skilles med luft. */
.dbox .facts li { border-bottom: 0; padding: 4px 0; }
.dbox .facts:first-child { border-top: 0; margin-top: 0; }
.dbox .times { margin: 8px 0 6px; padding: 0; background: none; gap: 6px 8px; }
.dbox .times .t { padding: 3px 10px; border: 1px solid transparent; border-radius: 999px; }
.dbox .times .t.past { color: var(--muted); font-weight: 500; }
.dbox .times .t.now { border-color: currentColor; }
/* Åpne tidsrom i grønt, som stengte står i rødt: kommende grønn tekst, det du er i med grønn ramme, passerte grå. */
.dbox .times[data-mode="open"] .t:not(.past) { color: var(--open-fg); }
.dbox .msgs { margin: 0 0 8px; }
.dbox .risk { margin: 4px 0 10px; }
/* Handlingene nederst skilles med luft, ikke streker; eneste strek i detaljene er den mot kortet over (27. nov 2026). */
.acts { display: flex; flex-direction: column; margin-top: 18px; }
.acts .alerts { margin: 0; padding: 4px 0; }
.times[data-state="closed_all_day"] { color: var(--closed-fg); }
.times[data-state="open_all_day"] { color: var(--open-fg); }
.times[data-mode="closed"]:not([data-state="open_all_day"]) { color: var(--closed-fg); }
.risk { list-style: none; margin: 0 0 6px; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(76px, 1fr)); gap: 6px; }
.risk li { display: grid; gap: 1px; justify-items: center; padding: 8px 4px; border-radius: 6px; text-align: center; }
.risk b { font-size: 1.0588rem; }
.risk small { font-size: 0.7059rem; }
.risk .other { font-weight: 600; }
.risk .hrs { opacity: .8; }
.risk li[data-level="low"] { background: var(--open-bg); color: var(--open-fg); }
.risk li[data-level="moderate"] { background: var(--convoy-bg); color: var(--convoy-fg); }
.risk li[data-level="high"] { background: var(--closed-bg); color: var(--closed-fg); }
/* Nøytral flate: meldingen er informasjon, ikke en status (gul er forbeholdt kolonne/delvis åpen). */
.callout { margin: 10px 0 0; padding: 12px 14px; border-radius: 8px; background: color-mix(in srgb, var(--text) 6%, transparent); color: var(--text); }
.callout small { display: block; margin-bottom: 2px; font-weight: 600; color: var(--muted); }
.warn { display: flex; align-items: flex-start; gap: 6px; margin-top: 6px; font-size: 0.7941rem; line-height: 1.3; color: var(--muted); }
.warn svg { width: 18px; height: 18px; flex: none; color: var(--convoy-fg); }
/* Føre (FJ-25): fast linje rett over prognosen, bare når Vegvesen har meldt glatt veg. */
.warn.fore { color: var(--text); }
.warn.fore + .riskline { margin-top: 4px; }
/* Ukeplanen på overgangssidene (27. nov 2026): stengte tider som røde brikker, dager uten stenging i grønt. */
.planweek { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.planweek li { display: flex; align-items: baseline; gap: 8px; }
.planweek .d { flex: none; width: 4.6em; color: var(--muted); }
.planweek .spans { display: flex; flex-wrap: wrap; gap: 6px; }
.planweek .t { padding: 1px 8px; border: 1px solid currentColor; border-radius: 999px; color: var(--closed-fg); font-weight: 600; white-space: nowrap; }
.planweek .allday { color: var(--open-fg); font-weight: 600; }
.cardnote { display: block; margin-top: 4px; font-size: 0.8235rem; color: var(--text); font-weight: 500; }
.note { font-size: 0.7941rem; color: var(--muted); }
.orig { margin-top: 14px; }
.orig summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; font-weight: 600; color: var(--accent); }
.msg { margin: 8px 0; padding: 12px; border-radius: 8px; background: var(--bg); font-size: 0.8529rem; white-space: pre-line; overflow-wrap: anywhere; }
.msg small { display: block; margin-bottom: 4px; color: var(--muted); font-weight: 600; }
.msgs { margin: -6px 0 14px; }
.facts .linkbtn.inl { text-align: right; }
.detail { position: relative; }
.star { position: absolute; top: 2px; right: 6px; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--muted); font: inherit; font-size: 0.8235rem; font-weight: 600; cursor: pointer; }
.star svg { width: 26px; height: 26px; fill: none; flex: none; }
.star span { display: none; }
.star.lbl { padding: 0 8px 0 10px; color: var(--text); }
.star.lbl span { display: inline; }
.star + * { padding-right: 44px; }
.star.lbl + * { padding-right: 110px; }
.star[aria-pressed="true"] svg { fill: currentColor; color: var(--convoy-fg); }
.empty svg { width: 16px; height: 16px; vertical-align: -3px; fill: none; }

.empty { padding: 28px 8px; text-align: center; color: var(--muted); }
.skeleton { height: 100px; border-radius: var(--radius); background: linear-gradient(90deg, var(--card), var(--line), var(--card)); background-size: 200% 100%; animation: sh 1.2s infinite linear; }
@keyframes sh { to { background-position: -200% 0; } }
/* Omrisset av et turkort mens turen hentes (mine-trips.js): samme glimt som listen over. */
.bone { display: block; height: 14px; width: 72%; margin-top: 10px; border-radius: 4px; background: linear-gradient(90deg, var(--card), var(--line), var(--card)); background-size: 200% 100%; animation: sh 1.2s infinite linear; }
.bone.pillbone { width: 84px; height: 28px; border-radius: 6px; }
.bone.short { width: 46%; }
.note-list { margin: 12px 2px 0; }
.foot { padding-top: 24px; padding-bottom: 32px; color: var(--muted); font-size: 0.7647rem; }
a.ext, .page p a { color: var(--accent); text-underline-offset: 2px; }
a.ext::after { content: " \2197"; display: inline-block; text-decoration: none; }
/* Kartlenker (Google Maps): kartnål foran i stedet for ↗ bak. */
a.ext.map::after { content: none; }
a.ext.map::before { content: ""; display: inline-block; width: 0.95em; height: 0.95em; margin-right: 0.2em; vertical-align: -0.12em; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M12 21.5s-7-6.3-7-11.8a7 7 0 0 1 14 0c0 5.5-7 11.8-7 11.8z'/%3E%3Ccircle cx='12' cy='9.7' r='2.4'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linejoin='round'%3E%3Cpath d='M12 21.5s-7-6.3-7-11.8a7 7 0 0 1 14 0c0 5.5-7 11.8-7 11.8z'/%3E%3Ccircle cx='12' cy='9.7' r='2.4'/%3E%3C/svg%3E") center / contain no-repeat; }
.foot a { color: inherit; text-underline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .skeleton, .bone { animation: none; } .chev { transition: none; } }

.bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; background: var(--card); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.bar-in { display: flex; max-width: 640px; margin: 0 auto; }
.tabbtn { flex: 1; min-height: var(--bar-h); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: none; border: 0; color: var(--muted); font: inherit; font-size: 0.7059rem; font-weight: 500; cursor: pointer; }
/* Valgt fane: svak flate i merkefargen bak ikonet, så formen og ikke bare fargen viser hvor du er (17. nov 2026). */
.tabbtn svg { box-sizing: content-box; width: 24px; height: 24px; padding: 3px 18px; border-radius: 999px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.tabbtn[aria-current="page"] { color: var(--text); font-weight: 700; }
.tabbtn[aria-current="page"] svg { color: var(--accent); background: color-mix(in srgb, var(--accent) 16%, transparent); stroke-width: 2.2; }
.tabbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
@media (orientation: landscape) and (max-height: 480px) { :root { --bar-h: 44px; } .tabbtn { flex-direction: row; gap: 8px; font-size: 0.7647rem; } .tabbtn svg { width: 20px; height: 20px; padding: 3px 10px; } }

/* Egen rekkefølge på favoritter */
.sorter { display: flex; justify-content: space-between; align-items: center; margin: 0 0 6px; color: var(--muted); font-size: 0.8235rem; }
.sorter[hidden] { display: none; }
.sorter button { min-height: 44px; padding: 0 4px; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.sortrow { display: flex; align-items: center; gap: 12px; min-height: 60px; padding: 6px 6px 6px 14px; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.sortrow .name { flex: 1; min-width: 0; }
.handle { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; background: none; color: var(--muted); cursor: grab; touch-action: none; }
.handle svg { width: 24px; height: 24px; }
.handle:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.sortrow.lift { position: relative; z-index: 2; border-color: var(--accent); box-shadow: 0 8px 18px rgba(0, 0, 0, .18); }

/* Språkark fra bunnmenyen */
.dim { position: fixed; inset: 0; z-index: 45; background: rgba(0, 0, 0, .35); }
.sheet { position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; max-width: 640px; margin: 0 auto; padding: 8px 0 calc(env(safe-area-inset-bottom) + 12px); border-radius: 14px 14px 0 0; background: var(--card); border: 1px solid var(--line); border-bottom: 0; box-shadow: 0 -10px 30px rgba(0, 0, 0, .2); }
.sheet h2 { margin: 6px 16px 4px; font-size: 0.7647rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.lrow { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 52px; padding: 0 16px; border: 0; background: none; color: var(--text); font: inherit; font-size: 0.9412rem; text-align: left; cursor: pointer; -webkit-user-select: none; user-select: none; }
.lrow .fl { font-size: 1.2941rem; line-height: 1; }
.lrow .ck { margin-left: auto; color: var(--accent); font-weight: 700; }
.lrow[aria-current="true"] { font-weight: 600; }
.lrow:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }

/* Lenkelisten på forsiden og egne sider per overgang (HTML fra API-et) */
.allpasses { margin: 6px 0 14px; }
.allpasses h3 { font-size: 0.8824rem; margin: 0 0 2px; color: var(--muted); font-weight: 600; }
.allpasses ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 14px; }
.allpasses a { display: inline-flex; align-items: center; gap: 5px; min-height: 36px; font-size: 0.88rem; color: var(--text); text-decoration: none; }
.allpasses a:hover { text-decoration: underline; }
.allpasses .rn { font-size: 0.72rem; color: var(--muted); }
/* Statusordet bak navnet (laget av serveren, så Google og AI leser det); dempet, stengt i rødt og kolonne i gult. */
.allpasses li { display: inline-flex; align-items: center; }
/* Omkjøringene på tunnelsiden: én per linje, med status. */
.allpasses.detour ul { flex-direction: column; }
.allpasses .tunnelline { margin: 6px 0 0; font-size: 0.82rem; color: var(--muted); }
.allpasses .tunnelline a { min-height: 0; }
.allpasses.detour a, .allpasses.detour .pst { font-size: 1rem; }
.allpasses .pst { font-size: 0.82rem; color: var(--muted); white-space: nowrap; }
.allpasses .pst[data-status="closed"], .allpasses .pst[data-status="winter_closed"] { color: var(--closed-fg); }
.allpasses .pst[data-status="convoy"], .allpasses .pst[data-status="partial"] { color: var(--convoy-fg); }
.allpasses summary { cursor: pointer; display: flex; align-items: center; min-height: 36px; font-size: 0.88rem; font-weight: 600; color: var(--accent); }
.row.static { cursor: default; }
.row.static .sub { display: block; }
.back { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; margin: 4px 0 0; color: var(--accent); font-weight: 600; text-decoration: none; }
.back:hover { text-decoration: underline; }
.page .lead { margin: -6px 0 12px; color: var(--text); line-height: 1.45; }
.page h2 { font-size: 1.35rem; line-height: 1.25; margin: 6px 0 14px; color: var(--text); }
.prose { margin: 22px 0 0; }
.prose h3 { font-size: 1rem; margin: 0 0 6px; color: var(--text); }
.prose p { margin: 0 0 12px; color: var(--muted); line-height: 1.5; }
/* Spørsmål og svar på overgangssidene: sammenfoldet, trykk på spørsmålet for svaret. */
.qa { border-top: 1px solid var(--line); }
.qa:last-child { border-bottom: 1px solid var(--line); }
.qa summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; cursor: pointer; list-style: none; }
.qa summary::-webkit-details-marker { display: none; }
.qa summary h3 { margin: 0; padding: 10px 0; font-size: 0.94rem; font-weight: 600; }
.qa summary::after { content: ""; flex: none; width: 8px; height: 8px; margin-right: 4px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: translateY(-2px) rotate(45deg); transition: transform .15s; }
.qa[open] summary::after { transform: translateY(2px) rotate(-135deg); }
.qa p { margin-top: -2px; }
@media (prefers-reduced-motion: reduce) { .qa summary::after { transition: none; } }
/* Guide på overgangssidene (pass-guides.ts): bilde, faktaliste og stopp. Bildet har fast forhold, så det ikke dytter teksten (CLS). */
.pimg { margin: 4px 0 12px; }
.pimg img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius); background: var(--line); }
.pimg figcaption { margin-top: 4px; font-size: 0.75rem; color: var(--muted); }
.pimg figcaption a { color: inherit; }
/* Webkamera langs vegen (FJ-12): rad man sveiper i, og forstørret visning (passpage.js). */
.cams { margin: 14px 0 4px; }
.cams h3 { margin: 0 0 2px; font-size: 1rem; }
.camnote { margin: 0 0 8px; font-size: 0.7647rem; color: var(--muted); }
.camrow { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0; padding: 0 0 8px; list-style: none; }
.camrow li { flex: 0 0 78%; max-width: 340px; scroll-snap-align: start; }
.camrow a { display: block; }
.camrow img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); background: var(--line); }
.camcap { display: block; margin-top: 4px; font-size: 0.7647rem; color: var(--muted); }
.camcap b { color: var(--text); font-weight: 600; }
.camview { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: rgba(5, 12, 20, 0.94); color: #fff; }
.camview::backdrop { background: rgba(5, 12, 20, 0.94); }
.camview .track { display: flex; height: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.camview .track::-webkit-scrollbar { display: none; }
.camview figure { flex: 0 0 100%; margin: 0; display: flex; flex-direction: column; justify-content: center; scroll-snap-align: center; }
.camview img { width: 100%; max-height: 78dvh; object-fit: contain; }
.camview figcaption { padding: 10px 16px; font-size: 0.9rem; }
.camview figcaption b { color: #fff; }
.camview button { position: absolute; width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.15); color: #fff; font: inherit; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.camview .x { top: max(10px, env(safe-area-inset-top)); right: 10px; }
.camview .prev, .camview .next { top: 50%; transform: translateY(-50%); }
.camview .prev { left: 10px; }
.camview .next { right: 10px; }
.camview .count { position: absolute; top: max(20px, env(safe-area-inset-top)); left: 16px; font-size: 0.85rem; opacity: 0.8; }
@media (hover: none) { .camview .prev, .camview .next { display: none; } }
.facts { list-style: none; margin: 0 0 14px; padding: 6px 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); font-size: 0.88rem; line-height: 1.35; }
.facts li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.facts li:last-child { border-bottom: 0; }
.facts b { flex: none; color: var(--muted); font-weight: 400; }
.facts li span { text-align: right; color: var(--text); font-weight: 500; }
.stops { margin: 0 0 12px; padding-left: 20px; color: var(--muted); line-height: 1.5; }
.stops li { margin-bottom: 8px; }
.others { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.others a { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 2px solid var(--line-strong); border-radius: 999px; color: var(--text); background: var(--card); text-decoration: none; }

/* ---------- Min tur (testfase): turkort i Mine, åpen tur, skjema og stedssøk ---------- */
.fld { display: block; position: relative; margin: 0 0 10px; }
.fld > span { display: block; margin-bottom: 4px; font-size: 0.8235rem; color: var(--muted); }
.fld input { width: 100%; box-sizing: border-box; min-height: 48px; padding: 0 12px; font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.fld select { width: 100%; box-sizing: border-box; min-height: 48px; padding: 0 12px; font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line-strong); border-radius: var(--radius); }
.tilrow { position: relative; }
.iconbtn { flex: none; display: inline-flex; align-items: center; justify-content: center; position: absolute; right: -10px; top: -14px; width: 44px; height: 44px; padding: 0; background: none; border: 0; color: var(--accent); cursor: pointer; }
.iconbtn svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.when { margin: 0 0 14px; }
.whenlabel { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 0 0 4px; }
.whenlabel span { font-size: 0.8235rem; color: var(--muted); }
.whenlabel b { font-weight: 600; font-variant-numeric: tabular-nums; }
.whenrow { display: flex; align-items: center; gap: 10px; }
/* Avreisen i Min tur (27. nov 2026): grønne brikker for de beste tidsrommene (bare når dagen har forskjeller), én linje om resten,
   og grå brikker for dagsdelene til å flytte seg i tid. Valgt brikke er fylt. */
.departs { margin: 4px 0 10px; }
.departs p { margin: 0 0 8px; }
.departs .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.departs .bestrow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.departs .bestrow > b { color: var(--open-fg); }
.departs .bestrow .t { color: var(--open-fg); border-color: currentColor; }
.departs .others { color: var(--muted); font-size: 0.8235rem; line-height: 1.35; }
.departs .t { min-width: 5.6em; min-height: 36px; padding: 2px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: none; color: var(--text); font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
.departs .t.sel { background: color-mix(in srgb, currentColor 12%, transparent); border-color: currentColor; }
.departs .t:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.whenstep { justify-content: flex-end; }
.whenstep .whenat { flex: 1; font-weight: 600; font-variant-numeric: tabular-nums; }
.stepbtn { flex: none; min-width: 52px; min-height: 44px; padding: 0 8px; background: var(--card); color: var(--text); border: 1px solid var(--line-strong); border-radius: 6px; font: inherit; font-weight: 600; font-variant-numeric: tabular-nums; cursor: pointer; }
.stepbtn:disabled { color: var(--muted); border-color: var(--line); cursor: default; }
.stepbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.whenends { display: flex; justify-content: space-between; align-items: center; margin: 0; font-size: 0.7647rem; color: var(--muted); }
.fld input:focus-visible, .fld select:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
.sugg { list-style: none; margin: 4px 0 0; padding: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.sugg[hidden] { display: none; }
.sugg li + li { border-top: 1px solid var(--line); }
.sugg button { display: flex; flex-direction: column; align-items: flex-start; width: 100%; min-height: 48px; padding: 8px 12px; background: none; border: 0; font: inherit; color: var(--text); text-align: left; cursor: pointer; }
.sugg button[aria-selected="true"] { background: var(--bg); }
.sugg button:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
.linkbtn { min-height: 44px; padding: 0; background: none; border: 0; font: inherit; font-weight: 600; color: var(--accent); cursor: pointer; }
.linkbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.saved { display: flex; flex-wrap: wrap; column-gap: 18px; margin: 0 0 6px; }
.saved[hidden], .savebox[hidden] { display: none; }
.savebox { display: flex; flex-wrap: wrap; align-items: center; column-gap: 16px; margin: -4px 0 10px; }
.savebox .note { margin: 0; }
.savebox .fld { flex: 1 1 100%; margin: 4px 0 0; }
.trip { padding: 14px 16px; }
.answer { margin-bottom: 12px; }
.answer h3 { margin: 0 0 4px; }
.answer p { margin: 4px 0; }
.linkbtn.inl { min-height: 0; padding: 0; }
.tripview .when { margin: 0 0 12px; }
.tripview .days { margin-top: 0; }
.tripnote { margin-top: 12px; }
.addtrip { margin: 4px 0 14px; }
.chev.go { transform: rotate(-90deg); }
/* Én veg (trip-single.js): statuslinjen i svarkortet kan trykkes for meldingene og vegnumrene. */
.answer .msgrow { display: flex; align-items: center; gap: 8px; width: 100%; margin: 8px 0 2px; padding: 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.answer .msgrow .statusline { flex: 1; margin: 0; }
.answer .msgrow .chev { flex: none; }
.answer .msgrow[aria-expanded="true"] .chev { transform: rotate(180deg); }
.answer .msgdetail { margin: 6px 0 4px; padding: 6px 0 0; }
.answer .msgdetail .roads { margin: 0 0 6px; }
.triphead { display: flex; align-items: center; gap: 4px; margin: 0 0 4px; }
.triphead .back { margin: 0; flex: none; }
.triphead .sep { flex: none; width: 1px; height: 20px; background: var(--line-strong); margin: 0 6px; }
.triphead h2 { flex: 1; min-width: 0; margin: 0; font-size: 1.1765rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tripedit h2 { margin: 6px 0 12px; font-size: 1.1765rem; font-weight: 600; }
.editbtns { display: flex; gap: 20px; margin: 4px 0 14px; }
/* Snu-knappen rett bak strekningen («Gol → Lærdal ⇅»), ikke ute ved kanten der den ble stående i luften ved værkolonnen (27. nov 2026). */
.answer .dirrow { display: flex; align-items: center; justify-content: flex-start; gap: 4px; margin: 2px 0 0; }
.answer .dir { font-weight: 400; min-width: 0; } /* vanlig vekt: vegnavnet over er svaret, fra og til er sammenheng */
.iconbtn.indir { position: static; flex: none; width: 44px; height: 44px; margin: -10px -12px -10px 0; }
.answer .actions { display: flex; flex-wrap: wrap; align-items: center; column-gap: 22px; margin: 2px 0 -6px; }
.actions .linkbtn { display: inline-flex; align-items: center; gap: 6px; }
.actions a.linkbtn { text-decoration: none; }
.actions .linkbtn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Pille med hva og når bak (docs/design-principles.md, «Statuser, ikoner og plassering»): lang tekst brekker i egen kolonne ved pillen. */
/* Teksten flyter som en setning: første linje ved pillen, resten under (rundt værkolonnen), så den ikke presses inn i en smal kolonne. */
.statusline.besides { display: block; line-height: 1.5; }
.statusline.besides .pill { vertical-align: middle; margin-right: 8px; }
.statusline.besides > .sub { vertical-align: middle; }
.statusline .warnin svg, .nextline.warnin svg { display: inline-block; width: 17px; height: 17px; margin-right: 4px; vertical-align: -3px; color: var(--convoy-fg); }
.statusline .warnin > span { display: inline; }
/* Anslaget for åpning er passert: tiden i stengt-fargen (docs/design-principles.md, «Passert anslag»). */
.late { color: var(--closed-fg); }
.dotline { display: flex; align-items: center; gap: 7px; }
/* Lav er en tom ring, moderat og høy fylt: «følg med» synes uten å skille farger. Gul prikk er klarere enn pilleteksten, som må være mørk for å kunne leses. */
.dot { flex: none; width: 10px; height: 10px; border-radius: 50%; }
.dot[data-level="low"] { box-shadow: inset 0 0 0 1.5px var(--open-fg); }
.dot[data-level="moderate"] { background: var(--dot-moderate); }
.dot[data-level="high"] { background: var(--closed-fg); }
/* Min tur: fjellovergangen på raden, med samme status som kortet i Mine. */
/* Min tur: vegvalget samlet på en svak flate, anbefalt veg med kant i merkefargen, og stille strekning som én linje. */
.tripgroup { margin: 4px -8px; padding: 8px; border-radius: 14px; background: color-mix(in srgb, var(--accent) 7%, transparent); }
.tripgroup > h3 { margin: 4px 6px 8px; font-size: 1.0588rem; font-weight: 600; }
/* Turer i Mine: ruteikon der overgangene har vegnummer, «Tur: Ål → Bergen» i sorteringsraden, og introkortet før første tur. */
.tripicon { display: inline-grid; place-items: center; width: 22px; height: 22px; margin-right: 8px; color: var(--accent); vertical-align: -4px; }
.tripicon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sortrow .name .sub { display: block; margin-top: 2px; font-weight: 400; }
.intro { position: relative; padding: 14px 44px 8px 16px; margin: 0 0 18px; }
.intro h3 { margin: 0 0 4px; font-size: 1rem; font-weight: 600; display: flex; align-items: center; }
.intro p { margin: 0; color: var(--muted); }
.intro .close { position: absolute; top: 4px; right: 4px; width: 44px; height: 44px; border: 0; background: none; color: var(--muted); font-size: 22px; cursor: pointer; }
#tripadd .addtrip { margin: 14px 0 0; }
.card.rec { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.quietline { display: flex; align-items: center; gap: 6px; margin: 0; }
.quietline svg { width: 16px; height: 16px; flex: none; color: var(--open-fg); }
.passline { display: flex; align-items: flex-start; gap: 6px; }
.passline svg { width: 16px; height: 16px; flex: none; margin-top: 3px; }
.passline[data-status="open"] svg { color: var(--open-fg); }
.passline[data-status="convoy"] svg, .passline[data-status="partial"] svg { color: var(--convoy-fg); }
.passline[data-status="closed"] svg { color: var(--closed-fg); }
.passline[data-status="winter_closed"] svg { color: var(--winter-fg); }
.name .tag + .tag { margin-left: -4px; }
/* Min tur: forrige visning står dempet mens ny tur hentes (snu, posisjon), i stedet for å blankes. */
.tripview.loading { animation: trippulse 1.4s ease-in-out infinite; }
@keyframes trippulse { 0%, 100% { opacity: 1; } 50% { opacity: .5; } }
@media (prefers-reduced-motion: reduce) { .tripview.loading { animation: none; opacity: .6; } }

/* Varsler i detaljvisningen (FJ-10, plassering F). Knappen er en lenkeknapp i merkefargen; «på» og hindringer er en linje med bjelle. */
.alerts { margin: 16px 0 4px; }
.alerts svg { fill: none; stroke: var(--accent); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.alertbtn { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0; border: 0; background: none; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.alertbtn svg { width: 20px; height: 20px; }
.alertbtn[disabled] { opacity: .6; cursor: default; }
.alertbtn:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.alerts .note { margin: 2px 0 0; line-height: 1.4; }
.alertctl { display: flex; align-items: center; gap: 12px; }
.alertctl > svg { flex: none; width: 22px; height: 22px; align-self: flex-start; margin-top: 2px; }
.alertctl .grow { flex: 1; }
.alertctl b { display: block; font-weight: 600; }
.alertctl small { display: block; margin-top: 2px; color: var(--muted); font-size: 0.7647rem; line-height: 1.35; }
.alertbtn.off { flex: none; }
/* Én linje («Varsel på: alltid»): bjella midt på teksten; to linjer har den øverst ved tittelen. */
.alertctl.single > svg { align-self: center; margin-top: 0; width: 20px; height: 20px; }
/* Valgene etter «Varsle meg» (FJ-58): ut dagen, i morgen, alltid. Rykket inn under teksten, forbi bjella. */
.alertchoice { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 0 28px; }
.alertchoice button { min-height: 40px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 20px; background: none; color: var(--text); font: inherit; font-size: 0.8824rem; font-weight: 500; cursor: pointer; }
.alertchoice button:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.alerts .choicenote { margin: 6px 0 0 28px; font-size: 0.7647rem; }
.namebell { display: inline-block; margin-left: 6px; vertical-align: -2px; }
.namebell svg { display: block; width: 16px; height: 16px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
/* Anbefalingen i Min tur: tiden i en liten linje over vegnavnet, så navnet får hele linjen. */
.rectitle small { display: block; margin-bottom: 2px; font-size: 0.8235rem; font-weight: 500; color: var(--muted); }
.rectitle span { display: block; }
/* Kort som rulles fram (varsler, /#navn) skal ikke havne under det faste feltet bak statuslinjen på iPhone. */
.list .card { scroll-margin-top: calc(env(safe-area-inset-top) + 8px); }

/* Tunneler med langvarig arbeid over overgangene på Oversikt, bare når en er stengt eller har kolonne nå (app.js renderTunnels). Ingen overskrift. */
.tunnels { margin: 0 0 18px; }
