/* The GLP-1 Answer Companion — shared styles.
   Design rules: large readable text, 48px targets, no colour that ranks or judges anything. */

:root {
  --bg: #f6f5f1;
  --surface: #ffffff;
  --ink: #1b2426;
  --muted: #4b585b;
  --line: #cdd3d1;
  --line-soft: #e4e8e6;
  --accent: #0a5f63;
  --accent-strong: #07474a;
  --accent-ink: #ffffff;
  --accent-soft: #e4f0ef;
  --hero: #e9f2f0;
  --warn: #9a3f0b;
  --warn-soft: #fdf2e9;
  --focus: #b3470d;
  --footer-bg: #12373a;
  --footer-ink: #eaf2f1;
  --footer-link: #bfe3df;
  --shadow: 0 1px 2px rgba(16, 40, 42, .06), 0 1px 1px rgba(16, 40, 42, .03);
  --shadow-lift: 0 10px 24px rgba(16, 40, 42, .10), 0 2px 6px rgba(16, 40, 42, .06);
  --radius: 12px;
  --measure: 44rem;
  --wide: 64rem;
  font-size: 18px;
}
:root.large-text { font-size: 22px; }
:root.high-contrast {
  --bg: #000000;
  --surface: #000000;
  --ink: #ffffff;
  --muted: #ffffff;
  --line: #ffffff;
  --line-soft: #ffffff;
  --accent: #ffe600;
  --accent-strong: #ffe600;
  --accent-ink: #000000;
  --accent-soft: #1a1a1a;
  --hero: #000000;
  --warn: #ffe600;
  --warn-soft: #000000;
  --focus: #ffe600;
  --footer-bg: #000000;
  --footer-ink: #ffffff;
  --footer-link: #ffe600;
  --shadow: none;
  --shadow-lift: none;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.55;
  overflow-wrap: break-word;
}
/* Text the person typed can be one long unbroken run (a pasted link, a row of emoji). Let it wrap anywhere. */
.user-text { overflow-wrap: anywhere; }
td.user-text, th.user-text { min-width: 7rem; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- typography ---------- */
h1, h2, h3 { line-height: 1.25; margin: 1.6em 0 .5em; font-weight: 700; }
h1 { font-size: 1.85rem; margin-top: .4em; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; }
h3 { font-size: 1.12rem; }
p, ul, ol { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: .15em; }
:root.high-contrast a { color: var(--accent); }
:root.high-contrast a.btn { color: var(--accent-ink); }
:root.high-contrast a.btn.secondary, :root.high-contrast a.btn.quiet { color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }
.subtitle { color: var(--muted); margin: .35rem 0 0; font-size: 1.05rem; }
.kicker { margin: 0 0 .15rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.nw { white-space: nowrap; }
.small { font-size: .9rem; }
.muted { color: var(--muted); }
.verbatim { }
.visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important;
  overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important;
}

/* ---------- focus ---------- */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
:root.high-contrast :focus-visible { outline-width: 4px; }

/* ---------- layout ---------- */
.skip-link {
  position: absolute; left: .5rem; top: -4rem; z-index: 100;
  background: var(--accent); color: var(--accent-ink); padding: .75rem 1rem; border-radius: 8px; font-weight: 700;
}
.skip-link:focus { top: .5rem; }
.wrap { width: 100%; max-width: var(--wide); margin: 0 auto; padding: 0 1rem; }
main { display: block; padding-bottom: 2rem; }
.prose { max-width: var(--measure); }

/* ---------- header and menu ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: .75rem; min-height: 64px; }
.site-header .brand { flex: 1 1 auto; min-width: 0; }
.site-header .menu { flex: none; }
.brand { font-weight: 700; font-size: 1.05rem; color: var(--ink); text-decoration: none; padding: .55rem 0; display: inline-flex; align-items: center; gap: .7rem; min-height: 48px; line-height: 1.35; }
.brand-mark { width: 40px; height: 40px; border-radius: 10px; flex: none; }
.brand-text { min-width: 0; }
.brand-text span { display: block; font-weight: 400; font-size: .8rem; color: var(--muted); }
:root.high-contrast .brand-mark { outline: 2px solid #fff; }
@media (max-width: 30rem) { .brand-text span { display: none; } .brand { line-height: 1.25; gap: .55rem; font-size: .95rem; } .brand-mark { width: 34px; height: 34px; } .menu > summary { padding: .5rem .85rem; } }
.menu { position: relative; }
.menu > summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .5rem;
  min-height: 48px; min-width: 48px; padding: .5rem 1rem; border: 2px solid var(--accent); border-radius: 999px;
  color: var(--accent); font-weight: 700; background: var(--surface);
}
.menu > summary::-webkit-details-marker { display: none; }
.menu > summary::before { content: "☰"; font-size: 1.1em; line-height: 1; }
.menu > summary:hover { background: var(--accent-soft); }
.menu[open] > summary::before { content: "✕"; }
.menu-panel {
  position: absolute; right: 0; top: calc(100% + .5rem); z-index: 50; width: min(22rem, 92vw);
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow-lift);
  padding: .5rem;
}
.menu-panel ul { list-style: none; margin: 0; padding: 0; }
.menu-panel a {
  display: flex; align-items: center; min-height: 48px; padding: .4rem .75rem; border-radius: 8px;
  color: var(--ink); text-decoration: none;
}
.menu-panel a:hover { background: var(--accent-soft); }
.menu-panel a[aria-current="page"] { font-weight: 700; background: var(--accent-soft); }
:root.high-contrast .menu-panel a[aria-current="page"] { outline: 2px solid var(--ink); }
.menu-panel .menu-group { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .7rem .75rem .2rem; }
.menu-settings { border-top: 1px solid var(--line); margin-top: .5rem; padding: .5rem .25rem .25rem; }

/* ---------- display toggles ---------- */
.toggles { display: flex; flex-direction: column; gap: .5rem; }
.toggle {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; width: 100%;
  min-height: 48px; padding: .5rem .75rem; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); color: var(--ink); font: inherit; cursor: pointer; text-align: left;
}
.toggle .state { position: relative; display: inline-flex; align-items: center; min-width: 5.6rem; padding-left: 3.3rem; font-weight: 700; justify-content: flex-start; }
.toggle .state::before {
  content: ""; position: absolute; left: 0; top: 50%; width: 2.8rem; height: 1.6rem; margin-top: -.8rem;
  border-radius: 999px; background: var(--line); border: 2px solid var(--line); transition: background .15s, border-color .15s;
}
.toggle .state::after {
  content: ""; position: absolute; left: .2rem; top: 50%; width: 1.2rem; height: 1.2rem; margin-top: -.6rem;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.3); transition: transform .15s;
}
.toggle[aria-pressed="true"] .state::before { background: var(--accent); border-color: var(--accent); }
.toggle[aria-pressed="true"] .state::after { transform: translateX(1.2rem); }
:root.high-contrast .toggle .state::before { background: #000; border-color: #fff; }
:root.high-contrast .toggle[aria-pressed="true"] .state::before { background: var(--accent); border-color: var(--accent); }
:root.high-contrast .toggle .state::after { background: #fff; box-shadow: none; }
:root.high-contrast .toggle[aria-pressed="true"] .state::after { background: #000; }
.toggle:hover { border-color: var(--accent); }

/* ---------- footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-ink); margin-top: 3rem; padding: 1.75rem 0 2.25rem; font-size: .92rem; }
:root.high-contrast .site-footer { border-top: 2px solid #fff; }
.site-footer p { margin: 0 0 .5rem; }
.site-footer .disclaimer { font-weight: 700; font-size: 1.05rem; }
.site-footer a { color: var(--footer-link); }
.site-footer nav a { display: inline-flex; align-items: center; min-height: 48px; margin-right: 1.25rem; }
.footer-grid { display: grid; gap: .5rem 2rem; }
@media (min-width: 52rem) {
  .footer-grid { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
  .site-footer nav { display: flex; flex-direction: column; align-items: flex-start; }
  .site-footer nav a { min-height: 40px; margin: 0; }
}

/* ---------- cards and panels ---------- */
.card-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); margin: 0 0 1.5rem; padding: 0; list-style: none; }
.card {
  display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.15rem 1.2rem 1rem; color: var(--ink); text-decoration: none; box-shadow: var(--shadow); height: 100%;
  transition: border-color .15s, box-shadow .15s, transform .15s;
}
a.card:hover { border-color: var(--accent); box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.card-icon, .page-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 2.75rem; height: 2.75rem; border-radius: 11px; background: var(--accent-soft); color: var(--accent);
}
.card-icon { margin-bottom: .75rem; }
.card-icon .icon { width: 1.55rem; height: 1.55rem; }
:root.high-contrast .card-icon, :root.high-contrast .page-icon { border: 2px solid #fff; background: #000; }
.card h3 { margin: 0 0 .35rem; color: var(--accent); font-size: 1.12rem; }
:root.high-contrast .card h3 { color: var(--accent); }
.card p { margin: 0 0 .75rem; color: var(--muted); }
:root.high-contrast .card p { color: var(--ink); }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin: auto 0 0 !important; padding-top: .25rem; }
.chip { display: inline-block; font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--bg); border: 1px solid var(--line-soft); border-radius: 999px; padding: .15rem .6rem; }
:root.high-contrast .chip { border-color: #fff; color: #fff; }
.card-go { font-size: .88rem; font-weight: 700; color: var(--accent); white-space: nowrap; }
.tool-group > h2 { margin-bottom: .2rem; }
.group-note { color: var(--muted); margin: 0 0 1rem; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.35rem; margin: 0 0 1.25rem; box-shadow: var(--shadow); }

/* ---------- page heading and home hero ---------- */
.page-head { display: flex; gap: 1rem; align-items: flex-start; margin: 1.6rem 0 1.5rem; }
.page-head h1 { margin: 0; }
.page-icon { width: 3.25rem; height: 3.25rem; border-radius: 14px; margin-top: .15rem; }
.page-icon .icon { width: 1.85rem; height: 1.85rem; }
@media (max-width: 36rem) { .page-head { display: block; margin-top: 1.2rem; } .page-icon { display: none; } }
.hero { display: grid; gap: 1.25rem; background: var(--hero); border: 1px solid var(--line-soft); border-radius: 18px; padding: 1.6rem 1.4rem; margin: 1.4rem 0 1.5rem; }
:root.high-contrast .hero { border: 2px solid #fff; }
.hero h1 { font-size: 2.15rem; margin: .1rem 0 .6rem; }
.hero .lede { font-size: 1.08rem; max-width: 42rem; margin: 0 0 1rem; }
.hero .btn-row { margin-bottom: 0; }
@media (min-width: 60rem) { .hero { grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); align-items: center; padding: 2.1rem 2.2rem; } }
@media (max-width: 30rem) { .hero { padding: 1.2rem 1rem; border-radius: 14px; } .hero h1 { font-size: 1.75rem; } .hero .lede { font-size: 1rem; } }
.notice.urgent { display: flex; gap: .8rem; align-items: flex-start; background: var(--warn-soft); border-left-color: var(--warn); margin: 0; }
.notice-icon { color: var(--warn); flex: none; }
.notice-icon .icon { width: 1.7rem; height: 1.7rem; }
.home-split { display: grid; gap: 0 3rem; }
.home-split > .prose { max-width: none; }
@media (min-width: 60rem) { .home-split { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.panel > :first-child { margin-top: 0; }
.panel > :last-child { margin-bottom: 0; }
.notice { border-left: 5px solid var(--accent); background: var(--accent-soft); padding: .8rem 1rem; border-radius: 6px; margin: 0 0 1.25rem; }
.notice > :last-child { margin-bottom: 0; }
.boxed { border: 2px solid var(--ink); border-radius: 6px; padding: 1rem 1.1rem; background: var(--surface); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  min-height: 48px; min-width: 48px; padding: .55rem 1.1rem; border-radius: 8px;
  border: 2px solid var(--accent); background: var(--accent); color: var(--accent-ink);
  font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; line-height: 1.2; text-align: center;
}
.btn { transition: background .15s, border-color .15s, color .15s; border-radius: 10px; }
.btn:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn:active { transform: translateY(1px); }
.btn.secondary { background: var(--surface); color: var(--accent); }
.btn.secondary:hover { background: var(--accent-soft); color: var(--accent-strong); }
.btn.quiet { background: transparent; border-color: var(--line); color: var(--ink); font-weight: 600; }
.btn.quiet:hover { background: var(--surface); border-color: var(--ink); }
:root.high-contrast .btn:hover { background: var(--accent); color: var(--accent-ink); }
:root.high-contrast .btn.secondary:hover, :root.high-contrast .btn.quiet:hover { background: #000; color: var(--accent); border-color: var(--accent); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: .75rem 0; align-items: center; }
.link-btn { background: none; border: 0; padding: .25rem; min-height: 48px; font: inherit; color: var(--accent); text-decoration: underline; cursor: pointer; }

/* ---------- forms ---------- */
label, legend { font-weight: 600; }
fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem 1rem 1rem; margin: 0 0 1rem; background: var(--surface); min-width: 0; }
legend { padding: 0 .35rem; }
.field { margin: 0 0 1rem; }
.field > label { display: block; margin-bottom: .3rem; }
.field > label.choice { display: inline-flex; margin-bottom: 0; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: .9rem; margin: .1rem 0 .35rem; }
input[type="text"], input[type="number"], input[type="date"], input[type="tel"], input[type="search"], select, textarea {
  width: 100%; max-width: 32rem; min-height: 48px; padding: .55rem .7rem; font: inherit; color: var(--ink);
  background: var(--surface); border: 2px solid var(--line); border-radius: 9px; transition: border-color .15s;
}
input:hover, select:hover, textarea:hover { border-color: #9aa5a3; }
:root.high-contrast input:hover, :root.high-contrast select:hover, :root.high-contrast textarea:hover { border-color: var(--ink); }
:root.high-contrast input, :root.high-contrast select, :root.high-contrast textarea { border-color: var(--ink); }
textarea { min-height: 6rem; resize: vertical; }
input[type="number"] { max-width: 12rem; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); outline: 3px solid var(--focus); outline-offset: 2px; }
.inline { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.inline > input { flex: 1 1 7rem; width: auto; min-width: 5rem; max-width: 12rem; }
.inline > select { flex: 0 0 auto; width: auto; min-width: 0; }
.choice-row { display: flex; flex-wrap: wrap; gap: .5rem; margin: .2rem 0 0; }
.choice {
  display: inline-flex; align-items: center; gap: .55rem; min-height: 48px; padding: .4rem .9rem .4rem .6rem;
  border: 2px solid var(--line); border-radius: 8px; background: var(--surface); font-weight: 500; cursor: pointer;
}
.choice input { width: 1.35rem; height: 1.35rem; margin: 0; accent-color: var(--accent); flex: none; }
.choice:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); background: var(--accent-soft); }
.choice:hover { border-color: var(--accent); }
.choice:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.tick {
  display: flex; align-items: flex-start; gap: .75rem; min-height: 48px; padding: .55rem .6rem; margin: 0 0 .35rem;
  border-radius: 8px; cursor: pointer; font-weight: 400;
}
.tick:hover { background: var(--accent-soft); }
.tick input { width: 1.5rem; height: 1.5rem; margin: .1rem 0 0; flex: none; accent-color: var(--accent); }
.status { min-height: 1.6em; font-weight: 600; margin: .4rem 0; }
.saved-note:not(:empty)::before { content: "✓ "; color: var(--accent); }
.info-note:empty { min-height: 0; margin: 0; }
.info-note:not(:empty) { background: var(--accent-soft); border-radius: 8px; padding: .5rem .8rem; margin: -.25rem 0 1rem; font-weight: 600; }
.form-row { display: grid; gap: 0 1.25rem; }
.form-row > fieldset { margin-bottom: 1rem; }
@media (min-width: 48rem) {
  .form-row.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-row.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .field.align-end { align-self: end; }
}
#entry > h2 { margin-bottom: 1rem; }
.error-text { font-weight: 700; margin: .3rem 0 0; }
.error-text::before { content: "⚠ "; }
input[aria-invalid="true"] { border-color: var(--focus); border-width: 3px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 0 1.25rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
caption { text-align: left; font-weight: 700; padding: .75rem .9rem; }
th, td { text-align: left; padding: .55rem .7rem; border-bottom: 1px solid var(--line-soft); vertical-align: top; }
thead th { background: var(--accent-soft); border-bottom: 2px solid var(--line); font-size: .88rem; }
tbody tr:hover > * { background: #fafbfa; }
:root.high-contrast tbody tr:hover > * { background: #000; }
:root.high-contrast thead th { background: #000; border-bottom-color: #fff; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
td .row-actions { display: flex; gap: .4rem; flex-wrap: wrap; }
@media (min-width: 40.01rem) { td .row-actions { flex-wrap: nowrap; justify-content: flex-end; } }

/* stacked tables on narrow screens */
@media (max-width: 40rem) {
  table.stack thead { position: absolute; left: -9999px; }
  table.stack caption { display: block; width: 100%; }
  table.stack th[scope="row"] { display: block; width: 100%; padding: .4rem .8rem .2rem; border: 0; font-size: 1.02rem; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { border-bottom: 2px solid var(--line); padding: .5rem 0; }
  table.stack td { border: 0; padding: .3rem .8rem; display: grid; grid-template-columns: 9.5rem 1fr; gap: .5rem; text-align: left; }
  table.stack td.num { text-align: left; white-space: normal; }
  table.stack td::before { content: attr(data-label); font-weight: 600; color: var(--muted); }
  table.stack td.no-label { display: block; }
  table.stack td:empty { display: none; }
  table.stack td.no-label::before { content: none; }
}

/* ---------- red flags ---------- */
.rf-box h2 { margin-top: 0; font-size: .95rem; letter-spacing: .12em; text-transform: uppercase; }
.rf-level { margin: 1.3rem 0 .6rem; font-size: .92rem; letter-spacing: .1em; text-transform: uppercase; background: var(--bg); border-left: 5px solid var(--ink); padding: .45rem .7rem; border-radius: 0 6px 6px 0; }
:root.high-contrast .rf-level { background: #000; border-left-color: #fff; }
.rf-list { margin: 0; padding-left: 1.3rem; }
.rf-list li { margin: 0 0 .9rem; }
.rf-list li p { margin: 0 0 .2rem; }
details.sources > summary { cursor: pointer; color: var(--accent); min-height: 48px; display: inline-flex; align-items: center; font-size: .92rem; }
details.panel > summary { list-style: none; cursor: pointer; min-height: 48px; display: flex; align-items: center; gap: .5rem; }
details.panel > summary::-webkit-details-marker { display: none; }
details.panel > summary::before { content: "▸"; }
details.panel[open] > summary::before { content: "▾"; }
details.sources ol, details.sources ul { font-size: .88rem; color: var(--muted); padding-left: 1.2rem; margin: .3rem 0; }
.call-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: .6rem 0 1rem; }

/* ---------- claims ---------- */
.grade {
  display: inline-flex; align-items: center; justify-content: center; width: 2.2rem; height: 2.2rem; flex: none;
  border: 2px solid var(--ink); border-radius: 6px; font-weight: 800; font-size: 1.05rem; background: var(--surface);
}
.claim { display: flex; gap: .9rem; padding: .85rem 0; border-bottom: 1px solid var(--line-soft); }
.claim:last-child { border-bottom: 0; }
.claim p { margin: 0 0 .2rem; }
.claim .claim-text { font-weight: 600; }
.claim .meta { font-size: .88rem; color: var(--muted); }
.chapter-block { margin: 0 0 1.25rem; }
.chapter-block h2 { font-size: 1.12rem; margin: 1.4rem 0 .3rem; }

/* ---------- questions ---------- */
.q-stage h2 { font-size: 1.15rem; }
.q-item { display: flex; gap: .75rem; align-items: flex-start; }
.q-num { font-weight: 800; flex: none; min-width: 2.4rem; white-space: nowrap; font-variant-numeric: tabular-nums; }
.q-ch { color: var(--muted); font-size: .88rem; white-space: nowrap; }

/* ---------- day cards (weekly protein) ---------- */
.day-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fill, minmax(min(13.5rem, 100%), 1fr)); }
.day-card { border: 1px solid var(--line); border-radius: var(--radius); padding: .6rem .9rem .9rem; background: var(--surface); box-shadow: var(--shadow); }
.day-card legend { font-size: 1.05rem; }
.day-card .total:not(:empty) { background: var(--accent-soft); border-radius: 8px; padding: .35rem .6rem; }
.day-card h3 { margin: .2rem 0 .5rem; font-size: 1.05rem; }
.day-card .field { margin-bottom: .6rem; }
.day-card input[type="number"] { max-width: none; }
.day-card .total { font-weight: 700; }

/* ---------- print-only and screen-only ---------- */
.print-only { display: none; }
@media print {
  @page { margin: 12mm; }
  :root, :root.large-text, :root.high-contrast {
    --bg: #fff; --surface: #fff; --ink: #000; --muted: #333; --line: #777; --line-soft: #bbb; --accent: #000; --accent-soft: #fff;
    --footer-bg: #fff; --footer-ink: #000; --footer-link: #000; --hero: #fff; --warn: #000; --warn-soft: #fff; --shadow: none; --shadow-lift: none;
    font-size: 11pt;
  }
  body { background: #fff; color: #000; }
  .no-print, .site-header, .site-footer nav, .skip-link, .btn, .btn-row, .menu, details > summary::marker { display: none !important; }
  .print-only { display: block; }
  .page-icon, .kicker, .card-icon, .card-go { display: none !important; }
  .page-head { margin: 0 0 .5rem; display: block; }
  .info-note:not(:empty) { background: none; padding: 0; }
  .saved-note { display: none; }
  a { color: #000; text-decoration: none; }
  .panel, .card, fieldset, .table-wrap { box-shadow: none; border-color: #999; }
  .site-footer { border-top: 1px solid #999; margin-top: 1rem; padding: .4rem 0 0; font-size: 8.5pt; }
  .site-footer .disclaimer { font-size: 9pt; }
  .site-footer p { margin: .1rem 0; }
  .site-footer { break-inside: avoid; }
  h1 { font-size: 16pt; margin: 0 0 .15em; }
  h2 { font-size: 12.5pt; margin: .8em 0 .3em; }
  table { font-size: 9.5pt; }
  th, td { padding: .25rem .4rem; border-bottom: 1px solid #bbb; }
  thead th { background: #eee !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  tr { break-inside: avoid; }
  details.sources[open] > summary { display: none; }
  details.sources:not([open]) { display: none; }
  .keep-together { break-inside: avoid; }
  .link-btn { display: none !important; }
  #contacts { padding: .3rem .8rem; }
  #contacts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; }
  #contacts fieldset { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 0 1.5rem; border: 0; padding: 0; margin: .3rem 0 0; }
  #contacts legend { padding: 0; font-weight: 700; }
  #contacts .field { margin: .15rem 0; }
  #contacts .status { display: none; }
  .rf-box li { margin-bottom: .15rem; }
  .rf-box li p { margin: 0; }
  .rf-box { padding: .5rem .9rem; margin-top: .6rem; line-height: 1.4; }
  .rf-box h3 { margin: .5rem 0 .2rem; }
  .print-header { display: flex; justify-content: space-between; font-size: 8.5pt; border-bottom: 1px solid #999; padding-bottom: .2rem; margin-bottom: .5rem; }
}

/* ---------- script-dependent pieces ---------- */
html:not(.js) .needs-js { display: none !important; }
html.js .no-js { display: none !important; }
a[href^="mailto:"], a[href^="http"] { overflow-wrap: anywhere; }
@media print { .nowrap { white-space: nowrap; } }
.plain-list { list-style: none; margin: 0; padding: 0; }
select.auto-width { width: auto; }
.baseline-grid { display: grid; gap: .5rem 1rem; grid-template-columns: repeat(auto-fill, minmax(min(12rem, 100%), 1fr)); margin: 0 0 1rem; }

/* ---------- dialog ---------- */
dialog.confirm {
  border: 2px solid var(--ink); border-radius: var(--radius); padding: 1.25rem 1.4rem; max-width: min(34rem, 92vw);
  background: var(--surface); color: var(--ink);
}
dialog.confirm::backdrop { background: rgba(0, 0, 0, .55); }
dialog.confirm h2 { margin-top: 0; }

/* ---------- Doctor-Visit Report ---------- */
.report { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; }
.report-title { margin-top: 0; }
.report h3 { font-size: 1rem; margin: 1.1rem 0 .35rem; }
.report-facts { margin: 0; }
.report-facts > div { display: grid; grid-template-columns: minmax(10rem, 16rem) 1fr; gap: .5rem; padding: .35rem 0; border-bottom: 1px solid var(--line-soft); }
.report-facts dt { font-weight: 600; }
.report-facts dd { margin: 0; }
.report .field { margin: .8rem 0; }
.report textarea { max-width: none; min-height: 3.4rem; }
.report table { font-size: .9rem; }
@media screen { .report th, .report td { padding: .45rem .5rem; } }
.daily-cols { display: grid; gap: 0 1rem; grid-template-columns: 1fr; }
@media screen and (min-width: 60rem) { .daily-cols { grid-template-columns: 1fr 1fr; } :root.large-text .daily-cols { grid-template-columns: 1fr; } }
.report .empty { color: var(--muted); font-style: italic; }
.empty-state { border: 2px dashed var(--line); border-radius: var(--radius); padding: 1.1rem 1.25rem; color: var(--muted); background: var(--surface); }
:root.high-contrast .empty-state { border-color: #fff; color: #fff; }
.chosen-list { list-style: none; padding: 0; }
.chosen-list li { margin: 0 0 .35rem; }
@media (max-width: 40rem) { .report-facts > div { grid-template-columns: 1fr; gap: 0; } }

@media print {
  .report { border: 0; padding: 0; }
  .report-title { display: none; }
  .report h3 { font-size: 10pt; margin: .45rem 0 .15rem; }
  .report-facts > div { grid-template-columns: 17rem 1fr; padding: .08rem 0; font-size: 9.5pt; }
  .report .field { margin: .3rem 0; }
  .report .field label { font-size: 9.5pt; }
  .report textarea { border: 0; border-bottom: 1px solid #999; border-radius: 0; padding: 0; min-height: 0; height: auto; font-size: 9.5pt; resize: none; }
  .report table { font-size: 8pt; line-height: 1.25; }
  .report th, .report td { padding: .05rem .25rem; }
  .report .nowrap, .report .nw { white-space: nowrap; }
  .daily-cols { grid-template-columns: 1fr 1fr; }
  .report .print-lines { display: block; border-bottom: 1px solid #999; height: 1.2rem; }
  body.printing-visit .site-footer p:not(.disclaimer) { display: none; }
  /* checklists: show state of ticks and typed values */
  .checklist .tick { min-height: 0; padding: .1rem 0; }
  .checklist input[type="text"], .checklist textarea { border: 0; border-bottom: 1px solid #999; border-radius: 0; padding: .1rem 0; min-height: 0; }
  .checklist .field { margin-bottom: .3rem; }
  .checklist h2 { font-size: 11pt; text-transform: uppercase; letter-spacing: .05em; }
  .notice { border-left: 3px solid #000; padding: .3rem .5rem; }
  /* log print pages */
  .print-page { break-after: page; }
  .print-page:last-child { break-after: auto; }
  .print-page table { font-size: 9pt; }
  .print-page td, .print-page th { border: 1px solid #999; }
  .print-page tbody td { height: 1.9rem; }
  .print-note { margin-top: .4rem; font-size: 8.5pt; }
  .print-meta { font-size: 9.5pt; margin: 0 0 .4rem; }
  /* questions: print only ticked when chosen */
  body.print-ticked .q-stage li:not(.is-ticked) { display: none; }
  body.print-ticked .q-stage:not(.has-ticked) { display: none; }
  .q-item input { display: none; }
  /* protein finder */
  #foods tr[hidden] { display: none; }
  body.printing-week main > *:not(#weekly) { display: none !important; }
  body.printing-week #week-form { display: none; }
}

/* ---------- printed values for typed answers ---------- */
.print-value { white-space: pre-wrap; overflow-wrap: anywhere; }
.report dd, .tick > span, .q-item > span, .choice > span { min-width: 0; overflow-wrap: anywhere; }
@media print {
  main textarea { display: none !important; }
  .print-value { display: block; border-bottom: 1px solid #999; min-height: 2.2rem; font-size: 10pt; }
  .report .print-value { min-height: 1.15rem; font-size: 9.5pt; }
  main input[type="text"], main input[type="tel"], main input[type="date"] { border: 0; border-bottom: 1px solid #999; border-radius: 0; padding: .1rem 0; min-height: 0; height: auto; background: none; }
  main .field { margin-bottom: .45rem; }
  main .field input { max-width: 100%; }
  .chosen-list { margin: .1rem 0 .2rem; font-size: 9.5pt; }
  .chosen-list li { margin: 0 0 .1rem; }
  .report .table-wrap { border: 0; margin: 0 0 .3rem; overflow: visible; }
  .report .empty { font-size: 9pt; }
}
