:root {
  --ink: #111111;
  --ink-2: #1c1c1c;
  --paper: #ffffff;
  --muted: #5b5b5b;
  --line: #e4e4e4;
  --y: #ffd400;
  --y-soft: rgba(255, 212, 0, 0.35);
  --display: 'Archivo Black', 'Inter', system-ui, sans-serif;
  --body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --max: 1080px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 72px; }
body {
  margin: 0;
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { text-decoration-color: var(--y); }
sup a { text-decoration: none; font-weight: 600; font-size: 0.75em; padding: 0 1px; color: var(--muted); }
sup a:hover { color: var(--ink); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 96px 24px; }
.hl { color: var(--y); }

/* Top bar */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 24px;
  background: var(--ink); color: var(--paper);
}
.brand { font-family: var(--display); font-size: 20px; text-decoration: none; letter-spacing: -0.3px; }
.brand .dot { color: var(--y); }
.topbar nav { display: flex; gap: 20px; flex-wrap: wrap; }
.topbar nav a { font-size: 14px; font-weight: 600; text-decoration: none; color: #cfcfcf; }
.topbar nav a:hover { color: var(--y); }

/* Typography */
h1, h2, h3 { margin: 0; }
h1 {
  font-family: var(--display);
  font-size: clamp(48px, 9vw, 112px);
  line-height: 0.98;
  letter-spacing: -2px;
  text-transform: uppercase;
}
h2 {
  font-family: var(--display);
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -1px;
  margin-bottom: 28px;
}
h3 { font-size: 20px; font-weight: 700; margin-bottom: 8px; }
.kicker {
  margin: 0 0 16px;
  font-size: 14px; font-weight: 700; letter-spacing: 2.5px; text-transform: uppercase;
  color: var(--muted);
}
.lead { font-size: clamp(19px, 2.2vw, 24px); line-height: 1.5; max-width: 760px; margin: 32px 0 0; }
.sub { color: var(--muted); max-width: 720px; margin: 0 0 32px; }
.body { max-width: 760px; }
.fine { font-size: 14px; color: var(--muted); max-width: 760px; }

/* Hero */
.hero {
  background: var(--ink); color: var(--paper);
  padding: 96px 24px 112px;
}
.hero > * { max-width: var(--max); margin-left: auto; margin-right: auto; }
.hero .kicker { color: #9a9a9a; }
.duel { margin-top: 64px; display: grid; gap: 28px; }
.duel-row { display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; align-items: end; }
.duel-label { font-size: 16px; font-weight: 600; color: #d6d6d6; }
.duel-num { font-family: var(--display); font-size: clamp(28px, 4vw, 44px); line-height: 1; }
.bar { grid-column: 1 / -1; display: flex; height: 40px; background: #262626; }
.fill { display: block; height: 100%; }
.fill-y { background: var(--y); }
.fill-w { background: #ffffff; }
.fill-w-soft { background: rgba(255, 255, 255, 0.45); }
.duel-note { font-size: 14px; color: #9a9a9a; margin: 0; }
.cta {
  display: inline-block; margin-top: 48px;
  padding: 16px 28px; min-height: 48px;
  background: var(--y); color: var(--ink);
  font: 700 17px/1 var(--body); text-decoration: none;
  border: 0; border-radius: 4px; cursor: pointer;
}
.cta:hover { background: #ffe14d; }

/* Bands */
.band { background: #f6f6f3; }
.band-dark { background: var(--ink-2); color: var(--paper); }
.band-dark .kicker { color: #9a9a9a; }
.band-dark sup a { color: #bdbdbd; }

/* Calculator */
.calc { display: grid; gap: 14px; max-width: 640px; }
.calc label { font-weight: 600; }
.calc input[type=range] { width: 100%; accent-color: var(--ink); height: 32px; }
.calc select { font: 500 17px var(--body); padding: 12px; border: 2px solid var(--ink); border-radius: 4px; background: var(--paper); max-width: 280px; min-height: 48px; }
.presets { display: flex; gap: 10px; flex-wrap: wrap; }
.presets button {
  font: 600 15px var(--body); padding: 10px 16px; min-height: 44px;
  border: 2px solid var(--ink); background: transparent; border-radius: 4px; cursor: pointer;
}
.presets button:hover, .presets button[aria-pressed=true] { background: var(--ink); color: var(--paper); }
.result { margin: 40px 0 16px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 12px 24px; }
.result-num { font-family: var(--display); font-size: clamp(48px, 8vw, 88px); line-height: 1; }
.result-txt { max-width: 420px; }

/* Facts */
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; margin: 8px 0 48px; }
.fact { margin: 0; padding: 28px; border: 2px solid var(--ink); border-radius: 6px; }
.fact-num { font-family: var(--display); font-size: clamp(36px, 5vw, 56px); line-height: 1; margin-bottom: 12px; }
.fact blockquote { margin: 0 0 12px; font-size: 21px; font-weight: 600; line-height: 1.4; }
.fact figcaption { color: var(--muted); font-size: 16px; }
.facts-3 { margin-top: 48px; }
.facts-3 .fact-num { font-size: clamp(32px, 3.6vw, 44px); white-space: nowrap; }

/* Ledger */
.ledger { margin-top: 40px; }
.ledger h3 { margin-top: 40px; font-size: 22px; }
table { width: 100%; border-collapse: collapse; margin-top: 12px; }
td { padding: 14px 8px; border-bottom: 1px solid var(--line); vertical-align: baseline; }
td.n { text-align: right; white-space: nowrap; font-weight: 700; font-variant-numeric: tabular-nums; }
td:last-child { width: 120px; text-align: right; white-space: nowrap; }
tr.sum td { border-bottom: 3px solid var(--ink); font-weight: 700; font-size: 20px; }
tr.sum td.n.hl { color: var(--ink); background: var(--y); padding-right: 12px; padding-left: 12px; }
.tag { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: 0.5px; padding: 2px 8px; border-radius: 3px; text-transform: uppercase; }
.tag.src { background: var(--ink); color: var(--paper); }
.tag.calc { border: 1.5px solid var(--ink); }
.tag-knapp { cursor: pointer; }
.note { color: var(--muted); font-size: 16px; max-width: 760px; }

.verdict { margin: 64px 0 0; padding: 40px; background: var(--ink); color: var(--paper); border-radius: 6px; }
.verdict-big { font-family: var(--display); font-size: clamp(56px, 10vw, 120px); line-height: 1; color: var(--y); }
.verdict p { font-size: 20px; margin: 16px 0 0; max-width: 640px; }

/* Two / three columns */
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 40px; }
.two p { margin: 0; color: #dcdcdc; }

/* Steps */
.steps { list-style: none; padding: 0; margin: 0; counter-reset: s; display: grid; gap: 40px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 72px 1fr; gap: 8px 20px; }
.steps li::before {
  content: counter(s);
  grid-row: span 2;
  font-family: var(--display); font-size: 56px; line-height: 1; color: var(--y);
  -webkit-text-stroke: 2px var(--ink);
}
.steps h3 { font-size: 24px; margin: 6px 0 0; }
.steps p { margin: 0; max-width: 720px; }

/* Rules */
.rules { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 20px; }
.rule { background: var(--paper); padding: 24px; border-radius: 6px; border-top: 6px solid var(--y); }
.rule p { margin: 0; font-size: 16px; }

/* Objections */
details { border-top: 2px solid var(--ink); padding: 4px 0; }
details:last-of-type { border-bottom: 2px solid var(--ink); }
summary {
  cursor: pointer; list-style: none;
  padding: 20px 40px 20px 0; position: relative;
  font-size: 21px; font-weight: 700;
}
summary::-webkit-details-marker { display: none; }
summary::after { content: '+'; position: absolute; right: 4px; top: 14px; font-family: var(--display); font-size: 30px; }
details[open] summary::after { content: '−'; }
details p { margin: 0 0 24px; max-width: 760px; }

/* Closing */
.closing { background: var(--ink); color: var(--paper); text-align: left; }
.closing p { font-size: 20px; max-width: 640px; }
.closing .fine { color: #9a9a9a; }

/* Sources */
.sources ol { padding-left: 24px; font-size: 15px; }
.sources li { margin-bottom: 10px; color: #333; }
.sources li:target { background: var(--y-soft); }

.foot { border-top: 1px solid var(--line); }
.foot .wrap { padding-top: 32px; padding-bottom: 48px; font-size: 14px; color: var(--muted); }

@media (max-width: 720px) {
  body { font-size: 17px; }
  .wrap { padding: 64px 20px; }
  .hero { padding: 64px 20px 80px; }
  .topbar nav { display: none; }
  td:last-child { width: auto; }
  td { padding: 12px 4px; font-size: 15px; }
  tr.sum td { font-size: 16px; }
  .steps li { grid-template-columns: 48px 1fr; }
  .steps li::before { font-size: 40px; }
  .verdict { padding: 28px; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* Beräkningssidan */
.doc h1 { font-size: clamp(40px, 6vw, 72px); text-transform: none; letter-spacing: -1px; margin-bottom: 24px; }
.doc h2 { font-size: clamp(26px, 3.5vw, 36px); margin: 56px 0 16px; }
.doc h3 { margin-top: 32px; }
.doc p, .doc li { max-width: 760px; }
.doc hr { border: 0; border-top: 2px solid var(--ink); margin: 48px 0 0; }
.doc table { font-size: 16px; }
.doc th { text-align: left; padding: 10px 8px; border-bottom: 2px solid var(--ink); }
.doc td:last-child { width: auto; text-align: left; white-space: normal; }
.doc td:nth-child(2) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.doc .cta { margin-top: 32px; }

/* Folket AB */
.two-light p { color: var(--ink); }
.body-light { color: #dcdcdc; margin-bottom: 32px; }
.body-light a { color: var(--y); }
.ledger-dark table { margin-bottom: 8px; }
.ledger-dark td { border-bottom-color: #333; }
.ledger-dark tr.sum td { border-bottom-color: var(--y); }
.ledger-dark tr.sum td.n.hl { background: transparent; color: var(--y); padding: 14px 8px; }
.ledger-dark .note { color: #a8a8a8; margin-bottom: 48px; }
th { text-align: left; font-size: 14px; letter-spacing: 1px; text-transform: uppercase; padding: 10px 8px; border-bottom: 2px solid currentColor; }
th.n { text-align: right; }
.ledger-dark td:last-child { width: auto; }
.teaser { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: end; }
@media (max-width: 720px) { .teaser { grid-template-columns: 1fr; } th { font-size: 12px; } }
.facts-3 .fact-num.sm { font-size: clamp(26px, 2.6vw, 34px); white-space: normal; }

/* Fördelning av elräkningen */
.split { margin: 8px 0 24px; max-width: 760px; }
.split-title { font-weight: 700; margin: 0 0 10px; }
.split-bar { display: flex; height: 32px; border: 2px solid var(--ink); border-radius: 4px; overflow: hidden; background: var(--paper); }
.seg { display: block; height: 100%; transition: width .2s ease; }
.seg + .seg { border-left: 2px solid var(--ink); }
.seg-el, .dot-el { background: var(--y); }
.seg-nat, .dot-nat { background: var(--ink); }
.seg-skatt, .dot-skatt { background: #8a8a8a; }
.seg-moms, .dot-moms { background: repeating-linear-gradient(45deg, #8a8a8a 0 4px, #ffffff 4px 8px); }
.split-legend { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-wrap: wrap; gap: 8px 24px; font-size: 15px; }
.split-legend li { display: flex; align-items: center; gap: 8px; }
.split-legend i { display: inline-block; width: 14px; height: 14px; border: 1.5px solid var(--ink); border-radius: 2px; }
@media (prefers-reduced-motion: reduce) { .seg { transition: none; } }
.ledger-dark .tag.src { background: var(--paper); color: var(--ink); }
#elnatet .two { margin-top: 48px; }
#eu .two { margin-top: 48px; }
#eu .eu-slut { margin-top: 48px; font-weight: 600; font-size: 21px; }
@media (max-width: 600px) {
  td.n { white-space: normal; }
  #eu td.n { text-align: left; }
  th { white-space: normal; letter-spacing: 0; font-size: 11px; padding-left: 3px; padding-right: 3px; }
  td { padding-left: 3px; padding-right: 3px; }
  .tag { font-size: 10px; letter-spacing: 0; padding: 1px 4px; }
  td { hyphens: auto; -webkit-hyphens: auto; overflow-wrap: break-word; }
}

/* Komprimerad startsida: det viktigaste syns direkt, resten fälls ut */
.hero-full { min-height: calc(100svh - 52px); display: flex; flex-direction: column; justify-content: center; padding-top: 56px; padding-bottom: 64px; }
.hero-full > * { width: 100%; }
.hero-full .duel { margin-top: 48px; }
.hero-full .lead { margin-top: 40px; }
.duel-anim .fill { transform-origin: left center; animation: vaxa 1.4s cubic-bezier(.2,.7,.2,1) both; }
.duel-anim .duel-row + .duel-row .fill { animation-delay: .35s; }
.duel-anim .duel-num { animation: tona 0.6s ease both; animation-delay: 1.1s; }
.duel-anim .duel-row + .duel-row .duel-num { animation-delay: 1.45s; }
@keyframes vaxa { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes tona { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .duel-anim .fill, .duel-anim .duel-num { animation: none; } }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px 16px; margin-top: 40px; }
.cta-row .cta { margin-top: 0; }
.cta-ghost { background: transparent; color: var(--paper); border: 2px solid #555; }
.cta-ghost:hover { background: transparent; border-color: var(--y); }

.result-zero { font-family: var(--display); font-size: clamp(48px, 8vw, 88px); line-height: 1; color: var(--muted); }
.result-zero span { color: var(--ink); background: var(--y); padding: 0 12px; border-radius: 4px; }
.result-txt { flex-basis: 100%; }

.punch h2 { max-width: 900px; }
.punch .mark { color: var(--muted); }
.punch-line { font-size: clamp(20px, 2.4vw, 26px); line-height: 1.45; font-weight: 500; max-width: 820px; margin: 0; }
.band-dark .punch-line { color: #e6e6e6; }
.verdict-top { margin-top: 8px; }

/* Fällbara delar */
details.more { border: 0; padding: 0; margin-top: 28px; }
details.more:last-of-type { border-bottom: 0; }
details.more > summary {
  display: inline-block; padding: 12px 52px 12px 18px;
  font-size: 16px; font-weight: 700;
  border: 2px solid currentColor; border-radius: 4px;
}
details.more > summary::after { top: 50%; transform: translateY(-50%); right: 16px; font-size: 24px; }
details.more > summary:hover { border-color: var(--y); }
details.more[open] > summary { margin-bottom: 32px; }
details.more > .ledger:first-of-type, details.more > .facts:first-of-type { margin-top: 0; }
details.more-small { margin-top: 10px; }
details.more-small > summary { padding: 6px 40px 6px 12px; font-size: 14px; border-width: 1.5px; }
details.more-small > summary::after { font-size: 20px; right: 12px; }
details.more-small[open] > summary { margin-bottom: 12px; }
.steps li::before { grid-row: span 3; }
.step-short { font-size: 19px; }
.sources details.more { margin-top: 8px; }
.sources details.more[open] > summary { margin-bottom: 20px; }
.hero-full h1 { font-size: clamp(44px, min(9vw, 10.5vh), 112px); }
@media (max-height: 760px) and (min-width: 721px) { .hero-full .duel { margin-top: 32px; gap: 18px; } .hero-full .lead { margin-top: 28px; } .cta-row { margin-top: 28px; } }
.fatt-nog { font-family: var(--display); font-size: clamp(36px, 6vw, 64px); line-height: 1.05; letter-spacing: -1px; margin: 48px 0 0; }
.fatt-nog::after { content: ''; display: block; width: 120px; height: 10px; background: var(--y); margin-top: 18px; }
.duel-row > .ab { grid-column: 1 / -1; }

/* Rutor för källor och förklaringar (kallor.js) */
.kalla-pop { position: absolute; z-index: 30; width: min(420px, calc(100vw - 24px)); background: var(--paper); color: var(--ink);
  border: 2px solid var(--ink); border-top: 6px solid var(--y); border-radius: 6px; padding: 16px 18px 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.25); font-size: 15px; line-height: 1.5; }
.kalla-nr { display: block; font-size: 12px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.kalla-pop > * + .kalla-nr { margin-top: 18px; padding-top: 14px; border-top: 1px solid rgba(0,0,0,0.15); }
.kalla-text { color: #333; }
.kalla-text a { color: var(--ink); }
.kalla-citat { margin: 12px 0 0; padding: 8px 0 8px 12px; border-left: 4px solid var(--y); font-style: italic; color: var(--ink); }
.kalla-ur, .kalla-sida { display: block; font-style: normal; font-size: 12px; font-weight: 700; letter-spacing: .5px; color: var(--muted); }
.kalla-ur { text-transform: uppercase; margin-bottom: 2px; }
.kalla-sida { margin-top: 4px; }
.kalla-go { display: inline-block; margin-top: 12px; font-weight: 700; text-decoration: none; border-bottom: 2px solid var(--y); }
[data-def] { cursor: help; text-decoration: underline dotted; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.fact-num [data-def] { text-decoration-color: var(--y); }
.lead .stycke { display: block; margin-top: 18px; }
.facts-mer { margin-top: 24px; }

/* Tidsplanen i steg 3 på startsidan */
.ledger-tid { margin-top: 18px; }
.ledger-tid h3 { margin-top: 0; font-size: 18px; }

/* Källa vid rubrikerna över staplarna i toppbilden */
.kalla-tag { margin-left: .4em; font-size: .8em; color: inherit; text-decoration: underline; text-underline-offset: 3px; opacity: .85; white-space: nowrap; }
.kalla-tag:hover, .kalla-tag:focus { opacity: 1; }
/* Inramat område på kalkylsidan (ram.js) */
.ram { outline: 3px solid var(--y); outline-offset: 10px; border-radius: 2px; margin: 24px 0; scroll-margin-top: 90px; }
