/* Guldtoft Madbanken - design system, aligned with the guldtoft.dk
   brand (shared with Guldtoft Padel). Warm paper background, ink-navy
   text, burnt-orange accent, editorial serif headings. Self-hosted
   fonts - no external CDN at runtime. */

@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('../fonts/Fraunces-variable.woff2') format('woff2');
}

@font-face {
  font-family: 'Inter Tight';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/InterTight-variable.woff2') format('woff2');
}

:root {
  --ink: #0f1b2d;
  --ink-2: #1b2a41;
  --paper: #f5f1ea;
  --paper-2: #ede6d8;
  --accent: #c6531f;
  --accent-soft: #e8a87c;
  --line: #0f1b2d;
  --muted: #5c6a7c;
  --green: #2f5d3a;
  --red: #a53a2b;
  --amber: #b7791f;
  --danger-bg: #f6e2dc;
  --warn-bg: #f5e6cd;
  --ok-bg: #e3ead9;
  --radius: 2px;
  --radius-lg: 3px;
  --shadow: none;
  color-scheme: light;
}

* { box-sizing: border-box; }
/* The hidden attribute must win over component display rules (.btn is
   inline-flex), or script-toggled buttons and panels never disappear. */
[hidden] { display: none !important; }
html, body { padding: 0; margin: 0; }

body {
  font-family: 'Inter Tight', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Fraunces', Georgia, 'Times New Roman', serif;
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

a { color: var(--accent); }

.app-shell {
  min-height: 100vh;
  background: var(--paper);
  display: flex;
  flex-direction: column;
}

.topbar {
  background: rgba(245, 241, 234, 0.9);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: var(--ink);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(15, 27, 45, 0.1);
  flex-wrap: wrap;
  gap: 8px;
}

.topbar .brand {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  color: var(--ink);
  text-decoration: none;
}

.topbar .brand .accent { color: var(--accent); }

.topbar nav {
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
}

.topbar nav a {
  color: var(--ink);
  text-decoration: none;
  padding: 7px 10px;
  border-radius: var(--radius);
  font-size: 0.85rem;
  font-weight: 500;
}

.topbar nav a.active, .topbar nav a:hover {
  background: var(--ink);
  color: var(--paper);
}

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  margin-left: 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 700;
  line-height: 1;
  vertical-align: 2px;
}
.nav-badge[hidden] { display: none; }

.main {
  flex: 1;
  max-width: 1100px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 60px;
}

.main.narrow { max-width: 640px; }

.card {
  background: #fff;
  border: 1px solid rgba(15, 27, 45, 0.1);
  border-radius: var(--radius-lg);
  padding: 24px 22px;
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

.card h1, .card h2, .card h3 { margin-top: 0; }

h1 { font-size: 1.7rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.05rem; font-family: inherit; font-weight: 700; letter-spacing: normal; }

.page-title { color: var(--ink); margin: 4px 0 20px; }
.page-title h1 { margin: 0; font-size: 1.9rem; }
.page-title p { margin: 6px 0 0; color: var(--muted); font-size: 0.92rem; }

.grid { display: grid; gap: 16px; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }

label { display: block; font-weight: 600; font-size: 0.8rem; margin: 12px 0 6px; color: var(--ink); text-transform: uppercase; letter-spacing: 0.03em; }
.field-hint { color: var(--muted); font-size: 0.78rem; margin-top: 4px; }
.import-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
}
.import-provenance { border-left: 4px solid var(--amber); }
.permission-confirmation {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  text-transform: none;
  letter-spacing: normal;
  font-size: 0.9rem;
  font-weight: 600;
}
.permission-confirmation input { width: auto; margin-top: 3px; }

input:not([type]), input[type=text], input[type=email], input[type=password], input[type=number],
input[type=date], input[type=time], input[type=search], input[type=file], select, textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid rgba(15, 27, 45, 0.25);
  border-radius: var(--radius);
  font-size: 1rem;
  background: #fff;
  color: var(--ink);
  font-family: inherit;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, select:focus, textarea:focus, button:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}
input:focus, select:focus, textarea:focus { border-color: var(--accent); }

.checkbox-line { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.checkbox-line input { width: auto; }
.checkbox-line label { margin: 0; font-weight: 500; text-transform: none; letter-spacing: normal; }

.form-row { display: flex; gap: 12px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 140px; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--accent);
  color: var(--paper);
  border: 1px solid var(--accent);
  padding: 12px 20px;
  border-radius: var(--radius);
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  font-family: inherit;
}
.btn:hover { background: #a8441a; border-color: #a8441a; }
.btn.secondary { background: transparent; color: var(--ink); border: 1px solid rgba(15, 27, 45, 0.3); }
.btn.secondary:hover { background: rgba(15, 27, 45, 0.06); }
.btn.danger { background: var(--red); border-color: var(--red); }
.btn.danger:hover { background: #8a2f22; border-color: #8a2f22; }
.btn.ghost { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.btn.small { padding: 8px 12px; font-size: 0.8rem; min-height: 36px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }

.alert { padding: 12px 14px; border-radius: var(--radius); margin: 14px 0; font-size: 0.9rem; border: 1px solid transparent; }
.alert.error { background: var(--danger-bg); color: var(--red); border-color: rgba(165, 58, 43, 0.3); }
.alert.warn { background: var(--warn-bg); color: var(--amber); border-color: rgba(183, 121, 31, 0.3); }
.alert.ok { background: var(--ok-bg); color: var(--green); border-color: rgba(47, 93, 58, 0.3); }

table.data { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
table.data th, table.data td { text-align: left; padding: 10px 8px; border-bottom: 1px solid rgba(15, 27, 45, 0.1); }
table.data th { color: var(--muted); font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.04em; font-weight: 600; }
table.data tr:last-child td { border-bottom: none; }
table.data tbody tr:hover { background: rgba(198, 83, 31, 0.05); }

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(15, 27, 45, 0.08);
  color: var(--muted);
}
.badge.published { background: var(--green); color: #fff; }
.badge.draft { background: rgba(15, 27, 45, 0.06); color: var(--muted); }
.badge.unlisted { background: var(--warn-bg); color: var(--amber); }
.badge.private { background: var(--ink); color: var(--paper); }
.badge.tag { background: var(--paper-2); color: var(--ink); font-weight: 600; text-transform: none; }

/* Local AI jobs. Every badge also carries its word, never colour alone. */
.badge.job-queued { background: var(--warn-bg); color: var(--amber); }
.badge.job-running { background: var(--ink); color: var(--paper); }
.badge.job-done { background: var(--green); color: #fff; }
.badge.job-failed { background: var(--danger-bg); color: var(--red); }
.badge.job-cancelled { background: rgba(15, 27, 45, 0.06); color: var(--muted); }
.ai-worker-status { font-size: 0.88rem; padding: 8px 12px; border-left: 3px solid var(--muted); background: rgba(15, 27, 45, 0.04); }
.ai-worker-status.online { border-left-color: var(--green); }
.ai-worker-status.offline { border-left-color: var(--amber); }
.ai-photo-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.ai-photo-preview canvas { border: 1px solid rgba(15, 27, 45, 0.2); background: #fff; max-width: 140px; height: auto; }
.ai-job-heading { margin: 22px 0 8px; font-size: 1rem; }
.ai-job-list { list-style: none; margin: 0; padding: 0; }
.ai-job { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 14px; padding: 10px 0; border-bottom: 1px solid rgba(15, 27, 45, 0.1); }
.ai-job:last-child { border-bottom: none; }
.ai-job-main { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 10px; min-width: 0; flex: 1 1 260px; }
.ai-job-label { overflow-wrap: anywhere; }
.ai-job-detail { color: var(--muted); font-size: 0.85rem; flex-basis: 100%; }
.ai-job-actions { display: flex; flex-wrap: wrap; gap: 6px; }
#recipe-import-ai-fallback { margin-top: 4px; }

footer.site-footer { text-align: center; color: var(--muted); font-size: 0.78rem; padding: 20px 0 40px; }
footer.site-footer a { color: var(--muted); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); }

/* --- Recipe cards ------------------------------------------------- */

.recipe-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }

.recipe-card {
  background: #fff;
  border: 1px solid rgba(15, 27, 45, 0.1);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--ink);
}
.recipe-card:hover { border-color: var(--accent); }

.recipe-card .thumb {
  aspect-ratio: 3 / 2;
  background: var(--paper-2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  overflow: hidden;
}
.recipe-card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.recipe-card .thumb svg { width: 48px; height: 48px; opacity: 0.5; }

.recipe-card .body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.recipe-card h2 { font-size: 1.15rem; margin: 0; }
.recipe-card p { margin: 0; color: var(--muted); font-size: 0.85rem; }
.recipe-card .recipe-author { color: var(--accent); font-size: 0.78rem; font-weight: 600; }
.recipe-card .community-stats { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.76rem; }
.recipe-card .community-stats span:first-child { color: var(--amber); font-weight: 600; }
.recipe-card .meta { display: flex; gap: 10px; flex-wrap: wrap; color: var(--muted); font-size: 0.78rem; margin-top: auto; padding-top: 8px; }
.recipe-card .tags { display: flex; gap: 6px; flex-wrap: wrap; }

.recipe-guide { margin: 0; padding-left: 1.25rem; }
.recipe-guide li { margin: 0 0 0.65rem; line-height: 1.5; }
.recipe-guide li:last-child { margin-bottom: 0; }

/* --- Filter bar --------------------------------------------------- */

.filter-bar { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filter-bar .field { flex: 1; min-width: 150px; }
.filter-bar .field.grow { min-width: 220px; flex: 2; }
.filter-bar label { margin-top: 0; }

/* --- Recipe detail ------------------------------------------------ */

.recipe-banner { margin: 16px 0; }
.recipe-banner img {
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 1;
  object-fit: cover;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(15, 27, 45, 0.1);
  display: block;
}
@media (max-width: 700px) {
  .recipe-banner img { aspect-ratio: 4 / 3; }
}

.meta-line { display: flex; gap: 14px; flex-wrap: wrap; color: var(--muted); font-size: 0.85rem; margin: 10px 0; }
.meta-line strong { color: var(--ink); font-weight: 600; }

.servings-control { display: inline-flex; align-items: center; gap: 8px; }
.servings-control button {
  width: 40px; height: 40px; border-radius: var(--radius);
  border: 1px solid rgba(15, 27, 45, 0.3);
  background: #fff; font-size: 1.2rem; font-weight: 700; cursor: pointer; color: var(--ink);
}
.servings-control button:hover { border-color: var(--accent); color: var(--accent); }
.servings-control input {
  width: 64px; text-align: center; font-family: 'Fraunces', serif; font-size: 1.3rem;
  font-weight: 600; padding: 6px 4px; -moz-appearance: textfield;
}
.servings-control input::-webkit-outer-spin-button,
.servings-control input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

.ingredient-list { list-style: none; padding: 0; margin: 0; }
.ingredient-list li {
  padding: 9px 4px;
  border-bottom: 1px solid rgba(15, 27, 45, 0.08);
  display: flex;
  gap: 10px;
  align-items: baseline;
}
.ingredient-list li:last-child { border-bottom: none; }
.ingredient-list .qty { font-weight: 600; white-space: nowrap; min-width: 76px; font-variant-numeric: tabular-nums; }
.ingredient-list .optional-note { color: var(--muted); font-size: 0.82rem; }
.ingredient-group-title { margin: 18px 0 4px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; }

.step-list { padding-left: 0; margin: 0; list-style: none; counter-reset: step; }
.step-list li { display: flex; gap: 14px; padding: 10px 0; border-bottom: 1px solid rgba(15, 27, 45, 0.08); }
.step-list li:last-child { border-bottom: none; }
.step-list li::before {
  counter-increment: step;
  content: counter(step);
  font-family: 'Fraunces', serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--accent);
  min-width: 26px;
}
.step-list img { max-width: 220px; border-radius: var(--radius); display: block; margin-top: 8px; }

/* --- Recipe community -------------------------------------------- */

.community-card { margin-top: 18px; border-top: 3px solid var(--accent); }
.community-heading { display: flex; justify-content: space-between; gap: 20px; align-items: flex-start; }
.community-heading h2 { margin-bottom: 5px; }
.community-heading p { color: var(--muted); margin: 0; }
.rating-summary { min-width: 150px; text-align: right; display: flex; flex-direction: column; color: var(--muted); }
.rating-summary strong { color: var(--amber); font-family: 'Fraunces', serif; font-size: 1.35rem; }
.rating-summary span { font-size: 0.78rem; }

.community-actions { display: grid; grid-template-columns: minmax(260px, 0.8fr) minmax(320px, 1.2fr); gap: 18px; margin: 22px 0; }
.rating-form, .comment-form, .community-login {
  background: var(--paper-2);
  border: 1px solid rgba(15, 27, 45, 0.1);
  border-radius: var(--radius);
  padding: 14px;
}
.rating-form fieldset { border: 0; padding: 0; margin: 0 0 12px; }
.rating-form legend { font-weight: 700; margin-bottom: 10px; }
.rating-scale { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.rating-scale label { margin: 0; text-transform: none; letter-spacing: 0; cursor: pointer; }
.rating-scale input { position: absolute; opacity: 0; pointer-events: none; }
.rating-scale span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  border: 1px solid rgba(15, 27, 45, 0.22);
  border-radius: var(--radius);
  background: #fff;
  color: var(--ink);
}
.rating-scale input:checked + span { background: var(--amber); border-color: var(--amber); color: #fff; }
.rating-scale input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.rating-scale label:hover span { border-color: var(--amber); }
.comment-form label { margin-top: 0; }
.comment-form-footer { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-top: 8px; }
.community-login { margin: 18px 0; }
.community-login p { margin: 0; }

.comment-section { margin-top: 22px; }
.comment-list { display: grid; gap: 12px; }
.comment {
  border: 1px solid rgba(15, 27, 45, 0.1);
  border-radius: var(--radius);
  padding: 14px 16px;
  background: #fff;
}
.comment header { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 0.78rem; }
.comment header strong { color: var(--ink); font-size: 0.92rem; }
.comment > p { white-space: normal; line-height: 1.55; margin: 12px 0 0; }
.community-badge { margin-left: 5px; background: var(--paper-2); color: var(--accent); text-transform: none; }
.community-badge.admin { background: var(--ink); color: var(--paper); }
.comment-controls { display: flex; align-items: flex-start; gap: 8px; margin-top: 12px; }
.comment-controls details { flex: 1; }
.comment-controls summary { cursor: pointer; color: var(--accent); font-size: 0.82rem; font-weight: 600; }
.comment-controls textarea { margin: 8px 0; }
.community-empty { padding: 22px 12px; }

@media (max-width: 700px) {
  .community-heading { flex-direction: column; }
  .rating-summary { text-align: left; }
  .community-actions { grid-template-columns: 1fr; }
  .comment-form-footer, .comment header { align-items: flex-start; flex-direction: column; }
}

.gallery { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.gallery img { width: 130px; height: 90px; object-fit: cover; border-radius: var(--radius); border: 1px solid rgba(15, 27, 45, 0.12); }

/* --- Suggestions -------------------------------------------------- */

.suggest-bar { display: flex; gap: 10px; flex-wrap: wrap; }
details.filter-details { margin-top: 10px; }
details.filter-details summary { cursor: pointer; color: var(--muted); font-size: 0.85rem; }

/* --- Shopping list ------------------------------------------------ */

.list-category-title { margin: 20px 0 4px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; }
.shopping-list { list-style: none; padding: 0; margin: 0; }
.shopping-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 4px; border-bottom: 1px solid rgba(15, 27, 45, 0.08);
}
.shopping-list li:last-child { border-bottom: none; }
.shopping-list li.checked .item-label { text-decoration: line-through; color: var(--muted); }
.shopping-list input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--accent); flex-shrink: 0; }
.shopping-list .item-label { flex: 1; }
.shopping-list .item-qty { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.shopping-list .item-sources { color: var(--muted); font-size: 0.78rem; display: block; }
.shopping-list .item-actions { display: flex; gap: 4px; }
.shopping-list .item-actions button {
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 0.95rem; padding: 6px; min-width: 32px; min-height: 32px;
}
.shopping-list .item-actions button:hover { color: var(--red); }

/* --- Meal plan ---------------------------------------------------- */

.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.week-nav h2 { margin: 0; }

.plan-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.plan-day { background: #fff; border: 1px solid rgba(15, 27, 45, 0.1); border-radius: var(--radius-lg); padding: 14px 16px; }
.plan-day.today { border-color: var(--accent); }
.plan-day .day-name { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.plan-day .dish { font-family: 'Fraunces', serif; font-size: 1.05rem; }
.plan-day .dish a { color: var(--ink); text-decoration: none; }
.plan-day .dish a:hover { color: var(--accent); }
.plan-day .plan-meta { color: var(--muted); font-size: 0.82rem; margin: 4px 0 10px; }

/* --- Admin ingredient form rows ----------------------------------- */

.ing-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 2fr auto;
  gap: 8px;
  align-items: start;
  padding: 10px 0;
  border-bottom: 1px solid rgba(15, 27, 45, 0.08);
}
.ing-row input, .ing-row select { padding: 8px 10px; font-size: 0.9rem; }
.ing-row .row-flags { display: flex; gap: 12px; align-items: center; font-size: 0.8rem; grid-column: 1 / -1; color: var(--muted); }
.ing-row .row-flags label { display: inline-flex; gap: 4px; align-items: center; margin: 0; text-transform: none; font-weight: 500; letter-spacing: normal; font-size: 0.8rem; }
.ing-row .row-flags input { width: auto; }
.ing-row .canonical-status { grid-column: 1 / -1; font-size: 0.8rem; }
.canonical-status.linked { color: var(--green); }
.canonical-status.suggestion { color: var(--amber); }
.canonical-status .btn { margin-left: 6px; }
.row-remove { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.1rem; padding: 8px; }
.row-remove:hover { color: var(--red); }
.row-move { background: none; border: 1px solid rgba(15,27,45,0.2); border-radius: var(--radius); cursor: pointer; padding: 4px 8px; }

.autocomplete { position: relative; }
.autocomplete-list {
  position: absolute; z-index: 30; left: 0; right: 0; top: 100%;
  background: #fff; border: 1px solid rgba(15, 27, 45, 0.2);
  border-radius: var(--radius); max-height: 220px; overflow-y: auto;
  box-shadow: 0 4px 14px rgba(15, 27, 45, 0.12);
}
.autocomplete-list button {
  display: block; width: 100%; text-align: left; background: none; border: none;
  padding: 9px 12px; cursor: pointer; font-size: 0.9rem; font-family: inherit;
}
.autocomplete-list button:hover, .autocomplete-list button.active { background: var(--paper-2); }

.image-admin-grid { display: flex; gap: 12px; flex-wrap: wrap; }
.image-admin-item { width: 170px; border: 1px solid rgba(15, 27, 45, 0.12); border-radius: var(--radius); padding: 8px; }
.image-admin-item img { width: 100%; height: 100px; object-fit: cover; border-radius: var(--radius); display: block; }
.image-admin-item input { margin-top: 6px; padding: 6px 8px; font-size: 0.8rem; }
.image-admin-item .img-flags { font-size: 0.75rem; margin-top: 6px; display: flex; justify-content: space-between; align-items: center; }

@media (max-width: 700px) {
  .ing-row { grid-template-columns: 1fr 1fr; }
  .ing-row .cell-name { grid-column: 1 / -1; }
  .import-row { grid-template-columns: 1fr; }
}

@media print {
  body { background: #fff; }
  .topbar, .btn-row, .btn, .no-print, footer.site-footer, .servings-control button { display: none !important; }
  .card { box-shadow: none; border: 1px solid #ccc; }
}
.nemlig-match-row {
    display: grid;
    grid-template-columns: minmax(130px, 1fr) minmax(220px, 2fr) 90px;
    gap: 10px;
    align-items: end;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(15, 27, 45, .1);
}

@media (max-width: 680px) {
    .nemlig-match-row {
        grid-template-columns: 1fr;
        align-items: stretch;
    }

    .nemlig-match-row > [style*="grid-column"] {
        grid-column: auto !important;
    }
}

/* Logged-out landing page: login invitation (assets/js/login-prompt.js). */
.login-prompt {
  width: min(440px, calc(100vw - 32px));
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--paper);
  color: var(--ink);
}
.login-prompt::backdrop { background: rgba(15, 27, 45, 0.45); }
.login-prompt-body { padding: 24px; }
.login-prompt h2 { margin: 0 0 8px; }
.login-prompt ul { margin: 12px 0 18px; padding-left: 20px; }
.login-prompt li { margin: 4px 0; }
.login-prompt .btn-row { margin: 0; }
.login-prompt-note { margin: 14px 0 0; color: var(--muted); font-size: 0.9em; }

/* Phone tab bar (includes/layout.php render_tab_bar). Desktop keeps the top nav. */
.tab-bar { display: none; }
@media (max-width: 700px) {
  .topbar nav { display: none; }
  .topbar { padding: 12px 16px; }
  .main { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
  .tab-bar {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    background: rgba(245, 241, 234, 0.96);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border-top: 1px solid rgba(15, 27, 45, 0.15);
    padding: 4px 4px env(safe-area-inset-bottom);
  }
  .tab-bar .tab {
    flex: 1 1 0;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 54px;
    color: var(--muted);
    text-decoration: none;
    font-size: 0.72rem;
    font-weight: 600;
    border-radius: var(--radius);
  }
  .tab-bar .tab[aria-current="page"], .tab-bar .tab-more[data-active] > summary { color: var(--accent); }
  .tab-icon { width: 24px; height: 24px; }
  .tab-bar .nav-badge { position: absolute; top: 3px; left: 50%; margin-left: 6px; }
  .tab-more > summary {
    list-style: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    width: 100%;
    min-height: 54px;
    cursor: pointer;
  }
  .tab-more > summary::-webkit-details-marker { display: none; }
  .tab-more[open] > summary { color: var(--ink); }
  .tab-sheet {
    position: absolute;
    right: 4px;
    bottom: calc(100% + 8px);
    min-width: 200px;
    display: flex;
    flex-direction: column;
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 6px;
  }
  .tab-sheet a {
    padding: 12px 14px;
    color: var(--ink);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    border-radius: var(--radius);
  }
  .tab-sheet a:hover { background: rgba(15, 27, 45, 0.06); }
  .tab-sheet .nav-badge { position: static; margin-left: 6px; }
}

/* Recipe page: byline, info chips, actions on top (opskrift.php). */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.recipe-byline { color: var(--muted); font-size: 0.85rem; margin: 8px 0 6px; }
.recipe-byline strong { color: var(--ink); font-weight: 600; }
.recipe-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 10px; }
.recipe-chips .chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border: 1px solid rgba(15, 27, 45, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}
.recipe-chips .chip svg { width: 15px; height: 15px; }
.recipe-chips a.chip:hover { border-color: var(--ink); }
.recipe-actions { margin-top: 6px; }
.recipe-minor-actions { display: flex; flex-wrap: wrap; gap: 16px; margin: 2px 0 10px; }
.link-button {
  background: none;
  border: 0;
  padding: 4px 0;
  color: var(--muted);
  font: inherit;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
}
.link-button:hover { color: var(--ink); }

/* Tick off ingredients and steps (assets/js/cook-mode.js). */
.tickable { cursor: pointer; min-height: 44px; }
.tickable:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ingredient-list li.done, .step-list li.done { color: var(--muted); }
.ingredient-list li.done > span, .step-list li.done > div { text-decoration: line-through; text-decoration-thickness: 1px; }
.step-list li.done::before { color: var(--muted); }

/* Cooking mode: bigger text, only what you cook from, a stop button in reach. */
body.cooking .community-card,
body.cooking .recipe-banner,
body.cooking .recipe-chips,
body.cooking .recipe-byline,
body.cooking .recipe-gallery,
body.cooking .recipe-admin { display: none; }
body.cooking .ingredient-list li, body.cooking .step-list li { font-size: 1.15rem; line-height: 1.5; padding: 12px 4px; }
/* While cooking only the ingredients and steps stay; stopping is a small pill in reach. */
body.cooking .page-title p,
body.cooking .recipe-secondary,
body.cooking .recipe-minor-actions .js-print,
body.cooking .recipe-minor-actions .js-copy-url,
body.cooking .fold-card,
body.cooking .js-list-feedback { display: none; }
/* The tags carry an inline display, hence the !important. */
body.cooking #opskrift .tags { display: none !important; }
body.cooking .recipe-actions { margin: 0; }
body.cooking .js-cook-toggle,
body.cooking .recipe-actions .recipe-cook {
  position: fixed;
  right: 16px;
  left: auto;
  bottom: calc(16px + env(safe-area-inset-bottom));
  z-index: 25;
  width: auto;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: .9rem;
  box-shadow: 0 6px 18px rgba(15, 27, 45, .25);
}
body.cooking .js-cook-toggle::before { content: "\2715"; margin-right: 8px; font-weight: 400; }
@media (max-width: 700px) {
  /* Above the tab bar; a running timer sits on the row above. */
  body.cooking .js-cook-toggle,
  body.cooking .recipe-actions .recipe-cook { bottom: calc(76px + env(safe-area-inset-bottom)); }
  body.cooking .timer-panel { bottom: calc(130px + env(safe-area-inset-bottom)); }
  body.cooking .main { padding-bottom: calc(190px + env(safe-area-inset-bottom)); }
}
@media print {
  .recipe-minor-actions, .recipe-chips a.chip { display: none; }
  .ingredient-list li.done > span, .step-list li.done > div { text-decoration: none; }
}

/* Front page: search up front, category chips, category art on cards (index.php). */
.search-card { display: flex; flex-direction: column; gap: 12px; }
.search-row { display: flex; gap: 8px; }
.search-row input[type="search"] { flex: 1; min-width: 0; font-size: 1rem; margin: 0; }
.search-row .btn { flex: 0 0 auto; }
.category-chips {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  margin: 2px -4px 0;
  padding: 2px 4px 4px;
  -webkit-overflow-scrolling: touch;
}
.category-chips::-webkit-scrollbar { display: none; }
.category-chips .chip {
  flex: 0 0 auto;
  padding: 8px 14px;
  border: 1px solid rgba(15, 27, 45, 0.18);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}
.category-chips .chip:hover { border-color: var(--ink); }
.category-chips .chip.active { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.search-card details.filter-details { margin-top: 0; }
.suggest-bar { align-items: center; }
.suggest-label { color: var(--muted); font-size: 0.85rem; margin-right: 2px; }
.filter-reset { margin: 0; font-size: 0.85rem; }
.recipe-card .thumb.thumb-art svg.category-art { width: 38%; height: auto; max-width: 110px; opacity: 1; }
@media (max-width: 700px) {
  .recipe-card .thumb.thumb-art { aspect-ratio: 3 / 1; }
  .recipe-card .thumb.thumb-art svg.category-art { width: 22%; }
  .suggest-label { flex-basis: 100%; }
}

/* AI meal plan (madplan.php). */
.ai-plan textarea { width: 100%; resize: vertical; }
.ai-plan .btn-row { margin-top: 10px; }
.ai-plan .random-week { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(15, 27, 45, 0.08); }
.ai-plan .random-week:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.ai-plan-pending { border-left: 3px solid var(--accent); }
.ai-plan-pending h2 { margin-bottom: 4px; }
.plan-reason { margin: 6px 0 4px; color: var(--muted); font-size: 0.82rem; font-style: italic; }
.plan-reason .badge { font-style: normal; font-size: 0.68rem; padding: 1px 6px; vertical-align: 1px; }
.ai-plan-summary p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.ai-plan-summary .badge { font-size: 0.68rem; padding: 1px 6px; vertical-align: 1px; }

/* Nutrition per person (opskrift.php, index.php, madplan.php). */
.nutrition-card h2 { margin-bottom: 10px; }
.nutrition-grid { display: flex; flex-wrap: wrap; gap: 14px 28px; align-items: flex-start; }
.nutrition-kcal { font-size: 0.95rem; color: var(--muted); }
.nutrition-kcal strong { display: block; font-family: 'Fraunces', Georgia, serif; font-size: 2.2rem; font-weight: 600; color: var(--ink); line-height: 1; }
.nutrition-grid dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px 22px; margin: 0; flex: 1; min-width: 240px; }
.nutrition-grid dt { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); font-weight: 700; }
.nutrition-grid dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; }
.nutrition-grid dd span { display: block; font-weight: 400; font-size: 0.8rem; color: var(--muted); }
.nutrition-card .field-hint { margin-top: 12px; }
.recipe-card .meta .nutrition-chip { color: var(--green); font-weight: 600; }
.plan-nutrition { margin: 4px 0 0; color: var(--muted); font-size: 0.8rem; }
body.cooking .nutrition-card { display: none; }
.plan-week-nutrition { color: var(--muted); font-size: 0.9rem; margin: 4px 2px 14px; }
.nutrition-cell { min-width: 220px; font-size: 0.85rem; }
.nutrition-cell details summary { cursor: pointer; color: var(--accent); font-size: 0.8rem; margin-top: 4px; }
.nutrition-form { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: end; margin-top: 6px; }
.nutrition-form label { margin: 0; font-size: 0.75rem; }
.nutrition-form input[type="number"], .nutrition-form input[type="text"] { width: 110px; padding: 6px; }
.nutrition-form label.inline { display: flex; gap: 4px; align-items: center; text-transform: none; }
.usda-results { margin: 10px 0 0; padding-left: 18px; font-size: 0.85rem; }
.usda-results code { font-weight: 700; }

/* Members' photos of a dish (opskrift.php, MemberPhotoService). */
.member-photos { margin: 22px 0 6px; }
.member-photos h3 { margin-bottom: 10px; }
.member-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.member-photo { margin: 0; background: #fff; border: 1px solid rgba(15, 27, 45, 0.1); border-radius: var(--radius-lg); overflow: hidden; }
.member-photo img { display: block; width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; }
.member-photo figcaption { padding: 8px 10px; font-size: 0.82rem; display: flex; flex-direction: column; gap: 2px; }
.member-photo-by { color: var(--muted); font-size: 0.75rem; }
.member-photo form { margin: 0; }
.member-photo-form { display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: end; margin-top: 14px; padding-top: 12px; border-top: 1px solid rgba(15, 27, 45, 0.08); }
.member-photo-form > div { flex: 1 1 220px; }
.member-photo-form .field-hint { flex-basis: 100%; margin: 0; }
.member-photo-form input[type="text"] { width: 100%; }
body.cooking .member-photos { display: none; }
.recipe-banner { position: relative; }
.recipe-banner-note { position: absolute; right: 10px; bottom: 10px; margin: 0; padding: 3px 8px; border-radius: 999px; background: rgba(15, 27, 45, 0.6); color: #fff; font-size: 0.72rem; }
.household-members { list-style: none; padding: 0; margin: 8px 0; }
.household-members li { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(15, 27, 45, 0.08); }
.household-members form { margin: 0; }
.household-invite { border-left: 3px solid var(--accent); }

/* Favourites (the heart). */
.favorite-button { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 1px solid rgba(15, 27, 45, 0.3); border-radius: var(--radius); padding: 0 12px; min-height: 44px; color: var(--ink); font: inherit; font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.favorite-button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.favorite-button[aria-pressed="true"] { color: var(--accent); }
.favorite-button[aria-pressed="true"] svg { fill: currentColor; }
.recipe-card-wrap { position: relative; }
.favorite-button.on-card { position: absolute; top: 8px; right: 8px; z-index: 2; min-height: 40px; width: 40px; padding: 0; justify-content: center; border: 0; border-radius: 999px; background: rgba(255, 255, 255, 0.92); }
.chip-favorite.active { background: var(--accent); border-color: var(--accent); }
@media print { .favorite-button { display: none; } }

/* Timers in recipe steps (assets/js/step-timers.js). */
.step-timer { display: inline; padding: 1px 8px; margin: 0 1px; border: 1px solid var(--accent); border-radius: 999px; background: #fff7f2; color: var(--accent); font: inherit; font-weight: 600; cursor: pointer; }
.step-timer::before { content: "⏱ "; }
.timer-panel { position: fixed; left: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 26; display: flex; flex-direction: column; gap: 6px; }
.timer-row { display: flex; gap: 14px; align-items: center; padding: 2px 14px; border-radius: var(--radius-lg); background: var(--ink); color: var(--paper); font-weight: 600; font-variant-numeric: tabular-nums; }
.timer-row .link-button { min-width: 44px; min-height: 44px; color: var(--accent-soft); }
.timer-row.done { background: var(--accent); animation: timer-pulse 1s ease-in-out infinite alternate; }
.timer-row.done .link-button { color: #fff; }
@keyframes timer-pulse { from { opacity: 1; } to { opacity: 0.75; } }
@media (max-width: 700px) { .timer-panel { bottom: calc(80px + env(safe-area-inset-bottom)); } }

/* "Spørg om retten" (assets/js/ask.js). */
.ask-form { display: flex; gap: 8px; align-items: flex-end; margin-top: 8px; }
.ask-form textarea { flex: 1; min-width: 0; resize: vertical; margin: 0; }
.ask-list { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 12px; }
.ask-list li { padding: 12px 14px; border-radius: var(--radius-lg); background: rgba(15, 27, 45, 0.04); }
.ask-q { margin: 0 0 6px; font-weight: 600; }
.ask-a { margin: 0; line-height: 1.5; white-space: pre-line; }
.ask-list li[data-status="queued"] .ask-a, .ask-list li[data-status="running"] .ask-a { color: var(--muted); font-style: italic; }
body.cooking .ask-card { display: none; }
.grocery-ai-status { margin: 0 0 12px; padding: 8px 12px; border-left: 3px solid var(--accent); background: rgba(198, 83, 31, 0.06); font-size: 0.9rem; }
.grocery-ai-note { display: block; margin-top: 4px; color: var(--green); font-size: 0.75rem; font-weight: 600; }
.grocery-ai-note[hidden] { display: none; }
.push-card .btn-row { margin-top: 8px; align-items: center; }

/* "Hvad har jeg i køleskabet?" */
.fridge-form textarea { width: 100%; }
.fridge-form .btn { margin-top: 8px; }
.fridge-fit { display: flex; flex-direction: column; gap: 2px; margin: 8px 0 0; font-size: 0.9rem; }
.fridge-used { color: var(--accent); font-weight: 600; }
.fridge-missing { color: var(--muted); }
.fridge-missing.none { color: var(--green); font-weight: 600; }
.fridge-picks { margin: 8px 0 0; padding-left: 1.4em; display: grid; gap: 12px; }
.fridge-picks li p { margin: 2px 0 0; }
.fridge-pick-title { font-weight: 700; font-size: 1.05rem; }
.fridge-why { color: var(--ink); }
.fridge-results-heading { margin: 24px 0 12px; }

/* Store preview on the shopping list (indkoebsliste.php, assets/js/grocery-ai.js). */
.gp-intro p { color: var(--muted); font-size: .9rem; margin: 6px 0 10px; }
.gp-intro .gp-check { color: var(--amber); font-weight: 600; }
.gp-list { display: grid; gap: 10px; }
.gp-row { border: 1px solid rgba(15, 27, 45, .14); border-radius: var(--radius-lg); background: #fff; padding: 12px; }
.gp-row.gp-flagged { border-color: var(--amber); }
.gp-row.gp-skipped { opacity: .55; }
.gp-row.gp-skipped .gp-chosen, .gp-row.gp-skipped .gp-stepper { display: none; }
.gp-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 8px; }
.gp-title { display: block; font-size: 1rem; }
.gp-need { display: block; font-size: .8rem; color: var(--muted); }
.gp-badges { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.gp-badge { display: inline-block; font-size: .72rem; font-weight: 600; padding: 2px 7px; border-radius: 999px; background: var(--paper-2); color: var(--ink); white-space: nowrap; }
.gp-badge.warn { background: var(--warn-bg); color: #7a4c0c; }
.gp-badge.offer { background: var(--danger-bg); color: var(--red); }
.gp-badge.ai { background: var(--ok-bg); color: var(--green); }
.gp-chosen, .gp-alt { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; }
.gp-thumb { width: 56px; height: 56px; border-radius: var(--radius); background: var(--paper-2); overflow: hidden; display: block; }
.gp-thumb img { width: 100%; height: 100%; object-fit: contain; background: #fff; display: block; }
.gp-info { min-width: 0; display: grid; gap: 2px; }
.gp-name { font-weight: 600; line-height: 1.25; }
.gp-meta { font-size: .8rem; color: var(--muted); }
.gp-line, .gp-price { font-weight: 700; white-space: nowrap; text-align: right; }
.gp-price s { display: block; font-weight: 400; font-size: .78rem; color: var(--muted); }
.gp-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 10px; }
.gp-stepper { display: inline-flex; align-items: stretch; border: 1px solid rgba(15, 27, 45, .25); border-radius: var(--radius); overflow: hidden; }
.gp-stepper input { width: 3.2em; text-align: center; border: 0; border-radius: 0; padding: 6px 2px; margin: 0; -moz-appearance: textfield; }
.gp-stepper input::-webkit-outer-spin-button, .gp-stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.gp-step { min-width: 40px; min-height: 40px; border: 0; background: var(--paper-2); font-size: 1.15rem; font-weight: 700; cursor: pointer; color: var(--ink); }
.gp-step:active { background: var(--accent-soft); }
.gp-alts { flex: 1 1 100%; }
.gp-alts > summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: .9rem; display: inline-block; padding: 6px 0; }
.gp-alts fieldset { border: 0; padding: 0; margin: 6px 0 0; display: grid; gap: 6px; }
.gp-alt { grid-template-columns: auto 56px 1fr auto; padding: 8px; border: 1px solid rgba(15, 27, 45, .12); border-radius: var(--radius); cursor: pointer; text-transform: none; letter-spacing: 0; font-weight: 400; margin: 0; }
.gp-alt:has(input:checked) { border-color: var(--accent); background: #fff7f1; }
.gp-alt input { width: auto; margin: 0; accent-color: var(--accent); }
.gp-alt.gp-skip-option { grid-template-columns: auto 1fr; }
.gp-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.gp-none { color: var(--muted); margin: 0; font-size: .9rem; }
.gp-bar {
  position: sticky; bottom: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: 14px -12px 0; padding: 12px; background: rgba(245, 241, 234, .97);
  border-top: 1px solid rgba(15, 27, 45, .15); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.gp-sum { font-weight: 700; font-size: .95rem; }
.gp-sum small { display: block; font-weight: 400; color: var(--muted); font-size: .75rem; }
.gp-bar .btn { margin: 0; white-space: nowrap; }
.gp-cancel { margin-top: 8px; }
@media (max-width: 700px) {
  /* Above the phone tab bar. */
  .gp-bar { bottom: calc(62px + env(safe-area-inset-bottom)); }
  .gp-alt { grid-template-columns: auto 44px 1fr auto; gap: 8px; }
  .gp-alt .gp-thumb { width: 44px; height: 44px; }
}
.gp-sent { background: var(--ok-bg); border-radius: var(--radius-lg); padding: 12px; margin: 10px 0; }
.gp-sent p { margin: 0 0 8px; font-size: .9rem; }
.gp-sent .btn-row { align-items: center; margin: 0; }
.gp-badge.memory { background: #e6eef7; color: #1d4f86; }
.faste-varer { list-style: none; margin: 0; padding: 0; }
.faste-varer li { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(15, 27, 45, .1); }
.faste-varer li > span { display: grid; gap: 2px; min-width: 0; }

/* Calmer screens (2.24): compact recipe cards, chips for choosing, less text. */
.recipe-card .body { padding: 10px 12px 12px; gap: 4px; }
.recipe-card h2 { font-size: 1.05rem; line-height: 1.25; }
.recipe-card .card-facts { color: var(--muted); font-size: .8rem; }
.recipe-card .card-facts .nutrition-chip { color: var(--green); font-weight: 600; }
.recipe-card .card-rating { color: var(--amber); font-weight: 600; }
.recipe-card .card-desc { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card-actions { margin-top: 6px; }
.suggest-bar { gap: 8px; margin-top: 12px; }
.suggest-bar .chip { text-decoration: none; }
@media (max-width: 700px) {
  .recipe-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .recipe-card .thumb, .recipe-card .thumb.thumb-art { aspect-ratio: 4 / 3; }
  .recipe-card .thumb.thumb-art svg.category-art { width: 40%; }
  .recipe-card h2 { font-size: .95rem; }
  .recipe-card .body { padding: 8px 10px 10px; }
  .recipe-card .card-desc { display: none; }
  .favorite-button.on-card { top: 6px; right: 6px; min-height: 34px; width: 34px; }
  .favorite-button.on-card svg { width: 18px; height: 18px; }
  .card-actions .btn { flex: 1 1 auto; padding-left: 8px; padding-right: 8px; }
}
.suggest-bar .chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border: 1px dashed rgba(15, 27, 45, .28); border-radius: 999px; background: transparent; color: var(--ink); font-size: .85rem; font-weight: 600; white-space: nowrap; }
.suggest-bar .chip:hover { border-color: var(--accent); color: var(--accent); }
/* Sections that fold away on the recipe page (Næring, Spørg, Bedømmelser). */
.fold-card > summary { list-style: none; cursor: pointer; display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 12px; }
.fold-card > summary::-webkit-details-marker { display: none; }
.fold-card > summary h2 { margin: 0; font-size: 1.15rem; }
.fold-card > summary h2::after { content: " ›"; color: var(--accent); display: inline-block; transition: transform .15s; }
.fold-card[open] > summary h2::after { transform: rotate(90deg); }
.fold-card > summary .fold-sum { color: var(--muted); font-size: .85rem; }
.fold-card[open] > summary { margin-bottom: 12px; }
.recipe-actions { display: grid; gap: 8px; margin: 14px 0 6px; }
.recipe-actions .recipe-cook { width: 100%; justify-content: center; }
.recipe-actions .recipe-secondary { margin: 0; }
@media (max-width: 700px) {
  .recipe-actions .recipe-secondary > .btn { flex: 1 1 0; padding-left: 8px; padding-right: 8px; }
}
/* Meal plan: a one-line week switcher, empty days with just the dish. */
.week-nav-compact { margin: 0 0 14px; flex-wrap: nowrap; }
.week-nav-compact h2 { font-size: 1.1rem; text-align: center; flex: 1; }
.week-step { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid rgba(15, 27, 45, .2); border-radius: 999px; background: #fff; color: var(--ink); font-size: 1.6rem; line-height: 1; text-decoration: none; flex: none; }
.week-step:hover { border-color: var(--accent); color: var(--accent); }
.plan-more { margin-top: 6px; }
.plan-more > summary { cursor: pointer; color: var(--muted); font-size: .82rem; }
.ai-plan textarea { margin-top: 4px; }
/* Shopping list: add an item in one line at the top. */
.quick-add { margin: 0 0 12px; }
.quick-add-row { display: flex; gap: 8px; }
.quick-add-row input { flex: 1; min-width: 0; margin: 0; }
.quick-add-row .btn { margin: 0; flex: none; }
.quick-add-more > summary { cursor: pointer; color: var(--muted); font-size: .82rem; margin-top: 6px; }
@media (min-width: 701px) {
  .recipe-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
  .recipe-actions .recipe-cook { width: auto; }
}
/* Notifications on Min konto. */
.notify-kinds fieldset { border: 0; padding: 0; margin: 12px 0; display: grid; gap: 6px; }
.notify-kinds legend { font-weight: 600; margin-bottom: 4px; }
.notify-kind { display: flex; align-items: flex-start; gap: 10px; text-transform: none; letter-spacing: 0; font-weight: 400; margin: 0; padding: 6px 0; }
.notify-kind input { width: auto; margin-top: 3px; accent-color: var(--accent); }

/* Admin on phones: grouped "Mere" menu, tiles, tables as cards. */
.tab-sheet-heading { margin: 8px 12px 2px; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tab-sheet-heading:first-child { margin-top: 4px; }
@media (max-width: 700px) {
  .tab-sheet { max-height: calc(100vh - 120px); overflow-y: auto; }
}
.admin-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 0 0 22px; }
.admin-tile { display: grid; gap: 2px; padding: 14px; background: #fff; border: 1px solid rgba(15, 27, 45, .12); border-radius: var(--radius-lg); color: var(--ink); text-decoration: none; }
.admin-tile:hover { border-color: var(--accent); }
.admin-tile strong { font-size: 1rem; }
.admin-tile span { color: var(--muted); font-size: .82rem; }
.admin-section-title { margin: 0 0 12px; font-size: 1.2rem; }
@media (max-width: 700px) {
  .admin-tiles { grid-template-columns: 1fr 1fr; gap: 8px; }
  .admin-tile { padding: 12px; }
  .admin-tile span { font-size: .76rem; }
  /* Without the script a wide table can at least scroll sideways. */
  table.data:not(.stack) { display: block; overflow-x: auto; }
  table.data.stack, table.data.stack tbody, table.data.stack tr, table.data.stack td { display: block; width: 100%; }
  table.data.stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.data.stack tr { padding: 10px 0; border-bottom: 1px solid rgba(15, 27, 45, .12); }
  table.data.stack tr:last-child { border-bottom: 0; }
  table.data.stack tbody tr:hover { background: transparent; }
  table.data.stack td { display: grid; grid-template-columns: 7.5em 1fr; gap: 8px; align-items: start; padding: 3px 0; border: 0; overflow-wrap: anywhere; }
  table.data.stack td::before { content: attr(data-label); color: var(--muted); font-size: .7rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding-top: 2px; }
  table.data.stack td:not([data-label])::before, table.data.stack td[data-label=""]::before { content: none; }
  table.data.stack td:not([data-label]), table.data.stack td[data-label=""] { grid-template-columns: 1fr; }
  /* The first column (the name) reads as the card's title. */
  table.data.stack td:first-child { grid-template-columns: 1fr; font-weight: 600; font-size: 1rem; }
  table.data.stack td:first-child::before { content: none; }
}
@media (max-width: 700px) {
  table.data.stack td { justify-items: start; }
}
/* Only a box on phones; on wide screens it does not exist for layout. */
.cell-body { display: contents; }
@media (max-width: 700px) {
  table.data.stack .cell-body { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
}
/* Login page. */
.login-wrap { max-width: 420px; margin: 24px auto 0; }
.login-remember { display: flex; align-items: center; gap: 8px; margin-top: 12px; text-transform: none; letter-spacing: 0; font-weight: 400; }
.login-remember input { width: auto; margin: 0; accent-color: var(--accent); }
.login-or { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; margin: 14px 0 4px; }
.login-or::before, .login-or::after { content: ""; flex: 1; border-top: 1px solid rgba(15, 27, 45, .15); }
.login-link { margin-top: 16px; }
.login-link > summary { cursor: pointer; color: var(--accent); font-size: .9rem; }
.login-link form { margin-top: 8px; }
.login-new { text-align: center; color: var(--muted); font-size: .88rem; margin-top: 14px; }
.konto-sub { font-size: 1rem; margin: 16px 0 6px; }

/* Admin -> Oversigt: usage card */
.usage-table td, .usage-table th { text-align: right; white-space: nowrap; }
.usage-table td:first-child, .usage-table th:first-child { text-align: left; }
.usage-away { color: var(--accent); font-weight: 600; }

/* Admin -> Brug */
.usage-periods { margin-bottom: 14px; }
.stat-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-bottom: 16px; }
.stat { background: #fff; border: 1px solid rgba(15, 27, 45, 0.1); border-radius: var(--radius-lg); padding: 14px 16px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.stat-value { font-family: 'Fraunces', Georgia, serif; font-size: 1.5rem; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-value small { font-family: 'Inter Tight', sans-serif; font-size: 0.8rem; color: var(--muted); }
.stat-label { color: var(--muted); font-size: 0.78rem; }
.usage-members td, .usage-members th { white-space: nowrap; font-variant-numeric: tabular-nums; }
.usage-bars { display: flex; align-items: flex-end; gap: 2px; height: 120px; padding: 6px 0; border-bottom: 1px solid rgba(15, 27, 45, 0.1); }
.usage-bar { flex: 1 1 0; min-width: 2px; background: rgba(15, 27, 45, 0.15); border-radius: 1px 1px 0 0; }
.usage-bar.on { background: var(--accent); }
.usage-adoption { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.usage-adoption li { display: grid; grid-template-columns: minmax(0, 1fr) 40% 28px; align-items: center; gap: 10px; font-size: 0.9rem; }
.usage-adoption strong { text-align: right; font-variant-numeric: tabular-nums; }
.usage-meter { height: 8px; background: var(--paper-2); border-radius: 999px; overflow: hidden; }
.usage-meter span { display: block; height: 100%; background: var(--accent); }

/* Quick add (tilfoej.php) and the Siri/widget steps on Min konto */
.quick-add { max-width: 640px; margin: 0 auto; }
.quick-add textarea { width: 100%; font-size: 1.1rem; min-height: 72px; }
.quick-add-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-add-chips .chip { padding: 8px 14px; border: 1px solid rgba(15, 27, 45, 0.18); border-radius: 999px; background: #fff; color: var(--ink); font: 600 0.85rem/1.2 inherit; font-family: inherit; cursor: pointer; min-height: 40px; }
.quick-add-chips .chip:hover { border-color: var(--ink); }
.quick-add-more { text-align: center; }
.shortcut-steps { padding-left: 20px; display: flex; flex-direction: column; gap: 10px; }
.shortcut-steps .import-row { margin-top: 6px; }
.shortcut-steps code { background: var(--paper-2); padding: 1px 6px; border-radius: 2px; }

/* Min konto: shops as rows with a Forbind button; the login form opens on request (konto.php). */
.konto-jump { margin-bottom: 16px; }
.shop-list { list-style: none; margin: 14px 0; padding: 0; border-top: 1px solid var(--line); }
.shop-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.shop-name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.shop-name .field-hint { margin: 0; overflow-wrap: anywhere; }
.shop-form { padding: 6px 0 18px; border-bottom: 1px solid var(--line); }
.shop-remove { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line); }
.inline-check { display: flex; align-items: center; gap: 8px; text-transform: none; letter-spacing: 0; }
.inline-check input { width: auto; }

/* Fejl og ønsker (sager.php). */
.ticket-kinds { border: 0; padding: 0; margin: 0 0 6px; }
.ticket-kinds legend { font-weight: 600; margin-bottom: 8px; }
.ticket-kind { display: flex; align-items: center; gap: 10px; padding: 12px 14px; margin: 0 0 8px; border: 1px solid var(--line); border-radius: var(--radius); text-transform: none; letter-spacing: 0; font-size: 1rem; cursor: pointer; }
.ticket-kind input { width: auto; margin: 0; }
.ticket-kind:has(input:checked) { border-color: var(--accent); background: var(--paper-2); }
.ticket-list li { align-items: center; }
.ticket-list .field-hint { display: block; margin-top: 4px; }
.ticket-answer { border-left: 3px solid var(--accent); }
.ticket-status-row { flex-wrap: wrap; }
.ticket-prompt { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.78rem; line-height: 1.45; white-space: pre; overflow: auto; }
.ticket-reply-suggestion { background: var(--paper-2); padding: 10px 12px; border-radius: var(--radius); }
