/* Today — compact mobile-first layout (the 2026-09 redesign, rounds 2 and 3).
   The garden with the big plant and the greeting beside it (css/garden.css) · one snapshot card with a
   Details disclosure · one Quick add button · the four meals · "What to eat today" (#eat-today) ·
   weather tips · "More for today".
   Surfaces stay light in every theme (the night hero is navy, its cards are not). */

/* Screen-reader-only text (headings and states that the layout already shows visually). */
.today-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- Hero: the garden (the big plant with the greeting beside it), then the snapshot ----
   Round 3: the greeting line moved into the garden card, next to the plant (css/garden.css), so the
   bigger plant costs no extra row. */
.world-hero.today-hero { padding: 6px 10px 9px; gap: 6px; margin-bottom: 10px; }
/* The ambient layer (js/adaptive/ambient.js) hangs festival items from the top of the hero and puts
   the moon in its top-right corner. In this compact hero they are small; on those days a thin band
   above the garden card keeps them in view (the card never covers them). */
html[data-event] .world-hero.today-hero, .world-hero.today-hero:has(.adp-moon, .deco-moon) { padding-top: 17px; }
html[data-event] .today-hero { --adp-moon-top: -1px; }
.today-hero { --adp-moon-top: -2px; --adp-moon-right: 14px; }
.today-hero .adp-moon .adp-moon-body { width: 21px; height: 21px; }
.today-hero .adp-moon.adp-moon-prominent .adp-moon-body { width: 22px; height: 22px; }
/* On a festival day the moon hangs in the band above the greeting, like the lanterns. */
html[data-event] .today-hero .adp-moon .adp-moon-body, html[data-event] .today-hero .adp-moon.adp-moon-prominent .adp-moon-body { width: 21px; height: 21px; }
.today-hero .adp-lanterns .adp-lantern, .today-hero .adp-lanterns-red .adp-lantern { --w: 11px !important; --len: 2px !important; }
.today-hero .adp-fairy-lights .adp-fairy-wire { height: 16px; }

.snap-card { position: relative; z-index: 2; background: var(--surface-glass); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border-radius: var(--radius-lg); padding: 7px 12px 8px; box-shadow: 0 6px 20px rgba(23, 34, 28, 0.08); color: var(--text-primary); }
.snap-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.snap-kcal { margin: 0; display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 6px; min-width: 0; }
.snap-kcal .hero-big { font-size: 30px; line-height: 1.15; }
.snap-kcal .hero-label { margin: 0; font-size: 14px; font-weight: 600; color: var(--text-secondary); }
.snap-kcal.is-empty { flex-direction: column; align-items: flex-start; gap: 0; padding: 4px 0; }
.snap-kcal.is-empty .hero-label { font-size: 16px; font-weight: 800; color: var(--text-primary); }
.snap-goal { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
/* 44 px to tap, but it takes only 36 px of the row (the extra 4 px above and below overlap the padding). */
.dh-disclosure.snap-details-btn { width: auto; flex: 0 0 auto; min-height: 44px; margin: -4px -4px -4px 0; padding: 0 10px 0 12px; font-size: 13.5px; background: var(--accent-light); color: var(--accent-strong); }
.snap-bar { height: 8px; margin: 2px 0 8px; border-radius: 999px; background: color-mix(in srgb, var(--macro-kcal) 16%, #eef1f5); overflow: hidden; }
.snap-bar > i { display: block; height: 100%; width: var(--pct, 0%); border-radius: inherit; background: var(--macro-kcal); transition: width 400ms ease; }

.snap-chips { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.snap-chip { display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 1px; min-width: 0; min-height: 48px; margin: 0;
  padding: 4px 9px 5px; border: 0; border-radius: 14px; background: var(--surface-soft); color: var(--text-primary); text-align: left; font-size: 14px; font-weight: 400; box-shadow: none; }
.snap-chip:hover { background: var(--accent-light); transform: none; }
.snap-chip-label { font-size: 11.5px; font-weight: 700; color: var(--text-secondary); line-height: 1.2; }
.snap-chip-value { max-width: 100%; font-size: 14.5px; font-weight: 800; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snap-chip-value.empty { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.snap-chip-track { display: block; width: 100%; height: 4px; margin-top: 3px; border-radius: 999px; background: #E3E8E5; overflow: hidden; }
.snap-chip-track > i { display: block; height: 100%; border-radius: inherit; background: var(--chip-c, var(--accent)); }
.snap-chip[data-chip="protein"] { --chip-c: var(--macro-protein); }
.snap-chip[data-chip="water"] { --chip-c: var(--sky); }
.snap-chip[data-chip="sleep"] { --chip-c: var(--lavender); }

/* One helper line; the low-intake care message is shown in full, on a warm backing. */
.snap-card .hero-context-msg.snap-msg { margin: 6px 0 0; font-size: 13px; font-weight: 600; line-height: 1.4; color: var(--text-secondary); text-wrap: pretty; }
.snap-card .hero-context-msg.snap-msg.is-care { padding: 6px 10px; line-height: 1.36; border-radius: 12px; background: #FFF4DB; color: #4A3A12; }
.snap-card .plan-card-warning { margin: 8px 0 0; font-size: 12.5px; color: #6E4D00; }
/* The "See details" button keeps a 44 px tap area without stretching the text lines. */
.snap-card .plan-card-warning .link-btn { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; padding: 0 2px; vertical-align: middle; font-size: 12.5px; color: #6E4D00; }

/* Details: the plan's 8 rows, energy, Up next. */
.snap-details { margin-top: 10px; padding-top: 8px; border-top: 1px dashed rgba(23, 34, 28, 0.14); }
.snap-details .plan-card-source, #tab-today #plan-card-source { display: block; min-height: 0; white-space: normal; font-size: 12.5px; line-height: 1.45; color: var(--text-secondary); }
.plan-card-source-more { display: block; font-size: 12px; }
.snap-details .plan-card-source-link { display: inline-flex; align-items: center; min-height: 44px; margin: -12px 0; vertical-align: middle; font-size: 12.5px; }
.snap-sub, .snap-details .plan-next-title { display: flex; align-items: center; gap: 8px; margin: 10px 0 6px; font-size: 11.5px; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; color: var(--text-secondary); }
.snap-sub .plan-card-badge { text-transform: none; letter-spacing: 0; }
.snap-details .plan-rows { gap: 8px; }
.snap-details .plan-next { margin-top: 4px; padding-top: 0; border-top: 0; }
.snap-details .plan-next-item { background: var(--surface-soft); }
.snap-energy.hero-substats { display: grid; gap: 2px; font-size: 13px; color: var(--text-primary); }
.snap-energy-row { display: flex; align-items: center; gap: 8px; min-height: 26px; }
.snap-energy-label { color: var(--text-secondary); font-weight: 600; }
.snap-energy-value { margin-left: auto; font-weight: 700; text-align: right; }
.snap-energy-value.empty { font-weight: 500; color: var(--text-secondary); }
.snap-energy-row .link-btn { margin: -9px -4px -9px 0; font-size: 13px; }

/* ---- The one Quick add button ---- */
.today-add { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; margin: 0 0 12px; padding: 8px 16px 8px 10px;
  border-radius: 18px; background: var(--accent-strong); color: #fff; text-align: left; box-shadow: 0 8px 20px rgba(23, 34, 28, 0.14); }
.today-add:hover { background: color-mix(in srgb, var(--accent-strong) 86%, #000); }
.today-add:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 3px; }
.today-add-plus { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 38px; height: 38px; border-radius: 12px; background: rgba(255, 255, 255, 0.2); font-size: 22px; font-weight: 800; line-height: 1; }
.today-add-text { display: flex; flex-direction: column; min-width: 0; }
.today-add-title { font-size: 16.5px; font-weight: 800; line-height: 1.2; }
.today-add-sub { font-size: 12.5px; font-weight: 600; opacity: 0.92; }

/* ---- Meals: 2 × 2 buttons ---- */
.today-meals { margin: 0 0 12px; padding: 8px 10px 10px; border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-soft); }
.today-meals-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 24px; margin: 0 2px 6px; }
.today-meals-head h2 { margin: 0; font-size: 16px; font-weight: 800; }
#today-meals-total { font-size: 13px; font-weight: 600; color: var(--text-secondary); }
.today-meals-head .link-btn { margin: -10px -4px -10px 0; font-size: 13.5px; }
.today-meal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.today-meal { display: flex; align-items: center; gap: 8px; min-width: 0; min-height: 48px; margin: 0; padding: 4px 10px; border: 1.5px solid transparent; border-radius: 14px;
  background: var(--surface-soft); color: var(--text-primary); text-align: left; font-size: 14px; font-weight: 400; box-shadow: none; }
.today-meal:hover { background: var(--accent-light); transform: none; }
.today-meal.empty { background: transparent; border-style: dashed; border-color: color-mix(in srgb, var(--accent-strong) 35%, transparent); }
.today-meal-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 30px; height: 30px; border-radius: 10px; background: var(--accent-light); color: var(--accent-strong); }
.today-meal-icon svg { width: 17px; height: 17px; }
.today-meal-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.today-meal-name { font-size: 12.5px; font-weight: 700; color: var(--text-secondary); }
.today-meal-value { font-size: 14.5px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-meal.empty .today-meal-value { color: var(--accent-strong); }
.today-meal:focus-visible, .snap-chip:focus-visible, .today-note-btn:focus-visible, .today-more-btn:focus-visible { outline: 3px solid var(--accent-strong); outline-offset: 2px; }

/* ---- The day's note (only when there is one) ---- */
.today-note { margin: 0 0 12px; }
#tab-today #note-preview-edit.today-note-btn { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; min-height: 48px; margin: 0; padding: 8px 12px;
  border-radius: 16px; background: var(--surface); color: var(--text-primary); text-align: left; font-size: 13.5px; font-weight: 500; box-shadow: var(--shadow-soft); }
#tab-today #note-preview-edit.today-note-btn:hover { background: var(--accent-light); transform: none; }
.today-note-btn .note-preview-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-primary); }
.today-note-btn .edit-icon { color: var(--accent-strong); font-size: 15px; }


/* ---- More for today ---- */
.today-more { margin: 0 0 12px; }
.dh-disclosure.today-more-btn { min-height: 52px; padding: 8px 14px; border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-soft); }
.today-more-label { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.today-more-hint { font-size: 12px; font-weight: 600; color: var(--text-secondary); }
.today-more-panel.adaptive-strip { display: grid; gap: 8px; margin: 8px 0 0; }
.today-more-panel .motivation-card { display: block; margin: 0; padding: 10px 14px; }
.today-more-panel .motivation-text { font-size: 14px; }
.today-more-panel .daily-challenge { margin: 4px 0 0; font-size: 13px; color: var(--text-secondary); }
.today-more-panel .rec-section { margin: 0; }

/* Motion: the user's setting and the OS setting both stop Today's small transitions. */
html[data-motion="reduced"] #tab-today *, html[data-motion="off"] #tab-today * { transition: none !important; }
@media (prefers-reduced-motion: reduce) { #tab-today * { transition: none !important; } }

/* Narrow phones (360 px): a little less padding so the three chips keep their words. */
@media (max-width: 380px) {
  .world-hero.today-hero { padding: 7px 8px 12px; }
  html[data-event] .world-hero.today-hero, .world-hero.today-hero:has(.adp-moon, .deco-moon) { padding-top: 17px; }
  .snap-card { padding: 8px 10px 10px; }
  .snap-chip { padding: 4px 7px 5px; }
  .snap-chip-value { font-size: 13.5px; }
  .snap-kcal .hero-big { font-size: 27px; }
}
@media (min-width: 700px) {
  .world-hero.today-hero { padding: 12px 16px 18px; gap: 10px; }
  html[data-event] .world-hero.today-hero, .world-hero.today-hero:has(.adp-moon, .deco-moon) { padding-top: 20px; }
  .snap-card { padding: 12px 16px 14px; }
}
