/* Gjeldsfri – brand-rammeverk
   Layout: app-skall. Toppstripe, rullbart innhold og fanelinje på mobil; sidemeny og 12-kolonners rutenett på desktop.
   Farger: mørk #001010, grønn #10B981, mint #5EE6B5, off-white #F7F8F6. Grønt brukes sparsomt: handlinger, fremgang og gode nyheter.
   Typografi: Manrope. Store tall i ExtraBold. */
:root {
  --font-display: 'Manrope', 'Helvetica Neue', Arial, system-ui, sans-serif;
  --font-body: 'Manrope', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Manrope', system-ui, sans-serif;

  --brand-dark: #001010;
  --green: #10B981;
  --mint: #5EE6B5;
  --grad: linear-gradient(135deg, #10B981 0%, #5EE6B5 100%);

  --bg: #f7f8f6;
  --surface: #ffffff;
  --surface-2: #f1f3f1;
  --line: #e4e8e5;
  --line-strong: #cdd5d1;
  --fg: #10201f;
  --muted: #71807d;
  --faint: #9aa5a2;
  --accent: #067a55;
  --accent-strong: #05664a;
  --accent-ink: #001010;
  --accent-soft: #dcf6ea;
  --hero: #001010;
  --hero-2: #062a24;
  --hero-fg: #f7f8f6;
  --hero-muted: #9db3ae;
  --gold: #e29a2d;
  --gold-soft: #fbf0db;
  --debt: #d64541;
  --debt-soft: #fbe4e2;
  --warn: #a8660b;
  --warn-soft: #fbf0db;
  --c-bolig: #4f7fa8;
  --c-bil: #22a99a;
  --c-forbruk: #e0584f;
  --c-kreditt: #ef9f37;
  --c-student: #8b7bea;
  --c-annet: #93a29e;
  --c-buffer: #10b981;
  --c-bsu: #3fd3a0;
  --c-fond: #c8a136;
  --c-mal: #b27ac8;
  --c-utgift: #c3ccc8;
  --shadow: 0 1px 2px rgba(0, 16, 16, 0.04), 0 14px 34px -18px rgba(0, 16, 16, 0.22);
  --radius: 22px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme='light']) {
    --bg: #001010; --surface: #061918; --surface-2: #0b2321; --line: #143029; --line-strong: #20443c;
    --fg: #eef4f2; --muted: #8fa6a1; --faint: #5f7a74; --accent: #5ee6b5; --accent-strong: #8af0cb; --accent-ink: #001010;
    --accent-soft: #0b3a2e; --hero: #032220; --hero-2: #07332c; --hero-fg: #f7f8f6; --hero-muted: #93b0a9;
    --gold: #f0b552; --gold-soft: #2f240c; --debt: #ff7a70; --debt-soft: #3a1513; --warn: #f2b54b; --warn-soft: #33270c;
    --c-bolig: #79a6d2; --c-bil: #3cc9b8; --c-forbruk: #ff7a70; --c-kreditt: #f5b45a; --c-student: #a99bf5; --c-annet: #8fa39d;
    --c-buffer: #10b981; --c-bsu: #5ee6b5; --c-fond: #e0bd56; --c-mal: #cc98e0; --c-utgift: #2b4440;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 34px -18px rgba(0, 0, 0, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme='dark'] {
  --bg: #001010; --surface: #061918; --surface-2: #0b2321; --line: #143029; --line-strong: #20443c;
  --fg: #eef4f2; --muted: #8fa6a1; --faint: #5f7a74; --accent: #5ee6b5; --accent-strong: #8af0cb; --accent-ink: #001010;
  --accent-soft: #0b3a2e; --hero: #032220; --hero-2: #07332c; --hero-fg: #f7f8f6; --hero-muted: #93b0a9;
  --gold: #f0b552; --gold-soft: #2f240c; --debt: #ff7a70; --debt-soft: #3a1513; --warn: #f2b54b; --warn-soft: #33270c;
  --c-bolig: #79a6d2; --c-bil: #3cc9b8; --c-forbruk: #ff7a70; --c-kreditt: #f5b45a; --c-student: #a99bf5; --c-annet: #8fa39d;
  --c-buffer: #10b981; --c-bsu: #5ee6b5; --c-fond: #e0bd56; --c-mal: #cc98e0; --c-utgift: #2b4440;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 14px 34px -18px rgba(0, 0, 0, 0.7);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum' 0;
}
/* App-skall: dokumentet ruller aldri. Bare innholdet i midten gjør det.
   Det hindrer at bunnmenyen flyter opp på iPhone etter tastatur eller over-scroll. */
html, body { height: 100%; }
body { overflow: hidden; overscroll-behavior: none; }
h1, h2, h3, h4, p, ol, ul, dl, dd, fieldset { margin: 0; padding: 0; }
ol, ul { list-style: none; }
fieldset { border: 0; min-width: 0; }
h1, h2, h3 { font-family: var(--font-display); text-wrap: balance; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
/* Listen som åpnes fra en nedtrekksmeny tegnes av systemet. Med gjennomsiktig bakgrunn på menyen ble den hvit
   med lys tekst i mørk modus (Windows og Android). Gi valgene appens egne farger. */
select option, select optgroup { background-color: var(--surface); color: var(--fg); }
select option:disabled { color: var(--faint); }
button { cursor: pointer; }
::selection { background: var(--accent-soft); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.ic { width: 20px; height: 20px; flex-shrink: 0; }
b, strong { font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.tiny { font-size: 11.5px; }
.txt-good { color: var(--accent); }
.txt-debt { color: var(--debt); }
.grow { flex: 1; }
.num, .kpi-value, .loan-balance, .tabular { font-variant-numeric: tabular-nums; }
[hidden] { display: none !important; }

/* ---------- Ramme ---------- */
.app {
  /* --app-h: høyden over tastaturet mens det er oppe (keyboard.js) */
  height: var(--app-h, 100%); display: grid; grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr) auto; grid-template-areas: 'top' 'main' 'tabs';
}
.sidebar { display: none; }
.topbar {
  grid-area: top; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 10px 10px 16px;
  background: var(--bg); border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}
.topbar-actions { display: flex; gap: 2px; align-items: center; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--fg); }
.brand-mark { width: 34px; height: 25px; flex-shrink: 0; color: var(--brand-dark); }
:root[data-theme='dark'] .brand-mark { color: #f7f8f6; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .brand-mark { color: #f7f8f6; } }
.wordmark { font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.03em; line-height: 1; }
.wordmark span { color: var(--green); }
:root[data-theme='dark'] .wordmark span { color: var(--mint); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .wordmark span { color: var(--mint); } }

.scroller {
  grid-area: main; min-height: 0; overflow-y: auto; overflow-x: hidden;
  overscroll-behavior: contain; -webkit-overflow-scrolling: touch; scroll-padding-top: 12px;
}
.view { width: 100%; max-width: 1320px; margin-inline: auto; min-width: 0; padding-inline: 16px; padding-block: 16px 40px; }
.view:focus { outline: none; }

.tabbar {
  grid-area: tabs; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px));
  background: var(--surface); border-top: 1px solid var(--line);
}
.tabbar a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 4px 0 2px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 600;
  -webkit-tap-highlight-color: transparent;
}
.tabbar a .ic { width: 48px; height: 30px; padding: 5px 14px; border-radius: 999px; transition: background 0.2s, color 0.2s; }
.tabbar a.active { color: var(--fg); }
.tabbar a.active .ic { background: var(--accent-soft); color: var(--accent); }

body[data-mode='wizard'] .tabbar, body[data-mode='wizard'] .sidebar, body[data-mode='wizard'] .topbar-actions { display: none; }

/* Tastaturet er oppe (keyboard.js): mer plass til feltet du skriver i */
.kb-open .tabbar, .kb-open .fab { display: none; }
.kb-open .sheet-root { bottom: auto; height: var(--app-h, 100%); }
.kb-open .sheet { max-height: calc(var(--app-h, 100dvh) - 8px); }
.kb-open .ns-live-grid > div { padding: 9px 14px; gap: 0; }
.kb-open .ns-live-grid small { display: none; }
.kb-open .ns-live-grid b { font-size: clamp(16px, 4.4vw, 19px); }
.kb-open .ns-bar { padding: 9px 14px; }

@media (min-width: 720px) {
  .view { padding-inline: 28px; padding-top: 24px; }
}
@media (min-width: 1024px) {
  .app { grid-template-columns: 252px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); grid-template-areas: 'side main'; }
  body[data-mode='wizard'] .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); grid-template-areas: 'top' 'main'; }
  .topbar { display: none; }
  body[data-mode='wizard'] .topbar { display: flex; background: transparent; border: 0; padding: 24px 32px 0; }
  .tabbar { display: none; }
  .view { padding-inline: 36px; padding-block: 32px 64px; }
  .sidebar {
    grid-area: side; display: flex; flex-direction: column; gap: 6px; min-height: 0; overflow-y: auto;
    padding: 22px 14px 18px; background: var(--surface); border-right: 1px solid var(--line);
  }
  .sidebar .brand { padding: 4px 10px 22px; }
  .side-nav { display: flex; flex-direction: column; gap: 2px; }
  .side-nav a {
    display: flex; align-items: center; gap: 12px; padding: 11px 12px; border-radius: 12px;
    text-decoration: none; color: var(--muted); font-weight: 600; font-size: 14.5px; transition: background 0.15s, color 0.15s;
  }
  .side-nav a:hover { background: var(--surface-2); color: var(--fg); }
  .side-nav a.active { background: var(--accent-soft); color: var(--fg); }
  .side-nav a.active .ic { color: var(--accent); }
  .side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 10px; }
  .side-status:empty { display: none; }
  .side-status {
    display: grid; gap: 2px; padding: 14px; border-radius: 18px; color: var(--hero-fg); text-decoration: none;
    background: radial-gradient(120% 100% at 100% 0%, rgba(16, 185, 129, 0.28), transparent 60%), var(--hero);
  }
  .side-status span { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--hero-muted); }
  .side-status b { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; }
  .side-status b::first-letter { text-transform: uppercase; }
  .side-status .side-bar { display: block; height: 6px; border-radius: 99px; background: rgba(255, 255, 255, 0.12); margin: 8px 0 4px; overflow: hidden; }
  .side-status .side-bar i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
  .side-status small { color: var(--hero-muted); font-size: 12px; }
  .side-btns { display: flex; gap: 4px; }
  .side-btns .btn-ghost { flex: 1; justify-content: flex-start; border: 0; }
}

/* ---------- Sidehode ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.page-title h1 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; }
.eyebrow {
  font-size: 11.5px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
  margin-bottom: 6px;
}
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- Rutenett og kort ---------- */
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 12px; align-items: start; }
.grid > * { grid-column: span 12; min-width: 0; }
@media (min-width: 720px) {
  .grid { gap: 16px; }
  .grid > * { grid-column: span var(--span-md, 12); }
}
@media (min-width: 1180px) {
  .grid > * { grid-column: span var(--span, 12); }
}
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; min-width: 0; box-shadow: var(--shadow);
}
@media (min-width: 720px) { .card { padding: 22px; } }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; }
.card-head p { margin-top: 3px; font-size: 13.5px; color: var(--muted); max-width: 68ch; }
.card-total { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.chart { width: 100%; min-width: 0; }
.chart-fallback { padding: 40px 0; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- Knapper ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 14px; border: 1px solid transparent;
  background: var(--grad); color: var(--accent-ink); font-weight: 700; font-size: 14px; text-decoration: none; white-space: nowrap;
  box-shadow: 0 8px 20px -10px rgba(16, 185, 129, 0.6);
  transition: filter 0.15s, border-color 0.15s, transform 0.1s, color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { filter: brightness(1.05) saturate(1.05); }
.btn:active { transform: scale(0.98); }
.btn:disabled { opacity: 0.45; pointer-events: none; }
.btn .ic { width: 18px; height: 18px; }
.btn-sm { height: 36px; padding: 0 13px; font-size: 13px; border-radius: 11px; }
.btn-soft { background: var(--accent-soft); color: var(--accent); box-shadow: none; }
.btn-soft:hover { background: color-mix(in srgb, var(--accent-soft) 70%, var(--accent) 12%); }
.btn-ghost { background: transparent; color: var(--fg); border-color: var(--line); box-shadow: none; }
.btn-ghost:hover { background: var(--surface-2); filter: none; }
.btn-danger { background: var(--debt-soft); color: var(--debt); box-shadow: none; }
.btn-danger:hover, .btn-danger.armed { background: var(--debt); color: #fff; }
.btn-gold { background: var(--grad); color: var(--accent-ink); }

.btn-icon {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; border: 0;
  background: transparent; color: var(--muted); flex-shrink: 0;
}
.btn-icon:hover { background: var(--surface-2); color: var(--fg); }
.btn-icon-sm { width: 32px; height: 32px; border-radius: 9px; }
.btn-icon-sm .ic { width: 16px; height: 16px; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }
.link {
  display: inline-flex; align-items: center; gap: 4px; margin-top: 8px; padding: 0; border: 0; background: none;
  color: var(--accent); font-weight: 650; font-size: 13.5px; text-decoration: none;
}
.link .ic { width: 15px; height: 15px; transition: transform 0.15s; }
.link:hover .ic { transform: translateX(3px); }
.kpi-sub a, .note a { color: var(--accent); font-weight: 600; text-decoration: none; }

/* ---------- Demo-banner ---------- */
.demo-banner {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; padding: 12px 14px;
  background: var(--gold-soft); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); border-radius: 16px;
}
.demo-banner > div { flex: 1 1 260px; min-width: 0; }
.demo-banner b { display: block; font-size: 14px; }
.demo-banner span { font-size: 13px; color: var(--muted); }
.demo-ic { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--gold); color: #1d1a0d; }

.nudge-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cloud-nudge {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-bottom: 16px; padding: 12px 14px;
  background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent); border-radius: 16px;
}
.cloud-nudge > div:nth-child(2) { flex: 1 1 260px; min-width: 0; }
.cloud-nudge b { display: block; font-size: 14px; }
.cloud-nudge span { font-size: 13px; color: var(--muted); }
.cloud-nudge .demo-ic { background: var(--grad); color: var(--accent-ink); }
.gis-slot { min-height: 44px; display: flex; align-items: center; color-scheme: normal; }
.gis-slot iframe { max-width: 100%; }

/* ---------- Konto og synk ---------- */
.account { display: flex; flex-direction: column; gap: 10px; padding: 14px; border-radius: 16px; background: var(--surface-2); border: 1px solid var(--line); }
.account-lead { font-size: 14px; }
.account-user { display: flex; align-items: center; gap: 12px; min-width: 0; }
.account-user > div { min-width: 0; }
.account-user b { display: block; font-size: 15px; }
.account-user > div span { font-size: 13px; color: var(--muted); overflow-wrap: anywhere; }
.avatar {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
  background: var(--grad); color: var(--accent-ink); font-weight: 800; font-size: 17px;
}
.avatar.sm { width: 30px; height: 30px; font-size: 13px; }
.sync-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); }
.sync-line i, .sync-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
[data-status='synced'] i, .sync-dot[data-sync='synced'] { background: var(--accent); }
[data-status='syncing'] i, .sync-dot[data-sync='syncing'] { background: var(--gold); animation: pulse 1s ease-in-out infinite; }
[data-status='offline'] i, .sync-dot[data-sync='offline'] { background: var(--warn); }
[data-status='error'] i, .sync-dot[data-sync='error'] { background: var(--debt); }
.sync-dot[data-sync='off'], .sync-dot[data-sync='local'] { display: none; }
@keyframes pulse { 50% { opacity: 0.35; } }
.has-dot { position: relative; }
.has-dot .sync-dot { position: absolute; top: 8px; right: 8px; box-shadow: 0 0 0 2px var(--bg); }
.side-account:empty { display: none; }
.acc-chip { text-decoration: none;
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; border-radius: 14px; text-align: left;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--fg);
}
.acc-chip:hover { border-color: var(--line-strong); }
.acc-chip > .ic { color: var(--accent); }
.acc-chip > span:last-child { min-width: 0; display: flex; flex-direction: column; }
.acc-chip b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-chip small { font-size: 11.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choice { display: grid; gap: 10px; margin-bottom: 12px; }
.choice-opt {
  display: grid; grid-template-columns: 24px 1fr; gap: 2px 12px; align-items: center; text-align: left;
  padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface);
}
.choice-opt:hover { border-color: var(--accent); }
.choice-opt .ic { grid-row: span 2; color: var(--accent); }
.choice-opt b { font-size: 15px; }
.choice-opt span { font-size: 13px; color: var(--muted); font-variant-numeric: tabular-nums; }
.choice-opt.rec { border-color: var(--accent); background: var(--accent-soft); }
.choice-opt:disabled { opacity: 0.6; cursor: not-allowed; border-color: var(--line); }

/* Advarsel om appens innebygde nettleser (Instagram o.l.) */
.cloud-nudge.warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.cloud-nudge.warn .demo-ic { background: var(--warn); color: #fff; }

/* Versjoner og enheter */
.ver-list { display: flex; flex-direction: column; margin-bottom: 14px; }
.ver-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.ver-row:last-child { border-bottom: 0; }
.ver-row > div { min-width: 0; display: flex; flex-direction: column; }
.ver-row b { font-size: 14px; font-variant-numeric: tabular-nums; }
.ver-row small { font-size: 12.5px; color: var(--muted); }
.ver-row .btn { flex: none; }
.ver-actions { display: flex; align-items: center; gap: 6px; flex: none; }
.menu-row.warn .menu-ic { background: var(--warn-soft); color: var(--warn); }
.recovery { max-width: 560px; margin: 24px auto; display: grid; gap: 10px; }
.recovery .demo-ic { background: var(--warn); color: #fff; }

/* ---------- KPI ---------- */
.kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .kpis { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (min-width: 720px) { .kpis-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .kpis { align-self: stretch; grid-auto-rows: 1fr; } }
.kpi {
  position: relative; display: flex; flex-direction: column; gap: 3px; min-width: 0; text-align: left;
  padding: 14px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
  font: inherit; color: inherit; width: 100%;
}
button.kpi { cursor: pointer; transition: border-color 0.15s, transform 0.12s, box-shadow 0.2s; -webkit-tap-highlight-color: transparent; }
button.kpi:hover { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
button.kpi:active { transform: scale(0.985); }
.kpi-go { position: absolute; top: 12px; right: 12px; width: 16px; height: 16px; color: var(--faint); }
button.kpi:hover .kpi-go { color: var(--accent); }
@media (min-width: 720px) { .kpi { padding: 16px; } }
.kpi-label { padding-right: 18px; font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.kpi-value { font-size: clamp(20px, 2.4vw, 27px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; overflow-wrap: anywhere; }
.kpi-sub { font-size: 12.5px; color: var(--muted); }
.kpi-debt .kpi-value, .kpi-bad .kpi-value { color: var(--debt); }
.kpi-warn .kpi-value { color: var(--warn); }
.kpi-good .kpi-value { color: var(--accent); }
.delta { display: inline-flex; align-items: center; gap: 1px; font-weight: 700; }
.delta .ic { width: 13px; height: 13px; }
.delta.down { color: var(--accent); }
.delta.up { color: var(--debt); }
.ticker {
  display: inline-flex; align-items: center; gap: 5px; align-self: flex-start; margin-top: 6px;
  padding: 3px 8px 3px 6px; border-radius: 999px; background: var(--debt-soft); color: var(--debt); font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.ticker .ic { width: 13px; height: 13px; }
.ticker b { font-weight: 700; font-variant-numeric: tabular-nums; }
.meter { display: block; height: 6px; margin-top: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.meter > span { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width 0.6s ease; }
.meter-warn > span { background: var(--warn); }
.meter-bad > span { background: var(--debt); }

/* ---------- 100-lappen ---------- */
.stack100 { display: flex; height: 18px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.stack100 > span { flex-grow: 0; flex-shrink: 0; min-width: 3px; }
.stack100 > span + span { box-shadow: inset 2px 0 0 var(--surface); }
.stack-lg { height: 28px; border-radius: 10px; margin: 2px 0 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 12px; font-size: 13px; color: var(--muted); }
.legend li { display: flex; align-items: center; gap: 7px; }
.legend i { width: 10px; height: 10px; border-radius: 3px; }
.legend b { color: var(--fg); font-variant-numeric: tabular-nums; }
.note {
  display: flex; align-items: flex-start; gap: 8px; margin-top: 10px; padding: 10px 12px; border-radius: 12px;
  font-size: 13px; background: var(--surface-2); color: var(--fg);
}
.note .ic { width: 16px; height: 16px; margin-top: 1px; }
.note.bad { background: var(--debt-soft); } .note.bad .ic { color: var(--debt); }
.note.warn { background: var(--warn-soft); } .note.warn .ic { color: var(--warn); }
.note.good { background: var(--accent-soft); } .note.good .ic { color: var(--accent); }
.note.info .ic { color: var(--c-buffer); }

/* ---------- Innsikt ---------- */
.insights { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 720px) { .insights { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; } }
.insight {
  display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start;
  padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line);
}
.insight h3 { font-size: 15px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.insight p { margin-top: 4px; font-size: 13.5px; color: var(--muted); }
.insight-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; }
.insight-bad .insight-ic { background: var(--debt-soft); color: var(--debt); }
.insight-good .insight-ic { background: var(--accent-soft); color: var(--accent); }
.insight-info .insight-ic { background: var(--gold-soft); color: var(--warn); }

/* ---------- Lister på oversikten ---------- */
.order li { display: grid; grid-template-columns: 18px 28px minmax(0, 1fr); gap: 10px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.order li:first-child { border-top: 0; padding-top: 0; }
.order-n { font-family: var(--font-mono); font-size: 12px; color: var(--faint); text-align: center; }
.order-top, .order-sub { display: flex; justify-content: space-between; gap: 8px; }
.order-top b { font-size: 14.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-top span { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.order-sub { font-size: 12px; color: var(--muted); }
.order-bar { height: 5px; margin: 6px 0 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.order-bar span { display: block; height: 100%; border-radius: 99px; }

.miles li { display: flex; align-items: center; gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.miles li:first-child { border-top: 0; padding-top: 0; }
.mile-dot { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: var(--surface-2); color: var(--faint); flex-shrink: 0; }
.mile-dot .ic { width: 16px; height: 16px; }
.miles li.done .mile-dot { background: var(--accent-soft); color: var(--accent); }
.miles li.done b { color: var(--muted); font-weight: 600; }
.miles b { display: block; font-size: 14px; }
.miles span { font-size: 12.5px; color: var(--muted); }
.miles li:not(.done):first-child .mile-dot { background: var(--grad); color: var(--accent-ink); }

/* ---------- Merker og piller ---------- */
.badge {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; flex-shrink: 0;
  background: color-mix(in srgb, var(--c) 15%, transparent); color: var(--c);
}
.badge.sm { width: 28px; height: 28px; border-radius: 9px; }
.badge.sm .ic { width: 16px; height: 16px; }
.badge.xs { width: 22px; height: 22px; border-radius: 7px; }
.badge.xs .ic { width: 13px; height: 13px; }
.pill {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 999px;
  font-size: 11.5px; font-weight: 650; white-space: nowrap; background: var(--surface-2); color: var(--muted);
}
.pill-good { background: var(--accent-soft); color: var(--accent); }
.pill-bad { background: var(--debt-soft); color: var(--debt); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }

/* ---------- Lånekort ---------- */
.loan-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 12px; }
@media (min-width: 720px) { .loan-grid { gap: 16px; } }
.loan-card, .acc-card {
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
  padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
  cursor: pointer; transition: border-color 0.15s, box-shadow 0.2s, transform 0.15s;
}
.loan-card:hover, .acc-card:hover { border-color: color-mix(in srgb, var(--c) 55%, var(--line)); box-shadow: var(--shadow); transform: translateY(-1px); }
.loan-card.is-paid { opacity: 0.7; }
.loan-head { display: flex; align-items: center; gap: 12px; }
.loan-name { min-width: 0; flex: 1; }
.loan-name h3 { font-size: 15.5px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.loan-name p { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank { font-family: var(--font-mono); font-size: 12px; padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--muted); }
.loan-balance { font-size: 27px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; }
.progress { height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.progress span { display: block; height: 100%; border-radius: 99px; background: var(--c); }
.loan-progress { font-size: 12.5px; color: var(--muted); margin-top: -4px; }
.acc-card .meter { margin-top: 0; }
.loan-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; padding-top: 10px; border-top: 1px solid var(--line); }
.loan-stats dt { font-size: 12px; color: var(--muted); }
.loan-stats dd { font-size: 14.5px; font-weight: 650; font-variant-numeric: tabular-nums; }
.loan-stats small { font-size: 11.5px; color: var(--faint); font-weight: 500; margin-left: 2px; }
.loan-card .note { margin-top: 0; }
.loan-add {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; min-height: 140px;
  border: 1.5px dashed var(--line-strong); border-radius: 20px; background: transparent; color: var(--muted); font-weight: 650;
}
.loan-add:hover { color: var(--accent); border-color: var(--accent); }

.table-wrap { overflow-x: auto; margin-inline: -4px; }
.table { width: 100%; min-width: 540px; border-collapse: collapse; font-size: 13.5px; }
.table th { text-align: left; font-family: var(--font-mono); font-size: 10.5px; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); padding: 8px; border-bottom: 1px solid var(--line); }
.table td { padding: 10px 8px; border-bottom: 1px solid var(--line); }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table tfoot td { font-weight: 750; border-bottom: 0; }
.cell-loan { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }

/* ---------- Budsjett ---------- */
.flow {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px;
  padding: 16px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
}
.flow-op { display: none; }
.flow-item span, .flow-split span { display: block; font-size: 12px; color: var(--muted); }
.flow-item b, .flow-split b { font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.015em; }
.flow-main b { color: var(--accent); }
.flow-split { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.flow-bad b { color: var(--debt); } .flow-warn b { color: var(--warn); } .flow-good b { color: var(--accent); }
@media (min-width: 960px) {
  .flow { display: flex; align-items: center; gap: 14px; padding: 18px 22px; }
  .flow-op { display: block; font-size: 22px; color: var(--faint); font-weight: 300; }
  .flow-split { margin-left: auto; display: flex; gap: 22px; padding: 0 0 0 22px; border-top: 0; border-left: 1px solid var(--line); }
}
.ladder li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ladder-n { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--c); color: #fff; font-weight: 700; font-size: 12.5px; }
.ladder-top { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; }
.ladder-top b { font-size: 15px; }
.ladder-top strong { font-size: 17px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ladder-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.ladder-q { margin-top: 10px; font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.queue { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.queue li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border-radius: 999px; background: var(--surface-2); font-size: 12.5px; }
.queue i { width: 8px; height: 8px; border-radius: 99px; }
.queue span { color: var(--faint); font-variant-numeric: tabular-nums; }
.rec-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.rec-compare span { display: block; font-size: 12px; color: var(--muted); }
.rec-compare b { font-size: 13.5px; }
.phases { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.phases li { padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--c) 12%, var(--surface)); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); }
.phases span { display: block; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); letter-spacing: 0.03em; }
.phases b { font-size: 13.5px; }

.erows { display: flex; flex-direction: column; margin-bottom: 10px; }
.erow {
  position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 116px 32px; gap: 6px; align-items: center;
  padding: 6px 0; border-bottom: 1px solid var(--line);
}
.erow:has(.erow-sel) { grid-template-columns: minmax(0, 1fr) 116px 32px; grid-template-areas: 'name name name' 'cat amt del'; }
.erow:has(.erow-sel) .erow-name { grid-area: name; }
.erow:has(.erow-sel) .erow-sel { grid-area: cat; }
.erow:has(.erow-sel) .erow-amt { grid-area: amt; }
.erow:has(.erow-sel) .btn-icon, .erow:has(.erow-sel) .erow-exp { grid-area: del; }
@media (min-width: 560px) {
  .erow:has(.erow-sel) { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) 112px 32px; grid-template-areas: 'name cat amt del'; }
}
.erow-share { position: absolute; left: 0; bottom: -1px; height: 2px; background: color-mix(in srgb, var(--accent) 60%, transparent); border-radius: 2px; }
.erow-name, .erow-sel {
  min-width: 0; width: 100%; height: 38px; padding: 0 10px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; font-size: 14.5px; font-weight: 600;
}
.erow-sel { font-size: 13px; font-weight: 500; color: var(--muted); background: var(--surface-2); }
.erow-name:hover, .erow-name:focus { background: var(--surface-2); border-color: var(--line); outline: none; }
.erow-sel:focus, .erow-name:focus-visible { border-color: var(--accent); outline: none; }
.erow-amt { display: flex; align-items: center; height: 38px; padding: 0 10px; border-radius: 10px; background: var(--surface-2); border: 1px solid transparent; }
.erow-amt:focus-within { border-color: var(--accent); }
.erow-amt input { width: 100%; min-width: 0; border: 0; background: transparent; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 16px; outline: none; }
.erow-amt em { font-style: normal; color: var(--faint); font-size: 12px; margin-left: 5px; }

/* ---------- Plan ---------- */
.controls { display: flex; flex-direction: column; gap: 14px; }
.controls .card-head { margin-bottom: 0; }
.seg { display: flex; gap: 4px; padding: 4px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line); }
.seg-opt { flex: 1; position: relative; }
.seg-opt input { position: absolute; opacity: 0; pointer-events: none; }
.seg-opt span {
  display: flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 8px; border-radius: 9px;
  font-weight: 650; font-size: 13.5px; color: var(--muted); cursor: pointer; text-align: center; transition: background 0.15s, color 0.15s;
}
.seg-opt span .ic { width: 16px; height: 16px; }
.seg-opt input:checked + span { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--line); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 1px; }
.seg-sm .seg-opt span { height: 34px; font-size: 12.5px; }
.range { display: flex; flex-direction: column; gap: 6px; }
.range-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13.5px; font-weight: 600; }
.range-top output { font-size: 21px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; color: var(--accent); }
.range-scale { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: 10.5px; color: var(--faint); }
input[type='range'] { -webkit-appearance: none; appearance: none; width: 100%; height: 30px; background: transparent; margin: 0; }
input[type='range']::-webkit-slider-runnable-track { height: 8px; border-radius: 99px; background: var(--line); }
input[type='range']::-moz-range-track { height: 8px; border-radius: 99px; background: var(--line); }
input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none; width: 26px; height: 26px; margin-top: -9px; border-radius: 50%;
  background: var(--green); border: 4px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong), 0 4px 10px rgba(0, 0, 0, 0.18);
}
input[type='range']::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: var(--green); border: 4px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { height: 32px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chip:hover { border-color: var(--accent); color: var(--accent); }
.sim-hero { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; }
.sim-hero .eyebrow { margin-bottom: 0; }
.sim-hero strong { font-family: var(--font-display); font-size: clamp(34px, 6vw, 50px); font-weight: 850; letter-spacing: -0.045em; line-height: 1; }
.sim-hero strong::first-letter { text-transform: uppercase; }
.sim-hero > span:last-child { color: var(--muted); font-size: 14px; }
.sim-kpis, .stress-grid, .preview-grid, .bsu-row, .bsu-year { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .sim-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.sim-kpis > div, .stress-grid > div, .preview-grid > div, .bsu-row > div, .bsu-year > div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.sim-kpis span, .stress-grid span, .preview-grid span, .bsu-row span, .bsu-year span { display: block; font-size: 12px; color: var(--muted); }
.sim-kpis b, .stress-grid b, .preview-grid b, .bsu-row b, .bsu-year b { font-size: 17px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -0.015em; }
.bsu-year small { display: block; font-size: 11.5px; color: var(--faint); }
.bsu .meter { margin: 10px 0 12px; }
.good b { color: var(--accent); } .bad b { color: var(--debt); } .warn b { color: var(--warn); }
.stress .range { margin-bottom: 12px; }
.stress-verdict { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; font-size: 13.5px; color: var(--muted); }
.scns { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 720px) { .scns { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
.scn { padding: 16px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); }
.scn.active { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.scn-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.scn-head b { font-size: 15px; }
.scn p { font-size: 12.5px; color: var(--muted); margin: 2px 0 10px; }
.scn dl { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.scn dt { font-size: 12px; color: var(--muted); }
.scn dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.scn dd::first-letter { text-transform: uppercase; }
.marginal { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); font-size: 13.5px; }
.marginal .ic { color: var(--accent); width: 18px; height: 18px; margin-top: 1px; }
.timeline li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.timeline li:first-child { border-top: 0; padding-top: 0; }
.timeline b { display: block; font-size: 14px; }
.timeline span { font-size: 12.5px; color: var(--muted); }

/* ---------- Skjema ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.form-sub { font-size: 14px; font-weight: 750; margin-top: 6px; }
.form-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (min-width: 560px) { .form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 720px) { .form-grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 600; }
.field-input {
  display: flex; align-items: center; height: 48px; padding: 0 12px; border-radius: 12px;
  background: var(--surface-2); border: 1px solid var(--line); transition: border-color 0.15s, box-shadow 0.15s;
}
.field-input:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-input input, .field-input select { flex: 1; min-width: 0; height: 100%; border: 0; background: transparent; font-size: 16px; outline: none; font-variant-numeric: tabular-nums; }
.field-input em { font-style: normal; font-size: 13px; color: var(--faint); margin-left: 6px; white-space: nowrap; }
.field-hint { font-size: 12px; color: var(--muted); }
.field textarea, .exp-text {
  width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2);
  font-family: var(--font-mono); font-size: 12px; resize: vertical;
}
.calc { display: flex; align-items: flex-end; gap: 8px; }
.calc .field { flex: 1; }
.calc .btn { height: 48px; }
.preview { padding: 14px; border-radius: 16px; border: 1px dashed var(--line-strong); }
.preview .muted { margin-top: 8px; }
.type-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 560px) { .type-pick { grid-template-columns: repeat(6, minmax(0, 1fr)); } .type-pick-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.type-pick-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.type-opt {
  position: relative; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
  font-size: 12px; font-weight: 650; text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.type-opt input { position: absolute; opacity: 0; pointer-events: none; }
.type-opt:hover { border-color: var(--line-strong); }
.type-opt:has(input:checked), .type-opt.on { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: var(--fg); }
.type-opt:has(input:checked) .ic, .type-opt.on .ic { color: var(--c); }
.type-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.ci-list { display: flex; flex-direction: column; gap: 8px; }
.ci-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 170px); gap: 10px; align-items: center; }
.ci-row > span:first-child { font-weight: 650; font-size: 14px; min-width: 0; }
.ci-row small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.ci-row .field-input input { text-align: right; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

/* ---------- Bunnark / dialog ---------- */
.sheet-root { position: fixed; inset: 0; z-index: 50; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(6, 14, 10, 0.5); opacity: 0; transition: opacity 0.2s; }
.sheet-root.open .sheet-backdrop { opacity: 1; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-direction: column;
  max-height: 92vh; max-height: 92dvh; background: var(--surface); border-radius: 24px 24px 0 0;
  padding-bottom: env(safe-area-inset-bottom, 0px); box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.2);
  transform: translateY(100%); transition: transform 0.26s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sheet-root.open .sheet { transform: translateY(0); }
.sheet-grab { width: 40px; height: 5px; border-radius: 99px; background: var(--line-strong); margin: 8px auto 0; }
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 12px 16px 6px 20px; }
.sheet-head h2 { font-size: 20px; font-weight: 800; letter-spacing: -0.02em; }
.sheet-head p { font-size: 13px; color: var(--muted); margin-top: 2px; }
.sheet-body { overflow-y: auto; overscroll-behavior: contain; padding: 8px 20px 20px; }
.sheet-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--line); }
@media (min-width: 720px) {
  .sheet {
    left: 50%; top: 50%; bottom: auto; right: auto; width: min(660px, calc(100% - 48px)); max-height: 88vh; max-height: 88dvh;
    border-radius: 24px; padding-bottom: 0; opacity: 0; transform: translate(-50%, -47%) scale(0.98);
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.18s;
  }
  .sheet-root.open .sheet { opacity: 1; transform: translate(-50%, -50%); }
  .sheet-grab { display: none; }
  .sheet-head { padding: 20px 20px 6px 24px; }
  .sheet-body { padding: 8px 24px 22px; }
  .sheet-foot { padding: 14px 24px; }
}

.toast-root { position: fixed; left: 0; right: 0; bottom: calc(92px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex; justify-content: center; pointer-events: none; padding-inline: 16px; }
@media (min-width: 1024px) { .toast-root { bottom: 32px; } }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 12px 16px; border-radius: 14px;
  background: var(--fg); color: var(--bg); font-weight: 600; font-size: 14px; box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
  opacity: 0; transform: translateY(14px); transition: opacity 0.2s, transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast .ic { width: 18px; height: 18px; color: var(--accent-soft); }
.toast-bad .ic { color: var(--debt-soft); }
.toast.has-action.show { pointer-events: auto; } /* en skjult melding skal aldri stjele trykk */
.toast-btn {
  margin-left: 6px; padding: 6px 12px; border-radius: 99px; border: 0; cursor: pointer; flex: none;
  background: color-mix(in srgb, var(--accent-soft) 20%, transparent); color: var(--accent-soft); font: inherit; font-weight: 800; font-size: 13px;
}
.toast-btn:hover { background: color-mix(in srgb, var(--accent-soft) 32%, transparent); }

/* ---------- Tomtilstand og veiviser ---------- */
.empty { text-align: center; padding: 28px 12px; }
.empty > .ic { width: 42px; height: 42px; color: var(--accent); margin-bottom: 10px; }
.empty h3 { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.empty p { color: var(--muted); max-width: 48ch; margin: 6px auto 0; }
.empty .btn { margin-top: 18px; }
.wiz { max-width: 780px; margin-inline: auto; display: flex; flex-direction: column; gap: 16px; }
.wiz-head .eyebrow { margin-bottom: 10px; }
.wiz-steps { display: flex; gap: 6px 16px; flex-wrap: wrap; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.wiz-steps li { display: flex; align-items: center; gap: 8px; }
.wiz-steps span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 9px; background: var(--surface); border: 1px solid var(--line); font-size: 12.5px; }
.wiz-steps span .ic { width: 14px; height: 14px; }
.wiz-steps li.on { color: var(--fg); }
.wiz-steps li.on span { background: var(--grad); color: var(--accent-ink); border-color: transparent; }
.wiz-steps li.done span { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.wiz-body { display: flex; flex-direction: column; gap: 14px; }
.wiz-body h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 800; letter-spacing: -0.03em; }
.wiz-body > .muted { max-width: 62ch; margin-top: -6px; }
.wiz-foot { display: flex; justify-content: space-between; gap: 10px; }
.wiz-total { font-size: 15px; text-align: right; }
.wiz-total b { font-size: 19px; font-variant-numeric: tabular-nums; }
.wiz-loans { display: flex; flex-direction: column; gap: 8px; }
.wiz-loans li { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.wiz-loans li > div { flex: 1; min-width: 0; }
.wiz-loans b { display: block; font-size: 14px; }
.wiz-loans span { font-size: 12.5px; color: var(--muted); }
.wiz-loan-form { display: flex; flex-direction: column; gap: 12px; padding: 14px; border-radius: 16px; border: 1px dashed var(--line-strong); }
.wiz-loan-form > .btn { align-self: flex-start; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Dokumentsider (personvern, vilkår) ---------- */
.doc { max-width: 720px; margin-inline: auto; padding-inline: 16px; padding-block: 32px 64px; }
.doc .brand { margin-bottom: 28px; }
.doc h1 { font-size: clamp(28px, 5vw, 38px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.1; }
.doc .lead { margin-top: 10px; color: var(--muted); font-size: 16px; }
.doc h2 { font-size: 18px; font-weight: 750; margin-top: 30px; margin-bottom: 8px; letter-spacing: -0.01em; }
.doc p, .doc li { font-size: 15px; line-height: 1.6; max-width: 66ch; }
.doc p + p { margin-top: 10px; }
.doc ul { list-style: disc; padding-left: 20px; display: grid; gap: 6px; }
.doc a { color: var(--accent); font-weight: 600; }
.doc .stamp { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-top: 8px; }
.doc .todo { background: var(--gold-soft); padding: 0 4px; border-radius: 4px; }
.doc-foot { margin-top: 40px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13px; color: var(--muted); }

/* ======================================================================
   Brand-komponenter
   ====================================================================== */

/* ---------- Hjem: «Du er på vei.» ---------- */
.greet { font-size: 15px; font-weight: 600; color: var(--muted); margin-bottom: 4px; }
.home-title { font-size: clamp(30px, 5vw, 44px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; }
.home-hero {
  position: relative; overflow: hidden; isolation: isolate; display: grid; gap: 18px;
  padding: 22px; border-radius: 26px; color: var(--hero-fg);
  background: radial-gradient(110% 90% at 100% 0%, rgba(16, 185, 129, 0.3), transparent 58%), linear-gradient(160deg, var(--hero-2), var(--hero) 60%);
  box-shadow: 0 24px 48px -28px rgba(0, 16, 16, 0.65);
}
.home-hero .hero-deco { position: absolute; right: -60px; bottom: -70px; width: 320px; height: 230px; color: #fff; opacity: 0.045; z-index: -1; pointer-events: none; }
@media (min-width: 720px) { .home-hero { padding: 28px; } }
.hero-row { display: flex; align-items: center; gap: 20px; }
.ring { position: relative; width: 132px; height: 132px; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .track { stroke: rgba(255, 255, 255, 0.1); }
.ring .bar { stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(0.2, 0.8, 0.2, 1); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label b { font-size: 34px; font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.ring-label small { font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--hero-muted); margin-top: 4px; }
.hero-copy { min-width: 0; }
.hero-copy .hero-kicker { display: block; font-size: 12px; font-weight: 600; letter-spacing: 0.1em; text-transform: uppercase; color: var(--mint); }
.hero-copy h2 { font-size: clamp(22px, 3vw, 28px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.1; margin-top: 6px; }
.hero-copy p { color: var(--hero-muted); font-size: 14px; margin-top: 6px; }
.hero-copy p b { color: var(--mint); }
.hero-bar { height: 8px; border-radius: 99px; background: rgba(255, 255, 255, 0.1); overflow: hidden; }
.hero-bar span { display: block; height: 100%; border-radius: 99px; background: var(--grad); }
.hero-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.hero-stat {
  display: flex; flex-direction: column; gap: 4px; padding: 14px; border-radius: 18px; text-align: left; cursor: pointer;
  background: rgba(255, 255, 255, 0.06); border: 1px solid rgba(255, 255, 255, 0.08); color: inherit; font: inherit;
  transition: background 0.15s, border-color 0.15s;
}
.hero-stat:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(94, 230, 181, 0.35); }
.hero-stat span { font-size: 12px; color: var(--hero-muted); display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.hero-stat span .ic { width: 14px; height: 14px; }
.hero-stat b { font-size: clamp(18px, 2.4vw, 22px); font-weight: 800; letter-spacing: -0.025em; }
.hero-stat b::first-letter { text-transform: uppercase; }
.hero-stat.mint b { color: var(--mint); }

/* Hjem på én skjerm: datoen er overskriften */
.hero-date {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 0; border: 0; background: none; color: var(--hero-fg);
  font: inherit; font-size: clamp(28px, 7vw, 38px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.hero-date .ic { flex: none; width: 18px; height: 18px; color: var(--hero-muted); transition: transform 0.15s, color 0.15s; }
.hero-date:hover .ic { color: var(--mint); transform: translateX(2px); }
@media (max-width: 420px) { .home-hero .ring { width: 104px; height: 104px; } .home-hero .ring-label b { font-size: 26px; } .home-hero .hero-row { gap: 14px; } }
/* Tre tall: alltid på én rad */
.quick-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.quick-stats:has(> .kpi:nth-child(2):last-child) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 559px) {
  .quick-stats .kpi { padding: 12px 10px 12px 12px; border-radius: 16px; }
  .quick-stats .kpi-label { font-size: 10px; letter-spacing: 0.05em; padding-right: 14px; }
  .quick-stats .kpi-value { font-size: clamp(16px, 4.6vw, 20px); overflow-wrap: normal; white-space: nowrap; }
  .quick-stats .kpi-sub { font-size: 11.5px; }
  .quick-stats .kpi-go { top: 10px; right: 8px; width: 14px; height: 14px; }
}
@media (min-width: 1180px) { .quick-stats { grid-auto-rows: auto; } }
/* Snarveier: lønningsdag, funnet til deg og nivå */
.home-links { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
@media (min-width: 900px) { .home-links { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; } }
.hlink { width: 100%; font: inherit; text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.hl-ic { color: var(--accent); }
.hl-ic .ic { width: 24px; height: 24px; }
.hl-ring { display: grid; place-items: center; width: 58px; height: 58px; }
.payday:active { transform: scale(0.99); }
/* Til Oversikt */
.home-more {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 18px; border-radius: 22px;
  text-decoration: none; color: inherit; background: var(--accent-soft); border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  transition: border-color 0.15s, transform 0.12s; -webkit-tap-highlight-color: transparent;
}
.home-more b { display: block; font-size: 15.5px; color: var(--accent); }
.home-more small { font-size: 13px; color: var(--muted); }
.home-more > .ic { flex: none; width: 20px; height: 20px; color: var(--accent); transition: transform 0.15s; }
.home-more:hover { border-color: var(--accent); }
.home-more:hover > .ic { transform: translateX(3px); }
.home-more:active { transform: scale(0.99); }
/* Tilbake fra en underside (Oversikt) */
.back-link { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 6px -4px; padding: 4px 8px 4px 4px; border-radius: 10px; font-size: 14px; font-weight: 650; color: var(--muted); text-decoration: none; }
.back-link .ic { width: 16px; height: 16px; transform: rotate(180deg); }
.back-link:hover { color: var(--accent); background: var(--surface-2); }

/* ---------- Smart trekk ---------- */
.smart {
  display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 14px; align-items: start;
  padding: 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.smart-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.smart-ic .ic { width: 22px; height: 22px; }
.smart-kicker { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent); }
.smart h3 { font-size: 17px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.3; margin-top: 4px; }
.smart p { font-size: 14px; color: var(--muted); margin-top: 4px; }
.smart p b { color: var(--accent); }
.smart .btn { margin-top: 12px; }
.smart.done .smart-ic { background: var(--grad); color: var(--accent-ink); }

/* ---------- Lønningsdag ---------- */
.payday {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; text-decoration: none; color: inherit;
  padding: 16px 18px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.payday:hover { border-color: color-mix(in srgb, var(--green) 45%, var(--line)); }
.payday-days { display: grid; place-content: center; text-align: center; width: 58px; height: 58px; border-radius: 16px; background: var(--surface-2); }
.payday-days b { font-size: 22px; font-weight: 800; line-height: 1; letter-spacing: -0.03em; }
.payday-days small { font-size: 10.5px; font-weight: 600; color: var(--muted); }
.payday-txt b { display: block; font-size: 15px; }
.payday-txt span { font-size: 13px; color: var(--muted); }
.payday > .ic { color: var(--faint); }

/* ---------- Statuspiller for lån ---------- */
.status { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.status::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.status-high { background: var(--debt-soft); color: var(--debt); }
.status-opt { background: var(--warn-soft); color: var(--warn); }
.status-ok { background: var(--accent-soft); color: var(--accent); }
.loan-save { font-size: 13px; color: var(--muted); }
.loan-save b { color: var(--accent); }

/* ---------- Underfaner (Lån | Simulator) ---------- */
.subnav { display: inline-flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 16px; }
.subnav a { padding: 8px 16px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted); text-decoration: none; }
.subnav a.on { background: var(--surface); color: var(--fg); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08), 0 0 0 1px var(--line); }

/* ---------- Plan: Din anbefaling ---------- */
.reco { display: flex; flex-direction: column; gap: 14px; }
.reco-total { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 12px; }
.reco-total b { font-size: clamp(32px, 5vw, 44px); font-weight: 800; letter-spacing: -0.04em; line-height: 1; }
.reco-total span { color: var(--muted); font-size: 14px; }
.reco-list { display: flex; flex-direction: column; }
.reco-list li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.reco-list li:first-child { border-top: 0; }
.reco-dot { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--c); }
.reco-dot .ic { width: 18px; height: 18px; }
.reco-list b { display: block; font-size: 15px; }
.reco-list small { font-size: 12.5px; color: var(--muted); }
.reco-list strong { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.reco-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; justify-content: space-between; padding-top: 4px; }

/* ---------- Plan: pengeplan og lønningsplan ---------- */
.mp-bar { display: flex; height: 30px; border-radius: 12px; overflow: hidden; background: var(--surface-2); margin: 4px 0 14px; }
.mp-bar span { flex-shrink: 0; min-width: 3px; }
.mp-bar span + span { box-shadow: inset 2px 0 0 var(--surface); }
.mp-rows { display: flex; flex-direction: column; }
.mp-row { border-top: 1px solid var(--line); }
.mp-row:first-child { border-top: 0; }
.mp-row summary, .mp-sum {
  display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 16px; gap: 12px; align-items: center; padding: 12px 0; cursor: pointer; list-style: none;
}
.mp-sum { cursor: default; grid-template-columns: 12px minmax(0, 1fr) auto 16px; }
.mp-sum > i { width: 12px; height: 12px; border-radius: 4px; }
.mp-sum b { font-size: 15px; }
.mp-sum small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.mp-amt { display: flex; flex-direction: column; align-items: flex-end; text-align: right; }
.mp-amt strong { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mp-amt small { font-size: 12px !important; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mp-start .mp-amt strong { color: var(--accent); }
.mp-end { border-top: 1.5px solid var(--line-strong) !important; }
.mp-end .mp-amt strong { font-size: 19px; }
.mp-end.bad b, .mp-end.bad .mp-amt strong { color: var(--debt); }
.mp-row summary::-webkit-details-marker { display: none; }
.mp-row summary > i { width: 12px; height: 12px; border-radius: 4px; }
.mp-row summary b { font-size: 15px; }
.mp-row summary small { display: block; font-size: 12.5px; color: var(--muted); font-weight: 500; }
.mp-row summary .mp-pct { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; min-width: 42px; text-align: right; }
.mp-row summary .ic { width: 16px; height: 16px; color: var(--faint); transition: transform 0.2s; }
.mp-row[open] summary .ic { transform: rotate(90deg); }
.mp-sub { padding: 0 0 12px 22px; display: flex; flex-direction: column; gap: 6px; }
.mp-sub div { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; color: var(--muted); }
.mp-sub div b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
/* Hver post er en snarvei til der tallet endres */
.mp-go { width: 100%; border: 0; background: none; text-align: left; cursor: pointer; border-radius: 12px; -webkit-tap-highlight-color: transparent; }
.mp-go .ic, .mp-part .ic { width: 15px; height: 15px; color: var(--faint); transition: color 0.15s; }
.mp-go:hover .ic, .mp-part:hover .ic { color: var(--accent); }
.mp-sub { gap: 2px; }
.mp-part {
  display: grid; grid-template-columns: minmax(0, 1fr) auto 15px; align-items: center; gap: 10px; width: 100%;
  min-height: 40px; padding: 6px 10px; margin-left: -10px; border: 0; border-radius: 10px; background: none;
  font-size: 13.5px; color: var(--muted); text-align: left; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.mp-part span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mp-part b { color: var(--fg); font-weight: 600; font-variant-numeric: tabular-nums; }
.mp-part:hover, .mp-part:focus-visible { background: var(--surface-2); color: var(--fg); }
.mp-part:active { background: var(--accent-soft); }
.mp-edit { align-self: flex-start; margin: 4px 0 0; font-size: 13.5px; }
/* Raden du kom til fra en snarvei, lyser kort opp */
.flash { animation: flash 1.8s ease-out; border-radius: 14px; }
.erow-wrap, #income-card, #expenses-card { scroll-margin-top: 14px; }
@keyframes flash { 0%, 35% { box-shadow: 0 0 0 2px var(--accent), 0 0 0 8px var(--accent-soft); } 100% { box-shadow: 0 0 0 2px transparent, 0 0 0 8px transparent; } }
@media (prefers-reduced-motion: reduce) { .flash { animation: none; box-shadow: 0 0 0 2px var(--accent); } }
.mp-total { display: flex; justify-content: space-between; padding-top: 12px; border-top: 1px solid var(--line-strong); font-weight: 800; }
.mp-total.bad { color: var(--debt); }

.check-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.check-progress { flex: 1; max-width: 160px; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.check-progress span { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width 0.3s; }
.checklist { display: flex; flex-direction: column; gap: 6px; }
.check {
  display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%;
  padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); text-align: left; font: inherit; color: inherit; cursor: pointer;
}
.check:hover { border-color: var(--line-strong); }
.check-box { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line-strong); color: transparent; }
.check-box .ic { width: 16px; height: 16px; }
.check b { display: block; font-size: 14.5px; }
.check small { font-size: 12.5px; color: var(--muted); }
.check strong { font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
.check.on { background: var(--surface-2); }
.check.on .check-box { background: var(--grad); border-color: transparent; color: var(--accent-ink); }
.check.on b, .check.on strong { color: var(--muted); text-decoration: line-through; text-decoration-thickness: 1px; }

/* ---------- Mer ---------- */
.menu { display: flex; flex-direction: column; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; box-shadow: var(--shadow); }
.menu-title { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 18px 4px 8px; }
.menu-row {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 13px 16px;
  border: 0; border-top: 1px solid var(--line); background: none; width: 100%; text-align: left; font: inherit; color: inherit; text-decoration: none; cursor: pointer;
}
.menu-row:first-child { border-top: 0; }
.menu-row:hover { background: var(--surface-2); }
.menu-row .menu-ic { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; background: var(--surface-2); color: var(--fg); }
.menu-row .menu-ic .ic { width: 18px; height: 18px; }
.menu-row b { display: block; font-size: 15px; }
.menu-row small { font-size: 12.5px; color: var(--muted); }
.menu-row > .ic { width: 18px; height: 18px; color: var(--faint); }
.menu-row.static { cursor: default; }
.menu-row.static:hover { background: none; }

/* ---------- KPI-detaljer ---------- */
.detail-hero { display: flex; flex-direction: column; gap: 4px; padding: 18px; border-radius: 20px; background: var(--surface-2); margin-bottom: 14px; }
.detail-hero span { font-size: 13px; color: var(--muted); }
.detail-hero b { font-size: clamp(30px, 6vw, 40px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.detail-hero b::first-letter { text-transform: uppercase; }
.detail-hero small { font-size: 13.5px; color: var(--muted); }
.formula { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--line-strong); font-size: 13.5px; margin-bottom: 14px; }
.formula .ic { width: 18px; height: 18px; color: var(--accent); margin-top: 1px; }
.formula b { font-weight: 700; }
.dl-title { font-size: 12px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin: 16px 0 8px; }
.drows { display: flex; flex-direction: column; gap: 10px; }
.drow { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: baseline; }
.drow b { font-size: 14.5px; font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drow strong { font-variant-numeric: tabular-nums; font-weight: 800; white-space: nowrap; }
.drow small { grid-column: 1 / -1; font-size: 12.5px; color: var(--muted); }
.drow .dbar { grid-column: 1 / -1; height: 6px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.drow .dbar span { display: block; height: 100%; border-radius: 99px; background: var(--c, var(--green)); }
.drow.sum { padding-top: 10px; border-top: 1px solid var(--line-strong); }
.drow.sum b { font-weight: 800; }
.drow.minus strong { color: var(--muted); }
.detail-foot { margin-top: 18px; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.section-title { font-size: 19px; font-weight: 800; letter-spacing: -0.025em; margin: 6px 2px 12px; }
.status-legend { display: flex; flex-wrap: wrap; gap: 8px; }
.status-legend:empty { display: none; }
.loan-card > div:has(> .status) { margin-top: -2px; }
.more { max-width: 720px; }
.menu-seg .seg { padding: 3px; }
.menu-seg .seg-opt span { height: 30px; padding: 0 10px; font-size: 12.5px; }
.menu-row:has(.menu-seg) { grid-template-columns: 36px minmax(0, 1fr) auto; cursor: default; }
.menu-row:has(.menu-seg):hover { background: none; }
@media (max-width: 420px) { .menu-row:has(.menu-seg) { grid-template-columns: 36px minmax(0, 1fr); } .menu-row:has(.menu-seg) .menu-seg { grid-column: 1 / -1; } }
@media (max-width: 480px) {
  .mp-row summary { grid-template-columns: 12px minmax(0, 1fr) auto 16px; }
  .mp-row summary .mp-pct { display: none; }
  .mp-row summary strong { min-width: 0; }
}

/* ---------- Enkeltposter og abonnementer ---------- */
.erow-exp {
  position: relative; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; border: 0;
  background: transparent; color: var(--muted); cursor: pointer;
}
.erow-exp:hover { background: var(--surface-2); color: var(--fg); }
.erow-exp .ic { width: 17px; height: 17px; transition: transform 0.2s; }
.erow-exp.on { background: var(--accent-soft); color: var(--accent); }
.erow-exp.on .ic { transform: rotate(90deg); }
.erow-exp i {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 99px;
  background: var(--brand-dark); color: #fff; font-size: 10px; font-style: normal; font-weight: 700; line-height: 16px;
}
:root[data-theme='dark'] .erow-exp i { background: var(--mint); color: var(--brand-dark); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) .erow-exp i { background: var(--mint); color: var(--brand-dark); } }
.erow-amt.ro { justify-content: flex-end; background: transparent; }
.erow-amt.ro b { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 15px; }
.erow-wrap.open > .erow { border-bottom-color: transparent; }
.subs-panel { margin: 0 0 10px; padding: 12px; border-radius: 16px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; container-type: inline-size; }
.subs-head { font-size: 13px; color: var(--muted); }
/* Smal: navn over beløp, periode og bruk. Bred (desktop/nettbrett): alt på én linje. Styrt av panelets bredde, ikke skjermens. */
.srow { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr) 32px; grid-template-areas: 'name name del' 'amt per per'; gap: 6px; align-items: center; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.srow.is-sub { grid-template-columns: minmax(0, 0.9fr) minmax(0, 0.95fr) minmax(0, 1fr) 32px; grid-template-areas: 'name name name del' 'amt per use use'; }
.srow .srow-name { grid-area: name; }
.srow .srow-amt { grid-area: amt; }
.srow .srow-sel[data-field='period'] { grid-area: per; }
.srow .srow-sel[data-field='usage'] { grid-area: use; }
.srow .btn-icon { grid-area: del; }
@container (min-width: 540px) {
  .srow { grid-template-columns: minmax(0, 1fr) 112px 84px 32px; grid-template-areas: 'name amt per del'; padding-bottom: 6px; }
  .srow.is-sub { grid-template-columns: minmax(0, 1fr) 104px 80px 124px 32px; grid-template-areas: 'name amt per use del'; }
}
.srow-name, .srow-sel {
  min-width: 0; width: 100%; height: 36px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--surface); font-size: 14px;
}
.srow-name { font-weight: 600; }
.srow-sel { font-size: 13px; color: var(--muted); }
.srow-name:focus, .srow-sel:focus { border-color: var(--green); outline: none; }
.srow-amt { display: flex; align-items: center; height: 36px; padding: 0 10px; border-radius: 10px; background: var(--surface); border: 1px solid var(--line); }
.srow-amt:focus-within { border-color: var(--green); }
.srow-amt input { width: 100%; min-width: 0; border: 0; background: transparent; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; font-size: 16px; outline: none; }
.srow-amt em { font-style: normal; color: var(--faint); font-size: 12px; margin-left: 5px; }
.sub-chips .chip { height: 30px; font-size: 12.5px; }
.subs-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.link-danger { color: var(--debt); margin-top: 0; }
.link-danger .ic { width: 15px; height: 15px; }
.subs-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin-bottom: 4px; }
.subs-stats > div { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.subs-stats span { display: block; font-size: 12px; color: var(--muted); }
.subs-stats b { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 480px) { .subs-stats { grid-template-columns: 1fr 1fr; } .subs-stats > div:last-child { grid-column: 1 / -1; } }
.subs-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 28px; }
@media (min-width: 900px) { .subs-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.sub-list { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.sub-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); }
.sub-list b { display: block; font-size: 14.5px; }
.sub-list small { font-size: 12.5px; color: var(--muted); }
.subs-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- Ny start (60 sekunder) ---------- */
.wiz.ns { max-width: 720px; gap: 14px; }
.ns-head { display: flex; flex-direction: column; gap: 10px; }
.ns-head-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ns-head-row .eyebrow { margin: 0; }
.ns-head-row .link { margin: 0; font-size: 13px; }
.ns-progress { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.ns-progress i { height: 5px; border-radius: 99px; background: var(--line); transition: background 0.3s; }
.ns-progress i.on { background: var(--grad); }
.ns-body { display: flex; flex-direction: column; gap: 14px; }
.ns-intro { display: flex; flex-direction: column; gap: 6px; }
.ns-title { font-size: clamp(30px, 6vw, 44px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.02; }
.ns-form { display: flex; flex-direction: column; gap: 14px; }
.ns-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.ns-fields .ns-big { grid-column: 1 / -1; }
@media (min-width: 640px) { .ns-fields { grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr) minmax(0, 1fr); } .ns-fields .ns-big { grid-column: auto; } }
.ns-big .field-input { height: 56px; }
.ns-big .field-input input { font-size: 22px; font-weight: 750; }
.ns-add { align-self: flex-start; }
.ns-help a { color: var(--accent); font-weight: 600; }
.ns-live { border-radius: 18px; }
.ns-live-empty { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); color: var(--muted); font-size: 14px; }
.ns-live-empty .ic { color: var(--accent); flex: none; }
.ns-live-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1px; overflow: hidden; border-radius: 18px;
  background: color-mix(in srgb, var(--hero-fg) 12%, transparent);
  box-shadow: 0 18px 40px -26px rgba(0, 16, 16, 0.7);
}
.ns-live-grid > div {
  display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; color: var(--hero-fg);
  background: linear-gradient(160deg, var(--hero-2), var(--hero));
  min-width: 0; transition: padding 0.2s ease;
}
/* Fast høyde på hver linje: lengre eller kortere tekst skal aldri flytte noe */
.ns-live-grid > div > span, .ns-live-grid small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ns-live-grid > div > span { font-size: 12px; color: var(--hero-muted); font-weight: 600; }
.ns-live-grid b { font-size: clamp(16px, 4.6vw, 26px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.15; font-variant-numeric: tabular-nums; }
.ns-live-grid b.txt-debt { color: #ff9b92; }
.ns-live-grid.is-empty b, .ns-live-grid.is-empty b.txt-debt { color: var(--hero-muted); transition: color 0.3s; }
.ns-live-grid small { font-size: 12px; line-height: 1.4; color: var(--hero-muted); font-variant-numeric: tabular-nums; }
.ns-note { margin-top: 8px; }
@media (max-width: 380px) { .ns-live-grid > div { padding-inline: 12px; } }
#w-live-note:empty { display: none; }
#w-live-note .ns-note { margin-top: 0; }

/* Verdier som ruller rolig til nytt tall (roll.js) */
.roll { display: grid; overflow: hidden; min-width: 0; }
.roll > .rv {
  grid-area: 1 / 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: transform 0.38s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.28s ease;
}
.roll > .rv-in { transform: translateY(calc(var(--d, 1) * 75%)); opacity: 0; }
.roll > .rv-out { transform: translateY(calc(var(--d, 1) * -75%)); opacity: 0; }
@media (prefers-reduced-motion: reduce) { .roll > .rv { transition: none; } }
.ns-foot-right { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.ns-foot-right .link { margin: 0; white-space: nowrap; }
.wiz.ns .wiz-foot { flex-wrap: wrap; align-items: center; }
/* Logg inn først */
.ns-login { align-items: stretch; }
.ns-login .gis-slot { justify-content: center; min-height: 48px; }
.ns-points { list-style: none; margin: 0; padding: 12px 0 0; display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); }
.ns-points li { display: flex; align-items: flex-start; gap: 10px; font-size: 14px; }
.ns-points .ic { flex: none; width: 18px; height: 18px; margin-top: 1px; color: var(--accent); }
.ns-skipnote { margin: 0; text-align: center; }
.ns-account .wiz-foot .link { font-weight: 650; }
.choice-opt.armed { border-color: var(--debt); background: color-mix(in srgb, var(--debt) 10%, transparent); }
.choice-opt.armed b { color: var(--debt); }

.ns-hero {
  position: relative; overflow: hidden; padding: 24px; border-radius: 26px; color: var(--hero-fg);
  background: radial-gradient(110% 90% at 100% 0%, rgba(16, 185, 129, 0.32), transparent 58%), linear-gradient(160deg, var(--hero-2), var(--hero) 60%);
  box-shadow: 0 24px 48px -28px rgba(0, 16, 16, 0.65);
}
.ns-hero .eyebrow { color: var(--hero-muted); }
.ns-hero h1 { font-size: clamp(28px, 6vw, 42px); font-weight: 800; letter-spacing: -0.04em; line-height: 1.05; }
.ns-hero h1 span { display: block; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.ns-hero p:last-child { margin-top: 8px; color: var(--hero-muted); font-size: 14px; font-variant-numeric: tabular-nums; }
.ns-slider { display: flex; flex-direction: column; gap: 14px; }
.ns-slider h2 { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; }
.ns-range { display: flex; align-items: center; gap: 14px; }
.ns-range input[type='range'] { flex: 1; min-width: 0; height: 32px; accent-color: var(--green); }
.ns-range output { min-width: 96px; text-align: right; font-size: 22px; font-weight: 800; font-variant-numeric: tabular-nums; }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.ns-aha { display: flex; flex-direction: column; gap: 10px; min-height: 92px; }
.ns-hint { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 14px; }
.ns-hint .ic { color: var(--accent); }
.ns-compare { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; }
.ns-compare > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
.ns-compare > div.good { background: var(--accent-soft); }
.ns-compare span { font-size: 12px; font-weight: 600; color: var(--muted); }
.ns-compare b { font-size: clamp(17px, 4vw, 21px); font-weight: 800; letter-spacing: -0.02em; }
.ns-compare .good b { color: var(--accent); }
.ns-arrow { color: var(--faint); }
.ns-win { display: flex; align-items: center; gap: 10px; font-size: 16px; }
.ns-win .ic { color: var(--accent); flex: none; }
.ns-win b { font-weight: 800; }
.ns-more-cats { align-self: flex-start; margin: 0; }
.ns-moreinfo { border-top: 1px solid var(--line); padding-top: 12px; }
.ns-moreinfo summary { cursor: pointer; font-weight: 700; font-size: 14px; margin-bottom: 12px; }
/* Opprinnelig lånebeløp (valgfritt) i oppsettet */
.ns-orig { margin-top: 2px; }
.ns-orig summary { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; cursor: pointer; list-style: none; font-size: 14px; font-weight: 650; color: var(--accent); -webkit-tap-highlight-color: transparent; }
.ns-orig summary::-webkit-details-marker { display: none; }
.ns-orig summary .ic { width: 15px; height: 15px; transition: transform 0.15s; }
.ns-orig[open] summary .ic { transform: rotate(45deg); }
.ns-orig summary .muted { font-weight: 500; }
.ns-orig[open] summary { margin-bottom: 8px; }
.loan-orig { align-self: flex-start; justify-self: start; display: inline-flex; align-items: flex-start; justify-content: flex-start; gap: 6px; width: auto; max-width: 100%; padding: 4px 0; font-size: 13px; text-align: left; line-height: 1.35; }
.loan-orig .ic { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.loan-orig:hover .ic { transform: none; }
.ns-sums { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); }
.ns-sum { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; color: var(--muted); font-variant-numeric: tabular-nums; }
.ns-sum b { color: var(--fg); font-weight: 700; }
/* «Har du fått med alt?» i budsjettsteget */
.ns-check { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 16px; border: 1px solid color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.ns-check > b { font-size: 15px; }
.ns-check p { margin: 0; font-size: 13.5px; color: var(--muted); }
.ns-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
.ns-chip {
  display: inline-flex; align-items: center; gap: 5px; min-height: 36px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--fg); font: inherit; font-size: 13.5px; font-weight: 650; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ns-chip .ic { width: 14px; height: 14px; color: var(--accent); }
.ns-chip:hover { border-color: var(--accent); }
.ns-chip:active { transform: scale(0.98); }
.ns-sum.total { padding-top: 8px; margin-top: 2px; border-top: 1px solid var(--line); color: var(--fg); font-weight: 700; }
.ns-sum.total b { font-size: 18px; font-weight: 800; }
.ns-sticky { position: sticky; top: 8px; z-index: 6; }
/* Bakgrunn rundt det klistrede, så det som ruller under ikke stikker fram over og ved siden av */
.ns-sticky::before { content: ''; position: absolute; inset: -8px -40px 0; z-index: -1; background: var(--bg); pointer-events: none; }
.ns-sticky:empty { display: none; }
.ns-bar {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 12px; padding: 12px 16px; border-radius: 16px;
  color: var(--hero-fg); background: linear-gradient(160deg, var(--hero-2), var(--hero)); box-shadow: 0 14px 30px -20px rgba(0, 16, 16, 0.7);
}
.ns-bar > span { font-size: 12.5px; color: var(--hero-muted); font-weight: 600; }
.ns-bar b { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.ns-bar b.txt-debt { color: #ff9b92; }
.ns-bar em { grid-column: 1 / -1; display: inline-flex; align-items: center; gap: 5px; font-style: normal; font-size: 13px; font-weight: 700; white-space: nowrap; transition: color 0.25s; }
.ns-bar b { text-align: right; }
.ns-bar em.wait { color: var(--hero-muted); font-weight: 600; }
@media (min-width: 720px) {
  .ns-bar { grid-template-columns: auto auto minmax(0, 1fr); }
  .ns-bar b { text-align: left; }
  .ns-bar em { grid-column: 3; justify-self: end; }
}
.ns-bar em .ic { width: 15px; height: 15px; }
.ns-bar em.good { color: var(--mint); }
.ns-bar em.warn { color: #f7c66b; }
.ns-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 720px) { .ns-cats { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
#w-budget .btn { margin-top: 8px; }

/* ---------- Funnet til deg ---------- */
.found-card { display: flex; flex-direction: column; gap: 14px; }
.found-head { display: flex; align-items: flex-start; gap: 14px; }
.found-head h2 { font-size: clamp(20px, 3.4vw, 26px); font-weight: 800; letter-spacing: -0.03em; }
.found-head .eyebrow { margin-bottom: 2px; }
.found-head .muted { font-size: 13.5px; margin-top: 2px; }
.found-total { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; font-variant-numeric: tabular-nums; }
.found-ic { display: grid; place-items: center; flex: none; width: 42px; height: 42px; border-radius: 13px; background: var(--grad); color: var(--accent-ink); }
.found-list { display: flex; flex-direction: column; }
.found-list li {
  display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; grid-template-areas: 'ic txt amt' 'ic txt btn';
  align-items: center; gap: 2px 12px; padding: 12px 0; border-top: 1px solid var(--line);
}
.found-list.prompts li { grid-template-areas: 'ic txt btn' 'ic txt btn'; }
.found-list li > div { grid-area: txt; min-width: 0; display: flex; flex-direction: column; }
.found-list b { font-size: 14.5px; }
.found-list small { font-size: 12.5px; color: var(--muted); }
.found-list strong { grid-area: amt; justify-self: end; font-size: 16px; font-weight: 800; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }
.found-list strong small { font-weight: 600; color: var(--muted); }
.found-list .btn { grid-area: btn; justify-self: end; }
.found-item-ic { grid-area: ic; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); }
.found-item-ic .ic { width: 17px; height: 17px; }
@media (min-width: 720px) {
  .found-list li { grid-template-columns: 34px minmax(0, 1fr) auto auto; grid-template-areas: 'ic txt amt btn'; }
  .found-list.prompts li { grid-template-areas: 'ic txt btn btn'; }
}

/* ---------- Skattekortet ---------- */
.tax { display: flex; flex-direction: column; gap: 10px; }
.tax a { color: var(--accent); font-weight: 600; }
.tax-hero { padding: 16px 18px; border-radius: 18px; background: var(--surface-2); }
.tax-big { font-size: clamp(22px, 4vw, 28px); font-weight: 800; letter-spacing: -0.03em; line-height: 1.2; margin: 2px 0 4px; }
.tax-rows { display: flex; flex-direction: column; }
.tax-rows li {
  display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 4px 10px;
  padding: 10px 0; border-top: 1px solid var(--line);
}
.tax-rows li:first-child { border-top: 0; }
.tax-rows li > div { display: flex; flex-direction: column; min-width: 0; }
.tax-rows b { font-size: 14.5px; }
.tax-rows small { font-size: 12.5px; color: var(--muted); }
.tax-rows strong { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.tax-sums { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 13px; }
.tax-sums li { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.tax-sums b { color: var(--fg); font-variant-numeric: tabular-nums; white-space: nowrap; }
.tax-sums li.sum { margin-top: 4px; padding-top: 6px; border-top: 1px solid var(--line); color: var(--fg); font-weight: 700; }
.tax-sums li.sum b { color: var(--accent); }
.tax-loans { border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; }
.tax-loans summary { display: flex; align-items: center; gap: 10px; padding: 10px 0; cursor: pointer; list-style: none; }
.tax-loans summary::-webkit-details-marker { display: none; }
.tax-loans summary > span { display: flex; flex-direction: column; }
.tax-loans summary small { font-size: 12.5px; color: var(--muted); }
.tax-loans summary .ic { width: 16px; height: 16px; color: var(--faint); transition: transform 0.2s; flex: none; }
.tax-loans[open] summary .ic { transform: rotate(90deg); }
.tax-loans > p { margin: 4px 0 10px; }
.tax-loan-rows li { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'txt amt' 'share share'; }
.tax-loan-rows li > div { grid-area: txt; }
.tax-loan-rows strong { grid-area: amt; justify-self: end; font-size: 14.5px; }
.tax-ctl { grid-area: share; justify-self: start; display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.tax-ctl select {
  height: 32px; padding: 0 24px 0 8px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  color: var(--fg); font: inherit; font-size: 12.5px; font-weight: 600; max-width: 100%;
}
/* Når ble lånet tatt opp? Spørsmålet står tydelig til det er svart på (tax.js: loanStart) */
.tax-safe { margin: -4px 0 0; }
.tax-ask { align-items: flex-start; }
.tax-ask b { display: block; font-size: 14px; }
.tax-ask p { margin: 2px 0 8px; font-size: 13px; color: var(--muted); }
.tax-ask-btns { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.tax-ctl select.ask { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.tax-loan-rows li { grid-template-areas: 'txt amt' 'share share' 'ytd ytd'; }
.tax-ytd { grid-area: ytd; display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.tax-ytd > span:first-child { display: flex; flex-direction: column; }
.tax-ytd small { font-size: 12px; color: var(--faint); }
.tax-ytd-in { position: relative; display: inline-flex; align-items: center; }
.tax-ytd-in input {
  width: 132px; height: 34px; padding: 0 30px 0 10px; border-radius: 9px; border: 1px solid var(--line); background: var(--surface);
  color: var(--fg); font: inherit; font-size: 16px; font-weight: 650; text-align: right; font-variant-numeric: tabular-nums;
}
.tax-ytd-in input::placeholder { font-size: 13px; font-weight: 500; color: var(--faint); }
.tax-ytd-in i { position: absolute; right: 9px; font-style: normal; font-size: 12px; color: var(--faint); pointer-events: none; }
.tax-bsu-ytd { padding: 10px 0 2px; border-top: 1px solid var(--line); margin-top: -4px; }
.tax-steps { display: flex; flex-direction: column; gap: 6px; padding-left: 20px; list-style: decimal; font-size: 14px; }
.tax-steps li::marker { color: var(--accent); font-weight: 700; }
.tax-strip { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.tax-strip > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); min-width: 0; }
.tax-strip span { font-size: 12px; color: var(--muted); }
.tax-strip b { font-size: 17px; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (max-width: 560px) {
  .tax-strip { grid-template-columns: 1fr; gap: 6px; }
  .tax-strip > div { flex-direction: row; justify-content: space-between; align-items: baseline; padding: 10px 12px; }
}
@media (min-width: 640px) {
  .tax-loan-rows li, .tax-loan-rows li.tax-unknown { grid-template-areas: 'txt amt' 'txt share' 'ytd ytd'; }
  .tax-ctl { justify-self: end; justify-content: flex-end; margin-top: 0; }
}

/* ---------- Innbetalinger ---------- */
.smart-pay { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }
.smart-pay p { margin: 0; }
.loan-est { display: flex; align-items: center; gap: 6px; margin-top: -2px; font-size: 12.5px; color: var(--muted); }
.loan-est .ic { width: 14px; height: 14px; flex: none; }
.loan-est.warn { color: var(--warn); font-weight: 600; }
.loan-actions { display: flex; justify-content: flex-end; margin-top: 8px; }
.pay-loans { display: flex; flex-direction: column; gap: 6px; }
.pay-loan {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.pay-loan input { position: absolute; opacity: 0; pointer-events: none; }
.pay-loan:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.pay-loan:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.pay-loan > span:last-child { display: flex; flex-direction: column; min-width: 0; }
.pay-loan b { font-size: 14.5px; }
.pay-loan small { font-size: 12.5px; color: var(--muted); }
.pay-loan em { font-style: normal; color: var(--accent); font-weight: 700; }
.pay-effect { display: flex; flex-direction: column; gap: 2px; padding: 14px 16px; border-radius: 16px; background: var(--surface-2); min-height: 64px; justify-content: center; }
.pay-effect span { font-size: 13.5px; color: var(--muted); }
.pay-big { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; color: var(--accent); }
.pay-list { display: flex; flex-direction: column; }
.pay-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; padding: 6px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pay-list li:first-child { border-top: 0; }
.pay-list span { color: var(--muted); }
.pay-list b { font-variant-numeric: tabular-nums; }
.toggle-row { display: flex; align-items: flex-start; gap: 12px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); cursor: pointer; }
.toggle-row[hidden] { display: none; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row > span:last-child { display: flex; flex-direction: column; gap: 2px; }
.toggle-row b { font-size: 14px; }
.toggle-row small { font-size: 12.5px; color: var(--muted); }
.toggle-ui { flex: none; position: relative; width: 40px; height: 24px; border-radius: 999px; background: var(--line); transition: background 0.2s; margin-top: 1px; }
.toggle-ui::after { content: ''; position: absolute; top: 3px; left: 3px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / 0.25); transition: transform 0.2s; }
.toggle-row input:checked + .toggle-ui { background: var(--accent); }
.toggle-row input:checked + .toggle-ui::after { transform: translateX(16px); }
.toggle-row input:focus-visible + .toggle-ui { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle-row, .pay-loan { position: relative; }
.pay-big.pay-meh { color: var(--warn); }

/* «Jeg har betalt ekstra»: ett lån eller flere, og hva det betyr mot planen */
.pay-one, .pay-many { display: flex; flex-direction: column; gap: 14px; }
.form.split .pay-one, .form:not(.split) .pay-many { display: none; }
.pay-many > .field-label { margin: 0; }
.pay-split { display: flex; flex-direction: column; gap: 6px; }
.pay-split-row { display: grid; grid-template-columns: auto minmax(0, 1fr) 128px; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); }
.pay-split-row:focus-within { border-color: var(--accent); }
.pay-split-name { display: flex; flex-direction: column; min-width: 0; }
.pay-split-name b { font-size: 14px; }
.pay-split-name small { font-size: 12px; color: var(--muted); line-height: 1.35; }
.pay-split-row .field-input { height: 42px; padding: 0 10px; }
.pay-split-row .field-input input { text-align: right; }
@media (max-width: 380px) { .pay-split-row { grid-template-columns: auto minmax(0, 1fr) 108px; } }
.pay-mode { align-self: flex-start; margin-top: -4px; font-size: 13.5px; }
.plan-dev { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; align-items: start; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); }
.plan-dev .ic { width: 18px; height: 18px; margin-top: 1px; }
.plan-dev > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.plan-dev b { font-size: 14px; }
.plan-dev small { font-size: 13px; color: var(--muted); line-height: 1.45; }
.plan-dev.tone-good { background: var(--accent-soft); } .plan-dev.tone-good .ic { color: var(--accent); }
.plan-dev.tone-warn { background: var(--warn-soft); } .plan-dev.tone-warn .ic { color: var(--warn); }
.plan-dev.tone-info .ic { color: var(--c-buffer); }
/* Hjem: planen mot det som er betalt, lån for lån */
.plan-dev-card { display: flex; flex-direction: column; gap: 12px; }
.dev-head { display: flex; flex-direction: column; gap: 2px; }
.dev-head b { font-size: 15px; }
.dev-head small { font-size: 12.5px; color: var(--muted); }
.dev-rows { display: flex; flex-direction: column; gap: 10px; }
.dev-rows li { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr) auto; gap: 10px; align-items: center; }
.dev-name { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dev-name b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dev-bars { position: relative; height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.dev-bars i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 99px; }
.dev-bars .dev-plan { background: color-mix(in srgb, var(--fg) 14%, transparent); }
.dev-bars .dev-paid { background: var(--accent); height: 6px; top: 2px; }
.dev-amt { display: flex; flex-direction: column; align-items: flex-end; font-variant-numeric: tabular-nums; }
.dev-amt b { font-size: 13.5px; }
.dev-amt small { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.dev-legend { display: flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: -4px; }
.dev-legend i { display: inline-block; width: 14px; height: 6px; border-radius: 99px; }
.dev-legend i + * { margin-right: 6px; }
.dev-legend .dev-paid { background: var(--accent); } .dev-legend .dev-plan { background: color-mix(in srgb, var(--fg) 14%, transparent); margin-left: 6px; }
.plan-dev-card .btn-row { margin-top: -2px; }

/* ---------- Lån utenfor planen ---------- */
.hero-note { display: flex; align-items: flex-start; gap: 6px; margin-top: 12px; font-size: 12.5px; color: var(--muted); }
.hero-note .ic { width: 14px; height: 14px; flex: none; margin-top: 2px; }
.hero-note a { color: inherit; font-weight: 700; }
.status-out { background: var(--surface-2); color: var(--muted); }
.loan-card.is-outside { background: color-mix(in srgb, var(--surface-2) 45%, var(--surface)); }
.loan-out { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; font-size: 12.5px; color: var(--muted); }
.loan-out .link { white-space: nowrap; flex: none; }
.kpi-missing { color: var(--warn); font-weight: 600; }

/* ---------- Planen går ikke opp ---------- */
.mp-bar-wrap { position: relative; }
.mp-limit { position: absolute; top: -4px; bottom: 10px; width: 0; border-left: 2px dashed var(--debt); }
.mp-limit em { position: absolute; top: -18px; left: 0; transform: translateX(-50%); font-style: normal; font-size: 11px; font-weight: 700; color: var(--debt); white-space: nowrap; }
.mp-over { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--debt-soft); }
.mp-over > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mp-over b { color: var(--debt); }
.mp-over small { font-size: 12.5px; color: var(--muted); }
@media (max-width: 560px) { .mp-over { flex-direction: column; align-items: stretch; } }
.pf { display: flex; flex-direction: column; gap: 10px; }
.pf-calc { display: flex; flex-direction: column; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); font-size: 14px; }
.pf-line { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; }
.pf-line b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.pf-line.minus { color: var(--muted); }
.pf-line.minus b { color: var(--fg); font-weight: 600; }
.pf-line.sum { margin-top: 4px; padding-top: 8px; border-top: 1px solid var(--line); font-weight: 800; }
.pf-line.bad, .pf-line.bad b { color: var(--debt); }
.pf-cause { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); font-size: 14px; }
.pf-changes { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; padding: 4px 14px; }
.pf-change { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14px; }
.pf-change:first-child { border-top: 0; }
.pf-change > span:first-child { display: flex; flex-direction: column; }
.pf-change small { font-size: 12px; color: var(--muted); }
.pf-change s { color: var(--muted); }
.pf-checks { display: flex; flex-direction: column; gap: 8px; padding-left: 18px; list-style: disc; font-size: 13.5px; color: var(--muted); }
.pf-checks b { color: var(--fg); }
#pf-fit { display: flex; flex-direction: column; gap: 10px; }
.pf .btn[data-pf="apply"] { align-self: flex-start; }
/* Prioritering: trygghet først eller gjeld først */
.prio { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
@media (max-width: 480px) { .prio { grid-template-columns: 1fr; } }
.prio-opt { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; }
.prio-opt input { position: absolute; opacity: 0; pointer-events: none; }
.prio-opt::before { content: ""; flex: none; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--line-strong, var(--muted)); box-sizing: border-box; }
.prio-opt:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.prio-opt:has(input:checked)::before { border: 5px solid var(--accent); }
.prio-opt:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.prio-opt > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.prio-opt b { font-size: 14.5px; }
.prio-opt small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.ladder-prio { display: flex; align-items: center; gap: 12px; margin: 2px 0 12px; }
.ladder-prio .seg { flex: 1; max-width: 340px; }

/* Google-knappen kunne ikke vises: forklaring og «Prøv igjen» */
.gis-error { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); }
.gis-error p { margin: 0; color: var(--fg); line-height: 1.45; }

/* ---------- Nivå og prestasjoner ---------- */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
:root {
  --t-bronse-a: #e3a776; --t-bronse-b: #a9622f; --t-bronse-ink: #3d1d06;
  --t-solv-a: #f1f4f6; --t-solv-b: #9da9b3; --t-solv-ink: #1f2b33;
  --t-gull-a: #ffe08a; --t-gull-b: #d4931a; --t-gull-ink: #4a2f00;
  --t-diamant-a: #9af3d2; --t-diamant-b: #5aa2f2; --t-diamant-ink: #001010;
}

/* Merkene: skjold i kategorifarge, trinnet vises med vinkler, stjerne, krone og laurbær (public/js/badge.js) */
.cat-start { --cat: #ea7c14; } .cat-debt { --cat: #10a874; } .cat-habit { --cat: #8b45e0; }
.cat-save { --cat: #169fbe; } .cat-smart { --cat: #dc3f8a; } .cat-secret { --cat: #5d6488; }
/* Merkene i Prestasjoner er svg.badge. Ikonene for lånetyper (span.badge, over) skal ikke arve dette. */
svg.badge { display: block; flex: none; height: auto; overflow: visible; filter: drop-shadow(0 3px 4px rgb(0 0 0 / 0.22)); }
.badge-xs { width: 30px; } .badge-sm { width: 40px; } .badge-md { width: 58px; } .badge-lg { width: 84px; } .badge-xl { width: 132px; }
svg.badge.locked { filter: grayscale(1); opacity: 0.38; }
:root[data-theme='dark'] svg.badge.locked { opacity: 0.45; }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) svg.badge.locked { opacity: 0.45; } }
svg.badge.st-6:not(.locked) { filter: drop-shadow(0 3px 5px rgb(0 0 0 / 0.25)) drop-shadow(0 0 10px rgb(255 205 70 / 0.35)); }
@media (prefers-reduced-motion: no-preference) {
  .badge-shine { animation: badge-shine 3.6s ease-in-out infinite; }
}
@keyframes badge-shine { 0% { transform: skewX(-18deg) translateX(0); } 55%, 100% { transform: skewX(-18deg) translateX(200px); } }

/* Nivåring og XP */
.lvl-ring { position: relative; flex: none; display: grid; place-items: center; }
.lvl-ring svg { position: absolute; inset: 0; }
.lvl-ring-bg { stroke: var(--surface-2); }
.lvl-ring-fg { stroke: var(--accent); transition: stroke-dashoffset 0.9s cubic-bezier(0.2, 0.8, 0.2, 1); }
.lvl-ring b { position: relative; font-size: 22px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.lvl-ring.big b { font-size: 36px; }
.xpbar { display: block; height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.xpbar i { display: block; height: 100%; border-radius: 99px; background: var(--grad); transition: width 0.6s cubic-bezier(0.2, 0.8, 0.2, 1); }
.mini-bar { display: block; height: 5px; border-radius: 99px; background: var(--surface-2); overflow: hidden; margin: 6px 0 3px; }
.mini-bar i { display: block; height: 100%; border-radius: 99px; background: var(--accent); }

/* Kortet på Hjem */
.lvl-card { display: flex; flex-direction: column; gap: 14px; }
.lvl-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px; width: 100%; text-align: left; padding: 0; background: none; border: 0; color: inherit; cursor: pointer; border-radius: 16px; }
.lvl-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.lvl-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.lvl-text small { font-size: 12px; color: var(--muted); font-weight: 600; }
.lvl-text b { font-size: 17px; font-weight: 800; letter-spacing: -0.02em; }
.lvl-text .xpbar { margin: 3px 0 1px; }
.lvl-side { display: flex; align-items: center; gap: 8px; color: var(--muted); }
.lvl-side > .ic { width: 18px; height: 18px; }
.lvl-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 10px; }
.lvl-chips { display: inline-flex; gap: 6px; }
.streak, .lvl-count { position: relative; display: inline-flex; align-items: center; gap: 3px; height: 24px; padding: 0 8px; border-radius: 99px; font-size: 12.5px; }
.streak { background: var(--gold-soft); color: var(--gold); }
.lvl-count { background: var(--surface-2); color: var(--fg); }
.streak .ic, .lvl-count .ic { width: 15px; height: 15px; }
.streak { font-weight: 600; }
.lvl-next { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 10px 12px; border-radius: 16px; background: var(--surface-2); border: 0; color: inherit; text-align: left; cursor: pointer; font: inherit; }
.lvl-next:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.lvl-next .track-n { align-self: center; }
.lvl-next-text { display: flex; flex-direction: column; min-width: 0; }
.lvl-next-text small { font-size: 12px; color: var(--muted); }
.lvl-next-text b { font-size: 14px; }
.lvl-next .mini-bar { background: var(--surface); }

/* Månedens oppdrag */
.quests { display: flex; flex-direction: column; gap: 6px; }
.quests-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 2px; }
.quests-head b { font-size: 14.5px; }
.quests-head span { font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.quest { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 10px 12px; text-align: left;
  border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: inherit; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
button.quest:hover { border-color: var(--accent); }
button.quest:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.quest-check { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; background: var(--surface-2); color: var(--accent); }
.quest-check .ic { width: 17px; height: 17px; }
.quest-text { display: flex; flex-direction: column; min-width: 0; }
.quest-text b { font-size: 14px; }
.quest-text small { font-size: 12.5px; color: var(--muted); }
.quest-xp { font-style: normal; font-size: 12px; font-weight: 700; color: var(--accent); white-space: nowrap; }
.quest.done { cursor: default; background: var(--surface-2); border-color: transparent; }
.quest.done .quest-check { background: var(--accent); color: var(--accent-ink); }
.quest.done .quest-text b { text-decoration: line-through; text-decoration-color: var(--faint); color: var(--muted); }
.quest.done .quest-xp { color: var(--muted); }
.quests-bonus { display: flex; align-items: center; gap: 8px; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.quests-bonus .ic { width: 16px; height: 16px; color: var(--gold); flex: none; }
.quests-bonus.on { color: var(--fg); font-weight: 700; }

/* Siden «Prestasjoner» */
.lvl-hero { position: relative; overflow: hidden; isolation: isolate; color: var(--hero-fg); border: 0;
  background: radial-gradient(120% 100% at 100% 0%, rgba(16, 185, 129, 0.32), transparent 60%), linear-gradient(160deg, var(--hero-2), var(--hero) 60%); }
.lvl-hero-top { display: flex; align-items: center; gap: 18px; }
.lvl-hero .lvl-ring-bg { stroke: rgba(255, 255, 255, 0.12); }
.lvl-hero .lvl-ring-fg { stroke: var(--mint); }
.lvl-hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.lvl-hero .eyebrow { color: var(--mint); }
.lvl-hero h2 { font-size: clamp(24px, 3.4vw, 32px); font-weight: 800; letter-spacing: -0.035em; line-height: 1.05; }
.lvl-hero .xpbar { background: rgba(255, 255, 255, 0.12); height: 10px; }
.lvl-hero-sub { font-size: 13px; color: var(--hero-muted); }
.lvl-hero-sub b { color: var(--hero-fg); }
.lvl-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.lvl-stats > div { padding: 10px 12px; border-radius: 14px; background: rgba(255, 255, 255, 0.06); }
.lvl-stats dt { font-size: 11.5px; color: var(--hero-muted); }
.lvl-stats dd { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; margin-top: 2px; }
.lvl-stats dd small { font-size: 12px; font-weight: 600; color: var(--hero-muted); letter-spacing: 0; }
@media (max-width: 560px) { .lvl-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); } .lvl-hero-top { gap: 14px; } .lvl-hero .lvl-ring.big { width: 80px !important; height: 80px !important; } .lvl-hero .lvl-ring.big svg { width: 80px; height: 80px; } .lvl-ring.big b { font-size: 30px; } }
.lvl-demo { margin-top: 14px; font-size: 12.5px; color: var(--hero-muted); }
.ach-filter { margin-bottom: 10px; }
.ach-cat + .ach-cat { margin-top: 18px; }
.ach-cat h3 { font-size: 14px; font-weight: 700; margin-bottom: 10px; display: flex; align-items: baseline; gap: 8px; }
.ach-cat h3 small { font-size: 12px; font-weight: 600; color: var(--muted); }
.ach-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 10px; }
.ach { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); }
.ach.on { background: linear-gradient(180deg, color-mix(in srgb, var(--accent-soft) 45%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }
.ach-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ach-body b { font-size: 14px; }
.ach-body small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.ach-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 6px; }
.ach .mini-bar { margin: 8px 0 0; }
.ach-body .ach-when { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--accent); }
.ach-when .ic { width: 14px; height: 14px; }
.ach:not(.on) .ach-body b { color: var(--fg); }
.game-page[data-filter='on'] #ach-all .ach[data-state='off'], .game-page[data-filter='off'] #ach-all .ach[data-done='1'] { display: none; }
.game-page[data-filter='on'] .ach-cat:not(:has(.ach[data-state='on'])), .game-page[data-filter='off'] .ach-cat:not(:has(.ach[data-done='0'])) { display: none; }
.lvl-ladder { display: flex; flex-direction: column; }
.lvl-ladder li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto 18px; gap: 10px; align-items: center; padding: 7px 4px; border-top: 1px solid var(--line); font-size: 13.5px; color: var(--muted); }
.lvl-ladder li:first-child { border-top: 0; }
.lvl-ladder li.on { color: var(--fg); }
.lvl-ladder li .ic { width: 16px; height: 16px; color: var(--accent); }
.ladder-lvl { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 8px; background: var(--surface-2); font-weight: 800; font-size: 12.5px; }
.lvl-ladder li.on .ladder-lvl { background: var(--accent-soft); color: var(--accent); }
.lvl-ladder li.cur { background: var(--accent-soft); border-radius: 12px; border-top-color: transparent; }
.lvl-ladder li.cur + li { border-top-color: transparent; }
.lvl-ladder li.cur .ladder-lvl { background: var(--accent); color: var(--accent-ink); }
.lvl-ladder small { font-variant-numeric: tabular-nums; font-size: 12px; }
.journey { display: flex; flex-direction: column; }
.journey li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); }
.journey li:first-child { border-top: 0; }
.journey span { display: flex; flex-direction: column; min-width: 0; }
.journey b { font-size: 14px; }
.journey small { font-size: 12.5px; color: var(--muted); }
.journey time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.game-note { margin-top: 14px; }

/* Prestasjoner med trinn */
.ach.track { display: block; padding: 0; }
.ach.track.on { background: linear-gradient(180deg, color-mix(in srgb, var(--cat) 9%, var(--surface)), var(--surface)); border-color: color-mix(in srgb, var(--cat) 28%, var(--line)); }
.ach.track.done { border-color: color-mix(in srgb, #e0a91b 55%, var(--line)); }
.track-btn { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 14px; align-items: start; width: 100%; padding: 12px 14px 12px 10px; border: 0; background: none; color: inherit; text-align: left; font: inherit; cursor: pointer; border-radius: 16px; }
.track-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.track-badge { padding-top: 2px; }
.track-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.track-n { flex: none; font-style: normal; font-size: 11.5px; font-weight: 700; padding: 3px 8px; border-radius: 99px; white-space: nowrap; color: var(--cat, var(--accent));
  background: color-mix(in srgb, var(--cat, var(--accent)) 14%, transparent); font-variant-numeric: tabular-nums; }
.track-n.max { color: #7a4d00; background: linear-gradient(135deg, #ffe28a, #f5b93a); }
.pips { display: flex; gap: 4px; margin: 5px 0 4px; }
.pips i { width: 18px; height: 6px; border-radius: 99px; background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.pips i.on { background: var(--cat); box-shadow: none; }
.track-next { color: var(--fg) !important; }
.track-next span { color: var(--accent); font-weight: 700; white-space: nowrap; }
.ach.track .mini-bar { margin: 7px 0 2px; }
.ach.track .mini-bar i { background: var(--cat); }
.track-prog { font-variant-numeric: tabular-nums; }
.cat-dot { display: inline-block; width: 9px; height: 9px; border-radius: 3px; background: var(--cat); align-self: center; }
.ach-cat h3 { align-items: center; }

/* Merkeveggen. Når kortene står under hverandre, kommer merkene rett etter nivået. */
@media (max-width: 1179px) { .game-page > .lvl-hero { order: -2; } .game-page > .wall-card { order: -1; } }
.badge-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 6px 4px; }
.wall-item { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 8px 2px 6px; border: 0; background: none; color: inherit; font: inherit; cursor: pointer; border-radius: 14px; transition: background 0.15s, transform 0.15s; }
.wall-item:hover { background: var(--surface-2); }
.wall-item:active { transform: scale(0.97); }
.wall-item:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.wall-item small { font-size: 11.5px; line-height: 1.25; color: var(--muted); text-align: center; max-width: 11ch; }
@media (max-width: 560px) { .badge-wall { grid-template-columns: repeat(4, minmax(0, 1fr)); } .wall-item .badge-md { width: 52px; } }

/* Arket med alle trinn */
.track-hero { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 16px; align-items: center; padding: 4px 0 14px; }
.track-hero .eyebrow { color: var(--cat); }
.track-hero-n { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.track-hero .badge-xl { width: 116px; }
.track-steps { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.track-steps li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 2px; border-bottom: 1px solid var(--line); }
.track-steps li.next { background: color-mix(in srgb, var(--cat) 8%, transparent); border-radius: 12px; border-bottom-color: transparent; padding-left: 8px; padding-right: 8px; }
.track-step-body { display: flex; flex-direction: column; min-width: 0; }
.track-step-body b { font-size: 14px; }
.track-step-body small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.track-step-body .ach-when { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; color: var(--accent); }
.track-step-body .mini-bar i { background: var(--cat); }
.track-xp { font-style: normal; font-size: 12px; font-weight: 700; color: var(--muted); white-space: nowrap; }
.track-steps li.on .track-xp { color: var(--accent); }
.track-sheet > .muted.small { margin-top: 12px; }

/* Feiring */
.sheet-cele .sheet-body { position: relative; }
.cele { position: relative; display: flex; flex-direction: column; gap: 14px; }
.cele-confetti { position: absolute; inset: -40px -8px 0; width: calc(100% + 16px); height: calc(100% + 40px); pointer-events: none; z-index: 2; }
.cele-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 8px 0 4px; }
.cele-hero h3 { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; margin-top: 6px; }
.cele-hero p { color: var(--muted); max-width: 34ch; }
.cele-badge { display: block; animation: medal-pop 0.75s cubic-bezier(0.2, 1.4, 0.4, 1) both; }
.cele-hero .eyebrow { margin-top: 4px; color: var(--cat, var(--accent)); }
.cele-hero h3 { margin-top: 0; }
.cele-hero .pips { justify-content: center; }
.cele-list { display: flex; flex-direction: column; gap: 8px; }
.cele-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); animation: cele-in 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.cele-list li:nth-child(2) { animation-delay: 0.08s; } .cele-list li:nth-child(3) { animation-delay: 0.16s; } .cele-list li:nth-child(4) { animation-delay: 0.24s; } .cele-list li:nth-child(5) { animation-delay: 0.32s; } .cele-list li:nth-child(6) { animation-delay: 0.4s; }
.cele-list span { display: flex; flex-direction: column; min-width: 0; }
.cele-list b { font-size: 14px; }
.cele-list small { font-size: 12.5px; color: var(--muted); }
.cele-level { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 16px; color: var(--hero-fg);
  background: radial-gradient(120% 120% at 100% 0%, rgba(16, 185, 129, 0.35), transparent 60%), linear-gradient(160deg, var(--hero-2), var(--hero)); animation: cele-in 0.5s 0.15s cubic-bezier(0.2, 0.8, 0.2, 1) both; }
.cele-level-n { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; font-size: 24px; font-weight: 800; background: var(--grad); color: var(--accent-ink); }
.cele-level small { font-size: 12px; color: var(--hero-muted); display: block; }
.cele-level b { font-size: 18px; font-weight: 800; letter-spacing: -0.02em; }
.cele-xp { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 13px; font-weight: 700; color: var(--accent); }
.cele-xp .ic { width: 16px; height: 16px; }
.cele-also { margin: 0; text-align: center; font-size: 13px; color: var(--muted); }

/* Liten melding øverst: nytt merke, trinn eller oppdrag (celebrate.js). Stopper ingenting. */
.notice-root {
  position: fixed; z-index: 70; left: 0; right: 0; top: calc(64px + env(safe-area-inset-top, 0px));
  display: flex; justify-content: center; padding-inline: 12px; pointer-events: none;
}
@media (min-width: 1024px) { .notice-root { top: 20px; left: auto; right: 24px; justify-content: flex-end; } }
.notice {
  display: flex; align-items: center; max-width: min(420px, 100%); pointer-events: auto;
  border-radius: 999px; background: var(--surface); border: 1px solid var(--line-strong);
  box-shadow: 0 14px 34px -14px rgba(0, 16, 16, 0.45);
  opacity: 0; transform: translateY(-10px) scale(0.98); transition: opacity 0.22s, transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.notice.show { opacity: 1; transform: none; }
.notice-main {
  display: flex; align-items: center; gap: 10px; min-width: 0; padding: 6px 4px 6px 8px; border: 0; background: none;
  text-align: left; cursor: pointer; border-radius: 999px; -webkit-tap-highlight-color: transparent;
}
.notice-main > .ic { flex: none; width: 15px; height: 15px; color: var(--faint); }
.notice-badge { flex: none; display: grid; place-items: center; width: 34px; height: 34px; }
.notice-badge .badge { width: 30px; height: auto; }
.notice-ic { flex: none; display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.notice-ic .ic { width: 16px; height: 16px; }
.notice-txt { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.notice-txt small { font-size: 11.5px; font-weight: 700; color: var(--accent); letter-spacing: 0.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-txt b { font-size: 14px; font-weight: 750; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-x { flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin-right: 4px; border: 0; border-radius: 50%; background: none; color: var(--faint); cursor: pointer; }
.notice-x:hover { background: var(--surface-2); color: var(--fg); }
.notice-x .ic { width: 14px; height: 14px; }
@media (prefers-reduced-motion: reduce) { .notice { transition: opacity 0.2s; transform: none; } }
@keyframes medal-pop { 0% { transform: scale(0.3) rotate(-25deg); opacity: 0; } 60% { transform: scale(1.12) rotate(6deg); opacity: 1; } 100% { transform: scale(1) rotate(0); } }
@keyframes cele-in { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .cele-badge, .cele-list li, .cele-level, .track-steps li.next .badge { animation: none; }
  .xpbar i, .lvl-ring-fg { transition: none; }
}

/* Registrer: fast knapp for «Hva har skjedd?» */
.fab { position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 35; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 18px;
  border: 0; background: var(--grad); color: var(--accent-ink); box-shadow: 0 10px 24px -8px rgba(16, 185, 129, 0.6), 0 2px 6px rgba(0, 16, 16, 0.18); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.fab .ic { width: 26px; height: 26px; }
.fab:active { transform: scale(0.96); }
.fab:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
body[data-mode='wizard'] .fab, html.sheet-open .fab { display: none; }
.side-add { display: none; }
@media (min-width: 1024px) {
  .fab { display: none; }
  .side-add { display: inline-flex; justify-content: center; width: calc(100% - 8px); margin: 4px 4px 14px; }
}
/* Plass til knappen under siste kort på mobil */
@media (max-width: 1023px) { .view { padding-bottom: 96px; } }
.quick { display: flex; flex-direction: column; gap: 8px; }
.quick-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; width: 100%; padding: 14px; text-align: left;
  border-radius: 16px; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.quick-row:hover { border-color: var(--accent); }
.quick-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.quick-ic { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); color: var(--accent); }
.quick-ic .ic { width: 22px; height: 22px; }
.quick-row b { display: block; font-size: 15px; }
.quick-row small { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.quick-row > .ic { width: 18px; height: 18px; color: var(--muted); }

/* Ord og uttrykk: trykk på et ord for forklaring */
.term { display: inline; padding: 0; margin: 0; border: 0; background: none; font: inherit; color: inherit; cursor: help;
  text-decoration: underline dotted; text-decoration-color: color-mix(in srgb, currentColor 55%, transparent); text-underline-offset: 3px; }
.term:hover { text-decoration-color: var(--accent); }
.term:focus-visible, .term-i:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.term-i { display: inline-grid; place-items: center; width: 22px; height: 22px; margin: -3px 0 -3px 2px; padding: 0; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: help; vertical-align: middle; }
.term-i .ic { width: 16px; height: 16px; }
.term-i:hover { color: var(--accent); }
.term-pop { position: fixed; z-index: 90; padding: 14px 16px 16px; border-radius: 16px; background: var(--surface); color: var(--fg); border: 1px solid var(--line);
  box-shadow: 0 18px 40px -12px rgba(0, 16, 16, 0.35); font-size: 14px; line-height: 1.5; animation: cele-in 0.18s ease-out both; }
.term-pop-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.term-pop-head b { font-size: 15px; line-height: 1.3; padding-top: 3px; }
.term-pop p { color: var(--muted); }
.term-pop p + p { margin-top: 8px; }
.term-ex { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: 12px; background: var(--surface-2); color: var(--fg) !important; font-size: 13.5px; }
.term-ex .ic { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--gold); }
.gloss { display: flex; flex-direction: column; }
.gloss-row { border-top: 1px solid var(--line); }
.gloss-row:first-child { border-top: 0; }
.gloss-row summary { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 12px 2px; cursor: pointer; list-style: none; }
.gloss-row summary::-webkit-details-marker { display: none; }
.gloss-row summary .ic { width: 16px; height: 16px; color: var(--muted); transition: transform 0.2s; }
.gloss-row[open] summary .ic { transform: rotate(90deg); }
.gloss-row p { color: var(--muted); font-size: 14px; margin: 0 2px 10px; }
.gloss-row .term-ex { margin-bottom: 12px; }
@media (prefers-reduced-motion: reduce) { .term-pop { animation: none; } }

/* Året fremover og regninger som ikke kommer hver måned */
.year-empty { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding: 14px; border-radius: 16px; background: var(--surface-2); margin-bottom: 12px; }
.year-empty p { font-size: 14px; color: var(--muted); }
.year-empty b { color: var(--fg); }
.year-sum { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 12px; }
.year-sum > * { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); text-align: left; border: 0; font: inherit; color: inherit; }
.year-sum span { font-size: 12px; color: var(--muted); }
.year-sum b { font-size: 19px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.year-sum small { font-size: 12px; color: var(--muted); }
.year-acc { cursor: pointer; border: 1px dashed var(--line-strong) !important; background: var(--surface) !important; }
.year-acc:hover { border-color: var(--accent) !important; }
@media (max-width: 560px) { .year-sum { grid-template-columns: 1fr 1fr; } .year-acc { grid-column: 1 / -1; } }
.year-list { display: flex; flex-direction: column; margin-top: 4px; }
.year-row { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; align-items: start; padding: 10px 0; border-top: 1px solid var(--line); }
.year-row:first-child { border-top: 0; }
.year-m { display: flex; flex-direction: column; gap: 1px; }
.year-m b { font-size: 14px; }
.year-m small { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.year-row.quiet .year-m b { color: var(--muted); font-weight: 600; }
.year-quiet { font-size: 13px; color: var(--faint); padding-top: 1px; }
.year-ev { display: flex; flex-direction: column; gap: 6px; }
.ev { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; font-size: 13.5px; }
.ev > span { display: flex; align-items: flex-start; gap: 8px; min-width: 0; }
.ev > span > .ic { flex: none; width: 16px; height: 16px; margin-top: 2px; }
.ev > span > span { display: flex; flex-direction: column; }
.ev small { font-size: 12.5px; color: var(--muted); }
.ev > b { font-variant-numeric: tabular-nums; white-space: nowrap; }
.ev-bill > span > .ic { color: var(--warn); }
.ev-loan > span > .ic { color: var(--accent); }
.ev-june > span > .ic, .ev-dec > span > .ic { color: var(--gold); }
.year-row.short .ev-bill > b { color: var(--debt); }
.year-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
@media (max-width: 560px) { .year-row { grid-template-columns: 1fr; gap: 6px; } }
.erow-bill { display: flex; align-items: center; gap: 6px; margin: -2px 0 6px 2px; font-size: 12.5px; color: var(--muted); }
.erow-bill .ic { width: 14px; height: 14px; color: var(--warn); flex: none; }
.erow-exp.bill .ic { transform: none !important; color: var(--warn); }
.month-pick { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.month-opt { height: 40px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font: inherit; font-size: 13.5px; font-weight: 600; text-transform: capitalize; color: var(--fg); cursor: pointer; }
.month-opt.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.month-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.month-presets { margin-top: 8px; }
.bill-sugg { margin-bottom: 4px; }


/* ---------- Kontoutskrift ---------- */
.mp-bank { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; border: 1px dashed var(--line-strong); }
.mp-bank > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.mp-bank small { font-size: 12.5px; color: var(--muted); }
.mp-bank .btn { flex: none; }
.mp-bank-ic, .ns-bank-ic { display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); }
.mp-bank-ic .ic, .ns-bank-ic .ic { width: 18px; height: 18px; }
.ns-bank { display: flex; align-items: center; gap: 12px; width: 100%; margin: 0 0 16px; padding: 12px 14px; border: 1px dashed var(--line-strong); border-radius: 14px; background: none; color: var(--fg); font: inherit; text-align: left; cursor: pointer; }
.ns-bank > span:nth-child(2) { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.ns-bank small { font-size: 12.5px; color: var(--muted); }
.ns-bank > .ic { width: 16px; height: 16px; color: var(--faint); }
.ns-bank:hover { border-color: var(--accent); }

.bank-pick { display: flex; flex-direction: column; gap: 12px; }
.bank-drop { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 18px; border: 1.5px dashed var(--line-strong); border-radius: 18px; background: var(--surface-2); text-align: center; cursor: pointer; transition: border-color 0.15s, background 0.15s; }
.bank-drop:hover, .bank-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.bank-drop b { font-size: 16px; }
.bank-drop small { font-size: 13px; color: var(--muted); max-width: 34ch; }
.bank-drop .btn { margin-top: 8px; pointer-events: none; }
.bank-drop-ic { display: grid; place-items: center; width: 46px; height: 46px; border-radius: 14px; background: var(--surface); color: var(--accent); box-shadow: var(--shadow); }
.bank-drop-ic .ic { width: 22px; height: 22px; }
#bank-file:focus-visible + #bank-view .bank-drop { outline: 2px solid var(--accent); outline-offset: 2px; }
.bank-safe { display: flex; gap: 10px; align-items: flex-start; margin: 0; padding: 12px 14px; border-radius: 14px; background: var(--accent-soft); font-size: 13px; line-height: 1.45; }
.bank-safe .ic { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--accent); }
.bank-how summary { cursor: pointer; font-weight: 650; font-size: 13.5px; color: var(--accent); }
.bank-how ol { margin: 8px 0 0; padding-left: 20px; display: grid; gap: 6px; font-size: 13px; color: var(--muted); line-height: 1.45; }
.bank-err { margin-top: 0; }
.bank-busy { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 40px 0; color: var(--muted); }
.spin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.bank-review { display: flex; flex-direction: column; gap: 14px; }
.bank-period { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: var(--muted); }
.bank-period > span:first-child { display: flex; align-items: center; gap: 6px; }
.bank-period .ic { width: 15px; height: 15px; }
.bank-files { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.bank-file { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 3px 4px 3px 10px; border-radius: 999px; background: var(--surface-2); color: var(--fg); }
.bank-file > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.bank-file small { color: var(--muted); }
.bank-file .link { margin: 0; font-size: 12px; white-space: nowrap; }
.bank-add { margin: 0; cursor: pointer; }
.bank-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bank-kpis > div { display: flex; flex-direction: column; gap: 2px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); min-width: 0; }
.bank-kpis small { font-size: 12px; font-weight: 650; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.bank-kpis strong { font-size: 22px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.bank-kpis span { font-size: 12.5px; color: var(--muted); }
.bank-lead { margin: 0; font-size: 14.5px; line-height: 1.5; }
.bank-demo { margin-top: 0; }
.bank-sec h3 { margin: 0 0 2px; font-size: 15px; }
.bank-sec > p { margin: 0 0 8px; }
.bank-unknown { padding: 12px 14px; border-radius: 16px; background: var(--warn-soft); }
.bank-unknown .bank-m { border-color: color-mix(in srgb, var(--warn) 18%, transparent); }

.bank-cats { display: flex; flex-direction: column; gap: 6px; }
.bank-cat { padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; transition: border-color 0.15s, background 0.15s; }
.bank-cat.on { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.bank-cat-head { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; cursor: pointer; }
.bank-cat-head input, .bank-subs input, .bank-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); }
.bank-cb-ph { display: grid; place-items: center; width: 20px; height: 20px; color: var(--faint); }
.bank-cb-ph .ic { width: 14px; height: 14px; }
.bank-cat-txt { display: flex; flex-direction: column; min-width: 0; }
.bank-cat-txt small, .bank-m-txt small, .bank-subs small { font-size: 12px; color: var(--muted); }
.bank-cat-head > strong, .bank-m > strong, .bank-subs strong { font-variant-numeric: tabular-nums; white-space: nowrap; text-align: right; }
.bank-cat-head > strong small, .bank-m > strong small, .bank-subs strong small { font-size: 11.5px; font-weight: 500; color: var(--muted); }
.bank-bar { position: relative; display: block; height: 5px; margin: 8px 0 0 30px; border-radius: 3px; background: var(--surface-2); }
.bank-bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); opacity: 0.75; }
.bank-bar em { position: absolute; top: -3px; width: 2px; height: 11px; margin-left: -1px; border-radius: 1px; background: var(--fg); opacity: 0.55; }
.bank-detail { margin: 6px 0 0 30px; }
.bank-detail summary { cursor: pointer; font-size: 12.5px; font-weight: 650; color: var(--accent); }
.bank-ms { display: flex; flex-direction: column; }
.bank-m { display: grid; grid-template-columns: 1fr auto; grid-template-areas: 'txt amt' 'move move'; align-items: center; gap: 4px 10px; padding: 8px 0; border-top: 1px solid var(--line); }
.bank-m:first-child { border-top: 0; }
.bank-m-txt { grid-area: txt; display: flex; flex-direction: column; min-width: 0; }
.bank-m-txt b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 650; font-size: 14px; }
.bank-m > strong { grid-area: amt; font-size: 14px; }
.bank-move { grid-area: move; justify-self: start; max-width: 100%; padding: 6px 28px 6px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--fg); font: inherit; font-size: 16px; }
@media (min-width: 640px) {
  .bank-m { grid-template-columns: 1fr auto auto; grid-template-areas: 'txt move amt'; }
  .bank-move { font-size: 13px; justify-self: end; }
}
.bank-subs { display: flex; flex-direction: column; gap: 6px; }
.bank-subs label, .bank-check { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.bank-subs label > span { display: flex; flex-direction: column; min-width: 0; }
.bank-subs label:has(input:checked), .bank-check:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 45%, transparent); }
.bank-subs label:has(input:disabled) { opacity: 0.6; cursor: default; }
.bank-check { grid-template-columns: auto 1fr; margin-top: 8px; font-size: 14px; }
.bank-check small { color: var(--muted); }
.bank-skip summary { display: flex; flex-direction: column; gap: 2px; cursor: pointer; padding: 10px 12px; border-radius: 14px; background: var(--surface-2); }
.bank-skip summary small { font-size: 12px; color: var(--muted); }
.bank-skip h4 { margin: 14px 0 0; font-size: 14px; }
.bank-skip h4 small { font-weight: 500; color: var(--muted); }
.bank-skip > p { margin: 2px 0 4px; }
.bank-foot { display: flex; flex-wrap: wrap; gap: 8px; width: 100%; justify-content: flex-end; }
.bank-foot #bank-apply { flex: 1 1 auto; max-width: 320px; }
@media (max-width: 639px) { .bank-foot > .btn { flex: 1 1 auto; } .bank-foot #bank-apply { max-width: none; } }

/* ---------- Pause på lån ---------- */
.loan-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.status-pause { background: color-mix(in srgb, var(--c-bolig) 16%, transparent); color: color-mix(in srgb, var(--c-bolig) 80%, var(--fg)); }
.status-pause::before { display: none; }
.status-pause.soon { background: var(--surface-2); color: var(--muted); }
.status-pause .ic { width: 12px; height: 12px; stroke-width: 3; }
.pause-box { display: flex; flex-direction: column; gap: 0; border-radius: 14px; }
.pause-box.on { background: var(--surface-2); }
.pause-box.on .toggle-row { background: none; }
.pause-fields { display: flex; flex-direction: column; gap: 12px; padding: 0 14px 14px; }
.pause-fields[hidden] { display: none; }
.pause-fields .form-grid { gap: 10px; }
.pause-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -4px; }
.pause-quick .ns-chip { min-height: 32px; font-size: 13px; }
.check-line { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; font-size: 14px; }
.check-line[hidden] { display: none; }
.check-line input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--accent); }
.check-line > span { display: flex; flex-direction: column; gap: 2px; }
.check-line small { font-size: 12.5px; color: var(--muted); line-height: 1.4; }
.pause-hint { margin: 0; line-height: 1.45; }
.pause-effect .ic { stroke-width: 3; }
.ev-pause > span > .ic, .ev-resume > span > .ic { stroke-width: 3; }
