:root {
  color-scheme: light;
  --ink: #15323a;
  --muted: #6b858c;
  --line: #dce9e8;
  --paper: #f5faf9;
  --card: #ffffff;
  --teal: #0e7490;
  --teal-dark: #075985;
  --mint: #dff5ee;
  --coral: #f97362;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.app-shell { max-width: 760px; margin: 0 auto; padding: 26px 20px 54px; }
.topbar, .section-heading, .tabs, .legend { display: flex; align-items: center; justify-content: space-between; }
.topbar { margin-bottom: 22px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 1.8rem; letter-spacing: -0.05em; }
h2 { font-size: 1.17rem; letter-spacing: -0.02em; }
h3 { font-size: .9rem; margin-bottom: 10px; }
.eyebrow { color: var(--teal); font-size: .68rem; font-weight: 800; letter-spacing: .15em; margin-bottom: 5px; }
.light { color: #a7e7dc; }
.icon-button, .close-button { border: 0; color: var(--teal); background: transparent; font-size: 1.4rem; padding: 7px; }
.hero-card { background: linear-gradient(120deg, #075985, #0e7490); border-radius: 22px; color: white; display: flex; justify-content: space-between; min-height: 150px; padding: 25px; margin-bottom: 22px; overflow: hidden; }
.hero-card h2 { font-size: 1.65rem; margin-bottom: 8px; }
.hero-card p:last-of-type { color: #d8f5f1; line-height: 1.5; max-width: 490px; }
.hero-spark { color: #8be3d0; font-size: 5rem; line-height: 1; align-self: center; opacity: .8; }
.tabs { justify-content: flex-start; gap: 26px; border-bottom: 1px solid var(--line); margin-bottom: 19px; }
.tab { background: none; border: 0; color: var(--muted); font-weight: 750; padding: 11px 2px; position: relative; }
.tab.active { color: var(--teal); }
.tab.active::after { background: var(--teal); bottom: -1px; content: ""; height: 3px; left: 0; position: absolute; right: 0; border-radius: 3px; }
.card { background: var(--card); border: 1px solid #e5efed; border-radius: 18px; box-shadow: 0 7px 25px rgba(26, 75, 82, .045); padding: 20px; margin-bottom: 17px; }
.section-heading { margin-bottom: 18px; }
.date-badge, .count-pill { background: var(--mint); border-radius: 99px; color: var(--teal-dark); font-size: .72rem; font-weight: 800; padding: 7px 11px; }
.count-pill { min-width: 29px; text-align: center; }
label { color: #416169; display: block; font-size: .77rem; font-weight: 750; margin-bottom: 14px; }
input, select, textarea { background: #fbfdfd; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); display: block; margin-top: 6px; padding: 11px 12px; width: 100%; }
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--teal); outline: 3px solid rgba(14, 116, 144, .12); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.muted { color: var(--muted); font-size: .77rem; font-weight: 450; }
.primary-button { background: var(--teal); border: 0; border-radius: 11px; color: white; font-weight: 800; padding: 13px 16px; width: 100%; }
.primary-button:hover { background: var(--teal-dark); }
.primary-button span { float: right; font-size: 1.2rem; line-height: .8; }
.entry-list { display: grid; gap: 9px; }
.entry-row { align-items: center; background: #f7fbfa; border-radius: 12px; display: grid; gap: 10px; grid-template-columns: 72px 1fr auto; padding: 12px; }
.entry-date { color: var(--muted); font-size: .7rem; font-weight: 800; text-transform: uppercase; }
.entry-food { color: var(--muted); font-size: .72rem; margin-top: 3px; }
.entry-metrics { display: flex; gap: 6px; }
.metric { background: white; border-radius: 7px; font-size: .68rem; font-weight: 750; padding: 5px 7px; white-space: nowrap; }
.metric.energy { color: var(--teal-dark); }
.metric.activity { color: #c45648; }
.delete-entry { background: transparent; border: 0; color: #a7b9bb; font-size: 1rem; }
.empty-state { color: var(--muted); font-size: .82rem; padding: 20px 0 4px; text-align: center; }
.chart-wrap { overflow: hidden; width: 100%; }
#trendChart { display: block; min-height: 230px; width: 100%; }
.legend { color: var(--muted); font-size: .68rem; gap: 5px; }
.legend-dot { border-radius: 50%; display: inline-block; height: 8px; margin-left: 8px; width: 8px; }
.energy-dot { background: var(--teal); }.activity-dot { background: var(--coral); }
.mood-dot { background: #8b5cf6; }
.food-table { display: grid; gap: 8px; }
.food-row { align-items: center; display: grid; gap: 8px; grid-template-columns: 1fr 75px 75px 75px; font-size: .76rem; }
.food-row.header { color: var(--muted); font-size: .66rem; font-weight: 800; text-transform: uppercase; }
.food-bar { background: var(--mint); border-radius: 4px; height: 8px; margin-top: 4px; }
.food-value { font-weight: 800; text-align: right; }
.insight-callout { background: #fff6e9; border-left: 3px solid #f6b64a; border-radius: 0 9px 9px 0; color: #7a5a28; font-size: .8rem; line-height: 1.45; margin-top: 18px; padding: 11px 13px; }
.disclaimer { color: var(--muted); font-size: .7rem; line-height: 1.4; text-align: center; }
.hidden { display: none !important; }
dialog { border: 0; border-radius: 18px; box-shadow: 0 18px 70px rgba(13, 52, 58, .25); max-width: 560px; padding: 0; width: calc(100% - 30px); }
dialog::backdrop { background: rgba(14, 40, 45, .35); }
.settings-panel { padding: 21px; }
.close-button { font-size: 1.7rem; line-height: 1; }
.option-group { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 15px; }
.option-list { display: flex; flex-wrap: wrap; gap: 7px; }
.option-chip { align-items: center; background: var(--mint); border-radius: 99px; color: var(--teal-dark); display: flex; font-size: .72rem; gap: 7px; padding: 7px 10px; }
.option-chip button { background: transparent; border: 0; color: var(--teal); font-size: .9rem; padding: 0; }
.add-option { display: flex; gap: 7px; margin-top: 10px; }
.add-option input { margin: 0; }
.add-option button { background: white; border: 1px solid var(--teal); border-radius: 9px; color: var(--teal); font-weight: 750; padding: 0 13px; }
.data-actions { display: flex; gap: 8px; margin-top: 11px; }
.secondary-button { background: white; border: 1px solid var(--teal); border-radius: 9px; color: var(--teal); font-weight: 750; padding: 10px 13px; }
.secondary-button:hover { background: var(--mint); }
.data-status { color: var(--teal-dark); font-size: .73rem; margin-top: 9px; min-height: 1em; }
@media (max-width: 500px) {
  .app-shell { padding: 20px 14px 42px; }
  .hero-card { min-height: 165px; padding: 20px; }
  .hero-card h2 { font-size: 1.4rem; }
  .hero-spark { font-size: 3.5rem; }
  .form-grid { grid-template-columns: 1fr; gap: 0; }
  .entry-row { grid-template-columns: 58px 1fr; }
  .entry-metrics { grid-column: 2; }
  .delete-entry { grid-column: 3; grid-row: 1; }
  .food-row { grid-template-columns: 1fr 58px 58px 58px; }
}
