@font-face { font-family: 'Montserrat'; font-weight: 500; font-display: swap; src: url('/fonts/montserrat/montserrat-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 600; font-display: swap; src: url('/fonts/montserrat/montserrat-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-weight: 700; font-display: swap; src: url('/fonts/montserrat/montserrat-latin-700-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 400; font-display: swap; src: url('/fonts/source-sans-3/source-sans-3-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Sans 3'; font-weight: 600; font-display: swap; src: url('/fonts/source-sans-3/source-sans-3-latin-600-normal.woff2') format('woff2'); }

:root {
  color-scheme: light dark;
  --bg: #F7F9F8;
  --surface: #FFFFFF;
  --fg: #142019;
  --muted: #5D6B66;
  --line: #DCE4E0;
  --accent: #2E8A68;
  --mint: #5DC19B;
  --slate: #8E9DB8;
  --on-step: #0E1513;
  --t-foer: #C98A1B;
  --t-forloeb: #2E8A68;
  --t-efter: #6A7C9C;
  --t-uaf: #9AA5A1;
  --head: 'Montserrat', system-ui, sans-serif;
  --body: 'Source Sans 3', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0F1513;
    --surface: #17201D;
    --fg: #E4ECE9;
    --muted: #95A49F;
    --line: #2B3733;
    --accent: #6FD3AC;
    --t-foer: #E2A84A;
    --t-forloeb: #5DC19B;
    --t-efter: #93A6C6;
    --t-uaf: #7C8985;
  }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 1rem/1.5 var(--body);
}

.top, main { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.top { padding-top: 32px; padding-bottom: 8px; }
main { padding-bottom: 64px; }

h1, h2, h3, h4 { font-family: var(--head); font-weight: 700; line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: clamp(1.5rem, 4vw, 2.1rem); }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.1rem; }
h3.inline { display: inline; }

a { color: var(--accent); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

.accent { color: var(--accent); }
.muted { color: var(--muted); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.eyebrow {
  font: 700 .7rem/1.3 var(--head);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 .4em;
}

.pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.pill {
  font: 600 .85rem/1 var(--head);
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  text-decoration: none;
}
.pill[aria-current='page'] { background: var(--accent); border-color: var(--accent); color: var(--surface); }

.intro { margin: 16px 0; max-width: 70ch; }

.stats, .legend { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 12px; }
.stats li { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; color: var(--muted); }
.stats strong { font: 700 1.3rem/1 var(--head); color: var(--fg); font-variant-numeric: tabular-nums; margin-right: 4px; }
.legend { gap: 16px; font-size: .9rem; color: var(--muted); }

.t-foer { --t: var(--t-foer); }
.t-forloeb { --t: var(--t-forloeb); }
.t-efter { --t: var(--t-efter); }
.t-uafklaret { --t: var(--t-uaf); }
.dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--t); flex: none; }

/* Overblikkets gitter */
.grid-scroll { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 16px; }
.grid { display: grid; grid-template-columns: 118px repeat(6, minmax(128px, 1fr)); gap: 8px 10px; min-width: 900px; }
.g-label { grid-column: 1; font: 700 .7rem/1.3 var(--head); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); padding-top: 6px; }
.g-divider { grid-column: 1 / -1; border-top: 1px solid var(--line); margin: 6px 0; }
.cell { margin: 0; font-size: .88rem; }

.step, .badge-step, .step-link { background: color-mix(in oklab, var(--mint) var(--p), var(--slate)); color: var(--on-step); }
.step {
  align-self: end;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 10px;
  border-radius: 8px 8px 2px 2px;
  text-decoration: none;
}
.step:hover .step-name { text-decoration: underline; }
.step-n { font: 700 1.4rem/1 var(--head); font-variant-numeric: tabular-nums; }
.step-name { font: 600 .82rem/1.2 var(--head); margin-top: 4px; }

.evidence .eyebrow { display: inline; }
.evidence.caveat { border-left: 3px solid var(--t-foer); padding-left: 8px; }

.chips { display: flex; flex-direction: column; gap: 6px; }
.chip {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 6px; align-items: baseline;
  padding: 6px 8px;
  border-radius: 8px;
  background: color-mix(in oklab, var(--t) 16%, var(--surface));
  color: var(--fg);
  text-decoration: none;
  font-size: .82rem; line-height: 1.3;
}
.chip-meta { grid-column: 2; font-size: .72rem; color: var(--muted); }

.components { padding-left: 1.1em; }

.bar {
  display: flex; justify-content: space-between; gap: 8px; align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: color-mix(in oklab, var(--accent) 18%, var(--surface));
  border: 1px solid color-mix(in oklab, var(--accent) 40%, var(--surface));
  font-size: .82rem;
}
.bar-title { font-weight: 600; }
.bar-meta { color: var(--muted); font-size: .75rem; }

.lane { display: grid; gap: 2px; padding: 2px 0; font-size: .82rem; }
.track { display: flex; align-items: center; padding: 0 calc(50% / var(--span, 1) - 6px); }
.lane.reverse .track { flex-direction: row-reverse; }
.lane-line { flex: 1; height: 2px; background: var(--accent); }
.mark { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--accent); flex: none; }
.mark.target { background: var(--accent); }
.lane-name { white-space: nowrap; }

/* Plateausiden */
.steps-nav { display: flex; gap: 6px; margin: 16px 0; }
.step-link { font: 700 .95rem/1 var(--head); padding: 9px 13px; border-radius: 8px; text-decoration: none; }
.step-link[aria-current='page'] { outline: 2px solid var(--fg); outline-offset: 2px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px; margin: 0 0 16px; }
.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.card-head h2 { margin: 0; }
.badge-step { font: 700 1.1rem/1 var(--head); padding: 8px 12px; border-radius: 8px; }
.saved { margin-left: auto; color: var(--accent); font-weight: 600; }

.fields { display: grid; gap: 12px; }
label { display: grid; gap: 4px; font: 600 .85rem/1.3 var(--head); }
input, textarea, select {
  font: 400 1rem/1.4 var(--body);
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 10px;
  width: 100%;
}
textarea { resize: vertical; }

.btn {
  font: 600 .85rem/1 var(--head);
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--surface);
  cursor: pointer;
}
.btn-quiet { background: transparent; color: var(--accent); }
.btn-danger { background: var(--t-foer); border-color: var(--t-foer); color: var(--on-step); }
summary.btn { list-style: none; display: inline-block; }
summary.btn::-webkit-details-marker { display: none; }

.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.decisions { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 10px; }
.decision {
  border: 1px solid var(--line);
  border-left: 4px solid var(--t);
  border-radius: 8px;
  padding: 10px;
  scroll-margin-top: 16px;
}
.decision:target { box-shadow: 0 0 0 2px var(--accent); }
.decision form { display: grid; gap: 8px; }
.decision-fields { display: grid; gap: 8px; }
.decision-fields label { font-size: .75rem; color: var(--muted); }
.decision-actions { display: flex; gap: 8px; align-items: center; margin-top: 8px; flex-wrap: wrap; }
.confirm[open] summary, .reply[open] > summary { display: none; }
.new-decision form { display: grid; gap: 8px; margin-top: 8px; }

.research-group { margin-top: 16px; }
.research { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.research li { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.research li.caveat { border-color: var(--t-foer); background: color-mix(in oklab, var(--t-foer) 8%, var(--surface)); }
.research p { margin: 0; }
.research .source { font-size: .85rem; color: var(--muted); margin-top: 4px; overflow-wrap: anywhere; }
.research li { scroll-margin-top: 16px; }
.research li:target { box-shadow: 0 0 0 2px var(--accent); }
.edit[open] { flex-basis: 100%; }
.edit[open] > summary { display: none; }
.edit form, .new-research form { margin-top: 8px; }
.new-research { margin-top: 16px; }
.checks { display: flex; flex-wrap: wrap; gap: 8px 20px; }
label.check { display: flex; align-items: center; gap: 8px; font-weight: 400; font-family: var(--body); font-size: .95rem; }
label.check input { width: auto; margin: 0; accent-color: var(--accent); }
.badge { font: 700 .65rem/1 var(--head); letter-spacing: .08em; text-transform: uppercase; padding: 3px 6px; border-radius: 999px; background: color-mix(in oklab, var(--accent) 18%, var(--surface)); color: var(--accent); margin-right: 6px; vertical-align: 1px; }
.badge-caveat { background: color-mix(in oklab, var(--t-foer) 20%, var(--surface)); color: var(--t-foer); }
details > summary { cursor: pointer; }

.prevnext { display: flex; justify-content: space-between; gap: 16px; font-family: var(--head); font-weight: 600; }

/* Login, adgang og ændringslog */
.whoami { float: right; display: flex; align-items: center; gap: 8px; font-size: .85rem; }
.narrow { max-width: 520px; }
.small { font-size: .85rem; }
.notice { color: var(--t-foer); font-weight: 600; }
.saved-line { color: var(--accent); font-weight: 600; }
.invite { display: flex; flex-wrap: wrap; gap: 8px; align-items: end; }
.invite label { flex: 1 1 240px; }
.rows { list-style: none; padding: 0; margin: 0; display: grid; gap: 0; }
.rows > li { border-top: 1px solid var(--line); padding: 10px 0; }
.rows > li:first-child { border-top: 0; }
.rows p { margin: 0; overflow-wrap: anywhere; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.row-meta { font-size: .85rem; color: var(--muted); }
@media (max-width: 600px) { .whoami { float: none; justify-content: flex-end; } }

/* Kommentarer */
.comments { margin-top: 10px; }
.comments[open] > summary { margin-bottom: 6px; }
.threads, .replies { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.replies { margin: 8px 0 0 14px; padding-left: 12px; border-left: 2px solid var(--line); }
.comment { scroll-margin-top: 16px; }
.comment:target { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }
.comment p { margin: 0; }
.comment-text { white-space: pre-line; overflow-wrap: anywhere; margin-top: 2px; }
.comment-form { display: grid; gap: 8px; }
.reply .comment-form { margin-top: 6px; }
.step-comments { font: 600 .72rem/1.2 var(--head); margin-top: 6px; opacity: .85; }

/* Beslutninger, moduler og eksempelkunder */
.legend .count { color: var(--fg); font-variant-numeric: tabular-nums; }
.card .legend { margin-bottom: 14px; }
.decisions.wide { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.card-head h3 { margin: 0; }
.card-head > .muted { margin-left: auto; font-size: .9rem; }

.status-pill { display: inline-block; font: 600 .85rem/1 var(--head); padding: 9px 14px; border-radius: 999px; margin: 0 0 16px; }
.status-pill.ok { background: color-mix(in oklab, var(--accent) 18%, var(--surface)); color: var(--accent); }
.status-pill.missing { background: color-mix(in oklab, var(--t-foer) 20%, var(--surface)); color: var(--t-foer); }

.item { scroll-margin-top: 16px; }
.item:target { box-shadow: 0 0 0 2px var(--accent); }
.items > li { padding: 14px 0; }
.items p { margin: 4px 0 0; }
.item-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.item-head h3 { margin: 0; }
.span-pill { font: 600 .75rem/1 var(--head); padding: 5px 10px; border-radius: 999px; background: color-mix(in oklab, var(--accent) 18%, var(--surface)); border: 1px solid color-mix(in oklab, var(--accent) 40%, var(--surface)); }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }

.journey { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 10px 0; }
.journey .badge-step { font-size: .95rem; padding: 6px 10px; }
.descriptions { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.descriptions dt { margin: 3px 0 0; }
.descriptions dd { margin: 0; }
@media (max-width: 600px) {
  .descriptions { grid-template-columns: 1fr; }
  .descriptions dd { margin-bottom: 6px; }
}
.row-actions { display: flex; gap: 8px; align-items: start; flex-wrap: wrap; }
.row .grow { flex: 1 1 280px; min-width: 0; }
.copy-link { display: flex; gap: 8px; margin-top: 6px; }
.copy-link input { flex: 1 1 auto; min-width: 0; font-size: .85rem; }
