/* ==========================================================================
   Isehaug Oppgjør — designsystem
   Mobil-først: botnmeny under 700px, sidebar over.
   ========================================================================== */

:root {
  color-scheme: dark;

  --bg:            #12100e;
  --bg-2:          #1a1714;
  --surface:       #1f1b17;
  --surface-2:     #262119;
  --surface-3:     #2f2820;
  --line:          #383026;
  --line-soft:     #2b241d;

  --text:          #f3ece2;
  --text-2:        #bdb0a0;
  --text-3:        #8b8073;

  --accent:        #e0a44a;
  --accent-ink:    #2a1c05;
  --accent-soft:   rgba(224,164,74,.14);

  --pos:           #46c07a;
  --pos-soft:      rgba(70,192,122,.14);
  --neg:           #ef5f5f;
  --neg-soft:      rgba(239,95,95,.14);
  --warn:          #e6b13c;
  --warn-soft:     rgba(230,177,60,.14);
  --info:          #64a8e8;
  --info-soft:     rgba(100,168,232,.14);

  --r-sm: 8px;
  --r:    14px;
  --r-lg: 20px;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px -12px rgba(0,0,0,.7);

  --tap: 46px;
  --pad: 16px;
  --maxw: 1180px;

  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", "Segoe UI Mono", Menlo, monospace;

  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
}

html[data-tema="lys"] {
  color-scheme: light;
  --bg:            #f6f2ea;
  --bg-2:          #efe9de;
  --surface:       #ffffff;
  --surface-2:     #f7f2e9;
  --surface-3:     #efe7d9;
  --line:          #ded3c1;
  --line-soft:     #eae1d2;
  --text:          #241d14;
  --text-2:        #5f5648;
  --text-3:        #8b8073;
  --accent:        #b9781a;
  --accent-ink:    #ffffff;
  --accent-soft:   rgba(185,120,26,.12);
  --pos:           #1c8b4d;
  --pos-soft:      rgba(28,139,77,.12);
  --neg:           #c5342f;
  --neg-soft:      rgba(197,52,47,.12);
  --warn:          #9a6f10;
  --warn-soft:     rgba(154,111,16,.14);
  --info:          #1f6fb2;
  --info-soft:     rgba(31,111,178,.12);
  --shadow: 0 1px 2px rgba(60,45,20,.08), 0 10px 24px -16px rgba(60,45,20,.35);
}

* { box-sizing: border-box; }
/* display frå eigne klasser (t.d. .btn) slår ut [hidden] frå nettlesaren — difor denne */
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  min-height: 100dvh;
  overscroll-behavior-y: none;
  -webkit-tap-highlight-color: transparent;
}

h1,h2,h3,h4 { margin: 0; line-height: 1.2; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0 0 .6em; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
svg { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }

/* ---------- Topbar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  padding-top: var(--safe-t);
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line-soft);
}
.topbar-inner {
  max-width: var(--maxw); margin: 0 auto;
  height: 56px; padding: 0 var(--pad);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-mark { width: 30px; height: 30px; flex: none; }
.bm-body { fill: var(--accent-soft); stroke: var(--accent); }
.bm-lid  { stroke: var(--accent); }
.bm-coin { fill: none; stroke: var(--accent); stroke-width: 1.6; }
.brand-txt { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
.brand-txt strong { font-size: 15px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand-txt span { font-size: 11px; color: var(--text-3); text-transform: uppercase; letter-spacing: .1em; }
.topbar-actions { display: flex; gap: 6px; }

/* Synkstatus */
.synkstatus {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 6px 11px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12px; font-weight: 600; color: var(--text-2);
  white-space: nowrap; cursor: pointer; transition: .14s;
}
.synkstatus:hover { border-color: var(--accent); color: var(--accent); }
.synkstatus i { width: 8px; height: 8px; border-radius: 50%; background: var(--text-3); flex: none; }
.synkstatus.pos  i { background: var(--pos); }
.synkstatus.warn i { background: var(--warn); }
.synkstatus.neg  i { background: var(--neg); }
.synkstatus.info i { background: var(--info); animation: puls 1.1s ease-in-out infinite; }
@keyframes puls { 50% { opacity: .25; } }
@media (max-width: 480px) { .topbar .synkstatus span { display: none; } .topbar .synkstatus { padding: 6px 9px; } }

.icon-btn {
  width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; transition: .15s;
}
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { background: var(--surface-2); border-color: var(--accent); color: var(--accent); }

/* ---------- Layout ---------- */
.view {
  max-width: var(--maxw); margin: 0 auto;
  padding: var(--pad) var(--pad) calc(84px + var(--safe-b));
  outline: none;
}
@media (min-width: 700px) {
  .view { padding-bottom: 40px; }
}

.pagehead { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.pagehead h1 { font-size: 22px; }
.pagehead .sub { color: var(--text-3); font-size: 13px; margin-top: 2px; }

.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: 1fr 1fr; }
.g3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 620px) { .g3 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1180px) {
  .split { display: grid; grid-template-columns: minmax(0,1fr) 340px; gap: 18px; align-items: start; }
  .sticky-side { position: sticky; top: 16px; }
}

/* ---------- Kort ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line-soft);
  border-radius: var(--r);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card + .card { margin-top: 12px; }
.card-h {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 12px 14px; border-bottom: 1px solid var(--line-soft);
  background: var(--surface-2);
}
.card-h h2, .card-h h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-2); font-weight: 650; }
.card-b { padding: 14px; }
.card-b.tight { padding: 6px 0; }

/* ---------- KPI ---------- */
.kpi {
  background: var(--surface); border: 1px solid var(--line-soft);
  border-radius: var(--r); padding: 12px 13px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 3px; min-width: 0;
}
.kpi .k-lbl { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-val { font-size: clamp(19px, 5.2vw, 25px); font-weight: 700; letter-spacing: -.02em; }
.kpi .k-sub { font-size: 12px; color: var(--text-3); }
.kpi.hero { background: linear-gradient(160deg, var(--surface-2), var(--surface)); }

.pos { color: var(--pos); }
.neg { color: var(--neg); }
.muted { color: var(--text-3); }

.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.pill.pos { background: var(--pos-soft); color: var(--pos); }
.pill.neg { background: var(--neg-soft); color: var(--neg); }
.pill.warn { background: var(--warn-soft); color: var(--warn); }
.pill.info { background: var(--info-soft); color: var(--info); }
.pill.accent { background: var(--accent-soft); color: var(--accent); }

/* ---------- Knappar ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: var(--tap); padding: 0 16px;
  border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text);
  font-weight: 600; font-size: 15px; cursor: pointer;
  transition: .14s; white-space: nowrap;
}
.btn svg { width: 18px; height: 18px; }
.btn:hover { border-color: var(--accent); color: var(--accent); }
.btn:active { transform: scale(.985); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { filter: brightness(1.07); color: var(--accent-ink); }
.btn.ghost { background: transparent; }
.btn.sm { min-height: 34px; padding: 0 11px; font-size: 13px; border-radius: 9px; }
.btn.danger { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 40%, var(--line)); }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .45; pointer-events: none; }
.btnrow { display: flex; gap: 8px; flex-wrap: wrap; }

.seg {
  display: inline-flex; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 11px; padding: 3px; gap: 3px; overflow-x: auto; max-width: 100%;
}
.seg button {
  border: 0; background: transparent; color: var(--text-2);
  padding: 7px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap;
}
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---------- Skjema ---------- */
.field { display: flex; flex-direction: column; gap: 5px; }
.field > label, .lbl { font-size: 12px; color: var(--text-2); font-weight: 600; }
.hint { font-size: 12px; color: var(--text-3); }

input[type="text"], input[type="date"], input[type="number"], input[type="month"], select, textarea {
  width: 100%; min-height: var(--tap);
  background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 11px; padding: 10px 12px;
  transition: border-color .14s, box-shadow .14s;
}
textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
input::placeholder { color: var(--text-3); }
select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 17px) calc(50% + 1px), calc(100% - 12px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat;
  padding-right: 34px;
}
input.kr { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
input.readonly, input:disabled { background: var(--bg-2); color: var(--text-3); }

/* Beløpsrad — kjernen i oppgjørsskjemaet */
.line {
  display: grid; grid-template-columns: 1fr 96px 132px; gap: 8px; align-items: center;
  padding: 8px 14px; border-bottom: 1px solid var(--line-soft);
}
.line:last-child { border-bottom: 0; }
.line .l-txt { font-size: 14px; min-width: 0; }
.line .l-txt small { display: block; color: var(--text-3); font-size: 11.5px; }
.line input { min-height: 42px; padding: 8px 10px; }
.line .ref { font-size: 13px; }
@media (max-width: 560px) {
  .line { grid-template-columns: 1fr 84px; grid-template-areas: "txt ref" "amt amt"; gap: 6px 8px; padding: 10px 12px; }
  .line .l-txt { grid-area: txt; }
  .line .ref { grid-area: ref; }
  .line .amt { grid-area: amt; }
}
.line.total {
  background: var(--surface-2); font-weight: 700;
  grid-template-columns: 1fr 132px; padding: 11px 14px;
}
.line.total .l-txt { font-size: 14px; }
.line.total .val { text-align: right; font-variant-numeric: tabular-nums; font-size: 16px; }
@media (max-width: 560px) { .line.total { grid-template-columns: 1fr auto; grid-template-areas: "txt val"; } .line.total .val { grid-area: val; } }

.subhead {
  padding: 11px 14px 7px; font-size: 12px; font-weight: 700;
  text-transform: uppercase; letter-spacing: .07em; color: var(--text-3);
  border-bottom: 1px solid var(--line-soft); background: var(--bg-2);
}

/* ---------- Differanse-banner ---------- */
.diffbox {
  border-radius: var(--r); padding: 16px; text-align: center;
  border: 1px solid var(--line); background: var(--surface);
}
.diffbox.ok   { background: var(--pos-soft); border-color: color-mix(in srgb, var(--pos) 45%, transparent); }
.diffbox.avvik{ background: var(--neg-soft); border-color: color-mix(in srgb, var(--neg) 45%, transparent); }
.diffbox .d-lbl { font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--text-2); }
.diffbox .d-val { font-size: clamp(28px, 8vw, 40px); font-weight: 750; letter-spacing: -.03em; line-height: 1.1; margin: 2px 0; }
.diffbox .d-sub { font-size: 13px; color: var(--text-2); }

/* ---------- Tabellar ---------- */
.tblwrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; white-space: nowrap; }
table.tbl th, table.tbl td { padding: 9px 11px; text-align: right; border-bottom: 1px solid var(--line-soft); }
table.tbl th {
  position: sticky; top: 0; z-index: 2;
  background: var(--surface-2); color: var(--text-3);
  font-size: 11px; text-transform: uppercase; letter-spacing: .05em; font-weight: 650;
}
table.tbl th:first-child, table.tbl td:first-child { text-align: left; }
table.tbl td.num, table.tbl th.num { font-variant-numeric: tabular-nums; }
table.tbl tbody tr:hover { background: var(--surface-2); }
table.tbl tr.helg td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
table.tbl tr.sumrow td { font-weight: 700; background: var(--surface-2); border-top: 2px solid var(--line); }
table.tbl td.tag { color: var(--accent); font-size: 12px; }

.listrow {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px; border-bottom: 1px solid var(--line-soft);
  cursor: pointer; transition: background .12s;
}
.listrow:last-child { border-bottom: 0; }
.listrow:hover { background: var(--surface-2); }
.listrow .lr-main { flex: 1; min-width: 0; }
.listrow .lr-t { font-weight: 600; font-size: 14.5px; }
.listrow .lr-s { font-size: 12px; color: var(--text-3); }
.listrow .lr-r { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Diverse ---------- */
.empty { text-align: center; padding: 42px 20px; color: var(--text-3); }
.empty svg { width: 42px; height: 42px; opacity: .5; margin-bottom: 10px; }

.varsel {
  display: flex; gap: 10px; padding: 11px 13px; border-radius: 12px;
  font-size: 13.5px; line-height: 1.4; border: 1px solid transparent;
}
.varsel svg { width: 17px; height: 17px; flex: none; margin-top: 2px; }
.varsel.info  { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 30%, transparent); }
.varsel.warn  { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.varsel.error { background: var(--neg-soft);  color: var(--neg);  border-color: color-mix(in srgb, var(--neg) 30%, transparent); }
.varsel.ok    { background: var(--pos-soft);  color: var(--pos);  border-color: color-mix(in srgb, var(--pos) 30%, transparent); }
.varsel + .varsel { margin-top: 8px; }
.varsel strong { font-weight: 700; }

/* Telleblokk */
.tellegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: 8px; }
.telle {
  display: flex; align-items: center; gap: 8px; padding: 7px 9px;
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 11px;
}
.telle .t-val { font-weight: 700; font-size: 13px; width: 46px; color: var(--accent); }
.telle input { min-height: 36px; padding: 5px 7px; text-align: center; font-weight: 600; }
.telle .t-sum { font-size: 11.5px; color: var(--text-3); min-width: 54px; text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Hovudnavigasjon ----------
   Mobil (< 900px): fast linje nedst — der tommelen når.
   PC   (≥ 900px): sidebar til venstre, og topplinja fell bort.        */
.hovudnav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  display: grid; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(16px) saturate(1.4);
  border-top: 1px solid var(--line-soft);
  padding-bottom: var(--safe-b);
}
.hovudnav .nav-brand, .hovudnav .nav-botn, .hovudnav .nav-lang { display: none; }
.hovudnav .nav-lenker { display: contents; }
.hovudnav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  padding: 9px 2px 7px; color: var(--text-3); font-size: 10.5px; font-weight: 600;
}
.hovudnav a svg { width: 21px; height: 21px; }
.hovudnav a.aktiv { color: var(--accent); }

@media (min-width: 700px) {
  :root { --sidebar: 232px; }
  body { padding-left: var(--sidebar); }
  .topbar { display: none; }

  .hovudnav {
    position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
    display: flex; flex-direction: column; gap: 4px;
    grid-template-columns: none;
    padding: 16px 12px calc(14px + var(--safe-b));
    background: var(--bg-2);
    border-top: 0; border-right: 1px solid var(--line-soft);
    backdrop-filter: none;
    overflow-y: auto;
  }
  .hovudnav .nav-brand {
    display: flex; align-items: center; gap: 10px;
    padding: 4px 8px 16px; margin-bottom: 4px;
    border-bottom: 1px solid var(--line-soft);
  }
  .hovudnav .nav-brand .brand-mark { width: 30px; height: 30px; flex: none; }
  .hovudnav .nav-brand .brand-txt { display: flex; flex-direction: column; line-height: 1.05; min-width: 0; }
  .hovudnav .nav-brand strong { font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .hovudnav .nav-brand span { font-size: 10.5px; color: var(--text-3); text-transform: uppercase; letter-spacing: .11em; }

  .hovudnav .nav-lenker { display: flex; flex-direction: column; gap: 3px; }
  .hovudnav a {
    position: relative;
    flex-direction: row; justify-content: flex-start; gap: 11px;
    font-size: 14.5px; font-weight: 600; color: var(--text-2);
    padding: 10px 12px; border-radius: 11px; min-height: 42px;
    transition: background .14s, color .14s;
  }
  .hovudnav a svg { width: 19px; height: 19px; flex: none; }
  .hovudnav a:hover { background: var(--surface-2); color: var(--text); }
  .hovudnav a.aktiv { background: var(--accent-soft); color: var(--accent); }
  .hovudnav a.aktiv::before {
    content: ""; position: absolute; left: 0; top: 9px; bottom: 9px;
    width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
  }
  .hovudnav .nav-lang { display: inline; }
  .hovudnav .nav-kort { display: none; }

  .hovudnav .nav-botn {
    display: flex; flex-direction: column; gap: 10px;
    margin-top: auto; padding-top: 12px; border-top: 1px solid var(--line-soft);
  }
  .hovudnav .js-nydag { justify-content: flex-start; width: 100%; }
  .hovudnav .synkstatus { width: 100%; justify-content: flex-start; }
  .hovudnav .nav-verkty { display: flex; align-items: center; gap: 6px; }
  .hovudnav .nav-versjon { margin-left: auto; font-size: 11px; color: var(--text-3); }
}

@media (min-width: 700px) and (max-width: 1019px) {
  :root { --sidebar: 66px; }
  .hovudnav { padding: 14px 9px; align-items: center; }
  .hovudnav .nav-brand { padding: 2px 0 14px; justify-content: center; }
  .hovudnav .nav-brand .brand-txt { display: none; }
  .hovudnav .nav-lenker { align-items: stretch; width: 100%; }
  .hovudnav a { flex-direction: column; gap: 3px; font-size: 9.5px; padding: 8px 2px; text-align: center; }
  .hovudnav a.aktiv::before { display: none; }
  .hovudnav .nav-lang { display: none; }
  .hovudnav .nav-kort { display: inline; }
  .hovudnav .nav-botn { align-items: center; width: 100%; }
  .hovudnav .js-nydag span { display: none; }
  .hovudnav .js-nydag { justify-content: center; padding: 0 8px; }
  .hovudnav .synkstatus span { display: none; }
  .hovudnav .synkstatus { justify-content: center; padding: 8px; width: auto; }
  .hovudnav .nav-verkty { flex-direction: column; }
  .hovudnav .nav-versjon { display: none; }
}

/* Toast */
.toasts {
  position: fixed; z-index: 90; left: 50%; transform: translateX(-50%);
  bottom: calc(80px + var(--safe-b)); display: flex; flex-direction: column; gap: 8px;
  pointer-events: none; width: min(420px, calc(100vw - 28px));
}
@media (min-width: 700px) { .toasts { bottom: 24px; left: calc(50% + var(--sidebar) / 2); } }
.toast {
  background: var(--surface-3); border: 1px solid var(--line);
  color: var(--text); padding: 11px 15px; border-radius: 12px;
  box-shadow: var(--shadow); font-size: 14px; font-weight: 500;
  animation: pop .22s ease-out;
}
.toast.ok { border-color: color-mix(in srgb, var(--pos) 50%, transparent); }
.toast.feil { border-color: color-mix(in srgb, var(--neg) 50%, transparent); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.97); } }

/* Modal */
.modal-bg {
  position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.55);
  display: flex; align-items: flex-end; justify-content: center;
  backdrop-filter: blur(3px); animation: fade .16s;
}
@media (min-width: 700px) { .modal-bg { align-items: center; } }
@keyframes fade { from { opacity: 0; } }
.modal {
  background: var(--surface); width: min(660px, 100%);
  max-height: 90dvh; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--r-lg) var(--r-lg) 0 0;
  padding: 18px 18px calc(18px + var(--safe-b));
  animation: up .22s cubic-bezier(.2,.9,.3,1);
}
@media (min-width: 700px) { .modal { border-radius: var(--r-lg); padding-bottom: 18px; } }
@keyframes up { from { transform: translateY(24px); opacity: .6; } }
.modal h2 { font-size: 18px; margin-bottom: 4px; }
.modal .m-actions { display: flex; gap: 8px; margin-top: 18px; }
.modal .m-actions .btn { flex: 1; }

/* Chart */
.chart { width: 100%; display: block; touch-action: pan-y; }
.chart text { fill: var(--text-3); stroke: none; font-size: 11px; font-family: var(--font); }
.chart .grid-l { stroke: var(--line-soft); stroke-width: 1; }
.chart .axis { stroke: var(--line); stroke-width: 1; }
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-2); padding: 0 14px 12px; }
.legend i { width: 11px; height: 11px; border-radius: 3px; display: inline-block; margin-right: 5px; vertical-align: -1px; }

.scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; }

details.acc { border-bottom: 1px solid var(--line-soft); }
details.acc:last-child { border-bottom: 0; }
details.acc > summary {
  padding: 13px 14px; cursor: pointer; font-weight: 600; font-size: 14.5px;
  display: flex; align-items: center; justify-content: space-between; gap: 10px; list-style: none;
}
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary::after { content: "＋"; color: var(--text-3); font-weight: 400; }
details.acc[open] > summary::after { content: "－"; }
details.acc > div { padding: 0 14px 14px; }

.stegviser { display: flex; gap: 6px; padding: 0 0 12px; }
.stegviser i { height: 3px; flex: 1; border-radius: 2px; background: var(--line); }
.stegviser i.on { background: var(--accent); }

.chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 5px 10px;
  border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line);
  font-size: 12.5px; cursor: pointer;
}
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }

.dropzone {
  border: 2px dashed var(--line); border-radius: var(--r); padding: 26px 16px;
  text-align: center; color: var(--text-3); cursor: pointer; transition: .15s;
}
.dropzone.over, .dropzone:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

kbd {
  font-family: var(--mono); font-size: 12px; background: var(--surface-3);
  border: 1px solid var(--line); border-radius: 5px; padding: 1px 5px;
}

/* ---------- Utskrift ---------- */
#printroot { display: none; }

@media print {
  @page { size: A4; margin: 14mm 12mm; }
  html, body { background: #fff !important; color: #000 !important; padding-left: 0 !important; }
  .topbar, .hovudnav, .toasts, #view, #modal-root, .no-print { display: none !important; }
  #printroot { display: block !important; }
  #printroot * { color: #000 !important; }
  .p-sheet { page-break-after: always; font-family: Arial, Helvetica, sans-serif; font-size: 11pt; }
  .p-sheet:last-child { page-break-after: auto; }
  .p-h1 { font-size: 15pt; font-weight: 700; letter-spacing: .06em; margin: 10px 0 2px; }
  .p-meta { display: flex; justify-content: space-between; font-size: 10pt; border-bottom: 1.5pt solid #000; padding-bottom: 5px; margin-bottom: 12px; }
  .p-sec { font-weight: 700; margin: 12px 0 3px; font-size: 11pt; }
  table.p-tbl { width: 100%; border-collapse: collapse; font-size: 10.5pt; }
  table.p-tbl td { padding: 2.6px 4px; border-bottom: .5pt solid #bbb; }
  table.p-tbl td.r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
  table.p-tbl tr.sum td { font-weight: 700; border-top: 1pt solid #000; border-bottom: 1pt solid #000; }
  table.p-tbl tr.grand td { font-weight: 700; border-top: 1.5pt solid #000; border-bottom: 2.5pt double #000; }
  .p-sign { margin-top: 26px; display: flex; gap: 40px; font-size: 10pt; }
  .p-sign div { flex: 1; border-top: .5pt solid #000; padding-top: 3px; }
  .p-note { border: .5pt solid #888; min-height: 52px; padding: 5px; margin-top: 4px; font-size: 10pt; }
}
