/* Diet plan web app. Mobile first, light and dark via prefers-color-scheme. */

:root {
  --bg: #f6f7f4;
  --surface: #ffffff;
  --surface-2: #eef1ec;
  --text: #1c2420;
  --muted: #56615b;
  --border: #d4dad3;
  --accent: #2f7d4f;
  --accent-strong: #236140;
  --accent-text: #ffffff;
  --focus: #1b5fd1;
  --warn-bg: #fff4dc;
  --warn-border: #c98a00;
  --info-bg: #e8f1fb;
  --info-border: #3b74b8;
  --error-bg: #fde9e7;
  --error-border: #c0392b;
  --ok: #1e7a3f;
  --bad: #b3261e;
  --c-protein: #c0504d;
  --c-carbs: #d8a31a;
  --c-fat: #3b74b8;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 2px 8px rgba(0, 0, 0, 0.04);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121614;
    --surface: #1b211e;
    --surface-2: #232b27;
    --text: #e6ebe7;
    --muted: #a3ada7;
    --border: #36403b;
    --accent: #5cbf85;
    --accent-strong: #7ad19e;
    --accent-text: #0d1a12;
    --focus: #8ab4ff;
    --warn-bg: #3a2f14;
    --warn-border: #d9a53a;
    --info-bg: #182a3d;
    --info-border: #6a9fd8;
    --error-bg: #3d1c1a;
    --error-border: #e57368;
    --ok: #7ad19e;
    --bad: #f28b82;
    --c-protein: #e07a77;
    --c-carbs: #e6bd4c;
    --c-fat: #6a9fd8;
    --shadow: none;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.5;
}

.wrap {
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 0 16px;
}

h1, h2, h3, h4 {
  line-height: 1.25;
  margin: 0 0 0.5em;
}
h1 { font-size: 1.4rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 0.75em; }

a { color: var(--accent-strong); }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}
[tabindex="-1"]:focus { outline: 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;
}

.skip-link {
  position: absolute;
  left: 8px;
  top: -48px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  border-radius: var(--radius);
  z-index: 10;
}
.skip-link:focus { top: 8px; }

.muted { color: var(--muted); }
.hint { color: var(--muted); font-size: 0.875rem; margin: 0.25em 0 0; }

/* Header, banner, footer */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 16px 0 12px;
}
.header-row {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
}
.subtitle { color: var(--muted); margin: 0; font-size: 0.95rem; }

.banner {
  background: var(--warn-bg);
  border-bottom: 1px solid var(--warn-border);
  font-size: 0.9rem;
}
.banner-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 8px 16px;
}
.banner-inner p { margin: 0; }

main { padding-top: 16px; padding-bottom: 24px; }
main:focus { outline: none; }

.site-footer {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  padding-bottom: 32px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* Cards and callouts */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 16px;
}

.callout {
  border-left: 4px solid var(--info-border);
  background: var(--info-bg);
  border-radius: 6px;
  padding: 10px 12px;
  margin: 0 0 12px;
}
.callout > :last-child { margin-bottom: 0; }
.callout h3 { font-size: 1rem; }
.callout ul { margin: 0; padding-left: 1.2em; }
.callout-warn { border-left-color: var(--warn-border); background: var(--warn-bg); }
.callout-info { border-left-color: var(--info-border); background: var(--info-bg); }
.callout-error { border-left-color: var(--error-border); background: var(--error-bg); }

.legal-text h2 { font-size: 1.1rem; }
.legal-text h3 { font-size: 1rem; }
.legal-text ul { padding-left: 1.2em; }

/* Forms */
.grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 560px) {
  .grid { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 860px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .grid.grid-2 { grid-template-columns: 1fr 1fr; }
}

.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
fieldset.field { border: 0; padding: 0; margin: 0; }
legend, .field > label { font-weight: 600; font-size: 0.95rem; padding: 0; }

input[type="number"],
input[type="text"],
input[type="password"],
select,
textarea {
  font: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--muted);
  border-radius: 8px;
  padding: 10px 12px;
  min-height: 44px;
  width: 100%;
}
textarea { resize: vertical; }
input[aria-invalid="true"] { border-color: var(--bad); }

.radio-row { display: flex; flex-wrap: wrap; gap: 4px 16px; min-height: 44px; align-items: center; }
.check-row { display: flex; align-items: flex-start; gap: 8px; }
.check-row input { width: 20px; height: 20px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.check-row label { cursor: pointer; }

.allergens { margin-top: 16px !important; }
.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  margin-top: 6px;
}
@media (min-width: 560px) {
  .check-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (min-width: 860px) {
  .check-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

.seed-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: flex-start;
  margin-top: 16px;
}
.seed-row .field { flex: 1 1 200px; }
.seed-row .btn { margin-top: 27px; }

.consent-check { margin: 12px 0 4px; font-weight: 600; }
.field-error { color: var(--bad); font-weight: 600; margin: 4px 0 0; }

.error-summary {
  border: 2px solid var(--error-border);
  background: var(--error-bg);
  border-radius: 8px;
  padding: 10px 12px;
  margin-bottom: 12px;
}
.error-summary ul { margin: 0; padding-left: 1.2em; }
.error-summary p { margin: 0 0 4px; }

.privacy-note { color: var(--muted); font-size: 0.9rem; margin: 12px 0 0; }
.data-info { font-size: 0.85rem; margin-top: -8px; }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; align-items: center; }
.btn {
  font: inherit;
  font-weight: 600;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 16px;
  min-height: 44px;
  cursor: pointer;
  line-height: 1.2;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-text); }
.btn-primary:hover:not(:disabled) { background: var(--accent-strong); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover:not(:disabled) { border-color: var(--muted); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-link { background: none; border: 0; color: var(--accent-strong); text-decoration: underline; padding: 10px 4px; }
.btn-small { padding: 6px 10px; min-height: 36px; font-size: 0.875rem; background: var(--surface-2); color: var(--text); border-color: var(--border); white-space: nowrap; }
.btn-small:hover { border-color: var(--muted); }
.lang-toggle { flex: none; padding: 6px 12px; min-height: 40px; }

/* Plan */
.plan-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}
.plan-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.meta-line { font-size: 0.85rem; }

.stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}
@media (min-width: 560px) {
  .stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.stat {
  background: var(--surface-2);
  border-radius: 8px;
  padding: 10px 12px;
  border-top: 4px solid var(--accent);
  display: flex;
  flex-direction: column;
}
.stat.k-protein { border-top-color: var(--c-protein); }
.stat.k-carbs { border-top-color: var(--c-carbs); }
.stat.k-fat { border-top-color: var(--c-fat); }
.stat-label { font-size: 0.85rem; color: var(--muted); }
.stat-value { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.stat-unit { font-size: 0.9rem; font-weight: 500; color: var(--muted); }

.segmented {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 4px 0 12px;
}
.seg-btn {
  font: inherit;
  font-weight: 600;
  background: var(--surface);
  color: var(--text);
  border: 0;
  padding: 8px 14px;
  min-height: 44px;
  cursor: pointer;
}
.seg-btn + .seg-btn { border-left: 1px solid var(--border); }
.seg-btn[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }

.tabs {
  display: flex;
  gap: 4px;
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
  scrollbar-width: thin;
}
.tab {
  font: inherit;
  background: transparent;
  color: var(--muted);
  border: 0;
  border-bottom: 3px solid transparent;
  padding: 8px 12px;
  min-height: 44px;
  cursor: pointer;
  white-space: nowrap;
}
.tab[aria-selected="true"] { color: var(--text); font-weight: 700; border-bottom-color: var(--accent); }
.tab:hover { color: var(--text); }

.screen-hidden { display: none; }
.day-panel[hidden] { display: none; }

.meals { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 760px) {
  .meals { grid-template-columns: 1fr 1fr; }
}
.meal {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 12px;
  min-width: 0;
}
.meal-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.meal-head h4 { margin: 0 0 4px; }
.meal-head .muted { font-size: 0.85rem; }

table.items { width: 100%; border-collapse: collapse; font-size: 0.925rem; }
.items th, .items td { padding: 6px 4px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.items thead th { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.items tbody th { font-weight: 500; }
.items tfoot th, .items tfoot td { border-bottom: 0; font-size: 0.85rem; }
.items .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.items .macros-cell { white-space: normal; color: var(--muted); }
.item-name { overflow-wrap: break-word; hyphens: auto; }
@media (max-width: 559px) {
  /* Narrow screens: icon-only swap button (it keeps its aria-label), full CIQUAL name only as tooltip. */
  .swap-text { display: none; }
  .btn-small { padding: 6px 10px; min-width: 40px; }
  .items .full-name { display: none; }
  .items .num .tag { display: block; width: max-content; margin-left: auto; }
}
.household { display: block; font-size: 0.8rem; color: var(--muted); }
.full-name { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 400; }
.tag { display: inline-block; font-size: 0.7rem; font-weight: 600; line-height: 1.4; padding: 0 6px; border-radius: 999px; border: 1px solid var(--border); color: var(--muted); vertical-align: 1px; }
.basis-note { font-size: 0.85rem; margin-top: 12px; }
.ranges { font-size: 0.875rem; margin: -4px 0 12px; }
.ranges-title { margin: 0 0 2px; font-weight: 600; }
.ranges ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 2px 16px; color: var(--muted); }
.method-line { font-size: 0.85rem; }
.swap-cell { width: 1%; text-align: right; }

.day-total { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.day-kcal { margin-bottom: 8px; }

.macro-bar {
  display: flex;
  height: 14px;
  border-radius: 7px;
  overflow: hidden;
  background: var(--surface-2);
}
.seg { display: block; height: 100%; }
.seg-protein, .dot.seg-protein { background: var(--c-protein); }
.seg-carbs, .dot.seg-carbs { background: var(--c-carbs); }
.seg-fat, .dot.seg-fat { background: var(--c-fat); }
.macro-legend { list-style: none; padding: 0; margin: 8px 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 0.875rem; }
.dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: baseline; }
.kcal-meter { font-size: 0.85rem; color: var(--muted); }
.kcal-track { display: block; position: relative; height: 8px; background: var(--surface-2); border-radius: 4px; margin-top: 4px; }
.kcal-fill { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.kcal-target { position: absolute; top: -3px; width: 2px; height: 14px; background: var(--text); }

.shopping-list { list-style: none; padding: 0; margin: 0; columns: 1; }
@media (min-width: 640px) {
  .shopping-list { columns: 2; column-gap: 32px; }
}
.shopping-list li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  break-inside: avoid;
}
.shop-qty { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--muted); }

/* Recipes */
.recipe-toggle {
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: none;
  border: 0;
  padding: 2px 0;
  min-height: 32px;
  display: inline-flex;
  align-items: flex-start;
  gap: 6px;
  text-align: left;
  cursor: pointer;
}
.recipe-toggle:hover .recipe-name { text-decoration: underline; }
.recipe-toggle .chev {
  flex: none;
  width: 0.5em;
  height: 0.5em;
  margin-top: 0.45em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
}
.recipe-toggle[aria-expanded="true"] .chev { transform: rotate(45deg); }
.recipe-sub { display: block; font-size: 0.8rem; color: var(--muted); font-weight: 400; margin-left: calc(0.5em + 6px); }
.tag-recipe { border-color: var(--accent); color: var(--accent-strong); }
.recipe-meta { white-space: nowrap; }
.items tr.recipe-row > * { border-bottom-style: dashed; }
.recipe-detail > td { padding: 0 0 8px; background: var(--surface-2); border-radius: 0 0 6px 6px; }
.recipe-detail[hidden] { display: none; }
table.components { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.components th, .components td { padding: 4px 6px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.components th { font-weight: 500; padding-left: 20px; }
.components .num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.comp-macros { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 400; }
.recipe-steps { padding: 6px 8px 0 20px; font-size: 0.85rem; }
.steps-title { font-weight: 600; margin: 0 0 2px; }
.recipe-steps ol { margin: 0; padding-left: 1.2em; }
.recipes-opt { margin-top: 16px; }

/* Mode switch and family form */
.form-head { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.form-head h2 { margin: 0; }
.mode-switch { border: 1px solid var(--border); border-radius: 8px; padding: 0; margin: 0; display: inline-flex; overflow: hidden; }
.mode-opt label { display: inline-block; padding: 8px 14px; min-height: 40px; cursor: pointer; font-weight: 600; background: var(--surface); }
.mode-opt + .mode-opt label { border-left: 1px solid var(--border); }
.mode-opt input:checked + label { background: var(--accent); color: var(--accent-text); }
.mode-opt input:focus-visible + label { outline: 3px solid var(--focus); outline-offset: -3px; }
.family-note p { margin: 0 0 4px; }
.members { display: grid; gap: 12px; }
.member-card { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin: 0; min-width: 0; }
.member-card > legend { font-weight: 700; padding: 0 6px; }
.member-label { margin-bottom: 12px; max-width: 320px; }
.member-label input[type="text"] { font: inherit; }
.member-actions { display: flex; justify-content: flex-end; }
fieldset.shared { border: 0; padding: 0; margin: 16px 0 0; }
fieldset.shared > legend { font-weight: 700; font-size: 1rem; margin-bottom: 8px; }
input[type="text"] { min-height: 44px; }

/* Family plan */
.fam-meals { display: grid; gap: 12px; }
.fam-table { --n: 2; font-size: 0.925rem; }
.fam-row {
  display: grid;
  /* Fixed last column so header, item and component rows line up. */
  grid-template-columns: minmax(9rem, 1.6fr) repeat(var(--n), minmax(4.75rem, 1fr)) 6.5rem;
  gap: 4px 10px;
  align-items: start;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}
.fam-head { font-size: 0.8rem; color: var(--muted); font-weight: 600; padding-top: 0; }
.fam-head .fam-col { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fam-row .doses { display: contents; list-style: none; }
.fam-row .dose { text-align: right; font-variant-numeric: tabular-nums; min-width: 0; }
.fam-row .who { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dose-main { display: block; white-space: nowrap; }
.dose-sub { display: block; font-size: 0.75rem; color: var(--muted); }
.fam-name { min-width: 0; overflow-wrap: break-word; }
.item-sub { display: block; font-size: 0.8rem; color: var(--muted); }
.fam-swap { justify-self: end; }
.fam-comp { font-size: 0.85rem; background: var(--surface-2); padding-left: 8px; padding-right: 8px; }
.fam-comp .fam-name { padding-left: 12px; }
.fam-detail { background: var(--surface-2); border-radius: 0 0 6px 6px; margin-bottom: 4px; padding-bottom: 6px; }
.fam-detail[hidden] { display: none; }
.member-totals { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
@media (min-width: 760px) {
  .member-totals { grid-template-columns: 1fr 1fr; }
}
.table-scroll { overflow-x: auto; margin-bottom: 12px; }
table.member-targets { width: 100%; border-collapse: collapse; font-size: 0.925rem; }
.member-targets th, .member-targets td { padding: 6px 8px; border-bottom: 1px solid var(--border); text-align: left; }
.member-targets .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.member-targets thead th { font-size: 0.8rem; color: var(--muted); }

@media (max-width: 639px) {
  /* Phones: each row lists the doses inline, "Marco 100 g · Anna 70 g". */
  .fam-head { display: none; }
  .fam-row { grid-template-columns: 1fr auto; }
  .fam-comp { grid-template-columns: 1fr; }
  .fam-row .doses { display: flex; flex-wrap: wrap; gap: 2px 0; grid-column: 1 / 2; margin: 0; padding: 0; }
  .fam-row .dose { text-align: left; display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 0 4px; }
  .fam-row .dose-none { display: none; }
  /* Separator before every visible dose that follows another visible one. */
  .fam-row .dose:not(.dose-none) ~ .dose:not(.dose-none)::before { content: "\00b7"; color: var(--muted); padding: 0 8px 0 4px; }
  .fam-row .who { position: static; width: auto; height: auto; clip: auto; overflow: visible; color: var(--muted); }
  .dose-main { display: inline; }
  .dose-sub { display: none; }
  .fam-swap { grid-column: 2; grid-row: 1 / span 2; }
  .fam-comp .doses { grid-column: 1 / -1; }
}

/* Chat */
details.chat > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
details.chat > summary::-webkit-details-marker { display: none; }
details.chat > summary::before {
  content: "";
  width: 0.55em;
  height: 0.55em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.15s;
  flex: none;
}
details.chat[open] > summary::before { transform: rotate(45deg); }
.summary-title { margin: 0; font-size: 1.15rem; }
.chat-body { margin-top: 12px; }
.key-field { margin-top: 12px; }
.key-row { display: flex; gap: 8px; flex-wrap: wrap; }
.key-row input { flex: 1 1 220px; width: auto; }
.key-status { margin: 4px 0 0; font-size: 0.9rem; min-height: 1.2em; }
.key-status.ok { color: var(--ok); }
.key-status.bad { color: var(--bad); }
.key-field .callout { margin-top: 8px; font-size: 0.9rem; }

.chat-log { display: flex; flex-direction: column; gap: 10px; margin: 16px 0; }
.msg { border-radius: 8px; padding: 10px 12px; background: var(--surface-2); max-width: 100%; overflow-wrap: anywhere; }
.msg-user { background: var(--info-bg); align-self: flex-end; max-width: 90%; }
.msg-error { background: var(--error-bg); }
.msg-who { font-size: 0.8rem; font-weight: 700; color: var(--muted); margin: 0 0 4px; }
.msg-content > :last-child { margin-bottom: 0; }
.msg-content ul, .msg-content ol { margin: 0 0 0.75em; padding-left: 1.3em; }
.msg-content { white-space: normal; }
.msg-user .msg-content { white-space: pre-wrap; }
.msg-usage { font-size: 0.75rem; margin: 6px 0 0; }
.ask-form { margin-top: 12px; }
.ask-form label { font-weight: 600; display: block; margin-bottom: 4px; }
.chat-status { margin: 8px 0 0; }

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

/* Print: the plan only, all days, plus the shopping list. */
@media print {
  :root {
    --bg: #fff; --surface: #fff; --surface-2: #f2f2f2; --text: #000; --muted: #444; --border: #bbb;
    color-scheme: light;
  }
  body { font-size: 10.5pt; }
  .site-header, .banner, #notice, #consent, #profile, #chat, .no-print, .skip-link, .lang-toggle, .data-info { display: none !important; }
  .card { border: 0; box-shadow: none; padding: 0; }
  .wrap { max-width: none; padding: 0; }
  .screen-hidden { display: block !important; }
  .day-panel[hidden] { display: block !important; }
  .day-panel { break-before: page; }
  .view-menu .day-panel:first-of-type { break-before: auto; }
  .view-shopping { break-before: page; }
  .meal { break-inside: avoid; }
  .recipe-detail[hidden] { display: table-row !important; }
  .recipe-toggle .chev { display: none; }
  .recipe-sub { margin-left: 0; }
  .fam-detail[hidden] { display: block !important; }
  .fam-row { grid-template-columns: minmax(9rem, 1.6fr) repeat(var(--n), minmax(4.75rem, 1fr)) 0; }
  .fam-meal { break-inside: auto; }
  .fam-row { break-inside: avoid; }
  .meals { grid-template-columns: 1fr 1fr; }
  .macro-bar, .seg, .dot, .kcal-fill, .stat { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .site-footer { border: 0; font-size: 8pt; }
  a { color: #000; }
}
