/* Båtapp – lys standard med blå fremheving, mørk instrumentvariant */
:root {
  --bg: #eef2f7;
  --surface: #ffffff;
  --surface-2: #f6f8fb;
  --fg: #14233a;
  --fg-strong: #0f2142;
  --muted: #5f7086;
  --line: #e1e7ef;
  --line-strong: #c9d3e0;
  --accent: #1f4fd1;
  --accent-fg: #ffffff;
  --accent-soft: #e6edff;
  --accent-soft-fg: #1f4fd1;
  --on-accent-muted: #c9d7ff;
  --fuel: #b25e00;
  --fuel-soft: #fff1dd;
  --service: #147a4b;
  --service-soft: #e3f5ec;
  --danger: #c0262d;
  --danger-soft: #fdeceb;
  --shadow: 0 1px 2px rgba(15, 33, 66, .06);
  --shadow-accent: 0 10px 22px -12px rgba(31, 79, 209, .7);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --num: "Saira Condensed", "Arial Narrow", system-ui, sans-serif;
  --r: 14px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #070b0f; --surface: #0f171e; --surface-2: #121c24; --fg: #dbe7ee; --fg-strong: #ffffff;
    --muted: #7f95a3; --line: #1d2a33; --line-strong: #2b3a44;
    --accent: #ffb547; --accent-fg: #1b1203; --accent-soft: #18232c; --accent-soft-fg: #ffb547; --on-accent-muted: #5b4210;
    --fuel: #6fc3ff; --fuel-soft: #142533; --service: #5fd0a0; --service-soft: #11251d;
    --danger: #ff7a73; --danger-soft: #2a1414;
    --shadow: none; --shadow-accent: none;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #070b0f; --surface: #0f171e; --surface-2: #121c24; --fg: #dbe7ee; --fg-strong: #ffffff;
  --muted: #7f95a3; --line: #1d2a33; --line-strong: #2b3a44;
  --accent: #ffb547; --accent-fg: #1b1203; --accent-soft: #18232c; --accent-soft-fg: #ffb547; --on-accent-muted: #5b4210;
  --fuel: #6fc3ff; --fuel-soft: #142533; --service: #5fd0a0; --service-soft: #11251d;
  --danger: #ff7a73; --danger-soft: #2a1414;
  --shadow: none; --shadow-accent: none;
  color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--fg);
  font: 15px/1.45 var(--font);
  min-height: 100vh;
}
body.has-tabs { padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px)); }
a { color: var(--accent-soft-fg); }
img { max-width: 100%; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
code { font-size: 13px; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
:focus-visible { outline: 2.5px solid var(--accent); outline-offset: 2px; }

/* Topp */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
  padding-top: env(safe-area-inset-top, 0px);
}
.top-in {
  max-width: 760px; margin: 0 auto; display: flex; align-items: flex-end; gap: 10px;
  padding: 10px max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
}
.back { color: var(--accent-soft-fg); display: grid; place-items: center; width: 34px; height: 34px; margin-left: -8px; border-radius: 10px; flex: none; }
.ttl { flex: 1; min-width: 0; }
.ttl .sub { display: block; color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ttl h1 {
  margin: 0; font-family: var(--num); font-weight: 700; font-size: 30px; line-height: 1.05;
  letter-spacing: .01em; color: var(--fg-strong);
  text-wrap: balance; overflow-wrap: anywhere;
}
.acts { flex: none; display: flex; gap: 6px; padding-bottom: 2px; }
.pill {
  display: inline-block; background: var(--accent-soft); color: var(--accent-soft-fg); text-decoration: none;
  border-radius: 999px; padding: 7px 12px; font-weight: 600; font-size: 13px; white-space: nowrap;
}

.main {
  max-width: 760px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px;
  padding-block: 4px 24px;
  padding-left: max(14px, env(safe-area-inset-left, 0px)); padding-right: max(14px, env(safe-area-inset-right, 0px));
}
.flash { background: var(--accent-soft); color: var(--accent-soft-fg); border-radius: 12px; padding: 10px 14px; font-weight: 500; }
.err { color: var(--danger); background: var(--danger-soft); border-color: transparent !important; }
.err p { margin: 2px 0; }
.ok ul { margin: 6px 0 12px; padding-left: 18px; }

/* Kort */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  padding: 12px 14px; box-shadow: var(--shadow); min-width: 0;
}
.card.list { padding-block: 4px; }
.lbl { font-family: var(--num); font-size: 13px; text-transform: uppercase; letter-spacing: .09em; font-weight: 600; color: var(--muted); }
.row-h { display: flex; justify-content: space-between; align-items: center; padding-top: 6px; }
.lnk { font-size: 13px; font-weight: 600; text-decoration: none; }
.stack { display: flex; flex-direction: column; gap: 10px; }

.card.active { background: var(--accent); border-color: var(--accent); box-shadow: var(--shadow-accent); color: var(--accent-fg); }
.card.active .lbl { color: var(--on-accent-muted); }
.card.has-x { position: relative; }
.card.has-x .x-form { position: absolute; top: 8px; right: 8px; margin: 0; }
.card.has-x > .x-btn { position: absolute; top: 8px; right: 8px; }
.x-btn {
  display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; border: 0; cursor: pointer;
  background: color-mix(in srgb, var(--accent-fg) 16%, transparent); color: var(--accent-fg); text-decoration: none;
}
.x-btn:hover { background: color-mix(in srgb, var(--accent-fg) 28%, transparent); }
.card.active .h5 {
  display: block; margin-top: 2px; font-family: var(--num); font-size: 26px; font-weight: 700; letter-spacing: .02em;
  color: var(--accent-fg); text-decoration: none; line-height: 1.1;
}
.card.active .here { margin: 8px 0 0; font-size: 13.5px; color: var(--on-accent-muted); }
.card.active .here b { color: var(--accent-fg); }
.card.active .btn { background: var(--accent-fg); color: var(--accent); margin-top: 12px; }
.mini { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.mini b { display: block; font-family: var(--num); font-size: 32px; font-weight: 600; line-height: 1; }
.mini b small { font-size: 15px; margin-left: 3px; color: var(--on-accent-muted); font-weight: 500; }
.mini span { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--on-accent-muted); }
.startform { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.in.light { background: var(--surface); border-color: transparent; }
.in.light span { color: var(--accent-soft-fg); }

.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.quick.tre { grid-template-columns: repeat(3, 1fr); }

/* Hjem: Min Båt-toppen og kompakt kort for tur */
.brandikon { width: 52px; height: 52px; border-radius: 13px; flex: none; object-fit: cover; box-shadow: var(--shadow); align-self: center; }
.ttl.brand { align-self: center; }
.ttl.brand h1 { font-size: 36px; line-height: 1; }
.ttl.brand .sub { font-size: 14.5px; font-weight: 500; color: var(--muted); margin-top: 3px; }
.hjemkort { padding: 12px 14px; }
.hjemrad { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hjemsted { min-width: 0; color: inherit; text-decoration: none; }
.hjemsted b { display: block; font-size: 17px; font-weight: 600; margin-top: 2px; line-height: 1.25; text-wrap: balance; color: var(--accent-fg); }
.hjemknapp {
  flex: none; display: inline-block; border: 0; cursor: pointer; text-decoration: none;
  background: var(--accent-fg); color: var(--accent); border-radius: 10px; padding: 9px 14px;
  font: 700 14px var(--num); letter-spacing: .04em; text-transform: uppercase;
}
.hjemkort .startform { margin: 0; }
.hjemkort .here { margin-top: 4px; }
.hjemkort .mini b { font-size: 26px; }
.hjemkort .angre { margin: 8px 0 0; }
.hjemkort .angre button { background: none; border: 0; padding: 0; color: var(--on-accent-muted); font-size: 12.5px; text-decoration: underline; cursor: pointer; }

/* Innstillinger: appikon */
.ikonvalg { display: flex; align-items: center; gap: 14px; }
.ikonvalg img { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; box-shadow: var(--shadow); flex: none; background: var(--surface-2, #fff); }
.quick a {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 5px; padding: 10px 4px;
  font-size: 12.5px; font-weight: 600; color: var(--fg); text-decoration: none;
}

/* Knapper */
.btn {
  display: block; width: 100%; text-align: center; border: 0; cursor: pointer; text-decoration: none;
  background: var(--accent); color: var(--accent-fg); border-radius: 12px; padding: 12px 14px;
  font-family: var(--num); font-weight: 700; font-size: 18px; text-transform: uppercase; letter-spacing: .07em;
}
.btn.ghost { background: transparent; color: var(--accent-soft-fg); border: 1.5px solid var(--line-strong); }
.btn.danger { background: var(--danger); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--danger); border-color: var(--danger); }
.btnrow { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.danger-zone { margin-top: 18px; display: flex; flex-direction: column; gap: 6px; }

/* Lister */
.li {
  display: flex; align-items: center; gap: 11px; padding: 10px 0; border-bottom: 1px solid var(--line);
  color: inherit; text-decoration: none; min-width: 0;
}
.li:last-child { border-bottom: 0; }
.li .lt { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.li b { font-weight: 600; font-size: 14.5px; color: var(--fg-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li .lt > span { color: var(--muted); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.li i { font-style: normal; font-family: var(--num); font-weight: 600; font-size: 18px; color: var(--fg-strong); flex: none; }
.ic {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; flex: none;
  background: var(--accent-soft); color: var(--accent-soft-fg); font-weight: 700; font-size: 14px;
}
.thumbsm {
  width: 44px; height: 44px; border-radius: 10px; overflow: hidden; flex: none;
  background: var(--surface-2); display: grid; place-items: center;
}
.thumbsm img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pdfsm { background: var(--danger-soft); color: var(--danger); font: 700 11px var(--font); }
.ic.f { background: var(--fuel-soft); color: var(--fuel); }
.ic.v { background: var(--service-soft); color: var(--service); }
.ic.n { background: var(--surface-2); color: var(--muted); }
.ic.h { background: var(--accent); color: var(--accent-fg); }
.live { font-style: normal; font-size: 10px; font-family: var(--font); font-weight: 700; background: var(--accent); color: var(--accent-fg); border-radius: 5px; padding: 1px 6px; vertical-align: 2px; margin-left: 4px; }
.linkcard { display: flex; align-items: center; justify-content: space-between; gap: 10px; text-decoration: none; color: inherit; }
.linkcard b { color: var(--fg-strong); }
.big { font-family: var(--num); font-size: 21px; font-weight: 600; }
.chev { color: var(--muted); font-size: 22px; }

.yearhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 8px 2px 6px; flex-wrap: wrap; }
.yearhead h2 { margin: 0; font-family: var(--num); font-size: 26px; color: var(--fg-strong); }
.yearhead span { color: var(--muted); font-size: 13px; }

.search input, .filters select {
  width: 100%; font: inherit; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line);
  background: var(--surface); color: var(--fg);
}
.katvelger { display: flex; flex-direction: column; gap: 8px; }
.katvelger select:disabled { opacity: .45; }
.filters { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* Tur */
.sum { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.sum div { background: var(--accent); border-radius: 11px; padding: 8px 6px; text-align: center; color: var(--accent-fg); min-width: 0; }
.sum div.wide { grid-column: span 2; }
.sum b { display: block; font-family: var(--num); font-size: 22px; font-weight: 600; line-height: 1.1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sum span { font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--on-accent-muted); }
.facts { margin: -2px 2px 0; color: var(--muted); font-size: 13px; }

.seg { display: flex; background: var(--line); border-radius: 11px; padding: 3px; gap: 2px; }
.seg > * {
  flex: 1; text-align: center; padding: 8px 4px; border-radius: 9px; font: 600 13px var(--font); color: var(--muted);
  text-decoration: none; border: 0; background: transparent; cursor: pointer;
}
.seg .on { background: var(--surface); color: var(--fg-strong); box-shadow: 0 1px 2px rgba(0, 0, 0, .1); }

.map { height: 320px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); z-index: 1; }
.map.tall { height: min(62vh, 560px); }
.map.lav { height: 230px; }
.nyttsted { border: 1.5px solid var(--accent, #1f4fd1); }
.gpsrad { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.gpsrad .pill { cursor: pointer; }
.navneforslag { border: 1.5px solid var(--accent); margin-bottom: 12px; }
.navneforslag .knapper { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.navneforslag .knapper .btn { margin: 0; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.forslagrad { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: -4px 0 0; }
.forslagrad .pill { cursor: pointer; }
.leaflet-popup-content a { font-weight: 600; }

/* Skjema */
.form { gap: 9px; }
.in {
  display: block; background: var(--surface); border: 1.5px solid var(--accent); border-radius: 12px; padding: 7px 12px 6px;
}
.in.n { border-color: var(--line); }
.in > span { display: block; font-family: var(--num); color: var(--accent-soft-fg); font-size: 13px; text-transform: uppercase; letter-spacing: .09em; font-weight: 600; }
.in.n > span { color: var(--muted); }
.feltlenke { float: right; font: 600 12px var(--font); text-transform: none; letter-spacing: 0; color: var(--accent-soft-fg); text-decoration: none; }
.in input, .in select, .in textarea {
  width: 100%; border: 0; background: transparent; color: var(--fg-strong); padding: 2px 0; outline: none;
  font: 600 22px/1.25 var(--num); letter-spacing: .01em;
}
.in textarea { font: 15px/1.45 var(--font); resize: vertical; }
.in select { font-size: 19px; }
.in.file input { font: 13px var(--font); }
.in:focus-within { box-shadow: 0 0 0 3px var(--accent-soft); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.two > * { min-width: 0; }
.calc { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; text-align: center; }
.calc div { background: var(--accent-soft); border-radius: 10px; padding: 6px 0; }
.calc b { display: block; font-family: var(--num); font-size: 22px; color: var(--accent-soft-fg); font-weight: 600; }
.calc span { font-size: 10.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.chk { display: flex; align-items: center; gap: 9px; font-size: 14.5px; color: var(--fg); cursor: pointer; }
.chk input { width: 20px; height: 20px; accent-color: var(--accent); }
.chk.big { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font-weight: 600; }

.prev { border: 1.5px dashed var(--line-strong); border-radius: 12px; padding: 9px 12px; background: var(--surface-2); }
.prev summary { list-style: none; cursor: pointer; }
.prev summary::-webkit-details-marker { display: none; }
.prev summary .lbl em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--accent-soft-fg); margin-left: 6px; font-family: var(--font); font-size: 12px; }
.prevrow { display: grid; grid-template-columns: 1fr auto auto; gap: 14px; align-items: end; margin-top: 2px; }
.prevrow b { font-size: 15px; color: var(--fg-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.prevrow em { font-style: normal; font-family: var(--num); font-size: 20px; text-align: right; color: var(--fg-strong); line-height: 1.05; }
.prevrow em small { display: block; font-family: var(--font); font-size: 9.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }

/* Detaljer */
.kv { margin: 0; display: flex; flex-direction: column; }
.kv > div, .kv > a { display: flex; justify-content: space-between; gap: 14px; padding: 9px 0; border-bottom: 1px solid var(--line); color: inherit; text-decoration: none; }
.kv > :last-child { border-bottom: 0; }
.kv dt { color: var(--muted); flex: none; max-width: 48%; }
.kv dd { margin: 0; text-align: right; font-weight: 500; color: var(--fg-strong); min-width: 0; overflow-wrap: anywhere; }
.note-text { margin: 8px 0 2px; white-space: normal; }
.photo img { display: block; width: 100%; border-radius: var(--r); }
.stedbilde img { aspect-ratio: 4 / 3; max-height: 340px; object-fit: cover; background: var(--surface-2); }

/* Manualer */
.grid-man { display: grid; grid-template-columns: repeat(auto-fill, minmax(135px, 1fr)); gap: 8px; }
.manual { position: relative; padding: 0; }
.manual { overflow: hidden; }
.man-link { display: flex; flex-direction: column; gap: 8px; padding: 0 0 12px; text-decoration: none; color: inherit; height: 100%; }
.man-link b { color: var(--fg-strong); font-size: 14px; overflow-wrap: anywhere; padding: 0 12px; line-height: 1.3; }
.thumb {
  position: relative; display: block; aspect-ratio: 4 / 3; max-width: 100%;
  background: var(--surface-2); border-bottom: 1px solid var(--line); overflow: hidden;
}
.thumb img, .thumb canvas { display: block; width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.thumb canvas:not(.ready) { opacity: 0; }
.thumb canvas.ready { opacity: 1; transition: opacity .3s; height: auto; min-height: 100%; }
.thumb canvas.failed { display: none; }
.nofile { position: absolute; inset: 0; display: grid; place-items: center; color: var(--muted); font-size: 12px; }
.pdf { position: absolute; left: 8px; bottom: 8px; font: 700 10.5px var(--font); background: var(--danger); color: #fff; border-radius: 5px; padding: 2px 6px; }
.manual { display: flex; flex-direction: column; }
.manual .man-link { flex: 1; padding-bottom: 6px; }
.man-edit {
  align-self: flex-start; margin: 0 12px 10px; font-size: 12.5px; font-weight: 600;
  color: var(--muted); text-decoration: none; padding: 2px 0;
}
.man-edit:hover { color: var(--accent-soft-fg); }

/* Diagrammer */
.bars { display: flex; flex-direction: column; gap: 4px; margin-top: 8px; }
.bar-row { display: grid; grid-template-columns: 46px 1fr 52px; gap: 8px; align-items: center; font-size: 13px; }
.bar-row b { text-align: right; font-family: var(--num); font-size: 16px; }
.bar { height: 9px; background: var(--surface-2); border-radius: 5px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.readout { font-family: var(--num); font-size: 15px; font-weight: 600; color: var(--accent-soft-fg); }
.linechart { margin-top: 6px; }
.endretall { margin-top: 6px; }
.endretall summary {
  cursor: pointer; font-size: 12.5px; font-weight: 600; color: var(--muted); padding: 4px 0; list-style: none;
}
.endretall summary::-webkit-details-marker { display: none; }
.endretall summary::after { content: " ›"; }
.endretall[open] summary::after { content: " ⌄"; }
.linechart svg { display: block; width: 100%; height: auto; max-width: 100%; touch-action: pan-y; cursor: crosshair; }
.linechart .grid { stroke: var(--line); stroke-width: 1; }
.linechart .tick { stroke: var(--line-strong); stroke-width: 1; }
.linechart .ylab { fill: var(--muted); font: 10px var(--font); text-anchor: end; }
.linechart .xlab { fill: var(--muted); font: 10px var(--font); text-anchor: middle; }
.linechart .axtitle { fill: var(--muted); font: 600 9.5px var(--font); }
.linechart .area { fill: var(--accent); opacity: .12; }
.linechart .line { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linejoin: round; stroke-linecap: round; }
.linechart .dot { fill: var(--surface); stroke: var(--accent); stroke-width: 1.6; }
.linechart .cursor { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 3 3; }
.linechart .cursor-dot { fill: var(--accent); stroke: var(--surface); stroke-width: 2; }
.vbars { display: flex; gap: 8px; align-items: flex-end; height: 170px; margin-top: 10px; }
.vbar { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; height: 100%; min-width: 0; }
.vbar .col { flex: 1; width: 100%; display: flex; align-items: flex-end; }
.vbar .col i { display: block; width: 100%; background: var(--accent); border-radius: 6px 6px 2px 2px; }
.vbar .v { font-family: var(--num); font-size: 14px; color: var(--fg-strong); white-space: nowrap; }
.vbar .y { font-size: 12px; color: var(--muted); }
.tablewrap { overflow-x: auto; padding: 0; }
.tbl { border-collapse: collapse; width: 100%; font-size: 13.5px; white-space: nowrap; }
.tbl th, .tbl td { padding: 8px 10px; text-align: right; border-bottom: 1px solid var(--line); }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl th { font-family: var(--num); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }
.tbl.avst { white-space: normal; }
.tbl.avst td { vertical-align: top; }
.tbl.avst td small { display: block; font-size: 11px; color: var(--muted); font-weight: 400; }
.tbl.avst td.sted { min-width: 0; }
.tbl.avst td.sted a { color: var(--fg-strong); font-weight: 600; text-decoration: none; }
.tbl.avst td b { font-family: var(--num); font-size: 18px; color: var(--fg-strong); }
.filelist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.filelist .yes { color: var(--service); }
.filelist .no { color: var(--muted); }

/* Faner */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
  background: var(--surface); border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr));
  padding: 7px max(2px, env(safe-area-inset-right, 0px)) calc(8px + env(safe-area-inset-bottom, 0px)) max(2px, env(safe-area-inset-left, 0px));
}
.tabbar a { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 500; color: var(--muted); text-decoration: none; padding: 2px 0; min-width: 0; white-space: nowrap; }
.tabbar svg { width: 22px; height: 22px; flex: none; }
.tabbar a.on { color: var(--accent-soft-fg); }

/* PC: menyen ligger i venstre kant */
@media (min-width: 900px) {
  body.has-tabs { padding-bottom: 24px; padding-left: 96px; }
  .tabbar {
    top: 0; right: auto; width: 84px; grid-template-columns: 1fr; grid-auto-rows: 70px; align-content: start;
    border-top: 0; border-right: 1px solid var(--line); padding-top: calc(18px + env(safe-area-inset-top, 0px));
  }
  .quick { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 380px) {
  .sum b { font-size: 19px; }
  .mini b { font-size: 27px; }
}
@media (prefers-reduced-motion: no-preference) {
  .li, .quick a, .btn { transition: opacity .15s, transform .15s; }
  .quick a:active, .btn:active { transform: scale(.98); }
}

/* Lesetilgang: skjul alt som registrerer, endrer eller sletter (serveren stopper det uansett) */
.lesetilgang form[method="post"]:not([data-tillat]) :is(button, .btn, .file, .chk, .x-btn),
.lesetilgang .startform,
.lesetilgang a:is(.pill, .btn, .x-btn, .man-edit):is([href*="s=ny"], [href*="s=tur_rediger"], [href*="s=manual&"], [href$="s=manual"], [href*="s=batinfo_rediger"], [href$="s=kontakt"], [href*="endre=1"]) {
  display: none !important;
}
.lesetilgang a.bi { pointer-events: none; }
.lesetilgang form[method="post"]:not([data-tillat]) p.muted { display: none; }
.lesetilgang form[method="post"]:not([data-tillat]) ::placeholder { color: transparent; }
.lesetilgang form[method="post"]:not([data-tillat]) :is(input, select, textarea):disabled { opacity: 1; color: var(--fg-strong); -webkit-text-fill-color: var(--fg-strong); }
.brukerrad { display: flex; flex-direction: column; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.brukerrad:first-of-type { border-top: 0; padding-top: 4px; }
.brukerrad .navn { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.brukerrad .navn b { color: var(--fg-strong); font-size: 16px; }
.rolle { font-size: 12px; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--accent-soft); color: var(--accent-soft-fg); }
.rolle.les { background: var(--surface-2); color: var(--muted); }
.brukerrad details summary { cursor: pointer; font-size: 13px; font-weight: 600; color: var(--accent-soft-fg); list-style: none; }
.brukerrad details summary::-webkit-details-marker { display: none; }
.brukerrad details[open] summary { margin-bottom: 8px; }
