:root {
  color-scheme: light;
  --ink: #203830;
  --muted: #51645a;
  --dark: #143c30;
  --accent: #a04328;
  --cream: #f7f4eb;
  --card: #fffdf7;
  --line: #deddd0;
  --sage: #e3ebd9;
  --peach: #f3e4d5;
  --serif: Georgia, 'Times New Roman', serif;
  font: 16px/1.52 system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--ink);
  background: var(--cream);
}
* { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
a { color: var(--dark); text-underline-offset: .2em; }
a:hover { text-decoration-thickness: .13em; }
button, input, textarea, select { color: inherit; font: inherit; }
button, summary { cursor: pointer; }
button:disabled { cursor: default; opacity: .43; }
:focus-visible { outline: 3px solid #9c462c; outline-offset: 3px; }
input, textarea, select { min-width: 0; }
.shell { width: min(68rem, calc(100% - 2rem)); margin-inline: auto; }
.masthead { background: var(--cream); border-bottom: 1px solid var(--line); }
.topbar { min-height: 4.5rem; display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .62rem; font: 700 1.48rem/1 var(--serif); white-space: nowrap; text-decoration: none; }
.brand-mark { display: grid; place-items: center; width: 2rem; aspect-ratio: 1; background: var(--dark); color: #f2c38f; border-radius: 50%; font: 1.45rem/1 system-ui; }
.navigation { display: flex; align-items: center; gap: .25rem; }
.navigation a { display: inline-flex; gap: .45rem; align-items: center; justify-content: center; min-height: 2.75rem; padding: .36rem .75rem; border-radius: .65rem; text-decoration: none; font-size: .91rem; font-weight: 650; }
.navigation a span { font-size: 1.12rem; line-height: 1; }
.navigation a[aria-current] { background: var(--sage); }
.navigation a:hover { background: #ebeadd; }
main { padding-top: 1.35rem; }
body[data-page="bienvenida"] .masthead, body[data-page="bienvenida"] footer { display: none; }
body[data-page="bienvenida"] main { padding-block: max(1.25rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-bottom)); }
.welcome-frame { display: grid; grid-template-columns: 1fr 1fr; min-height: 29rem; margin-block: clamp(0rem, 8vh, 5rem); overflow: hidden; border-radius: 1.55rem; background: var(--dark); color: var(--card); }
.welcome-photo { order: 1; width: 100%; height: 100%; min-height: 0; object-fit: cover; object-position: 53% center; }
.welcome-copy { align-self: center; padding: clamp(1.5rem, 5vw, 4.25rem); }
.welcome-copy h1 { margin-bottom: .7rem; }
.welcome-copy p { max-width: 30ch; color: #f0f2e7; font-size: clamp(1rem, 2.4vw, 1.14rem); }
.welcome-actions { display: flex; flex-wrap: wrap; align-items: center; column-gap: 1.4rem; row-gap: .45rem; margin-top: 1.45rem; }
.welcome-actions .button { padding-inline: 1.1rem; }
.welcome-shopping { display: inline-flex; align-items: center; min-height: 2.75rem; color: #f7e6cc; font-weight: 650; }
.welcome-actions :focus-visible { outline-color: #f3c496; }
.hero { min-height: 19rem; display: grid; grid-template-columns: 1fr 1fr; border-radius: 1.55rem; overflow: hidden; background: var(--dark); color: var(--card); }
.hero-copy { align-self: center; padding: clamp(1.45rem, 4.5vw, 3.5rem); }
.hero .eyebrow { color: #f3c496; }
.hero h1 { max-width: 12ch; margin-block: .25rem .65rem; }
.hero p:not(.eyebrow) { max-width: 33ch; color: #f0f2e7; }
.hero-art { min-width: 0; background: radial-gradient(ellipse at 70% 70%, #547259, #143c30 76%); }
.hero-art.with-photo { background-image: linear-gradient(90deg, #143c30, transparent 33%), url('menu-hero.webp'); background-position: center; background-size: cover; }
.hero .light { margin-top: 1.15rem; }
.hero :focus-visible { outline-color: #f3c496; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.08; letter-spacing: -.025em; }
h1 { font-size: clamp(2.45rem, 5.7vw, 4.4rem); font-weight: 500; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); font-weight: 500; }
h3 { font-size: 1.27rem; }
.eyebrow { color: var(--accent); font-size: .79rem; font-weight: 800; letter-spacing: .075em; text-transform: uppercase; }
.button { display: inline-flex; justify-content: center; align-items: center; min-height: 2.75rem; padding: .45rem .85rem; border: 1px solid transparent; border-radius: .67rem; text-decoration: none; font-weight: 750; font-size: .89rem; }
.button.light { color: var(--dark); background: #f7e6cc; }
.button.outline { border-color: #a5b0a0; background: var(--card); }
.button:hover { filter: brightness(.96); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin-block: 1.65rem .8rem; }
.date-control { display: flex; gap: .3rem; min-width: 0; align-items: center; }
.date-control button, .date-control input, #week-label, #shopping-week-label { min-height: 2.75rem; border: 1px solid #c9cebe; border-radius: .72rem; background: var(--card); }
.date-control input { width: 8.4rem; padding: .35rem; text-align: center; }
.date-control input::-webkit-date-and-time-value { text-align: center; }
.date-control button { width: 2.75rem; flex: none; font-size: 1.45rem; line-height: 1; }
.date-control .jump-today { width: auto; padding-inline: .62rem; font-size: .85rem; font-weight: 750; }
.dashboard-grid { display: grid; grid-template-columns: minmax(0, 2.35fr) minmax(15rem, 1fr); gap: 1rem; }
.meals-grid, .shopping-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem; }
.panel, .meal { min-width: 0; background: var(--card); border: 1px solid var(--line); border-radius: 1rem; padding: 1.05rem; }
.meal { display: flex; flex-direction: column; border-top-width: 3px; border-top-color: #d5b78e; }
.meal[data-meal="lunch"] { border-top-color: #9aaf81; }
.meal[data-meal="dinner"] { border-top-color: #bc785f; }
.meal[data-meal="snack"] { border-top-color: #a19bba; }
.meal[data-done] { background: #f0f4e8; border-color: #a4b78e; }
.meal h3 { margin-block: .4rem .45rem; }
.meal p:not(.eyebrow) { color: var(--muted); }
.recipe-trigger { width: 100%; display: flex; align-items: center; gap: .75rem; text-align: start; padding: 0; border: 0; border-radius: .65rem; background: transparent; }
.recipe-trigger:hover .recipe-link { text-decoration-thickness: .14em; }
.meal-photo { width: 4.8rem; height: 4.8rem; flex: none; object-fit: cover; border-radius: .65rem; background: var(--sage); }
.recipe-trigger-text { min-width: 0; display: grid; gap: .3rem; }
.meal-name { font: 700 1.18rem/1.16 var(--serif); }
.recipe-link { font: 650 .86rem/1.3 system-ui; color: var(--dark); text-decoration: underline; text-underline-offset: .2em; letter-spacing: 0; }
.meal-actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .15rem .45rem; margin-top: auto; padding-top: .85rem; }
.tick { display: flex; align-items: center; gap: .58rem; min-height: 2.75rem; font-weight: 700; cursor: pointer; }
.tick input { flex: none; width: 1.22rem; height: 1.22rem; margin: 0; accent-color: var(--dark); }
.text-button { min-height: 2.75rem; padding-inline: .18rem; background: transparent; border: 0; text-decoration: underline; text-underline-offset: .18em; color: var(--dark); font-size: .85rem; font-weight: 650; }
.dashboard-side { display: grid; gap: .9rem; align-content: start; }
.daily-progress { background: var(--sage); }
.dashboard-side p { margin-top: .65rem; }
.daily-progress progress { appearance: none; width: 100%; height: .62rem; margin-block: .6rem .35rem; border: 0; border-radius: .5rem; background: #c4d2b9; accent-color: var(--dark); }
.daily-progress progress::-webkit-progress-bar { background: #c4d2b9; border-radius: .5rem; }
.daily-progress progress::-webkit-progress-value { background: var(--dark); border-radius: .5rem; }
.daily-progress progress::-moz-progress-bar { background: var(--dark); border-radius: .5rem; }
.progress-bottom { border-top: 1px solid #b8c7aa; }
.progress-bottom a { display: inline-block; padding-block: .5rem .1rem; font-weight: 700; }
.list-prompt { background: var(--peach); }
.list-prompt .button { margin-top: .75rem; }
.page-head { padding-block: 1.25rem .95rem; }
.page-head h1 { margin-block: .22rem .65rem; }
.page-head > p:not(.eyebrow) { max-width: 65ch; color: var(--muted); }
.goal { margin: .4rem 0 1rem; background: var(--sage); }
.goal p, .month-panel p { margin-block: .55rem; max-width: 76ch; }
.choice-row { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .35rem; margin-bottom: .8rem; }
.choice-row button { min-height: 2.75rem; padding: .14rem; border: 1px solid #c9cebe; border-radius: .7rem; background: var(--card); font-size: .87rem; font-weight: 750; }
.choice-row button[aria-pressed="true"] { color: white; background: var(--dark); border-color: var(--dark); }
.calendar { padding: .65rem; }
.month-control { justify-content: space-between; margin-bottom: .55rem; }
.month-control h2 { text-align: center; font-size: clamp(1.15rem, 4vw, 1.58rem); }
.calendar-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .24rem; }
.calendar-days button { min-height: 2.75rem; padding: 0; border: 1px solid transparent; border-radius: .55rem; background: #f3f2e8; font-weight: 650; }
.calendar-days button[aria-current="date"] { border-color: var(--accent); }
.calendar-days button[aria-pressed="true"] { background: var(--dark); color: white; }
.calendar-weekday { text-align: center; font-size: .84rem; font-weight: 650; color: var(--muted); }
.nutrition-details { margin-top: .95rem; }
.plan-menu { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .85rem; }
.plan-menu .meal p.budget { margin-top: .6rem; padding-top: .15rem; border-top: 1px solid var(--line); }
.budget button { text-align: start; }
.month-panel { background: var(--peach); }
.shopping-grid h3 { margin-bottom: .6rem; }
.shopping-grid label + label { border-top: 1px solid var(--line); }
.shopping-grid .tick { padding-block: .5rem; align-items: flex-start; }
.shopping-grid .tick input { margin-top: .18rem; }
.shopping-grid .tick:has(:checked) .shopping-item { text-decoration: line-through; color: var(--muted); }
.shopping-quantity, .shopping-details { display: block; color: var(--muted); font-size: .875rem; }
.shopping-quantity { font-weight: 650; }
.shopping-details { font-weight: 450; }
.movement-list { display: grid; gap: .65rem; }
.movement-list details { margin-top: .15rem; }
.movement-list p { margin-top: .42rem; }
.movement-list .tick { margin-bottom: .28rem; }
.muted { color: var(--muted); }
.note { margin-block: .8rem; font-size: .9rem; }
.week-control { margin-bottom: .9rem; }
#week-label, #shopping-week-label { display: grid; place-items: center; text-align: center; padding: .4rem .75rem; font-size: .91rem; font-weight: 750; }
.weekly-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: .9rem; align-items: start; }
.week-activity { background: var(--sage); }
.tallies { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; margin: .9rem 0 1rem; }
.tallies div { display: grid; }
.tallies strong { font: 2.2rem/1.15 var(--serif); }
.tallies span { font-size: .88rem; }
.week-bars { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: .3rem; margin-top: .6rem; }
.week-bars a { display: grid; gap: .28rem; justify-items: center; align-items: end; min-height: 5rem; text-decoration: none; font-size: .78rem; font-weight: 700; }
.week-bars a:hover { text-decoration: underline; }
.bar { align-self: end; height: 3.25rem; width: 60%; max-width: 1.32rem; background: #cad7c0; border-radius: .45rem; display: flex; align-items: end; }
.bar i { width: 100%; background: #27664d; border-radius: .45rem; }
.symptoms p { margin-block: .45rem .8rem; color: var(--muted); }
.symptoms form { display: grid; gap: .85rem; }
.symptoms label { display: block; min-width: 0; font-weight: 650; }
.symptoms select, .symptoms textarea { display: block; width: 100%; min-height: 2.85rem; margin-top: .28rem; border: 1px solid #a9b7a8; border-radius: .65rem; background: var(--card); padding: .55rem; font-weight: 400; }
.symptoms textarea { resize: vertical; }
.pain-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .65rem; align-items: end; }
.mobility-grid { display: grid; gap: .55rem; margin-top: .55rem; }
summary { font-weight: 700; min-height: 2.75rem; align-content: center; }
footer { padding-block: 1.35rem; color: var(--muted); font-size: .85rem; }
#recipe-dialog { width: min(35rem, calc(100% - 1.5rem)); max-height: 90vh; max-height: 90dvh; padding: 0; color: var(--ink); background: var(--card); border: 1px solid var(--line); border-radius: 1.2rem; box-shadow: 0 1rem 4rem #142e2680; }
#recipe-dialog::backdrop { background: #132a23b5; }
body:has(#recipe-dialog[open]) { overflow: hidden; }
.recipe-close-form { position: sticky; top: 0; display: flex; justify-content: flex-end; height: 0; padding-inline: .65rem; z-index: 1; }
.recipe-close { width: 2.75rem; height: 2.75rem; flex: none; margin-top: .65rem; border: 1px solid #919b87; border-radius: 50%; background: var(--card); font-size: 1.55rem; line-height: 1; }
.recipe-hero { background: var(--sage); }
.recipe-hero img { display: block; width: 100%; height: clamp(10rem, 39vh, 17rem); object-fit: cover; object-position: center; }
.recipe-content { padding: 1.25rem; }
.recipe-content h2 { margin-block: .35rem .9rem; }
.recipe-content h3 { margin-block: .92rem .35rem; }
.recipe-content ol { padding-inline-start: 1.35rem; margin-block: .4rem 0; }
.recipe-content li + li { margin-top: .35rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
@media (max-width: 48rem) {
  .dashboard-grid, .weekly-grid { grid-template-columns: 1fr; }
  .dashboard-side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 37rem) {
  .shell { width: calc(100% - 1.5rem); }
  .welcome-frame { grid-template-columns: 1fr; min-height: 0; margin-block: 0; }
  .welcome-photo { order: 0; height: clamp(12.5rem, 41vh, 19rem); }
  .welcome-copy { padding: 1.4rem; }
  .topbar { min-height: 3.5rem; }
  .navigation { position: fixed; z-index: 2; inset: auto 0 0; padding: .3rem .6rem max(.3rem, env(safe-area-inset-bottom)); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); background: var(--cream); box-shadow: 0 -5px 20px #2038300c; }
  .navigation a { flex-direction: column; gap: .13rem; min-height: 3.05rem; padding: .24rem 0; font-size: .78rem; }
  main { padding-top: .85rem; padding-bottom: calc(3.7rem + env(safe-area-inset-bottom)); }
  .hero { min-height: 17rem; position: relative; grid-template-columns: 1fr; }
  .hero-copy { position: relative; z-index: 1; padding: 1.15rem; }
  .hero-copy p:not(.eyebrow) { max-width: 23ch; }
  .hero-art { position: absolute; inset: 0 0 0 25%; }
  .hero-art.with-photo { background-image: linear-gradient(90deg, #143c30 0%, #143c30d9 33%, #143c3060 100%), url('menu-hero.webp'); background-position: 57% center; }
  .section-head { flex-wrap: wrap; margin-block: 1.25rem .7rem; }
  .meals-grid, .plan-menu { grid-template-columns: 1fr; gap: .6rem; }
  .meal { padding: .8rem .9rem; }
  .meal-actions { padding-top: .35rem; }
  .dashboard-side, .shopping-grid { grid-template-columns: 1fr; }
  #recipe-dialog { margin: auto auto max(.25rem, env(safe-area-inset-bottom)); }
}
