:root {
  color-scheme: dark;
  --ink: #edf9ec;
  --muted: #afc9be;
  --lime: #dbfa91;
  --aqua: #8fead9;
  --coral: #ffbdab;
  font: 16px/1.5 "Trebuchet MS", sans-serif;
}
* { box-sizing: border-box; }
body {
  min-height: 100vh; margin: 0; color: var(--ink);
  background: #0c211e
    radial-gradient(ellipse at 86% 8%, #356e62 0%, transparent 47%) fixed;
}
body::before {
  content: ""; position: fixed; z-index: -1; inset: 0; pointer-events: none;
  background: radial-gradient(ellipse at 15% 38%, #39583b 0%, transparent 48%),
              radial-gradient(ellipse at 80% 72%, #264c51 0%, transparent 50%);
}
.shell {
  max-width: 920px; margin: auto;
  padding: max(22px, env(safe-area-inset-top)) clamp(16px, 5vw, 52px) max(24px, env(safe-area-inset-bottom));
}
.masthead, .section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { color: var(--ink); text-decoration: none; font-size: 22px; font-weight: 800; letter-spacing: -.06em; }
.brand span, .eyebrow { color: var(--lime); }
.mark { display: inline-block; font-size: 26px; vertical-align: -2px; margin-right: 4px; }
.pill, .segmented, footer button {
  padding: 6px 12px; border: 1px solid #d4fff544; border-radius: 100px;
  background: #dafff014; color: var(--ink);
}
.pill:empty { visibility: hidden; }
.intro { padding: clamp(26px, 6vw, 52px) 0 22px; }
.eyebrow { margin: 0 0 10px; font-size: .68rem; letter-spacing: .18em; font-weight: 700; }
h1 { font: 400 clamp(3rem, 10vw, 6rem)/.86 Georgia, serif; letter-spacing: -.075em; margin: 0; }
h1 em { color: var(--lime); font-weight: inherit; }
h2 { font-size: 1.05rem; letter-spacing: -.035em; margin: 0 0 12px; }
p { margin: 0; }
.glass {
  position: relative; border-radius: 28px; padding: clamp(17px, 4vw, 28px);
  background: linear-gradient(145deg, #defaea29, #9edbcd0c 56%, #c8ffda16);
  border: 1px solid #d0fff343;
  box-shadow: inset 0 1px 1px #ffffff3b, inset 0 -1px 1px #91ecb420, 0 16px 38px #020c0b35;
  backdrop-filter: blur(24px) saturate(140%);
  animation: surface .55s ease-out both;
}
@keyframes surface { from { opacity: 0; transform: translateY(12px); } }
.overview, .details { display: grid; grid-template-columns: 1.15fr 1fr; gap: 12px; }
.history, .details { margin-top: 12px; }
.energy { overflow: hidden; }
.energy::before {
  content: ""; position: absolute; inset: -40px -65px; pointer-events: none;
  background: radial-gradient(ellipse at 50% 50%, #9cdf6737, transparent 54%);
}
@property --progress {
  syntax: "<percentage>"; inherits: false; initial-value: 0%;
}
.orbit {
  --progress: 0%; transition: --progress .75s cubic-bezier(.2,.8,.2,1); position: relative; display: grid; place-items: center;
  width: min(190px, 75%); aspect-ratio: 1; margin: 10px auto 15px; border-radius: 50%;
  background: conic-gradient(var(--lime) var(--progress), #d5ffdd29 0);
  box-shadow: 0 0 32px #c9fc7d21, inset 0 0 14px #e2ffa855;
}
.orbit-content {
  position: absolute; inset: 9px; display: grid; align-content: center; text-align: center; border-radius: 50%;
  background: radial-gradient(circle at 40% 26%, #42634b, #152e28 75%);
}
.orbit strong { font-size: clamp(1.6rem, 5vw, 2.8rem); line-height: 1.1; letter-spacing: -.06em; }
.orbit span, .muted, .chart-detail, .meal-values { color: var(--muted); font-size: .82rem; }
.energy-note { position: relative; text-align: center; color: var(--lime); font-weight: 700; }
.exceeded { color: var(--coral); }
.macro { padding: 12px 0; }
.macro-head { display: flex; justify-content: space-between; align-items: baseline; gap: 7px; flex-wrap: wrap; }
.macro-head strong { font-size: .86rem; }
.macro-head span, .macro small { color: var(--muted); font-size: .74rem; }
.track { height: 7px; margin: 6px 0 3px; border-radius: 99px; overflow: hidden; background: #ebfff324; }
.fill { height: 100%; border-radius: inherit; background: var(--accent); box-shadow: 0 0 9px var(--accent); animation: grow .65s ease both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }
.section-head h2 { margin: 0; }
.segmented { display: flex; padding: 3px; gap: 3px; white-space: nowrap; }
button { font: inherit; cursor: pointer; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--lime); outline-offset: 2px; }
.segmented button { border: 0; border-radius: 99px; background: transparent; color: var(--muted); padding: 5px 10px; font-size: .75rem; }
.segmented button[aria-pressed="true"] { background: var(--lime); color: #1b2d19; }
.history .muted { margin: 8px 0; }
.chart { position: relative; display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; gap: clamp(2px, 1vw, 8px); height: 115px; margin: 13px 0 6px; align-items: end; }
.chart::before { content: ""; position: absolute; inset: auto 0 var(--goal) 0; border-top: 1px dashed #f1ffd26b; pointer-events: none; }
.bar { z-index: 1; border: 0; width: 100%; height: 100%; padding: 0; border-radius: 4px; background: transparent; display: flex; align-items: flex-end; }
.bar span { pointer-events: none; width: 100%; min-height: 3px; border-radius: 5px 5px 2px 2px; height: var(--height); background: linear-gradient(#c7faac, #559d7a); }
.bar.empty span { background: #d5fff03b; }
.bar.over span { background: linear-gradient(var(--coral), #af695c); }
.bar[aria-pressed="true"] span { filter: brightness(1.35); }
.chart-detail { min-height: 2.9em; overflow-wrap: anywhere; }
.stats { display: flex; flex-wrap: wrap; gap: 10px 22px; padding-top: 12px; border-top: 1px solid #e3fff129; }
.stat { display: grid; font-size: .75rem; color: var(--muted); }
.stat strong, .weight strong { color: var(--ink); font-size: 1.05rem; }
.meals ul { list-style: none; padding: 0; margin: 0; }
.meals li + li { border-top: 1px solid #e3fff129; margin-top: 9px; padding-top: 9px; }
.meal-title { display: flex; justify-content: space-between; gap: 10px; overflow-wrap: anywhere; }
.meal-title time { color: var(--muted); font-size: .8rem; white-space: nowrap; }
footer { display: flex; justify-content: center; margin-top: 18px; }
footer button { font-size: .84rem; }
.status { margin-bottom: 12px; }
@media (max-width: 520px) {
  .overview { grid-template-columns: 1fr; }
  .details { grid-template-columns: 1fr; }
  .macros #macros { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
  .macro { padding: 3px 0; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
