/* Nunito ligger på vores egen server (ikke Google Fonts), så besøgendes IP-adresse ikke sendes til Google. SIL OFL 1.1, se assets/fonts/OFL.txt */
@font-face { font-family: "Nunito"; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url("../fonts/nunito-latin.woff2") format("woff2-variations"), url("../fonts/nunito-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD; }
@font-face { font-family: "Nunito"; font-style: normal; font-display: swap; font-weight: 200 1000;
  src: url("../fonts/nunito-latin-ext.woff2") format("woff2-variations"), url("../fonts/nunito-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02AF,U+0304,U+0308,U+0329,U+1E00-1E9F,U+1EF2-1EFF,U+2020,U+20A0-20AB,U+20AD-20C0,U+2113,U+2C60-2C7F,U+A720-A7FF; }
/* ===================== pantreo ===================== */

:root {
  --bg: #f7f1e8;
  --bg2: #efe5d6;
  --card: #fffdf9;
  --ink: #1d2f33;
  --ink2: #4a5654;
  --muted: #6b6f69;
  --line: #ebe2d3;
  /* Navnene er historiske: "blue" er nu petroleumsblå (baggrunden fra musens app-ikon) */
  --blue: #0f6480;
  --blue-d: #0b4559;
  --blue-l: #e2eef0;
  /* Velkomstfelterne: fra creme til lys petroleum */
  --hero-a: #fcefe2;
  /* Spisekammeret: hylder med glas til højre, bordplade nederst */
  --scene: url("../img/bg/lys.webp");
  --scene-sm: url("../img/bg/lys-sm.webp");
  --hero-b: #d7e9ed;
  --btn: #0f6480;
  --btn-hover: #0b5268;
  /* Musens farver: koral fra ørerne, creme fra maven, salvie fra tørklædet */
  --coral: #e8897c;
  --coral-l: #fdecea;
  --cream: #fbf3ea;
  --sage: #9fb38a;
  --green: #22c55e;
  --green-l: #e7f8ee;
  --amber: #f59e0b;
  --amber-d: #b45309;
  --amber-l: #fff4dc;
  --red: #ef4444;
  --red-d: #dc2626;
  --red-l: #fde8e8;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(21,56,68, .04), 0 8px 24px rgba(41,110,133, .08);
  --sidebar: 248px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(1200px 400px at 70% -100px, #daf0f7 0%, transparent 70%),
    linear-gradient(180deg, var(--bg) 0%, #fcf9f5 100%);
  background-attachment: fixed;
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}
body.modal-open { overflow: hidden; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
h1 { font-size: 30px; font-weight: 900; letter-spacing: -.01em; }
h2 { font-size: 18px; font-weight: 800; }
h3 { font-size: 15px; font-weight: 800; margin: 18px 0 8px; }
p { margin: 0; }
.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 13px; margin-top: 6px; }
.hidden { display: none !important; }
.ico { flex: none; }
:focus-visible { outline: 3px solid #9eddf2; outline-offset: 2px; }

/* ---------- Boot ---------- */
.boot { min-height: 100vh; display: grid; place-items: center; }
.boot-logo { animation: boot-bob 1.4s ease-in-out infinite; }
@keyframes boot-bob { 50% { transform: translateY(-6px); } }
@media (prefers-reduced-motion: reduce) { .boot-logo { animation: none; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Layout ---------- */
.layout { min-height: 100vh; }
/* Hovedfladen fylder hele skærmen; indholdet centreres og stopper først på meget brede skærme */
.main { position: relative; margin-left: var(--sidebar); padding: 28px 32px 48px; }
#view { position: relative; z-index: 1; max-width: 1680px; margin: 0 auto; }
.top-scene {
  /* Følger billedets format (3:1), så hylderne og bordpladen ses helt; toner først ud nederst */
  position: absolute; left: 0; right: 0; top: 0; height: clamp(300px, calc((100vw - var(--sidebar)) / 3), 640px); z-index: 0; pointer-events: none;
  background: var(--scene) right bottom / cover no-repeat, var(--hero-a);
  -webkit-mask-image: linear-gradient(180deg, #000000 80%, transparent 100%);
  mask-image: linear-gradient(180deg, #000000 80%, transparent 100%);
  opacity: .9;
}
#view { outline: none; }

.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 40;
  display: flex; flex-direction: column; padding: 26px 16px 16px;
  color: #ffffff;
  background: linear-gradient(180deg, #0a4a5f 0%, #0d5870 55%, #11657e 100%);
  overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 30px; font-weight: 900; letter-spacing: -.02em; }
.sidebar .brand { padding: 0 10px; color: #ffffff; }
.brand-stack { flex-direction: column; gap: 4px; font-size: 34px; line-height: 1; padding: 0 !important; }
.brand-stack img { display: block; }
.sidebar .tagline { text-align: center; padding: 6px 0 0; }
.tagline { padding: 2px 12px 0; font-size: 14px; color: #d3ebf3; }
.side-nav { display: flex; flex-direction: column; gap: 4px; margin-top: 26px; }
.side-nav a, .side-nav button {
  display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px;
  font-weight: 700; font-size: 15px; color: #e8f5fa; background: none; border: 0; text-align: left;
}
.side-nav a:hover, .side-nav button:hover { background: rgba(255,255,255,.1); }
.side-nav a.active { background: #ffffff; color: var(--blue-d); box-shadow: 0 4px 14px rgba(0,0,0,.12); }
.side-user {
  margin-top: auto;
  display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 14px;
  background: rgba(255,255,255,.12);
}
.side-user-info { flex: 1; min-width: 0; line-height: 1.2; }
.side-user-info strong, .side-user-info small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user-info small { color: #d3ebf3; }
.side-user .icon-btn { color: #ffffff; }
.avatar {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: linear-gradient(135deg, #9eddf2, #6fcceb); color: #ffffff; font-weight: 900;
}
.avatar.sm { width: 32px; height: 32px; font-size: 14px; }
.scrim { display: none; }

.mobile-top, .bottom-nav, .mobile-only { display: none; }
.btn.mobile-only { display: none; }

/* ---------- Page header ---------- */
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 22px; flex-wrap: wrap; }
.page-head-text { min-width: 0; }
.page-head h1 { display: flex; align-items: center; gap: 8px; }
.page-head .muted { margin-top: 4px; font-size: 16px; }
.heart { color: var(--blue); display: inline-flex; }
.page-head-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.back-link { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-weight: 700; font-size: 14px; margin-bottom: 6px; }
.head-search {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px; width: 280px;
  background: var(--card); border-radius: 999px; box-shadow: var(--shadow); color: var(--muted);
}
.head-search input { border: 0; outline: 0; background: none; flex: 1; min-width: 0; font-size: 15px; color: var(--ink); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 44px; padding: 0 18px; border-radius: 12px; border: 0;
  font-weight: 800; font-size: 15px; white-space: nowrap; transition: background .15s, transform .1s, opacity .15s;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: default; }
.btn.busy { position: relative; color: transparent !important; }
.btn.busy::after {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%;
  border: 2.5px solid rgba(255,255,255,.5); border-top-color: #ffffff; animation: spin .8s linear infinite;
}
.btn-soft.busy::after, .btn-ghost.busy::after { border-color: #c5ebf8; border-top-color: var(--blue); }
/* Knapper har deres egen petroleumsfarve, så hvid tekst kan læses i begge temaer */
.btn-primary { background: var(--btn); color: #ffffff; box-shadow: 0 6px 16px rgba(15,100,128,.22); }
.btn-primary:hover { background: var(--btn-hover); }
.btn-soft { background: var(--blue-l); color: var(--blue-d); }
.btn-soft:hover { background: #def1f8; }
.btn-ghost { background: transparent; color: var(--ink2); }
.btn-ghost:hover { background: var(--blue-l); }
.btn-danger { background: var(--red-d); color: #ffffff; }
.btn-sm { height: 36px; padding: 0 12px; font-size: 14px; border-radius: 10px; }
.btn-block { width: 100%; }
.danger-text { color: var(--red-d) !important; }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 12px;
  border: 0; background: transparent; color: var(--ink2);
}
.icon-btn:hover { background: rgba(57,176,215, .08); }
.link, .link-btn { color: var(--blue); font-weight: 800; font-size: 14px; background: none; border: 0; padding: 0; }
.link-btn.inline { font-size: 12px; margin-left: 6px; }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.mr-auto { margin-right: auto; }

/* ---------- Cards ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; color: var(--ink); min-width: 0; }
.card-head h2 .ico { color: var(--blue); }
.card-head-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.h-ico { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; }
.h-ico.amber { background: var(--amber-l); color: var(--amber-d); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; align-items: start; }

/* ---------- Stat cards ---------- */
.stats4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.stat-card {
  display: flex; align-items: center; gap: 14px; padding: 18px 16px 18px 18px; border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow); transition: transform .15s;
}
.stat-card:hover { transform: translateY(-2px); }
.stat-card b { display: block; font-size: 30px; font-weight: 900; line-height: 1; }
.stat-card span { font-weight: 700; color: var(--ink2); }
.stat-card .chev { margin-left: auto; color: var(--muted); }
.stat-icon { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 14px; flex: none; }
.c-blue .stat-icon { background: var(--blue-l); }
.c-amber { background: linear-gradient(135deg, #fff8e8, #ffffff); }
.c-amber .stat-icon { background: var(--amber-l); }
.c-amber b { color: var(--amber-d); }
.c-red { background: linear-gradient(135deg, #fff0f0, #ffffff); }
.c-red .stat-icon { background: var(--red-l); }
.c-red b { color: var(--red-d); }

/* ---------- Lists ---------- */
.list { display: flex; flex-direction: column; gap: 8px; }
.item-row, .freezer-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px;
  border: 1px solid var(--line); background: #fefdfc; cursor: pointer; transition: border-color .15s, background .15s;
  min-width: 0;
}
.item-row:hover, .freezer-row:hover { border-color: #cde6ef; background: #fdfbf7; }
.item-row.hist { cursor: default; }
.item-info, .freezer-info { flex: 1; min-width: 0; }
.item-name { font-weight: 800; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere; line-height: 1.25; }
.item-tags { display: flex; flex-wrap: wrap; gap: 4px; margin: 2px 0; }
.item-tags .pill { margin-left: 0; }
.item-meta { display: flex; align-items: center; gap: 6px; font-size: 13.5px; font-weight: 700; color: var(--ink2); flex-wrap: wrap; }
.item-sub { font-size: 12.5px; color: var(--muted); }
.exp-fresh { color: #15803d; }
.exp-soon { color: var(--amber-d); }
.exp-expired { color: var(--red-d); }
.thumb {
  width: 46px; height: 46px; border-radius: 12px; flex: none; display: grid; place-items: center;
  font-size: 26px; background: var(--thumb, #e3ecef);
}
/* I lister: dæmpet flade, så statusstriben og datoen bærer farven - ikonet har allerede sine egne farver */
.thumb:not(.lg) { background: color-mix(in srgb, var(--thumb, #e3ecef) 30%, #fcf8f3); }
.thumb.lg { width: 64px; height: 64px; font-size: 36px; border-radius: 16px; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.dot-fresh { background: var(--green); }
.dot-soon { background: var(--amber); }
.dot-expired { background: var(--red); }
.chip {
  flex: none; font-size: 12.5px; font-weight: 700; padding: 4px 10px; border-radius: 999px;
  background: var(--blue-l); color: var(--blue-d); max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chev { color: var(--muted); display: inline-flex; flex: none; }
.quick {
  flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 1px;
  min-width: 40px; height: 36px; padding: 0 10px; border-radius: 10px; border: 1.5px solid #d3eaf1;
  background: #ffffff; color: var(--blue-d); font-weight: 800; font-size: 13px; white-space: nowrap;
}
.quick:hover { background: var(--green-l); border-color: #86efac; color: #15803d; }
.quick.busy { color: transparent; }
.st-expired { border-left: 4px solid var(--red); }
.st-soon { border-left: 4px solid var(--amber); }
.st-fresh { border-left: 4px solid var(--green); }
.pill { display: inline-block; font-size: 12px; font-weight: 800; padding: 3px 9px; border-radius: 999px; }
.pill-fresh { background: var(--green-l); color: #15803d; }
.pill-soon { background: var(--amber-l); color: var(--amber-d); }
.pill-expired, .pill-disposed { background: var(--red-l); color: var(--red-d); }
.pill-used { background: var(--green-l); color: #15803d; }
.more { display: inline-block; margin-top: 12px; }

/* Freezer rows */
.freezer-art { width: 54px; height: 54px; display: grid; place-items: center; border-radius: 12px; background: #fbf7f2; flex: none; }
.freezer-info strong { display: block; font-weight: 800; }
.freezer-info small { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 6px; color: var(--muted); font-weight: 700; }
.freezer-fill:empty { display: none; }
.freezer-fill { width: 38%; display: flex; align-items: center; gap: 10px; }
.freezer-fill small { font-weight: 700; color: var(--ink2); white-space: nowrap; font-size: 13px; }
.freezer-fill.wide { width: 100%; margin-top: 12px; }
.bar { flex: 1; height: 8px; background: #e9f2f5; border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; border-radius: 999px; }
.bar-ok { background: linear-gradient(90deg, #4ade80, #22c55e); }
.bar-mid { background: linear-gradient(90deg, #fcd34d, #f59e0b); }
.bar-high { background: linear-gradient(90deg, #f87171, #ef4444); }

/* Tabs */
.tabs { display: flex; gap: 4px; border-bottom: 2px solid var(--line); margin-bottom: 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs > * {
  flex: none; padding: 9px 14px; border: 0; background: none; font-weight: 800; color: var(--muted);
  border-bottom: 3px solid transparent; margin-bottom: -2px; white-space: nowrap;
}
.tabs > .on { color: var(--blue); border-bottom-color: var(--blue); }
.tabs small { font-weight: 700; opacity: .7; }
.inline-select {
  border: 0; background: var(--blue-l); color: var(--blue-d); font-weight: 800; font-size: 16px;
  border-radius: 10px; padding: 4px 8px; max-width: 180px;
}

/* Statistik */
.stat-body { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; justify-content: center; }
.donut-num { font-size: 26px; font-weight: 900; fill: var(--ink); font-family: Nunito, sans-serif; }
.donut-lbl { font-size: 12px; font-weight: 700; fill: var(--muted); font-family: Nunito, sans-serif; }
.legend { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; min-width: 170px; flex: 1; max-width: 260px; }
.legend li { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.legend b { margin-left: auto; }
.legend small { color: var(--muted); width: 28px; text-align: right; }
.period-line { margin-top: 14px; color: var(--ink2); font-size: 14px; text-align: center; }
.tip {
  display: flex; align-items: center; gap: 10px; margin-top: 14px; padding: 12px 14px; border-radius: 12px;
  background: #fff8e6; color: #7a5200; font-weight: 700; font-size: 14px;
}
.tip .ico { color: var(--amber); }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.kpi { padding: 14px; border-radius: 14px; background: #fdfbf7; }
.kpi b { display: block; font-size: 28px; font-weight: 900; }
.kpi span { color: var(--ink2); font-weight: 700; font-size: 14px; }
.kpi-red { background: #fff4f4; }
.kpi-red b { color: var(--red-d); }
.hbars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.hbars li { display: grid; grid-template-columns: 140px 1fr 30px; align-items: center; gap: 10px; font-weight: 700; font-size: 14px; }
.hb-track { height: 10px; background: #f9f4ec; border-radius: 999px; overflow: hidden; }
.hb-track span { display: block; height: 100%; background: linear-gradient(90deg, #6fcceb, #39b0d7); border-radius: 999px; }
.hbars b { text-align: right; }
.select-pill { height: 44px; padding: 0 14px; border-radius: 999px; border: 0; background: var(--card); box-shadow: var(--shadow); font-weight: 700; }

/* Frysere */
.freezer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.freezer-card { display: block; transition: transform .15s; }
.freezer-card:hover { transform: translateY(-2px); }
.freezer-card-top { display: flex; align-items: center; gap: 14px; }
.freezer-card-stats { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; font-weight: 700; color: var(--ink2); }
.zone-chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.zone-chips .chip { max-width: 100%; }
.freezer-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; flex-wrap: wrap; }
.freezer-hero-info { flex: 1; min-width: 180px; display: flex; flex-direction: column; gap: 6px; }

/* Søg */
.search-card { margin-bottom: 14px; }
.search-big {
  display: flex; align-items: center; gap: 10px; height: 52px; padding: 0 16px; border-radius: 14px;
  background: #fcf9f5; border: 1.5px solid var(--line); color: var(--muted);
}
.search-big:focus-within { border-color: #9eddf2; background: #ffffff; }
.search-big input { flex: 1; border: 0; outline: 0; background: none; font-size: 17px; color: var(--ink); min-width: 0; }
.chips-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 14px 0 4px; scrollbar-width: none; }
.chips-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: none; height: 36px; padding: 0 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #ffffff; font-weight: 700; font-size: 14px;
}
.cat-chip.on { background: var(--blue); border-color: var(--blue); color: #ffffff; }
.filters { margin-top: 10px; }
.filters summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; font-weight: 800; color: var(--blue); list-style: none; }
.filters summary::-webkit-details-marker { display: none; }
.filter-grid { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; margin-top: 12px; }
.filter-grid fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.filter-grid legend { font-weight: 800; font-size: 13px; color: var(--ink2); margin-bottom: 4px; }
.result-count { margin: 6px 4px 10px; color: var(--muted); font-weight: 700; }

/* ---------- Forms ---------- */
.stack { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span { font-weight: 800; font-size: 13.5px; color: var(--ink2); }
.field small { font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  height: 46px; padding: 0 14px; border-radius: 12px; border: 1.5px solid #dbeaef; background: #ffffff; font-size: 16px; width: 100%;
}
.field input[readonly] { background: #fcf8f3; color: var(--ink2); }
.field input:focus, .field select:focus { outline: 0; border-color: #6fcceb; box-shadow: 0 0 0 3px rgba(111,204,235, .2); }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: end; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 700; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--blue); }
.check.vac { height: 46px; }
.row-form { display: flex; align-items: flex-end; gap: 10px; margin-bottom: 10px; }
.grow { flex: 1; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.cat-opt input, .kind-opt input { position: absolute; opacity: 0; pointer-events: none; }
.cat-opt span, .kind-opt span {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 4px; border-radius: 12px;
  border: 1.5px solid var(--line); font-size: 24px; cursor: pointer; text-align: center; background: #ffffff;
}
.cat-opt small, .kind-opt small { font-size: 11.5px; font-weight: 800; color: var(--ink2); line-height: 1.15; }
.cat-opt input:checked + span, .kind-opt input:checked + span { border-color: var(--blue); background: var(--blue-l); box-shadow: 0 0 0 2px rgba(57,176,215,.15); }
.cat-opt input:focus-visible + span, .kind-opt input:focus-visible + span { outline: 3px solid #9eddf2; }
.kind-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.size-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.size-opt input { position: absolute; opacity: 0; pointer-events: none; }
.size-opt span {
  display: flex; flex-direction: column; gap: 2px; height: 100%; padding: 10px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #ffffff; cursor: pointer;
}
.size-opt b { font-size: 14px; }
.size-opt small { font-size: 11.5px; font-weight: 600; color: var(--muted); line-height: 1.25; }
.size-opt input:checked + span { border-color: var(--blue); background: var(--blue-l); box-shadow: 0 0 0 2px rgba(57,176,215,.15); }
.size-opt input:focus-visible + span { outline: 3px solid #9eddf2; }
.cap-custom { margin-top: 10px; }
/* Skjulte radioknapper bag valg-kortene må ikke fylde (ellers kan formularen rulle sidelæns) */
.cat-opt, .kind-opt, .size-opt { position: relative; min-width: 0; }
.cat-opt input, .kind-opt input, .size-opt input { width: 1px !important; height: 1px !important; padding: 0 !important; margin: 0; left: 0; top: 0; }
.quality-note { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; margin: 0 0 14px; border-radius: 12px; background: #fff4e5; color: #7a4100; font-size: 14px; line-height: 1.45; }
.quality-note.soft { background: #fcf8f3; color: var(--blue-d); }
.quality-note .ico { flex: none; margin-top: 1px; }
.safety-tip { margin: 0 0 14px; }
.name-field { position: relative; }
.suggest {
  position: absolute; left: 0; right: 0; top: 100%; z-index: 20; margin: 4px 0 0; padding: 6px; list-style: none;
  background: #ffffff; border: 1.5px solid #dbeaef; border-radius: 14px; box-shadow: 0 14px 30px rgba(21,56,68,.16);
  max-height: 320px; overflow-y: auto;
}
.suggest li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.suggest li:hover, .suggest li.on { background: var(--blue-l); }
.sugg-emoji { font-size: 22px; flex: none; }
.sugg-text { display: flex; flex-direction: column; min-width: 0; }
.sugg-text b { font-weight: 800; }
.sugg-text small { font-size: 12px; color: var(--muted); font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.owner-wrap .link-btn { display: inline-flex; align-items: center; gap: 6px; }
.zone-row { display: flex; gap: 6px; margin-bottom: 6px; }
.zone-row input[data-zone-name] { flex: 1; height: 42px; padding: 0 12px; border-radius: 10px; border: 1.5px solid #dbeaef; font-size: 16px; min-width: 0; }
.invite-box summary, .sub-details summary { cursor: pointer; font-weight: 800; color: var(--blue); font-size: 14px; }
.invite-box[open] summary, .sub-details[open] summary { margin-bottom: 10px; }
.sub-details { margin-top: 14px; }

/* Vis/skjul adgangskode */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 52px !important; }
.pw-toggle {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 42px; height: 38px; border: 0; border-radius: 10px; background: none;
  display: grid; place-items: center; color: var(--muted);
}
.pw-toggle:hover { background: var(--blue-l); color: var(--blue-d); }

/* Switch */
.switch { position: relative; width: 50px; height: 30px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #dbd6d1; transition: background .2s; cursor: pointer; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #ffffff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--blue); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 3px solid #9eddf2; }

/* Settings */
.settings { columns: 2; column-gap: 20px; }
.settings > .card { break-inside: avoid; margin-bottom: 20px; display: block; }
.settings h2 { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.settings h2 .ico { color: var(--blue); }
.setting-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 0; border-top: 1px solid var(--line); }
.setting-row:first-of-type { border-top: 0; padding-top: 0; }
.setting-row .muted { font-size: 14px; }
.members { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 10px; }
.members li { display: flex; align-items: center; gap: 10px; }
.share-badge {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 8px; padding: 2px 8px; border-radius: 999px;
  font-size: 11.5px; font-weight: 800; color: #6d28d9; background: #f1ebff; white-space: nowrap;
}
.freezer-card .share-badge, .freezer-hero .share-badge { margin: 6px 0 0; align-self: flex-start; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.freezer-info .share-badge { margin: 3px 0 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; display: inline-flex; }
.share-badge > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who {
  flex: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px 3px 3px; border-radius: 999px;
  background: var(--who-bg); color: var(--who-fg); font-size: 13px; font-weight: 800; max-width: 120px;
}
.who-dot {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; flex: none;
  background: var(--who-fg); color: #ffffff; font-size: 12px; font-weight: 900;
}
.who-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine-toggle { max-width: 320px; margin-bottom: 12px; }
.mine-toggle a { display: flex; align-items: center; justify-content: center; gap: 6px; height: 38px; border-radius: 9px; font-weight: 800; color: var(--muted); }
.mine-toggle a.on { background: #ffffff; color: var(--blue-d); box-shadow: 0 2px 6px rgba(21,56,68,.08); }
.mine-toggle small { font-weight: 700; opacity: .7; }
.shared-list { list-style: none; margin: 0 0 8px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.shared-list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 12px; border-radius: 12px; background: #fdfbf7; font-weight: 700; }
.shared-list li span { display: inline-flex; align-items: center; gap: 6px; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.compose-foot { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-top: 6px; }
.compose-foot .hint { margin-top: 2px; }
.compose-foot .btn { flex: none; }
.share-row:empty { display: none; }
.invite-email { margin-top: 14px; }
.field textarea { height: auto; min-height: 132px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid #dbeaef; background: #ffffff; font-size: 16px; width: 100%; resize: vertical; line-height: 1.4; }
.field textarea:focus { outline: 0; border-color: #6fcceb; box-shadow: 0 0 0 3px rgba(111,204,235, .2); }
.invite-banner { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 16px; border-radius: 14px; background: var(--blue-l); color: var(--blue-d); }
.invite-banner small { color: var(--ink2); }
.invite { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.invite code { font-size: 18px; font-weight: 900; letter-spacing: .12em; padding: 6px 14px; border-radius: 10px; background: var(--blue-l); color: var(--blue-d); }

/* ---------- Modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 100; background: rgba(21,56,68, .45); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .15s;
}
.modal {
  position: relative; width: 100%; max-width: 520px; max-height: calc(100vh - 40px); overflow-y: auto;
  background: #ffffff; border-radius: 22px; padding: 24px; box-shadow: 0 30px 60px rgba(21,56,68, .3);
  animation: pop .18s ease-out;
}
.modal-wide { max-width: 720px; }
.modal-x { position: absolute; right: 12px; top: 12px; }
.modal-title { font-size: 22px; font-weight: 900; margin-bottom: 10px; padding-right: 36px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { transform: translateY(10px) scale(.98); opacity: 0; } }
.sheet-head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.sheet-head .modal-title { margin-bottom: 6px; }
.details { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; margin: 0 0 18px; }
.details div { min-width: 0; }
.details .full { grid-column: 1 / -1; }
.details dt { font-size: 12.5px; font-weight: 800; color: var(--muted); }
.details dd { margin: 2px 0 0; font-weight: 700; overflow-wrap: anywhere; }
.action-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.action-grid .btn { min-width: 0; white-space: normal; line-height: 1.15; padding: 8px 10px; min-height: 48px; height: auto; text-align: center; }
.action-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.steps { padding-left: 20px; line-height: 1.9; }
.kbd { display: inline-block; padding: 0 6px; border-radius: 6px; background: var(--blue-l); }

/* ---------- Toast ---------- */
#toast-root { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; width: max-content; max-width: calc(100vw - 32px); }
.toast {
  display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-radius: 14px;
  background: #153844; color: #ffffff; font-weight: 700; box-shadow: 0 12px 30px rgba(0,0,0,.25); animation: pop .2s;
}
.toast-error { background: var(--red-d); }
.toast-undo { display: inline-flex; align-items: center; gap: 6px; border: 0; background: rgba(255,255,255,.15); color: #ffffff; font-weight: 800; padding: 6px 10px; border-radius: 10px; }

/* ---------- Empty ---------- */
.empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 18px 10px; text-align: center; color: var(--muted); font-weight: 700; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: linear-gradient(180deg, transparent 0, transparent 200px, var(--bg) 340px), var(--scene) right top / auto 340px no-repeat, var(--bg); }
.auth-card { width: 100%; max-width: 420px; background: #ffffff; border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }
.auth-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; margin-bottom: 18px; text-align: center; }
.brand-xl { display: flex; align-items: center; gap: 10px; font-size: 38px; font-weight: 900; color: var(--blue-d); }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #faf6ef; border-radius: 12px; padding: 4px; margin-bottom: 18px; }
.seg button { height: 40px; border: 0; background: none; border-radius: 9px; font-weight: 800; color: var(--muted); }
.seg button.on { background: #ffffff; color: var(--blue-d); box-shadow: 0 2px 6px rgba(21,56,68,.08); }
.auth-card .link-btn { align-self: center; }

/* ===================== Tablet ===================== */
@media (max-width: 1180px) {
  .main { padding: 24px 22px 40px; }
  .head-search { width: 220px; }
  .freezer-fill { width: 34%; }
}

/* ===================== Mobil ===================== */
@media (max-width: 899px) {
  :root { --radius: 16px; }
  .desktop-only { display: none !important; }
  .mobile-only { display: block; }
  .btn.mobile-only { display: inline-flex; }
  .main { margin-left: 0; padding: 0 14px calc(96px + var(--safe-b)); }
  h1 { font-size: 26px; }

  .sidebar { transform: translateX(-100%); transition: transform .25s ease; box-shadow: 0 0 40px rgba(0,0,0,.25); }
  body.drawer-open .sidebar { transform: none; }
  body.drawer-open .scrim { display: block; position: fixed; inset: 0; z-index: 39; background: rgba(21,56,68,.4); }

  .mobile-top {
    display: flex; align-items: center; justify-content: space-between; position: sticky; top: 0; z-index: 30;
    margin: 0 -14px 10px; padding: calc(10px + env(safe-area-inset-top, 0px)) 14px 10px;
    background: rgba(250,246,239, .9); backdrop-filter: blur(10px);
  }
  .mobile-top .brand { color: var(--blue-d); font-size: 26px; }
  .top-scene { display: none; }
  .mobile-top-actions { display: flex; gap: 2px; }

  .page-head { margin-bottom: 14px; }
  .page-head-actions { width: 100%; }
  .page-head-actions:empty { display: none; }

  .mobile-hero {
    display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 16px 0 20px;
    margin-bottom: 14px; border-radius: var(--radius); overflow: hidden;
    min-height: 96px;
    background: var(--scene-sm) right bottom / cover no-repeat, var(--hero-a);
  }
  .mobile-hero h1 { font-size: 22px; }
  .mobile-hero p { color: var(--blue-d); font-weight: 800; margin-top: 4px; }
  .mobile-hero .mascot { margin-bottom: -6px; }

  .stats4 { grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 14px; }
  .stat-card { padding: 12px; gap: 10px; }
  .stat-card b { font-size: 24px; }
  .stat-card span { font-size: 14px; }
  .stat-card .chev { display: none; }
  .stat-icon { width: 44px; height: 44px; }
  .stat-icon svg { width: 30px; height: 30px; }

  .grid2 { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .settings { columns: 1; }
  .settings > .card { margin-bottom: 14px; }
  .st-label, .dyn-label { display: none; }
  .item-row .quick { padding: 0 8px; font-size: 12.5px; }
  .item-row .item-sub { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .item-row { gap: 10px; }
  .freezer-info strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .freezer-fill { width: auto; flex: none; }
  .freezer-fill .bar { display: none; }
  .freezer-fill small { padding: 4px 10px; border-radius: 999px; background: var(--blue-l); color: var(--blue-d); }
  .freezer-fill.wide .bar { display: block; }
  .freezer-fill.wide small { background: none; padding: 0; }
  .card { padding: 16px; }
  .chip { max-width: 96px; }
  .item-row .chip { display: none; }
  .who { padding: 3px; }
  .who-name { display: none; }
  .mine-toggle { max-width: none; }
  .filter-grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(4, 1fr); gap: 6px; }
  .cat-opt span { font-size: 22px; padding: 6px 2px; }
  .cat-opt small { font-size: 10px; }
  .kind-grid { grid-template-columns: repeat(3, 1fr); }
  .size-grid { grid-template-columns: 1fr 1fr; }
  .hbars li { grid-template-columns: 110px 1fr 26px; }
  .freezer-hero .btn { width: 100%; }

  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { max-width: none; border-radius: 22px 22px 0 0; max-height: 92vh; padding: 22px 18px calc(22px + var(--safe-b)); animation: slideup .22s ease-out; }
  @keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
  .modal-actions .btn { flex: 1; }
  .modal-actions .mr-auto { flex: 0 0 auto; }

  .bottom-nav {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: end; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
    padding: 6px 6px calc(6px + var(--safe-b)); background: rgba(255,255,255,.96); backdrop-filter: blur(10px);
    box-shadow: 0 -4px 20px rgba(21,56,68,.08); border-radius: 20px 20px 0 0;
  }
  .bottom-nav a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; font-size: 11.5px; font-weight: 800; color: var(--muted); }
  .bottom-nav a.active { color: var(--blue); }
  .fab {
    justify-self: center; width: 58px; height: 58px; border-radius: 50%; border: 4px solid #ffffff; margin-top: -26px;
    background: linear-gradient(135deg, #1a7f9c, #0f6480); color: #ffffff; display: grid; place-items: center;
    box-shadow: 0 8px 20px rgba(15,100,128,.35);
  }
  #toast-root { bottom: calc(92px + var(--safe-b)); }
}

@media (max-width: 380px) {
  .freezer-fill small { display: none; }
  .two { grid-template-columns: 1fr; }
}

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

/* Egne varetyper */
.custom-type { margin-top: -4px; padding: 12px; border-radius: 12px; background: var(--bg, #fcf9f5); }
.custom-type .hint { margin: 6px 0 0; }
.type-list { list-style: none; padding: 0; margin: 0 0 8px; display: flex; flex-direction: column; gap: 6px; }
.type-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line, #e6eef1); }
.type-list .type-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.type-list .type-months { display: flex; align-items: center; gap: 6px; font-size: 14px; color: var(--muted, #867869); }
.type-list .type-months input { width: 64px; padding: 6px 8px; }
.mods { display: flex; flex-wrap: wrap; gap: 4px 20px; margin-top: -6px; }
.mods .check.vac { height: 36px; }
.mods .check small { font-weight: 500; color: var(--muted); }
.type-list .type-months input { border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--ink); font: inherit; }

/* ---------- Badges i navigationen ---------- */
.nav-badge {
  min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--red); color: #ffffff;
  font-size: 11.5px; font-weight: 800; display: inline-grid; place-items: center; line-height: 1;
}
.side-nav .nav-badge { margin-left: auto; }
.bottom-nav a { position: relative; }
.bottom-nav .nav-badge { position: absolute; top: 2px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: 10.5px; padding: 0 5px; }
.nav-badge.hidden { display: none; }

.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Foto ---------- */
.thumb.photo { overflow: hidden; padding: 0; }
.thumb.photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sheet-photo { display: block; width: 100%; max-height: 260px; object-fit: cover; border-radius: 14px; margin: 0 0 14px; background: var(--bg2); }
.photo-pick { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.photo-pick .btn { position: relative; cursor: pointer; }
.photo-preview { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; background: var(--bg2); }

/* ---------- Scanner ---------- */
.scan-view { width: 100%; min-height: 220px; border-radius: 16px; overflow: hidden; background: #153844; display: grid; place-items: center; margin: 4px 0 16px; }
.scan-view video { width: 100% !important; display: block; object-fit: cover; }
.scan-wait { color: #e8f5fa; text-align: center; padding: 24px; font-weight: 700; max-width: 360px; }
.name-label { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.barcode-note { display: flex; align-items: center; gap: 6px; margin: -4px 0 0; }

/* ---------- Etiketter ---------- */
.label-pick-head { display: flex; justify-content: space-between; align-items: center; font-weight: 700; }
.label-pick { max-height: 260px; overflow: auto; display: flex; flex-direction: column; gap: 4px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; }
.label-pick .check { font-weight: 600; }
#print-root { display: none; }
@media print {
  html, body { background: #ffffff !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: grid !important; }
  #print-root.print-a4 { grid-template-columns: repeat(3, 70mm); grid-auto-rows: 37mm; padding: 0; }
  #print-root.print-roll { display: block !important; }
  .print-roll .label { width: 62mm; height: 29mm; padding: 2mm 2.5mm; break-after: page; page-break-after: always; }
  .print-a4 .label:nth-child(24n) { break-after: page; page-break-after: always; }
  .label { box-sizing: border-box; padding: 3mm 3.5mm; display: flex; gap: 2.5mm; align-items: center; overflow: hidden; color: #000000; font-family: Nunito, Arial, sans-serif; break-inside: avoid; }
  .label-qr { flex: none; width: 25mm; height: 25mm; }
  .print-roll .label-qr { width: 23mm; height: 23mm; }
  .label-qr svg { width: 100%; height: 100%; display: block; }
  .label-text { display: flex; flex-direction: column; min-width: 0; font-size: 8.5pt; line-height: 1.25; }
  .label-text b { font-size: 11pt; line-height: 1.15; margin-bottom: 1mm; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .label-text small { font-size: 7pt; color: #333333; margin-top: .6mm; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}

/* ---------- Indkøbsliste ---------- */
.shop-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.sub-h { font-size: 14px; color: var(--muted); margin: 4px 0 6px; }
.shop-list { list-style: none; padding: 0; margin: 0 0 12px; display: flex; flex-direction: column; }
.shop-list li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.shop-list li:last-child { border-bottom: 0; }
.shop-list .grow { flex: 1; min-width: 0; }
.shop-list .grow small { display: block; }
.shop-list li.done span { text-decoration: line-through; color: var(--muted); }
.shop-list .check { font-weight: 600; }
.shop-ico { font-size: 24px; flex: none; }
.stock-miss { background: var(--amber-l); border-radius: 12px; padding: 10px 12px !important; margin-bottom: 6px; border-bottom: 0 !important; }
.shop-add { margin: 6px 0 4px; }
.rule-list .type-months input { width: 58px; }

/* ---------- Hvad skal vi spise? ---------- */
.meal-hero { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; background: linear-gradient(135deg, #ffffff, var(--blue-l)); }
.meal-hero h2 { margin: 2px 0 4px; font-size: 22px; }
.meal-hero p { margin: 0; }
.meal-hero .grow { flex: 1; min-width: 0; }
.meal-hero-ico { font-size: 46px; flex: none; }
.meal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.meal-card { display: flex; flex-direction: column; gap: 10px; margin: 0; }
.meal-top { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.meal-top .grow { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip.idea { max-width: none; background: #ffffff; border: 1px solid var(--line); color: var(--ink); }
.chip.idea:hover { border-color: var(--blue); color: var(--blue-d); }
.hint.center { text-align: center; margin-top: 16px; }

@media (max-width: 899px) {
  .shop-grid { grid-template-columns: 1fr; }
  .meal-hero { flex-direction: column; align-items: flex-start; }
  .meal-hero .btn { width: 100%; justify-content: center; }
}

/* Producent, økologi og fedt */
.product-details { border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
.product-details summary { cursor: pointer; font-weight: 800; color: var(--ink2); }
.product-details[open] summary { margin-bottom: 10px; }
.product-details .hint { margin: 6px 0 0; }
.eco { color: #15803d; font-weight: 700; }

/* ---------- Tilbagekaldelser ---------- */
.pill-recall { background: var(--red); color: #ffffff; font-size: 11.5px; vertical-align: 2px; margin-left: 4px; white-space: nowrap; }
.pill-recall.maybe { background: var(--amber); color: #3b2300; }
.item-row.recalled { box-shadow: inset 4px 0 0 var(--red); }
.recall-banner { background: var(--red-l); border: 1px solid #fca5a5; margin-bottom: 18px; }
.recall-banner h2 { color: var(--red-d); font-size: 18px; margin: 0 0 8px; }
.recall-banner ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.recall-banner .link-btn { font-weight: 800; color: var(--red-d); text-decoration: underline; margin-right: 6px; }
.recall-box { border-radius: 14px; padding: 12px 14px; margin: 0 0 14px; background: var(--red-l); color: #7f1d1d; border: 1px solid #fca5a5; }
.recall-box.maybe { background: var(--amber-l); color: #7a4100; border-color: #fcd34d; }
.recall-box p { margin: 4px 0; font-weight: 700; }
.recall-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.recall-btn { background: var(--red-d); color: #ffffff; }
.recall-latest { padding-left: 18px; margin: 0 0 12px; display: flex; flex-direction: column; gap: 6px; font-size: 14px; }

/* ---------- Indstillinger: faner ---------- */
.settings-tabs { grid-template-columns: repeat(5, 1fr); max-width: 760px; }
.settings-tabs button { font-size: 14.5px; padding: 0 6px; }
.settings[data-active="husstand"] > [data-tab]:not([data-tab="husstand"]),
.settings[data-active="varer"] > [data-tab]:not([data-tab="varer"]),
.settings[data-active="beskeder"] > [data-tab]:not([data-tab="beskeder"]),
.settings[data-active="konto"] > [data-tab]:not([data-tab="konto"]) { display: none; }
.settings[data-active="husstand"], .settings[data-active="beskeder"] { columns: 1; max-width: 760px; }
.members li .grow { flex: 1; min-width: 0; }
.members li .grow small { overflow-wrap: anywhere; }
.split-list { display: flex; flex-direction: column; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 12px; }
.split-list .check, .keep-field .check { font-weight: 600; align-items: flex-start; }
.split-list .check input, .keep-field .check input { margin-top: 2px; flex: none; }
.btn.danger-bg { background: var(--red-d); box-shadow: none; }
@media (max-width: 899px) { .settings-tabs button { font-size: 13px; } }
.settings p.muted { font-size: 14.5px; line-height: 1.5; }
.recall-status p { margin: 8px 0; }
.recall-status h3 { font-size: 15px; margin: 12px 0 6px; }
.suggest-host { position: relative; }

/* ---------- Madplan ---------- */
.pill-plan { background: var(--blue-l); color: var(--blue-d); font-size: 11.5px; vertical-align: 2px; margin-left: 4px; white-space: nowrap; }
.pill-plan.late { background: var(--amber-l); color: var(--amber-d); }
.plan-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; margin-bottom: 14px; }
.plan-day { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer; }
.plan-day small { color: var(--muted); }
.plan-day.on, .plan-day:hover { border-color: var(--blue); background: var(--blue-l); }
/* auto-fit: de 7 dage strækkes til fuld bredde i stedet for at efterlade tomme kolonner */
.plan-week { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 18px; }
.plan-col { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.plan-col header { display: flex; justify-content: space-between; align-items: baseline; }
.plan-col header small { color: var(--muted); }
.plan-col.today { box-shadow: inset 0 0 0 2px var(--blue), var(--shadow); }
.plan-col .btn { align-self: flex-start; margin-top: auto; }
.plan-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.plan-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.plan-list .link-btn { font-weight: 700; color: var(--ink); text-align: left; }
.plan-list .icon-btn, .plan-list .btn { margin-left: auto; }
.plan-col .plan-list li { flex-wrap: nowrap; gap: 4px; }
.meal-title { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; background: none; border: 0; padding: 2px 0; font: inherit; font-size: 17px; font-weight: 800; color: var(--ink); cursor: pointer; }
.meal-title span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.meal-title svg { flex: none; color: var(--muted); }
.meal-title.empty { font-size: 14px; font-weight: 700; color: var(--blue-d); }
.pl-place { font-weight: 500; color: var(--muted); }
.meal-title-form { align-items: flex-end; }
.is-meal { font-weight: 800; }
.plan-col .meal-title { flex-direction: row; justify-content: flex-start; align-self: stretch; margin: 0; }
.meal-title.empty span { flex: 1; }
.plan-col .plan-list .link-btn { flex: 1; min-width: 0; display: flex; align-items: flex-start; gap: 6px; }
.plan-col .plan-list .link-btn svg, .plan-col .plan-list .link-btn img { flex: none; margin-top: 2px; }
.plan-col .plan-list .icon-btn { flex: none; width: 26px; height: 26px; }
.plan-col .pl-name { min-width: 0; overflow-wrap: break-word; }
/* Ugen fylder hele bredden: 4 + 3 på mellemstore skærme, hele ugen på én række på brede (aldrig 6 + 1) */
@media (min-width: 900px) { .plan-week { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 900px) and (max-width: 1199px) { .plan-col .plan-list .link-btn .ico { display: none; } }
@media (min-width: 1700px) { .plan-week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 12px; } .plan-col { padding: 16px; } }
.plan-late { background: var(--amber-l); }
.plan-pick { max-height: 55vh; overflow: auto; }
/* Dagsknapper med et kig ind i madplanen */
.plan-days.with-plan { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.plan-days.with-plan .plan-day { align-items: stretch; text-align: left; gap: 4px; padding: 10px 12px; min-height: 74px; }
.pd-head { display: flex; justify-content: space-between; align-items: baseline; gap: 6px; }
.pd-plan { display: flex; flex-direction: column; gap: 1px; font-size: 13px; min-width: 0; }
.pd-plan span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pd-plan .is-recipe, .week-day .is-recipe { color: var(--blue-d); font-weight: 700; }
.pd-plan svg, .week-day svg { vertical-align: -2px; margin-right: 3px; }
@media (max-width: 480px) { .plan-days.with-plan { grid-template-columns: 1fr 1fr; } }
/* Opskrifter til en vare og "kan laves nu" */
.meal-recipes, .can-make-list { display: flex; flex-direction: column; gap: 8px; }
.meal-recipe { display: flex; align-items: center; gap: 8px; min-width: 0; }
.meal-recipe .recipe-row { flex: 1; }
.meal-recipe > .btn { flex: none; min-width: 140px; justify-content: center; }
@media (max-width: 560px) { .meal-recipe { flex-direction: column; align-items: stretch; } }
.plan-recipe-hint { border: 0; background: var(--blue-l); color: var(--blue-d); font: inherit; font-size: 12.5px; font-weight: 700; border-radius: 999px; padding: 2px 8px; cursor: pointer; max-width: 45%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: none; }
.chip.own-recipe { background: var(--blue-l); border-color: transparent; color: var(--blue-d); font-weight: 700; cursor: pointer; font: inherit; font-size: inherit; }
.hero-recipe { margin-top: 8px !important; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.hero-recipe .link-btn { font-weight: 800; }
/* Ugens madplan på "Hvad skal vi spise?" */
.week-strip { margin-bottom: 18px; }
.week-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; }
.week-day { display: flex; flex-direction: column; gap: 2px; min-width: 0; text-align: left; padding: 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-size: 13px; cursor: pointer; }
.week-day b { font-size: 13.5px; }
.week-day span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-day small { color: var(--muted); }
.week-day.today { border-color: var(--blue); }
.week-day.empty { background: transparent; border-style: dashed; }
.week-day:hover { border-color: var(--blue); background: var(--blue-l); }
@media (max-width: 899px) { .week-days { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 4px; } .week-day { flex: 0 0 118px; scroll-snap-align: start; } }
.can-make { margin-bottom: 18px; }
.plan-pick-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px; border: 0; border-radius: 12px; background: none; text-align: left; cursor: pointer; color: var(--ink); }
.plan-pick-row:hover { background: var(--blue-l); }
.plan-pick-row .grow { display: flex; flex-direction: column; min-width: 0; }
.plan-pick-row[hidden] { display: none; }
.meal-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: auto; }
.portions-row { align-items: end; }
.portions-hint { margin: 0 0 12px; }

/* ---------- Gennemgang ---------- */
.review-nudge { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--blue-l); }
.review-nudge p { font-size: 14px; }
.review-nudge p { margin: 2px 0 0; }
.review-nudge .grow { flex: 1; min-width: 0; }
.review-ico { color: var(--blue); flex: none; }
.review-group { border: 1px solid var(--line); border-radius: 14px; padding: 6px 12px 10px; margin: 0; }
.review-group legend { font-weight: 800; padding: 0 6px; color: var(--ink2); }
.review-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.review-row:last-child { border-bottom: 0; }
.review-row .grow { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.review-row small { color: var(--muted); }
.review-row input { width: 22px; height: 22px; accent-color: var(--red-d); flex: none; }
.review-tag { font-size: 12px; font-weight: 800; color: var(--muted); }
.review-row:has(input:checked) b { text-decoration: line-through; color: var(--muted); }
.review-row:has(input:checked) .review-tag { color: var(--red-d); }
@media (max-width: 899px) { .plan-week { grid-template-columns: 1fr; } }

/* =====================================================================
   Mørkt tema – følger telefonens indstilling (eller valget under Indstillinger)
   ===================================================================== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #171513; --bg2: #1f1c18; --card: #24211d; --ink: #f1ebe2; --ink2: #cfc6b9; --muted: #a39a8d; --line: #37322b;
    --blue: #5fb6cf; --blue-d: #8fd0e2; --blue-l: #1d3a42; --green-l: #1d3322; --amber-l: #3a2a0c; --amber-d: #fbbf24;
    --red-l: #3d1717; --red-d: #f87171; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
    --coral: #f0a196; --coral-l: #3a2422; --cream: #2a2520; --sage: #9fb38a; --btn: #1a7f9c; --btn-hover: #2190b0; --hero-a: #2b2621; --hero-b: #173a44; --scene: url("../img/bg/moerk.webp"); --scene-sm: url("../img/bg/moerk-sm.webp");
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #171513; --bg2: #1f1c18; --card: #24211d; --ink: #f1ebe2; --ink2: #cfc6b9; --muted: #a39a8d; --line: #37322b;
  --blue: #5fb6cf; --blue-d: #8fd0e2; --blue-l: #1d3a42; --green-l: #1d3322; --amber-l: #3a2a0c; --amber-d: #fbbf24;
  --red-l: #3d1717; --red-d: #f87171; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  --coral: #f0a196; --coral-l: #3a2422; --cream: #2a2520; --sage: #9fb38a; --btn: #1a7f9c; --btn-hover: #2190b0; --hero-a: #2b2621; --hero-b: #173a44; --scene: url("../img/bg/moerk.webp"); --scene-sm: url("../img/bg/moerk-sm.webp");
  color-scheme: dark;
}
/* Fælles regler for mørkt tema (aktiv når color-scheme er dark) */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) body { --dark: 1; } }
:root[data-theme="dark"] body { --dark: 1; }

/* Komponenter i mørkt tema (genereret: samme regler for automatisk og valgt mørkt tema) */
:root[data-theme="dark"] body { background: linear-gradient(180deg, var(--bg) 0%, #25201a 100%);}
:root[data-theme="dark"] .top-scene { opacity: .9;}
:root[data-theme="dark"] .side-nav a.active { background: var(--blue-l); color: #ffffff;}
:root[data-theme="dark"] .btn-soft:hover { background: #4f4539;}
:root[data-theme="dark"] .c-amber { background: linear-gradient(135deg, #2a2210, var(--card));}
:root[data-theme="dark"] .c-red { background: linear-gradient(135deg, #2e1616, var(--card));}
:root[data-theme="dark"] .item-row, :root[data-theme="dark"] .freezer-row { background: #29241e;}
:root[data-theme="dark"] .item-row:hover, :root[data-theme="dark"] .freezer-row:hover { background: #342e26; border-color: #594d40;}
:root[data-theme="dark"] .freezer-art { background: #3a332a;}
:root[data-theme="dark"] .bar, :root[data-theme="dark"] .hb-track { background: #443b31;}
:root[data-theme="dark"] .tip { background: #2a2210; color: #fcd9a0;}
:root[data-theme="dark"] .kpi { background: #342e26;}
:root[data-theme="dark"] .kpi-red { background: #2e1616;}
:root[data-theme="dark"] .search-big { background: #29241e;}
:root[data-theme="dark"] .search-big:focus-within { background: var(--card);}
:root[data-theme="dark"] .field input, :root[data-theme="dark"] .field select, :root[data-theme="dark"] .field textarea, :root[data-theme="dark"] .zone-row input[data-zone-name] { background: #26211c; border-color: #54493d; color: var(--ink);}
:root[data-theme="dark"] .field input[readonly] { background: #312a23; color: var(--ink2);}
:root[data-theme="dark"] .cat-opt span, :root[data-theme="dark"] .size-opt span, :root[data-theme="dark"] .chips-scroll a, :root[data-theme="dark"] .chip.idea, :root[data-theme="dark"] .plan-day { background: #29241e; color: var(--ink);}
:root[data-theme="dark"] .quality-note { background: #2a2210; color: #fcd9a0;}
:root[data-theme="dark"] .quality-note.soft { background: #3c352c; color: #c5ebf8;}
:root[data-theme="dark"] .suggest { background: var(--card); border-color: #54493d;}
:root[data-theme="dark"] .switch span::after { background: #e8f3f6;}
:root[data-theme="dark"] .who { background: #3f372e; color: #bce7f6;}
:root[data-theme="dark"] .mine-toggle a.on, :root[data-theme="dark"] .seg button.on { background: var(--card); color: var(--blue-d);}
:root[data-theme="dark"] .seg { background: #26211c;}
:root[data-theme="dark"] .modal, :root[data-theme="dark"] .auth-card { background: var(--card);}
:root[data-theme="dark"] .mobile-top { background: rgba(14,28,34, .9);}
:root[data-theme="dark"] .bottom-nav { background: rgba(23,46,54, .97);}
:root[data-theme="dark"] .fab { border-color: var(--card);}
:root[data-theme="dark"] .toast { background: #e8f3f6; color: #1d1915;}
:root[data-theme="dark"] .toast-error { background: #b91c1c; color: #ffffff;}
:root[data-theme="dark"] .pill-fresh { color: #4ade80;}
:root[data-theme="dark"] .exp-fresh { color: #4ade80;}
:root[data-theme="dark"] .meal-hero { background: linear-gradient(135deg, var(--card), var(--blue-l));}
:root[data-theme="dark"] .recall-box { color: #fecaca; border-color: #7f1d1d;}
:root[data-theme="dark"] .recall-box.maybe { color: #fde68a; border-color: #78350f;}
:root[data-theme="dark"] .recall-banner { border-color: #7f1d1d;}
:root[data-theme="dark"] .stock-miss { background: #2a2210;}
:root[data-theme="dark"] .custom-type { background: #26211c;}
:root[data-theme="dark"] .thumb { filter: saturate(.85) brightness(.9);}
:root[data-theme="dark"] .thumb:not(.lg) { background: color-mix(in srgb, var(--thumb, #e3ecef) 30%, #d6d0ca); filter: brightness(.88);}
:root[data-theme="dark"] .avatar { background: var(--blue-l); color: var(--blue-d);}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body { background: linear-gradient(180deg, var(--bg) 0%, #25201a 100%);}
  :root:not([data-theme="light"]) .top-scene { opacity: .9;}
  :root:not([data-theme="light"]) .side-nav a.active { background: var(--blue-l); color: #ffffff;}
  :root:not([data-theme="light"]) .btn-soft:hover { background: #4f4539;}
  :root:not([data-theme="light"]) .c-amber { background: linear-gradient(135deg, #2a2210, var(--card));}
  :root:not([data-theme="light"]) .c-red { background: linear-gradient(135deg, #2e1616, var(--card));}
  :root:not([data-theme="light"]) .item-row, :root:not([data-theme="light"]) .freezer-row { background: #29241e;}
  :root:not([data-theme="light"]) .item-row:hover, :root:not([data-theme="light"]) .freezer-row:hover { background: #342e26; border-color: #594d40;}
  :root:not([data-theme="light"]) .freezer-art { background: #3a332a;}
  :root:not([data-theme="light"]) .bar, :root:not([data-theme="light"]) .hb-track { background: #443b31;}
  :root:not([data-theme="light"]) .tip { background: #2a2210; color: #fcd9a0;}
  :root:not([data-theme="light"]) .kpi { background: #342e26;}
  :root:not([data-theme="light"]) .kpi-red { background: #2e1616;}
  :root:not([data-theme="light"]) .search-big { background: #29241e;}
  :root:not([data-theme="light"]) .search-big:focus-within { background: var(--card);}
  :root:not([data-theme="light"]) .field input, :root:not([data-theme="light"]) .field select, :root:not([data-theme="light"]) .field textarea, :root:not([data-theme="light"]) .zone-row input[data-zone-name] { background: #26211c; border-color: #54493d; color: var(--ink);}
  :root:not([data-theme="light"]) .field input[readonly] { background: #312a23; color: var(--ink2);}
  :root:not([data-theme="light"]) .cat-opt span, :root:not([data-theme="light"]) .size-opt span, :root:not([data-theme="light"]) .chips-scroll a, :root:not([data-theme="light"]) .chip.idea, :root:not([data-theme="light"]) .plan-day { background: #29241e; color: var(--ink);}
  :root:not([data-theme="light"]) .quality-note { background: #2a2210; color: #fcd9a0;}
  :root:not([data-theme="light"]) .quality-note.soft { background: #3c352c; color: #c5ebf8;}
  :root:not([data-theme="light"]) .suggest { background: var(--card); border-color: #54493d;}
  :root:not([data-theme="light"]) .switch span::after { background: #e8f3f6;}
  :root:not([data-theme="light"]) .who { background: #3f372e; color: #bce7f6;}
  :root:not([data-theme="light"]) .mine-toggle a.on, :root:not([data-theme="light"]) .seg button.on { background: var(--card); color: var(--blue-d);}
  :root:not([data-theme="light"]) .seg { background: #26211c;}
  :root:not([data-theme="light"]) .modal, :root:not([data-theme="light"]) .auth-card { background: var(--card);}
  :root:not([data-theme="light"]) .mobile-top { background: rgba(14,28,34, .9);}
  :root:not([data-theme="light"]) .bottom-nav { background: rgba(23,46,54, .97);}
  :root:not([data-theme="light"]) .fab { border-color: var(--card);}
  :root:not([data-theme="light"]) .toast { background: #e8f3f6; color: #1d1915;}
  :root:not([data-theme="light"]) .toast-error { background: #b91c1c; color: #ffffff;}
  :root:not([data-theme="light"]) .pill-fresh { color: #4ade80;}
  :root:not([data-theme="light"]) .exp-fresh { color: #4ade80;}
  :root:not([data-theme="light"]) .meal-hero { background: linear-gradient(135deg, var(--card), var(--blue-l));}
  :root:not([data-theme="light"]) .recall-box { color: #fecaca; border-color: #7f1d1d;}
  :root:not([data-theme="light"]) .recall-box.maybe { color: #fde68a; border-color: #78350f;}
  :root:not([data-theme="light"]) .recall-banner { border-color: #7f1d1d;}
  :root:not([data-theme="light"]) .stock-miss { background: #2a2210;}
  :root:not([data-theme="light"]) .custom-type { background: #26211c;}
  :root:not([data-theme="light"]) .thumb { filter: saturate(.85) brightness(.9);}
  :root:not([data-theme="light"]) .thumb:not(.lg) { background: color-mix(in srgb, var(--thumb, #e3ecef) 30%, #d6d0ca); filter: brightness(.88);}
  :root:not([data-theme="light"]) .avatar { background: var(--blue-l); color: var(--blue-d);}
}
:root[data-theme="dark"] .kind-opt span { background: #29241e; color: var(--ink); }
:root[data-theme="dark"] .cat-opt input:checked + span, :root[data-theme="dark"] .kind-opt input:checked + span, :root[data-theme="dark"] .size-opt input:checked + span, :root[data-theme="dark"] .plan-day.on { background: var(--blue-l); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .kind-opt span { background: #29241e; color: var(--ink); }
  :root:not([data-theme="light"]) .cat-opt input:checked + span, :root:not([data-theme="light"]) .kind-opt input:checked + span, :root:not([data-theme="light"]) .size-opt input:checked + span, :root:not([data-theme="light"]) .plan-day.on { background: var(--blue-l); }
}

/* ---------- Offline ---------- */
.offline-bar { position: sticky; top: 0; z-index: 25; margin: 0 0 14px; padding: 10px 14px; border-radius: 12px; background: var(--amber-l); color: var(--amber-d); font-weight: 700; font-size: 14px; }
.offline-bar .link-btn { margin-left: 6px; }
@media (max-width: 899px) { .offline-bar { top: calc(58px + env(safe-area-inset-top, 0px)); } }
:root[data-theme="dark"] .share-badge { background: #3f372e; color: #bce7f6; }
:root[data-theme="dark"] .item-row .chip, :root[data-theme="dark"] .freezer-row .chip { background: var(--blue-l); color: var(--blue-d); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .share-badge { background: #3f372e; color: #bce7f6; }
  :root:not([data-theme="light"]) .item-row .chip, :root:not([data-theme="light"]) .freezer-row .chip { background: var(--blue-l); color: var(--blue-d); }
}
.auth-links { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- Strømsvigt ---------- */
.power-verdict { border-radius: 14px; padding: 12px 14px; margin-bottom: 12px; }
.power-verdict p { margin: 4px 0 0; }
.power-verdict.ok { background: var(--green-l); }
.power-verdict.edge { background: var(--amber-l); }
.power-verdict.bad { background: var(--red-l); }
.power-rules { padding-left: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; margin: 0 0 12px; font-size: 14.5px; }
.power-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.power-row .grow { flex: 1; min-width: 120px; display: flex; flex-direction: column; }
.power-row small { color: var(--muted); }
.power-row.gone { opacity: .45; }
.power-row.gone b { text-decoration: line-through; }

/* "Mere"-menu i sidehovedet */
.more-menu { position: relative; }
.more-menu > summary { list-style: none; cursor: pointer; }
.more-menu > summary::-webkit-details-marker { display: none; }
.more-pop { position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 220px; padding: 6px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--line); box-shadow: 0 14px 30px rgba(21,56,68,.18); display: flex; flex-direction: column; }
.more-pop button { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 0; border-radius: 10px; background: none; font: inherit; font-weight: 700; color: var(--ink); text-align: left; cursor: pointer; }
.more-pop button:hover { background: var(--blue-l); }
.power-acts { display: flex; gap: 6px; margin-left: auto; }
@media (max-width: 899px) { .power-row .grow { flex-basis: calc(100% - 70px); } .power-acts { width: 100%; justify-content: flex-end; } }

.recall-banner.maybe { background: var(--amber-l); border-color: #fcd34d; }
.recall-banner.maybe h2 { color: var(--amber-d); font-size: 16px; }
.recall-banner.maybe .link-btn { color: var(--amber-d); }

.meal-hero-acts { display: flex; flex-direction: column; gap: 8px; flex: none; }
@media (max-width: 899px) { .meal-hero-acts { width: 100%; } .meal-hero-acts .btn { width: 100%; justify-content: center; } }

/* Mørkt tema: lys/mørk udgave af skærmbilleder */
.art-dark { display: none; }
:root[data-theme="dark"] .art-light { display: none; }
:root[data-theme="dark"] .art-dark { display: inline-block; }
:root[data-theme="dark"] .mobile-hero h1, :root[data-theme="dark"] .mobile-hero p { color: #e8f3f6; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .art-light { display: none; }
  :root:not([data-theme="light"]) .art-dark { display: inline-block; }
  :root:not([data-theme="light"]) .mobile-hero h1, :root:not([data-theme="light"]) .mobile-hero p { color: #e8f3f6; }
}
:root[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #0c2f3a 0%, #0a252e 100%); }
:root[data-theme="dark"] .side-nav a.active { background: #473e33; color: #ffffff; box-shadow: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sidebar { background: linear-gradient(180deg, #0c2f3a 0%, #0a252e 100%); }
  :root:not([data-theme="light"]) .side-nav a.active { background: #473e33; color: #ffffff; box-shadow: none; }
}

/* Mørkt tema: stjernehimmel og svagt nordlys i sidebaren */
:root[data-theme="dark"] .sidebar { background: linear-gradient(180deg, #0c2f3a 0%, #0a252e 100%); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .sidebar { background: linear-gradient(180deg, #0c2f3a 0%, #0a252e 100%); }
}

.portions-wrap { margin-top: -4px; }
.portions-wrap .portions-row { margin-top: 8px; }

/* ---------- Forside ---------- */
.landing { max-width: 1240px; margin: 0 auto; padding: 18px 20px 40px; }
.landing-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.landing-top .brand { color: var(--blue-d); font-size: 28px; }
.landing-hero { --hero-veil: linear-gradient(90deg, rgba(250,246,239,.9) 0%, rgba(250,246,239,.72) 42%, rgba(250,246,239,0) 68%);
  display: grid; grid-template-columns: 1.3fr .7fr; align-items: center; gap: 24px; padding: 34px 34px 0; border-radius: 28px; overflow: hidden; position: relative;
  background: var(--scene) right bottom / cover no-repeat, var(--hero-a);
  border: 1px solid var(--line); margin-bottom: 22px; }
.landing-hero h1 { font-size: clamp(28px, 4.2vw, 46px); line-height: 1.08; margin: 0 0 12px; letter-spacing: -.02em; }
.landing-hero p { font-size: 18px; color: var(--ink2); margin: 0 0 18px; max-width: 560px; }
.landing-hero-text { padding-bottom: 34px; }
.landing-hero-art { align-self: end; justify-self: center; }
.landing-hero-art .mascot { vertical-align: bottom; margin-bottom: -8px; }
.landing-cta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.landing-cta .btn { height: 50px; padding: 0 22px; font-size: 16px; }
.landing-feats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-bottom: 22px; }
.landing-feat { margin: 0; }
.landing-feat h3 { margin: 6px 0 6px; font-size: 17px; }
.landing-feat p { margin: 0; color: var(--ink2); font-size: 15px; line-height: 1.5; }
.lf-emoji { font-size: 30px; }
.landing-steps { margin-bottom: 22px; }
.landing-steps h2, .landing-privacy h2 { margin: 0 0 10px; font-size: 22px; }
.landing-steps ol { margin: 0 0 10px; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 16px; }
.landing-privacy { display: flex; align-items: center; gap: 20px; padding: 10px 8px 22px; }
.landing-privacy p { margin: 0; color: var(--ink2); font-size: 16px; max-width: 640px; }
.landing-foot { display: flex; flex-direction: column; align-items: center; gap: 10px; padding-top: 6px; }
.landing-foot .btn { height: 50px; padding: 0 26px; font-size: 16px; }
.auth-back { align-self: flex-start !important; display: inline-flex; align-items: center; gap: 4px; margin: -8px 0 8px; color: var(--muted); }
@media (max-width: 899px) {
  .landing { padding: 12px 14px 32px; }
  /* Kort hero på mobil, så "Brug mig først" kan ses ved første blik */
  .landing-hero {
    grid-template-columns: 1fr; padding: 20px 18px 18px; text-align: left; margin-bottom: 16px; border-radius: 22px; }
  .landing-hero h1 { font-size: 27px; margin-bottom: 8px; }
  .landing-hero p { font-size: 15.5px; margin-bottom: 14px; }
  .landing-hero-text { padding-bottom: 0; }
  .landing-hero-art { position: absolute; bottom: 0; right: 12px; }
  .landing-hero-art .mascot { width: 84px; height: auto; margin-bottom: -4px; }
  .landing-hero .landing-cta .btn { flex: 0 0 auto; }
  .landing-hero .landing-cta, .landing-hero .hint { padding-right: 96px; }
  .landing-top { margin-bottom: 12px; }
  .landing-feats { grid-template-columns: 1fr; }
  .landing-cta .btn { flex: 1; justify-content: center; }
  .landing-privacy { flex-direction: column; text-align: center; }
}
:root[data-theme="dark"] .landing-hero h1 { color: #fbf7f1; }
:root[data-theme="dark"] .landing-hero p { color: #cadee5; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .landing-hero h1 { color: #fbf7f1; }
  :root:not([data-theme="light"]) .landing-hero p { color: #cadee5; }
}
.landing-hero .hint { color: var(--ink); font-weight: 700; opacity: .8; }
:root[data-theme="dark"] .quick { background: #26211c; border-color: #54493d; color: var(--blue-d); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .quick { background: #26211c; border-color: #54493d; color: var(--blue-d); }
}
.item-row .item-meta { flex-wrap: nowrap; align-items: flex-start; }
.item-row .item-meta .dot { margin-top: 5px; }

/* Skærmbilleder på forsiden */
.landing-show { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; justify-items: center; margin: 0 0 30px; padding: 0; }
/* "Brug mig først" flugter med logoet og velkomstfeltet i venstre side */
.landing-show .show-first { justify-self: start; }
.show-first { margin: 0; display: flex; flex-direction: column; gap: 12px; width: 100%; max-width: 470px; }
.show-first-img { border-radius: 26px; overflow: hidden; box-shadow: 0 18px 40px rgba(21,56,68, .16); background: var(--card); }
.show-first-img img { display: block; width: 100%; height: auto; }
.show-first-img img.art-dark { display: none; }
.show-first figcaption, .shot figcaption { display: flex; flex-direction: column; gap: 3px; color: var(--ink2); font-size: 15px; line-height: 1.45; }
.show-first figcaption { text-align: center; }
.show-tabs { display: flex; flex-direction: column; align-items: center; gap: 14px; width: 100%; max-width: 360px; }
.show-tablist { grid-template-columns: repeat(4, 1fr); width: 100%; margin: 0; }
.show-tablist button { height: 38px; font-size: 14px; padding: 0 4px; }
.shot { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.shot[hidden] { display: none; }
.shot figcaption { text-align: center; font-size: 14px; }
.phone { width: 100%; max-width: 270px; aspect-ratio: 390 / 844; border-radius: 30px; padding: 8px; background: #153844;
  box-shadow: 0 18px 40px rgba(21,56,68, .25); overflow: hidden; }
.phone img { width: 100%; height: 100%; object-fit: cover; object-position: top; border-radius: 23px; display: block; }
.phone img.art-dark { display: none; }
@media (max-width: 899px) {
  .landing-show { grid-template-columns: 1fr; gap: 22px; margin-bottom: 24px; padding: 0; }
  .show-first { max-width: none; padding-top: 0; }
  .show-first-img { border-radius: 20px; }
  .phone { max-width: 250px; }
}
:root[data-theme="dark"] .show-first-img img.art-light { display: none; }
:root[data-theme="dark"] .show-first-img img.art-dark { display: block; }
:root[data-theme="dark"] .show-first-img { box-shadow: 0 18px 40px rgba(0,0,0,.45); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .show-first-img img.art-light { display: none; }
  :root:not([data-theme="light"]) .show-first-img img.art-dark { display: block; }
  :root:not([data-theme="light"]) .show-first-img { box-shadow: 0 18px 40px rgba(0,0,0,.45); }
}
:root[data-theme="dark"] .phone img.art-light { display: none; }
:root[data-theme="dark"] .phone img.art-dark { display: block; }
:root[data-theme="dark"] .phone { background: #443b31; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .phone img.art-light { display: none; }
  :root:not([data-theme="light"]) .phone img.art-dark { display: block; }
  :root:not([data-theme="light"]) .phone { background: #443b31; box-shadow: 0 18px 40px rgba(0,0,0,.45); }
}

/* Egne ikoner i stedet for emojis */
.power-rules li { display: flex; gap: 10px; align-items: flex-start; }
.power-rules li > .ico { flex: none; margin-top: 2px; color: var(--blue); }
.lf-emoji { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 14px; background: var(--blue-l); color: var(--blue); }
.pill .ico, .eco .ico { vertical-align: -2px; }
.cat-chip .cat-ico, .hb-label .cat-ico, .plan-list .cat-ico, .type-name .cat-ico, .details .cat-ico { vertical-align: -3px; }
.cat-opt .cat-ico { display: block; margin: 0 auto 2px; }
.meal-hero-ico { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 20px; background: var(--blue-l); }
.recall-box b .ico, .recall-banner h2 .ico, .card h2 .ico { flex: none; }
.offline-bar .ico { vertical-align: -3px; margin-right: 4px; }

/* Skuffevælger på mobil (i stedet for faner, der bliver skåret af) */
.zone-pick { display: none; align-items: center; gap: 10px; margin-bottom: 14px; font-weight: 800; color: var(--muted); }
.zone-pick select { flex: 1; height: 42px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font-weight: 800; font-size: 15px; padding: 0 12px; }
@media (max-width: 899px) { .zone-pick.mobile-only { display: flex; } }

/* Tilføj vare: valgfrie felter samlet, og knapperne altid synlige nederst */
.more-details { border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 12px; }
.more-details > summary { cursor: pointer; font-weight: 800; color: var(--ink); display: flex; flex-direction: column; gap: 2px; list-style: none; position: relative; padding-right: 32px; }
.more-details > summary::-webkit-details-marker { display: none; }
.more-details > summary::after { content: "+"; position: absolute; right: 2px; top: 50%; transform: translateY(-50%); font-size: 22px; font-weight: 700; color: var(--blue); }
.more-details > summary small { font-weight: 600; color: var(--muted); }
.more-details[open] > summary { margin-bottom: 4px; }
.more-details .product-details { border-style: dashed; }
.sticky-actions { position: sticky; bottom: -24px; z-index: 3; margin: 18px -24px -24px; padding: 12px 24px; background: var(--card);
  border-top: 1px solid var(--line); border-radius: 0 0 22px 22px; }
@media (max-width: 899px) {
  .sticky-actions { bottom: calc(-22px - var(--safe-b)); margin: 16px -18px calc(-22px - var(--safe-b)); padding: 10px 18px calc(10px + var(--safe-b)); border-radius: 0; flex-wrap: nowrap; }
  .sticky-actions .btn { padding: 0 10px; }
}
.more-details[open] > summary::after { content: "−"; }

/* Madidéer: forklaring af farverne og hvor datoen kommer fra */
.meal-legend { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 14px; padding: 10px 14px; border-radius: 14px; background: var(--blue-l); color: var(--ink2); font-size: 14px; line-height: 1.45; }
.meal-legend svg { flex: none; margin-top: 2px; color: var(--blue); }
.date-src { margin: 2px 0 0; font-size: 12.5px; }

/* Varevinduet: samlet datostatus, kort råd og flere handlinger */
.sheet-status { font-weight: 800; font-size: 16px; }
.sheet-src { color: var(--muted); font-size: 13px; margin-top: 2px; }
.details dd small.dd-sub { display: block; font-weight: 600; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.read-more { margin-top: 6px; }
.read-more > summary { cursor: pointer; font-weight: 800; text-decoration: underline; text-underline-offset: 2px; list-style: none; display: inline; }
.read-more > summary::-webkit-details-marker { display: none; }
.read-more[open] > summary { display: block; margin-bottom: 4px; }
.sheet-more { margin-top: 6px; }
.sheet-more > summary { list-style: none; display: inline-flex; color: var(--muted); }
.sheet-more > summary::-webkit-details-marker { display: none; }
.sheet-more > summary::after { content: "▾"; margin-left: 6px; font-size: 12px; }
.sheet-more[open] > summary::after { content: "▴"; }
.sheet-more-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.date-note { margin: 4px 0 12px; font-size: 12.5px; }
.action-grid.has-take { grid-template-columns: 1fr 1fr; }
.action-grid.has-take > :first-child { grid-column: 1 / -1; }
.modal:focus { outline: none; }

/* Privatlivspolitik og links i bunden */
.foot-links { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; font-size: 14px; font-weight: 700; }
.foot-links a { color: var(--ink2); text-decoration: underline; text-underline-offset: 3px; }
.privacy-page article { max-width: 760px; margin: 0 auto 22px; padding: 28px 30px; }
.privacy-page h1 { margin: 0 0 4px; font-size: 30px; }
.privacy { max-width: 720px; }
.privacy section { margin-top: 20px; }
.privacy h2 { font-size: 18px; margin: 0 0 6px; }
.privacy p, .privacy li { color: var(--ink2); line-height: 1.55; }
.privacy p { margin: 0 0 8px; }
.privacy ul { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.privacy a { color: var(--blue-d); font-weight: 700; }
@media (max-width: 899px) { .privacy-page article { padding: 20px 18px; } .privacy-page h1 { font-size: 24px; } }

/* ===================== Køleskab (trin 2) ===================== */
.quality-note.danger { background: #fdecec; color: #8f1d1d; }
.fridge-add { display: flex; flex-wrap: wrap; gap: 8px; }
.fridge-nudge { display: flex; align-items: center; gap: 14px; }
.fridge-nudge .grow { flex: 1; min-width: 0; }
.fridge-nudge p { margin: 4px 0 10px; font-size: 14px; }
.fridge-nudge .row-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.fridge-nudge-art { flex: none; }
.group-title { margin: 14px 0 6px; font-size: 14px; font-weight: 700; color: var(--muted, #867869); text-transform: uppercase; letter-spacing: .03em; }
.group-title:first-child { margin-top: 4px; }
.group-title small { font-weight: 500; margin-left: 4px; }
.place-row { border-top: 0; padding-top: 0; margin-bottom: 12px; }
.fridge-hide { display: none !important; }
button.freezer-row { width: 100%; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .quality-note.danger { background: #3b1717; color: #fecaca; } }
:root[data-theme="dark"] .quality-note.danger { background: #3b1717; color: #fecaca; }

/* ===================== Madkammer (trin 3) ===================== */
.stock-pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12.5px; font-weight: 600; line-height: 1.6; }
.stock-pill.stock-ok { background: #dcfce7; color: #166534; }
.stock-pill.stock-low { background: #fef3c7; color: #92400e; }
.stock-pill.stock-open { background: #dbeafe; color: #1e40af; }
.stock-pill.stock-empty { background: #fee2e2; color: #991b1b; }
.item-row.stock-low { border-left-color: #f59e0b; }
.item-row.stock-empty { border-left-color: #ef4444; }
.item-row.stock-empty .item-name { color: var(--muted, #867869); }
.stock-seg { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 4px 0 8px; }
@media (max-width: 480px) { .stock-seg { grid-template-columns: 1fr 1fr; } }
.stock-seg.n3 { grid-template-columns: repeat(3, 1fr); }
.stock-seg .btn { padding-left: 6px; padding-right: 6px; }
.shop-place { margin-left: 6px; font-size: 12px; }
:root[data-theme="dark"] .stock-pill.stock-ok { background: #14361f; color: #bbf7d0; }
:root[data-theme="dark"] .stock-pill.stock-low { background: #3a2a0c; color: #fde68a; }
:root[data-theme="dark"] .stock-pill.stock-open { background: #172a4a; color: #bfdbfe; }
:root[data-theme="dark"] .stock-pill.stock-empty { background: #3b1717; color: #fecaca; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .stock-pill.stock-ok { background: #14361f; color: #bbf7d0; }
  :root:not([data-theme="light"]) .stock-pill.stock-low { background: #3a2a0c; color: #fde68a; }
  :root:not([data-theme="light"]) .stock-pill.stock-open { background: #172a4a; color: #bfdbfe; }
  :root:not([data-theme="light"]) .stock-pill.stock-empty { background: #3b1717; color: #fecaca; }
}
.stock-pill { white-space: nowrap; }
.item-row .item-meta:has(.stock-pill) { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; }
/* Vinduet med noget udfyldt: et lille ryk i stedet for at lukke ved klik udenfor */
.modal.nudge { animation: modal-nudge .32s ease; }
@keyframes modal-nudge { 20% { transform: translateX(-6px); } 45% { transform: translateX(5px); } 70% { transform: translateX(-3px); } 100% { transform: none; } }
@media (prefers-reduced-motion: reduce) { .modal.nudge { animation: none; box-shadow: 0 0 0 3px var(--blue); } }
/* Overblikket: hver kolonne stabler sine egne kort, så et højt kort ikke efterlader et hul ved siden af */
.overview-cols > .col { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
@media (max-width: 899px) { .overview-cols > .col { gap: 14px; } }
/* Invitationerne (køleskab/madkammer) har samme afstand som de andre kort */
.fridge-nudge { margin-bottom: 20px; }
@media (max-width: 899px) { .fridge-nudge { margin-bottom: 14px; } }
/* Vælg type, når man opretter et sted */
.place-type-seg { grid-template-columns: repeat(4, 1fr); margin-bottom: 0; }
/* Forsidens velkomstkort på telefon: et blødt slør over venstre side, så teksten ikke ligger direkte på glassene */
@media (max-width: 899px) {
  .landing-hero { background: linear-gradient(90deg, color-mix(in srgb, var(--hero-a) 88%, transparent) 0%, color-mix(in srgb, var(--hero-a) 70%, transparent) 55%, transparent 85%), var(--scene-sm) right bottom / cover no-repeat, var(--hero-a); }
}
/* Madidéer: det, I også har i madkammeret */
.pantry-have { margin-top: 20px; }
.pantry-have h2 { margin: 0 0 4px; font-size: 18px; }
.pantry-have .chips { margin-top: 10px; }
/* Steder grupperet efter type */
.place-group { margin: 22px 0 10px; }
.place-group:first-of-type { margin-top: 4px; }

/* Velkomst: vælg steder */
.welcome { max-width: 720px; margin: 0 auto; }
.welcome-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.welcome-head h1 { margin: 0 0 6px; font-size: 24px; }
.welcome-row { display: flex; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 14px; cursor: pointer; }
.welcome-row input[type=checkbox] { width: 20px; height: 20px; flex: none; }
.welcome-row .grow { display: flex; flex-direction: column; min-width: 0; }
.welcome-row small { color: var(--muted); }
.welcome-row select { width: 64px; }
.welcome-art { flex: none; }
@media (max-width: 899px) { .welcome-head { flex-direction: column; text-align: center; } }
/* Indstillinger: steder */
.place-list li { display: flex; align-items: center; gap: 10px; }
.place-list .place-art { flex: none; }
.place-list .icon-btn svg { transform: rotate(-90deg); }
.place-list .icon-btn.flip svg { transform: rotate(90deg); }
.place-list .icon-btn:disabled { opacity: .3; }
.place-list .type-name { display: flex; flex-direction: column; min-width: 0; }
.place-list .type-name b, .place-list .type-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-list .icon-btn { flex: none; width: 32px; }
@media (max-width: 480px) { .place-list .btn-sm .label { display: none; } }

/* Reoler med hylder */
.zone-section[data-section] { border: 1px solid var(--line); border-radius: 14px; padding: 10px; margin-top: 10px; background: var(--cream); }
.zone-section-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.zone-section-head input { flex: 1; min-width: 0; font-weight: 700; }
.zone-section[data-section] .zone-rows { padding-left: 12px; border-left: 3px solid var(--line); }
.tabs.sub-tabs { margin-top: -6px; font-size: 14px; opacity: .95; }
.section-tools { margin-top: 10px; }
.zone-row .zone-move { flex: none; width: 30px; }
.zone-row .zone-move svg { transform: rotate(-90deg); }
.zone-row .zone-move.flip svg { transform: rotate(90deg); }
.zone-rows .zone-row:first-child [data-move-zone="-1"] { opacity: .35; }
.zone-rows .zone-row:last-child [data-move-zone="1"] { opacity: .35; }
@media (min-width: 900px) { .search-card .chips-scroll { flex-wrap: wrap; overflow: visible; } }
@media (max-width: 899px) { .use-first.mobile-only { margin-bottom: 14px; } }

/* Opskrifter */
.recipes-card { margin-top: 20px; }
.recipe-list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; min-width: 0; }
@media (min-width: 900px) { .recipe-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.recipe-row { display: flex; align-items: center; gap: 12px; width: 100%; min-width: 0; text-align: left; padding: 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); color: inherit; font: inherit; cursor: pointer; }
.recipe-row:hover { border-color: var(--blue); }
.recipe-row .grow { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.recipe-row b, .recipe-row small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recipe-ico { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--cream); color: var(--blue); }
.recipe-ing { list-style: none; padding: 0; margin: 0 0 14px; display: grid; gap: 4px; }
.recipe-ing li { display: flex; flex-direction: column; gap: 2px; padding: 8px 12px; border-radius: 10px; border-left: 4px solid transparent; }
.recipe-ing li.have { background: color-mix(in srgb, var(--sage, #9fb38a) 18%, transparent); border-left-color: #22c55e; }
.recipe-ing li.missing { background: color-mix(in srgb, var(--line) 35%, transparent); border-left-color: var(--line); }
.recipe-ing .ing-line { font-weight: 600; }
.recipe-ing .ing-status { font-size: 12.5px; color: var(--muted); display: flex; align-items: center; gap: 4px; }
.recipe-ing li.have .ing-status { color: #15803d; }
.recipe-ing small { color: var(--muted); display: flex; align-items: center; gap: 4px; }
.recipe-method { padding-left: 20px; margin: 0 0 14px; display: grid; gap: 6px; }
.plan-recipe .link-btn { font-weight: 700; }

/* Pile til at bladre mellem steder i oversigten */
.place-step { display: inline-flex; gap: 2px; margin-left: 2px; vertical-align: middle; }
.ov-head { flex-wrap: wrap; }
.ov-head h2 { flex: none; max-width: 100%; }
.place-dots { display: flex; justify-content: center; gap: 6px; margin: -6px 0 10px; }
.place-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.place-dots i.on { background: var(--blue); width: 18px; border-radius: 4px; }
.place-step .icon-btn { width: 34px; height: 34px; border-radius: 10px; background: var(--blue-l); color: var(--blue-d); flex: none; }

/* Indkøbsscanning */
/* Læg det købte på plads */
.putaway-skip { grid-column: 1 / -1; }
.putaway-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.putaway-note { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; border: 0;
  margin-bottom: 14px; background: var(--blue-l); box-shadow: inset 0 0 0 2px var(--blue), var(--shadow); }
.putaway-note .grow { min-width: 0; }
.putaway-note b, .putaway-note small { display: block; }
.putaway-row { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 14px; }
.putaway-row .grow { min-width: 0; }
.putaway-sum b, .putaway-sum small { display: block; }
.putaway-row { flex-wrap: wrap; }
.putaway-edit { margin-top: 4px; flex-basis: 100%; }
.putaway-edit[hidden] { display: none; }
.putaway-row.off .grow { opacity: .45; }
.basket-entry { margin: -6px 0 14px; width: 100%; justify-content: center; }
.scan-view-sm { min-height: 170px; max-height: 240px; }
.scan-view-sm video { max-height: 240px; }
.basket-head { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 6px; }
.basket-list { display: flex; flex-direction: column; gap: 6px; max-height: 38vh; overflow-y: auto; }
.basket-row { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; background: var(--blue-l); }
.basket-row .grow { min-width: 0; }
.basket-row b, .basket-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.basket-row small { color: var(--muted); font-weight: 600; }
.basket-row.loading { opacity: .6; }
.basket-row.unknown { background: var(--amber-l); }
.basket-row:first-child { animation: basket-in .35s ease; }
@keyframes basket-in { from { transform: translateY(-6px); opacity: 0; } }
.qty-step { display: flex; align-items: center; gap: 4px; flex: none; }
.qty-step span { min-width: 22px; text-align: center; font-weight: 800; }
.qty-step .icon-btn { width: 32px; height: 32px; background: var(--card); border-radius: 9px; }
.basket-empty { text-align: center; padding: 12px 0; }
.review-list { display: flex; flex-direction: column; gap: 12px; }
.review-item { border: 1px solid var(--line); border-radius: 14px; padding: 12px; margin: 0; min-width: 0; }
.review-item.invalid { border-color: #ef4444; }
.review-top { display: flex; gap: 8px; align-items: flex-end; }
.review-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: 8px 0 4px; }
.review-grid .field select, .review-grid .field input { min-width: 0; width: 100%; }
.row-inline { display: flex; gap: 6px; }
.row-inline input { width: 58px !important; flex: none; padding-left: 8px; padding-right: 4px; }
.row-inline select { flex: 1; min-width: 0; padding-left: 8px; padding-right: 4px; }
@media (max-width: 700px) { .review-grid { grid-template-columns: 1fr 1fr; } }

/* Fra stregkoden: billede og allergener */
.barcode-thumb { width: 34px; height: 34px; object-fit: contain; border-radius: 8px; background: #fff; vertical-align: middle; flex: none; }
.barcode-note:has(.barcode-thumb) { display: flex; align-items: center; gap: 8px; }
.allergen-note { display: flex; align-items: flex-start; gap: 6px; margin: 0; padding: 8px 10px; border-radius: 10px; background: var(--amber-l); color: var(--amber-d); font-weight: 700; font-size: 14px; }
.allergen-note .ico, .allergen-note svg { flex: none; margin-top: 2px; }
.basket-thumb { width: 38px; height: 38px; object-fit: contain; border-radius: 8px; background: #fff; flex: none; }
.basket-thumb.lg { width: 48px; height: 48px; align-self: flex-end; }
.photo-src { display: block; width: 100%; }

/* Statistik: kortene stables i to spalter, så et højt kort ikke efterlader huller */
.stats-cols { display: flex; flex-direction: column; gap: 20px; }
@media (min-width: 900px) {
  .stats-cols { display: block; column-count: 2; column-gap: 20px; }
  .stats-cols > .card { break-inside: avoid; display: inline-block; width: 100%; margin: 0 0 20px; }
}

/* Overblik: madforslag på sin egen linje under "Brug mig først" */
.meal-cta { display: flex; align-items: center; gap: 12px; margin-top: 12px; padding: 12px 14px; border-radius: 14px; background: var(--blue-l, #eef6f7); color: inherit; text-decoration: none; }
.meal-cta > span { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.meal-cta small { color: var(--muted); }
.meal-cta:hover { filter: brightness(.97); }
.landing-top-actions { display: flex; align-items: center; gap: 8px; }

/* Madplan: ugen fra mandag til søndag */
.plan-weekbar { display: flex; align-items: center; gap: 10px; margin: 0 0 10px; }
.plan-weekbar b { font-size: 17px; }
.plan-weekbar .icon-btn[disabled] { opacity: .35; cursor: default; }
.plan-col.past { opacity: .7; }
.today-acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.ideas-card { margin-top: 18px; }
.ideas-card > .btn { margin-top: 12px; }
.idea-items { display: flex; flex-direction: column; gap: 8px; }
.idea-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 14px; }
.idea-item-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; background: none; border: 0; padding: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.idea-item-main .grow { display: flex; flex-direction: column; min-width: 0; }
.idea-item-main small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Vælg dagens ret: kort i stil med en opskriftssøgning */
.dish-tip { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 12px; border-radius: 12px; background: var(--blue-l); font-size: 14px; }
.dish-tip svg { flex: none; color: var(--blue); }
.dish-filters { margin: 8px 0 4px; }
.dish-filters .chip { cursor: pointer; }
.dish-filters .chip.on { background: var(--blue-d); border-color: var(--blue-d); color: #ffffff; }
.dish-scroll { max-height: 52vh; overflow: auto; margin: 0 -4px; padding: 0 4px; }
.dish-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.dish-grid[hidden], .dish-card[hidden], .group-title[hidden] { display: none; }
.dish-card { display: flex; gap: 12px; align-items: flex-start; padding: 12px; border: 1px solid var(--line); border-radius: 16px; background: var(--card, #ffffff); text-align: left; font: inherit; color: var(--ink); cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.dish-card:hover, .dish-card:focus-visible { border-color: var(--blue); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.dish-ico { flex: none; display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: var(--blue-l); color: var(--blue-d); }
.dish-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.dish-body b { line-height: 1.25; overflow-wrap: anywhere; }
.dish-body small { font-size: 12.5px; }
.dish-badge { align-self: flex-start; margin-top: 2px; padding: 2px 8px; border-radius: 999px; background: var(--amber-l); font-size: 12px; font-weight: 700; }
.dish-badge.ok { background: var(--green-l); }
.dish-items { margin-top: 14px; }
.dish-items summary { cursor: pointer; font-weight: 700; color: var(--blue-d); padding: 6px 0; }
@media (max-width: 480px) { .dish-grid { grid-template-columns: minmax(0, 1fr); } .dish-scroll { max-height: none; } }
.dish-filters { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.dish-filters .chip { flex: none; max-width: none; overflow: visible; text-overflow: clip; }

/* Opskrifternes billeder */
.recipe-ico, .dish-ico { overflow: hidden; }
.recipe-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.dish-ico .recipe-img { border-radius: inherit; }
.recipe-hero-img { display: block; width: calc(100% + 48px); max-height: 240px; object-fit: cover; margin: -24px -24px 14px; border-radius: 20px 20px 0 0; }
@media (max-width: 480px) { .dish-ico { width: 64px; height: 64px; } }
@media (max-width: 899px) { .recipe-hero-img { width: calc(100% + 36px); margin: -22px -18px 14px; } }
.modal:has(.recipe-hero-img) .modal-x { z-index: 2; background: rgba(255,255,255,.92); color: #153844; box-shadow: 0 2px 8px rgba(0,0,0,.18); }

/* ---------- Pantreo 2.0: lageret ---------- */
.qty-line { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.qty-line input, .qty-line select { height: 46px; padding: 0 12px; border-radius: 12px; border: 1.5px solid #dbeaef; font-size: 16px; background: #fff; color: var(--ink); }
.field .qty-line input, .field .qty-line select { width: auto; }
.field .qty-line input[name="count"], .field .qty-line input[name="size"] { width: 88px; }
.qty-line .size-wrap { display: inline-flex; gap: 8px; align-items: center; font-weight: 700; color: var(--ink2); }
.qty-line [hidden], .mods [hidden] { display: none !important; }
.ret-unit { font-weight: 700; color: var(--ink2); }
.check.small { font-weight: 600; font-size: 14px; margin-top: 6px; }
.zone-edit-row .zone-sec { flex: 0 1 40%; }
.radio-seg label { display: flex; position: relative; }
.radio-seg input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; pointer-events: none; }
.radio-seg span { flex: 1; display: grid; place-items: center; height: 40px; border-radius: 9px; font-weight: 800; color: var(--muted); cursor: pointer; }
.radio-seg input:checked + span { background: #ffffff; color: var(--blue-d); box-shadow: 0 2px 6px rgba(21,56,68,.08); }
.radio-seg input:focus-visible + span { outline: 2px solid #6fcceb; }
.stock-seg .btn[disabled] { opacity: .45; }
.item-row.pending { opacity: .8; }
.item-row.pending .item-name::after { content: " ⏳"; font-size: 12px; }
.history-list { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.history-list li { display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--line); }
.history-list small { margin-left: auto; }
:root[data-theme="dark"] .qty-line input, :root[data-theme="dark"] .qty-line select { background: #26211c; border-color: #54493d; color: var(--ink); }
:root[data-theme="dark"] .radio-seg input:checked + span { background: var(--card); color: var(--blue-d); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .qty-line input, :root:not([data-theme="light"]) .qty-line select { background: #26211c; border-color: #54493d; color: var(--ink); }
  :root:not([data-theme="light"]) .radio-seg input:checked + span { background: var(--card); color: var(--blue-d); }
}

/* Pantreo 2.0: stregkoder (milepæl 3) */
.pack-text { align-self: center; font-weight: 700; white-space: nowrap; }
.name-field .allergen-note { margin-top: 6px; }

/* ---------- Milepæl 7: statistik, delte steder og gennemgang ---------- */
.pill-discarded { background: var(--red-l); color: var(--red-d); }
.pill-removed, .pill-event { background: var(--line); color: var(--ink2); }
.pill-owner { background: var(--blue-l); color: var(--ink2); font-size: 11.5px; margin-left: 4px; vertical-align: 2px; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; }
.item-row.undone .item-name { text-decoration: line-through; color: var(--muted); }
.month-bars { display: flex; align-items: flex-end; gap: 8px; height: 150px; padding-top: 6px; }
.mb-col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 0; }
.mb-col small { font-size: 12px; font-weight: 800; color: var(--muted); min-height: 16px; }
.mb-bar { display: block; width: 100%; max-width: 36px; border-radius: 8px 8px 3px 3px; background: linear-gradient(180deg, #f87171, #ef4444); }
.mb-col b { font-size: 12px; font-weight: 800; color: var(--ink2); }
.review-ico { color: var(--blue-d, #0b4559); display: inline-flex; }

/* ---------- Milepæl 8: eksempeldata ---------- */
.demo-offer { margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line); display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.demo-offer p { flex: 1; min-width: 200px; margin: 0; }
.demo-banner { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; background: var(--blue-l); }
.demo-banner .grow { flex: 1; min-width: 200px; }
.demo-banner p { margin: 2px 0 0; }

/* ---------- Varebilleder og næringsindhold fra Open Food Facts ---------- */
.thumb.product { position: relative; overflow: hidden; }
.thumb.lg.product { width: 84px; height: 84px; }
.thumb.product img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #fff; padding: 3px; box-sizing: border-box; }
.size-hint { margin: 4px 0 0; padding: 8px 10px; border-radius: 10px; background: var(--bg2); }
.facts { margin: 14px 0 4px; }
.facts-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-bottom: 6px; }
.facts-head h3 { margin: 0; font-size: 15px; }
.nutrition { width: 100%; border-collapse: collapse; font-size: 14px; }
.nutrition th, .nutrition td { padding: 5px 0; border-bottom: 1px solid var(--line); text-align: left; font-weight: 600; }
.nutrition td { text-align: right; white-space: nowrap; }
.nutrition tr.sub th { font-weight: 400; padding-left: 14px; color: var(--muted, inherit); }
.nutriscore { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 700; }
.nutriscore b { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; color: #fff; font-size: 15px; }
.ns-a b { background: #038141; } .ns-b b { background: #85bb2f; } .ns-c b { background: #e6a700; } .ns-d b { background: #ee8100; } .ns-e b { background: #e63e11; }
.ingredients { margin-top: 10px; font-size: 14px; }
.ingredients summary { cursor: pointer; font-weight: 700; }
.ingredients p { margin: 6px 0 0; line-height: 1.45; }

/* ---------- Retter fra en forbundet app (Budgetgryden) ---------- */
.src-pill { display: inline-block; margin-left: 4px; padding: 1px 7px; border-radius: 999px; background: var(--bg2); color: var(--muted); font-size: 11px; font-weight: 700; vertical-align: middle; }
.partner-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.partner-card p { margin: 0; }
.shop-group { border: 0; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.shop-group legend { font-weight: 700; margin-bottom: 4px; }
