/* Designuttrykk: blåtimen på Skeikampen – mørk blå himmel, varmt vinduslys, snø. */
:root {
  --night: #0b1c33;
  --sky: #16345c;
  --sky-2: #2a5a96;
  --glass: rgba(14, 32, 58, 0.62);
  --glass-strong: rgba(10, 24, 44, 0.82);
  --line: rgba(190, 215, 245, 0.14);
  --text: #f1f5fb;
  --muted: #a9bbd3;
  --snow: #e6eef8;
  --amber: #f3b561;
  --amber-2: #ffcf87;
  --ok: #7fd3a0;
  --rain: #8cc4ff;
  --bg: #0b1c33;
  --sunk: rgba(0, 0, 0, .2);
  --chip: rgba(255, 255, 255, .08);
  --bar: rgba(8, 20, 38, .8);
  --shadow: rgba(0, 0, 0, .18);
  --danger: #ff8f7a;
  --accent-text: #ffcf87;
  --mg-grid: rgba(190, 215, 245, .10);
  --mg-null: rgba(190, 215, 245, .32);
  --mg-dag: rgba(190, 215, 245, .28);
  --mg-tidslinje: rgba(190, 215, 245, .07);
  --mg-akse: rgba(14, 34, 64, .95);
  --mg-akse-0: rgba(14, 34, 64, 0);
  --mg-ring: #0e2240;
  --radius: 18px;
  --tabbar-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
html { background: var(--bg); }
body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  line-height: 1.45;
  min-height: 100vh;
}
/* Fast bakgrunn (iOS støtter ikke background-attachment: fixed) */
body::before {
  content: ""; position: fixed; inset: 0; z-index: -1;
  background:
    linear-gradient(180deg, rgba(11, 28, 51, .2) 0%, rgba(11, 28, 51, .7) 65%, var(--night) 100%),
    url("/img/bakgrunn.jpg") center 35% / cover no-repeat,
    var(--night);
}

/* Toppfelt */
.topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 5;
  padding: calc(var(--safe-t) + 10px) 20px 12px;
  background: linear-gradient(180deg, rgba(8, 20, 38, .85) 0%, rgba(8, 20, 38, .55) 70%, rgba(8, 20, 38, 0) 100%);
  transition: background .2s;
}
.topbar.solid {
  background: rgba(8, 20, 38, .78);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
  border-bottom: 1px solid var(--line);
}
.topbar { display: flex; justify-content: space-between; align-items: flex-start; }
.info-btn {
  flex: 0 0 auto; width: 40px; height: 40px; margin: 0 -6px 0 0; border-radius: 50%;
  display: grid; place-content: center; text-decoration: none; color: var(--snow);
}
.info-btn.active { color: var(--accent-text); }
.view-title { font-size: 30px; letter-spacing: -.02em; margin: 6px 4px 14px; font-weight: 700; }
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.fact {
  background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.fact .n { font-size: 28px; font-weight: 300; color: var(--accent-text); letter-spacing: -.02em; }
.fact .l { font-size: 13px; color: var(--muted); }
.tur .km { font-size: 14px; font-weight: 600; color: var(--accent-text); white-space: nowrap; font-variant-numeric: tabular-nums; }
.eyebrow { margin: 0; font-size: 12px; color: var(--accent-text); letter-spacing: .08em; text-transform: uppercase; font-weight: 600; }
h1 { margin: 2px 0 0; font-size: 28px; letter-spacing: -.02em; text-shadow: 0 2px 12px rgba(0, 0, 0, .4); }

main {
  max-width: 640px; margin: 0 auto;
  padding: calc(var(--safe-t) + 86px) 16px calc(var(--tabbar-h) + var(--safe-b) + 24px);
}

/* Toppbilde på forsiden */
.hero {
  position: relative;
  margin: calc(-1 * (var(--safe-t) + 86px)) -16px 0;
  min-height: calc(var(--safe-t) + 430px);
  display: flex; align-items: flex-end;
  padding: 0 16px 18px;
  background: url("/img/hytta-900.jpg") 38% 60% / cover no-repeat;
}
@media (min-width: 700px) { .hero { background-image: url("/img/hytta-1600.jpg"); border-radius: 0 0 28px 28px; } }
.hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11, 28, 51, 0) 40%, rgba(11, 28, 51, .55) 72%, var(--night) 100%);
  border-radius: inherit;
}
.hero > * { position: relative; z-index: 1; }

.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 26px 4px 10px; font-weight: 600; }
.card {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  backdrop-filter: blur(14px) saturate(140%);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  box-shadow: 0 10px 30px var(--shadow);
}
.card + .card { margin-top: 10px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.source { font-size: 12px; color: var(--muted); margin: 18px 4px 0; }

/* Lister */
.list { padding: 4px 0; }
.row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; min-height: 50px;
  color: inherit; text-decoration: none;
}
.row + .row { border-top: 1px solid var(--line); }
.row .grow { flex: 1; min-width: 0; }
.row .sub { font-size: 13px; color: var(--muted); }
.row .chev { color: var(--accent-text); font-size: 20px; }
a.row:active { background: rgba(243, 181, 97, .08); }

/* Vær */
.weather-now {
  display: flex; align-items: center; gap: 14px; width: 100%;
  background: none; border: 0; box-shadow: none; padding: 0;
  backdrop-filter: none; -webkit-backdrop-filter: none;
}
.weather-now .big-ico { font-size: 54px; line-height: 1; filter: drop-shadow(0 4px 12px rgba(0, 0, 0, .35)); }
.weather-now .temp { font-size: 64px; font-weight: 200; letter-spacing: -.04em; line-height: 1; text-shadow: 0 4px 20px rgba(0, 0, 0, .45); }
.weather-now .meta { font-size: 14px; color: var(--snow); opacity: .9; text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
.hours { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.hours::-webkit-scrollbar { display: none; }
.hour {
  flex: 0 0 64px; text-align: center; padding: 10px 4px; scroll-snap-align: start;
  background: var(--glass); border: 1px solid var(--line); border-radius: 16px;
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.hour:first-child { border-color: rgba(243, 181, 97, .55); background: rgba(243, 181, 97, .14); }
.hour .t { font-size: 12px; color: var(--muted); }
.hour .i { font-size: 24px; margin: 4px 0; }
.hour .v { font-weight: 600; }
.hour .p { font-size: 11px; color: var(--rain); min-height: 14px; }
.day .temps { font-variant-numeric: tabular-nums; }
.day .ico { font-size: 22px; width: 28px; text-align: center; }
.day .grow::first-letter { text-transform: uppercase; }
.snow-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.snow-grid .n { font-size: 26px; font-weight: 600; color: var(--snow); }
.snow-grid .n small { font-size: 14px; color: var(--muted); font-weight: 500; }
.snow-grid .l { font-size: 12px; color: var(--muted); }

/* Huskeliste */
.progress-card { position: sticky; top: calc(var(--safe-t) + 82px); z-index: 2; background: var(--glass-strong); }
.progress-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.progress { height: 8px; background: var(--chip); border-radius: 99px; overflow: hidden; }
.progress-bar { height: 100%; width: 0; background: linear-gradient(90deg, var(--amber), var(--amber-2)); transition: width .25s; box-shadow: 0 0 12px rgba(243, 181, 97, .6); }
.check {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 16px; min-height: 54px; cursor: pointer;
}
.check + .check { border-top: 1px solid var(--line); }
.check input { appearance: none; -webkit-appearance: none; width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--muted); flex: 0 0 auto; display: grid; place-content: center; margin: 0; transition: all .15s; }
.check input:checked { background: var(--amber); border-color: var(--amber); box-shadow: 0 0 12px rgba(243, 181, 97, .5); }
.check input:checked::after { content: "✓"; color: var(--night); font-weight: 800; font-size: 15px; }
.check input:checked + span { color: var(--muted); text-decoration: line-through; }
.check .hint { display: block; font-size: 13px; color: var(--muted); text-decoration: none; }
.done-banner {
  margin-top: 16px; padding: 18px; border-radius: var(--radius); text-align: center; font-weight: 600;
  background: linear-gradient(135deg, var(--amber), var(--amber-2)); color: var(--night);
}

/* Knapper og skjema */
button { font: inherit; }
.btn-primary, .btn-secondary {
  display: flex; justify-content: center; align-items: center; gap: 8px;
  width: 100%; min-height: 52px; margin-top: 12px;
  border: 0; border-radius: 14px; font-weight: 600; font-size: 17px; cursor: pointer;
}
.btn-primary { background: linear-gradient(135deg, var(--amber), var(--amber-2)); color: var(--night); box-shadow: 0 6px 20px rgba(243, 181, 97, .28); }
.btn-secondary { background: var(--chip); color: var(--snow); border: 1px solid var(--line); }
.btn-primary:disabled { opacity: .5; }
.btn-ghost { background: none; border: 0; color: var(--accent-text); font-weight: 600; padding: 6px 4px; cursor: pointer; }
.add-row { margin-top: 6px; }
.field { display: block; margin-top: 14px; }
.field span { display: block; font-size: 13px; color: var(--muted); margin-bottom: 6px; }
input[type=text], input[type=password], input[type=number], textarea {
  width: 100%; font: inherit; font-size: 16px; color: var(--text);
  background: var(--sunk); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px;
}
input:focus, textarea:focus { outline: 2px solid rgba(243, 181, 97, .6); outline-offset: 1px; }
::placeholder { color: rgba(169, 187, 211, .6); }
.item-row { display: flex; gap: 8px; align-items: center; padding: 8px 12px; }
.item-row + .item-row { border-top: 1px solid var(--line); }
.item-row .qty { width: 86px; flex: 0 0 auto; text-align: center; }
.item-row .name { flex: 1; }
.item-row .low { font-size: 11px; color: var(--accent-text); font-weight: 600; }
.item-row .del { background: none; border: 0; color: var(--muted); font-size: 20px; width: 32px; cursor: pointer; }
.skap-preview { margin-top: 12px; }
.skap-preview img { width: 100%; border-radius: var(--radius); display: block; max-height: 320px; object-fit: cover; }
.status { margin-top: 12px; padding: 12px 16px; border-radius: 12px; background: var(--glass); border: 1px solid var(--line); }
.status.error { border-color: var(--danger); color: var(--danger); }

/* Lenker */
.link-group + .link-group { margin-top: 10px; }
.link-group h3 { font-size: 15px; margin: 0; padding: 12px 16px 4px; color: var(--accent-text); }

/* Menylinje */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  display: grid; grid-template-columns: repeat(6, 1fr);
  height: calc(var(--tabbar-h) + var(--safe-b));
  padding-bottom: var(--safe-b);
  background: var(--bar);
  backdrop-filter: saturate(160%) blur(20px);
  -webkit-backdrop-filter: saturate(160%) blur(20px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--muted); text-decoration: none; font-size: 10.5px; font-weight: 500; letter-spacing: -.01em;
}
.tabbar .ico { width: 26px; height: 26px; opacity: .75; transition: opacity .15s, transform .15s; }
.tabbar a.active { color: var(--accent-text); }
.tabbar a.active .ico { opacity: 1; transform: translateY(-1px); }
.tabbar a { position: relative; }
.tabbar a.active::before { content: ""; position: absolute; top: 0; width: 22px; height: 2px; border-radius: 0 0 2px 2px; background: var(--amber); }

.toast {
  position: fixed; left: 16px; right: 16px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px);
  max-width: 480px; margin: 0 auto; z-index: 20;
  background: var(--snow); color: var(--night); padding: 12px 16px; border-radius: 12px; text-align: center; font-weight: 600;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
}
#skap { scroll-margin-top: calc(var(--safe-t) + 100px); }

/* Løypekart (Løyper.net) */
.map-card {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--glass-strong);
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25);
}
.map-bar { display: flex; justify-content: space-between; align-items: center; padding: 6px 8px 6px 14px; font-size: 14px; font-weight: 600; color: var(--snow); }
.map-card iframe { display: block; width: 100%; height: 62vh; min-height: 380px; border: 0; background: #dfe7ef; }
.map-card.fullscreen {
  position: fixed; z-index: 8; border-radius: 0; border: 0;
  left: 0; right: 0; top: calc(var(--safe-t) + 82px); background: var(--night); bottom: calc(var(--tabbar-h) + var(--safe-b));
  display: flex; flex-direction: column;
}
.map-card.fullscreen iframe { flex: 1; height: auto; min-height: 0; }
body.map-open { overflow: hidden; }

/* Vind */
.arrow { display: inline-block; font-weight: 700; line-height: 1; margin-right: 2px; }
.wind-now { font-size: 16px; margin-top: 2px; }
.wind-now strong { color: var(--text); }
.hour .w { font-size: 13px; font-weight: 600; color: var(--snow); margin-top: 2px; }
.hour .g { font-size: 11px; color: var(--muted); min-height: 14px; }
.hours-legend { flex: 0 0 auto; align-self: center; font-size: 11px; color: var(--muted); width: 70px; margin: 0 6px; line-height: 1.3; }
.wind-strong, .wind-strong strong, .hour .w.wind-strong { color: var(--accent-text); }
.wind-danger, .wind-danger strong, .hour .w.wind-danger { color: var(--danger); }
.day .sub .arrow { font-size: 12px; }

/* Manualer */
.man-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.man-tile {
  display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center;
  padding: 14px 6px 12px; border-radius: var(--radius); text-decoration: none; color: var(--text);
  background: var(--glass); border: 1px solid var(--line);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.man-tile:active { background: rgba(243, 181, 97, .12); }
.man-tile-ico { font-size: 30px; }
.man-tile-navn { font-size: 13px; font-weight: 600; line-height: 1.2; }
.man-tile-modell { font-size: 11px; color: var(--muted); }
.back { display: inline-block; color: var(--accent-text); text-decoration: none; font-weight: 600; padding: 4px 0 10px; }
.man-head { display: flex; gap: 14px; align-items: center; }
.man-ico { font-size: 34px; width: 60px; height: 60px; display: grid; place-content: center; border-radius: 16px; background: rgba(243, 181, 97, .15); border: 1px solid rgba(243, 181, 97, .35); flex: 0 0 auto; }
.man-head h2 { margin: 0; font-size: 26px; letter-spacing: -.02em; }
.man-head p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.man-kort { color: var(--snow); opacity: .9; margin: 14px 2px; }
.toc { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.toc::-webkit-scrollbar { display: none; }
.chip-btn { flex: 0 0 auto; font: inherit; font-size: 13px; font-weight: 600; color: var(--snow); background: var(--chip); border: 1px solid var(--line); border-radius: 99px; padding: 7px 12px; cursor: pointer; }
.man-sec { margin-top: 12px; border-radius: var(--radius); background: var(--glass); border: 1px solid var(--line); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); scroll-margin-top: calc(var(--safe-t) + 96px); }
.man-sec > summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 700; font-size: 17px; display: flex; justify-content: space-between; align-items: center; }
.man-sec > summary::-webkit-details-marker { display: none; }
.man-sec > summary::after { content: "›"; color: var(--accent-text); font-size: 22px; transition: transform .2s; }
.man-sec[open] > summary::after { transform: rotate(90deg); }
.man-sec > :not(summary) { margin: 0 12px 14px; }
.steps { list-style: none; padding: 0; counter-reset: s; }
.steps li { display: flex; gap: 12px; padding: 10px 4px; }
.steps li + li { border-top: 1px solid var(--line); }
.steps .num { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-content: center; font-weight: 800; color: var(--night); background: linear-gradient(135deg, var(--amber), var(--amber-2)); }
.steps p, .key p, .prog p, .fault p { margin: 2px 0 0; color: var(--muted); font-size: 14px; }
.fig { margin: 0 0 12px; }
.fig-btn { display: block; width: 100%; padding: 8px; border: 0; border-radius: 12px; background: #fff; cursor: zoom-in; }
.fig-btn img { display: block; width: 100%; height: auto; }
.fig figcaption { font-size: 12px; color: var(--muted); margin-top: 6px; text-align: center; }
.keys { display: grid; gap: 2px; }
.key { display: flex; gap: 12px; align-items: flex-start; padding: 8px 4px; }
.key + .key { border-top: 1px solid var(--line); }
.key-sym { flex: 0 0 auto; min-width: 34px; max-width: 110px; padding: 5px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; text-align: center; line-height: 1.25; color: var(--accent-text); background: rgba(243, 181, 97, .12); border: 1px solid rgba(243, 181, 97, .3); }
.key-sym.num { width: 30px; min-width: 30px; height: 30px; padding: 0; border-radius: 50%; display: grid; place-content: center; font-size: 14px; }
.progs { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; }
.prog { padding: 12px; border-radius: 12px; background: var(--sunk); border: 1px solid var(--line); }
.prog-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; flex-wrap: wrap; }
.chips { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 99px; background: rgba(140, 196, 255, .14); color: var(--rain); }
.man-list { list-style: none; padding: 0; }
.man-list li { display: flex; gap: 10px; padding: 8px 4px; font-size: 15px; }
.man-list li + li { border-top: 1px solid var(--line); }
.li-ico { flex: 0 0 auto; }
.faults { display: grid; gap: 8px; }
.fault { padding: 12px; border-radius: 12px; background: rgba(255, 143, 122, .08); border: 1px solid rgba(255, 143, 122, .25); }
.lightbox { position: fixed; inset: 0; z-index: 50; background: rgba(4, 10, 20, .94); overflow: auto; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: calc(var(--safe-t) + 16px) 8px calc(var(--safe-b) + 16px); touch-action: pinch-zoom pan-x pan-y; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; background: #fff; border-radius: 8px; padding: 6px; }
.lightbox p { color: var(--muted); font-size: 13px; }
.prog.has-sym { display: flex; gap: 12px; align-items: flex-start; }
.prog-body { flex: 1; min-width: 0; }
.syms { flex: 0 0 auto; display: flex; flex-direction: column; gap: 6px; }
.syms img { width: 48px; height: auto; background: #fff; border-radius: 8px; padding: 5px; display: block; }

/* Strekikoner (meny og info-knapp) */
.ico { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; display: block; }
.info-btn .ico { width: 28px; height: 28px; filter: drop-shadow(0 1px 4px rgba(0, 0, 0, .4)); }

/* Aldri sidelengs skroll på telefonen (clip bryter ikke sticky) */
html, body { overflow-x: clip; }

/* Nødnummer – kompakt: tre små kort og skipatruljen i full bredde */
.nod-box:empty { display: none; }
.nod-title { display: flex; align-items: center; gap: 6px; }
.nod-title .ico { width: 16px; height: 16px; color: var(--danger); }
.nod-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.nod { border-radius: 14px; padding: 8px 6px 9px; text-align: center; color: #fff; box-shadow: 0 6px 16px rgba(0, 0, 0, .22); display: flex; flex-direction: column; align-items: center; justify-content: center; }
.nod-politi { background: #3a63e0; }
.nod-brann { background: #c93a32; }
.nod-ambulanse { background: #3f9a52; }
.nod-skipatrulje { background: #d8622b; grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; padding: 9px 14px; text-align: left; }
.nod-navn { font-weight: 600; font-size: 13px; opacity: .95; }
.nod-navn small { font-weight: 500; font-size: 11px; opacity: .85; }
.nod-nr { display: block; color: #fff; text-decoration: none; font-weight: 800; letter-spacing: -.01em; font-size: 24px; line-height: 1.1; }
.nod-skipatrulje .nod-nr { font-size: 17px; }
.nod-skipatrulje .nod-navn { flex: 1 0 100%; }
.nod-nr:active { opacity: .7; }
.nod-adr { font-size: 12px; color: var(--muted); margin: 8px 4px 0; }

/* Logo nederst */
.site-footer { display: flex; justify-content: center; padding: 34px 0 6px; }
.site-footer img { width: 120px; height: auto; opacity: .32; transition: opacity .2s; display: block; }
.site-footer a:active img { opacity: .6; }

/* Fnugg – forholdene i bakken */
.fnugg { padding: 14px 14px 16px; }
.fn-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 99px; }
.badge.open { background: rgba(127, 211, 160, .16); color: var(--ok); }
.badge.closed { background: rgba(255, 143, 122, .14); color: var(--danger); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: 0 0 auto; display: inline-block; }
.dot.on { background: var(--ok); box-shadow: 0 0 8px rgba(127, 211, 160, .7); }
.dot.off { background: var(--danger); opacity: .8; }
.fn-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.fn-stats > div { background: var(--sunk); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.fn-stats .n { font-size: 30px; font-weight: 300; color: var(--accent-text); line-height: 1.1; }
.fn-stats .n small { font-size: 16px; color: var(--muted); }
.fn-stats .l { font-size: 12px; color: var(--muted); }
.fn-desc { margin: 12px 2px 0; color: var(--snow); font-style: italic; }
.fn-zones { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.zone { background: var(--sunk); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.zone h4 { margin: 0; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.zone-temp { font-size: 32px; font-weight: 200; letter-spacing: -.03em; margin: 2px 0 4px; }
.zone-row { font-size: 15px; margin-top: 6px; }
.zone-sub { font-size: 11px; color: var(--muted); }
.status-list { list-style: none; padding: 0; }
.status-list li { display: flex; align-items: center; gap: 10px; padding: 8px 4px; font-size: 15px; }
.status-list li + li { border-top: 1px solid var(--line); }
.status-list .grow { flex: 1; min-width: 0; }
.status-list .st { font-size: 12px; color: var(--muted); }
.diff { width: 10px; height: 10px; border-radius: 2px; flex: 0 0 auto; }
.diff-green { background: #3fae5a; } .diff-blue { background: #3a7be0; } .diff-red { background: #d43b35; } .diff-black { background: #111; border: 1px solid #666; }

/* Frisbeegolf */
.fg-hero h3 { margin: 4px 0 10px; font-size: 22px; letter-spacing: -.01em; }
.fg-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 99px; background: var(--chip); border: 1px solid var(--line); color: var(--snow); }
.fg-facts { margin-top: 10px; }
.fg-facts .n { font-size: 24px; }
.fg-vind-naa { font-size: 20px; }
.fg-vurdering { margin: 4px 0 10px; color: var(--snow); font-size: 14px; }
.fg-strip { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.fg-h { text-align: center; background: var(--sunk); border: 1px solid var(--line); border-radius: 10px; padding: 6px 2px; }
.fg-h .t { font-size: 11px; color: var(--muted); }
.fg-h .w { font-size: 14px; font-weight: 600; }
.swatch { width: 14px; height: 14px; border-radius: 50%; flex: 0 0 auto; border: 1px solid var(--line); }
/* Seks faner: litt strammere tekst */
.tabbar a span { font-size: 10px; letter-spacing: -.02em; white-space: nowrap; }

/* Kart */
.top-actions { display: flex; gap: 2px; align-items: center; }
.kart-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: -4px 0 12px; }
.kart-chips:empty { display: none; }
.kart-chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border-radius: 99px; text-decoration: none; color: var(--night); background: linear-gradient(135deg, var(--amber), var(--amber-2)); font-weight: 700; font-size: 14px; box-shadow: 0 4px 14px rgba(243, 181, 97, .25); }
.kart-chip .ico { width: 18px; height: 18px; }
.kart-kort-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kart-kort { display: flex; flex-direction: column; text-decoration: none; color: var(--text); background: var(--glass); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.kart-thumb { display: block; aspect-ratio: 4 / 3; background: #dfe7ef; overflow: hidden; }
.kart-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.kart-navn { font-weight: 700; font-size: 15px; padding: 10px 12px 0; }
.kart-besk { font-size: 12px; color: var(--muted); padding: 2px 12px 12px; }
.kartviewer { position: fixed; inset: 0; z-index: 40; background: #050c18; display: flex; flex-direction: column; }
.kartviewer[hidden] { display: none; }
.kv-bar { display: flex; align-items: center; gap: 10px; padding: calc(var(--safe-t) + 8px) 12px 8px; background: rgba(8, 20, 38, .95); border-bottom: 1px solid var(--line); }
.kv-bar strong { flex: 1; font-size: 17px; }
.kv-actions { display: flex; gap: 6px; }
.kv-btn { width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: rgba(255, 255, 255, .08); color: var(--snow); font-size: 20px; font-weight: 600; cursor: pointer; }
.kv-scroll { flex: 1; position: relative; overflow: hidden; background: #dfe7ef; touch-action: none; user-select: none; -webkit-user-select: none; }
.kv-scroll img { position: absolute; left: 0; top: 0; width: auto; height: auto; max-width: none; max-height: none; transform-origin: 0 0; will-change: transform; pointer-events: none; -webkit-user-drag: none; }
.kv-links { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 10px 12px calc(var(--safe-b) + 10px); background: rgba(8, 20, 38, .95); border-top: 1px solid var(--line); }
.kv-links a { color: var(--accent-text); text-decoration: none; font-weight: 600; font-size: 14px; padding: 6px 10px; border-radius: 99px; background: rgba(255, 255, 255, .06); }

/* Sommer: tre like seksjoner */
.sommer-nav { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: -4px 0 4px; }
.sommer-chip { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 14px; font: inherit; font-size: 13px; font-weight: 700; color: var(--snow); background: var(--glass); border: 1px solid var(--line); cursor: pointer; }
.sommer-chip .ico { width: 26px; height: 26px; color: var(--accent-text); }
.aktivitet { margin-top: 30px; scroll-margin-top: calc(var(--safe-t) + 96px); }
.akt-top { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.akt-ico { width: 52px; height: 52px; border-radius: 14px; display: grid; place-content: center; background: rgba(243, 181, 97, .14); border: 1px solid rgba(243, 181, 97, .35); color: var(--accent-text); flex: 0 0 auto; }
.akt-ico .ico { width: 30px; height: 30px; }
.akt-top h3 { margin: 0; font-size: 24px; letter-spacing: -.01em; }
.akt-under { margin: 2px 0 0; font-size: 13px; color: var(--muted); }
.akt-hvor { margin-top: 10px; }
.akt-hvor p { margin: 0; font-size: 14px; }
.akt-sub { font-size: 12px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin: 18px 4px 8px; font-weight: 600; }

/* Stolpejakten */
.sj-top { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: end; }
.sj-n { font-size: 40px; font-weight: 300; color: var(--accent-text); line-height: 1; }
.sj-sesong { font-size: 17px; font-weight: 700; }
.sj .l { font-size: 12px; color: var(--muted); }
.sj-tekst { margin: 12px 0 4px; color: var(--snow); font-size: 14px; }
.sj-steps { margin: 4px 0 8px; }
.sj-steps p { color: var(--text); }
.sj-farger { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 10px; }
.sj-farge { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.sj-farge .sub { font-size: 12px; color: var(--muted); }

/* Meteogram */
.meteogram { padding: 12px 0 10px; }
.mg-wrap { position: relative; }
.mg-scroll { overflow-x: auto; overflow-y: hidden; padding: 0 12px 0 34px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.mg-scroll::-webkit-scrollbar { display: none; }
.mg-scroll svg { display: block; }
.mg-akse { position: absolute; left: 0; top: 0; bottom: 0; width: 34px; pointer-events: none; background: linear-gradient(90deg, var(--mg-akse) 70%, var(--mg-akse-0)); border-radius: var(--radius) 0 0 var(--radius); }
.mg-akse span { position: absolute; left: 8px; font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.mg-sym { font-size: 16px; }
.mg-dag { font-size: 11px; fill: var(--muted); font-weight: 600; text-transform: capitalize; }
.mg-verdi { font-size: 12px; font-weight: 700; fill: var(--text); }
.mg-liten { font-size: 11px; fill: var(--muted); font-variant-numeric: tabular-nums; }
.mg-liten.wind-strong { fill: var(--accent-text); } .mg-liten.wind-danger { fill: var(--danger); }
.mg-tip { position: absolute; top: 34px; z-index: 2; display: flex; flex-direction: column; gap: 2px; padding: 8px 10px; border-radius: 10px; background: rgba(5, 12, 24, .94); border: 1px solid var(--line); font-size: 13px; white-space: nowrap; box-shadow: 0 8px 20px rgba(0, 0, 0, .35); pointer-events: none; }
.mg-forklaring { margin: 8px 14px 0; font-size: 11px; color: var(--muted); line-height: 1.6; }
.mg-key { display: inline-block; width: 12px; height: 3px; border-radius: 2px; vertical-align: middle; margin: 0 4px 0 2px; }
.mg-tip[hidden] { display: none; }
.mg-dag { font-size: 11px; fill: var(--text); font-weight: 700; text-transform: capitalize; }
.mg-tid { font-size: 12px; font-weight: 600; fill: var(--snow); font-variant-numeric: tabular-nums; }
.mg-dag { font-size: 12px; }

/* ================= Lyst tema =================
   Aktiveres med data-theme="light" på <html> (settes av valget under Info → Utseende).
   Toppen forblir mørkeblå: iPhone viser alltid hvit klokke/batteri øverst i app-modus. */
:root[data-theme="light"] {
  --bg: #eef2f7;
  --glass: rgba(255, 255, 255, .92);
  --glass-strong: rgba(255, 255, 255, .97);
  --line: rgba(20, 50, 90, .12);
  --text: #13233a;
  --muted: #5a6b82;
  --snow: #1d2f47;
  --ok: #1f8a4c;
  --rain: #1f6fc2;
  --sunk: rgba(20, 50, 90, .045);
  --chip: rgba(20, 50, 90, .07);
  --bar: rgba(255, 255, 255, .92);
  --shadow: rgba(20, 40, 70, .08);
  --danger: #c43d27;
  --accent-text: #a65a00;
  --mg-grid: rgba(20, 50, 90, .08);
  --mg-null: rgba(20, 50, 90, .30);
  --mg-dag: rgba(20, 50, 90, .25);
  --mg-tidslinje: rgba(20, 50, 90, .06);
  --mg-akse: rgba(255, 255, 255, .96);
  --mg-akse-0: rgba(255, 255, 255, 0);
  --mg-ring: #ffffff;
  color-scheme: light;
}
[data-theme="light"] body::before { background: linear-gradient(180deg, #e7edf5 0%, #f4f7fb 60%, #eef2f7 100%); }
[data-theme="light"] .card, [data-theme="light"] .hour, [data-theme="light"] .fact, [data-theme="light"] .man-tile,
[data-theme="light"] .man-sec, [data-theme="light"] .kart-kort, [data-theme="light"] .sommer-chip {
  backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: 0 1px 2px rgba(20, 40, 70, .06), 0 6px 18px var(--shadow);
}

/* Mørk topplinje også i lyst tema (egne mørke variabler innenfor) */
[data-theme="light"] .topbar {
  --text: #f1f5fb; --muted: #a9bbd3; --snow: #e6eef8; --accent-text: #ffcf87; --line: rgba(190, 215, 245, .14);
  background: rgba(11, 28, 51, .96); border-bottom: 1px solid rgba(0, 0, 0, .2);
  backdrop-filter: saturate(150%) blur(16px); -webkit-backdrop-filter: saturate(150%) blur(16px);
}
[data-theme="light"] .topbar h1 { color: #f1f5fb; }

/* Toppbildet glir over i lys bakgrunn; teksten om været blir mørk */
[data-theme="light"] .hero::after { background: linear-gradient(180deg, rgba(238, 242, 247, 0) 38%, rgba(238, 242, 247, .82) 64%, #eef2f7 86%); }
[data-theme="light"] .weather-now .temp, [data-theme="light"] .weather-now .meta { text-shadow: none; color: var(--text); }
[data-theme="light"] .weather-now .big-ico { filter: none; }

/* Menylinjen */
[data-theme="light"] .tabbar { border-top-color: var(--line); box-shadow: 0 -4px 16px rgba(20, 40, 70, .06); }
[data-theme="light"] .tabbar .ico { opacity: .8; }

/* Komponenter som alltid er mørke (kartvisning, detaljboks, bildevisning) */
.kartviewer, .mg-tip, .lightbox {
  --text: #f1f5fb; --muted: #a9bbd3; --snow: #e6eef8; --accent-text: #ffcf87; --line: rgba(190, 215, 245, .14); --chip: rgba(255, 255, 255, .08);
  color: var(--text);
}

/* Logoen er lys – gjør den mørk på lys bakgrunn */
[data-theme="light"] .site-footer img { filter: brightness(.18); opacity: .45; }

/* Valg av utseende */
.tema-valg { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 4px; border-radius: 12px; background: var(--sunk); border: 1px solid var(--line); margin-top: 6px; }
.tema-valg button { font: inherit; font-size: 14px; font-weight: 600; padding: 9px 4px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; }
.tema-valg button[aria-pressed="true"] { background: var(--glass-strong); color: var(--text); box-shadow: 0 1px 4px var(--shadow); }
[data-theme="light"] .weather-now { background: none; box-shadow: none; border: 0; }

/* Apparatikoner i manualene */
.man-tile-ico { display: grid; place-items: center; height: 40px; color: var(--accent-text); }
.man-tile-ico .ico { width: 36px; height: 36px; stroke-width: 1.5; }
.man-ico { color: var(--accent-text); }
.man-ico .ico { width: 34px; height: 34px; stroke-width: 1.5; }

/* Forklaring til tallene på illustrasjonene */
.fig-legend { list-style: none; margin: 10px 0 4px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; }
.fig-legend li { display: flex; gap: 8px; align-items: flex-start; font-size: 13px; line-height: 1.3; color: var(--snow); }
.fl-nr { flex: 0 0 26px; width: 26px; height: 22px; padding: 0; border-radius: 11px; display: grid; place-content: center; font-size: 12px; font-weight: 700; color: var(--accent-text); background: rgba(243, 181, 97, .14); border: 1px solid rgba(243, 181, 97, .35); }
@media (max-width: 360px) { .fig-legend { grid-template-columns: 1fr; } }
