/* Stay Fit — "market morning": dill green, squash and beetroot on a pale sage ground; glass tab bar like iOS 26. */
@font-face { font-family: 'Bricolage'; src: url(fonts/bricolage.woff2) format('woff2'); font-weight: 400 800; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Bricolage'; src: url(fonts/bricolage-ext.woff2) format('woff2'); font-weight: 400 800; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF; }
:root {
  --ground: #eaf0eb; --card: #ffffff; --ink: #13241c; --sub: #5d6f65; --line: #d9e3dc;
  --dill: #3e7c59; --dill-soft: #dcebe1; --squash: #e3a13a; --beet: #9c2f5b; --warn: #b3261e;
  --glass: rgba(255, 255, 255, .72); --shadow: 0 1px 2px rgba(19, 36, 28, .06), 0 8px 24px rgba(19, 36, 28, .06);
  --display: 'Bricolage', ui-rounded, -apple-system, system-ui, sans-serif;
  color-scheme: light dark; font: 17px/1.45 -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}
@media (prefers-color-scheme: dark) { :root {
  --ground: #0f1a15; --card: #18261f; --ink: #e9f1ec; --sub: #93a59a; --line: #2a3a32;
  --dill: #6cc293; --dill-soft: #1d3628; --squash: #f0b45a; --beet: #e0709c; --glass: rgba(24, 38, 31, .7); --shadow: none; } }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body { margin: 0; background: var(--ground); color: var(--ink); padding: env(safe-area-inset-top) 0 calc(104px + env(safe-area-inset-bottom)); -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 3px solid var(--dill); outline-offset: 2px; border-radius: 12px; }

/* header */
header { position: sticky; top: 0; z-index: 2; padding: 14px 20px 10px; display: flex; align-items: center; gap: 8px;
  background: linear-gradient(var(--ground) 70%, transparent); }
header h1 { font: 700 34px/1.05 var(--display); letter-spacing: -.02em; margin: 0; flex: 1; font-variation-settings: 'opsz' 96; }
main { padding: 0 16px 24px; max-width: 620px; margin: 0 auto; }
.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 22px; color: var(--dill); background: var(--card); box-shadow: var(--shadow); }
.icon-btn svg { width: 22px; height: 22px; }

/* surfaces */
.card { background: var(--card); border-radius: 24px; padding: 16px 18px; margin: 14px 0; box-shadow: var(--shadow); }
.card h2 { font: 650 19px/1.2 var(--display); margin: 0 0 10px; letter-spacing: -.01em; }
.muted { color: var(--sub); font-size: 15px; }
.pill { display: inline-block; font-size: 13px; padding: 3px 10px; border-radius: 99px; background: var(--dill-soft); color: var(--dill); font-weight: 600; }

/* rows (lists, shop, settings, train) */
.row { display: flex; align-items: center; gap: 12px; min-height: 52px; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.row .grow { flex: 1; min-width: 0; text-align: left; padding: 10px 0; }
.row .t { font-weight: 600; display: block; }
.row .s { color: var(--sub); font-size: 14px; display: block; }
.check { width: 30px; height: 30px; border-radius: 15px; border: 2px solid var(--line); background: var(--card); display: grid; place-items: center; flex: none; transition: background .2s, border-color .2s; }
.check svg { width: 18px; height: 18px; }
.check.on { background: var(--dill); border-color: var(--dill); color: #fff; }
.done .t { color: var(--sub); text-decoration: line-through; text-decoration-color: var(--line); }

/* today: rings hero */
.today { display: grid; grid-template-columns: auto 1fr; gap: 18px; align-items: center; padding: 18px; }
.rings { width: 132px; height: 132px; }
.rings circle { fill: none; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 50% 50%; transition: stroke-dashoffset .6s cubic-bezier(.2, .8, .2, 1); }
.rings .track { stroke: var(--line); }
.stat b { font: 700 34px/1 var(--display); letter-spacing: -.02em; display: block; font-variant-numeric: tabular-nums; }
.stat span { color: var(--sub); font-size: 14px; }
.stat + .stat { margin-top: 12px; }
.stat i { display: inline-block; width: 10px; height: 10px; border-radius: 5px; margin-right: 6px; vertical-align: 1px; }
.daynav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 2px 0 4px; }
.daynav > div { text-align: center; }
.daynav b { font: 650 18px/1.2 var(--display); }

/* the day as a timeline: breakfast → dinner along one rail */
.timeline { position: relative; margin: 8px 0 0; padding: 0; }
.timeline::before { content: ''; position: absolute; left: 15px; top: 34px; bottom: 34px; width: 2px; background: var(--line); border-radius: 1px; }
.meal { position: relative; display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.meal .body { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 22px; padding: 10px 8px 10px 10px; box-shadow: var(--shadow); }
.meal img { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; flex: none; background: var(--line); }
.meal .grow { flex: 1; min-width: 0; text-align: left; }
.meal .slot { font-size: 13px; color: var(--sub); font-weight: 600; display: block; }
.meal .t { font: 600 17px/1.25 var(--display); display: block; letter-spacing: -.005em; }
.meal .s { color: var(--sub); font-size: 14px; display: block; margin-top: 2px; }
.meal.done .body { opacity: .62; }
.meal.done .t { text-decoration: line-through; text-decoration-color: var(--line); }
.swap { color: var(--dill); width: 44px; height: 44px; display: grid; place-items: center; border-radius: 22px; flex: none; }
.swap svg { width: 22px; height: 22px; }
.swap:disabled { opacity: .2; }

/* bars, kv, buttons */
.bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 4px 0 10px; }
.bar i { display: block; height: 100%; background: var(--squash); border-radius: 4px; }
.bar.p i { background: var(--beet); }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 16px; padding: 3px 0; }
.kv b { font-variant-numeric: tabular-nums; }
.btn { display: block; width: 100%; padding: 15px; border-radius: 18px; background: var(--dill); color: #fff; font-weight: 650; text-align: center; margin: 10px 0; text-decoration: none; }
.btn:active, .icon-btn:active, .swap:active, .check:active { transform: scale(.97); }
.btn.ghost { background: var(--dill-soft); color: var(--dill); }
.btn.danger { background: transparent; color: var(--warn); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0; scrollbar-width: none; }
.chip { flex: none; padding: 8px 12px; border-radius: 14px; background: var(--ground); font-size: 14px; color: var(--sub); text-align: center; font-weight: 600; }
.chip.on { background: var(--dill); color: #fff; }

/* glass tab bar, floating */
nav#tabs { position: fixed; z-index: 3; left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); max-width: 520px; margin: 0 auto;
  display: flex; padding: 6px; border-radius: 30px; background: var(--glass); backdrop-filter: blur(22px) saturate(1.6); -webkit-backdrop-filter: blur(22px) saturate(1.6);
  box-shadow: 0 10px 30px rgba(19, 36, 28, .14), inset 0 0 0 1px rgba(255, 255, 255, .35); }
nav#tabs button { flex: 1; padding: 8px 0 6px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; font-weight: 600; color: var(--sub); border-radius: 24px; }
nav#tabs button svg { width: 24px; height: 24px; }
nav#tabs button.on { color: var(--dill); background: var(--dill-soft); }

/* sheets */
dialog#sheet { border: 0; padding: 0; width: 100%; max-width: 620px; max-height: 90vh; margin: auto auto 0; border-radius: 30px 30px 0 0; background: var(--ground); color: var(--ink); overflow-y: auto; }
dialog#sheet[open] { animation: rise .32s cubic-bezier(.2, .8, .2, 1); }
dialog#sheet::backdrop { background: rgba(10, 20, 15, .38); }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } }
.sheet-in { padding: 8px 18px calc(28px + env(safe-area-inset-bottom)); }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 6px auto 12px; }
.sheet-in h3 { font: 700 26px/1.15 var(--display); margin: 8px 0 8px; letter-spacing: -.015em; }
img.photo { width: 100%; aspect-ratio: 4/3; object-fit: cover; border-radius: 22px; background: var(--line); display: block; }
.macros { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; margin: 12px 0; }
.macros div { background: var(--card); border-radius: 16px; padding: 10px 0; box-shadow: var(--shadow); }
.macros b { display: block; font: 700 20px/1.1 var(--display); }
.macros span { font-size: 13px; color: var(--sub); }
ol.steps { padding-left: 22px; margin: 0; } ol.steps li { margin: 8px 0; }

/* forms */
input, select { background: var(--ground); border: 1px solid var(--line); border-radius: 14px; padding: 12px 14px; width: 100%; }
label.f { display: block; margin: 10px 0; } label.f span { display: block; font-size: 14px; color: var(--sub); margin-bottom: 4px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* timer */
.big { font: 800 96px/1 var(--display); text-align: center; font-variant-numeric: tabular-nums; letter-spacing: -.04em; margin: 12px 0; }
#toast { position: fixed; left: 50%; bottom: calc(100px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(8px); background: var(--ink); color: var(--ground);
  padding: 11px 18px; border-radius: 16px; font-size: 15px; font-weight: 600; opacity: 0; transition: opacity .2s, transform .2s; pointer-events: none; max-width: 90%; z-index: 9; }
#toast.on { opacity: 1; transform: translateX(-50%); }
@media (prefers-reduced-motion: reduce) { *, *::before { transition: none !important; animation: none !important; } }
