/* ============================================================
   Kreditpartner — shared stylesheet
   Clean, premium, Scandinavian. Single accent, generous space.
   ============================================================ */

:root {
  --bg:        #FBFBF9;
  --surface:   #FFFFFF;
  --surface-2: #F4F4F0;
  --ink:       #16181D;
  --muted:     #5B6066;
  --faint:     #8A8F96;
  --border:    #E7E7E2;
  --border-2:  #DCDCD5;

  --accent:      #1E5C4F;  /* deep, trustworthy green */
  --accent-ink:  #16463C;
  --accent-soft: #EAF2EF;

  --warn-bg:   #FBF4E9;
  --warn-bd:   #EAD9B8;
  --warn-ink:  #6B5421;

  --pos:       #1E5C4F;
  --neg:       #9B3B2E;

  --radius:    14px;
  --radius-sm: 10px;
  --shadow:    0 1px 2px rgba(20,24,29,.04), 0 8px 30px rgba(20,24,29,.05);
  --shadow-sm: 0 1px 2px rgba(20,24,29,.05);

  --maxw: 1080px;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  font-size: 17px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-weight: 650;
  margin: 0 0 .5em;
}
h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 64px 0; }
.section--tight { padding: 40px 0; }
.muted { color: var(--muted); }
.center { text-align: center; }
.eyebrow {
  display: inline-block;
  font-size: .8rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 14px;
}
.lede { font-size: 1.15rem; color: var(--muted); max-width: 56ch; }

/* ---------- Top warning strip ---------- */
.topwarn {
  background: var(--ink);
  color: #EDEDE7;
  font-size: .82rem;
  text-align: center;
  padding: 9px 16px;
  line-height: 1.45;
}
.topwarn strong { color: #fff; font-weight: 600; }

/* ---------- Header / nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251,251,249,.85);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  height: 68px;
}
.brand {
  font-weight: 700; font-size: 1.15rem; letter-spacing: -0.02em;
  color: var(--ink); display: inline-flex; align-items: center; gap: 9px;
}
.brand:hover { text-decoration: none; }
/* Header uses the full lockup (icon + wordmark + slogan) on both
   desktop and mobile — sized down at the ≤860px breakpoint below. */
.brand-logo { display: block; height: 38px; width: auto; }
.brand-logo--footer { height: 54px; }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-links a {
  color: var(--muted); font-size: .95rem; font-weight: 500;
  padding: 8px 12px; border-radius: 8px;
}
.nav-links a:hover { color: var(--ink); background: var(--surface-2); text-decoration: none; }
.nav-links a.active { color: var(--ink); }
.nav-cta {
  margin-left: 8px;
}
.nav-links a.nav-cta,
.nav-links a.nav-cta:hover { color: #fff; }
.nav-toggle {
  display: none; background: none; border: 1px solid var(--border-2);
  border-radius: 8px; width: 42px; height: 38px; cursor: pointer; align-items: center; justify-content: center;
}
.nav-toggle span { display: block; width: 18px; height: 2px; background: var(--ink); position: relative; }
.nav-toggle span::before, .nav-toggle span::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: var(--ink);
}
.nav-toggle span::before { top: -6px; }
.nav-toggle span::after { top: 6px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; font-size: .98rem;
  padding: 12px 22px; border-radius: 10px; cursor: pointer;
  border: 1px solid transparent; transition: transform .04s ease, background .15s ease, border-color .15s ease;
  text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn--primary { background: var(--accent); color: #fff; }
.btn--primary:hover { background: var(--accent-ink); color: #fff; }
.btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--border-2); }
.btn--ghost:hover { background: var(--surface-2); }
.btn--sm { padding: 9px 16px; font-size: .9rem; border-radius: 9px; }
.btn--block { width: 100%; }

/* ---------- Hero ---------- */
.hero { padding: 56px 0 8px; }
.hero h1 { max-width: 16ch; }
.hero .lede { margin-top: 6px; }
.pill-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.pill {
  font-size: .82rem; color: var(--muted); background: var(--surface);
  border: 1px solid var(--border); padding: 6px 12px; border-radius: 999px;
  display: inline-flex; align-items: center; gap: 7px;
}
.pill .tick { color: var(--accent); font-weight: 700; }

/* ---------- Calculator ---------- */
.calc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.calc-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
}
.calc-inputs { padding: 30px 32px; }
.calc-results {
  padding: 30px 32px;
  background: var(--accent-soft);
  border-left: 1px solid var(--border);
}
.calc-title { font-size: 1.05rem; font-weight: 650; margin-bottom: 4px; }
.calc-sub { font-size: .9rem; color: var(--muted); margin-bottom: 22px; }

/* ---------- Homepage calculator: loan/debt-type selector ---------- */
.calc-type-tabs {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px;
  background: var(--surface-2); padding: 6px; border-bottom: 1px solid var(--border);
}
.calc-type-btn {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: .85rem; font-weight: 600; color: var(--muted);
  background: transparent; border: none; border-radius: 8px;
  padding: 10px 6px; cursor: pointer; white-space: nowrap;
}
.calc-type-btn:hover { color: var(--ink); }
.calc-type-btn.is-active {
  background: var(--surface); color: var(--ink);
  box-shadow: 0 1px 2px rgba(20,24,29,.08), 0 4px 10px rgba(20,24,29,.06);
}
.calc-type-ic { font-size: 1rem; line-height: 1; }
.home-panel--hidden { display: none !important; }
.calc-reco { margin-top: 14px; text-align: center; font-size: .92rem; }
.calc-reco a { color: var(--accent); font-weight: 600; }

.field { margin-bottom: 18px; }
.field:last-child { margin-bottom: 0; }
.field label {
  display: flex; justify-content: space-between; align-items: baseline;
  font-size: .9rem; font-weight: 550; margin-bottom: 7px; color: var(--ink);
}
.field label .val { font-variant-numeric: tabular-nums; color: var(--accent); font-weight: 650; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap .suffix {
  position: absolute; right: 14px; font-size: .9rem; color: var(--faint); pointer-events: none;
}
input[type="number"], input[type="text"], select {
  width: 100%; font: inherit; font-size: 1rem;
  padding: 11px 14px; border: 1px solid var(--border-2); border-radius: 10px;
  background: var(--surface); color: var(--ink);
  font-variant-numeric: tabular-nums; -moz-appearance: textfield;
}
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
  background: var(--border-2); border-radius: 999px; margin: 14px 0 2px; cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--accent); border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); cursor: pointer;
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border-radius: 50%; background: var(--accent);
  border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.2); cursor: pointer;
}

/* result readouts */
.result-main { margin-bottom: 18px; }
.result-main .label { font-size: .85rem; color: var(--muted); margin-bottom: 2px; }
.result-main .big {
  font-size: 2.3rem; font-weight: 700; letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums; line-height: 1.05;
}
.result-rows { border-top: 1px solid var(--border-2); padding-top: 14px; }
.result-row {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 7px 0; font-size: .95rem;
}
.result-row .k { color: var(--muted); }
.result-row .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.result-note {
  font-size: .78rem; color: var(--faint); margin-top: 16px; line-height: 1.5;
  border-top: 1px solid var(--border-2); padding-top: 12px;
}

/* ---------- Category cards ---------- */
.cards {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px;
}
.card {
  display: block; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 26px 26px; box-shadow: var(--shadow-sm);
  transition: border-color .15s ease, transform .1s ease, box-shadow .15s ease;
  color: var(--ink);
}
.card:hover { text-decoration: none; border-color: var(--border-2); transform: translateY(-2px); box-shadow: var(--shadow); }
.card .card-ic {
  width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft);
  color: var(--accent); display: flex; align-items: center; justify-content: center; margin-bottom: 16px;
}
.card h3 { margin-bottom: 6px; }
.card p { color: var(--muted); font-size: .95rem; margin-bottom: 14px; }
.card .more { color: var(--accent); font-weight: 600; font-size: .92rem; display: inline-flex; align-items: center; gap: 6px; }
.card:hover .more .arr { transform: translateX(3px); }
.card .more .arr { transition: transform .15s ease; }

/* ---------- Trust row ---------- */
.trust { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.trust .item { }
.trust h4 { font-size: 1rem; margin-bottom: 4px; }
.trust p { color: var(--muted); font-size: .92rem; margin: 0; }

/* ---------- Generic content blocks ---------- */
.content { max-width: 760px; }
.content h2 { margin-top: 8px; }
.content h3 { margin-top: 28px; }
.content p { color: #2C3036; }
.content ul { padding-left: 0; list-style: none; margin: 0 0 1.2rem; }
.content ul li {
  position: relative; padding-left: 26px; margin-bottom: 9px; color: #2C3036;
}
.content ul li::before {
  content: ""; position: absolute; left: 4px; top: 11px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--accent);
}

/* term/definition mini blocks */
.terms { display: grid; gap: 14px; margin: 8px 0 8px; }
.term {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 18px 20px;
}
.term h4 { margin: 0 0 4px; font-size: 1.02rem; }
.term p { margin: 0; color: var(--muted); font-size: .95rem; }

/* ---------- Accordion (Läs mer) ---------- */
.acc { border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); overflow: hidden; }
.acc + .acc { margin-top: 12px; }
.acc summary {
  list-style: none; cursor: pointer; padding: 18px 20px;
  font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 16px;
}
.acc summary::-webkit-details-marker { display: none; }
.acc summary .ico {
  flex: none; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--border-2);
  position: relative; transition: transform .2s ease;
}
.acc summary .ico::before, .acc summary .ico::after {
  content: ""; position: absolute; background: var(--accent); border-radius: 2px;
  top: 50%; left: 50%; transform: translate(-50%,-50%);
}
.acc summary .ico::before { width: 9px; height: 1.6px; }
.acc summary .ico::after { width: 1.6px; height: 9px; transition: opacity .2s ease; }
.acc[open] summary .ico::after { opacity: 0; }
.acc .acc-body { padding: 0 20px 20px; color: #2C3036; }
.acc .acc-body p:last-child { margin-bottom: 0; }

/* ---------- Checklist ---------- */
.checklist { display: grid; gap: 10px; margin: 8px 0; }
.check {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.check .box {
  flex: none; width: 22px; height: 22px; border-radius: 6px; background: var(--accent-soft);
  color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 13px; margin-top: 1px;
}
.check p { margin: 0; font-size: .95rem; color: #2C3036; }

/* ---------- Warning box ---------- */
.warnbox {
  background: var(--warn-bg); border: 1px solid var(--warn-bd); color: var(--warn-ink);
  border-radius: var(--radius-sm); padding: 16px 18px; font-size: .9rem; line-height: 1.55;
}
.warnbox strong { color: var(--warn-ink); }

.disclaimer-inline {
  font-size: .82rem; color: var(--faint); line-height: 1.55;
}

/* ---------- CTA band ---------- */
.cta-band {
  background: var(--ink); color: #F1F1EC; border-radius: var(--radius); padding: 44px 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 30px; flex-wrap: wrap;
}
.cta-band h2 { color: #fff; margin: 0 0 6px; }
.cta-band p { color: #B9BCC0; margin: 0; max-width: 48ch; font-size: .98rem; }
.cta-band .btn--primary { background: var(--accent); }
.cta-band .btn--primary:hover { background: #2a7766; color:#fff; }

/* page hero for inner pages */
.page-hero { padding: 50px 0 30px; }
.page-hero .eyebrow { margin-bottom: 10px; }
.breadcrumb { font-size: .85rem; color: var(--faint); margin-bottom: 14px; }
.breadcrumb a { color: var(--muted); }

/* two-column layout for category pages */
.split { display: grid; grid-template-columns: 1fr; gap: 40px; }

/* ---------- Comparison result ---------- */
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.cmp-col {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 20px;
}
.cmp-col.now { }
.cmp-col.next { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.cmp-col .tag {
  font-size: .72rem; letter-spacing: .07em; text-transform: uppercase; font-weight: 700; color: var(--muted);
}
.cmp-col.next .tag { color: var(--accent); }
.cmp-col .big { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; margin: 4px 0 12px; letter-spacing: -.02em; }
.cmp-col .line { display: flex; justify-content: space-between; font-size: .9rem; padding: 5px 0; }
.cmp-col .line .k { color: var(--muted); }
.cmp-col .line .v { font-weight: 600; font-variant-numeric: tabular-nums; }

.verdict {
  margin-top: 18px; padding: 22px 24px; border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid #CFE3DC;
}
.verdict .headline { font-size: 1.15rem; font-weight: 650; margin-bottom: 10px; }
.verdict .vrow { display: flex; justify-content: space-between; padding: 6px 0; font-size: .95rem; border-top: 1px solid #D6E6E0; }
.verdict .vrow:first-of-type { border-top: none; }
.verdict .vrow .v { font-weight: 700; font-variant-numeric: tabular-nums; }
.delta-pos { color: var(--pos); }
.delta-neg { color: var(--neg); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 56px 0 40px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.footer-grid h5 { font-size: .8rem; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); margin: 0 0 14px; font-weight: 600; }
.footer-grid a { display: block; color: var(--muted); font-size: .92rem; margin-bottom: 9px; }
.footer-grid a:hover { color: var(--ink); }
.footer-about p { color: var(--muted); font-size: .9rem; max-width: 38ch; }
.footer-bottom { margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--border); font-size: .82rem; color: var(--faint); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(20,24,29,.5); backdrop-filter: blur(2px);
  display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  background: var(--surface); border-radius: var(--radius); max-width: 480px; width: 100%;
  padding: 30px 30px 26px; box-shadow: 0 20px 60px rgba(0,0,0,.25); animation: pop .18s ease;
}
@keyframes pop { from { transform: scale(.97); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal h3 { font-size: 1.3rem; margin-bottom: 12px; }
.modal ul { list-style: none; padding: 0; margin: 0 0 18px; }
.modal ul li { position: relative; padding-left: 22px; margin-bottom: 8px; font-size: .92rem; color: #2C3036; }
.modal ul li::before { content: ""; position: absolute; left: 2px; top: 9px; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.modal .modal-warn { font-size: .85rem; }
.modal .modal-actions { display: flex; gap: 10px; margin-top: 20px; }

/* ============================================================
   v2 additions: credit warning, eff-rate row, glossary, steps
   ============================================================ */

/* ---------- Official credit warning ---------- */
:root { --danger: #C0341D; --danger-bg: #FCF1EE; --danger-bd: #F0D2CA; }

.warn-ic {
  flex: none; width: 22px; height: 22px; margin-top: 1px; color: var(--danger);
}

/* Credit warning notice — placed near the calculator/CTA, not as a top banner */
.creditwarn {
  display: flex; gap: 16px; align-items: flex-start;
  background: var(--surface); border: 1.5px solid var(--danger-bd);
  border-radius: var(--radius-sm); padding: 16px 18px; margin: 0;
}
.creditwarn .warn-ic { flex: none; width: 68px; height: 68px; margin-top: 0; }
.creditwarn p { margin: 0; font-size: .92rem; line-height: 1.55; color: var(--ink); }
.creditwarn .warn-h { color: var(--ink); font-weight: 700; }
.creditwarn a { color: #1a56db; text-decoration: underline; }

/* ---------- Effective-rate row in results ---------- */
.eff-row {
  display: flex; justify-content: space-between; align-items: baseline;
  margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--border-2);
}
.eff-row .k { font-size: .92rem; color: var(--muted); }
.eff-row .v { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 1.05rem; }

/* räkneexempel disclaimer block */
.rakneexempel {
  font-size: .8rem; color: var(--faint); line-height: 1.55;
  background: var(--surface-2); border-radius: var(--radius-sm);
  padding: 12px 14px; margin-top: 16px;
}

/* ---------- Trust steps (1-2-3) ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.step .n {
  width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent);
  font-weight: 700; display: flex; align-items: center; justify-content: center; margin-bottom: 14px; font-size: .95rem;
}
.step h4 { margin: 0 0 5px; font-size: 1.05rem; }
.step p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------- Glossary ---------- */
.gloss-search { position: relative; margin-bottom: 28px; max-width: 460px; }
.gloss-search input { padding-left: 42px; }
.gloss-search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--faint); }
.gloss-group { margin-bottom: 30px; }
.gloss-letter {
  font-size: .9rem; font-weight: 700; color: var(--accent); letter-spacing: .04em;
  padding-bottom: 8px; border-bottom: 1px solid var(--border); margin-bottom: 14px;
}
.gloss-list { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.gloss-item {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 16px 18px; scroll-margin-top: 90px;
}
.gloss-item h4 { margin: 0 0 5px; font-size: 1rem; }
.gloss-item p { margin: 0; font-size: .9rem; color: var(--muted); line-height: 1.5; }
.gloss-item p a { color: var(--accent); }
#ordlista-empty { color: var(--muted); padding: 20px 0; }

/* ============================================================
   Mobile-first components (base = hidden/desktop; shown in @media)
   ============================================================ */
body { overflow-x: hidden; }

/* Hero CTAs — mobile only */
.hero-cta { display: none; gap: 10px; margin: 22px 0 4px; }

/* Comparison: desktop keeps two columns via this class (was inline grid) */
.cmp-inputs { display: grid; grid-template-columns: 1fr 1fr; gap: 0; }
.cmp-tabs { display: none; }

/* Sticky mobile CTA bar (injected by JS) — hidden on desktop */
.mobile-cta-bar { display: none; }

/* Mobile-only hero — hidden on desktop */
.m-hero { display: none; }

/* ============================================================
   Responsive — mobile-first polish (desktop untouched)
   ============================================================ */
@media (max-width: 860px) {
  /* ---- Header: hamburger replaces the inline desktop nav ---- */
  .site-header { position: sticky; }
  .nav { height: 58px; }
  .nav-toggle { display: flex; }
  .brand-logo { height: 34px; }
  .brand-logo--footer { height: 46px; }
  /* Desktop inline nav is not used as the mobile menu — see .mobile-menu below.
     (Kept in the DOM for desktop; simply hidden here.) */
  .nav-links { display: none !important; }

  /* ---- Tighter vertical rhythm (less bulk) ---- */
  .section { padding: 34px 0; }
  .section--tight { padding: 20px 0; }
  .hero { padding: 22px 0 4px; }
  .page-hero { padding: 22px 0 12px; }
  .wrap { padding: 0 18px; }
  h2 { font-size: 1.5rem; }
  .eyebrow { margin-bottom: 10px; }

  /* ---- Credit warning: compact but triangle still clearly visible ---- */
  .creditwarn { padding: 13px 14px; gap: 12px; }
  .creditwarn p { font-size: .82rem; }
  .creditwarn .warn-ic { width: 60px; height: 60px; }

  /* ---- Hero: compact, CTA visible early ---- */
  .hero h1 { max-width: none; }
  .hero .lede { font-size: 1rem; margin-bottom: 0; }
  .hero-cta { display: flex; flex-direction: column; gap: 9px; margin: 18px 0 2px; }
  .hero-cta .btn { width: 100%; padding: 15px; font-size: 1.05rem; }
  .hero .pill-row { gap: 6px; margin-top: 16px; }
  .pill { font-size: .76rem; padding: 5px 11px; }

  /* ---- Calculator: full-width, thumb-friendly ---- */
  .calc-grid { grid-template-columns: 1fr; }
  .calc-results { border-left: none; border-top: 1px solid var(--border); }
  .calc-inputs, .calc-results { padding: 20px 17px; }
  .calc-sub { margin-bottom: 18px; }
  .field { margin-bottom: 17px; }
  .field label { font-size: .92rem; }
  input[type="number"], input[type="text"], select {
    font-size: 16px; padding: 13px 14px; min-height: 50px;   /* 16px stops iOS zoom */
  }
  input[type="range"] { height: 6px; margin: 15px 0 4px; }
  input[type="range"]::-webkit-slider-thumb { width: 26px; height: 26px; }
  input[type="range"]::-moz-range-thumb { width: 26px; height: 26px; }
  .result-main .big { font-size: 2rem; }
  .calc .btn--block { padding: 15px; font-size: 1.05rem; }

  /* ---- Comparison: tabs instead of side-by-side ---- */
  .cmp-inputs { grid-template-columns: 1fr; }
  .cmp-inputs .calc-inputs { border-right: none !important; }
  .cmp-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 16px 17px 0; }
  .cmp-tab {
    font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer;
    padding: 12px; border-radius: 10px; border: 1px solid var(--border-2);
    background: var(--surface); color: var(--muted);
  }
  .cmp-tab.active { background: var(--accent); color: #fff; border-color: var(--accent); }
  .cmp-panel { display: none; }
  .cmp-panel.active { display: block; }
  .cmp-grid { grid-template-columns: 1fr; gap: 12px; }

  /* ---- Category cards → compact, scannable rows ---- */
  .cards { grid-template-columns: 1fr; gap: 11px; }
  .cards .card {
    display: grid; grid-template-columns: auto 1fr auto; column-gap: 14px;
    align-items: center; padding: 15px 16px; transform: none;
  }
  .cards .card:hover { transform: none; }
  .cards .card .card-ic { grid-column: 1; grid-row: 1 / span 2; margin: 0; width: 40px; height: 40px; }
  .cards .card h3 { grid-column: 2; grid-row: 1; margin: 0; font-size: 1.04rem; align-self: end; }
  .cards .card p {
    grid-column: 2; grid-row: 2; margin: 2px 0 0; font-size: .85rem; align-self: start;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .cards .card .more { display: none; }
  .cards .card::after {
    content: "›"; grid-column: 3; grid-row: 1 / span 2; align-self: center;
    color: var(--faint); font-size: 1.5rem; line-height: 1;
  }

  /* ---- Other grids stack, tighter ---- */
  .trust { grid-template-columns: 1fr; gap: 16px; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
  .steps { grid-template-columns: 1fr; gap: 11px; }
  .step { padding: 18px 20px; }
  .gloss-list { grid-template-columns: 1fr; }

  /* ---- Content pages: tighter heading rhythm ---- */
  .content h3 { margin-top: 22px; }
  .terms { gap: 11px; }
  .term { padding: 15px 17px; }

  /* ---- CTA bands stack, full-width button ---- */
  .cta-band { padding: 24px 20px; gap: 16px; }
  .cta-band h2 { font-size: 1.35rem; }
  .cta-band p { font-size: .95rem; }
  .cta-band .btn { width: 100%; }

  /* ---- Glossary: sticky search ---- */
  .gloss-search {
    position: sticky; top: 58px; z-index: 20; max-width: none;
    margin: 0 -18px 20px; padding: 12px 18px;
    background: rgba(251,251,249,.94); backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--border);
  }
  .gloss-search .ic { left: 32px; }
  .gloss-group { margin-bottom: 24px; }

  /* ---- Sticky bottom CTA bar ---- */
  body.has-mcta { padding-bottom: 74px; }
  .mobile-cta-bar {
    display: flex; gap: 10px; align-items: center;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    padding: 9px 16px calc(9px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.94); backdrop-filter: blur(10px);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(20,24,29,.06);
  }
  .mobile-cta-bar .btn { flex: 1; padding: 14px; font-size: 1.05rem; }
  body.menu-open .mobile-cta-bar { display: none; }
}

/* ============================================================
   Dedicated mobile menu (hamburger dropdown)
   Rendered as a direct child of <body> — not nested inside
   .site-header — so its own stacking/positioning is never
   affected by the header's backdrop-filter. Desktop-hidden.
   ============================================================ */
.mobile-menu-backdrop { display: none; }
.mobile-menu { display: none; }

@media (max-width: 860px) {
  .mobile-menu-backdrop {
    /* starts below the header so it never covers the hamburger button —
       otherwise it would intercept the tap meant to close the menu */
    display: block; position: fixed; top: 58px; left: 0; right: 0; bottom: 0; z-index: 190;
    background: rgba(20,24,29,.28);
    opacity: 0; visibility: hidden; transition: opacity .16s ease, visibility .16s;
  }
  .mobile-menu-backdrop.open { opacity: 1; visibility: visible; }

  .mobile-menu {
    display: flex; flex-direction: column;
    position: fixed; top: calc(58px + env(safe-area-inset-top) + 10px);
    left: 14px; right: 14px; z-index: 200;
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: 0 20px 50px rgba(20,24,29,.18);
    padding: 8px; max-height: calc(100vh - 90px); overflow-y: auto;
    transform-origin: top right;
    opacity: 0; visibility: hidden; transform: translateY(-8px) scale(.98);
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
  }
  .mobile-menu.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
  .mobile-menu a {
    padding: 13px 12px; font-size: 1rem; font-weight: 500;
    color: var(--ink); border-radius: 8px; border-bottom: 1px solid var(--border);
  }
  .mobile-menu a:last-child { border-bottom: none; }
  .mobile-menu a:hover { background: var(--surface-2); text-decoration: none; }
  .mobile-menu a.active { color: var(--accent); font-weight: 600; }
  .mobile-menu-cta.btn { margin-top: 6px; text-align: center; border-bottom: none; }

  /* Hamburger → X */
  .nav-toggle span { transition: background-color .15s ease; }
  .nav-toggle span::before, .nav-toggle span::after { transition: transform .15s ease, top .15s ease; }
  .nav-toggle.active span { background: transparent; }
  .nav-toggle.active span::before { top: 0; transform: rotate(45deg); }
  .nav-toggle.active span::after { top: 0; transform: rotate(-45deg); }
}

/* ============================================================
   Mobile homepage — purpose-built hero (≤767px)
   Desktop hero is hidden and replaced by .m-hero here.
   ============================================================ */
@media (max-width: 767px) {
  /* swap desktop hero for mobile hero */
  .hero { display: none; }

  /* ---- Credit warning: compact on small phones, triangle still prominent ---- */
  .creditwarn { padding: 12px 13px; gap: 10px; }
  .creditwarn p { font-size: .8rem; line-height: 1.5; }
  .creditwarn .warn-ic { width: 58px; height: 58px; }

  /* ---- Mobile hero ---- */
  .m-hero { display: block; padding: 18px 18px 8px; }
  .m-eyebrow {
    display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
    color: var(--accent); background: var(--accent-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 16px;
  }
  .m-title { font-size: 2rem; line-height: 1.12; letter-spacing: -0.025em; font-weight: 700; margin: 0 0 10px; }
  .m-sub { font-size: 1rem; line-height: 1.5; color: var(--muted); margin: 0 0 18px; max-width: 32ch; }
  .m-cta { display: flex; flex-direction: column; gap: 10px; }
  .m-cta .btn { padding: 16px; font-size: 1.06rem; border-radius: 13px; }
  .m-cta .btn--primary { box-shadow: 0 8px 20px rgba(30,92,79,.22); }
  .m-cta .btn--ghost { border-color: var(--border-2); color: var(--ink); background: var(--surface); font-weight: 600; }
  .m-trust { list-style: none; display: flex; flex-wrap: wrap; gap: 7px; margin: 16px 0 0; padding: 0; }
  .m-trust li {
    display: inline-flex; align-items: center; gap: 6px; font-size: .77rem; color: var(--muted);
    background: var(--surface); border: 1px solid var(--border); padding: 6px 11px; border-radius: 999px;
  }
  .m-trust svg { color: var(--accent); flex: none; }

  /* calculator sits right after hero */
  #kalkylator { padding-top: 12px; }
  .calc { box-shadow: 0 1px 2px rgba(20,24,29,.05), 0 10px 30px rgba(20,24,29,.06); }
}

/* Phones (≤600px) — typography scale */
@media (max-width: 600px) {
  h1 { font-size: 1.72rem; letter-spacing: -0.015em; }
  h2 { font-size: 1.42rem; }
  .lede { font-size: 1rem; }
  .page-hero .lede, .hero .lede { font-size: 1rem; }

  /* Homepage calculator type selector: 2x2 grid so labels stay readable */
  .calc-type-tabs { grid-template-columns: 1fr 1fr; }
  .calc-type-btn { font-size: .82rem; padding: 10px 8px; }
}

/* Small phones (≤430px) */
@media (max-width: 430px) {
  body { font-size: 16px; }
  .wrap { padding: 0 16px; }
  .footer-grid { grid-template-columns: 1fr; gap: 20px; }
  h1 { font-size: 1.62rem; }
  .result-main .big { font-size: 1.9rem; }
  .modal { padding: 22px 20px 20px; }
  .breadcrumb { font-size: .8rem; }
  .gloss-search { margin-left: -16px; margin-right: -16px; }
}
