:root {
    --bg: #faf6f1;
    --surface: #ffffff;
    --surface-2: #f2ebe2;
    --border: rgba(60, 40, 20, 0.10);
    --text: #2b2420;
    --text-muted: #7a6d63;
    --accent: #e0694a;          /* tomat */
    --accent-dark: #c4553a;
    --accent-soft: #fbe3da;
    --green: #3f8f5a;
    --red: #c9372c;
    --shadow: 0 1px 2px rgba(60, 40, 20, 0.06), 0 6px 20px rgba(60, 40, 20, 0.08);
    --radius: 18px;
    --radius-sm: 12px;
    --topbar-bg: rgba(250, 246, 241, 0.86);
    color-scheme: light;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #1a1613;
        --surface: #26201c;
        --surface-2: #322a25;
        --border: rgba(255, 240, 225, 0.10);
        --text: #f4ece4;
        --text-muted: #b0a297;
        --accent: #f07c5c;
        --accent-dark: #e0694a;
        --accent-soft: #46291f;
        --green: #6cc28a;
        --red: #f0715f;
        --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.35);
        --topbar-bg: rgba(26, 22, 19, 0.86);
        color-scheme: dark;
    }
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    min-height: 100dvh;
    -webkit-font-smoothing: antialiased;
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
}

@media (display-mode: standalone) {
    body { overscroll-behavior-y: none; }
}

a, button, label { -webkit-tap-highlight-color: transparent; }
a { color: var(--accent); text-decoration: none; }
img { max-width: 100%; display: block; }

h1, h2 { font-family: 'Fraunces', Georgia, serif; font-weight: 600; letter-spacing: -0.01em; margin: 0; }

[hidden] { display: none !important; }

/* ---------- Topbar ---------- */
.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding-top: env(safe-area-inset-top);
    background: var(--topbar-bg);
    backdrop-filter: blur(16px) saturate(160%);
    -webkit-backdrop-filter: blur(16px) saturate(160%);
    border-bottom: 1px solid var(--border);
}
.topbar-inner {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 52px;
    padding: 0 8px 0 16px;
}
.topbar-inner:has(> a:first-child) { padding-left: 8px; }
.topbar-titel {
    font-family: 'Fraunces', Georgia, serif;
    font-weight: 600;
    font-size: 1.2rem;
}
.ikon-knap, .ikon-knap-plads {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--text);
    flex-shrink: 0;
}
.ikon-knap:active { background: var(--surface-2); }

/* ---------- Generelt layout ---------- */
.side {
    max-width: 640px;
    margin: 0 auto;
    padding: 20px 16px 120px;
}
.side.smal { max-width: 480px; }

.kort {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.kort h2 { font-size: 1.2rem; margin-bottom: 12px; }
.kort-tekst { margin: 0 0 12px; color: var(--text-muted); }

/* ---------- Formularer ---------- */
form label, .felt { display: block; margin-bottom: 14px; }
form label > span, .felt > span {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.felt em { font-style: normal; opacity: 0.7; }

input[type="text"], input[type="password"], input[type="time"] {
    width: 100%;
    font: inherit;
    font-size: 16px;            /* forhindrer iOS-zoom ved fokus */
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    outline: none;
    transition: border-color 0.15s, background 0.15s;
    -webkit-appearance: none;
    appearance: none;
}
input:focus { border-color: var(--accent); background: var(--surface); }
input[type="time"] { min-height: 48px; }

.knap {
    display: block;
    width: 100%;
    font: inherit;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    cursor: pointer;
    transition: transform 0.1s, background 0.15s;
}
.knap:active { transform: scale(0.98); }
.knap.primaer { background: var(--accent); color: #fff; }
.knap.primaer:active { background: var(--accent-dark); }
.knap.sekundaer { background: var(--surface-2); color: var(--text); }
.knap.fare { background: transparent; color: var(--red); border: 1px solid currentColor; margin-top: 8px; }
.knap.fare.bekraeft { background: var(--red); color: #fff; border-color: var(--red); }

.fejl, .ok {
    padding: 10px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    margin: 0 0 14px;
}
.fejl { background: color-mix(in srgb, var(--red) 12%, transparent); color: var(--red); }
.ok { background: color-mix(in srgb, var(--green) 14%, transparent); color: var(--green); }

/* ---------- Login / setup ---------- */
.auth-side {
    display: grid;
    place-items: center;
    padding: 24px 16px;
    padding-top: calc(24px + env(safe-area-inset-top));
}
.auth-boks {
    width: 100%;
    max-width: 360px;
    text-align: center;
}
.auth-boks form { text-align: left; margin-top: 24px; }
.auth-ikon {
    width: 76px;
    height: 76px;
    border-radius: 20px;
    margin: 0 auto 18px;
    box-shadow: var(--shadow);
}
.auth-boks h1 { font-size: 2rem; }
.auth-intro { color: var(--text-muted); margin: 8px 0 0; }
.auth-boks .fejl { margin-top: 16px; text-align: left; }

/* ---------- Forside (hub) ---------- */
.hilsen { margin: 8px 0 24px; }
.hilsen-dato { margin: 0 0 2px; color: var(--text-muted); font-size: 0.95rem; }
.hilsen h1 { font-size: 2rem; line-height: 1.15; }

.moduler { display: grid; gap: 12px; }
.modul {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    box-shadow: var(--shadow);
    transition: transform 0.12s;
}
a.modul:active { transform: scale(0.985); }
.modul-billede {
    width: 64px;
    height: 64px;
    border-radius: 14px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--accent-soft);
    display: grid;
    place-items: center;
}
.modul-billede img { width: 100%; height: 100%; object-fit: cover; }
.modul-emoji { font-size: 1.9rem; }
.modul-tekst { flex: 1; min-width: 0; }
.modul-tekst h2 { font-size: 1.15rem; }
.modul-tekst p { margin: 2px 0 0; color: var(--text-muted); font-size: 0.9rem; }
.modul-pil { color: var(--text-muted); margin-right: 4px; }
.modul-snart { opacity: 0.55; box-shadow: none; background: transparent; border-style: dashed; }
.modul-snart .modul-billede { background: var(--surface-2); }

/* ---------- Mad-dagbog: dag-navigation ---------- */
.dagnav {
    max-width: 640px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px 10px;
}
.dagnav-pil {
    width: 44px;
    height: 44px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text);
    flex-shrink: 0;
}
.dagnav-pil:active { background: var(--accent-soft); }
.dagnav-pil.deaktiveret { opacity: 0.3; }
.dagnav-dato {
    position: relative;
    flex: 1;
    text-align: center;
    margin: 0 !important;
    padding: 2px 8px;
    line-height: 1.25;
    cursor: pointer;
}
.dagnav-dato strong { display: block; font-family: 'Fraunces', Georgia, serif; font-size: 1.25rem; font-weight: 600; }
.dagnav-dato span { display: block; font-size: 0.85rem; color: var(--text-muted) !important; margin: 0 !important; font-weight: 400 !important; }
/* Usynlig dato-vælger lagt over teksten, så tryk åbner telefonens kalender. */
.dagnav-dato input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
}

.tilbage-idag {
    display: block;
    width: fit-content;
    margin: -4px auto 16px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-dark);
    font-size: 0.85rem;
    font-weight: 600;
}
@media (prefers-color-scheme: dark) { .tilbage-idag { color: var(--accent); } }

/* ---------- Mad-dagbog: feed ---------- */
.antal { margin: 0 0 12px; color: var(--text-muted); font-size: 0.9rem; text-align: center; }

.feed {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.post {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: none;
    border-radius: 14px;
    overflow: hidden;
    background: var(--surface-2);
    box-shadow: var(--shadow);
    cursor: pointer;
    aspect-ratio: 3 / 4;
    font: inherit;
    color: #fff;
    text-align: left;
}
.post img { width: 100%; height: 100%; object-fit: cover; }
.post-tid {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-size: 0.72rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}
.post-tekst {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 32px 10px 9px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.75), rgba(0, 0, 0, 0));
    font-size: 0.85rem;
    font-weight: 500;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.4);
}
/* Lange tekster afkortes til 2 linjer — hele teksten ses når man trykker. */
.post-tekst > span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tom {
    text-align: center;
    padding: 56px 24px;
    color: var(--text-muted);
}
.tom-emoji { font-size: 3rem; margin-bottom: 8px; }
.tom p { margin: 0; font-size: 1.05rem; color: var(--text); }
.tom .tom-hint { margin-top: 6px; font-size: 0.92rem; color: var(--text-muted); }

/* ---------- Plus-knap ---------- */
.fab {
    position: fixed;
    right: calc(20px + env(safe-area-inset-right));
    bottom: calc(24px + env(safe-area-inset-bottom));
    z-index: 30;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    background: var(--accent);
    color: #fff;
    box-shadow: 0 6px 20px color-mix(in srgb, var(--accent) 45%, transparent), 0 2px 6px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.12s;
    margin: 0 !important;
}
.fab:active { transform: scale(0.92); background: var(--accent-dark); }
@media (min-width: 700px) {
    .fab { right: calc(50% - 320px + 16px); }
}

/* ---------- Ark (bottom sheet) ---------- */
dialog.ark {
    border: none;
    padding: 0;
    margin: auto auto 0;
    width: 100%;
    max-width: 560px;
    max-height: 92dvh;
    background: var(--surface);
    color: var(--text);
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -8px 40px rgba(0, 0, 0, 0.25);
    overflow-y: auto;
}
dialog.ark[open] { animation: op 0.24s cubic-bezier(0.2, 0.8, 0.2, 1); }
dialog.ark::backdrop { background: rgba(20, 12, 8, 0.45); }
@keyframes op { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (min-width: 700px) {
    dialog.ark { margin: auto; border-radius: 22px; }
}

.ark-indhold {
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom));
}
.ark-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    margin-bottom: 8px;
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}
.ark-top strong { font-weight: 600; }
.tekst-knap {
    font: inherit;
    background: none;
    border: none;
    color: var(--accent);
    padding: 10px 4px;
    cursor: pointer;
    min-width: 72px;
    text-align: left;
}
.tekst-knap:last-child { text-align: right; }
.tekst-knap.fed { font-weight: 700; }
.tekst-knap:disabled { opacity: 0.5; }

.ark-billede {
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface-2);
    margin-bottom: 16px;
}
.ark-billede img {
    width: 100%;
    max-height: 42dvh;
    object-fit: contain;
    margin: 0 auto;
}

body.ark-aaben { overflow: hidden; }

/* =====================================================
   Penge
   ===================================================== */

/* Kategori-farver: faste pr. kategori (farven følger kategorien, aldrig
   rækkefølgen). 8 farvetoner + grå til "Andet". Valideret for farveblindhed. */
:root {
    --k-dagligvarer: #2a78d6;
    --k-fastfood:    #eb6834;
    --k-bolig:       #1baf7a;
    --k-abonnement:  #eda100;
    --k-toej:        #e87ba4;
    --k-teknologi:   #008300;
    --k-gave:        #4a3aa7;
    --k-date:        #e34948;
    --k-andet:       #8f877f;
    --madkort: #3f8f5a;
    --mitkort: #2a78d6;
}
@media (prefers-color-scheme: dark) {
    :root {
        --k-dagligvarer: #3987e5;
        --k-fastfood:    #d95926;
        --k-bolig:       #199e70;
        --k-abonnement:  #c98500;
        --k-toej:        #d55181;
        --k-teknologi:   #008300;
        --k-gave:        #9085e9;
        --k-date:        #e66767;
        --k-andet:       #8a8079;
        --madkort: #6cc28a;
        --mitkort: #3987e5;
    }
}

button.fab { border: none; font: inherit; }

.penge .kort { padding: 18px; }
.kort-hoved { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.kort-hoved h2 { margin: 0; }
.kort-hoved .tekst-knap { min-width: 0; text-align: right; padding-right: 0; }

/* Overblik */
.overblik { text-align: center; }
.overblik-label { margin: 0; color: var(--text-muted); font-size: 0.9rem; }
.overblik-total {
    margin: 2px 0 14px;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 2.6rem;
    font-weight: 600;
    line-height: 1.1;
    font-variant-numeric: tabular-nums;
}
.overblik-kort { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kort-chip {
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    text-align: left;
    border-left: 4px solid var(--c);
}
.kort-chip-madkort { --c: var(--madkort); }
.kort-chip-mitkort { --c: var(--mitkort); }
.kort-chip span { display: block; font-size: 0.8rem; color: var(--text-muted); }
.kort-chip strong { font-size: 1.05rem; font-variant-numeric: tabular-nums; }

/* Fordeling (donut + forklaring) */
.fordeling h2 { font-size: 1.1rem; margin-bottom: 12px; }
.fordeling-indhold { display: flex; align-items: center; gap: 18px; }
.donut-boks { position: relative; width: 128px; height: 128px; flex-shrink: 0; }
.donut { width: 100%; height: 100%; display: block; }
.donut circle { fill: none; stroke-width: 5; }
.donut-spor { stroke: var(--surface-2); }
.donut-midte {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    text-align: center;
    padding: 24px;
}
.donut-midte strong { font-size: 0.92rem; font-variant-numeric: tabular-nums; line-height: 1.2; }
.forklaring { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 0; display: grid; gap: 6px; }
.forklaring li {
    display: grid;
    grid-template-columns: 10px minmax(0, 1fr) auto;
    column-gap: 8px;
    align-items: center;
    font-size: 0.88rem;
}
.prik { width: 10px; height: 10px; border-radius: 50%; }
.forklaring-navn { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.forklaring-beloeb { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; }
.forklaring-pct { grid-column: 3; font-size: 0.75rem; color: var(--text-muted); text-align: right; line-height: 1; }
.fordeling-tom { margin: 0; color: var(--text-muted); font-size: 0.9rem; }

/* Mål */
.maal-liste { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 16px; }
.maal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-size: 0.92rem; }
.maal-navn { font-weight: 600; }
.maal-tal { font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.maal-tal span { color: var(--text-muted); font-weight: 400; }
.bar {
    position: relative;
    height: 10px;
    border-radius: 999px;
    background: var(--surface-2);
    margin: 6px 0 4px;
}
.bar-fyld { height: 100%; border-radius: 999px; min-width: 4px; }
.bar-tempo {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 2px;
    margin-left: -1px;
    background: var(--text);
    opacity: 0.55;
    border-radius: 1px;
}
.maal-status { margin: 0; font-size: 0.8rem; color: var(--text-muted); }
.maal-liste li.over .maal-status { color: var(--red); font-weight: 600; }
.maal-liste li.over .bar { box-shadow: 0 0 0 2px color-mix(in srgb, var(--red) 55%, transparent); }
.maal-liste li.advarsel .maal-status { color: var(--text); }
.maal-forklaring { margin: 14px 0 0; font-size: 0.75rem; color: var(--text-muted); }

/* Liste */
.sektion-titel { font-size: 1.2rem; margin: 26px 4px 4px; }
.dag-titel {
    display: flex;
    justify-content: space-between;
    margin: 16px 4px 6px;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.dag-sum { font-variant-numeric: tabular-nums; text-transform: none; letter-spacing: 0; }
.udgift-liste {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.udgift-liste li + li { border-top: 1px solid var(--border); }
.udgift {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 12px 14px;
    background: none;
    border: none;
    font: inherit;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}
.udgift:active { background: var(--surface-2); }
.udgift-ikon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: grid;
    place-items: center;
    font-size: 1.2rem;
    flex-shrink: 0;
    background: color-mix(in srgb, var(--c) 18%, transparent);
}
.udgift-tekst { flex: 1; min-width: 0; line-height: 1.3; }
.udgift-tekst strong { display: block; font-weight: 600; }
.udgift-tekst span {
    display: block;
    font-size: 0.82rem;
    color: var(--text-muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.udgift-beloeb { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Ark: beløb, kort-valg, kategorier */
.beloeb-felt {
    display: flex !important;
    align-items: baseline;
    justify-content: center;
    gap: 6px;
    margin: 4px 0 18px !important;
}
.beloeb-felt input {
    width: 100%;
    max-width: 240px;
    text-align: center;
    font-family: 'Fraunces', Georgia, serif;
    font-size: 2.6rem !important;
    font-weight: 600;
    padding: 6px 10px !important;
    background: transparent !important;
    border: none !important;
    border-bottom: 2px solid var(--border) !important;
    border-radius: 0 !important;
    font-variant-numeric: tabular-nums;
}
.beloeb-felt input:focus { border-bottom-color: var(--accent) !important; }
.beloeb-felt > span { font-size: 1.3rem !important; color: var(--text-muted); margin: 0 !important; }

.segment {
    display: grid;
    grid-template-columns: 1fr 1fr;
    background: var(--surface-2);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 18px;
}
.segment label { margin: 0 !important; }
.segment input { position: absolute; opacity: 0; pointer-events: none; }
.segment span {
    display: block !important;
    margin: 0 !important;
    text-align: center;
    padding: 9px 8px;
    border-radius: 9px;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    color: var(--text-muted);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}
.segment input:checked + span { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12); }
.segment input:focus-visible + span { outline: 2px solid var(--accent); }

.kategorier {
    border: none;
    padding: 0;
    margin: 0 0 16px;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
}
.kategorier legend {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
    padding: 0;
}
.kategorier label { margin: 0 !important; }
.kategorier input { position: absolute; opacity: 0; pointer-events: none; }
.kategorier label > span {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: 0 !important;
    padding: 10px 4px;
    border-radius: var(--radius-sm);
    background: var(--surface-2);
    border: 2px solid transparent;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    color: var(--text) !important;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.kat-emoji { font-size: 1.35rem; line-height: 1.2; }
.kategorier input:checked + span {
    border-color: var(--c);
    background: color-mix(in srgb, var(--c) 16%, var(--surface));
    font-weight: 600 !important;
}
.kategorier input:focus-visible + span { outline: 2px solid var(--accent); }

input[type="date"] {
    width: 100%;
    font: inherit;
    font-size: 16px;
    color: var(--text);
    background: var(--surface-2);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    min-height: 48px;
    -webkit-appearance: none;
    appearance: none;
}
.dagnav-dato input[type="date"], .dagnav-dato input[type="month"] { padding: 0; min-height: 0; }

/* Mål-ark */
.maal-input-liste { list-style: none; margin: 0 0 12px; padding: 0; }
.maal-input-liste li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
}
.maal-input-liste li + li { border-top: 1px solid var(--border); }
.maal-input-liste label { margin: 0 !important; font-weight: 500; }
.maal-input { display: flex; align-items: center; gap: 6px; }
.maal-input input { width: 110px !important; text-align: right; padding: 10px 12px !important; }
.maal-input span { color: var(--text-muted); font-size: 0.9rem; }

/* =====================================================
   Indstillinger: rækkefølge
   ===================================================== */
.gemt-status { font-size: 0.8rem; color: var(--text-muted); }
.orden-liste { list-style: none; margin: 4px 0 0; padding: 0; }
.orden-liste li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
    border-radius: var(--radius-sm);
}
.orden-liste li + li { border-top: 1px solid var(--border); }
.orden-liste li.flyttet { animation: flyttet 0.5s ease-out; }
@keyframes flyttet { from { background: var(--accent-soft); } to { background: transparent; } }
.orden-emoji { font-size: 1.3rem; width: 32px; text-align: center; }
.orden-navn { flex: 1; font-weight: 500; }
.orden-knap {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: var(--surface-2);
    color: var(--text);
    display: grid;
    place-items: center;
    cursor: pointer;
}
.orden-knap:active { background: var(--accent-soft); }
.orden-knap:disabled { opacity: 0.3; cursor: default; }

/* =====================================================
   Huskeliste
   ===================================================== */
.ny-ting {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}
.ny-ting input {
    flex: 1;
    background: var(--surface) !important;
    border: 1px solid var(--border) !important;
    box-shadow: var(--shadow);
    padding: 14px 16px !important;
}
.ny-ting input:focus { border-color: var(--accent) !important; }
.ny-ting button {
    width: 50px;
    flex-shrink: 0;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: #fff;
    display: grid;
    place-items: center;
    cursor: pointer;
}
.ny-ting button:active { background: var(--accent-dark); }

.huske-liste {
    list-style: none;
    margin: 0;
    padding: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
}
.huske-liste:empty { display: none; }
.huske-liste li + li { border-top: 1px solid var(--border); }
.huske-liste li.gemmer { opacity: 0.6; }
.punkt {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 16px;
    background: none;
    border: none;
    font: inherit;
    font-size: 1rem;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}
.punkt:active { background: var(--surface-2); }
.punkt-cirkel {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: grid;
    place-items: center;
    flex-shrink: 0;
    color: transparent;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.punkt-tekst { flex: 1; min-width: 0; overflow-wrap: anywhere; transition: color 0.15s; }
.punkt[aria-pressed="true"] .punkt-cirkel { background: var(--green); border-color: var(--green); color: #fff; }
.punkt[aria-pressed="true"] .punkt-tekst { color: var(--text-muted); text-decoration: line-through; }

.tom-liste { text-align: center; color: var(--text-muted); margin: 32px 0; }

.klaret { margin-top: 28px; }
.klaret-hoved { display: flex; justify-content: space-between; align-items: center; margin: 0 4px 6px; }
.klaret-hoved h2 {
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
}
.klaret-hoved .tekst-knap { min-width: 0; text-align: right; padding-right: 0; font-size: 0.9rem; }
.klaret-hoved .tekst-knap.bekraeft { color: var(--red); font-weight: 600; }
.klaret .huske-liste { box-shadow: none; }

@media (max-width: 360px) {
    .fordeling-indhold { flex-direction: column; align-items: stretch; }
    .donut-boks { margin: 0 auto; }
}
