/* Merkevarefont: Outfit, variabel vekt, beskåret til norsk tekst av tools/brand/build_brand.py. OFL-lisens. */
@font-face { font-family: Outfit; src: url(outfit.woff2) format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap; }

:root {
  --pink: #F71060;
  --pink-press: #D60A50;   /* rosa for tekst og flater med tekst: 5,2:1 mot hvit */
  --pink-deep: #B8083F;    /* trykket tilstand på knapper med --pink-press */
  --pink-soft: #FFE7EF;
  --navy: #061120;
  --green: #0E8853;
  --green-soft: #E4F4EC;
  --amber-soft: #fff4e0;
  --amber-text: #7a4a00;
  --bg: #ffffff;
  --bg2: #F7F3F4;
  --text: #061120;
  --muted: #6E6C7D;
  --line: #EDE7EA;
  --display: Outfit, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --r: 12px;
  --r-kort: 20px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 15px/1.4 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
body { user-select: none; -webkit-user-select: none; }
input, textarea { user-select: text; -webkit-user-select: text; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2 { letter-spacing: -0.01em; }
.ic { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
[hidden] { display: none !important; }

.screen { position: fixed; inset: 0; display: flex; flex-direction: column; background: var(--bg); overflow: hidden; }
.screen.push { animation: push .22s cubic-bezier(.2,.8,.2,1); }
@keyframes push { from { transform: translateX(28px); opacity: .6; } to { transform: none; opacity: 1; } }

/* App bar */
.appbar { display: flex; align-items: center; gap: 6px; height: calc(52px + var(--safe-t)); padding: var(--safe-t) 12px 0;
  border-bottom: 1px solid var(--line); background: var(--bg); flex: none; }
.logo { display: block; height: 28px; width: auto; }
.logo.big { height: 64px; }
.display { font-family: var(--display); letter-spacing: -0.03em; }
.appbar-sub { margin-left: auto; font-size: 13px; color: var(--muted); font-weight: 600; }
.appbar-title { font-family: var(--display); letter-spacing: -0.025em; font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; color: var(--text); flex: none; }
.icon-btn:active { background: var(--bg2); }

/* Hjem */
.home-body { flex: 1; overflow-y: auto; padding: 20px 16px 16px; }
.home-body h1 { font-family: var(--display); letter-spacing: -0.025em; margin: 8px 0 12px; font-size: 26px; }
.search-entry { display: flex; align-items: center; gap: 10px; width: 100%; height: 48px; padding: 0 14px; border-radius: var(--r);
  background: var(--bg2); color: var(--muted); text-align: left; font-size: 15px; }
.search-entry:active { background: #EFE9EB; }
.actions-list { margin-top: 20px; border-top: 1px solid var(--line); }
.action { display: flex; align-items: center; gap: 14px; width: 100%; padding: 16px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.action:active { background: var(--bg2); }
.action .ic { width: 26px; height: 26px; color: var(--pink); }
.action.primary .ic { color: var(--pink); }
.action-text { flex: 1; min-width: 0; }
.action b { display: block; font-size: 16px; font-weight: 600; }
.action small { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }
.action .chev { width: 18px; height: 18px; color: #b7bbc7; }
.fineprint { margin: 24px 4px 0; font-size: 12px; color: var(--muted); }
.tabbar { display: flex; border-top: 1px solid var(--line); padding-bottom: var(--safe-b); background: var(--bg); flex: none; }
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 6px; color: var(--muted); font-size: 11px; font-weight: 500; }
.tab .ic { width: 24px; height: 24px; }
.tab.active { color: var(--pink-press); }

/* Kart-skjerm */
#find { background: var(--bg2); }
#map { position: absolute; inset: 0; }
.maplibregl-ctrl-attrib { font-size: 10px; }
.maplibregl-ctrl-top-right { top: calc(var(--safe-t) + 104px); }
.overlay-top { position: absolute; left: 0; right: 0; top: 0; padding: calc(var(--safe-t) + 8px) 10px 0; z-index: 3; pointer-events: none; }
.overlay-top > * { pointer-events: auto; }
.searchbar { display: flex; align-items: center; gap: 2px; height: 48px; padding: 0 4px; background: var(--bg); border-radius: var(--r);
  box-shadow: 0 1px 2px rgba(27,35,64,.08), 0 4px 16px rgba(27,35,64,.10); }
.searchbar input { flex: 1; min-width: 0; height: 40px; border: 0; background: none; font-size: 16px; outline: none; color: var(--text); }
.searchbar input::placeholder { color: var(--muted); }
.searchbar input::-webkit-search-cancel-button { display: none; }
.suggest { list-style: none; margin: 6px 0 0; padding: 4px 0; background: var(--bg); border-radius: var(--r);
  box-shadow: 0 4px 16px rgba(27,35,64,.12); max-height: 45vh; overflow-y: auto; }
.suggest li { display: flex; align-items: center; gap: 10px; padding: 10px 14px; cursor: pointer; }
.suggest li:active { background: var(--bg2); }
.suggest .ic { color: var(--muted); width: 18px; height: 18px; }
.suggest b { font-weight: 600; display: block; }
.suggest small { color: var(--muted); font-size: 12px; }
.suggest .none { color: var(--muted); font-size: 14px; }
.chips { display: flex; gap: 6px; padding: 8px 0 0; overflow-x: auto; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; height: 32px; padding: 0 12px; border-radius: 16px; background: var(--bg);
  font-size: 13px; font-weight: 500; box-shadow: 0 1px 2px rgba(27,35,64,.08), 0 2px 8px rgba(27,35,64,.08); position: relative; }
.chip.on { background: var(--navy); color: #fff; }
.chip.select::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); margin: -3px 0 0 7px; opacity: .7; }
.chip select { position: absolute; inset: 0; opacity: 0; width: 100%; font-size: 16px; }

/* Bunnark */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; height: 88vh; background: var(--bg); border-radius: 16px 16px 0 0;
  box-shadow: 0 -2px 12px rgba(27,35,64,.10); display: flex; flex-direction: column; z-index: 4;
  transition: transform .28s cubic-bezier(.2,.8,.2,1); will-change: transform; }
.sheet.dragging { transition: none; }
.sheet[data-snap="peek"] { transform: translateY(calc(88vh - 214px - var(--safe-b))); }
.sheet[data-snap="half"] { transform: translateY(46vh); }
.sheet[data-snap="full"] { transform: translateY(0); }
.sheet-handle { padding: 8px 0 4px; display: grid; place-items: center; touch-action: none; cursor: grab; }
.grip { width: 36px; height: 4px; border-radius: 2px; background: #d3d6de; }
.sheet-head { padding: 0 16px 8px; font-size: 13px; color: var(--muted); display: flex; justify-content: space-between; touch-action: none; }
.sheet-head b { color: var(--text); font-weight: 600; }
.dest-actions { display: flex; gap: 8px; padding: 0 12px 8px; }
.dest-actions .act { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 40px; border-radius: 10px;
  background: var(--bg2); color: var(--text); font-size: 13px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.dest-actions .act:active { background: #EFE9EB; }
.dest-actions .act .ic { width: 18px; height: 18px; }
.sheet-body { flex: 1; overflow-y: auto; padding: 0 12px calc(16px + var(--safe-b)); }
.sheet[data-snap="peek"] .sheet-body, .sheet[data-snap="half"] .sheet-body { overflow: hidden; }
.empty { padding: 20px 8px; color: var(--muted); font-size: 14px; }

/* Anbefalt-kort og liste */
.rec { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--r); background: var(--navy); color: #fff; margin-bottom: 6px; }
.rec:active { background: #03101F; }
.rec .pill { font-size: 11px; font-weight: 600; background: var(--pink-press); color: #fff; border-radius: 6px; padding: 2px 7px; display: inline-block; margin-bottom: 4px; }
.rec .name { font-weight: 600; font-size: 16px; }
.rec .meta { font-size: 13px; opacity: .75; }
.rec .price { font-family: var(--display); letter-spacing: -0.025em; margin-left: auto; text-align: right; font-weight: 700; font-size: 22px; white-space: nowrap; }
.rec .price.free { color: #8fe3b0; }
.rec .save { display: block; font-size: 12px; font-weight: 500; color: #8fe3b0; }
.rec .chev { width: 18px; height: 18px; opacity: .6; }
ol#list { list-style: none; margin: 0; padding: 0; }
.row { display: flex; align-items: center; gap: 12px; padding: 12px 4px; border-bottom: 1px solid var(--line); }
.row:active { background: var(--bg2); }
.row .ic { color: var(--muted); width: 20px; height: 20px; }
.row .txt { flex: 1; min-width: 0; }
.row .name { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .meta { font-size: 13px; color: var(--muted); }
.row .price { font-family: var(--display); letter-spacing: -0.025em; font-weight: 700; white-space: nowrap; text-align: right; font-size: 16px; }
.row .price.free { color: var(--green); }
.row .price.unknown { color: var(--muted); font-weight: 500; font-size: 14px; }
.row .price small { display: block; font-size: 11px; color: var(--muted); font-weight: 500; }

/* Detalj */
.detail-body { flex: 1; overflow-y: auto; padding: 16px 16px calc(24px + var(--safe-b)); }
.detail-body h2 { font-family: var(--display); letter-spacing: -0.025em; margin: 0 0 2px; font-size: 22px; }
.detail-body .meta { color: var(--muted); font-size: 14px; }
.stat-row { display: flex; gap: 8px; margin: 16px 0; }
.stat { flex: 1; padding: 12px; border-radius: var(--r); background: var(--bg2); }
.stat b { font-family: var(--display); letter-spacing: -0.025em; display: block; font-size: 20px; font-weight: 700; }
.stat.free b { color: var(--green); }
.stat span { font-size: 12px; color: var(--muted); }
.kv { margin: 0; border-top: 1px solid var(--line); }
.kv div { display: flex; justify-content: space-between; gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--muted); white-space: nowrap; }
.kv dd { margin: 0; text-align: right; font-weight: 600; }
.steps { margin: 0; padding: 0; list-style: none; font-size: 14px; }
.steps li { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--line); }
.steps li:last-child { border: 0; }
.section-label { margin: 18px 0 6px; font-size: 13px; font-weight: 600; color: var(--muted); }
.note { border-radius: var(--r); padding: 10px 12px; font-size: 14px; margin-top: 12px; }
.note.warn { background: var(--amber-soft); color: var(--amber-text); }
.note.ok { background: var(--green-soft); color: #0A5E3A; }
.note .btn.small { height: 40px; margin-top: 10px; width: 100%; }
.actions { display: flex; gap: 10px; margin-top: 20px; }
.btn { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 48px; padding: 0 14px; border-radius: var(--r);
  background: var(--pink-press); color: #fff; font-weight: 600; text-decoration: none; font-size: 15px; }
.btn:active { background: var(--pink-deep); }
.btn.secondary { background: var(--bg2); color: var(--text); }
.btn.secondary:active { background: #EFE9EB; }
.btn .ic { width: 18px; height: 18px; }
.disclaimer { font-size: 12px; color: var(--muted); margin-top: 20px; line-height: 1.5; }
a.plain { color: var(--pink-press); font-weight: 600; text-decoration: none; }

/* Kan jeg stå her */
.check-body { flex: 1; overflow-y: auto; padding-bottom: calc(24px + var(--safe-b)); }
.check-map { height: 38vh; min-height: 220px; background: var(--bg2); }
.check-pos { margin: 8px 16px 0; font-size: 13px; color: var(--muted); }
.check-tools { display: flex; gap: 10px; padding: 10px 16px 0; }
.check-tools .btn { flex: 1; cursor: pointer; }
.photo-preview { display: block; width: calc(100% - 32px); max-height: 180px; object-fit: cover; margin: 10px 16px 0; border-radius: var(--r); }
#check-result { padding: 12px 16px 0; }
#check-result .actions { margin-top: 12px; }
.verdict { border-radius: var(--r); padding: 14px 16px; color: #fff; }
.verdict.ok { background: #0B7A4A; } .verdict.unsure { background: #B8520A; } .verdict.no { background: #C4281C; } .verdict.unknown { background: #6E6C7D; }
.verdict-head { font-family: var(--display); letter-spacing: -0.025em; display: flex; justify-content: space-between; align-items: baseline; font-size: 20px; }
.verdict .conf { font-size: 15px; font-weight: 600; }
.verdict-hint { font-size: 14px; margin-top: 2px; }
.reasons { margin: 12px 0 0; padding: 0 0 0 18px; font-size: 14px; }
.reasons li { margin: 4px 0; }
.plain-list { list-style: none; margin: 0; padding: 0; }
.dot { width: 12px; height: 12px; border-radius: 50%; flex: none; background: #9A98A8; }
.dot.ok { background: var(--green); } .dot.no { background: #D92D20; } .dot.unsure { background: #E3680C; }
.thumb { width: 44px; height: 44px; border-radius: 8px; object-fit: cover; flex: none; }
.history-body { flex: 1; overflow-y: auto; padding: 4px 16px; }

/* Stubs */
.stub { padding: 56px 28px; text-align: center; }
.stub-ic { width: 48px; height: 48px; color: var(--pink); margin-bottom: 8px; }
.stub h2 { margin: 8px 0; }
.stub p { color: var(--text); }
.muted { color: var(--muted); font-size: 14px; }

/* Splash og toast */
#splash { position: fixed; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 20px; background: var(--bg); z-index: 50; }
.spinner { width: 22px; height: 22px; border: 2.5px solid var(--line); border-top-color: var(--pink); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
#toast { position: fixed; left: 50%; bottom: calc(24px + var(--safe-b)); transform: translateX(-50%); background: var(--navy); color: #fff;
  padding: 10px 16px; border-radius: 10px; font-size: 14px; z-index: 60; max-width: 90vw; }

/* Desktop: vis som telefon */
@media (min-width: 720px) {
  body { background: #e9eaef; }
  .screen, #splash, #toast { max-width: 414px; left: 50%; transform: translateX(-50%); }
  .screen { top: 24px; bottom: 24px; border-radius: 28px; box-shadow: 0 0 0 1px rgba(0,0,0,.08), 0 24px 60px rgba(0,0,0,.18); }
  #splash { top: 24px; bottom: 24px; border-radius: 28px; }
  .screen.push { animation: none; }
  .sheet[data-snap="peek"] { transform: translateY(calc(88vh - 214px)); }
}

/* Parkie-nålen på kartet, se pin.js */
.pk-pin { width: 46px; height: 46px; cursor: grab; }
.pk-pin svg { width: 100%; height: 100%; overflow: visible; display: block; }
.pk-pin .pk-pin-body { transform-box: fill-box; transform-origin: 50% 100%; animation: pk-drop .5s cubic-bezier(.2,.9,.3,1.25); }
.pk-pin .pk-pin-shadow { transform-box: fill-box; transform-origin: 50% 50%; animation: pk-shadow-in .5s ease-out; }
.pk-pin.pop .pk-pin-badge { transform-box: fill-box; transform-origin: 50% 50%; animation: pk-pop .45s cubic-bezier(.2,.9,.3,1.3); }
@keyframes pk-drop { 0% { transform: translateY(-14px) scale(.9); opacity: 0; } 70% { transform: translateY(1px) scale(1.02); opacity: 1; } 100% { transform: none; } }
@keyframes pk-shadow-in { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: .22; } }
@keyframes pk-pop { 0% { transform: scale(.55); } 60% { transform: scale(1.12); } 100% { transform: scale(1); } }
@media (prefers-reduced-motion: reduce) {
  .pk-pin .pk-pin-body, .pk-pin .pk-pin-shadow, .pk-pin.pop .pk-pin-badge { animation: none; }
}
}

/* «Gratis nå» i rosa, ønske fra statusmøtet 10. september */
.chip[data-filter="free"] { color: var(--pink-press); font-weight: 600; }
.chip[data-filter="free"].on { background: var(--pink-press); color: #fff; }

/* Synlig fokus for tastatur og skjermleser (WCAG 2.4.7). Musklikk får ingen ring. */
:focus-visible { outline: 3px solid var(--pink-press); outline-offset: 2px; border-radius: 6px; }
.row[role="button"], .rec[role="button"] { cursor: pointer; }
.row[role="button"]:focus-visible { outline-offset: -3px; }

/* Varsel når enheten er uten nett */
#offline { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(76px + var(--safe-b)); z-index: 60;
  background: var(--navy); color: #fff; font-size: 13px; padding: 9px 14px; border-radius: 999px;
  box-shadow: 0 6px 18px rgba(6,17,32,.25); max-width: calc(100% - 32px); text-align: center; }

/* Felttestmodus, se felttest.js */
.felttest { margin-top: 16px; padding: 14px; border-radius: var(--r); background: var(--bg2); font-size: 14px; }
.ft-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 8px; }
.ft-head span { color: var(--muted); font-size: 13px; }
.ft-label { display: block; font-size: 13px; font-weight: 600; color: var(--muted); margin: 10px 0 4px; }
.ft-select, .ft-input { width: 100%; box-sizing: border-box; height: 44px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); font: inherit; color: var(--text); }
.ft-meta { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.ft-meta a { color: var(--pink-press); font-weight: 600; }
.ft-steps { margin: 12px 0 0; padding-left: 20px; display: grid; gap: 10px; }
.ft-steps .btn { display: flex; margin-top: 6px; }
.ft-ok { display: block; margin-top: 4px; color: var(--ok, #0B7A4A); font-weight: 600; font-size: 13px; }
.ft-radio { display: flex; gap: 16px; margin-top: 6px; }
.ft-radio label { display: flex; align-items: center; gap: 6px; }
.ft-foot { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.ft-foot .btn { flex: 1 1 140px; }
.ft-off { color: var(--muted); font-size: 13px; }
.felttest .btn.secondary { background: var(--bg); border: 1px solid var(--line); }
.felttest .btn.secondary:disabled { opacity: .5; }

/* Lenkene i kildeangivelsen må skilles fra teksten med mer enn farge (WCAG 1.4.1). */
.maplibregl-ctrl-attrib a { text-decoration: underline; }
.data-attrib { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
