/* ============================================================
   BudsjettetMitt — design system
   Fintech dark theme: Linear / Stripe / Vercel aesthetic
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@300;400;500;600&family=IBM+Plex+Serif:wght@300;400&family=IBM+Plex+Mono:wght@400;600&display=swap');

/* ── 1. DESIGN TOKENS ──────────────────────────────────────── */
:root {
  /* === SURFACE HIERARCHY — samkjørt med BudsjettetMitt (teal-tema) === */
  --bg:          #07111f;   /* dyp navy body */
  --surface:     #0d1f35;   /* kortflate */
  --surface-2:   #132840;   /* paneler, hevede kort */
  --surface-3:   #24405f;   /* inputfelter — lysere for kontrast */

  /* === TEKST === */
  --ink:         #dce8f4;   /* primær tekst */
  --muted:       #8fb0cc;   /* sekundær tekst — AA-kompatibel mot surface */
  --dim:         #6b8fab;   /* placeholder */

  /* === KANTER === */
  --line:        #1e3855;   /* standard border */
  --line-2:      #2c4a6a;   /* sterk border, input-ramme */

  /* === ACCENT (teal) === */
  --blue:        #00d4aa;   /* primær handling */
  --blue-hi:     #1ee9bd;   /* lenker, highlights */
  --blue-dim:    rgba(0,212,170,.12);
  --brand:       #00d4aa;   /* brukt i app.js dynamiske noter */

  /* === SEMANTISK === */
  --green:       #2da05a;
  --green-dim:   rgba(45,160,90,.12);
  --amber:       #e0920a;
  --amber-dim:   rgba(224,146,10,.12);
  --red:         #e04040;
  --red-dim:     rgba(224,64,64,.12);

  /* === BAKOVERKOMPATIBLE ALIASER === */
  --paper:       var(--bg);
  --paper-deep:  #040d1a;
  --surface-alt: var(--surface-2);
  --teal:        var(--blue);
  --teal-soft:   var(--blue-dim);
  --ochre:       var(--blue);
  --rust:        var(--blue-hi);
  --sage:        var(--green);
  --danger:      var(--red);

  --shadow-sm:   0 1px 3px rgba(0,0,0,.4);
  --shadow:      0 4px 24px rgba(0,0,0,.5), 0 1px 0 rgba(255,255,255,.03) inset;
  --shadow-lg:   0 16px 48px rgba(0,0,0,.6);
  --shadow-glow: 0 0 0 3px rgba(0,212,170,.18), 0 4px 20px rgba(0,212,170,.12);
  --radius:      8px;
  --radius-lg:   12px;
  --radius-xl:   16px;

  font-family: "IBM Plex Sans", "Inter", system-ui, sans-serif;
  font-size: 16px;
}

/* ── 2. RESET & BASE ───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button, input, select, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }

/* ── 3. TYPOGRAFI ──────────────────────────────────────────── */
h1, h2, h3, h4, p { margin-top: 0; }

h1, h2 {
  font-family: "IBM Plex Serif", Georgia, serif;
  font-weight: 300; letter-spacing: -.01em; line-height: 1.1;
}
h1 { font-size: clamp(32px, 4vw, 52px); margin-bottom: 16px; max-width: 740px; color: var(--ink); }
h2 { font-size: clamp(26px, 3.5vw, 44px); margin-bottom: 0; }
h3 { font-size: clamp(16px, 1.5vw, 20px); font-weight: 600; margin-bottom: 8px; }
h4 { font-size: 14px; font-weight: 600; margin-bottom: 8px; }

.workspace h1 { font-size: clamp(24px, 2.8vw, 32px); margin: 0; }
.tool-surface h2, .summary-panel h2 { font-size: clamp(19px, 1.8vw, 24px); font-weight: 300; }

.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .1em;
  text-transform: uppercase; color: var(--blue-hi); margin: 0 0 12px;
}
.lead { font-size: clamp(15px, 1.1vw, 17px); color: var(--muted); line-height: 1.6; max-width: 580px; }
.fineprint, .panel-note, .view-head p, .prep-grid p, .insight-panel p, .object-result p, .report-grid p {
  color: var(--muted); line-height: 1.6; font-size: 14px;
}

/* ── 4. BROWSER SHELL ──────────────────────────────────────── */
.browser-shell {
  width: min(1480px, calc(100vw - 32px));
  margin: 20px auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

/* ── 5. SITE HEADER ────────────────────────────────────────── */
.site-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 0 28px; height: 56px;
  background: var(--bg); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 100;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 600; color: var(--ink); text-decoration: none; letter-spacing: -.01em; }
.brand-mark { width: 30px; height: 30px; background: var(--blue); border-radius: 7px; display: grid; place-items: center; font-size: 11px; font-weight: 800; color: #07111f; flex-shrink: 0; letter-spacing: -.02em; box-shadow: 0 2px 8px rgba(0,212,170,.35); }
.site-header nav { display: flex; gap: 28px; color: var(--muted); font-size: 13px; }
.site-header nav a { transition: color .15s; }
.site-header nav a:hover { color: var(--ink); }
.utility-actions { display: flex; align-items: center; gap: 8px; }
.header-search { height: 32px; width: 200px; border: 1px solid var(--line); border-radius: var(--radius); padding: 0 10px; font-size: 13px; background: var(--surface-3); color: var(--ink); }
.header-search::placeholder { color: var(--dim); }

/* ── 6. KNAPPER ────────────────────────────────────────────── */
.button, .header-action {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 42px; padding: 0 22px; border-radius: var(--radius);
  font-size: 14px; font-weight: 600; border: none; cursor: pointer;
  transition: background .15s, box-shadow .15s, opacity .15s, border-color .15s, transform .1s;
  white-space: nowrap; gap: 8px; letter-spacing: .01em;
}
.button.primary, .header-action {
  background: var(--blue); color: #07111f;
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 2px 8px rgba(0,212,170,.25);
}
.button.primary:hover, .header-action:hover {
  background: var(--blue-hi);
  box-shadow: 0 1px 0 rgba(255,255,255,.15) inset, 0 4px 16px rgba(0,212,170,.35);
  transform: translateY(-1px);
}
.button.primary:active, .header-action:active { transform: translateY(0); }
.button.secondary {
  background: rgba(255,255,255,.04); color: var(--muted);
  border: 1px solid var(--line-2);
}
.button.secondary:hover { border-color: var(--blue); color: var(--ink); background: rgba(0,212,170,.06); }
.button.compact {
  min-height: 34px; padding: 0 14px; font-size: 13px; font-weight: 500;
  background: rgba(255,255,255,.04); color: var(--muted); border: 1px solid var(--line);
  border-radius: var(--radius);
}
.button.compact:hover { border-color: var(--blue); color: var(--ink); background: rgba(0,212,170,.05); }
.button:disabled { opacity: .35; cursor: not-allowed; transform: none !important; }
.text-button {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  justify-self: start;
  width: max-content;
  max-width: max-content;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  color: var(--blue-hi);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  cursor: pointer;
  transition: color .15s;
}
.text-button:hover { color: var(--ink); }

/* Hero actions — god spacing mellom knapper */
.hero-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 24px 0 12px; }

/* ── 7. INPUTS & LABELS ────────────────────────────────────── */
label {
  display: grid; gap: 6px;
  font-size: 12px; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink);
}
input, select, textarea {
  width: 100%; min-height: 48px; padding: 0 14px;
  border: 1.5px solid var(--line-2); border-radius: var(--radius);
  background: rgba(255,255,255,.055); color: var(--ink); font-size: 15px; outline: none;
  transition: border-color .18s, background .18s, box-shadow .18s;
}
select {
  appearance: none; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23a8c8e8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px;
}
select option { background: #132840; color: var(--ink); }
textarea { min-height: 180px; padding: 12px 14px; line-height: 1.5; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--dim); }
input:focus, select:focus, textarea:focus {
  border-color: var(--blue); background: rgba(255,255,255,.10);
  box-shadow: 0 0 0 3px rgba(0,212,170,.18), 0 1px 4px rgba(0,0,0,.2);
}
input[readonly], input[readonly]:focus {
  background: rgba(255,255,255,.03); color: var(--muted);
  border: 1.5px dashed var(--line); cursor: default;
}
button:focus-visible, a:focus-visible {
  outline: 2px solid var(--blue-hi); outline-offset: 2px;
}
.checkbox-row {
  display: flex; align-items: flex-start; gap: 10px;
  grid-column: 1 / -1; text-transform: none; letter-spacing: 0;
  font-size: 14px; font-weight: 400; color: var(--muted);
}
.checkbox-row input[type="checkbox"] { width: 16px; height: 16px; min-height: 16px; accent-color: var(--blue); flex-shrink: 0; margin-top: 2px; }
.checkbox-row span { font-size: 14px; line-height: 1.5; }

/* ── 8. LAYOUT — HERO, PREP, STORY ────────────────────────── */
.hero {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(280px,.65fr);
  gap: clamp(40px,6vw,96px); align-items: center;
  padding: clamp(56px,5vw,80px) clamp(24px,3vw,40px) clamp(48px,4vw,64px);
}
.home-hero { align-items: center; }
.hero-copy { max-width: 800px; }
.home-illustration { align-self: end; min-height: 240px; border-left: 1px solid var(--line); color: #2a4a6e; }
.home-illustration svg { width: 100%; height: 100%; min-height: 240px; fill: none; stroke: currentColor; stroke-width: 1.2; }

.hero-panel {
  position: relative; padding: 28px; border: 1px solid var(--line);
  border-radius: var(--radius-lg); background: var(--surface-2);
}
.hero-panel::before {
  content: ""; position: absolute; inset: 16px auto auto -1px;
  width: 3px; height: 50%; background: var(--blue);
}

.prep-section {
  display: grid; grid-template-columns: minmax(200px,.44fr) minmax(0,1fr);
  gap: clamp(32px,6vw,88px);
  padding: clamp(32px,3.5vw,52px) clamp(24px,3vw,40px);
  background: var(--surface); border-block: 1px solid var(--line);
}
.prep-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1px; background: var(--line); }
.prep-grid article { min-height: 120px; padding: 24px; background: var(--surface); transition: background .15s; }
.prep-grid article:hover { background: var(--surface-2); }
.prep-grid span { display: block; color: var(--blue-hi); font-size: 11px; font-weight: 700; margin-bottom: 10px; }
.prep-grid h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.prep-grid p { font-size: 13px; color: var(--muted); line-height: 1.55; margin: 0; }

.story-section {
  display: grid; grid-template-columns: minmax(240px,.75fr) minmax(0,1fr);
  gap: clamp(32px,6vw,88px);
  padding: clamp(32px,3.5vw,52px) clamp(24px,3vw,40px);
  border-bottom: 1px solid var(--line); background: var(--surface);
}
.story-copy p:not(.eyebrow) { max-width: 580px; color: var(--muted); font-size: 17px; line-height: 1.65; }
.scenario-list { display: grid; gap: 1px; align-self: start; border: 1px solid var(--line); background: var(--line); border-radius: var(--radius); overflow: hidden; }
.scenario-list span { display: block; padding: 16px 20px; background: var(--surface-2); font-size: 14px; font-weight: 500; color: var(--muted); transition: color .15s, background .15s; }
.scenario-list span:hover { background: var(--surface-3); color: var(--ink); }

.trust-section {
  display: grid; grid-template-columns: minmax(240px,.65fr) minmax(0,1fr);
  gap: clamp(32px,6vw,88px);
  padding: clamp(32px,3.5vw,52px) clamp(24px,3vw,40px);
  background: var(--bg); border-top: 1px solid var(--line);
}
.trust-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 1px; border: 1px solid var(--line); background: var(--line); border-radius: var(--radius); overflow: hidden; }
.trust-grid p { margin: 0; padding: 24px; background: var(--surface); color: var(--muted); font-size: 14px; line-height: 1.65; }
.help-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 1px; border: 1px solid var(--line); background: var(--line); border-radius: var(--radius); overflow: hidden; }
.help-grid article { background: var(--surface); padding: 20px; }
.help-grid h3 { font-size: 16px; margin-bottom: 8px; }
.help-grid p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }

/* ── 9. APP SHELL — KALKULATOR ─────────────────────────────── */
.workspace { min-height: calc(100dvh - 56px); background: var(--bg); padding: clamp(24px,2.8vw,36px) clamp(20px,2.4vw,32px); }
.workspace-top { display: grid; grid-template-columns: minmax(220px,.55fr) minmax(0,1fr); gap: 24px; align-items: start; margin-bottom: 20px; }
.source-note { justify-self: end; max-width: 400px; color: var(--muted); font-size: 13px; line-height: 1.55; }
.action-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 16px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }

/* ── SCENARIO PANEL ─────────────────────────────────────────── */
.scenario-anchor { position: relative; }
.scenario-panel { position: absolute; top: calc(100% + 4px); left: 0; z-index: 200; width: min(360px, calc(100vw - 32px)); max-height: 480px; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 8px 32px rgba(0,0,0,.35); overflow: hidden; }
.scenario-panel[hidden] { display: none; }
.scenario-panel-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 10px; border-bottom: 1px solid var(--line); flex-shrink: 0; }
.scenario-panel-header h4 { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.scenario-save-row { display: flex; gap: 8px; padding: 12px 16px 0; flex-shrink: 0; }
.scenario-save-row input[type="text"] { flex: 1; min-width: 0; padding: 7px 10px; font-size: 13px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg); color: var(--ink); }
.scenario-save-row input[type="text"]:focus { outline: none; border-color: var(--brand); }
.scenario-status { margin: 6px 16px 0; font-size: 12px; color: var(--muted); min-height: 16px; }
.scenario-status.ok  { color: #4ade80; }
.scenario-status.err { color: #f87171; }
.scenario-list-inner { flex: 1; overflow-y: auto; padding: 8px 0 10px; }
.scenario-empty { margin: 12px 16px; font-size: 13px; color: var(--muted); }
.scenario-item { display: flex; align-items: center; gap: 6px; padding: 8px 16px; cursor: pointer; transition: background .12s; border-bottom: 1px solid var(--line); }
.scenario-item:last-child { border-bottom: none; }
.scenario-item:hover { background: rgba(255,255,255,.04); }
.scenario-item-info { flex: 1; min-width: 0; }
.scenario-item-name { font-size: 13px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.scenario-item-meta { font-size: 11px; color: var(--muted); margin-top: 1px; }
.scenario-item-actions { display: flex; gap: 4px; flex-shrink: 0; }
.scenario-item-btn { padding: 4px 10px; font-size: 12px; border-radius: var(--radius); border: 1px solid var(--line); background: transparent; color: var(--ink); cursor: pointer; white-space: nowrap; transition: background .12s, color .12s; }
.scenario-item-btn:hover { background: var(--brand); color: #07111f; border-color: var(--brand); }
.scenario-item-btn.danger:hover { background: #ef4444; border-color: #ef4444; color: #fff; }
.legal-note { margin-bottom: 24px; padding: 13px 18px; border: 1px solid rgba(224,146,10,.2); border-radius: var(--radius-lg); background: rgba(224,146,10,.05); color: var(--muted); font-size: 13px; line-height: 1.55; border-left: 3px solid var(--amber); }

.kpi-strip { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 10px; margin-bottom: 24px; }
.kpi-strip article {
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--surface); padding: 18px 20px;
  border-left: 3px solid var(--line);
  transition: border-color .2s, box-shadow .2s;
}
.kpi-strip article:hover { border-left-color: var(--blue); box-shadow: var(--shadow-sm); }
.kpi-strip article.tone-good { border-left-color: var(--green); }
.kpi-strip article.tone-bad  { border-left-color: var(--red); }
.kpi-strip article.tone-warn { border-left-color: var(--amber); }
.kpi-strip span { display: block; color: var(--muted); font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; margin-bottom: 8px; }
.kpi-strip strong { display: block; font-size: clamp(20px, 2vw, 28px); font-weight: 700; color: var(--ink); font-family: "IBM Plex Mono", "Courier New", monospace; line-height: 1.1; }
.kpi-strip article.tone-good strong { color: #4ade80; }
.kpi-strip article.tone-bad  strong { color: #f87171; }
.kpi-strip article.tone-warn strong { color: #fbbf24; }

.app-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 680px; border: 1px solid var(--line-2); border-radius: var(--radius-xl); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }

/* ── 10. SIDEBAR — VERTIKAL STEGNAVIGASJON ─────────────────── */
.sidebar { display: flex; flex-direction: column; background: rgba(4,12,24,.6); border-right: 1px solid var(--line); padding: 16px 0; grid-column: auto; }
.step {
  position: relative; display: flex; align-items: center; gap: 12px;
  width: 100%; min-height: 48px; padding: 0 20px 0 16px;
  background: transparent; border: none; border-left: 3px solid transparent;
  color: var(--dim); font-size: 13px; font-weight: 500; text-align: left; cursor: pointer;
  transition: color .15s, background .15s;
}
.step::after { display: none; }
.step span {
  display: grid; width: 24px; height: 24px; place-items: center;
  border: 1.5px solid var(--line-2); border-radius: 6px;
  font-size: 11px; font-weight: 700; flex-shrink: 0; color: inherit;
  transition: background .15s, border-color .15s, color .15s;
}
.step:hover { background: rgba(255,255,255,.035); color: var(--muted); }
.step { color: var(--dim); }
.step.active { background: rgba(0,212,170,.08); color: var(--ink); border-left-color: var(--blue); font-weight: 600; }
.step.active::before { display: none; }
.step.active span { background: var(--blue); border-color: var(--blue); color: #07111f; }
.step.done { color: var(--muted); }
.step.done span { border-color: var(--green); color: var(--green); background: rgba(45,160,90,.1); }

.tool-surface { padding: clamp(28px,3.2vw,44px); background: var(--bg); overflow-y: auto; overflow-x: auto; }

/* ── Wizard-progress (veiviser-følelse) ── */
.wizard-progress { margin-bottom: 32px; display: flex; flex-direction: column; gap: 10px; }
.wizard-progress-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.wizard-step-label { font-family: "IBM Plex Sans", sans-serif; font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -.01em; }
.wizard-step-counter { font-size: 12px; color: var(--dim); font-variant-numeric: tabular-nums; white-space: nowrap; }
.wizard-progress-track { height: 3px; background: var(--line); border-radius: 999px; overflow: hidden; }
.wizard-progress-fill { height: 100%; width: 0%; background: var(--blue); border-radius: 999px; transition: width .4s cubic-bezier(.22,1,.36,1); box-shadow: 0 0 8px rgba(0,212,170,.5); }
.summary-panel { padding: 24px; border-left: 1px solid var(--line); background: var(--surface); }
.summary-panel h3 { margin-bottom: 4px; font-size: 15px; }
#scenarioName { color: var(--blue-hi); font-weight: 600; }

/* ── 11. SCENARIO-KORT ─────────────────────────────────────── */
.scenario-choice-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 14px; }
.scenario-card {
  min-height: 110px; padding: 22px; border: 1.5px solid var(--line-2);
  border-radius: var(--radius-lg); background: var(--surface);
  color: var(--ink); text-align: left; cursor: pointer;
  transition: border-color .18s, background .18s, transform .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.scenario-card:hover { border-color: var(--blue); background: var(--surface-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.scenario-card:active { transform: translateY(0) scale(0.98); }
.scenario-card span { display: block; margin-bottom: 8px; font-family: "IBM Plex Serif", Georgia, serif; font-size: 20px; font-weight: 300; }
.scenario-card small { color: var(--muted); font-size: 13px; line-height: 1.5; }
.scenario-card.active { border-color: var(--blue); background: rgba(0,212,170,.07); box-shadow: 0 0 0 1px rgba(0,212,170,.2); }
.scenario-card.active small { color: var(--muted); }
@media (max-width: 560px) { .scenario-choice-grid { grid-template-columns: 1fr; } }

/* ── 12. VIEWS ─────────────────────────────────────────────── */
.view { display: none; }
.view.active { display: block; }
.view-head {
  display: flex; justify-content: space-between; gap: 24px;
  margin-bottom: 32px; padding-bottom: 20px; border-bottom: 1px solid var(--line);
}
.view-head h2 { font-size: clamp(18px,1.6vw,22px); font-weight: 600; color: var(--ink); margin: 0 0 4px; font-family: "IBM Plex Sans", sans-serif; letter-spacing: -.01em; }
.view-head p { max-width: 460px; margin-bottom: 0; font-size: 14px; color: var(--muted); line-height: 1.6; }
.form-grid, .budget-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 20px 24px; }

/* ── 13. KORTBLOKKER ───────────────────────────────────────── */
.current-home-block, .inline-children, .expense-block, .embedded-object { margin-top: 32px; padding-top: 0; border-top: none; }
.current-home-block { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.housing-block, .mortgage-block, .buyout-block { margin-bottom: 28px; padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); }
.buyout-block { margin-top: 0; }

/* Lånekapasitet-stripe — vises øverst i bolig-steget ved kjøp */
.capacity-banner { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 24px; padding: 18px 22px; border: 1px solid rgba(0,212,170,.25); border-radius: var(--radius-lg); background: rgba(0,212,170,.07); border-left: 3px solid var(--blue); }
.capacity-banner .capacity-icon { font-size: 20px; line-height: 1.3; flex-shrink: 0; }
.capacity-banner .capacity-text { display: flex; flex-direction: column; gap: 4px; }
.capacity-banner .capacity-text strong { color: var(--ink); font-size: 15px; }
.capacity-banner .capacity-text .block-note { font-size: 13px; line-height: 1.55; }
.housing-link-row { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin: 14px 0; }
.block-note { color: var(--muted); font-size: 14px; line-height: 1.65; margin-bottom: 18px; }
/* ── Section-innledning med eyebrow-linje over seksjoner ── */
.section-intro { margin-bottom: 24px; }
.section-intro .eyebrow { margin-bottom: 4px; }
.section-intro h3 { font-size: 17px; font-weight: 600; color: var(--ink); margin-bottom: 6px; }
.section-intro p { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0; }
.list-title {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 12px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.list-title h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin: 0; }
.income-list { margin-top: 36px; padding-top: 28px; border-top: 1px solid var(--line); }
.savings-field { max-width: 420px; margin-bottom: 16px; }

/* ── 14. STATUS-PILL ───────────────────────────────────────── */
.status-pill { display: inline-flex; align-items: center; border: 1px solid var(--blue-hi); border-radius: 999px; padding: 4px 12px; color: var(--blue-hi); font-size: 12px; font-weight: 500; }
.status-pill.warning { border-color: var(--amber); color: var(--amber); }

/* ── 15. TABELLER OG RADER ─────────────────────────────────── */
.mini-row { display: grid; grid-template-columns: 1fr 150px 140px auto; gap: 8px; margin-bottom: 8px; }
#incomeRows .mini-row, #expenseRows .mini-row { grid-template-columns: minmax(200px,260px) 160px 120px auto; justify-content: start; }
.variable-income-row { display: grid; grid-template-columns: minmax(180px,240px) 160px auto auto auto; gap: 8px; margin-bottom: 8px; align-items: center; }
.variable-income-hint { font-size: 13px; color: var(--blue); font-variant-numeric: tabular-nums; white-space: nowrap; }
.variable-include-label { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); text-transform: none; letter-spacing: 0; font-weight: 400; white-space: nowrap; cursor: pointer; }
.variable-factor-wrap { display: flex; align-items: center; gap: 4px; }
.variable-factor { width: 60px; min-height: 48px; padding: 0 8px; text-align: center; }
.variable-factor-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.debt-rate-wrap { display: flex; align-items: center; gap: 4px; }
.debt-rate { width: 60px; min-height: 48px; padding: 0 8px; text-align: center; }
.debt-rate-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.debt-payoff-note { font-size: 12px; padding: 6px 12px 6px 16px; border-radius: 0 0 var(--radius) var(--radius); margin-top: -2px; line-height: 1.4; }
.debt-payoff-ok { background: rgba(0,212,170,.08); color: var(--blue); border: 1px solid rgba(0,212,170,.2); border-top: none; }
.debt-payoff-warn { background: rgba(224,123,0,.08); color: var(--amber); border: 1px solid rgba(224,123,0,.25); border-top: none; }
#dailyExpenseRows .sifo-row { grid-template-columns: minmax(200px,260px) 160px 120px; }
.asset-operating-group { padding: 12px 0; border-top: 1px solid var(--line); }
.asset-operating-group:first-child { border-top: 0; padding-top: 0; }
.asset-operating-title { margin: 0; font-size: 14px; font-weight: 600; color: var(--ink); }
.asset-operating-cost-row { grid-template-columns: minmax(200px,260px) 160px auto; justify-content: start; }
.fixed-label { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.03); color: var(--muted); padding: 0 12px; display: flex; align-items: center; font-size: 13px; font-weight: 500; letter-spacing: .005em; }
.sifo-row .fixed-label, .child-cost-row .fixed-label { max-width: 240px; }

.data-table { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow-x: auto; box-shadow: var(--shadow-sm); }
.table-row { display: grid; grid-template-columns: 1.2fr 1fr 1fr .8fr 1fr; gap: 6px; align-items: center; padding: 9px 12px; border-bottom: 1px solid var(--line); font-size: 13px; }
/* Asset-rad: 10 kolonner — mnd drift flyttet til Månedlige utgifter */
.asset-row {
  grid-template-columns:
    minmax(100px, 1.3fr)   /* Post/navn */
    minmax(72px,  .8fr)    /* Verdi */
    minmax(62px,  .65fr)   /* Eierandel % */
    minmax(72px,  .8fr)    /* Belåning */
    minmax(58px,  .6fr)    /* Rente % */
    minmax(70px,  .75fr)   /* Mnd lån */
    minmax(108px, .95fr)   /* Fordeling (select) */
    minmax(104px, .9fr)    /* Likviditet (select) */
    minmax(62px,  .65fr)   /* Til meg */
    36px;                  /* Fjern-knapp */
  min-width: 810px;
}
/* Tettere input-padding inni asset-tabellen */
.asset-row input, .asset-row select {
  min-height: 36px;
  padding: 0 7px;
  font-size: 13px;
}
.debt-row { grid-template-columns: 1.2fr .95fr .9fr .85fr .95fr .9fr auto; }
.table-row:last-child { border-bottom: 0; }
.table-head { background: rgba(255,255,255,.025); color: var(--dim); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; border-bottom: 1px solid var(--line); }
.table-add { margin-top: 12px; }

.children-layout, .object-layout { display: grid; grid-template-columns: 1fr 260px; gap: 20px; }
.child-row { display: grid; gap: 12px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.child-main, .child-cost-row { display: grid; gap: 10px; align-items: end; }
.child-main { grid-template-columns: .8fr 1fr auto; }
.child-cost-row { grid-template-columns: minmax(155px,205px) 155px 155px auto; margin-bottom: 8px; }
.child-costs { padding-left: 12px; border-left: 2px solid var(--line); }
.age { display: grid; min-height: 48px; place-items: center; border: 1px solid var(--line); border-radius: var(--radius); color: var(--blue-hi); font-weight: 600; font-size: 13px; }
.insight-panel, .object-result, .missing-box, .report-grid article { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 22px; box-shadow: var(--shadow-sm); }

/* ── FRIGJØRINGSPOTENSIAL ───────────────────────────────────── */
.sale-status-label { font-size: 11px; color: var(--muted); font-weight: 400; text-transform: none; letter-spacing: 0; }

/* ── 16. RAPPORT ───────────────────────────────────────────── */
.report-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-top: 14px; }
.report-hero { display: grid; grid-template-columns: 1.4fr 1fr; gap: 14px; }
.report-hero article { padding: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-2); box-shadow: var(--shadow-sm); }
/* Hovedtall — stort, sentrert og teal */
.report-hero article:first-child { grid-column: 1 / -1; text-align: center; padding: 36px 24px; background: linear-gradient(135deg, rgba(0,212,170,.08) 0%, rgba(0,212,170,.02) 100%); border-color: rgba(0,212,170,.3); box-shadow: 0 0 0 1px rgba(0,212,170,.1) inset; }
.report-hero article:first-child strong { font-size: clamp(2.4rem, 7vw, 3.4rem); color: var(--blue); letter-spacing: -.04em; }
.report-hero article:first-child span { font-size: 12px; }
.report-hero article:first-child p { max-width: 460px; margin: 6px auto 0; }
.report-hero article span { display: block; color: var(--muted); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 10px; }
.report-hero article strong { display: block; font-size: clamp(24px,2vw,32px); font-weight: 700; line-height: 1; margin-bottom: 8px; font-family: "IBM Plex Mono","Courier New",monospace; }
.report-hero article p { margin: 0; font-size: 13px; color: var(--muted); }

/* Donut på rapporten — som gratis-kalkulatoren */
.report-donut-section { display: flex; flex-direction: column; align-items: center; gap: 18px; margin: 24px 0; }
.report-donut-wrap { position: relative; width: 200px; height: 200px; }
.report-donut { width: 200px; height: 200px; border-radius: 50%; }
.report-donut::after { content: ''; position: absolute; inset: 34px; background: var(--bg); border-radius: 50%; }
.report-donut-center { position: absolute; inset: 34px; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; }
.report-donut-val { font-family: "IBM Plex Mono", monospace; font-size: 1.2rem; font-weight: 600; line-height: 1; color: var(--ink); }
.report-donut-label { font-size: 0.62rem; color: var(--muted); text-align: center; line-height: 1.2; }
.report-donut-legend { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 16px; max-width: 380px; }
.rd-item { display: inline-flex; align-items: center; gap: 6px; font-size: 0.78rem; color: var(--muted); }
.rd-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.report-grid strong { display: block; margin: 8px 0 6px; font-size: clamp(18px,1.4vw,22px); font-weight: 700; line-height: 1.05; font-family: "IBM Plex Mono","Courier New",monospace; }
.report-grid article span { display: block; color: var(--muted); font-size: 12px; }
.report-grid article p { margin: 0; font-size: 13px; color: var(--muted); }

.followup-block { margin-top: 20px; }
.followup-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
.followup-grid article { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; background: var(--surface); }
.followup-grid h4 { font-size: 13px; font-weight: 600; margin-bottom: 12px; color: var(--ink); }
.checkline { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.checkline input { width: 15px; height: 15px; min-height: 15px; accent-color: var(--blue); }

.decision-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 10px; margin-top: 14px; }
.decision-grid article { border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; background: var(--surface-2); }
.decision-grid span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.decision-grid strong { font-size: 20px; line-height: 1.1; font-family: "IBM Plex Mono",monospace; }

.monthly-overview { margin-top: 16px; }
.budget-ledger { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; box-shadow: var(--shadow-sm); }
.ledger-row { display: flex; justify-content: space-between; gap: 20px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line); font-size: 14px; }
.ledger-row:first-child { border-top: 0; }
.ledger-row span { color: var(--muted); font-weight: 500; }
.ledger-row strong { font-size: 17px; font-weight: 600; font-family: "IBM Plex Mono","Courier New",monospace; white-space: nowrap; }
.ledger-row.subline { padding: 9px 20px; }
.ledger-row.subline span { font-size: 12px; padding-left: 16px; }
.ledger-row.subline strong { font-size: 14px; font-weight: 400; color: var(--muted); }
.ledger-row.subline.subline-plus strong { color: #22c55e; }
.ledger-row.subline.subline-minus strong { color: #f87171; }
.ledger-row.total { background: var(--surface-2); border-top: 1px solid var(--line-2); }
.ledger-row.total strong { font-size: 20px; color: var(--ink); }

/* ── 17. TONE-STATES ───────────────────────────────────────── */
.tone-good { border-color: rgba(22,163,74,.35) !important; background: var(--green-dim) !important; }
.tone-good strong { color: #4ade80; }
.tone-warn { border-color: rgba(217,119,6,.35) !important; background: var(--amber-dim) !important; }
.tone-warn strong { color: #fbbf24; }
.tone-bad { border-color: rgba(220,38,38,.35) !important; background: var(--red-dim) !important; }
.tone-bad strong { color: #f87171; }

.calculation-breakdown { margin-top: 24px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); padding: 22px; box-shadow: var(--shadow-sm); }
.breakdown-row { display: flex; justify-content: space-between; gap: 20px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.breakdown-row:first-child { border-top: 0; }
.breakdown-row span { color: var(--muted); }
.breakdown-row strong { font-weight: 600; }
.breakdown-row.breakdown-good { margin: 0 -20px; padding: 10px 20px; background: var(--green-dim); }
.breakdown-row.breakdown-good strong { color: #4ade80; }
.breakdown-row.breakdown-warn { margin: 0 -20px; padding: 10px 20px; background: var(--amber-dim); }
.breakdown-row.breakdown-warn strong { color: #fbbf24; }
.breakdown-row.breakdown-bad { margin: 0 -20px; padding: 10px 20px; background: var(--red-dim); }
.breakdown-row.breakdown-bad strong { color: #f87171; }

/* ── 18. DIVERSE ───────────────────────────────────────────── */
.scenario-switcher { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.scenario-switcher button { min-height: 36px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: transparent; color: var(--muted); font-size: 13px; font-weight: 500; cursor: pointer; transition: all .15s; }
.scenario-switcher button.active { background: var(--blue); color: #07111f; border-color: var(--blue); }

.privacy-strip { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.privacy-strip button { padding: 0; background: transparent; border: none; color: var(--blue-hi); font-weight: 500; cursor: pointer; }
.result-stamp { margin: 20px 0; }
.result-stamp span, .hero-metrics dt, .summary-list dt, .object-result dt, .report-grid span { display: block; color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; }
.result-stamp strong { display: block; margin-top: 6px; font-family: "IBM Plex Serif",Georgia,serif; font-size: 28px; font-weight: 300; }
.hero-metrics { display: grid; gap: 0; margin: 0; }
.hero-metrics div, .summary-list div, .object-result dl div { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; padding: 13px 0; border-top: 1px solid var(--line); }
.hero-metrics dd, .summary-list dd, .object-result dd { margin: 0; font-weight: 600; }
.summary-list { margin: 20px 0; }
.risk-band { display: grid; grid-template-columns: repeat(4,1fr); gap: 4px; margin: 20px 0 14px; }
.risk-band span { height: 3px; background: var(--line); border-radius: 2px; }
.risk-band span:nth-child(1), .risk-band span:nth-child(2), .risk-band .active { background: var(--blue); }
.missing-box ul { margin: 0; padding-left: 18px; color: var(--muted); line-height: 1.8; font-size: 13px; }
#missingChecklist li.done { color: var(--ink); }
.guidance-panel { color: var(--muted); font-size: 14px; line-height: 1.65; }
.guidance-panel p { margin-bottom: 14px; }
.guidance-panel ol { margin: 0; padding-left: 20px; }
.guidance-panel li { margin: 8px 0; }
/* ── FREMTIDSPERSPEKTIV ─────────────────────────────────────── */
.proj-rate-wrap { display: flex; align-items: center; gap: 8px; }
.proj-rate-label { font-size: 12px; color: var(--muted); white-space: nowrap; }
.rate-tabs { display: flex; gap: 4px; }
.rate-tab { padding: 4px 10px; border: 1px solid var(--line-2); border-radius: 4px; background: transparent; color: var(--muted); font-size: 12px; font-weight: 500; cursor: pointer; transition: all .15s; }
.rate-tab.active { background: var(--blue); border-color: var(--blue); color: #07111f; }
.rate-tab:hover:not(.active) { border-color: var(--blue-hi); color: var(--ink); }
.projection-grid { display: grid; grid-template-columns: 1fr repeat(3, 90px); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: 16px; }
.proj-col-header { background: var(--surface-2); padding: 8px 10px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); text-align: center; }
.proj-col-label { background: var(--surface-2); padding: 8px 10px; }
.proj-row-label { background: var(--surface); padding: 10px 14px; font-size: 13px; color: var(--muted); display: flex; align-items: center; }
.proj-val { background: var(--surface); padding: 10px 8px; font-family: "IBM Plex Mono", monospace; font-size: 13px; font-weight: 600; color: var(--ink); text-align: center; display: flex; align-items: center; justify-content: center; }
.proj-goal-row { color: var(--amber) !important; }
.proj-goal-row.proj-val { color: var(--amber) !important; }
@media (max-width: 600px) {
  .projection-grid { grid-template-columns: 1fr repeat(3, 72px); }
  .proj-rate-wrap { flex-wrap: wrap; }
}
.export-row { display: flex; align-items: center; gap: 10px; margin-top: 20px; }
.flow-actions { display: flex; justify-content: space-between; gap: 12px; margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
.sifo-info-box { margin: 8px 0 16px; padding: 14px 18px; border: 1px solid rgba(0,212,170,.2); border-radius: var(--radius-lg); background: rgba(0,212,170,.06); border-left: 3px solid var(--blue); }
.sifo-info-box strong { display: block; margin-bottom: 4px; font-size: 13px; color: var(--ink); }
.sifo-info-box p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.sifo-label { justify-content: space-between; }
.info-dot { width: 24px; height: 24px; min-height: 24px; border: 1px solid var(--line-2); border-radius: 50%; background: var(--surface-2); color: var(--blue-hi); font-weight: 700; font-size: 11px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; transition: background .15s; }
.info-dot:hover { background: var(--blue-dim); }
.noscript-banner { padding: 10px 16px; border-bottom: 1px solid var(--line); background: var(--amber-dim); color: var(--amber); font-size: 13px; }
[hidden] { display: none !important; }
.quiet .brand span:last-child, .quiet .result-stamp strong, .quiet #scenarioName { filter: blur(5px); }
.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; }

/* ── 19. PREVIEW WINDOW ────────────────────────────────────── */
.preview-window { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); }
.window-bar { display: flex; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--surface-2); }
.window-bar span { width: 8px; height: 8px; border: 1px solid rgba(255,255,255,.1); border-radius: 50%; }
.preview-content { padding: clamp(20px,3vw,32px); }
.preview-content h2 { margin-bottom: 20px; font-size: clamp(24px,3.4vw,40px); }
.home-preview { align-self: center; }

/* ── 20. CONSENT ───────────────────────────────────────────── */
.cmp-banner[hidden] { display: none !important; }
.cmp-banner { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 70; display: grid; grid-template-columns: 1fr auto; gap: 16px; padding: 18px 20px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-2); box-shadow: var(--shadow-lg); }
.cmp-copy p { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.cmp-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: flex-end; }
.cmp-manage { position: fixed; right: 16px; bottom: 16px; z-index: 69; min-height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 13px; cursor: pointer; }
.cmp-dialog { width: min(500px,calc(100vw - 32px)); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0; background: var(--surface-2); color: var(--ink); }
.cmp-dialog::backdrop { background: rgba(1,8,16,.75); }
.cmp-dialog-inner { padding: 24px; }
.cmp-dialog-inner h3 { margin: 0 0 8px; font-size: 22px; line-height: 1.1; }
.cmp-intro { margin: 0 0 14px; color: var(--muted); font-size: 14px; }
.cmp-toggle-row { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-top: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.cmp-toggle-row strong { font-size: 15px; }
.cmp-help { margin: 4px 0 0; color: var(--muted); font-size: 12px; }
.cmp-switch-control { position: relative; display: inline-flex; width: 44px; height: 26px; align-items: center; justify-content: center; }
.cmp-switch-control input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; min-height: 1px; }
.cmp-switch-slider { position: relative; width: 44px; height: 26px; border-radius: 999px; background: var(--line-2); transition: background .2s; }
.cmp-switch-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.5); transition: transform .2s; }
.cmp-switch-control input:checked + .cmp-switch-slider { background: var(--blue); }
.cmp-switch-control input:checked + .cmp-switch-slider::after { transform: translateX(18px); }
.cmp-switch-control input:disabled + .cmp-switch-slider { opacity: .5; }
.cmp-dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.checkout-value-grid { margin-bottom: 16px; }
.access-login-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }

/* ── 21. RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 1180px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { flex-direction: row; flex-wrap: wrap; border-right: 0; border-bottom: 1px solid var(--line); padding: 0; }
  .step { flex: 1; min-width: 110px; min-height: 50px; border-left: none; border-bottom: 3px solid transparent; justify-content: center; font-size: 11px; gap: 6px; }
  .step.active { border-left-color: transparent; border-bottom-color: var(--blue); background: rgba(0,212,170,.07); }
  .summary-panel { border-left: none; border-top: 1px solid var(--line); }
}
@media (max-width: 860px) {
  .site-header { height: auto; flex-direction: column; align-items: flex-start; padding: 14px 20px; gap: 12px; }
  .site-header nav { flex-wrap: wrap; }
  .hero, .prep-section, .workspace-top, .children-layout, .object-layout, .story-section, .trust-section { grid-template-columns: 1fr; }
  .prep-grid, .help-grid, .report-grid, .trust-grid { grid-template-columns: repeat(2,1fr); }
  .decision-grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .followup-grid { grid-template-columns: 1fr; }
  .utility-actions { width: 100%; }
  .header-search { width: 100%; }
  .kpi-strip { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .report-hero { grid-template-columns: 1fr; }
  .form-grid, .budget-grid, .mini-row, .child-row, .table-row { grid-template-columns: 1fr; }
  .view-head { display: block; }
  .scenario-switcher { justify-content: flex-start; }

  /* ── MOBILE: contain horizontal scroll to data-tables only ── */
  .tool-surface { overflow-x: hidden; padding: clamp(16px,4vw,24px); }
  .data-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ── MOBILE: fix specificity bugs — override desktop grid cols ── */
  /* Income / expense mini-rows: name spans full width, rest on row 2 */
  #incomeRows .mini-row,
  #expenseRows .mini-row {
    grid-template-columns: 1fr 130px auto;
  }
  #incomeRows .mini-row > input[type="text"]:first-child,
  #expenseRows .mini-row > input[type="text"]:first-child {
    grid-column: 1 / -1;
  }

  /* SIFO daily rows: label full width, amount + period on row 2 */
  #dailyExpenseRows .sifo-row {
    grid-template-columns: 1fr 130px;
  }
  #dailyExpenseRows .sifo-row > .fixed-label {
    grid-column: 1 / -1;
  }

  /* Asset operating cost rows */
  .asset-operating-cost-row {
    grid-template-columns: 1fr auto;
  }
  .asset-operating-cost-row > .fixed-label {
    grid-column: 1 / -1;
  }

  /* Child cost rows: label full width, amount + select + remove on row 2 */
  .child-cost-row {
    grid-template-columns: 1fr 120px auto;
  }
  .child-cost-row > .fixed-label {
    grid-column: 1 / -1;
  }

  /* Child-main: keep 3-col but smaller */
  .child-main { grid-template-columns: 1fr 1fr auto; }

  /* Asset/debt table: remove min-width so rows stack cleanly, hide header */
  .asset-row, .debt-row { min-width: 0; }
  .table-head { display: none; }
  /* Asset rows: give each a visible card border to group fields per asset */
  .asset-row { border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; padding: 4px 0; }
  .asset-row:last-child { margin-bottom: 0; }

  /* Touch targets — minimum 44px for all interactive row elements */
  .mini-row input, .mini-row select,
  .sifo-row input, .sifo-row select,
  .child-cost-row input, .child-cost-row select,
  .asset-operating-cost-row input {
    min-height: 44px;
  }
  .text-button.remove-income,
  .text-button.remove-expense,
  .text-button.remove-child,
  .text-button.remove-child-cost,
  .text-button.remove-asset,
  .text-button.remove-debt {
    min-height: 44px;
    min-width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* bb-estimate-grid: single column */
  .bb-estimate-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .hero { padding-top: 40px; }
  .decision-grid { grid-template-columns: 1fr; }
  .prep-grid, .report-grid, .report-hero, .trust-grid { grid-template-columns: 1fr; }
  .header-action { width: 100%; }
  /* Step nav: scroll horizontally, snap to each tab */
  .sidebar {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  .sidebar::-webkit-scrollbar { display: none; }
  .step {
    min-width: 80px;
    flex-shrink: 0;
    scroll-snap-align: start;
    font-size: 10px;
    gap: 4px;
    padding: 0 8px;
  }
  /* KPI strip: 2×2 with tighter padding on small screens */
  .kpi-strip { gap: 8px; }
  .kpi-strip article { padding: 12px 14px; }
  .kpi-strip strong { font-size: 18px; }
  /* Action toolbar: wrap buttons */
  .action-toolbar { flex-wrap: wrap; gap: 8px; }
  /* Reduce tool-surface padding further */
  .tool-surface { padding: 14px; }
}
/* ── YTELSER, BARNEBIDRAG, CHECKLIST ────────────────────── */
.barnebidrag-info-box { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-top: 12px; font-size: 13px; }
.barnebidrag-info-box strong { display: block; color: var(--ink); margin-bottom: 4px; }
.bb-estimate-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }

.checklist-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.checklist-card { background: rgba(255,255,255,.04); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.checklist-card h4 { margin: 0 0 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.checklist-card ul { margin: 0; padding-left: 16px; }
.checklist-card li { font-size: 12px; color: var(--muted); line-height: 1.5; margin-bottom: 4px; }
.checklist-card p { font-size: 12px; color: var(--muted); line-height: 1.5; margin: 0 0 8px; }

.info-box-result { padding: 12px 16px; border-radius: var(--radius); font-size: 13px; line-height: 1.5; border: 1px solid var(--line); }
.info-box-result.ok { background: rgba(74,222,128,.08); border-color: rgba(74,222,128,.3); color: #4ade80; }
.info-box-result.warn { background: rgba(251,191,36,.08); border-color: rgba(251,191,36,.3); color: #fbbf24; }
.info-box-result.err { background: rgba(248,113,113,.08); border-color: rgba(248,113,113,.3); color: #f87171; }

.status-pill.warn { border-color: rgba(251,191,36,.4); color: #fbbf24; background: rgba(251,191,36,.08); }

@media (max-width: 700px) {
  .checklist-cards { grid-template-columns: 1fr; }
}

/* ── EKSTRA POLISHING ────────────────────────────────────────── */
/* Litt mer luft rundt workspace-toppseksjonen */
.workspace-top { margin-bottom: 24px; }
.eyebrow { font-size: 10px; letter-spacing: .12em; }

/* Scenario-switcher mer polert */
.scenario-switcher button { border-radius: var(--radius); font-weight: 500; }
.scenario-switcher button.active { box-shadow: 0 2px 8px rgba(0,212,170,.2); }

/* Barnebidrag-boks mer konsistent med resten */
.barnebidrag-info-box { background: var(--surface); border-color: var(--line-2); border-radius: var(--radius-lg); padding: 16px 18px; }

/* Checklist-kort */
.checklist-card { border-radius: var(--radius-lg); background: var(--surface); border-color: var(--line); }

/* Info-boks resultater */
.info-box-result { border-radius: var(--radius-lg); padding: 14px 18px; font-weight: 500; }

/* Missing-box listemarginer */
.missing-box ul { line-height: 2; }

/* Summary panel */
.summary-panel { padding: 28px 24px; }

/* Projeksjonsverdi-kolonner */
.proj-val { font-size: 14px; }
.proj-col-header { font-size: 10px; }

/* Breakdown-rader */
.breakdown-row { font-size: 14px; }
.breakdown-row strong { font-family: "IBM Plex Mono", monospace; }

/* Asset-rad inputs litt mer rom */
.asset-row input, .asset-row select { border-radius: 6px; }

/* Scenario-panel */
.scenario-panel { border-radius: var(--radius-lg); }

/* ── PRINT-RAPPORT HEADER (skjult på skjerm) ─────────────────── */
.print-report-header { display: none; }
.no-print { display: block; }

@media print {
  @page { size: A4; margin: 14mm 12mm; }
  .site-header, .hero, .prep-section, .sidebar, .scenario-switcher,
  .export-row, .flow-actions, .cmp-banner, .cmp-manage, .cmp-dialog,
  .insight-panel, .no-print, .rate-tabs, .proj-rate-wrap,
  .followup-block, .action-toolbar, .kpi-strip, .legal-note,
  .workspace-top, .access-gate-card, #previewNotice { display: none !important; }

  html, body { background: white !important; color: #111 !important; }
  .browser-shell { width: auto !important; margin: 0 !important; border: 0 !important; box-shadow: none !important; overflow: visible !important; }
  body, .workspace, .app-shell, .tool-surface, .summary-panel { background: white !important; color: #111 !important; }
  .workspace { min-height: auto !important; padding: 0 !important; }
  .tool-surface { padding: 0 !important; overflow: visible !important; }
  .app-shell { border: 0 !important; display: block !important; overflow: visible !important; min-height: auto !important; }
  .view { display: none !important; }
  #view-report { display: block !important; }

  /* Print-topptekst */
  .print-report-header {
    display: block !important;
    border-bottom: 2px solid #111;
    padding-bottom: 12px;
    margin-bottom: 20px;
  }
  .print-brand {
    font-size: 11px; font-weight: 700; letter-spacing: .12em;
    text-transform: uppercase; color: #555; margin-bottom: 6px;
  }
  .print-report-title {
    font-size: 26px; font-weight: 700; margin: 0 0 4px;
    font-family: "IBM Plex Serif", Georgia, serif; color: #111;
  }
  .print-report-meta {
    font-size: 13px; color: #444; display: flex; gap: 8px; align-items: center; margin-bottom: 6px;
  }
  .print-meta-sep { color: #aaa; }
  .print-report-disclaimer {
    font-size: 11px; color: #777; border-top: 1px solid #ddd; padding-top: 6px; margin-top: 8px;
  }

  /* Seksjon-formatering */
  #view-report section,
  #view-report .report-grid,
  #view-report .report-hero,
  #view-report .current-home-block,
  #view-report .budget-ledger { break-inside: avoid; page-break-inside: avoid; }
  .report-hero, .report-grid, .decision-grid { grid-template-columns: 1fr 1fr !important; }
  .report-hero article, .report-grid article, .decision-grid article,
  .ledger-row { border-color: #ddd !important; color: #111 !important; }
  .status-pill { border-color: #999 !important; color: #111 !important; background: transparent !important; }
  .current-home-block { margin-top: 10px !important; background: white !important; border-color: #ddd !important; }
  .budget-ledger { background: white !important; border-color: #ddd !important; }
  strong, .ledger-row strong { color: #111 !important; }
  .ledger-row.total { border-top: 1px solid #999 !important; }

  /* Projeksjonsrad: skjul rate-tab-interaksjon */
  .projection-grid { background: #eee !important; border-color: #ddd !important; }
  .proj-col-header, .proj-row-label { background: #f5f5f5 !important; color: #555 !important; }
  .proj-val { background: white !important; color: #111 !important; }
}

/* ── Tilgjengelighet: fokus på skjemafelt og redusert bevegelse ── */
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--blue-hi, #00d4aa);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
