/* LønLet — designsystem v3 "Venlig og varm"
   Temaer: light (Lys), dark (Mørk), mix (marineblå menu + lyst indhold, standard) */

/* ================= Tokens ================= */
:root {
  --display: 'Bricolage Grotesque', 'DM Sans', system-ui, sans-serif;
  --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  --r-sm: 10px;
  --r: 14px;
  --r-lg: 22px;
  --r-xl: 32px;
  --sun: #FFD166;
  --sun-soft: #FFF1CC;
  --mint: #C8F0DC;
}

:root, [data-theme="mix"], [data-theme="light"] {
  color-scheme: light;
  --bg: #FFF7F2;
  --surface: #FFFFFF;
  --soft: #FFF9F5;
  --hover: #FFF1EA;
  --fg: #1B1F3B;
  --fg-2: #3A3F5E;
  --muted: #5D6180;
  --border: #EFE3DB;
  --border-strong: #D6C8BE;
  --line: #F2E9E3;
  --line-2: #E6D9D0;
  --brand: #D9381E;
  --brand-hover: #BF2E16;
  --brand-shadow: #A92A14;
  --brand-fg: #FFFFFF;
  --brand-soft: #FFE3D6;
  --brand-ink: #9E2410;
  --ok-bg: #DDF5E7;
  --ok-fg: #11643A;
  --ok-dot: #1F9D55;
  --navy: #1B1F3B;
  --focus: rgba(217, 56, 30, .28);
  --shadow-sm: 0 1px 2px rgba(27, 31, 59, .06);
  --shadow: 0 2px 4px rgba(27, 31, 59, .04), 0 12px 28px rgba(27, 31, 59, .08);
  --shadow-lg: 0 4px 8px rgba(27, 31, 59, .04), 0 30px 60px rgba(27, 31, 59, .16);
  --err: #B42318;
  --err-bg: #FEF3F2;
  --err-line: #FBD5D1;
  --info: #2B3A8C;
  --info-bg: #EEF0FF;
  --info-line: #D6DBFA;
  --warn-bg: #FFF4D6;
  --warn-line: #F5DE9B;
  --nav-bg: rgba(255, 247, 242, .9);
  --code-bg: #F6ECE5;

  --side-bg: #1B1F3B;
  --side-fg: #FFFFFF;
  --side-muted: #A9ADCB;
  --side-link: #D5D7EA;
  --side-line: #2C3158;
  --side-hover: #252A4F;
  --side-on: #2E3466;
  --side-on-fg: #FFFFFF;
  --side-on-ic: #FFD166;
  --inv-bg: #1B1F3B;
  --inv-fg: #FFFFFF;
  --inv-muted: #B9BDD6;
  --inv-line: #353B6A;
  --inv-accent: #FFD166;
}

[data-theme="light"] {
  --side-bg: #FFFFFF;
  --side-fg: #1B1F3B;
  --side-muted: #5D6180;
  --side-link: #3A3F5E;
  --side-line: #EFE3DB;
  --side-hover: #FFF1EA;
  --side-on: #FFE3D6;
  --side-on-fg: #9E2410;
  --side-on-ic: #D9381E;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #12142A;
  --surface: #1B1E38;
  --soft: #171A33;
  --hover: #23264A;
  --fg: #F6F3F0;
  --fg-2: #D6D4E2;
  --muted: #A5A8C4;
  --border: #2C3058;
  --border-strong: #3E4378;
  --line: #262A4D;
  --line-2: #33386A;
  --brand: #FF7A5C;
  --brand-hover: #FF927A;
  --brand-shadow: #C4472C;
  --brand-fg: #2A0D06;
  --brand-soft: #3D1F22;
  --brand-ink: #FFB8A6;
  --ok-bg: #123826;
  --ok-fg: #8FE3B5;
  --ok-dot: #3CCB7F;
  --focus: rgba(255, 122, 92, .35);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .3);
  --shadow: 0 2px 4px rgba(0, 0, 0, .25), 0 12px 28px rgba(0, 0, 0, .3);
  --shadow-lg: 0 30px 60px rgba(0, 0, 0, .5);
  --err: #FF9B8F;
  --err-bg: #3A1616;
  --err-line: #5E2424;
  --info: #B4BEFF;
  --info-bg: #1E2350;
  --info-line: #343C7A;
  --warn-bg: #3A3016;
  --warn-line: #5C4A1E;
  --nav-bg: rgba(18, 20, 42, .88);
  --code-bg: #262A4D;
  --side-bg: #0D0F22;
  --side-fg: #F6F3F0;
  --side-muted: #A5A8C4;
  --side-link: #D6D4E2;
  --side-line: #1F2242;
  --side-hover: #1B1E38;
  --side-on: #262A52;
  --side-on-fg: #FFFFFF;
  --side-on-ic: #FFD166;
  --inv-bg: #0D0F22;
  --inv-fg: #F6F3F0;
  --inv-muted: #A5A8C4;
  --inv-line: #2C3058;
  --inv-accent: #FFD166;
}

/* ================= Basis ================= */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--body); color: var(--fg); background: var(--bg); font-size: 15.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; font-feature-settings: 'cv11', 'ss01'; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-hover); }
h1, h2, h3 { font-family: var(--display); color: var(--fg); line-height: 1.15; margin: 0 0 .5em; letter-spacing: -0.02em; font-weight: 700; }
h1 { font-size: clamp(26px, 3.4vw, 34px); }
h2 { font-size: 19px; }
h3 { font-size: 16px; }
p { margin: 0 0 1em; }
code { font-family: var(--mono); font-size: .88em; background: var(--code-bg); padding: 2px 6px; border-radius: 6px; }
.muted { color: var(--muted); }
.small { font-size: 13.5px; }
.strong { font-weight: 600; }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.r { text-align: right; }
.nowrap { white-space: nowrap; }
[hidden] { display: none !important; }
.ic { flex: none; }
.accent { color: var(--inv-accent) !important; }

/* ================= Knapper ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 20px; border-radius: 14px; border: 1.5px solid var(--brand);
  background: var(--brand); color: var(--brand-fg); font: 700 15px/1 var(--body); text-decoration: none;
  cursor: pointer; box-shadow: 0 3px 0 var(--brand-shadow); transition: background .15s, border-color .15s, color .15s, transform .08s, box-shadow .08s;
}
.btn:hover { background: var(--brand-hover); border-color: var(--brand-hover); color: var(--brand-fg); }
.btn:active { transform: translateY(2px); box-shadow: 0 1px 0 var(--brand-shadow); }
.btn:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible, textarea:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--focus); }
.btn.ghost { background: var(--surface); color: var(--fg); border-color: var(--fg); box-shadow: none; }
.btn.ghost:hover { background: var(--hover); color: var(--fg); border-color: var(--fg); }
.btn.ghost:active { box-shadow: none; }
.btn.sm { min-height: 36px; padding: 7px 13px; font-size: 13.5px; border-radius: 11px; box-shadow: 0 2px 0 var(--brand-shadow); }
.btn.ghost.sm { box-shadow: none; }
.btn.lg { min-height: 56px; padding: 16px 26px; font-size: 16.5px; border-radius: 16px; box-shadow: 0 5px 0 var(--brand-shadow); }
.btn.ghost.lg { box-shadow: none; }
.btn.full { width: 100%; }
.btn.light { background: #fff; border-color: #fff; color: #1B1F3B; box-shadow: none; }
.btn.light:hover { background: #FFF1EA; border-color: #FFF1EA; color: #1B1F3B; }
.btn.outline-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.35); box-shadow: none; }
.btn.outline-light:hover { background: rgba(255,255,255,.08); color: #fff; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ================= Sprog/tema-vælger ================= */
.prefs { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.prefs-group { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); }
.prefs-group a { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; min-width: 34px; justify-content: center; padding: 4px 9px; border-radius: 7px; text-decoration: none; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.prefs-group a:hover { color: var(--fg); background: var(--hover); }
.prefs-group a.on { background: var(--navy); color: #fff; }
[data-theme="dark"] .prefs-group a.on { background: var(--hover); }
.prefs-group a span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.prefs.compact { margin-left: 4px; }
.side .prefs { padding: 10px 6px 0; }
.side .prefs-group { background: transparent; border-color: var(--side-line); }
.side .prefs-group a { color: var(--side-muted); }
.side .prefs-group a:hover { color: var(--side-fg); background: var(--side-hover); }
.side .prefs-group a.on { background: var(--side-on); color: var(--side-on-fg); }
.bare-prefs { position: absolute; top: 16px; right: 16px; z-index: 5; }

/* ================= App-skal ================= */
.shell { display: flex; flex-wrap: wrap; min-height: 100vh; }
.side {
  flex: 1 1 240px; max-width: 100%; background: var(--side-bg); color: var(--side-fg);
  display: flex; flex-direction: column; gap: 6px; padding: 20px 14px;
  border-right: 1px solid var(--side-line);
}
@media (min-width: 900px) { .side { flex: 0 0 256px; position: sticky; top: 0; height: 100vh; overflow-y: auto; } }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 800 20px var(--display); letter-spacing: -0.03em; color: var(--fg); }
.brand:hover { color: var(--fg); }
.brand.sm { font-size: 17px; }
.logo { display: inline-flex; width: 32px; height: 32px; border-radius: 10px; background: var(--brand); color: var(--brand-fg); align-items: center; justify-content: center; font: 800 17px var(--display); transform: rotate(-6deg); }
.side .brand { color: var(--side-fg); padding: 4px 8px 10px; }
.side-org { font-size: 12.5px; color: var(--side-muted); padding: 0 8px 14px; border-bottom: 1px solid var(--side-line); overflow-wrap: anywhere; }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding-top: 10px; }
@media (max-width: 899px) { .side-nav { flex-direction: row; flex-wrap: wrap; } }
.side-nav a { display: flex; align-items: center; gap: 11px; padding: 9px 11px; min-height: 40px; border-radius: 9px; color: var(--side-link); text-decoration: none; font-weight: 500; font-size: 14.5px; }
.side-nav a .ic { opacity: .8; }
.side-nav a:hover { background: var(--side-hover); color: var(--side-fg); }
.side-nav a.on { background: var(--side-on); color: var(--side-on-fg); font-weight: 600; }
.side-nav a.on .ic { opacity: 1; color: var(--side-on-ic); }
.side-user { margin-top: auto; padding: 14px 8px 0; border-top: 1px solid var(--side-line); display: flex; flex-direction: column; gap: 10px; }
.side-user .who { display: flex; flex-direction: column; font-size: 13.5px; overflow-wrap: anywhere; }
.side-user .who span { color: var(--side-muted); font-size: 12.5px; }
.side-user .btn { border-color: var(--side-line); color: var(--side-fg); background: transparent; box-shadow: none; }
.side-user .btn:hover { background: var(--side-hover); color: var(--side-fg); }
.main { flex: 999 1 560px; min-width: 0; padding: clamp(20px, 4vw, 40px); max-width: 1280px; }
.main-bare { min-height: 100vh; padding: 72px 16px 40px; display: flex; flex-direction: column; align-items: center; justify-content: center; background: var(--bg); }

.page-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 24px; }
.page-head h1 { margin-bottom: 4px; }
.page-head p { margin: 0; }
.page-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ================= Kort ================= */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px 26px; margin-bottom: 20px; box-shadow: var(--shadow-sm); }
.card.flush { padding: 0; overflow: hidden; }
.card .pad { padding: 20px 24px 4px; }
.card.narrow { max-width: 520px; }
.card.empty { text-align: center; padding: 52px 24px; }
.card h2 { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.grid-2col { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); gap: 20px; align-items: start; }
.grid-2col .card { margin-bottom: 0; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: 14px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 6px; box-shadow: var(--shadow-sm); }
.stat-label { font-size: 13px; font-weight: 500; color: var(--muted); }
.stat-val { font: 700 28px/1.1 var(--display); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stat-val small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.stat-sub { font-size: 12.5px; color: var(--muted); }
.stat.dark { background: var(--inv-bg); color: var(--inv-fg); border-color: var(--inv-bg); }
.stat.dark .stat-label, .stat.dark .stat-sub, .stat.dark .stat-val small { color: var(--inv-muted); }
.stat.dark .stat-val { color: var(--inv-accent); }
[data-theme="light"] .stat.dark { background: var(--sun); border-color: var(--sun); color: #1B1F3B; }
[data-theme="light"] .stat.dark .stat-val { color: #1B1F3B; }
[data-theme="light"] .stat.dark .stat-label, [data-theme="light"] .stat.dark .stat-sub, [data-theme="light"] .stat.dark .stat-val small { color: #4A4220; }
[data-theme="dark"] .stat.dark { border-color: var(--border); }

.banner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 14px 18px; margin-bottom: 20px; border-radius: var(--r); background: var(--warn-bg); border: 1px solid var(--warn-line); text-decoration: none; color: var(--fg); }
.banner:hover { color: var(--fg); border-color: var(--border-strong); }
.banner > .ic { color: #A06A00; }
.banner-cta { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; font-weight: 600; color: var(--brand); }

.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--hover); color: var(--fg-2); white-space: nowrap; border: 1px solid var(--border); font-family: var(--body); letter-spacing: 0; }
.pill.ok { background: var(--ok-bg); color: var(--ok-fg); border-color: transparent; }
.pill.ok::before { content: ''; width: 6px; height: 6px; border-radius: 999px; background: var(--ok-dot); }
.pill.muted { color: var(--muted); }
.pill.warn { background: var(--err-bg); color: var(--err); border-color: var(--err-line); }

.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0; margin: 0 0 18px; }
.kv dt, .kv dd { padding: 9px 0; border-bottom: 1px solid var(--line); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; font-weight: 500; }
.kv dt.strong, .kv dd.strong { color: var(--fg); font-weight: 700; }
.big-period { font: 700 24px var(--display); letter-spacing: -0.02em; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.checklist { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; }
.checklist li { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: none; }
.checklist li .ic { padding: 3px; border-radius: 999px; border: 1.5px solid var(--border-strong); color: transparent; width: 24px; height: 24px; }
.checklist li.done .ic { background: var(--ok-dot); border-color: var(--ok-dot); color: #fff; }
.checklist li a { color: var(--fg); text-decoration: none; font-weight: 500; }
.checklist li a:hover { color: var(--brand); }
.checklist li.done a { color: var(--muted); text-decoration: line-through; font-weight: 400; }

.note { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--r); background: var(--info-bg); border: 1px solid var(--info-line); margin-bottom: 16px; font-size: 13.5px; color: var(--fg-2); }
.note > .ic { color: var(--info); margin-top: 1px; }
.note p { margin: 0; }

.tabs { display: inline-flex; gap: 2px; margin-bottom: 14px; padding: 3px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; }
.tabs a { padding: 6px 14px; border-radius: 7px; text-decoration: none; font-weight: 600; font-size: 13.5px; min-height: 34px; display: inline-flex; align-items: center; color: var(--muted); }
.tabs a.on { background: var(--navy); color: #fff; }
[data-theme="dark"] .tabs a.on { background: var(--hover); }

/* ================= Tabeller ================= */
.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.table th { text-align: left; font-size: 12px; font-weight: 600; letter-spacing: .02em; color: var(--muted); padding: 11px 16px; border-bottom: 1px solid var(--border); background: var(--soft); white-space: nowrap; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.table tbody tr:last-child td { border-bottom: none; }
.table th.r, .table td.r { text-align: right; }
.table tbody tr:hover { background: var(--hover); }
.table tr.inactive td { color: var(--muted); }
.table tfoot td { font-weight: 700; border-top: 1px solid var(--border-strong); border-bottom: none; background: var(--soft); }
.table a.strong { text-decoration: none; color: var(--fg); }
.table a.strong:hover { color: var(--brand); }
.card > .table-wrap .table th:first-child, .card > .table-wrap .table td:first-child { padding-left: 24px; }
.card > .table-wrap .table th:last-child, .card > .table-wrap .table td:last-child { padding-right: 24px; }
.run-table input { margin: 0; }
.in-sm { width: 96px; }
.in-md { width: 180px; }
.inline-form { display: inline-flex; gap: 6px; }

/* ================= Formularer ================= */
.form { display: flex; flex-direction: column; gap: 14px; }
.form.inline { flex-direction: row; flex-wrap: wrap; align-items: flex-end; gap: 14px; }
.form.inline label { flex: 1 1 180px; }
fieldset { border: none; padding: 0; margin: 0 0 6px; display: flex; flex-direction: column; gap: 14px; }
legend { font: 700 15px var(--display); margin-bottom: 10px; padding: 0; color: var(--fg); }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13.5px; font-weight: 600; color: var(--fg-2); }
.hint { font-weight: 400; font-size: 12.5px; color: var(--muted); }
input, select, textarea {
  font: 400 15px var(--body); color: var(--fg); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 10px 12px; min-height: 42px; width: 100%;
  transition: border-color .15s, box-shadow .15s;
}
input::placeholder { color: var(--muted); opacity: .75; }
input:hover, select:hover, textarea:hover { border-color: var(--muted); }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px var(--focus); }
input[readonly] { background: var(--soft); }
textarea.code { font: 13px/1.5 var(--mono); }
label.check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 500; }
label.check input { width: 18px; height: 18px; min-height: 0; margin-top: 2px; accent-color: var(--brand); flex: none; }
.grid2, .grid3 { display: grid; gap: 14px; }
.grid2 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.grid3 { grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin-bottom: 14px; }
.card .grid3:last-child { margin-bottom: 0; }
.seg { display: inline-flex; padding: 3px; border-radius: 10px; border: 1px solid var(--border); background: var(--soft); margin-bottom: 16px; gap: 2px; flex-wrap: wrap; }
.seg label { flex-direction: row; cursor: pointer; color: var(--muted); }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.seg span { padding: 7px 16px; border-radius: 7px; min-height: 34px; display: inline-flex; align-items: center; font-weight: 600; }
.seg input:checked + span { background: var(--navy); color: #fff; box-shadow: var(--shadow-sm); }
[data-theme="dark"] .seg input:checked + span { background: var(--hover); }
.seg input:focus-visible + span { box-shadow: 0 0 0 3px var(--focus); }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 6px 0 20px; }
.form-actions.sticky { position: sticky; bottom: 0; padding: 14px 0; background: linear-gradient(to top, var(--bg) 70%, transparent); }
.danger-zone { margin-top: 12px; }
.copy-box { display: flex; gap: 8px; margin-top: 12px; }
.copy-box input { font-family: var(--mono); font-size: 12.5px; }
.card.invite { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; align-items: center; background: var(--sun-soft); border-color: transparent; }
[data-theme="dark"] .card.invite { background: var(--soft); border-color: var(--border); }
.card.invite h2 { color: var(--fg); }
.card.invite > div { flex: 1 1 360px; min-width: 0; }
.month-pick { margin-bottom: 20px; max-width: 460px; }

/* ================= Sikkerhed ================= */
.setup-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 18px; margin: 0; }
.setup-steps li { padding-left: 4px; }
.setup-steps li::marker { font-weight: 700; color: var(--brand); }
.qr { width: 196px; height: 196px; margin: 12px 0; padding: 8px; background: #fff; border-radius: var(--r); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.qr svg { width: 100%; height: 100%; display: block; }
.manual summary { cursor: pointer; font-size: 13.5px; color: var(--muted); min-height: 30px; }
.secret { display: inline-block; margin-top: 8px; font-size: 14px; letter-spacing: .08em; word-break: break-all; }
.code-input { font-family: var(--mono); font-size: 19px; letter-spacing: .22em; max-width: 220px; }
.codes { columns: 2; padding-left: 24px; margin: 0 0 12px; }
.codes li { margin-bottom: 6px; }
.codes code { font-size: 15px; }
.card.recovery { border: 1px solid var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.code-block { font: 12.5px/1.5 var(--mono); background: var(--code-bg); padding: 12px 14px; border-radius: 10px; overflow-x: auto; white-space: pre; }
.checks { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 0 28px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line); }
.checks li div { display: flex; flex-direction: column; }
.checks li .ic { border-radius: 999px; padding: 3px; width: 24px; height: 24px; }
.checks li.ok .ic { background: var(--ok-bg); color: var(--ok-fg); }
.checks li.bad .ic { background: var(--err-bg); color: var(--err); }
.checks li.unknown .ic { background: var(--hover); color: var(--muted); }

/* ================= Testversion ================= */
.demo-bar { background: var(--sun); color: #1B1F3B; text-align: center; font-size: 13.5px; padding: 8px 16px; line-height: 1.4; position: relative; z-index: 30; }
.demo-bar strong { background: #1B1F3B; color: var(--sun); padding: 2px 8px; border-radius: 6px; margin-right: 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.demo-box { background: var(--sun-soft); border: 1px dashed #D9B24C; border-radius: var(--r); padding: 14px 16px; margin-bottom: 16px; font-size: 14px; color: #1B1F3B; }
.demo-box dl { display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; margin: 8px 0 0; }
.demo-box dt { color: #5A4A1A; }
.demo-box dd { margin: 0; }
.demo-box code { background: #fff; color: #1B1F3B; }
[data-theme="dark"] .demo-box { background: #2E2810; border-color: #6B5A20; color: var(--fg); }
[data-theme="dark"] .demo-box dt { color: var(--muted); }
[data-theme="dark"] .demo-box code { background: var(--code-bg); color: var(--fg); }
body.bare .bare-prefs { top: 48px; }
@media (min-width: 900px) {
  body.demo .demo-bar { position: sticky; top: 0; height: 36px; display: flex; align-items: center; justify-content: center; padding-top: 0; padding-bottom: 0; }
  body.demo.app .side { top: 36px; height: calc(100vh - 36px); }
}

/* ================= Beskeder ================= */
.flash { padding: 12px 16px; border-radius: var(--r); margin-bottom: 16px; font-size: 14.5px; border: 1px solid #B8E6CB; background: var(--ok-bg); color: var(--ok-fg); }
.flash-err { background: var(--err-bg); border-color: var(--err-line); color: var(--err); }
.flash-info { background: var(--info-bg); border-color: var(--info-line); color: var(--info); }
[data-theme="dark"] .flash { border-color: #1E5A3D; }

/* ================= Login / opret ================= */
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-xl); padding: clamp(26px, 5vw, 40px); box-shadow: var(--shadow-lg); }
.auth-card.wide { max-width: 720px; }
.auth-card .brand { margin-bottom: 28px; }
.auth-card h1 { font-size: 28px; }
.auth-foot { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.auth-foot p { margin: 0 0 6px; }
.steps-list li { margin-bottom: 8px; }
.prose h2 { margin-top: 1.4em; font-size: 18px; }
.prose ul { padding-left: 20px; }

/* ================= Lønseddel ================= */
.slip { position: relative; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: clamp(22px, 4vw, 44px); max-width: 860px; overflow: hidden; box-shadow: var(--shadow); }
.slip-draft { position: absolute; top: 40%; left: 50%; transform: translate(-50%, -50%) rotate(-18deg); font: 800 120px var(--display); color: var(--fg); opacity: .05; pointer-events: none; }
.slip-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.slip-title { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--brand); }
.slip-period { font: 700 30px var(--display); letter-spacing: -0.03em; }
.slip-company { text-align: right; font-size: 13.5px; line-height: 1.6; color: var(--fg-2); }
.slip-company strong { color: var(--fg); }
.slip-parties { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; padding: 22px 0; font-size: 13.5px; }
.slip-parties .lbl { display: block; font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 4px; }
.slip-meta { display: grid; grid-template-columns: auto auto; gap: 4px 18px; margin: 0; }
.slip-meta dt { color: var(--muted); }
.slip-meta dd { margin: 0; font-variant-numeric: tabular-nums; font-weight: 500; }
.slip-lines { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.slip-lines th { text-align: left; font-size: 12px; letter-spacing: .02em; color: var(--muted); font-weight: 600; padding: 10px 10px; border-bottom: 1px solid var(--border); background: var(--soft); }
.slip-lines th.r, .slip-lines td.r { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.slip-lines td { padding: 11px 10px; border-bottom: 1px solid var(--line); }
.slip-lines tr.sub td { font-weight: 700; background: var(--soft); }
.slip-lines tfoot td { padding: 18px 10px; font: 700 20px var(--display); border-bottom: none; border-top: 2px solid var(--fg); }
.slip-lines tfoot td.r { font: 800 26px var(--display); color: var(--fg); }
.slip-lines tfoot td.r span.hl { background: var(--sun); color: #1B1F3B; padding: 2px 10px; border-radius: 10px; }
.slip-boxes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 16px; margin-top: 22px; }
.slip-boxes section { background: var(--soft); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; }
.slip-boxes h3 { font-size: 13.5px; margin-bottom: 10px; }
.slip-boxes dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-size: 13px; }
.slip-boxes dt { color: var(--muted); }
.slip-boxes dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.slip-foot { margin-top: 22px; font-size: 12px; color: var(--muted); }

@media print {
  @page { size: A4; margin: 14mm; }
  :root, [data-theme] { --bg: #fff; --surface: #fff; --soft: #f4f6f8; --fg: #000; --fg-2: #222; --muted: #555; --border: #bbb; --line: #ddd; --line-2: #ccc; --brand: #0E7A5F; color-scheme: light; }
  body { background: #fff; color: #000; }
  .side, .no-print, .flash, .bare-prefs { display: none !important; }
  .main { padding: 0; max-width: none; }
  .slip { border: none; padding: 0; max-width: none; border-radius: 0; box-shadow: none; }
  .card.recovery { box-shadow: none; border: 1px solid #000; }
  body.print-codes .card:not(.recovery), body.print-codes .grid-2col, body.print-codes .page-head { display: none !important; }
}

/* =========================================================
   FORSIDE
   ========================================================= */
body.landing { background: var(--bg); }
.l-wrap { max-width: 1200px; margin: 0 auto; padding-left: 24px; padding-right: 24px; }
.l-nav { position: sticky; top: 0; z-index: 20; background: var(--nav-bg); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--line); }
.l-nav-in { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; min-height: 68px; }
.l-links { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; }
.l-links > a:not(.btn) { padding: 10px 12px; text-decoration: none; font-weight: 500; font-size: 14.5px; color: var(--fg-2); border-radius: 8px; }
.l-links > a:not(.btn):hover { color: var(--fg); background: var(--hover); }
.l-links .btn { margin-left: 4px; }
@media (max-width: 760px) { .l-nav { position: static; } .l-links .hide-sm { display: none; } }

.eyebrow { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; padding: 7px 14px 7px 7px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-ink); font-size: 14px; font-weight: 700; }
.eyebrow b { background: var(--brand); color: var(--brand-fg); border-radius: 999px; padding: 2px 8px; font-size: 11.5px; letter-spacing: .02em; }
.sec-label { display: inline-block; font-size: 13px; font-weight: 700; letter-spacing: .02em; color: var(--brand-ink); background: var(--brand-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 16px; }

/* Hero */
.l-hero { background: var(--bg); overflow: hidden; }
.l-hero-in { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 56px; align-items: center; padding-top: 64px; padding-bottom: 80px; }
.l-hero-copy { display: flex; flex-direction: column; gap: 24px; }
.l-hero h1 { font: 800 clamp(46px, 6vw, 76px)/1 var(--display); letter-spacing: -0.045em; margin: 0; }
.l-hero h1 mark { background: var(--sun); color: #1B1F3B; padding: 0 12px; border-radius: 16px; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.l-lead { font-size: 18.5px; line-height: 1.6; color: var(--fg-2); max-width: 540px; margin: 0; }
.l-ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.l-ticks { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 14px; color: var(--fg-2); font-weight: 500; }
.l-ticks li { display: inline-flex; align-items: center; gap: 7px; }
.l-ticks .ic { color: var(--ok-dot); }

/* Produktvisning i hero: lønseddel på mobil */
.phone-wrap { position: relative; display: flex; justify-content: center; padding: 28px 0 12px; }
.phone-sun { position: absolute; width: min(380px, 80%); aspect-ratio: 1; border-radius: 999px; background: var(--sun); top: 0; right: 4%; }
.phone-chip { position: absolute; left: 0; bottom: 4%; background: var(--surface); border: 1.5px solid var(--fg); border-radius: 16px; padding: 12px 16px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 10px; font-size: 13.5px; font-weight: 600; z-index: 2; }
.phone-chip .ic { color: var(--ok-dot); background: var(--ok-bg); border-radius: 999px; padding: 3px; width: 26px; height: 26px; }
.phone-chip small { display: block; font-weight: 400; color: var(--muted); font-size: 12px; }
.phone { position: relative; width: 300px; background: #1B1F3B; border-radius: 44px; padding: 14px; box-shadow: var(--shadow-lg); }
.phone-scr { background: #FFFFFF; color: #1B1F3B; border-radius: 32px; padding: 22px 20px; display: flex; flex-direction: column; gap: 14px; min-height: 470px; }
.phone-top { display: flex; justify-content: space-between; align-items: center; font: 700 17px var(--display); }
.phone-top .logo { width: 26px; height: 26px; font-size: 13px; border-radius: 8px; }
.phone-pay { background: #D9381E; color: #FFFFFF; border-radius: 22px; padding: 20px; display: flex; flex-direction: column; gap: 4px; }
.phone-pay span { font-size: 13px; opacity: .92; }
.phone-pay strong { font: 800 28px var(--display); white-space: nowrap; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.phone-rows { display: flex; flex-direction: column; font-size: 14px; }
.phone-rows div { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px dashed #E8DDD5; font-variant-numeric: tabular-nums; }
.phone-rows div span:first-child { color: #5D6180; }
.phone-btn { margin-top: auto; text-align: center; padding: 12px; border-radius: 14px; background: #FFF1EA; color: #9E2410; font-weight: 700; font-size: 14px; }
@media (max-width: 560px) { .phone-chip { display: none; } .phone { width: 270px; } }

/* Tillidslinje */
.l-trust { border-top: 1.5px solid var(--fg); border-bottom: 1.5px solid var(--fg); background: var(--surface); }
.l-trust-in { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 18px; padding-top: 26px; padding-bottom: 26px; }
.l-trust-in > div { display: flex; align-items: center; gap: 12px; font-size: 14.5px; font-weight: 600; color: var(--fg); }
.l-trust-in > div > div { display: flex; flex-direction: column; line-height: 1.35; }
.l-trust-in > div > div > span { font-weight: 400; color: var(--muted); font-size: 13px; }
.l-trust-in .ic-box { width: 40px; height: 40px; border-radius: 10px; }

/* Sektioner */
.l-sec { padding-top: 96px; padding-bottom: 24px; }
.l-sec-head { max-width: 680px; margin-bottom: 44px; }
.l-sec-head.center { margin-left: auto; margin-right: auto; text-align: center; }
.l-sec h2, .l-price h2, .l-final h2 { font: 800 clamp(30px, 4vw, 44px)/1.1 var(--display); letter-spacing: -0.035em; margin-bottom: 14px; }
.l-sec-head p { font-size: 17px; color: var(--fg-2); margin: 0; }
.ic-box { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); flex: none; }

.l-features { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 16px; }
.l-features article { background: var(--surface); border: 2px solid var(--fg); border-radius: 28px; padding: 28px; display: flex; flex-direction: column; gap: 12px; transition: box-shadow .2s, transform .2s; }
.l-features article:hover { box-shadow: 6px 6px 0 var(--fg); transform: translate(-3px, -3px); }
[data-theme="dark"] .l-features article { border-color: var(--border-strong); }
[data-theme="dark"] .l-features article:hover { box-shadow: 6px 6px 0 #000; }
.l-features h3 { font-size: 21px; margin: 6px 0 0; letter-spacing: -0.02em; }
.l-features article:nth-child(3n+1) .ic-box { background: var(--sun-soft); color: #8A5A00; }
.l-features article:nth-child(3n+2) .ic-box { background: var(--ok-bg); color: var(--ok-fg); }
.l-features article:nth-child(3n) .ic-box { background: var(--brand-soft); color: var(--brand-ink); }
.l-features p { margin: 0; color: var(--fg-2); font-size: 15px; }

.l-steps { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; counter-reset: step; }
.l-steps li { position: relative; padding: 28px; border-radius: 28px; background: var(--surface); border: 1px solid var(--border); display: flex; flex-direction: column; gap: 10px; }
.l-steps .n { width: 42px; height: 42px; border-radius: 14px; background: var(--sun); color: #1B1F3B; display: inline-flex; align-items: center; justify-content: center; font: 800 18px var(--display); transform: rotate(-6deg); }
.l-steps h3 { font-size: 18px; margin: 6px 0 0; }
.l-steps p { margin: 0; color: var(--fg-2); }

/* Pris */
.l-price { padding-top: 96px; padding-bottom: 24px; }
.l-price-card { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); border: 2px solid var(--fg); border-radius: 36px; overflow: hidden; box-shadow: 8px 8px 0 var(--fg); background: var(--surface); }
[data-theme="dark"] .l-price-card { border-color: var(--border-strong); box-shadow: 8px 8px 0 #000; }
.l-price-main { padding: clamp(28px, 4vw, 48px); display: flex; flex-direction: column; gap: 18px; }
.l-price-big { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 28px; }
.l-price-big div { display: flex; flex-direction: column; }
.l-price-big strong { font: 800 clamp(40px, 5vw, 56px)/1 var(--display); letter-spacing: -0.04em; color: var(--fg); }
.l-price-big span { color: var(--muted); font-size: 14px; margin-top: 6px; }
.l-price-big .plus { font: 700 28px var(--display); color: var(--muted); padding-bottom: 22px; }
.l-incl { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); gap: 10px 20px; }
.l-incl li { display: flex; align-items: flex-start; gap: 9px; font-size: 14.5px; color: var(--fg-2); }
.l-incl .ic { color: var(--ok-dot); margin-top: 2px; }
.l-calc { background: var(--inv-bg); color: var(--inv-fg); padding: clamp(28px, 4vw, 48px); display: flex; flex-direction: column; gap: 20px; }
.l-calc .lbl { font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--inv-accent); }
.l-calc-q { font: 700 22px var(--display); letter-spacing: -0.02em; color: var(--inv-fg); }
.l-calc-slider { display: flex; align-items: center; gap: 18px; background: rgba(255,255,255,.06); border: 1px solid var(--inv-line); border-radius: 14px; padding: 12px 18px; }
.l-calc-slider input { accent-color: #FFD166; border: none; padding: 0; background: transparent; cursor: pointer; box-shadow: none; min-height: 32px; }
.l-calc-slider output { min-width: 56px; text-align: right; font: 800 30px var(--display); color: #fff; font-variant-numeric: tabular-nums; }
.l-calc-res { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.l-calc-res div { border: 1px solid var(--inv-line); border-radius: 14px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.l-calc-res span { font-size: 13px; color: var(--inv-muted); }
.l-calc-res strong { font: 800 clamp(24px, 3vw, 32px) var(--display); letter-spacing: -0.03em; color: #fff; font-variant-numeric: tabular-nums; }
.l-calc-res strong.accent { color: var(--inv-accent) !important; }
.l-calc-res span[data-out] { font-size: inherit; color: inherit; }
.l-calc-note { font-size: 13px; color: var(--inv-muted); }
[data-theme="light"] .l-calc { background: var(--sun); color: #1B1F3B; }
[data-theme="light"] .l-calc .lbl { color: #6B4A00; }
[data-theme="light"] .l-calc-q, [data-theme="light"] .l-calc-res strong, [data-theme="light"] .l-calc-slider output { color: #1B1F3B; }
[data-theme="light"] .l-calc-res strong.accent { color: #9E2410 !important; }
[data-theme="light"] .l-calc-res span, [data-theme="light"] .l-calc-note { color: #4A4220; }
[data-theme="light"] .l-calc-slider, [data-theme="light"] .l-calc-res div { background: #fff; border-color: #E8BE4C; }
[data-theme="light"] .l-calc-slider input { accent-color: #D9381E; }

/* Sikkerhed */
.l-security { background: var(--inv-bg); color: var(--inv-fg); margin-top: 96px; }
.l-security-in > div:first-child { max-width: 520px; }
.l-security-in { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 48px; padding-top: 88px; padding-bottom: 88px; align-items: center; }
.l-security h2 { color: #fff; font: 800 clamp(30px, 4vw, 44px)/1.1 var(--display); letter-spacing: -0.035em; margin-bottom: 14px; }
.l-security p { color: var(--inv-muted); font-size: 17px; margin: 0; }
.l-security .sec-label { color: #1B1F3B; background: var(--sun); }
.l-sec-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: 14px; }
.l-sec-list div { border: 1px solid var(--inv-line); border-radius: var(--r-lg); padding: 20px; background: rgba(255,255,255,.03); }
.l-sec-list h3 { color: #fff; font-size: 16px; margin: 12px 0 6px; }
.l-sec-list p { font-size: 14px; }
.l-sec-list .ic-box { background: rgba(255, 209, 102, .14); color: var(--inv-accent); width: 40px; height: 40px; }
[data-theme="light"] .l-security { background: var(--soft); color: var(--fg); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
[data-theme="light"] .l-security h2, [data-theme="light"] .l-sec-list h3 { color: var(--fg); }
[data-theme="light"] .l-security p { color: var(--fg-2); }

[data-theme="light"] .l-sec-list div { background: var(--surface); border-color: var(--border); }
[data-theme="light"] .l-sec-list .ic-box { background: var(--sun-soft); color: #8A5A00; }

/* FAQ */
.l-faq { max-width: 860px; }
.l-faq-list { display: flex; flex-direction: column; gap: 10px; }
.l-faq details { border: 1.5px solid var(--fg); border-radius: 22px; padding: 4px 22px; background: var(--surface); transition: box-shadow .2s; }
[data-theme="dark"] .l-faq details { border-color: var(--border-strong); }
.l-faq details[open] { box-shadow: var(--shadow); }
.l-faq summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 16px; min-height: 60px; font: 600 16.5px var(--display); letter-spacing: -0.01em; }
.l-faq summary::-webkit-details-marker { display: none; }
.l-faq .plus { width: 28px; height: 28px; border-radius: 999px; background: var(--hover); display: inline-flex; align-items: center; justify-content: center; font: 500 18px/1 var(--body); color: var(--fg-2); transition: transform .2s; flex: none; }
.l-faq details[open] .plus { transform: rotate(45deg); background: var(--sun); color: #1B1F3B; }
.l-faq details p { margin: 0 0 18px; font-size: 15.5px; color: var(--fg-2); max-width: 720px; }

/* Afslutning */
.l-final { padding-top: 96px; padding-bottom: 88px; }
.l-final-in { background: var(--navy); color: #fff; border-radius: 40px; padding: clamp(36px, 6vw, 72px); display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 28px; position: relative; overflow: hidden; }
[data-theme="dark"] .l-final-in { background: var(--surface); border: 1px solid var(--border); }
.l-final h2 { margin: 0 0 10px; color: #fff; }
[data-theme="dark"] .l-final h2 { color: var(--fg); }
.l-final p { margin: 0; color: #B9BDD6; font-size: 17px; }
.l-final h2 mark { background: var(--sun); color: #1B1F3B; padding: 0 10px; border-radius: 12px; }
.l-final-btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* Footer */
.l-foot { border-top: 1px solid var(--line); background: var(--soft); }
.l-foot-in { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); gap: 28px; padding-top: 48px; padding-bottom: 32px; font-size: 14px; }
.l-foot-in h4 { font: 700 13px var(--display); text-transform: uppercase; letter-spacing: .06em; color: var(--fg); margin: 0 0 12px; }
.l-foot-in p { color: var(--muted); margin: 10px 0 0; max-width: 260px; }
.l-foot-in ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.l-foot-in a { color: var(--fg-2); text-decoration: none; }
.l-foot-in a:hover { color: var(--brand); }
.l-foot-bottom { border-top: 1px solid var(--line); padding-top: 18px; padding-bottom: 24px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 13px; color: var(--muted); }

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