/* ═══════════════════════════════════════════════════════════════
   Regnly - startsiden. Designverden "Blæk & Signal".
   Mørkt operativt kontrolrum, hvidt lovpligtigt papir, én signalfarve.
   Standalone: importerer ikke styles.css, men deler dens grammatik.
   ═══════════════════════════════════════════════════════════════ */

/* ── Tokens: mørk som udgangspunkt ────────────────────────── */
:root {
  --font: "Sora", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  --font-num: "Fragment Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --bg: #0E1016;
  --surface: #151823;
  --surface-2: #1A1E2C;
  --inset: #212739;
  --ink: #F2F4FA;
  --ink-2: #A8B0C7;
  --ink-3: #8891AC;
  --line: rgba(242, 244, 250, .09);
  --line-2: rgba(242, 244, 250, .17);

  --signal: #C6F135;
  --signal-hover: #D4FA4F;
  --signal-ink: #DDF884;
  --signal-soft: rgba(198, 241, 53, .13);
  --signal-line: rgba(198, 241, 53, .32);
  --signal-fill: #C6F135;
  --signal-fill-hover: #D4FA4F;
  --on-signal: #0E1016;

  --teal: #4ADE9D;
  --teal-ink: #8DEFC4;
  --teal-soft: rgba(74, 222, 157, .13);
  --teal-line: rgba(74, 222, 157, .3);

  --amber: #F5C13D;
  --amber-soft: rgba(245, 193, 61, .13);
  --amber-line: rgba(245, 193, 61, .3);

  --rose: #FF6B8A;
  --rose-soft: rgba(255, 107, 138, .13);
  --rose-line: rgba(255, 107, 138, .3);

  /* Papiret er hvidt i begge temaer - det er verdenens signatur. */
  --paper: #FFFFFF;
  --paper-ink: #14161D;
  --paper-ink-2: #4C5165;
  --paper-ink-3: #6E7489;
  --paper-line: rgba(20, 22, 29, .10);
  --paper-line-2: rgba(20, 22, 29, .18);

  /* Diagramtokens - paletvalideret, må ikke erstattes af egne nuancer. */
  --chart-in: #2FA97A;
  --chart-out: #BA8A24;
  --chart-neutral: #8891AC;
  --chart-grid: rgba(242, 244, 250, .07);

  --chrome: rgba(21, 24, 35, .72);
  --chrome-edge: rgba(242, 244, 250, .08);
  --grid: rgba(242, 244, 250, .055);
  --glow: rgba(198, 241, 53, .08);

  --lift:
    0 2px 5px rgba(0, 0, 0, .30),
    0 16px 34px rgba(0, 0, 0, .40),
    0 44px 88px rgba(0, 0, 0, .34);

  --r-xl: 24px;
  --r-lg: 18px;
  --r-md: 13px;
  --r-sm: 9px;
  --r-xs: 6px;

  --ease: cubic-bezier(.22, .78, .2, 1);
  --t-fast: .16s;
  --t-base: .28s;

  --wrap: 1180px;
  --gut: clamp(20px, 5vw, 56px);

  color-scheme: dark;
}

/* ── Lyst tema: både efter system og efter attribut ───────── */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --bg: #EFF1EA;
    --surface: #FFFFFF;
    --surface-2: #FAFBF7;
    --inset: #E7EAE0;
    --ink: #14161D;
    --ink-2: #4C5165;
    --ink-3: #63687E;
    --line: rgba(20, 22, 29, .09);
    --line-2: rgba(20, 22, 29, .16);

    --signal: #4F7A00;
    --signal-hover: #5C8D00;
    --signal-ink: #3E6000;
    --signal-soft: #EAF4D4;
    --signal-line: rgba(79, 122, 0, .28);

    --teal: #0C8A66;
    --teal-ink: #0A7455;
    --teal-soft: #DFF3EB;
    --teal-line: rgba(12, 138, 102, .25);

    --amber: #8A5400;
    --amber-soft: #FAF0DC;
    --amber-line: rgba(138, 84, 0, .22);

    --rose: #C42B50;
    --rose-soft: #FCE7EC;
    --rose-line: rgba(196, 43, 80, .22);

    --chart-in: #0C8A66;
    --chart-out: #8A5400;
    --chart-neutral: #63687E;
    --chart-grid: rgba(20, 22, 29, .07);

    --chrome: rgba(255, 255, 255, .78);
    --chrome-edge: rgba(20, 22, 29, .07);
    --grid: rgba(20, 22, 29, .05);
    --glow: rgba(79, 122, 0, .07);

    --lift:
      0 2px 4px rgba(20, 22, 29, .07),
      0 14px 30px rgba(20, 22, 29, .10),
      0 40px 76px rgba(20, 22, 29, .12);

    color-scheme: light;
  }
}

:root[data-theme="light"] {
  --bg: #EFF1EA;
  --surface: #FFFFFF;
  --surface-2: #FAFBF7;
  --inset: #E7EAE0;
  --ink: #14161D;
  --ink-2: #4C5165;
  --ink-3: #63687E;
  --line: rgba(20, 22, 29, .09);
  --line-2: rgba(20, 22, 29, .16);

  --signal: #4F7A00;
  --signal-hover: #5C8D00;
  --signal-ink: #3E6000;
  --signal-soft: #EAF4D4;
  --signal-line: rgba(79, 122, 0, .28);

  --teal: #0C8A66;
  --teal-ink: #0A7455;
  --teal-soft: #DFF3EB;
  --teal-line: rgba(12, 138, 102, .25);

  --amber: #8A5400;
  --amber-soft: #FAF0DC;
  --amber-line: rgba(138, 84, 0, .22);

  --rose: #C42B50;
  --rose-soft: #FCE7EC;
  --rose-line: rgba(196, 43, 80, .22);

  --chart-in: #0C8A66;
  --chart-out: #8A5400;
  --chart-neutral: #63687E;
  --chart-grid: rgba(20, 22, 29, .07);

  --chrome: rgba(255, 255, 255, .78);
  --chrome-edge: rgba(20, 22, 29, .07);
  --grid: rgba(20, 22, 29, .05);
  --glow: rgba(79, 122, 0, .07);

  --lift:
    0 2px 4px rgba(20, 22, 29, .07),
    0 14px 30px rgba(20, 22, 29, .10),
    0 40px 76px rgba(20, 22, 29, .12);

  color-scheme: light;
}

/* ── Grund ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

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

body {
  margin: 0;
  min-height: 100%;
  overflow-x: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 350;
  line-height: 1.62;
  letter-spacing: -.008em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Millimeterpapir i blæk. Stillestående - grunden bevæger sig ikke. */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    repeating-linear-gradient(0deg, var(--grid) 0 1px, transparent 1px 46px),
    repeating-linear-gradient(90deg, var(--grid) 0 1px, transparent 1px 46px);
  mask-image: linear-gradient(180deg, #000 0%, #000 62%, transparent 100%);
}

h1, h2, h3, p, ul, ol, figure, table, dl { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: inherit; text-decoration: none; }

::selection { background: var(--signal-fill); color: var(--on-signal); }

:focus-visible {
  outline: 2px solid var(--signal);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

* { scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
*::-webkit-scrollbar { height: 8px; width: 8px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line-2); border-radius: 99px; }
*::-webkit-scrollbar-thumb:hover { background: var(--ink-3); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.sprite { position: absolute; }
.nowrap { white-space: nowrap; }

.skip-link {
  position: fixed; top: 10px; left: 10px; z-index: 90;
  padding: 10px 16px; border-radius: var(--r-md);
  background: var(--signal-fill); color: var(--on-signal);
  font-size: .9375rem; font-weight: 650;
  transform: translateY(-160%);
  transition: transform var(--t-base) var(--ease);
}
.skip-link:focus-visible { transform: translateY(0); }

.ic {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.ic-sm { width: 17px; height: 17px; stroke-width: 1.9; }

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gut);
}

/* ── Knapper ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 42px; padding: 0 17px; border-radius: var(--r-md);
  border: 1px solid transparent; background: none;
  font-family: inherit; font-size: .9375rem; font-weight: 620; letter-spacing: -.014em;
  cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease),
              color var(--t-fast) var(--ease), transform 110ms var(--ease);
}
.btn:active { transform: scale(.975); }
.btn .ic { width: 17px; height: 17px; }

/* Signalfarven bærer kun handlingen. */
.btn-primary { background: var(--signal-fill); color: var(--on-signal); }
.btn-primary:hover { background: var(--signal-fill-hover); }

.btn-secondary { background: var(--surface); border-color: var(--line-2); color: var(--ink); }
.btn-secondary:hover { background: var(--inset); border-color: var(--ink-3); }

.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--inset); color: var(--ink); }

.btn-lg { height: 50px; padding: 0 24px; font-size: 1rem; border-radius: var(--r-lg); }

/* ── Topbar: mørkt glas ───────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 40;
  background: var(--chrome);
  border-bottom: 1px solid var(--chrome-edge);
  backdrop-filter: blur(22px) saturate(170%);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
}
.topbar-in {
  display: flex; align-items: center; gap: clamp(14px, 3vw, 34px);
  width: 100%; max-width: var(--wrap); margin-inline: auto;
  padding: 11px var(--gut);
}

.brand { display: inline-flex; align-items: center; gap: 10px; }
.brand-mark {
  width: 32px; height: 32px; flex: none; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--signal-fill); color: var(--on-signal);
}
.brand-name { font-size: 1.0625rem; font-weight: 700; letter-spacing: -.036em; }

.topbar-nav { display: flex; gap: 4px; margin-inline-start: auto; }
.topbar-nav a {
  padding: 7px 11px; border-radius: var(--r-sm);
  font-size: .9375rem; font-weight: 450; color: var(--ink-2);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.topbar-nav a:hover { color: var(--ink); background: var(--inset); }

.topbar-actions { display: flex; align-items: center; gap: 7px; }

.theme-toggle {
  width: 38px; height: 38px; flex: none; border-radius: var(--r-sm);
  display: grid; place-items: center;
  border: 1px solid var(--line); background: none; color: var(--ink-2);
  cursor: pointer;
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.theme-toggle:hover { color: var(--ink); background: var(--inset); }
:root .icon-sun { display: none; }
:root .icon-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .icon-sun { display: block; }
  :root:not([data-theme="dark"]) .icon-moon { display: none; }
}
:root[data-theme="light"] .icon-sun { display: block; }
:root[data-theme="light"] .icon-moon { display: none; }
:root[data-theme="dark"] .icon-sun { display: none; }
:root[data-theme="dark"] .icon-moon { display: block; }

/* ── Hero ─────────────────────────────────────────────────── */
.hero { position: relative; padding-top: clamp(46px, 9vw, 96px); padding-bottom: clamp(52px, 8vw, 104px); }
.hero::before {
  content: ""; position: absolute; inset: -1px 0 auto 0; height: 148%; z-index: -1;
  background: url(/img/hero-bg.jpg) left top / cover no-repeat;
  opacity: .5; pointer-events: none;
  -webkit-mask-image: linear-gradient(180deg, #000 0%, #000 52%, transparent 96%);
  mask-image: linear-gradient(180deg, #000 0%, #000 52%, transparent 96%);
}
:root[data-theme="light"] .hero::before,
.hero::before { }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .hero::before { opacity: .16; } }
:root[data-theme="light"] .hero::before { opacity: .16; }
:root[data-theme="dark"] .hero::before { opacity: .5; }

.hero-h {
  font-size: clamp(2.15rem, 6.1vw, 4.15rem);
  font-weight: 780;
  line-height: 1.02;
  letter-spacing: -.04em;
  text-wrap: balance;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(34px, 6vw, 56px);
  margin-top: clamp(26px, 4vw, 42px);
}

.hero-sub {
  font-size: clamp(1.0625rem, 1.5vw, 1.1875rem);
  font-weight: 300;
  line-height: 1.6;
  color: var(--ink-2);
  max-width: 46ch;
  text-wrap: pretty;
}

.hero-cta { display: flex; flex-wrap: wrap; gap: 11px; margin-top: 30px; }

.hero-fine {
  margin-top: 26px;
  padding-top: 17px;
  border-top: 1px solid var(--line);
  font-size: .875rem;
  line-height: 1.55;
  color: var(--ink-3);
  max-width: 44ch;
  text-wrap: pretty;
}

/* ── Papiret: verdenens eneste løftede flade ──────────────── */
.paper-fig { display: flex; flex-direction: column; gap: 15px; }

.paper {
  --pad: clamp(20px, 4.4vw, 38px);
  position: relative;
  padding: var(--pad);
  border-radius: var(--r-lg);
  background: var(--paper);
  color: var(--paper-ink);
  box-shadow: var(--lift);
}

.sheet-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding-bottom: 11px; margin-bottom: 22px;
  border-bottom: 1px solid var(--paper-line);
  font-size: .75rem; font-weight: 450; color: var(--paper-ink-3);
}
.sheet-doc { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sheet-page { white-space: nowrap; font-family: var(--font-num); }

.paper-h { font-size: 1.1875rem; font-weight: 680; letter-spacing: -.03em; }
.paper-unit { font-size: .8125rem; color: var(--paper-ink-3); margin-top: 3px; margin-bottom: 19px; }

.paper-scroll { overflow-x: auto; }

.doc-table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.doc-table th {
  font-size: .6875rem; font-weight: 620; letter-spacing: .05em; text-transform: uppercase;
  color: var(--paper-ink-3); text-align: right;
  padding: 0 0 9px 10px; border-bottom: 1px solid var(--paper-line-2);
}
.doc-table th:first-child { text-align: left; padding-left: 0; }
.doc-table th.c-note { text-align: center; width: 42px; }
.doc-table td { padding: 7px 0; border-bottom: 1px solid var(--paper-line); }
.doc-table td:first-child { padding-right: 10px; }
.doc-table td:not(:first-child) {
  text-align: right; font-family: var(--font-num); font-weight: 400;
  font-size: .8125rem; width: 21%; white-space: nowrap; padding-left: 10px;
}
.doc-table td.c-note { text-align: center; width: 42px; color: var(--paper-ink-3); font-size: .6875rem; }
.doc-table tr:last-child td { border-bottom: 0; }
.doc-table .dr-total td { font-weight: 650; border-top: 1px solid var(--paper-line-2); border-bottom: 0; padding-top: 8px; }
.doc-table .dr-total td:not(:first-child) { font-weight: 400; }
.doc-table .dr-grand td { font-weight: 680; font-size: 1rem; border-top: 2px solid var(--paper-ink); border-bottom: 0; padding-top: 11px; }
.doc-table .dr-grand td:not(:first-child) { font-size: .9375rem; }
.doc-table .dr-neg td:not(:first-child) { color: var(--paper-ink-2); }

.paper-foot {
  display: flex; flex-wrap: wrap; gap: 4px 20px; justify-content: space-between;
  margin-top: 24px; padding-top: 13px;
  border-top: 1px solid var(--paper-line);
  font-size: .75rem; color: var(--paper-ink-3);
}

.paper-cap {
  font-size: .8125rem; line-height: 1.6; color: var(--ink-3);
  max-width: 56ch; text-wrap: pretty;
}

/* ── Sektioner ────────────────────────────────────────────── */
.sec { padding-block: clamp(58px, 9vw, 118px); }
.sec + .sec { border-top: 1px solid var(--line); }

.sec-head { max-width: 62ch; margin-bottom: clamp(34px, 5vw, 54px); }
.sec-head h2 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 700; line-height: 1.08; letter-spacing: -.04em;
  text-wrap: balance;
}
.sec-head p {
  margin-top: 15px;
  font-size: 1.0625rem; font-weight: 300; line-height: 1.62;
  color: var(--ink-2); text-wrap: pretty;
}

.sec-note {
  margin-top: clamp(30px, 4vw, 44px);
  padding-top: 22px;
  border-top: 1px solid var(--line);
  max-width: 66ch;
  font-size: .9375rem; line-height: 1.65; color: var(--ink-2);
  text-wrap: pretty;
}

/* ── Motoren: én lodret kørsel ────────────────────────────── */
.pipeline { position: relative; display: flex; flex-direction: column; }
.pipeline::before {
  content: ""; position: absolute; left: 22px; top: 34px; bottom: 34px;
  width: 2px; background: var(--inset); border-radius: 2px;
}
.pipeline::after {
  content: ""; position: absolute; left: 22px; top: 34px; bottom: 34px;
  width: 2px; border-radius: 2px;
  background: linear-gradient(180deg, var(--signal), var(--teal));
  transform: scaleY(1); transform-origin: top;
}

.pl-step {
  position: relative;
  display: grid; grid-template-columns: 46px minmax(0, 1fr);
  align-items: start; gap: 16px;
  padding: 14px 0;
}
.pl-ico {
  position: relative; z-index: 1;
  width: 46px; height: 46px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--signal-fill); border: 2px solid var(--signal-fill);
  color: var(--on-signal);
}
.pl-body { padding-top: 5px; }
.pl-body strong {
  display: block; font-size: 1.0625rem; font-weight: 640; letter-spacing: -.024em;
}
.pl-sub {
  display: block; margin-top: 4px;
  font-size: .9375rem; font-weight: 300; line-height: 1.6;
  color: var(--ink-2); max-width: 58ch; text-wrap: pretty;
}

/* ── XBRL-mappingen ───────────────────────────────────────────
   Kontoplanen til venstre løber sammen i dokumentets poster til højre.
   Stregerne tegner sig selv, mens figuren passerer - færdige uden JS. */
.map { margin-top: clamp(34px, 5vw, 56px); }

.map-h {
  font-size: 1.0625rem; font-weight: 640; letter-spacing: -.026em; color: var(--ink);
}

.map-grid {
  --map-pad: 15px;
  display: grid;
  grid-template-columns: minmax(0, .82fr) clamp(40px, 8vw, 130px) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: 0;
  min-height: clamp(250px, 30vw, 330px);
  margin-top: 18px;
}

.map-col {
  grid-row: 1;
  padding-bottom: 9px;
  font-size: .75rem; font-weight: 620; letter-spacing: -.008em; color: var(--ink-3);
}
.map-col-l { grid-column: 1; }
.map-col-r { grid-column: 3; padding-inline-start: var(--map-pad); }

.map-accounts {
  grid-column: 1; grid-row: 2;
  display: grid; grid-template-rows: repeat(6, minmax(0, 1fr));
  padding-block: var(--map-pad);
  border-top: 1px solid var(--chart-grid);
  border-bottom: 1px solid var(--chart-grid);
}
.map-accounts li {
  display: flex; align-items: center; gap: 9px; min-width: 0;
  font-size: .8125rem; color: var(--ink-2);
}
.map-accounts .num {
  font-family: var(--font-num); font-weight: 400; font-size: .75rem;
  color: var(--ink-3); flex: none;
}
.map-n { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Hårfin leder frem til stregen, så kontoen møder sit felt. */
.map-accounts li::after {
  content: ""; flex: 1 1 6px; min-width: 6px; height: 1px;
  background: var(--chart-grid);
}

.map-links { grid-column: 2; grid-row: 2; padding-block: var(--map-pad); }
.map-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.map-svg path {
  fill: none;
  stroke: var(--ink-3);
  stroke-width: 1.7;
  stroke-linecap: round;
  opacity: .55;
  vector-effect: non-scaling-stroke;
}

.map-sheet {
  grid-column: 3; grid-row: 2;
  display: flex;
  padding: var(--map-pad) calc(var(--map-pad) + 3px);
  border-radius: var(--r-md);
  background: var(--paper); color: var(--paper-ink);
  box-shadow: var(--lift);
}
.map-fields {
  flex: 1; min-width: 0;
  display: grid; grid-template-rows: repeat(4, minmax(0, 1fr));
}
.map-fields li {
  display: flex; align-items: center;
  min-width: 0;
  font-size: .8125rem; font-weight: 550; letter-spacing: -.014em;
  color: var(--paper-ink); line-height: 1.25;
  hyphens: auto;
}

.map-cap {
  margin-top: 16px;
  font-size: .8125rem; line-height: 1.6; color: var(--ink-3);
  max-width: 68ch; text-wrap: pretty;
}

/* ── Balancen, der stemmer ────────────────────────────────────
   To tynde stablede søjler af de samme demotal som arket øverst. */
.bal { --bar: clamp(26px, 3.4vw, 40px); max-width: 840px; }

.bal-heads, .bal-cols {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(16px, 3vw, 44px);
}
.bal-col-h {
  font-size: .9375rem; font-weight: 640; letter-spacing: -.022em; color: var(--ink);
  margin-bottom: 10px;
}

/* Den ene akse: hårlinjen ligger i balancesummen, nullinjen under søjlerne. */
.bal-axis {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--chart-grid);
  font-size: .8125rem;
}
.bal-axis-lbl { font-weight: 620; letter-spacing: -.016em; color: var(--ink-2); }
.bal-axis-val { color: var(--ink); }
.bal-axis-val .num { font-family: var(--font-num); font-weight: 400; }

.bal-cols { padding-top: 0; }

.bal-stack {
  display: flex; flex-direction: column; gap: 2px; min-width: 0;
  height: clamp(230px, 27vw, 310px);
}
.bal-seg {
  display: flex; align-items: center; gap: 11px;
  min-height: 0; min-width: 0;
  flex-basis: 0;
}
.bal-mark {
  flex: none; align-self: stretch;
  width: var(--bar);
  border-radius: 0;
  background: var(--chart-neutral);
  transition: filter var(--t-fast) var(--ease);
}
/* Rundede dataender kun væk fra baslinjen - toppen af stablen. */
.bal-seg:first-child .bal-mark { border-start-start-radius: 4px; border-start-end-radius: 4px; }
.bal-seg:hover .bal-mark { filter: brightness(1.14); }

.sg-neutral .bal-mark { background: var(--chart-neutral); }
.sg-in .bal-mark { background: var(--chart-in); }
.sg-out .bal-mark { background: var(--chart-out); }

.bal-lab { min-width: 0; }
.bal-lab-n {
  display: block;
  font-size: .8125rem; font-weight: 550; letter-spacing: -.016em; line-height: 1.25;
  color: var(--ink);
}
.bal-lab-v {
  display: block; margin-top: 2px;
  font-size: .8125rem; color: var(--ink-2);
}
.bal-lab-v .num { font-family: var(--font-num); font-weight: 400; }

.bal-base {
  margin-top: 0; padding-top: 7px;
  border-top: 1px solid var(--chart-grid);
  font-size: .75rem; color: var(--ink-3);
}
.bal-base .num { font-family: var(--font-num); font-weight: 400; }

.bal-legend {
  display: flex; flex-wrap: wrap; gap: 8px 22px;
  margin-top: 20px;
  font-size: .8125rem; color: var(--ink-2);
}
.bal-legend li { display: flex; align-items: center; gap: 8px; }
.bal-key { width: 12px; height: 12px; border-radius: 3px; flex: none; background: var(--chart-neutral); }
.bal-legend .sg-in { background: var(--chart-in); }
.bal-legend .sg-out { background: var(--chart-out); }

.bal-cap {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: .8125rem; line-height: 1.6; color: var(--ink-3);
  max-width: 74ch; text-wrap: pretty;
}
.bal-cap .num { font-family: var(--font-num); font-weight: 400; color: var(--ink-2); }

/* ── Loven, oversat ───────────────────────────────────────── */
.law-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 15px;
}

.law-card {
  padding: clamp(22px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
}
.law-card h3 {
  font-size: 1.0625rem; font-weight: 660; letter-spacing: -.026em;
  color: var(--ink);
}
.law-card > p,
.law-opt-say > p {
  margin-top: 12px;
  font-size: .9375rem; font-weight: 300; line-height: 1.62;
  color: var(--ink-2); max-width: 54ch; text-wrap: pretty;
}

.law-ref {
  display: inline-block;
  margin-top: 20px;
  padding: 3px 9px;
  border-radius: var(--r-xs);
  background: var(--inset);
  border: 1px solid var(--line);
  font-size: .75rem; font-weight: 620; letter-spacing: -.004em;
  color: var(--ink-2);
}

.law-fine { margin-top: 11px; font-size: .8125rem; color: var(--ink-3); }

/* ── Fristen som en strækning ─────────────────────────────────
   Tolv måneders regnskabsår, derefter seks måneder til indberetning.
   Markøren står i mål, når siden ligger stille. */
.run {
  --year: 66.667%;
  margin-top: clamp(26px, 3.6vw, 40px);
}

.run-tops { display: flex; margin-bottom: 11px; }
.run-top {
  flex: 0 0 var(--year);
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px;
  min-width: 0;
  padding-inline-end: 10px;
  font-size: .8125rem;
}
.run-top-frist { flex: 1 1 0; padding-inline-end: 0; }
.run-top-n { font-weight: 620; letter-spacing: -.018em; color: var(--ink); }
.run-top-d { font-size: .75rem; color: var(--ink-3); }

.run-track { position: relative; height: 22px; }
.run-zone {
  position: absolute; inset-block: 0; left: var(--year); right: 0;
  border-radius: var(--r-xs);
  background: var(--signal-soft);
}
.run-rail, .run-fill {
  position: absolute; left: 0; right: 0; top: 50%;
  height: 3px; margin-top: -1.5px; border-radius: 3px;
}
.run-rail { background: var(--line-2); }
.run-fill {
  background: var(--signal);
  transform: scaleX(1); transform-origin: left center;
}

.run-tick {
  position: absolute; top: 0; bottom: 0; width: 1px;
  background: var(--line-2);
}
.run-tick-a { left: 0; }
.run-tick-b { left: var(--year); }
.run-tick-c { left: calc(100% - 1px); background: var(--signal-line); }

.run-marker {
  position: absolute; top: 50%; left: 100%;
  width: 15px; height: 15px; margin: -7.5px 0 0 -7.5px;
  border-radius: 50%;
  background: var(--signal-fill);
  box-shadow: 0 0 0 4px var(--signal-soft);
}

.run-dates { position: relative; margin-top: 12px; min-height: 78px; }
.run-d { position: absolute; top: 0; display: block; }
.run-d-a { left: 0; width: 30%; text-align: left; }
.run-d-b { left: var(--year); width: 20%; text-align: center; transform: translateX(-50%); }
.run-d-c { left: 100%; width: 21%; text-align: right; transform: translateX(-100%); }

.run-d-num {
  display: block;
  font-size: clamp(1.35rem, 2.9vw, 2.5rem);
  font-weight: 300; line-height: 1; letter-spacing: -.05em;
  color: var(--ink);
}
.run-d-num .num { font-family: var(--font-num); font-weight: 400; letter-spacing: -.05em; }
.run-d-mon {
  display: block; margin-top: 4px;
  font-size: .75rem; font-weight: 450; line-height: 1.35; color: var(--ink-2);
}
.run-d-mon .num { font-family: var(--font-num); font-weight: 400; }
.run-d-cap {
  display: block; margin-top: 3px;
  font-size: .6875rem; line-height: 1.3; color: var(--ink-3);
}
.run-d-c .run-d-num { color: var(--signal-ink); }
.run-d-c .run-d-cap { color: var(--ink-2); }

/* ── Regnskabsklasserne som skala ─────────────────────────────
   En tabel, tegnet som en skala: zonerne er lige brede, tallene er lovens. */
.law-scroll { overflow-x: auto; margin-top: 22px; }

.law-scale { width: 100%; border-collapse: collapse; table-layout: fixed; }
.law-scale th, .law-scale td { padding: 0; }
.law-scale thead th {
  font-size: .75rem; font-weight: 620; letter-spacing: -.008em;
  color: var(--ink-2); text-align: center;
  padding-bottom: 9px; white-space: nowrap;
}
.law-scale thead th:first-child { width: 27%; min-width: 96px; }
.law-scale tbody th {
  width: 27%;
  font-size: .8125rem; font-weight: 620; letter-spacing: -.016em;
  color: var(--ink); text-align: left;
  padding: 12px 12px 12px 0; vertical-align: middle;
}
.sc-u {
  display: block; margin-top: 1px;
  font-size: .6875rem; font-weight: 400; letter-spacing: 0; color: var(--ink-3);
}
.law-scale tbody tr + tr th, .law-scale tbody tr + tr td {
  border-top: 1px solid var(--chart-grid);
}
.law-scale tbody td { padding: 12px 2px 12px 0; vertical-align: middle; }
.law-scale tbody td:last-child { padding-right: 0; }

/* Tynde marks, 2px yt-gap mellem zonerne, runde ender kun yderst. */
.sc-bar { display: block; height: 9px; border-radius: 0; }
.law-scale tbody td:first-of-type .sc-bar { border-start-start-radius: 4px; border-end-start-radius: 4px; }
.law-scale tbody td:last-child .sc-bar { border-start-end-radius: 4px; border-end-end-radius: 4px; }
.sc-a { background: var(--chart-in); }
.sc-b { background: var(--chart-neutral); }
.sc-c { background: var(--chart-out); }

.sc-v {
  display: block; margin-top: 7px;
  text-align: right; padding-inline-end: 2px;
  font-size: .8125rem; color: var(--ink-2);
}
.law-scale tbody td:last-child .sc-v { padding-inline-end: 0; }
.sc-v .num { font-family: var(--font-num); font-weight: 400; }

/* ── Fravalg af revision ──────────────────────────────────── */
.law-thresholds { margin-top: 20px; display: flex; flex-direction: column; }
.law-thresholds li {
  display: flex; align-items: baseline; gap: 14px;
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.law-thresholds li:last-child { border-bottom: 0; }
.law-thresholds .num {
  font-family: var(--font-num); font-weight: 400;
  font-size: 2.05rem; line-height: 1; letter-spacing: -.04em;
  color: var(--signal-ink);
  min-width: 2.1ch; text-align: right;
}
.law-thresholds .lbl { font-size: .9375rem; font-weight: 300; color: var(--ink-2); }

/* ── Åbenhed ──────────────────────────────────────────────── */
/* Tegnet ornament i samme 1.7-streg som ikonerne. */
.sec-head-mark { position: relative; }
.seal {
  display: block;
  width: clamp(46px, 6vw, 58px); height: auto;
  margin-bottom: 16px;
  fill: none; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
  overflow: visible;
}
.seal-sheet { stroke: var(--ink-3); }
.seal-ring { stroke: var(--signal-line); }
.seal-check { stroke: var(--signal); stroke-width: 2.4; }

.honest { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.honest li {
  display: grid; grid-template-columns: 38px minmax(0, 1fr);
  gap: 15px; align-items: start;
  padding: 21px 0;
  border-top: 1px solid var(--line);
}
.honest li:last-child { border-bottom: 1px solid var(--line); }
.hn-ico {
  width: 38px; height: 38px; border-radius: var(--r-sm);
  display: grid; place-items: center;
  background: var(--inset); color: var(--ink-2);
}
.honest strong {
  display: block; font-size: 1rem; font-weight: 640; letter-spacing: -.024em;
}
.honest p {
  margin-top: 5px;
  font-size: .9375rem; font-weight: 300; line-height: 1.62;
  color: var(--ink-2); max-width: 68ch; text-wrap: pretty;
}
.hn-flag .hn-ico { background: var(--signal-soft); color: var(--signal-ink); border: 1px solid var(--signal-line); }

/* ── Kom i gang ───────────────────────────────────────────── */
.start-box {
  padding: clamp(30px, 5.5vw, 62px);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  background: var(--surface);
}
.start-box h2 {
  font-size: clamp(1.65rem, 3.4vw, 2.35rem);
  font-weight: 720; line-height: 1.08; letter-spacing: -.04em;
  text-wrap: balance;
}
.start-box > p {
  margin-top: 16px;
  font-size: 1.0625rem; font-weight: 300; line-height: 1.62;
  color: var(--ink-2); max-width: 62ch; text-wrap: pretty;
}
.start-fine {
  margin-top: 24px;
  font-size: .875rem; color: var(--ink-3); max-width: 58ch; text-wrap: pretty;
}

/* ── Sidefod ──────────────────────────────────────────────── */
.foot { border-top: 1px solid var(--line); padding-block: 34px 46px; }
.foot-in {
  display: flex; flex-wrap: wrap; align-items: center; gap: 14px 26px;
}
.foot-nav { display: flex; gap: 20px; }
.foot-nav a {
  font-size: .9375rem; color: var(--ink-2);
  text-decoration: underline; text-decoration-color: var(--line-2);
  text-underline-offset: 4px;
  transition: color var(--t-fast) var(--ease), text-decoration-color var(--t-fast) var(--ease);
}
.foot-nav a:hover { color: var(--ink); text-decoration-color: var(--ink-3); }
.foot-note {
  flex: 1 1 100%;
  font-size: .8125rem; color: var(--ink-3);
}

/* ── Breakpoints ──────────────────────────────────────────── */
/* Smalle skærme: opstillingen skal rummes uden vandret rul,
   og begge årstal skal blive stående - sammenligningstallet er pointen. */
/* Smalt: mappingen og strækningen skal stadig kunne læses. */
@media (max-width: 620px) {
  .map-grid {
    --map-pad: 11px; min-height: 260px;
    grid-template-columns: minmax(0, .95fr) 40px minmax(0, 1fr);
  }
  .map-accounts li { gap: 7px; font-size: .75rem; }
  .map-accounts .num { font-size: .6875rem; }
  .map-accounts li::after { flex-basis: 4px; min-width: 4px; }
  .map-fields li { font-size: .75rem; }
  .map-col { font-size: .6875rem; }

  .run-dates { min-height: 92px; }
  .run-d-mon, .run-d-cap { font-size: .625rem; }

  .bal-legend { gap: 7px 16px; font-size: .75rem; }
}

@media (max-width: 480px) {
  .paper { --pad: 18px; }
  .doc-table { table-layout: fixed; font-size: .875rem; }
  .doc-table .c-note { display: none; }
  .doc-table th { padding-left: 6px; font-size: .625rem; letter-spacing: .04em; }
  .doc-table th:not(:first-child) { width: 29%; }
  .doc-table td:first-child { padding-right: 8px; font-size: .75rem; hyphens: auto; }
  .doc-table td:not(:first-child) { width: 29%; font-size: .75rem; padding-left: 6px; }
  .sheet-head { font-size: .6875rem; }
  .sheet-doc { white-space: normal; overflow: visible; text-overflow: clip; }
  .doc-table .dr-grand td:not(:first-child) { font-size: .8125rem; }

  .law-scale tbody th { padding-right: 9px; font-size: .75rem; }
  .law-scale thead th { font-size: .6875rem; }
  .law-scale thead th:first-child, .law-scale tbody th { width: 30%; min-width: 84px; }
  .sc-v { font-size: .75rem; }
}

/* Under 400px: hvert punkt tæller, hvis begge opstillinger skal rummes. */
@media (max-width: 400px) {
  .paper { --pad: 15px; }
  .doc-table td:not(:first-child) { padding-left: 4px; }
  .law-card { padding: 21px 17px; }
  .law-scale tbody th { padding-right: 7px; }
}

@media (max-width: 899px) {
  .topbar-nav { display: none; }
  .btn-sm-hide { display: none; }
  .topbar-actions { margin-inline-start: auto; }
}

@media (min-width: 720px) {
  .law-grid { gap: 16px; }

  /* Fristen: overskrift og forklaring side om side over strækningen. */
  .law-deadline { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 44px; align-items: baseline; }
  .law-deadline h3 { grid-column: 1; grid-row: 1; }
  .law-deadline > p:not(.law-ref) { grid-column: 2; grid-row: 1; margin-top: 0; }
  .law-deadline .run { grid-column: 1 / -1; grid-row: 2; }
  .law-deadline .law-ref { grid-column: 1 / -1; grid-row: 3; justify-self: start; }

  /* Fravalget: teksten til venstre, de tre grænser til højre. */
  .law-opt { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 6px 44px; align-items: start; }
  .law-opt .law-thresholds { margin-top: 0; }
}

@media (min-width: 900px) {
  .honest { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 44px; }
  .honest li { padding: 22px 0; }
  .honest li:nth-last-child(-n+2) { border-bottom: 1px solid var(--line); }
}

@media (min-width: 1000px) {
  .hero-grid {
    grid-template-columns: minmax(0, 0.86fr) minmax(0, 1.14fr);
    align-items: start;
    gap: clamp(40px, 5vw, 72px);
  }
  .hero-say { padding-top: 6px; }

  /* Motoren: overskriften bliver stående, mens kørslen løber forbi. */
  #motoren .wrap {
    display: grid;
    grid-template-columns: minmax(0, .78fr) minmax(0, 1fr);
    column-gap: clamp(44px, 6vw, 92px);
    align-items: start;
  }
  #motoren .sec-head { grid-column: 1; grid-row: 1; margin-bottom: 0; position: sticky; top: 96px; }
  #motoren .pipeline { grid-column: 2; grid-row: 1; }
  #motoren .sec-note { grid-column: 2; grid-row: 2; max-width: none; }
  #motoren .map { grid-column: 1 / -1; grid-row: 3; }
}

/* ── Rørelse: scroll-drevet, ellers stille ────────────────── */
@property --sweep {
  syntax: "<percentage>";
  initial-value: 100%;
  inherits: false;
}

@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {

    /* Arket monterer sig: masken løber ned over papiret, mens det stiger. */
    .paper {
      mask-image: linear-gradient(180deg, #000 var(--sweep), rgba(0, 0, 0, 0) calc(var(--sweep) + 14%));
      -webkit-mask-image: linear-gradient(180deg, #000 var(--sweep), rgba(0, 0, 0, 0) calc(var(--sweep) + 14%));
      animation: sheet-build linear both;
      animation-timeline: view();
      animation-range: entry 0% entry 88%;
    }
    @keyframes sheet-build {
      from { --sweep: 0%; transform: translateY(26px) scale(.985); }
      to   { --sweep: 100%; transform: translateY(0) scale(1); }
    }

    /* Rækkerne lander efter tur, mens arket passerer. */
    .doc-table tbody tr {
      animation: row-land linear both;
      animation-timeline: view(block);
      animation-range: entry 12% entry 74%;
    }
    @keyframes row-land {
      from { opacity: 0; transform: translateY(9px); }
      35%  { opacity: 1; transform: translateY(0); }
      to   { opacity: 1; transform: translateY(0); }
    }

    /* Kørslen tegner sig ned gennem trinnene. */
    .pipeline::after {
      animation: run-fill linear both;
      animation-timeline: view();
      animation-range: entry 34% cover 62%;
    }
    @keyframes run-fill {
      from { transform: scaleY(0); }
      to   { transform: scaleY(1); }
    }

    /* Hvert trin tænder, når det passerer. */
    .pl-ico {
      animation: step-live linear both;
      animation-timeline: view(block);
      animation-range: entry 70% contain 8%;
    }
    @keyframes step-live {
      from { background: transparent; border-color: var(--inset); color: var(--ink-3); }
      to   { background: var(--signal-fill); border-color: var(--signal-fill); color: var(--on-signal); }
    }

    /* Stregerne mellem kontoplan og dokument tegner sig selv. */
    .map-svg path {
      stroke-dasharray: 260;
      stroke-dashoffset: 260;
      animation: map-draw linear both;
      animation-timeline: view();
      animation-range: entry 34% cover 52%;
    }
    @keyframes map-draw { to { stroke-dashoffset: 0; } }
    .map-svg path:nth-child(2) { animation-range: entry 38% cover 55%; }
    .map-svg path:nth-child(3) { animation-range: entry 42% cover 58%; }
    .map-svg path:nth-child(4) { animation-range: entry 46% cover 61%; }
    .map-svg path:nth-child(5) { animation-range: entry 50% cover 64%; }
    .map-svg path:nth-child(6) { animation-range: entry 54% cover 67%; }

    /* Balancen fyldes nedefra, og etiketterne lander bagefter. */
    .bal-mark {
      transform-origin: bottom center;
      animation: bal-fill linear both;
      animation-timeline: view(block);
      animation-range: entry 34% cover 42%;
    }
    @keyframes bal-fill {
      from { transform: scaleY(0); }
      to   { transform: scaleY(1); }
    }
    .bal-lab {
      animation: bal-lab-in linear both;
      animation-timeline: view(block);
      animation-range: entry 46% cover 46%;
    }
    @keyframes bal-lab-in {
      from { opacity: 0; transform: translateY(6px); }
      to   { opacity: 1; transform: translateY(0); }
    }

    /* Zonerne lægges ud fra venstre, én klasse ad gangen. */
    .sc-bar {
      transform-origin: left center;
      animation: sc-lay linear both;
      animation-timeline: view(block);
      animation-range: entry 34% cover 34%;
    }
    @keyframes sc-lay {
      from { transform: scaleX(0); }
      to   { transform: scaleX(1); }
    }
    .law-scale tbody td:nth-of-type(2) .sc-bar { animation-range: entry 42% cover 40%; }
    .law-scale tbody td:nth-of-type(3) .sc-bar { animation-range: entry 50% cover 46%; }

    /* Markøren løber strækningen igennem og standser på fristen. */
    .run-fill {
      animation: run-travel-fill linear both;
      animation-timeline: view(block);
      animation-range: entry 34% cover 62%;
    }
    @keyframes run-travel-fill {
      from { transform: scaleX(0); }
      to   { transform: scaleX(1); }
    }
    .run-marker {
      animation: run-travel linear both;
      animation-timeline: view(block);
      animation-range: entry 34% cover 62%;
    }
    @keyframes run-travel {
      from { left: 0%; }
      to   { left: 100%; }
    }
    /* Kun opacitet - datoerne er placeret med transform. */
    .run-d {
      animation: run-d-in linear both;
      animation-timeline: view(block);
      animation-range: entry 40% cover 44%;
    }
    @keyframes run-d-in {
      from { opacity: .1; }
      to   { opacity: 1; }
    }

    .law-thresholds .num {
      animation: fig-rise linear both;
      animation-timeline: view(block);
      animation-range: entry 30% entry 96%;
    }
    @keyframes fig-rise {
      from { opacity: .12; transform: translateY(7px); }
      to   { opacity: 1; transform: translateY(0); }
    }
  }
}

/* ── Alfa 1: ordreveals + Lenis ───────────────────────────────
   Rubrikord maskas och glider upp; bara transform/opacity.
   Utan JS syns hel text (ingen .w = ingen dold text). */
.hero-h .w, main h2 .w {
  display: inline-block; overflow: clip; vertical-align: top;
  overflow-clip-margin: 0.3em;
  padding-top: 0.12em; margin-top: -0.12em;
}
.hero-h .wi, main h2 .wi {
  display: inline-block;
  transform: translateY(115%);
  transition: transform .72s cubic-bezier(.22,.78,.2,1);
  will-change: transform;
}
.hero-h.w-in .wi, main h2.w-in .wi { transform: none; }
@media (prefers-reduced-motion: reduce) {
  .hero-h .wi, main h2 .wi { transform: none; transition: none; }
}

/* Lenis: native scroll under den mjuka - scroll-timelines fungerar vidare */
html.lenis, html.lenis body { height: auto; }
.lenis.lenis-smooth { scroll-behavior: auto !important; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-stopped { overflow: clip; }
.lenis.lenis-smooth iframe { pointer-events: none; }

/* Hero-motorbånd - appens pipeline i miniature, drevet af én signal-glød */
.hero-flow {
  display: flex; flex-wrap: wrap; gap: 8px 6px; list-style: none; margin: 26px 0 0; padding: 0;
  max-width: 30rem;
}
.hero-flow li {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: .8125rem; font-weight: 500; color: var(--ink-2);
  padding: 6px 11px 6px 8px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--surface-2);
}
.hero-flow .hf-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--ink-3); flex: none;
}
@media (prefers-reduced-motion: no-preference) {
  .hero-flow .hf-dot { animation: hf-pulse 4.5s var(--ease, ease) infinite; animation-delay: calc(var(--i) * .9s); }
  @keyframes hf-pulse {
    0%, 82%, 100% { background: var(--ink-3); box-shadow: none; }
    8%, 20% { background: var(--signal-fill); box-shadow: 0 0 0 3px var(--signal-soft); }
  }
}
@media (max-width: 720px) { .hero-flow { gap: 6px; } .hero-flow li { font-size: .75rem; padding: 5px 9px 5px 7px; } }
