/* Familiens madplan – farver og typografi som i skitsen. */
:root {
    --bg: #F4F6F1;
    --card: #FFFFFF;
    --text: #18261F;
    --text-2: #3D4A43;
    --muted: #55635B;
    --line: #E4E9E1;
    --line-strong: #CBD3C7;
    --accent: #2F6B4F;
    --accent-dark: #1F4A36;
    --accent-soft: #E3EFE6;
    --accent-text: #24563F;
    --warn: #8A3A12;
    --warn-soft: #F7E6DC;
    --new-soft: #FBEFD5;
    --new-text: #7A4B00;
    --fish-soft: #DCE9F5;
    --fish-text: #1D4F7A;
    --meat-soft: #F3E1E1;
    --meat-text: #7D2B2B;
    --radius: 18px;
    --display: 'Bricolage Grotesque', system-ui, sans-serif;
    --body: 'DM Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg: #111814;
        --card: #1B241F;
        --text: #E8EEE9;
        --text-2: #C9D3CC;
        --muted: #9AA89F;
        --line: #2A362F;
        --line-strong: #3B4A41;
        --accent: #5FA883;
        --accent-dark: #7CC19E;
        --accent-soft: #1F3A2C;
        --accent-text: #9AD4B4;
        --warn: #F0A27A;
        --warn-soft: #3A2419;
        --new-soft: #3A2E12;
        --new-text: #F2C46B;
        --fish-soft: #18304A;
        --fish-text: #9CC6EE;
        --meat-soft: #3A1E1E;
        --meat-text: #EFA8A8;
    }
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--body); font-size: 16px; -webkit-text-size-adjust: 100%; }
a { color: var(--accent); }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .55; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.app { min-height: 100vh; }
.content { max-width: 560px; margin: 0 auto; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.page { display: flex; flex-direction: column; gap: 14px; padding: calc(24px + env(safe-area-inset-top)) 16px 24px; }
.page.login { padding-top: 15vh; max-width: 420px; margin: 0 auto; }

.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.title { margin: 0; font-family: var(--display); font-size: 34px; line-height: 1.05; font-weight: 700; }
.h2 { margin: 0; font-size: 18px; font-weight: 600; }
.section { display: flex; flex-direction: column; gap: 8px; }
.section-title { margin: 6px 0 0; font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.row { display: flex; align-items: center; gap: 8px; }
.row-inline { display: flex; align-items: center; gap: 10px; font-size: 13px; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.row-gap { display: flex; gap: 10px; }
.align-end { align-items: flex-end; }
.align-start { align-items: flex-start; }
.ok { color: var(--accent-text); }
.warn { color: var(--warn); }
.loading { padding: 32px 0; text-align: center; color: var(--muted); }
.loading.boot { padding-top: 40vh; font-family: var(--body); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.card.list { padding: 0; }
.card.empty p { margin: 0 0 6px; }

/* Chips og mærker */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px; background: var(--card); border: 1px solid var(--line); font-size: 13px; font-weight: 500; color: var(--text-2); }
.chip-green { background: var(--accent-soft); border-color: transparent; color: var(--accent-text); font-weight: 600; }
.chip-warn { background: var(--warn-soft); border-color: transparent; color: var(--warn); font-weight: 600; }
.chip-button { min-height: 44px; font-weight: 600; color: var(--text); border-color: var(--line-strong); }
.chip-selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.chip-dashed { border-style: dashed; }
.chip-tall { flex-direction: column; align-items: flex-start; justify-content: center; gap: 0; }
.chip-tall small { font-size: 11px; font-weight: 500; }
.chip-x { display: inline-flex; border: 0; background: transparent; padding: 4px; margin: -4px -6px -4px 0; color: var(--muted); }
.tag { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.tag-veg { background: var(--accent-soft); color: var(--accent-text); }
.tag-fish { background: var(--fish-soft); color: var(--fish-text); }
.tag-chicken { background: var(--warn-soft); color: var(--warn); }
.tag-meat { background: var(--meat-soft); color: var(--meat-text); }
.tag-new { background: var(--new-soft); color: var(--new-text); }

/* Knapper og felter */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--card); font-weight: 600; font-size: 15px; text-decoration: none; color: var(--text); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost { background: transparent; }
.btn-danger { background: var(--warn); border-color: var(--warn); color: #fff; }
.btn-dashed { border-style: dashed; border-color: var(--accent); color: var(--accent); background: var(--card); }
.btn-small { min-height: 40px; padding: 0 12px; font-size: 13px; border-radius: 12px; }
.icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; background: transparent; color: var(--muted); border-radius: 12px; flex: none; }
.field { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 500; }
.field input, .input { height: 48px; padding: 0 14px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--card); font-size: 16px; }
.search { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--line-strong); color: var(--muted); }
.search input { flex: 1; border: 0; outline: none; background: transparent; font-size: 16px; color: var(--text); }
.select-small { height: 40px; padding: 0 8px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--card); font-size: 14px; }
.notice { padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); color: var(--warn); font-size: 14px; line-height: 1.4; }
.notice-ok { background: var(--accent-soft); color: var(--accent-text); }
.notice-warn { background: var(--warn-soft); color: var(--warn); }
.back { align-self: flex-start; min-height: 44px; display: inline-flex; align-items: center; gap: 4px; font-weight: 600; text-decoration: none; }
.link-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 52px; text-decoration: none; color: var(--text); font-weight: 600; }

/* Fremskridt */
.progress-block { display: flex; flex-direction: column; gap: 6px; }
.progress-text { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); }
.progress { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.progress .bar { height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }

/* Ugen */
.day { padding: 0; }
.day.today { border: 2px solid var(--accent); }
.day-head, .dish-head { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border: 0; background: transparent; text-align: left; border-radius: var(--radius); }
.dish-head { flex-direction: column; align-items: stretch; gap: 6px; padding: 0; }
.day-date { width: 40px; display: flex; flex-direction: column; align-items: center; }
.day-date span { font-size: 12px; font-weight: 600; text-transform: uppercase; color: var(--muted); }
.day-date strong { font-family: var(--display); font-size: 22px; }
.dish-name { font-size: 15px; font-weight: 600; line-height: 1.25; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; margin-top: 4px; font-size: 13px; color: var(--muted); }
.day-body { padding: 0 14px 14px; }
.card > .day-body { padding: 12px 0 0; }
.day > .day-body { padding: 0 14px 14px 68px; }
.recipe { font-size: 14px; line-height: 1.45; color: var(--text-2); }
.recipe p { margin: 0 0 8px; }
.recipe h3 { margin: 10px 0 4px; font-size: 13px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.ingredients { list-style: none; margin: 0; padding: 0; }
.ingredients li { display: flex; justify-content: space-between; gap: 12px; padding: 3px 0; border-bottom: 1px solid var(--line); }
.steps { margin: 0; padding-left: 20px; }
.steps li { margin-bottom: 4px; }
.banner { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--accent); color: #fff; text-decoration: none; }
.banner strong { display: block; font-size: 15px; }
.banner span { font-size: 13px; opacity: .85; }

/* Afstemning */
.daytabs { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.daytab { height: 56px; border-radius: 14px; border: 1px solid var(--line-strong); background: var(--card); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-weight: 600; font-size: 13px; }
.daytab small { font-size: 12px; font-weight: 600; color: var(--muted); }
.daytab.selected { background: var(--accent); border-color: var(--accent); color: #fff; }
.daytab.selected small { color: #fff; }
.option { display: flex; align-items: flex-start; gap: 12px; text-align: left; width: 100%; }
.option.chosen { border: 2px solid var(--accent); padding: 13px; }
.radio { flex: none; width: 22px; height: 22px; margin-top: 1px; border-radius: 50%; border: 2px solid var(--line-strong); }
.radio.on { border: 7px solid var(--accent); }

/* Indkøb */
.list-row { padding: 6px 8px; border-top: 1px solid var(--line); }
.list-row:first-child { border-top: 0; }
.card.list > .list-row.row-between, .card.list > .toggle-row { padding: 10px 14px; min-height: 60px; }
.list-row.moved { background: color-mix(in srgb, var(--bg) 60%, var(--card)); }
.check { flex: none; width: 44px; height: 44px; border: 0; background: transparent; display: flex; align-items: center; justify-content: center; }
.check span { width: 24px; height: 24px; border-radius: 7px; border: 2px solid var(--line-strong); background: var(--card); display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 15px; }
.check.bought span { background: var(--accent); border-color: var(--accent); }
.check.notneeded span, .check.movedbox span { background: var(--muted); border-color: var(--muted); }
.check:disabled { opacity: 1; }
.item-name { font-size: 15px; }
.item-name.struck { text-decoration: line-through; color: var(--muted); }
.moved-text { color: var(--new-text); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 6px 8px 52px; }
.price-input { width: 96px; height: 40px; padding: 0 10px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--card); text-align: right; font-size: 15px; }

/* Indstillinger */
.stepper { display: flex; align-items: center; gap: 4px; }
.stepper button { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); font-size: 20px; font-weight: 600; }
.stepper span { min-width: 56px; text-align: center; font-weight: 600; white-space: nowrap; }
.toggle-row { cursor: pointer; }
.toggle-row input { width: 24px; height: 24px; accent-color: var(--accent); flex: none; }

/* Brugere */
.people { display: grid; grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); gap: 8px; }
.person { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }
.person.selected { border: 2px solid var(--accent); }
.person strong { font-size: 13px; }
.person small { font-size: 11px; color: var(--muted); }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--warn-soft); color: var(--warn); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.avatar-admin { background: var(--accent-soft); color: var(--accent-text); }

/* Bundmenu */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-around; background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); z-index: 10; }
.tab { min-width: 60px; min-height: 48px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; font-weight: 500; color: var(--muted); text-decoration: none; }
.tab.active { color: var(--accent); font-weight: 600; }

.toast { position: fixed; left: 16px; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); max-width: 528px; margin: 0 auto; display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; border-radius: 14px; background: var(--text); color: var(--bg); font-size: 14px; z-index: 20; }
.toast span { flex: 1; }
.toast .icon-btn { color: var(--bg); }

#blazor-error-ui { display: none; position: fixed; bottom: 0; left: 0; right: 0; padding: 12px 16px; background: var(--warn-soft); color: var(--warn); z-index: 30; }
#blazor-error-ui .dismiss { float: right; cursor: pointer; }
