/* Diet charts: a paper sheet on screen, one A4 page in print. Reads in colour and in greyscale:
   the three lists differ by their marker shape (✓ – ✕), never by colour alone. */
@font-face { font-family: Gabarito; src: url('../fonts/gabarito-latin.woff2') format('woff2'); font-weight: 400 900; font-display: swap; }

:root {
  --stone: #e6e2dc; --paper: #fbfaf7; --ink: #0b1e23; --ink-soft: #44545a;
  --teal: #16737a; --teal-deep: #0f5a60; --coral: #e8674f; --mustard: #edb940;
  --leaf: #7fb48a; --line: #d9d3ca;
  --hindi: 'Noto Sans Devanagari', 'Kohinoor Devanagari', 'Nirmala UI', Mangal, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body.d-body { margin: 0; background: var(--stone); color: var(--ink); font: 400 1rem/1.5 Gabarito, 'Avenir Next', 'Segoe UI', system-ui, sans-serif; }
body.d-body--hi { font-family: var(--hindi); line-height: 1.6; }

.d-sheet { max-width: 60rem; margin: 24px auto; padding: clamp(16px, 4vw, 44px); background: var(--paper); border-radius: 22px; }

.d-head { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: flex-start; border-bottom: 2px solid var(--ink); padding-bottom: 12px; }
.d-doc { display: flex; flex-direction: column; font-size: .85rem; color: var(--ink-soft); font-family: Gabarito, system-ui, sans-serif; }
.d-doc strong { font-size: 1.15rem; color: var(--ink); }
.d-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.d-btn { display: inline-flex; align-items: center; min-height: 40px; padding: 0 18px; border-radius: 999px; border: 0; background: var(--ink); color: var(--paper); font: inherit; font-weight: 700; font-size: .9rem; text-decoration: none; cursor: pointer; }
.d-btn:hover { background: var(--teal-deep); }
.d-btn--wa { background: var(--teal); }
.d-btn:focus-visible, .d-foot a:focus-visible { outline: 3px solid var(--mustard); outline-offset: 2px; }

.d-status { margin: 14px 0 0; font-size: .85rem; color: var(--ink-soft); }
.d-status--draft { display: inline-block; padding: 4px 12px; border-radius: 999px; background: var(--mustard); color: var(--ink); font-weight: 700; }

h1 { margin: 10px 0 6px; font-size: clamp(1.8rem, 4vw, 2.6rem); line-height: 1.12; letter-spacing: -.02em; }
.d-body--hi h1 { letter-spacing: 0; line-height: 1.3; }
h2 { margin: 0 0 8px; font-size: 1.1rem; }
.d-lede { margin: 0 0 18px; max-width: 44rem; font-size: 1.08rem; color: var(--ink-soft); }
.d-small { margin: -4px 0 8px; font-size: .85rem; color: var(--ink-soft); }

.d-top { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 24px; align-items: center; margin-bottom: 20px; }
.d-plate { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.d-plate svg { width: 9.5rem; height: auto; }
.d-plate__rim { fill: #fff; stroke: var(--ink); stroke-width: 2; }
.d-plate__veg { fill: var(--leaf); }
.d-plate__protein { fill: var(--coral); }
.d-plate__grain { fill: var(--mustard); }
.d-plate figcaption { display: flex; flex-direction: column; gap: 3px; font-size: .82rem; }
.d-key::before { content: ''; display: inline-block; width: .8em; height: .8em; margin-right: 6px; border: 1px solid var(--ink); border-radius: 50%; vertical-align: -1px; }
.d-key--veg::before { background: var(--leaf); }
.d-key--protein::before { background: var(--coral); }
.d-key--grain::before { background: var(--mustard); }

.d-rules { margin: 0; padding: 0; list-style: none; counter-reset: rule; display: grid; gap: 10px; }
.d-rules li { counter-increment: rule; position: relative; padding-left: 2.4rem; font-weight: 600; }
.d-rules li::before { content: counter(rule); position: absolute; left: 0; top: -.05rem; width: 1.8rem; height: 1.8rem; border-radius: 50%; background: var(--teal); color: var(--paper); display: grid; place-items: center; font-size: .95rem; font-weight: 800; }

.d-lists { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-bottom: 20px; }
.d-card { border: 1.5px solid var(--line); border-radius: 16px; padding: 14px 16px; border-top-width: 6px; }
.d-card--more { border-top-color: var(--teal); }
.d-card--less { border-top-color: var(--mustard); }
.d-card--avoid { border-top-color: var(--coral); }
.d-card ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 7px; font-size: .92rem; }
.d-card li { position: relative; padding-left: 1.4rem; }
.d-card li::before { position: absolute; left: 0; font-weight: 800; }
.d-card--more li::before { content: '✓'; color: var(--teal); }
.d-card--less li::before { content: '–'; color: #a07a12; }
.d-card--avoid li::before { content: '✕'; color: #b8412c; }

.d-day { margin-bottom: 20px; }
.d-meals { margin: 0; font-size: .92rem; }
.d-meals > div { display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: 4px 16px; padding: 8px 10px; border-top: 1px solid var(--line); break-inside: avoid; }
.d-meals dt { font-weight: 700; }
.d-meals dd { margin: 0; }
.d-swap { display: block; margin-top: 3px; color: var(--ink-soft); font-size: .86rem; }

.d-myths { margin-bottom: 20px; }
.d-myths dl { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 20px; font-size: .92rem; }
.d-myths dt { font-weight: 700; position: relative; padding-left: 1.4rem; }
.d-myths dt::before { content: '✕'; position: absolute; left: 0; color: #b8412c; font-weight: 800; }
.d-myths dd { padding-left: 1.4rem; }
.d-myths dd { margin: 2px 0 0; }

.d-note { border: 1.5px dashed var(--ink-soft); border-radius: 16px; padding: 12px 16px; margin-bottom: 14px; }
.d-note__lines { min-height: 4.5rem; background: repeating-linear-gradient(transparent 0 1.45rem, var(--line) 1.45rem 1.5rem); white-space: pre-wrap; }
.d-alert { margin: 0 0 12px; padding: 10px 14px; border-left: 6px solid var(--coral); background: #fbe9e4; border-radius: 8px; font-weight: 700; }
.d-caution { margin: 0 0 14px; font-size: .86rem; color: var(--ink-soft); }
.d-foot { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; font-size: .82rem; color: var(--ink-soft); border-top: 1px solid var(--line); padding-top: 10px; }
.d-foot a { color: var(--teal-deep); font-weight: 700; }

@media (max-width: 720px) {
  .d-sheet { margin: 0; border-radius: 0; }
  .d-top, .d-lists, .d-myths dl { grid-template-columns: minmax(0, 1fr); }
  .d-plate { flex-direction: row; }
  .d-meals > div { grid-template-columns: minmax(0, 1fr); }
}

/* One A4 page. The buttons go; the note box stays for his handwriting or the platform's typed note. */
@page { size: A4; margin: 10mm 11mm; }
@media print {
  body.d-body { background: #fff; font-size: 9pt; line-height: 1.35; }
  .d-sheet { max-width: none; margin: 0; padding: 0; border-radius: 0; background: #fff; }
  .d-tools { display: none; }
  .d-head { padding-bottom: 5px; }
  .d-doc { flex-direction: row; flex-wrap: wrap; gap: 0 12px; font-size: 8pt; align-items: baseline; }
  .d-doc strong { font-size: 11pt; }
  .d-status { margin-top: 6px; font-size: 7.5pt; }
  .d-small { font-size: 7.5pt; margin: -2px 0 4px; }
  .d-swap { font-size: .95em; margin-top: 1px; }
  h1 { font-size: 17pt; margin: 6px 0 2px; }
  h2 { font-size: 10.5pt; margin-bottom: 4px; }
  .d-lede { font-size: 9pt; margin-bottom: 5px; }
  .d-top { grid-template-columns: 38mm 1fr; gap: 12px; margin-bottom: 8px; }
  .d-plate svg { width: 22mm; }
  .d-plate { flex-direction: row; gap: 8px; }
  .d-plate figcaption { font-size: 7.5pt; }
  .d-rules { gap: 2px; }
  .d-rules li::before { width: 1.5rem; height: 1.5rem; font-size: 8pt; }
  .d-lists { gap: 8px; margin-bottom: 6px; }
  .d-card { padding: 7px 9px; border-radius: 8px; break-inside: avoid; }
  .d-card ul { gap: 2px; font-size: 8.3pt; }
  .d-day, .d-myths { margin-bottom: 5px; break-inside: avoid; }
  .d-foot { padding-top: 4px; }
  .d-caution { margin-bottom: 4px; }
  .d-meals, .d-myths dl { font-size: 8.5pt; }
  .d-meals { columns: 2; column-gap: 14px; }
  .d-meals > div { grid-template-columns: 22mm minmax(0, 1fr); gap: 2px 8px; padding: 3px 4px; }
  .d-myths dl { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px 10px; }
  .d-note { padding: 6px 10px; margin-bottom: 6px; break-inside: avoid; }
  .d-note__lines { min-height: 12mm; }
  .d-note h2 { margin-bottom: 0; }
  .d-caution, .d-foot { font-size: 7.5pt; }
  .d-alert { font-size: 8.5pt; padding: 5px 9px; margin-bottom: 6px; }
  * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
