/* Big Type: black and white with huge condensed numerals. Orange only ever means "needs attention". */
@font-face { font-family: "Anton"; src: url("/fonts/anton-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Hanken Grotesk"; src: url("/fonts/hanken-grotesk-variable.woff2") format("woff2"); font-weight: 100 900; font-display: swap; }
:root {
  color-scheme: dark;
  --ground: #0a0a0a;
  --ink: #ffffff;
  --muted: #a3a3a3;
  --line: #2e2e2e;
  --gap-mark: #6b6b6b;
  --alert: #ff5a1f;
  --ink-on-paper: #0a0a0a;
  --muted-on-paper: #5c5c5c;
  --alert-on-paper: #b53a0c;
  --display: "Anton", Impact, "Arial Narrow", sans-serif;
  --body: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --gutter: 20px;
  --tab-height: 59px;
  background: var(--ground);
  color: var(--ink);
  font-family: var(--body);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--ground); font-size: 15px; line-height: 1.4; }
button, input { font: inherit; color: inherit; }
button, input[type="date"] { min-height: 44px; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:disabled { cursor: wait; opacity: .6; }
button:focus-visible, input:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
h1, h2, h3, p, dl, dd { margin: 0; }
h1, h2, h3 { font-weight: 400; }

.app-shell { width: 100%; max-width: 560px; margin: 0 auto; padding: 8px var(--gutter) calc(var(--tab-height) + 24px + env(safe-area-inset-bottom)); }
.app-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; margin-bottom: 14px; }
.wordmark { font-family: var(--display); font-size: 20px; line-height: 1; letter-spacing: .4px; text-transform: uppercase; }
.button { display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 22px; background: var(--ink); color: var(--ink-on-paper); padding: 0 16px; font-size: 14px; font-weight: 700; }
.button-quiet { background: transparent; color: var(--ink); border: 1px solid var(--gap-mark); }
.button-wide { width: 100%; min-height: 54px; border-radius: 27px; font-size: 15px; text-align: center; overflow-wrap: anywhere; }

.status-card { display: grid; gap: 10px; padding: 48px 0; }
.status-card h2 { font-family: var(--display); font-size: 48px; line-height: 1.05; text-transform: uppercase; letter-spacing: .3px; }
.status-card p { color: var(--muted); font-size: 16px; line-height: 1.5; }

#private-content { display: grid; gap: 30px; min-width: 0; }
.day-head { display: grid; gap: 4px; }
.eyebrow { color: var(--muted); font-size: 13px; font-weight: 600; overflow-wrap: anywhere; }
.day-title-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.day-title { font-family: var(--display); font-size: 64px; line-height: 1.04; text-transform: uppercase; letter-spacing: .3px; min-width: 0; }

.day-strip { display: grid; gap: 10px; }
.day-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.day { display: grid; justify-items: stretch; text-align: center; gap: 5px; padding: 0; min-width: 0; background: transparent; border: 0; }
.day-letter { color: var(--muted); font-size: 12px; font-weight: 600; }
.day-circle { justify-self: center; display: flex; align-items: center; justify-content: center; width: min(44px, 100%); aspect-ratio: 1; border: 2px solid var(--ink); border-radius: 50%; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.day.is-gap .day-circle { border: 2px dashed var(--gap-mark); color: var(--muted); }
.day.is-selected .day-circle { background: var(--ink); border: 2px solid var(--ink); color: var(--ink-on-paper); }
.subtle { color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }

.panel { display: grid; gap: 30px; min-width: 0; }
.section { display: grid; gap: 12px; min-width: 0; }
.section-title { font-family: var(--display); font-size: 30px; line-height: 1.1; text-transform: uppercase; letter-spacing: .3px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tag { display: inline-flex; padding: 3px 8px; border: 1px solid var(--gap-mark); font-size: 12px; font-weight: 600; color: var(--muted); }
.flag { display: inline-flex; padding: 2px 7px; background: var(--alert); color: var(--ink-on-paper); font-size: 11px; font-weight: 700; letter-spacing: .2px; text-transform: uppercase; white-space: nowrap; }

.hero-number { display: block; font-family: var(--display); font-size: clamp(96px, 34vw, 132px); line-height: 1; font-weight: 400; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hero-empty { display: block; font-family: var(--display); font-size: clamp(88px, 29vw, 112px); line-height: 1; font-weight: 400; color: var(--muted); max-width: min-content; text-transform: uppercase; }
.hero-caption { display: block; margin-top: 6px; font-size: 15px; font-weight: 600; }
.bar { position: relative; height: 6px; background: var(--line); }
.bar::after { content: ""; position: absolute; left: 80%; top: -3px; bottom: -3px; width: 2px; background: var(--ink); }
.bar-fill { position: absolute; left: 0; top: 0; bottom: 0; background: var(--ink); }
.bar-hero { height: 10px; margin-top: 12px; }
.bar-gap { background: repeating-linear-gradient(135deg, var(--gap-mark) 0 2px, transparent 2px 7px); }
.bar-gap::after { content: none; }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { display: flex; flex-direction: column-reverse; justify-content: flex-end; gap: 3px; min-width: 0; }
.stat dd { font-family: var(--display); font-size: 38px; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.stat dt { color: var(--muted); font-size: 12px; line-height: 1.3; }
.net-panel { display: grid; gap: 10px; }
.balance-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding-top: 10px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 600; }
.balance-row strong { color: var(--muted); font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }

.nutrients { display: grid; gap: 14px; }
.nutrient { display: grid; gap: 6px; min-width: 0; }
.nutrient-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.nutrient-label { font-family: var(--body); font-size: 15px; font-weight: 600; }
.nutrient-values { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
.nutrient-value { font-family: var(--display); font-size: 28px; line-height: 1.1; font-weight: 400; font-variant-numeric: tabular-nums; }
.nutrient-value.is-empty { font-family: var(--body); font-size: 14px; font-weight: 600; color: var(--muted); }
.nutrient-of { color: var(--muted); font-size: 13px; }
.nutrient.is-over .nutrient-value { color: var(--alert); }
.nutrient.is-over .bar-fill { background: var(--alert); }

.record-list { display: grid; list-style: none; padding: 0; margin: 0; }
.record-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; row-gap: 2px; padding: 10px 0; border-top: 1px solid var(--line); }
.record-title { font-size: 16px; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }
.record-stat { grid-row: span 2; align-self: center; font-family: var(--display); font-size: 26px; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.record-meta::first-letter { text-transform: uppercase; }
.record-meta { color: var(--muted); font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.empty-message { padding: 14px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; line-height: 1.5; }

.burn-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.burn-card { display: grid; align-content: start; gap: 3px; min-width: 0; padding-top: 10px; border-top: 2px solid var(--ink); }
.burn-label { font-family: var(--body); font-size: 13px; font-weight: 600; }
.burn-value { font-family: var(--display); font-size: 34px; line-height: 1.15; font-weight: 400; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.burn-value.is-empty { color: var(--muted); font-size: 26px; text-transform: uppercase; }
.burn-detail { color: var(--muted); font-size: 12px; line-height: 1.35; }
.notice { color: var(--muted); font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.notice-warning { padding: 10px 12px; border: 1px solid var(--alert); color: #ffb59c; }

.run-cards { display: grid; gap: 2px; margin-inline: calc(var(--gutter) * -1); }
.run-card { display: grid; gap: 12px; padding: 22px var(--gutter); background: var(--ink); color: var(--ink-on-paper); }
.run-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.run-title { font-family: var(--display); font-size: 30px; line-height: 1.1; text-transform: uppercase; letter-spacing: .3px; min-width: 0; overflow-wrap: anywhere; }
.run-date { color: var(--muted-on-paper); font-size: 12px; font-weight: 600; }
.run-distance { display: flex; align-items: baseline; gap: 8px; }
.run-distance strong { font-family: var(--display); font-size: clamp(88px, 29vw, 112px); line-height: 1; font-weight: 400; font-variant-numeric: tabular-nums; }
.run-distance span { font-family: var(--display); font-size: 30px; text-transform: uppercase; }
.run-card .stat dd { font-size: 28px; }
.run-card .stat dt { color: var(--muted-on-paper); }

.week-list { display: grid; gap: 4px; }
.week-row { display: grid; grid-template-columns: 76px minmax(0, 1fr) 108px; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 6px 0; background: transparent; border: 0; border-top: 1px solid var(--line); text-align: left; }
.week-date { font-size: 13px; font-weight: 600; }
.week-values { display: grid; justify-items: end; text-align: right; }
.week-kcal { font-family: var(--display); font-size: 24px; line-height: 1.1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.week-kcal.is-empty { font-family: var(--body); font-size: 13px; font-weight: 600; color: var(--muted); }
.week-meta { color: var(--muted); font-size: 11px; }
.week-row.is-selected .week-date { text-decoration: underline; text-underline-offset: 3px; }
.date-controls { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; min-width: 0; }
.date-controls span { color: var(--muted); font-size: 12px; }
input[type="date"] { display: block; -webkit-appearance: none; appearance: none; width: 100%; min-width: 0; max-width: 100%; border: 1px solid var(--gap-mark); border-radius: 22px; background: transparent; padding: 9px 16px; font-size: 15px; }

.tab-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: 0 max(8px, calc((100vw - 560px) / 2)) env(safe-area-inset-bottom); background: var(--ground); border-top: 1px solid var(--line); }
.tab { min-height: 56px; background: transparent; border: 0; border-top: 3px solid transparent; color: var(--muted); font-family: var(--display); font-size: 18px; letter-spacing: .6px; text-transform: uppercase; }
.tab[aria-selected="true"] { border-top-color: var(--ink); color: var(--ink); }
.tab:focus-visible { outline-offset: -3px; }
.app-footer { color: var(--muted); font-size: 12px; line-height: 1.5; padding-top: 28px; }
@media (max-width: 360px) {
  :root { --gutter: 14px; }
  .day-title { font-size: 52px; }
  .stat dd { font-size: 30px; }
  .week-row { grid-template-columns: 66px minmax(0, 1fr) 100px; }
  .week-kcal { font-size: 22px; }
}
@media (prefers-reduced-motion: no-preference) {
  .tab, .button { transition: color .15s ease, border-color .15s ease; }
}
