/* de31 polish (2026-10-23). Loaded after app.css. One place for the Nutrition tab redesign, the
   Going out sheet, sheet dragging, swipe rows, the workout switches row and the journal feelings.
   Spacing uses a 4 pt grid (4, 8, 12, 16, 20, 24); colors only come from the theme tokens in app.css,
   so light and dark both follow automatically. Every motion has a Reduced Motion fallback at the end. */

/* ---------- Nutrition card: measured by its own width (iPhone SE to Pro Max) ---------- */
.macro-tracker{container-type:inline-size;container-name:nut}
/* Raised surfaces for segmented controls and small round buttons: lighter than the track in both themes */
:root{--seg-ind:var(--surface);--chip-bg:var(--surface)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){--seg-ind:#343c36;--chip-bg:#2c332e}}
:root[data-theme="dark"]{--seg-ind:#343c36;--chip-bg:#2c332e}

/* Day totals: one stat per tracked number, centered as a group, each with a thin progress line */
.macro-tracker .macro-totals{display:grid;grid-template-columns:repeat(var(--cols,2),minmax(0,1fr));gap:16px;margin:12px 0 16px;text-align:center;justify-items:stretch;align-items:start}
.macro-tracker .macro-totals[data-n="1"]{--cols:1;width:min(100%,280px);margin-inline:auto}
.macro-tracker .macro-totals[data-n="3"]{--cols:3;gap:12px}
.macro-tracker .macro-total{display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0}
.macro-tracker .macro-total__value{font-family:var(--display);font-size:2.75rem;line-height:1;letter-spacing:-.01em;color:var(--text);font-variant-numeric:tabular-nums;white-space:nowrap}
.macro-tracker .macro-totals[data-n="1"] .macro-total__value{font-size:3.25rem}
.macro-tracker .macro-totals[data-n="3"] .macro-total__value{font-size:2.125rem}
.macro-tracker .macro-total__label{font-size:.8125rem;line-height:1.3;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
.macro-tracker .macro-total__bar{position:relative;display:block;width:100%;max-width:200px;height:4px;margin:8px auto 0;border-radius:2px;background:var(--line);overflow:hidden}
.macro-tracker .macro-total__bar::after{content:"";position:absolute;inset:0;border-radius:inherit;background:var(--accent);transform-origin:left center;transform:scaleX(var(--p,0));transition:transform .7s cubic-bezier(.2,.8,.2,1)}
.macro-tracker .macro-total.is-done .macro-total__bar::after{background:var(--sage)}
.macro-tracker .macro-total__left{font-size:.75rem;line-height:1.3;color:var(--faint);font-variant-numeric:tabular-nums;white-space:nowrap}
.macro-tracker .macro-total.is-done .macro-total__left{color:var(--ok-text);font-weight:600}
@container nut (max-width:330px){
  .macro-tracker .macro-total__value{font-size:2.25rem}
  .macro-tracker .macro-totals[data-n="3"] .macro-total__value{font-size:1.75rem}
}

/* "Tracking" bar: label, chosen macros, then the extras on the right; no stray dot */
.macro-tracker .macro-track{border-radius:16px;border-color:var(--line);grid-template-columns:minmax(0,1fr)}
.macro-tracker .macro-track>*{min-width:0}
.macro-tracker .macro-track__btn{gap:8px;min-height:48px;padding:8px 12px 8px 16px;flex-wrap:nowrap}
@container nut (max-width:300px){.macro-tracker .macro-track__btn .macro-choose__label{display:none}}
.macro-tracker .macro-track__btn .macro-choose__label{font-size:.6875rem;letter-spacing:.1em;color:var(--muted);opacity:1;flex:none}
.macro-tracker .macro-track__btn .macro-choose__current{display:inline-flex!important;flex-wrap:nowrap!important;flex:none;align-items:center;gap:4px}
.macro-tracker .macro-track__btn:has(.macro-choose__current > :nth-child(3)) .macro-choose__label{display:none}
.macro-tracker .macro-choose__current .macro-mini{flex:none}
/* Two or three macros: icons only, so the bar stays one line */
.macro-tracker .macro-choose__current:has(> :nth-child(2)) .macro-mini{font-size:0;gap:0;padding:6px;min-width:32px;justify-content:center}
.macro-tracker .macro-choose__current:has(> :nth-child(2)) .macro-mini .macro-icon{font-size:1rem}
.macro-tracker .macro-track__extra{margin-left:auto;min-width:0;font-size:.8125rem;color:var(--muted);opacity:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.macro-tracker .macro-track__extra[hidden]{display:none}
.macro-tracker .macro-track__chev{margin-left:4px;flex:none;width:28px;height:28px;display:grid;place-items:center;border-radius:50%;color:var(--muted)}
.macro-tracker .macro-track__extra[hidden] + .macro-track__chev{margin-left:auto}

/* 7-day average: one centered line, only what is tracked (member-ui.js shortens it to fit) */
.macro-tracker .week-avg{margin:10px 0 4px;text-align:center;white-space:nowrap;overflow:hidden;font-size:.8125rem;line-height:1.4;color:var(--muted)}
.macro-tracker .week-avg.is-small{font-size:.75rem;letter-spacing:-.005em}

/* Meals: one segmented control, the moon as the fifth segment, a sliding highlight */
.macro-tracker .slot-bar.slot-seg{position:relative;display:grid;grid-template-columns:repeat(var(--n,4),minmax(0,1fr));gap:0;flex-wrap:nowrap;padding:4px;margin:16px 0 4px;border-radius:14px;background:var(--surface-2);border:1px solid var(--line-soft);overflow:visible}
.macro-tracker .slot-bar.slot-seg.has-moon{grid-template-columns:repeat(4,minmax(0,1fr)) 48px}
.macro-tracker .slot-seg .slot-ind{position:absolute;z-index:0;top:4px;bottom:4px;left:0;width:var(--iw,0);border-radius:10px;background:var(--seg-ind);box-shadow:0 1px 2px rgba(28,35,33,.08),0 3px 10px -4px rgba(48,40,26,.22);transform:translateX(var(--ix,4px));transition:transform .36s cubic-bezier(.3,1.2,.4,1),width .36s cubic-bezier(.3,1.2,.4,1)}
.macro-tracker .slot-seg.no-anim .slot-ind{transition:none}
.macro-tracker .slot-seg .slot-tab{position:relative;z-index:1;flex:none;display:flex;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:44px;padding:0 4px;border:0;border-radius:10px;background:transparent;color:var(--muted);font:500 .8125rem/1.1 var(--font);white-space:nowrap;box-shadow:none;animation:none}
.macro-tracker .slot-seg .slot-tab.is-on,.macro-tracker .slot-seg .slot-tab[aria-selected="true"]{background:transparent;color:var(--text);font-weight:600}
.macro-tracker .slot-seg .slot-tab:active{transform:scale(.95);opacity:1}
.macro-tracker .slot-seg .slot-tab__l{overflow:hidden;text-overflow:clip}
.macro-tracker .slot-seg .slot-tab__l--short{display:none}
.macro-tracker .slot-seg .slot-tab__n{position:absolute;top:-6px;right:-2px;min-width:18px;height:18px;padding:0 5px;border-radius:9px;background:var(--accent);color:var(--accent-ink);border:2px solid var(--surface);box-sizing:border-box;font:700 .625rem/14px var(--font);text-align:center;font-variant-numeric:tabular-nums;display:block}
.macro-tracker .slot-seg .slot-tab--moon{color:var(--accent)}
.macro-tracker .slot-seg .slot-tab--moon.is-on{color:var(--accent)}
.macro-tracker .slot-seg .slot-tab__moon{display:inline-flex;line-height:0}
.macro-tracker .slot-seg .slot-tab__moon svg{width:22px;height:22px}
@container nut (max-width:280px){
  .macro-tracker .slot-seg .slot-tab{font-size:.6875rem;padding:0 1px}
  .macro-tracker .slot-seg .slot-tab__l--long{display:none}
  .macro-tracker .slot-seg .slot-tab__l--short{display:inline}
}
@container nut (min-width:281px) and (max-width:380px){
  .macro-tracker .slot-seg .slot-tab{font-size:.75rem;letter-spacing:-.01em;padding:0 2px}
}

/* Today's food header: readable title, a count, the day's calories on the right */
.macro-tracker .today-foods{margin:16px 0 8px}
.macro-tracker .today-foods__head{display:flex;align-items:center;gap:12px;min-height:44px;flex-wrap:nowrap}
.macro-tracker .today-foods__fold{margin-right:auto;gap:8px;min-height:44px;padding:8px 0;color:var(--text)}
.macro-tracker .today-foods__chev{width:20px;height:20px;display:grid;place-items:center;color:var(--muted)}
.macro-tracker .today-foods__title{font:600 1rem/1.2 var(--font);letter-spacing:0;text-transform:none;color:var(--text)}
.macro-tracker .today-foods__count{min-width:24px;height:24px;padding:0 8px;box-sizing:border-box;border-radius:12px;background:var(--surface-2);border:1px solid var(--line);color:var(--muted);font:600 .75rem/22px var(--font);text-align:center;font-variant-numeric:tabular-nums}
.macro-tracker .today-foods__sum{font-size:.8125rem;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.macro-tracker .today-foods__sum b{color:var(--text);font-weight:600}
.macro-tracker .today-foods__copy{font-size:.8125rem;white-space:nowrap}
.macro-tracker .today-foods__micro{text-align:left;margin:4px 0 0}

/* Food rows: separate rounded cards with room between them; swipe actions stay hidden until a swipe */
.macro-tracker .today-foods__list{display:grid;gap:8px;margin:8px 0 0}
.macro-tracker .today-foods__row.swipe{border:0;border-radius:16px;overflow:hidden;background:transparent;isolation:isolate;transition:opacity .2s ease}
.macro-tracker .today-foods__row .swipe__face{background:var(--surface-2);border:1px solid var(--line-soft);border-radius:16px}
.macro-tracker .today-foods__row .swipe__act{visibility:hidden;top:1px;bottom:1px;border-radius:16px}
.macro-tracker .today-foods__row.is-swiping .swipe__act,.macro-tracker .today-foods__row .swipe__act[aria-hidden="false"]{visibility:visible}
.macro-tracker .today-foods__row .swipe__act--del{background:var(--danger);color:#fff;transition:width .18s ease}
.macro-tracker .today-foods__row .swipe__act--fav{background:var(--accent);color:var(--accent-ink)}
.macro-tracker .today-foods__row.is-full .swipe__act--del{width:100%}
.macro-tracker .today-foods__row.is-removing{opacity:0}
.macro-tracker .today-foods__row.swipe .today-foods__main{grid-template-columns:minmax(0,1fr) auto 28px;grid-template-areas:"text kcal cue" "mac mac cue";column-gap:12px;row-gap:8px;align-items:center;padding:12px 10px 12px 16px;min-height:60px}
.macro-tracker .today-foods__row.swipe .today-foods__name{font-size:.9375rem;font-weight:600;line-height:1.3;color:var(--text)}
.macro-tracker .today-foods__brand{font-size:.75rem;color:var(--muted)}
.macro-tracker .today-foods__row.swipe .today-foods__kcal{font-size:1rem;color:var(--text);align-self:start;padding-top:1px}
.macro-tracker .today-foods__kcal b{font-weight:700}
.macro-tracker .today-foods__kcal small{font-size:.75rem;font-weight:500;color:var(--muted);opacity:1}
.macro-tracker .today-foods__row.swipe .today-foods__macros{gap:6px}
.macro-tracker .tf-pill{display:inline-flex;align-items:baseline;gap:2px;padding:3px 8px;border-radius:999px;font-size:.75rem;line-height:1.3;font-weight:500;color:var(--muted);background:var(--chip-bg);border:1px solid var(--line-soft);font-variant-numeric:tabular-nums;white-space:nowrap}
.macro-tracker .tf-pill b{font-weight:700;color:var(--text)}
.macro-tracker .tf-pill--alc{color:var(--accent);background:var(--accent-soft);border-color:var(--accent-line)}
.macro-tracker .tf-pill--alc b{color:var(--accent)}
.macro-tracker .today-foods__cue{width:28px;height:28px;border-radius:50%;background:var(--chip-bg);border:1px solid var(--line);color:var(--muted);opacity:1}
.macro-tracker .today-foods__row.is-open .today-foods__cue{opacity:1;color:var(--text)}
.macro-tracker .today-foods__row.is-open .today-foods__ctl{max-height:80px;padding:0 12px 4px 16px}
.macro-tracker .today-foods__ctl-row{gap:8px;padding:0 0 12px}
.macro-tracker .today-foods__del--icon{gap:6px;padding:0 12px 0 10px;min-width:44px;min-height:40px;border-radius:999px;color:var(--danger);border-color:var(--danger-line);background:transparent;font:600 .8125rem var(--font)}
.macro-tracker .today-foods__del-l{line-height:1}
@container nut (max-width:330px){.macro-tracker .today-foods__del-l{display:none}}
.macro-tracker .today-foods__empty{display:flex;align-items:center;gap:12px;margin:8px 0 4px;padding:14px 16px;border:1px dashed var(--line);border-radius:16px;color:var(--muted);font-size:.875rem;line-height:1.4}
.macro-tracker .today-foods__empty-icon{flex:none;color:var(--accent);display:inline-flex}
.macro-tracker .go-add{display:flex;width:100%;justify-content:center;margin:8px 0 0;min-height:44px}
.macro-tracker .go-moon{width:44px;height:44px;flex:none}

/* Log food tiles: equal height, text always inside the tile, two by two on narrow phones */
.macro-tracker .food-log{display:grid;grid-template-columns:repeat(var(--tiles,3),minmax(0,1fr));gap:8px;margin:16px 0 8px}
.macro-tracker .food-log:has(> :nth-child(4)){--tiles:4}
.macro-tracker .food-log .food-log__opt{box-sizing:border-box;min-width:0;min-height:108px;padding:12px 8px;gap:4px;justify-content:flex-start;align-items:center;border-radius:16px;border:1px solid var(--line);overflow:hidden}
.macro-tracker .food-log__icon{margin-bottom:4px;flex:none}
.macro-tracker .food-log__opt b{font-size:.875rem;line-height:1.2;white-space:nowrap;max-width:100%;overflow:hidden;text-overflow:ellipsis}
.macro-tracker .food-log__opt small{display:block;max-width:100%;white-space:normal;text-wrap:balance;overflow-wrap:break-word;font-size:.6875rem;line-height:1.25;color:var(--muted)}
@container nut (max-width:340px){
  .macro-tracker .food-log:has(> :nth-child(4)){--tiles:2}
  .macro-tracker .food-log:has(> :nth-child(4)) .food-log__opt{min-height:92px;flex-direction:row;justify-content:flex-start;text-align:left;gap:8px;padding:12px}
  .macro-tracker .food-log:has(> :nth-child(4)) .food-log__opt b,.macro-tracker .food-log:has(> :nth-child(4)) .food-log__opt small{text-align:left}
}

/* Stacked buttons never touch */
.nutrition-settings-actions{display:grid;gap:12px;margin:24px 0 16px}
.nutrition-settings-actions>.btn{margin:0;width:100%}

/* ---------- Workout switches: Rest timer, Supersets (and Watch) and "?" on one row ----------
   Each switch is a compact two-line pill: its name, and under it On or Off. Icons step aside when
   three switches share the row or the phone is narrow, so nothing is cut off. */
.day-chips{display:flex;flex-wrap:nowrap;align-items:stretch;gap:8px;container-type:inline-size}
.day-chips .day-chip{flex:1 1 0;min-width:0;display:grid;grid-template-columns:auto minmax(0,1fr);grid-template-areas:"icon label" "icon state";align-items:center;column-gap:8px;row-gap:0;min-height:48px;padding:6px 12px 6px 8px;border-radius:16px;text-align:left;overflow:hidden}
.day-chips .day-chip .ss-day__icon{grid-area:icon;flex:none;width:28px;height:28px;min-width:28px;display:grid;place-items:center;border-radius:50%;background:var(--surface-2);border:1px solid var(--line-soft)}
.day-chips .day-chip .ss-day__icon svg{width:16px;height:16px}
.day-chips .day-chip__label{grid-area:label;min-width:0;font:600 .8125rem/1.2 var(--font);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:var(--text)}
.day-chips .day-chip__state{grid-area:state;justify-self:start;margin:0;padding:0;background:none;font:600 .6875rem/1.3 var(--font);letter-spacing:.04em;text-transform:uppercase;color:var(--muted)}
.day-chips .day-chip.is-on .day-chip__state{color:var(--accent);background:none}
.day-chips .day-chip__help{flex:0 0 48px;width:48px;height:auto;min-height:48px;margin:0;border-radius:16px}
.day-chips:has(> .day-chip:nth-of-type(3)) .day-chip{grid-template-columns:minmax(0,1fr);grid-template-areas:"label" "state";padding:6px 10px}
.day-chips:has(> .day-chip:nth-of-type(3)) .day-chip .ss-day__icon{display:none}
@container (max-width:322px){
  .day-chips .day-chip{grid-template-columns:minmax(0,1fr);grid-template-areas:"label" "state";padding:6px 10px}
  .day-chips .day-chip .ss-day__icon{display:none}
}

/* ---------- Journal: "Name the feeling", tidy and foldable ---------- */
.feel{display:block;margin:16px 0 4px;border:1px solid var(--line);border-radius:16px;background:var(--surface);overflow:hidden}
.feel__head{all:unset;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;gap:12px;width:100%;min-height:52px;padding:8px 12px 8px 16px;-webkit-tap-highlight-color:transparent}
.feel__head:focus-visible{outline:2px solid var(--accent);outline-offset:-2px;border-radius:16px}
.feel__title{font:600 1rem/1.2 var(--font);color:var(--text);flex:none}
.feel__meta{display:flex;gap:4px;align-items:center;margin-left:auto;min-width:0;overflow:hidden}
.feel__opt,.feel__count{flex:none;padding:3px 10px;border-radius:999px;font:600 .75rem/1.3 var(--font);background:var(--surface-2);color:var(--muted);border:1px solid var(--line-soft)}
.feel__count{background:var(--accent-soft);color:var(--accent);border-color:var(--accent-line)}
.feel__mini{flex:0 1 auto;min-width:0;padding:3px 10px;border-radius:999px;font:600 .75rem/1.3 var(--font);background:var(--accent-soft);color:var(--accent);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.feel__chev{flex:none;width:28px;height:28px;display:grid;place-items:center;border-radius:50%;color:var(--muted);transition:transform .26s cubic-bezier(.2,.8,.2,1)}
.feel.is-open .feel__chev{transform:rotate(180deg)}
.feel__body{display:grid;grid-template-rows:0fr;transition:grid-template-rows .3s cubic-bezier(.2,.8,.2,1)}
.feel.is-open .feel__body{grid-template-rows:1fr}
.feel__in{min-height:0;overflow:hidden;padding:0 16px;opacity:0;transition:opacity .2s ease,padding .3s ease}
.feel.is-open .feel__in{opacity:1;padding:0 16px 16px}
.feel__hint{margin:0 0 12px;font-size:.8125rem;color:var(--muted)}
.feel__groups{display:grid;gap:12px}
.feel__group{display:grid;gap:8px;padding:0;border:0}
.feel__label{display:flex;align-items:center;gap:8px;font-size:.6875rem;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--muted)}
.feel__dot{width:8px;height:8px;border-radius:50%;flex:none;background:var(--feel)}
.feel__group--bright{--feel:#c99a3f}.feel__group--calm{--feel:#6a9480}.feel__group--tense{--feel:#c06a58}.feel__group--low{--feel:#7884a3}
.feel__chips{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
@container (max-width:280px){.feel__chips{grid-template-columns:repeat(2,minmax(0,1fr))}}
.feel{container-type:inline-size}
.feel .feel__chip{display:inline-flex;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:40px;padding:0 4px;margin:0;border-radius:12px;border:1px solid var(--line);background:var(--surface-2);color:var(--text);font:500 .78rem/1.1 var(--font);letter-spacing:-.005em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.feel .feel__chip.on{background:color-mix(in srgb,var(--feel) 18%,var(--surface));border-color:color-mix(in srgb,var(--feel) 70%,transparent);color:var(--text);font-weight:600}
.feel .feel__chip.is-dim{opacity:.45}
.feel__check{font-weight:700;color:var(--feel);font-size:.75rem}

/* ---------- Going out sheet ---------- */
.go-sheet__head{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;margin:0 0 16px;padding:0 4px;min-height:36px;touch-action:none}
.go-sheet__tally{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-variant-numeric:tabular-nums}
.go-sheet__kcal{margin:0;justify-self:end;white-space:nowrap;font-weight:600;font-variant-numeric:tabular-nums;min-width:4.5em;text-align:right}
.go-sheet__kcal.is-zero{color:var(--faint);font-weight:500}
.go-sheet__kcal.is-pop{animation:selPop .26s ease}
.go-sheet__grab{width:44px;height:5px;margin:0 auto 12px;background:var(--line-strong);position:relative;touch-action:none}
.go-sheet__grab::before{content:"";position:absolute;inset:-14px -40px}   /* a bigger target than the bar itself */
.go-sheet__in{padding:8px 16px calc(16px + env(safe-area-inset-bottom,0px))}
.go-tile{position:relative;overflow:hidden;gap:4px;min-height:120px;padding:14px 8px 12px}
.go-tile__hold{display:inline-flex;align-items:center;gap:4px;margin-top:4px;padding:2px 8px;border-radius:999px;border:1px dashed var(--accent-line);color:var(--accent);font-size:.6875rem;line-height:1.4;font-weight:500}
.go-tile__hold-dot{width:6px;height:6px;border-radius:50%;background:var(--accent);opacity:.8}
.go-tile__ring{position:absolute;inset:0;border-radius:inherit;pointer-events:none;box-shadow:inset 0 0 0 2px var(--accent);clip-path:inset(0 100% 0 0);opacity:0}
.go-tile.is-holding{border-color:var(--accent);background:var(--accent-soft)}
.go-tile.is-holding .go-tile__ring{opacity:1;animation:goHold .52s linear forwards}
@keyframes goHold{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0 0 0 0)}}
.go-tile__flash{position:absolute;left:8px;right:8px;bottom:8px;padding:4px 8px;border-radius:10px;background:var(--accent);color:var(--accent-ink);font-size:.6875rem;font-weight:600;line-height:1.3;animation:goFlash 1.4s ease forwards;pointer-events:none}
@keyframes goFlash{0%{opacity:0;transform:translateY(6px)}12%{opacity:1;transform:none}80%{opacity:1}100%{opacity:0}}
.go-sheet__note{margin:16px 0 0;text-align:center;font-size:.8125rem;line-height:1.45;color:var(--muted)}
.go-sheet__note b{color:var(--text);font-weight:600}
.go-sheet__week{margin:4px 0 0;min-height:1.4em;text-align:center;font-variant-numeric:tabular-nums}
.go-sheet__legal{margin:8px 0 0;text-align:center}
.go-sheet__what{font-size:inherit;padding:4px 2px;min-height:0}
/* What the moon is */
.go-explain .go-info__in{text-align:left}
.go-explain .go-info__icon,.go-explain h3{text-align:center;display:block}
.go-explain .go-info__icon{display:flex;justify-content:center}
.go-explain h3{margin:4px 0 8px}
.go-explain .go-info__in>p{text-align:center;margin:0 0 16px}
.go-explain__list{list-style:none;margin:0 0 20px;padding:0;display:grid;gap:12px}
.go-explain__list li{display:grid;grid-template-columns:36px minmax(0,1fr);gap:12px;align-items:start;font-size:.875rem;line-height:1.45}
.go-explain__ic{width:36px;height:36px;border-radius:12px;display:grid;place-items:center;background:var(--accent-soft);color:var(--accent)}
.go-explain .btn{width:100%}

/* ---------- Bottom sheets that drag: the dim layer fades with the drag ---------- */
.sheet.go-sheet,.sheet.go-info,.sheet.day-help,.sheet.leave-guard,.sheet[data-swipe-dismiss]{background:transparent}
.sheet.go-sheet::before,.sheet.go-info::before,.sheet.day-help::before,.sheet.leave-guard::before,.sheet[data-swipe-dismiss]::before{content:"";position:absolute;inset:0;z-index:0;pointer-events:none;background:var(--scrim);opacity:var(--sheet-drag,1);transition:opacity .28s ease}
.sheet.go-sheet>.sheet__in,.sheet.go-info>.sheet__in,.sheet.day-help>.sheet__in,.sheet.leave-guard>.sheet__in,.sheet[data-swipe-dismiss]>.sheet__in{position:relative;z-index:1;will-change:transform}
.sheet__in.is-dragging{transition:none!important}
.sheet__in.is-dragging::-webkit-scrollbar{display:none}

/* ---------- Reduced Motion ---------- */
@media (prefers-reduced-motion:reduce){
  .macro-tracker .macro-total__bar::after,.macro-tracker .slot-seg .slot-ind,.feel__chev,.feel__body,.feel__in,.macro-tracker .today-foods__row.swipe,.macro-tracker .today-foods__row .swipe__act--del{transition:none}
  .go-tile.is-holding .go-tile__ring{animation:none;clip-path:none}
  .go-tile__flash,.go-sheet__kcal.is-pop{animation:none}
}
@container (max-width:330px){
  .feel .feel__chip{font-size:.72rem;padding:0 2px;letter-spacing:-.01em}
  .feel__chips{gap:6px}
}

/* ---------- Today: an odd last shortcut tile spans the row instead of sitting alone ---------- */
.quick-grid > :last-child:nth-child(odd){grid-column:1 / -1}

/* ---------- Optional journal sections ("Add a note or weight", "Plan your next session") look tappable ---------- */
.journal-extra>summary{list-style:none;position:relative;display:grid;gap:4px;padding-right:44px;-webkit-tap-highlight-color:transparent}
.journal-extra>summary::-webkit-details-marker{display:none}
.journal-extra>summary::before{content:"";position:absolute;right:0;top:50%;width:32px;height:32px;margin-top:-16px;border-radius:50%;background:var(--chip-bg);border:1px solid var(--line)}
.journal-extra>summary::after{content:"";position:absolute;right:12px;top:50%;width:7px;height:7px;border-right:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:translateY(-70%) rotate(45deg);transition:transform .24s cubic-bezier(.2,.8,.2,1)}
.journal-extra[open]>summary::after{transform:translateY(-25%) rotate(225deg)}
@media (prefers-reduced-motion:reduce){.journal-extra>summary::after{transition:none}}
.trk-empty-acts{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.trk-empty-acts .btn{margin:0}

/* ---------- Restaurants tab (restaurants-ui.js) ---------- */
.rest{container-type:inline-size;min-width:0}
.rest__view{display:grid;gap:12px;min-width:0}
.rest__view.from-right{animation:pane-r .34s cubic-bezier(.22,.61,.36,1) both}
.rest__view.from-left{animation:pane-l .34s cubic-bezier(.22,.61,.36,1) both}
.rest-lede{margin:2px 0 0}
.rest-search{display:flex;align-items:center;gap:8px;min-height:44px;padding:0 14px;border:1px solid var(--line);border-radius:999px;background:var(--chip-bg);transition:border-color .2s ease,box-shadow .2s ease}
.rest-search:focus-within{border-color:var(--accent-line);box-shadow:0 0 0 3px var(--accent-soft)}
.rest-search__icon{display:grid;color:var(--faint)}.rest-search__icon svg{width:17px;height:17px}
.rest-search__input{all:unset;flex:1;min-width:0;font-size:16px;color:var(--text);padding:10px 0}
.rest-search__input::placeholder{color:var(--faint)}
.rest-list{list-style:none;margin:0;padding:0;display:grid;max-height:min(56vh,520px);overflow:auto;overscroll-behavior:contain;border-top:1px solid var(--line-soft);-webkit-mask-image:linear-gradient(#000 calc(100% - 22px),transparent);mask-image:linear-gradient(#000 calc(100% - 22px),transparent);padding-bottom:18px}
.rest-list__head{font-size:.68rem;letter-spacing:.12em;text-transform:uppercase;color:var(--faint);padding:14px 2px 6px}
.rest-row{all:unset;box-sizing:border-box;cursor:pointer;width:100%;display:flex;align-items:center;gap:12px;padding:10px 2px;border-bottom:1px solid var(--line-soft);-webkit-tap-highlight-color:transparent;transition:background-color .18s ease,transform .14s ease}
.rest-row:active{transform:scale(.985);background:var(--accent-soft)}
.rest-row:focus-visible{box-shadow:var(--focus);border-radius:12px}
.rest-row__text{flex:1;min-width:0;display:grid;gap:2px}
.rest-row__text b{font-weight:600;font-size:.95rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rest-row__text small{color:var(--muted);font-size:.76rem}
.rest-row__chev{display:grid;color:var(--faint);flex:none}.rest-row__chev svg{width:18px;height:18px}
.rest-badge{flex:none;width:36px;height:36px;border-radius:11px;display:grid;place-items:center;font-weight:700;font-size:.95rem;letter-spacing:-.01em;
  color:hsl(var(--h) 38% 30%);background:hsl(var(--h) 45% 92%);border:1px solid hsl(var(--h) 30% 82%)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .rest-badge{color:hsl(var(--h) 45% 82%);background:hsl(var(--h) 18% 20%);border-color:hsl(var(--h) 18% 30%)}}
:root[data-theme="dark"] .rest-badge{color:hsl(var(--h) 45% 82%);background:hsl(var(--h) 18% 20%);border-color:hsl(var(--h) 18% 30%)}
.rest-empty{list-style:none;padding:14px 2px;display:grid;gap:10px}
.rest-ask{display:flex;align-items:center;gap:12px;padding:12px 14px;border:1px dashed var(--accent-line);border-radius:16px;background:var(--accent-soft)}
.rest-ask__icon{flex:none;display:grid;color:var(--accent)}.rest-ask__icon svg{width:22px;height:22px}
.rest-ask__text{flex:1;min-width:0;display:grid;gap:2px}
.rest-ask__text b{font-size:.9rem;font-weight:600}.rest-ask__text small{color:var(--muted);font-size:.76rem;line-height:1.35}
.rest-ask .btn{flex:none;margin:0}
.rest-head{display:grid;gap:8px}
.rest-head__title{display:flex;align-items:center;gap:10px;min-width:0}
.rest-head__title h3{margin:0;font-size:1.15rem;line-height:1.2;text-wrap:balance}
.rest-back{all:unset;cursor:pointer;justify-self:start;display:inline-flex;align-items:center;gap:2px;min-height:36px;padding:0 10px 0 4px;margin-left:-4px;border-radius:999px;color:var(--accent);font-weight:600;font-size:.88rem;-webkit-tap-highlight-color:transparent}
.rest-back svg{width:18px;height:18px}.rest-back:active{background:var(--accent-soft)}.rest-back:focus-visible{box-shadow:var(--focus)}
.rest-build{all:unset;box-sizing:border-box;cursor:pointer;display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:16px;border:1px solid var(--accent-line);background:linear-gradient(135deg,var(--accent-soft),transparent 70%);transition:transform .14s ease,border-color .2s ease}
.rest-build:active{transform:scale(.985)}.rest-build:focus-visible{box-shadow:var(--focus)}
.rest-build__icon{display:grid;color:var(--accent)}.rest-build__icon svg{width:26px;height:26px}
.rest-build__text{flex:1;display:grid;gap:2px}.rest-build__text b{font-weight:600}.rest-build__text small{color:var(--muted);font-size:.78rem}
.rest-cats{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;padding:2px 2px 4px;margin:0 -2px;-webkit-overflow-scrolling:touch;scroll-snap-type:x proximity}
.rest-cats::-webkit-scrollbar{display:none}
.rest-cats .chip{flex:none;scroll-snap-align:center;min-height:32px;padding:0 13px;font-size:.8rem;border-radius:999px;background:var(--chip-bg);border:1px solid var(--line);color:var(--text)}
.rest-cats .chip.is-on{background:var(--text);border-color:var(--text);color:var(--bg)}
.rest-menu{margin:0}
.rest-item{align-items:flex-start}
.rest-item .food-row__add{margin-top:2px}
.rest-item__main{all:unset;flex:1;min-width:0;display:grid;gap:6px;padding:2px 0}
.rest-item__main .food-row__name{font-weight:600;line-height:1.3}
.rest-sizes{display:flex;flex-wrap:wrap;gap:6px}
.rest-size{all:unset;cursor:pointer;min-height:28px;padding:0 10px;display:inline-flex;align-items:center;border-radius:999px;font-size:.74rem;font-weight:600;color:var(--muted);border:1px solid var(--line);background:var(--chip-bg);transition:background-color .18s ease,color .18s ease,border-color .18s ease,transform .12s ease}
.rest-size:active{transform:scale(.94)}
.rest-size.is-on{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}
.rest-size:focus-visible{box-shadow:var(--focus)}
.rest-src{margin:0}
.rest-group{display:grid;gap:8px}
.rest-group__head{margin:4px 0 0}
.rest-parts{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));gap:8px}
.rest-part{all:unset;box-sizing:border-box;cursor:pointer;min-height:52px;padding:8px 12px;border-radius:14px;border:1px solid var(--line);background:var(--chip-bg);display:grid;align-content:center;gap:2px;position:relative;-webkit-tap-highlight-color:transparent;transition:background-color .18s ease,border-color .18s ease,transform .12s ease}
.rest-part:active{transform:scale(.96)}
.rest-part:focus-visible{box-shadow:var(--focus)}
.rest-part__name{font-size:.84rem;font-weight:600;line-height:1.2;color:var(--text)}
.rest-part small{font-size:.72rem;color:var(--muted)}
.rest-part.is-on{border-color:var(--accent);background:var(--accent-soft);box-shadow:inset 0 0 0 1px var(--accent)}
.rest-part.is-on::after{content:"";position:absolute;top:8px;right:9px;width:8px;height:8px;border-radius:50%;background:var(--accent)}
.rest-part.is-double::after{width:auto;height:auto;padding:1px 6px;border-radius:999px;content:"2×";font-size:.62rem;font-weight:700;color:var(--accent-ink);top:6px}
.rest-totalbar{position:sticky;bottom:calc(78px + env(safe-area-inset-bottom,0px));z-index:2;display:flex;align-items:center;gap:12px;padding:10px 10px 10px 14px;border-radius:18px;background:var(--surface);border:1px solid var(--line);box-shadow:0 10px 30px -14px rgba(0,0,0,.35)}
.native-tabs .rest-totalbar{bottom:12px}
.rest-total{flex:1;min-width:0;display:grid;gap:2px}
.rest-total__label{font-size:.74rem;color:var(--muted)}
.rest-total .food-row__macros{flex-wrap:wrap}
.rest-total__add{flex:none;margin:0;white-space:nowrap}
.rest-form{display:grid;gap:4px}
.rest-form input,.rest-form textarea{font-size:16px}
.rest-form__err{color:var(--danger);margin:0 0 6px}
.rest-form__send{justify-self:stretch;margin-top:4px}
.rest-mine{display:grid;gap:8px}
.rest-mine__chips{display:flex;flex-wrap:wrap;gap:6px}
.rest-mine__chip{display:inline-flex;align-items:center;gap:6px;min-height:28px;padding:0 10px;border-radius:999px;border:1px solid var(--line);background:var(--chip-bg);font-size:.78rem;font-weight:600}
.rest-mine__chip small{font-weight:500;color:var(--muted)}
.rest-mine__chip.is-added{border-color:var(--sage-line);background:var(--sage-soft)}.rest-mine__chip.is-added small{color:var(--ok-text)}
.rest-done{display:grid;justify-items:center;text-align:center;gap:10px;padding:18px 6px 8px}
.rest-done h3{margin:0;text-wrap:balance}
.rest-done p{margin:0;max-width:34ch}
.rest-done__mark{width:56px;height:56px;color:var(--ok)}
.rest-done__ring{stroke-dasharray:145;stroke-dashoffset:145;animation:rest-draw .5s cubic-bezier(.65,0,.35,1) forwards}
.rest-done__tick{stroke-dasharray:36;stroke-dashoffset:36;animation:rest-draw .35s .38s cubic-bezier(.65,0,.35,1) forwards}
@keyframes rest-draw{to{stroke-dashoffset:0}}
.rest-link{all:unset;box-sizing:border-box;cursor:pointer;width:100%;display:flex;align-items:center;gap:12px;margin:6px 0;padding:12px 14px;border-radius:16px;border:1px solid var(--accent-line);background:var(--accent-soft);transition:transform .14s ease}
.rest-link:active{transform:scale(.985)}.rest-link:focus-visible{box-shadow:var(--focus)}
.rest-link__text{flex:1;min-width:0;display:grid;gap:2px}.rest-link__text b{font-weight:600}.rest-link__text small{font-size:.76rem;color:var(--muted)}
.rest-link__chev{display:grid;color:var(--accent)}.rest-link__chev svg{width:18px;height:18px}
/* Four tabs on a phone: the open/close chevrons go, the labels stay whole. */
.food-find__seg button{min-width:0;padding-left:4px;padding-right:4px;flex:1 1 auto}
.food-find__seg button>span.food-find__chev[aria-hidden]{display:none}.food-find__seg{overflow:hidden}.food-find__seg button{white-space:nowrap}
@media (max-width:440px){.food-find__seg button{font-size:.8rem;gap:4px;letter-spacing:-.005em}}
@media (prefers-reduced-motion:reduce){.rest__view{animation:none!important}.rest-done__ring,.rest-done__tick{animation:none;stroke-dashoffset:0}.rest-row,.rest-part,.rest-size,.rest-build,.rest-link{transition:none}}
