/* Every colour is light-dark(light, dark): it follows the system theme, or data-theme on <html>
   when something else decides (the food card inside Claude follows Claude's theme). */
:root {
	color-scheme: light dark;
	--page: light-dark(#f6f5f1, #0e0e0d);
	--surface: light-dark(#fcfcfb, #181817);
	--raised: light-dark(#ffffff, #1f1f1e);
	--ink: light-dark(#0b0b0b, #f0efec);
	--ink-2: light-dark(#52514e, #c3c2b7);
	--muted: light-dark(#898781, #8d8b84);
	--grid: light-dark(#e6e5df, #2a2a28);
	--axis: light-dark(#c3c2b7, #3a3a37);
	--line: light-dark(rgba(11, 11, 11, 0.08), rgba(255, 255, 255, 0.08));
	--wash: light-dark(rgba(11, 11, 11, 0.04), rgba(255, 255, 255, 0.05));
	--wash-2: light-dark(rgba(11, 11, 11, 0.07), rgba(255, 255, 255, 0.09));
	/* Identity: lifts blue, runs orange, weight violet, food green (validated together, light + dark). */
	--lift: light-dark(#2a78d6, #3987e5);
	--lift-wash: light-dark(rgba(42, 120, 214, 0.1), rgba(57, 135, 229, 0.16));
	--run: light-dark(#eb6834, #d95926);
	--run-wash: light-dark(rgba(235, 104, 52, 0.1), rgba(217, 89, 38, 0.17));
	--weight: light-dark(#6250d6, #9085e9);
	--food: light-dark(#1baf7a, #199e70);
	--food-wash: light-dark(rgba(27, 175, 122, 0.14), rgba(25, 158, 112, 0.2));
	/* Status: reserved, always with an icon and a word. */
	--good: light-dark(#0a7d3b, #3fbf6f);
	--good-wash: light-dark(rgba(10, 125, 59, 0.1), rgba(63, 191, 111, 0.14));
	--warn: light-dark(#a86400, #e0a33a);
	--warn-wash: light-dark(rgba(237, 161, 0, 0.14), rgba(224, 163, 58, 0.15));
	--bad: light-dark(#c8302f, #ef6b6a);
	--bad-wash: light-dark(rgba(227, 73, 72, 0.11), rgba(239, 107, 106, 0.15));
	--strava: #fc4c02;
	--radius: 20px;
	--shadow: 0 1px 2px light-dark(rgba(11, 11, 11, 0.04), transparent), 0 4px 16px light-dark(rgba(11, 11, 11, 0.04), transparent);
	--font: ui-sans-serif, system-ui, -apple-system, "SF Pro Text", "Segoe UI", sans-serif;
	--display: ui-rounded, "SF Pro Rounded", system-ui, -apple-system, sans-serif;
	--mono: ui-monospace, "SF Mono", Menlo, monospace;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--page);
	color: var(--ink);
	font: 15px/1.45 var(--font);
	-webkit-font-smoothing: antialiased;
	font-feature-settings: "tnum" 1;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.ok { color: var(--good); }
.bad { color: var(--bad); }
[hidden] { display: none !important; }

/* --- frame --------------------------------------------------------------- */

.wrap {
	max-width: 1120px;
	margin: 0 auto;
	padding: max(16px, env(safe-area-inset-top)) 20px calc(40px + env(safe-area-inset-bottom));
}
.top {
	display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px;
	padding: 6px 2px 18px;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { width: 30px; height: 30px; border-radius: 8px; }
.brand b { font: 650 20px/1 var(--display); letter-spacing: -0.01em; }
.top-r { display: flex; justify-content: flex-end; align-items: center; gap: 4px; }
.sync {
	display: inline-flex; align-items: center; gap: 7px;
	border: 0; background: transparent; color: var(--muted);
	font-size: 13px; padding: 6px 10px; border-radius: 999px; cursor: pointer;
}
.sync:hover { background: var(--wash); color: var(--ink-2); }
.sync .dot { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--good); }
.sync.err .dot { background: var(--bad); }
.sync.busy .dot { background: var(--muted); }

.icon-btn {
	width: 40px; height: 40px; display: grid; place-items: center;
	border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); cursor: pointer;
}
.icon-btn:hover { background: var(--wash); }
.icon-btn svg { width: 19px; height: 19px; }
.pill-btn {
	border: 1px solid var(--line); background: var(--raised); border-radius: 999px;
	font-size: 12.5px; font-weight: 550; min-height: 32px; padding: 4px 12px; cursor: pointer; color: var(--ink-2);
}
.pill-btn:hover { background: var(--wash); }
.more { margin-top: 8px; }
.btn {
	height: 40px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line);
	background: var(--raised); font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
	text-decoration: none; white-space: nowrap;
}
.btn:hover { background: var(--wash); }
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--ink); color: var(--page); border-color: var(--ink); }
.btn-primary:hover { background: var(--ink); opacity: 0.88; }
.btn-strava { background: var(--strava); color: #fff; border-color: var(--strava); }
.btn-strava:hover { background: var(--strava); opacity: 0.9; }
.seg-ctl { display: inline-flex; background: var(--wash); border-radius: 10px; padding: 2px; gap: 2px; position: relative; isolation: isolate; }
.seg-ctl button {
	position: relative;
	border: 0; background: transparent; min-height: 32px; padding: 4px 12px; border-radius: 8px;
	font-size: 12.5px; font-weight: 550; color: var(--muted); cursor: pointer;
}
/* The pressed option's pill is a pseudo-element under the labels, so it can slide between options. */
.seg-ctl button[aria-pressed="true"] { color: var(--ink); }
.seg-ctl button[aria-pressed="true"]::before {
	content: ""; position: absolute; inset: 0; z-index: -1; border-radius: inherit;
	background: var(--raised); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); transform-origin: left center;
}
/* The header tabs are a larger segmented control. */
.tabs { padding: 3px; border-radius: 12px; }
.tabs button { min-height: 36px; padding: 7px 22px; font-size: 14px; border-radius: 9px; }

/* Week tab: training + weight left, food + money right; one column on narrow screens. */
.grid {
	display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; align-items: start;
}
.col { display: grid; gap: 16px; min-width: 0; }
.slot { min-width: 0; }

.card {
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
	box-shadow: var(--shadow); padding: 22px; min-width: 0;
}
/* One header for every card: title + muted context on the left, controls on the right. */
.card-h {
	display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
	min-height: 36px; margin: -4px 0 14px;
}
.card-h h2 { font: 650 18px/1.2 var(--display); margin: 0; letter-spacing: -0.01em; }
.card-h .sub { color: var(--muted); font-size: 13px; }
.card-h .right { margin-left: auto; display: flex; gap: 4px; align-items: center; }
/* What a card says before it has data: one line, with what to tell Claude. */
.empty-msg { margin: 0; color: var(--ink-2); font-size: 14.5px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 10px; }
.tag { font-size: 11.5px; font-weight: 600; color: var(--muted); background: var(--wash-2); border-radius: 6px; padding: 1px 7px; }

.legend { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--muted); margin: -6px 0 16px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.legend i.o { background: var(--wash-2); border: 1px solid var(--axis); }
.legend i.p { border: 1.5px dashed var(--muted); }
.legend i.eat { background: var(--food); }
.chart-legend { margin: 10px 0 0; }
.chart-legend .hint-r { margin-left: auto; }

/* --- workouts ------------------------------------------------------------ */

.today-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: -4px; }
.status {
	display: inline-flex; align-items: center; gap: 6px;
	font-size: 13px; font-weight: 600; padding: 5px 10px 5px 8px; border-radius: 999px;
}
.status svg { width: 15px; height: 15px; }
.status.on_track, .status.done { background: var(--good-wash); color: var(--good); }
.status.tight { background: var(--warn-wash); color: var(--warn); }
.status.behind, .status.missed { background: var(--bad-wash); color: var(--bad); }

.today h1 {
	font: 700 clamp(30px, 5vw, 40px)/1.05 var(--display); letter-spacing: -0.02em;
	margin: 10px 0 6px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.today h1 .glyph { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; flex: none; }
.today h1 .glyph svg { width: 26px; height: 26px; }
.glyph.lift { background: var(--lift-wash); color: var(--lift); }
.glyph.run { background: var(--run-wash); color: var(--run); }
.glyph.rest { background: var(--wash-2); color: var(--ink-2); }
.glyph.done { background: var(--good-wash); color: var(--good); }
.today .lede { margin: 0; color: var(--ink-2); font-size: 15.5px; max-width: 46ch; }

.meters { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 18px; }
.meter-h { display: flex; align-items: baseline; justify-content: space-between; font-size: 13px; margin-bottom: 6px; }
.meter-h b { font-size: 15px; font-weight: 650; }
.meter-h b .muted { font-weight: 500; }
.meter-h .label { color: var(--ink-2); font-weight: 550; }
.segs { display: flex; gap: 2px; height: 10px; }
.seg { flex: 1; border-radius: 3px; background: var(--wash-2); }
.seg:first-child { border-top-left-radius: 5px; border-bottom-left-radius: 5px; }
.seg:last-child { border-top-right-radius: 5px; border-bottom-right-radius: 5px; }
/* The fill is a layer over the empty track, so it can grow in. */
.seg.done { position: relative; }
.seg.done::after { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--fill); transform-origin: left center; }
.seg.done.lift { --fill: var(--lift); }
.seg.done.run { --fill: var(--run); }
.seg.extra { opacity: 0.5; }

.week-nav { display: flex; align-items: center; gap: 2px; }
.week-nav .icon-btn { width: 36px; height: 36px; }
.week-nav .icon-btn svg { width: 18px; height: 18px; }
.week-nav .icon-btn:disabled { opacity: 0.3; cursor: default; background: transparent; }

/* The board is the week's day picker; Food's chart columns pick the same day. */
.board { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 18px 0; }
.bday {
	border-radius: 14px; padding: 9px 4px 10px; text-align: center;
	background: var(--wash); min-height: 108px;
	display: flex; flex-direction: column; align-items: center; gap: 6px;
	border: 1.5px solid transparent; cursor: pointer;
}
.bday:hover { background: var(--wash-2); }
.bday.past { opacity: 0.85; }
.bday.sel { background: var(--raised); border-color: var(--axis); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06); }
.bday.today { background: var(--raised); border-color: var(--ink); }
.bday .dw { font-size: 11px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.bday.today .dw { color: var(--ink); }
.bday .dn { font: 650 17px/1 var(--display); }
.bday .marks { display: flex; flex-direction: column; gap: 4px; align-items: center; margin-top: 2px; }
.mark { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; }
.mark svg { width: 17px; height: 17px; }
.mark.lift { background: var(--lift); color: #fff; }
.mark.run { background: var(--run); color: #fff; }
.mark.other { background: var(--wash-2); color: var(--ink-2); }
.mark.plan { background: transparent; border: 1.5px dashed currentColor; }
.mark.plan.lift { color: var(--lift); }
.mark.plan.run { color: var(--run); }
.mark.rest { background: transparent; color: var(--muted); font-size: 11px; width: auto; height: auto; }

/* The selected day, in both Workouts and Food. */
.daypanel { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 16px; }
.dp-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.dp-h h3 { margin: 0; font: 650 15px/1.2 var(--font); }
.daypanel .items { display: grid; gap: 8px; }
.daypanel .empty { color: var(--muted); font-size: 14px; }

.act {
	display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; align-items: start;
	padding: 10px 12px; border-radius: 14px; background: var(--raised); border: 1px solid var(--line);
	text-align: left; width: 100%; cursor: pointer;
}
.act:hover { border-color: var(--axis); }
.act .ic { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; }
.act .ic svg { width: 20px; height: 20px; }
.act .ic.lift { background: var(--lift-wash); color: var(--lift); }
.act .ic.run { background: var(--run-wash); color: var(--run); }
.act .ic.other { background: var(--wash-2); color: var(--ink-2); }
.act .t { font-weight: 600; font-size: 14.5px; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.act .meta { font-size: 13px; color: var(--muted); }
.act-other { background: transparent; }
.act-other .t { font-weight: 550; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.chip {
	border: 1px solid var(--line); background: var(--surface); border-radius: 999px;
	padding: 5px 11px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; white-space: nowrap;
	max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.chip b { font-weight: 600; color: var(--ink); }
.chip:hover { background: var(--lift-wash); border-color: transparent; color: var(--ink); }
.planned {
	display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 14px;
	border: 1.5px dashed var(--axis); color: var(--ink-2); font-size: 14px;
}
.planned .ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; }
.planned .ic svg { width: 16px; height: 16px; }
.planned.lift .ic { color: var(--lift); background: var(--lift-wash); }
.planned.run .ic { color: var(--run); background: var(--run-wash); }
.planned .why { margin-left: auto; font-size: 12.5px; color: var(--muted); }

/* --- food and spend -------------------------------------------------------- */

/* KPI tiles, shared by Food and Spend: small label, display-size value, optional footnote. */
.tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.tiles.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tile { background: var(--wash); border-radius: 14px; padding: 12px 14px; min-width: 0; }
.tile .k { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.tile .v { font: 700 24px/1.15 var(--display); letter-spacing: -0.01em; margin-top: 4px; white-space: nowrap; }
.tile .v .u { font: 550 13px/1 var(--font); color: var(--muted); margin-left: 3px; letter-spacing: 0; }
.tile .s { font-size: 12.5px; color: var(--muted); }
/* Takeout grey, home-cooked green: the same swatch in tiles, split bar and spend rows. */
.tile .k i, .spend-row i { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.takeout { background: var(--muted); }
.homemade { background: var(--food); }
.dine_in { background: var(--ink-2); }

.meal { margin-top: 14px; }
.meal-h { display: flex; align-items: center; gap: 8px; margin-bottom: 2px; }
.meal-h > span:first-child { font-size: 12px; font-weight: 650; letter-spacing: 0.05em; text-transform: uppercase; color: var(--muted); }
.ftag { font-size: 11.5px; font-weight: 600; border-radius: 6px; padding: 1px 7px; white-space: nowrap; color: var(--ink); }
.ftag.takeout { background: var(--wash-2); }
.ftag.homemade { background: var(--food-wash); }
.ftag.dine_in { background: var(--wash-2); }
/* Dishes: drawing, title (tap for the items), then protein and calories in columns whose headers are the day's totals. */
.food-head, .food-row { display: grid; grid-template-columns: 48px minmax(0, 1fr) 64px 76px; column-gap: 12px; align-items: center; }
.food-head { margin-top: 4px; padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.food-head .spacer { grid-column: 1 / 3; }
.dp-h .burn-note { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.dp-h .burn-note b { color: var(--ink); font-weight: 650; }
.food-head .food-num { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.2; }
.food-head .lbl { font-size: 11.5px; color: var(--muted); }
.food-head b { font: 700 18px/1.2 var(--display); letter-spacing: -0.01em; }
.food-head .muted { font-size: 11.5px; }
/* Title and time centred against the drawing; the numbers sit on the title's baseline. */
.food-row { padding: 8px 0; border-bottom: 1px solid var(--line); align-items: baseline; }
.food-img { align-self: start; }
.meal .food-row:last-child { border-bottom: 0; }
.food-row > .food-num { text-align: right; font-size: 14.5px; font-weight: 600; }
.food-row > .food-num:first-of-type { color: var(--ink-2); font-weight: 500; }
.food-img { width: 48px; height: 48px; }
.food-img img { width: 100%; height: 100%; display: block; border-radius: 12px; }
.food-main { min-width: 0; min-height: 48px; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; }
.food-title { display: inline; max-width: 100%; font: 600 15px/1.3 var(--font); color: var(--ink); background: none; border: 0; padding: 0; text-align: left; }
button.food-title { cursor: pointer; }
.food-title svg { width: 15px; height: 15px; margin-left: 3px; vertical-align: -2px; color: var(--muted); transition: transform 0.25s var(--ease); }
.food-row.open .food-title svg { transform: rotate(90deg); }
.food-time { font-size: 12.5px; color: var(--muted); margin-top: 1px; }
.food-desc { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.25s var(--ease); }
.food-desc > div { overflow: hidden; }
.food-row.open .food-desc { grid-template-rows: 1fr; }
.food-desc p { margin: 4px 0 0; font-size: 13px; line-height: 1.4; color: var(--ink-2); }
.food-desc p:first-child { margin-top: 6px; }
.food-desc .ftag { margin-right: 6px; vertical-align: 1px; }
@media (prefers-reduced-motion: reduce) { .food-desc, .food-title svg { transition: none; } }


.split-bar { display: flex; gap: 2px; height: 8px; margin-top: 14px; }
.split-bar span { display: block; height: 100%; border-radius: 3px; }
.split-bar span:first-child { border-radius: 5px 3px 3px 5px; }
.split-bar span:last-child { border-radius: 3px 5px 5px 3px; }
.split-bar span[style*="width:0%"] { display: none; }
.spend-list { margin-top: 14px; border-top: 1px solid var(--line); }
.spend-row {
	display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 10px; align-items: center;
	padding: 10px 8px; border-bottom: 1px solid var(--line); font-size: 14px;
}
.spend-row:last-child { border-bottom: 0; }
.spend-row.sel { background: var(--wash); border-radius: 8px; }
.spend-row .d { color: var(--muted); font-size: 12.5px; }
.spend-row .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.spend-row .n i { margin-right: 8px; vertical-align: -1px; }

/* --- stats, charts --------------------------------------------------------- */

.hero-num { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.hero-num b { font: 700 34px/1 var(--display); letter-spacing: -0.02em; }
.hero-num .u { color: var(--muted); font-size: 15px; font-weight: 550; }
.trend { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; font-weight: 600; padding: 3px 9px; border-radius: 999px; background: var(--wash-2); color: var(--ink-2); }
.trend svg { width: 13px; height: 13px; }
.stat-row { display: flex; gap: 22px; flex-wrap: wrap; margin: 14px 0 6px; }
.stat-row.flush { margin-top: 0; }
.stat .k { font-size: 12px; color: var(--muted); }
.stat .v { font-weight: 650; font-size: 15px; }
.stat .when { color: var(--muted); font-weight: 500; font-size: 12.5px; }

.chart { position: relative; margin-top: 10px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .gl { stroke: var(--grid); stroke-width: 1; }
.chart .tk { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .lbl { fill: var(--ink-2); font-size: 11.5px; font-weight: 600; font-family: var(--font); }
.chart .xh { stroke: var(--axis); stroke-width: 1; }
.tip {
	position: fixed; z-index: 50; pointer-events: none;
	background: var(--raised); color: var(--ink); border: 1px solid var(--line);
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14); border-radius: 10px;
	padding: 7px 10px; font-size: 12.5px; line-height: 1.35; max-width: 240px;
}
.tip b { font-weight: 650; }
.tip .k { color: var(--muted); }

/* --- progress -------------------------------------------------------------- */

.cg { display: grid; gap: 8px; overflow-x: auto; }
.cg-row { display: grid; grid-template-columns: 84px repeat(var(--n), minmax(16px, 1fr)); gap: 4px; align-items: end; }
.cg-l { font-size: 13px; font-weight: 550; color: var(--ink-2); display: flex; align-items: center; gap: 7px; }
.cg-l i { width: 9px; height: 9px; border-radius: 3px; }
.cg-w { display: flex; flex-direction: column-reverse; gap: 2px; padding: 3px; border-radius: 7px; }
.cg-w.met { background: var(--good-wash); }
.cg-w span { height: 8px; border-radius: 3px; background: var(--wash-2); }
.cg-w span.on.lift { background: var(--lift); }
.cg-w span.on.run { background: var(--run); }
.cg-w span.extra { opacity: 0.5; }
.cg-x .cg-d { font-size: 10.5px; color: var(--muted); white-space: nowrap; overflow: visible; }
.cg-x .cg-d:last-child { direction: rtl; } /* the last date label hangs left instead of clipping */

.search {
	width: 100%; height: 38px; border-radius: 11px; border: 1px solid var(--line); background: var(--raised);
	color: var(--ink); padding: 0 12px; font: inherit; margin-bottom: 6px;
}
.search:focus { outline: 2px solid var(--lift); outline-offset: -1px; }
.list { display: grid; }
.list.runs { margin-top: 12px; }
.row {
	display: grid; grid-template-columns: minmax(0, 1fr) 72px auto; gap: 14px; align-items: center;
	padding: 10px 6px; margin: 0 -6px; width: calc(100% + 12px);
	border: 0; border-radius: 12px; background: transparent; text-align: left; cursor: pointer;
}
.runs .row { grid-template-columns: minmax(0, 1fr) auto; }
.row + .row { border-top: 1px solid var(--line); border-radius: 0; }
.row:hover { background: var(--wash); border-radius: 12px; }
.row .rt { min-width: 0; }
.row .n { font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .s { font-size: 12.5px; color: var(--muted); }
.row .v { text-align: right; font-weight: 650; font-size: 14px; white-space: nowrap; }
.row .v .u { color: var(--muted); font-weight: 500; }
.row .v small { display: block; font-weight: 500; font-size: 12px; color: var(--muted); }
.spark { width: 72px; height: 26px; display: block; }

/* --- sheets ---------------------------------------------------------------- */

.scrim {
	position: fixed; inset: 0; z-index: 40; background: rgba(0, 0, 0, 0.34);
	display: flex; align-items: center; justify-content: center; padding: 20px;
	animation: fade 0.22s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.sheet {
	width: min(640px, 100%); max-height: min(88vh, 900px); overflow: auto;
	background: var(--surface); border-radius: 24px; padding: 22px 22px 26px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	animation: sheet-in 0.42s cubic-bezier(0.32, 0.72, 0, 1);
}
/* The sheet's title and close button stay put while its body scrolls. */
.sheet-h {
	display: flex; align-items: flex-start; gap: 12px;
	position: sticky; top: -22px; z-index: 2; background: var(--surface);
	margin: -22px -22px 6px; padding: 22px 22px 10px;
}
.sheet-h h3 { margin: 0; font: 700 22px/1.15 var(--display); letter-spacing: -0.01em; }
.sheet-h .sub { color: var(--muted); font-size: 13.5px; margin-top: 4px; }
.sheet-h:not(:has(.sub)) { align-items: center; }
.sheet-h .icon-btn { margin-left: auto; flex: none; background: var(--wash); }
.sheet-sec { margin: 22px 0 12px; font: 650 15px/1.2 var(--font); }
.sheet-ctl { display: flex; justify-content: flex-end; margin-top: 8px; }
.sheet-foot { margin-top: 22px; display: flex; justify-content: flex-end; }
.sheet-foot.start { margin-top: 16px; justify-content: flex-start; }

.sessions { margin-top: 18px; display: grid; }
.session { padding: 11px 0; border-top: 1px solid var(--line); }
.session-h { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.session-h b { font-weight: 600; }
.sets { display: flex; gap: 5px; flex-wrap: wrap; margin-top: 6px; }
.set { font-size: 12.5px; background: var(--wash); border-radius: 7px; padding: 2px 7px; color: var(--ink-2); }
.set.warm { opacity: 0.6; }
.set.top { background: var(--lift-wash); color: var(--ink); font-weight: 600; }
.ex-blocks { margin-top: 12px; }
.ex-block { padding: 12px 0; border-top: 1px solid var(--line); }
.ex-block .ex-name { font-weight: 600; font-size: 14.5px; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.ex-block .ex-name:hover { color: var(--lift); }
.desc-d { margin-top: 12px; }
.desc { white-space: pre-wrap; font-size: 13px; color: var(--ink-2); background: var(--wash); border-radius: 12px; padding: 12px; margin-top: 12px; }

/* Settings: grouped lists, iOS style. Every row shares the same left and right edges; nothing in a
   row may push it wider than the sheet (min-width: 0 and wrapping all the way down). */
.set-group { margin-top: 22px; min-width: 0; }
.sheet-h + .set-group { margin-top: 8px; }
.set-group h4 { margin: 0 0 7px; padding: 0 16px; font: 600 12.5px/1.2 var(--font); color: var(--muted); letter-spacing: 0.01em; }
.set-list {
	display: grid; grid-template-columns: minmax(0, 1fr);
	background: var(--raised); border: 1px solid var(--line); border-radius: 16px; overflow: hidden;
}
.set-row {
	display: flex; align-items: center; gap: 12px; min-width: 0; min-height: 48px; padding: 10px 16px;
	position: relative; font-size: 15px; text-align: left; text-decoration: none;
	border: 0; background: none; width: 100%; margin: 0; color: var(--ink);
}
/* Hairlines between rows, inset to the text like iOS. */
.set-row + .set-row::before { content: ""; position: absolute; top: 0; left: 16px; right: 0; border-top: 1px solid var(--line); }
.set-row + .set-row.svc::before { left: 60px; }
.set-k { flex: 1; min-width: 0; }
.set-v { color: var(--muted); text-align: right; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.set-foot { display: flex; gap: 8px; align-items: flex-start; margin: 8px 0 0; padding: 0 16px; font-size: 12.5px; line-height: 1.4; color: var(--muted); }
.set-foot svg { width: 14px; height: 14px; flex: none; margin-top: 1.5px; }
.set-foot i { color: var(--ink-2); }

/* A connected service: mark, name, a status line or two. */
.svc { align-items: center; padding-top: 11px; padding-bottom: 11px; }
.logo { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; color: #fff; font-weight: 800; font-size: 15px; flex: none; }
.logo svg { width: 17px; height: 17px; }
.logo.strava { background: var(--strava); }
.logo.hevy { background: #1f6fff; }
.logo.claude { background: #d97757; }
.svc-txt { flex: 1; min-width: 0; display: grid; gap: 1px; }
.svc-txt b { font-weight: 600; font-size: 15px; }
.svc-txt > span { font-size: 13px; line-height: 1.35; color: var(--muted); overflow-wrap: anywhere; }
.btn-sm { height: 32px; padding: 0 14px; border-radius: 999px; font-size: 13.5px; flex: none; }

/* Tappable rows: links, copy, the disclosure, destructive actions. */
.set-link, .set-copy, .set-danger, .set-how summary { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.set-link:hover, .set-copy:hover, .set-danger:hover, .set-how summary:hover { background: var(--wash); }
.set-link:active, .set-copy:active, .set-danger:active, .set-how summary:active { background: var(--wash-2); }
.set-link > span { flex: 1; min-width: 0; }
.set-link > svg, .set-how summary > svg { width: 16px; height: 16px; flex: none; color: var(--axis); }
.set-danger { color: var(--bad); font-weight: 500; }
.set-copy .svc-txt b { font-weight: 500; }
.set-copy code { font: 12.5px/1.4 var(--mono); color: var(--muted); overflow-wrap: anywhere; }
.set-how .nw { white-space: nowrap; }
.set-ic { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; color: var(--lift); background: var(--lift-wash); }
.set-ic svg { width: 16px; height: 16px; }
.set-how { display: block; padding: 0; }
.set-how summary {
	display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 10px 16px; list-style: none;
}
.set-how summary::-webkit-details-marker { display: none; }
.set-how summary > span { flex: 1; min-width: 0; }
.set-how summary > svg { transition: transform 0.2s var(--ease); }
.set-how[open] summary > svg { transform: rotate(90deg); }
.set-how ol { margin: 0; padding: 0 16px 14px 34px; font-size: 13.5px; line-height: 1.45; color: var(--ink-2); }
.set-how li { margin: 6px 0; overflow-wrap: anywhere; }
.set-how code.cmd { display: block; margin: 6px 0; padding: 8px 10px; border-radius: 8px; line-height: 1.5; color: var(--ink); }
.set-how li::marker { color: var(--muted); }
.set-how code { font: 12px/1.5 var(--mono); background: var(--wash); padding: 1px 5px; border-radius: 5px; }
.copy-inline { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.copy-inline code { word-break: break-all; }
details.howto { font-size: 13px; color: var(--ink-2); }
details.howto summary { cursor: pointer; color: var(--muted); }
details.howto ol { padding-left: 18px; margin: 8px 0 0; }
details.howto li { margin: 4px 0; }
details.howto code { font: 12.5px/1.4 var(--mono); background: var(--wash); padding: 1px 5px; border-radius: 5px; }

/* --- boot, "couldn't load", server pages, toast ------------------------------------- */

.boot { min-height: 70vh; display: grid; place-items: center; }
.boot.sm { min-height: 160px; }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2.5px solid var(--wash-2); border-top-color: var(--ink-2); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.signin { min-height: 86vh; display: grid; place-items: center; padding: 24px; }
.signin-card { max-width: 420px; text-align: center; }
.signin-card h1 { font: 700 34px/1.1 var(--display); letter-spacing: -0.02em; margin: 18px 0 10px; }
.signin-card p { color: var(--ink-2); margin: 0 0 24px; }
.signin-card .btn { height: 46px; padding: 0 22px; font-size: 15px; }

/* The consent page the server renders (src/index.ts). */
body.plain { display: grid; place-items: center; min-height: 100vh; padding: 20px; }
.plain-card { max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 24px; padding: 28px; box-shadow: var(--shadow); }
.plain-card h1 { font: 700 24px/1.2 var(--display); margin: 14px 0 10px; }
.plain-card p { color: var(--ink-2); }
.plain-mark { width: 48px; height: 48px; border-radius: 14px; background: var(--ink); color: var(--page); display: grid; place-items: center; font: 800 22px/1 var(--display); }
.plain-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 22px; }

.toast {
	position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); transform: translateX(-50%);
	background: var(--ink); color: var(--page); padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 60;
	animation: toast-in 0.32s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.toast.out { animation: toast-out 0.22s ease-in forwards; }

/* --- narrow screens ---------------------------------------------------------- */

@media (max-width: 900px) {
	.grid { grid-template-columns: minmax(0, 1fr); }
	/* Week tab on one column: workouts, food, spend, then weight. */
	.week-grid .col { display: contents; }
	.s-work { order: 1; }
	.s-food { order: 2; }
	.s-spend { order: 3; }
	.s-weight { order: 4; }
}
@media (max-width: 640px) {
	.top { grid-template-columns: 1fr auto; row-gap: 12px; }
	.tabs { grid-column: 1 / -1; grid-row: 2; display: flex; }
	.tabs button { flex: 1; }
	.scrim { align-items: flex-end; padding: 0; }
	.sheet { border-radius: 24px 24px 0 0; max-height: 92vh; padding-bottom: calc(26px + env(safe-area-inset-bottom)); }
}
@media (max-width: 560px) {
	.wrap { padding-left: 12px; padding-right: 12px; }
	.top .sync .lbl { display: none; }
	.card { padding: 16px; border-radius: 18px; }
	.tile { padding: 10px 12px; }
	.tile .v { font-size: 21px; }
	.board { gap: 4px; }
	.bday { padding: 8px 2px; border-radius: 12px; }
	.mark { width: 26px; height: 26px; border-radius: 8px; }
	.mark svg { width: 15px; height: 15px; }
	.act .chips { margin-left: -48px; }
	.row { grid-template-columns: minmax(0, 1fr) 60px auto; gap: 10px; }
	.runs .row { grid-template-columns: minmax(0, 1fr) auto; }
	.spark { width: 60px; }
	.food-head, .food-row { grid-template-columns: 40px minmax(0, 1fr) 48px 62px; column-gap: 10px; }
	.food-img { width: 40px; height: 40px; }
	.food-img img { border-radius: 10px; }
	.food-main { min-height: 40px; }
	.food-head b { font-size: 16px; }
}

/* --- motion ---------------------------------------------------------------- */
/* Entrance animations are keyed to a class on .wrap that render() sets for the interaction that
   caused it (anim-intro, anim-tab, anim-day, anim-wk-next/prev, …). Background refreshes render
   without one, so nothing replays. Everything ends in the resting state and uses transform/opacity. */

:root { --ease: cubic-bezier(0.2, 0.8, 0.2, 1); --spring: cubic-bezier(0.32, 0.72, 0, 1); }
@keyframes fade-out { to { opacity: 0; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(8px); } }
@keyframes card-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes from-right { from { opacity: 0; transform: translateX(14px); } }
@keyframes from-left { from { opacity: 0; transform: translateX(-14px); } }
@keyframes pop { from { opacity: 0; transform: scale(0.4); } }
@keyframes day-pop { from { transform: scale(0.93); } }
@keyframes grow-x { from { transform: scaleX(0); } }
@keyframes grow-y { from { transform: scaleY(0); } }
@keyframes draw { from { stroke-dashoffset: 1; } }
@keyframes pill { from { transform: translateX(var(--px, 0)) scaleX(var(--psx, 1)); } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) scale(0.98); } }
@keyframes sheet-out { to { opacity: 0; transform: translateY(16px) scale(0.98); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@keyframes sheet-down { to { transform: translateY(100%); } }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 14px) scale(0.97); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 8px); } }
@keyframes ripple { from { opacity: 0.55; transform: scale(1); } to { opacity: 0; transform: scale(2.8); } }
@keyframes dot-done { 40% { transform: scale(1.7); } }

/* First load: header fades, cards rise in a short stagger (--i is set in visual order). */
.anim-intro .top { animation: fade 0.4s ease-out backwards; }
.anim-intro .card { animation: card-in 0.5s var(--ease) backwards; animation-delay: calc(60ms + var(--i, 0) * 60ms); }
/* Tab switch: the new tab's cards rise in, quicker. */
.anim-tab .card { animation: card-in 0.36s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 40ms); }

/* Segmented controls: the pill slides from the old option (FLIP offsets set in app.js). */
.seg-ctl button.pill-in::before { animation: pill 0.3s var(--ease); }

/* Meters fill segment by segment; the split bar grows. */
.anim-intro .seg.done::after, .anim-tab .seg.done::after, .anim-wk .seg.done::after {
	animation: grow-x 0.4s var(--ease) backwards; animation-delay: calc(200ms + var(--i, 0) * 70ms);
}
.anim-intro .split-bar, .anim-wk .split-bar { transform-origin: left center; animation: grow-x 0.55s var(--ease) 0.2s backwards; }

/* Day picked: the new day settles in; both day panels fade up instead of jumping. */
.anim-day .bday.sel { animation: day-pop 0.26s var(--ease); }
.anim-day .daypanel > *, .anim-wk .daypanel > * { animation: fade-up 0.28s var(--ease) backwards; }
.anim-day .daypanel > :nth-child(n+2), .anim-wk .daypanel > :nth-child(n+2) { animation-delay: 40ms; }

/* Week arrows: the board slides in from the side we moved toward; the week's numbers fade up. */
.anim-wk-next .bday { animation: from-right 0.32s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 22ms); }
.anim-wk-prev .bday { animation: from-left 0.32s var(--ease) backwards; animation-delay: calc((6 - var(--i, 0)) * 22ms); }
.anim-wk .tiles, .anim-wk .spend-list, .anim-wk .today h1, .anim-wk .today .lede, .anim-wk .food-head { animation: fade-up 0.3s var(--ease) backwards; }

/* Consistency grid: each week's filled cells pop in, left to right. */
.anim-intro .cg-w span.on, .anim-tab .cg-w span.on { animation: pop 0.3s var(--ease) backwards; animation-delay: calc(150ms + var(--i, 0) * 28ms); }

/* Sparklines draw in with the card. */
.spark path { stroke-dasharray: 1; }
.anim-intro .spark path, .anim-tab .spark path { animation: draw 0.6s ease-out 0.2s backwards; }
.anim-intro .spark circle, .anim-tab .spark circle { transform-box: fill-box; transform-origin: center; animation: pop 0.3s var(--ease) 0.7s backwards; }

/* Rows added by "Show more" fade up. */
.row-in { animation: fade-up 0.3s var(--ease) backwards; animation-delay: calc(var(--i, 0) * 25ms); }

/* Charts (classes added by charts.js only on a first draw or a data change, never on resize). */
.chart .a-draw { stroke-dasharray: 1; animation: draw 0.55s cubic-bezier(0.45, 0, 0.25, 1) backwards; }
.chart .a-pop { transform-box: fill-box; transform-origin: center; animation: pop 0.3s var(--ease) backwards; }
.chart .a-grow { transform-box: fill-box; transform-origin: center bottom; animation: grow-y 0.45s var(--ease) backwards; }
.chart .a-fade { animation: fade 0.3s ease-out backwards; }

/* Sheets: spring up, fade the scrim; on close, the reverse before removal. Content swaps cross-fade. */
.scrim.closing { pointer-events: none; animation: fade-out 0.22s ease-in forwards; }
.scrim.closing .sheet { animation: sheet-out 0.22s ease-in forwards; }
.sheet.swap > * { animation: fade 0.2s ease-out; }
details.howto[open] > :not(summary), .set-how[open] > ol { animation: fade-up 0.25s var(--ease); }
.tip:not([hidden]) { animation: fade 0.12s ease-out; }

/* Sync: a soft ripple while busy (phase-locked across re-renders), a small pop when it finishes. */
.sync.busy .dot::after {
	content: ""; position: absolute; inset: 0; border-radius: 50%; background: inherit;
	animation: ripple 1.4s var(--ease) var(--ph, 0s) infinite;
}
.sync.done .dot { animation: dot-done 0.5s var(--ease); }

/* Hover and press. */
.btn, .pill-btn, .icon-btn, .seg-ctl button, .chip, .bday, .act, .row, .sync, .ex-block .ex-name {
	transition: background-color 0.15s, border-color 0.15s, color 0.15s, opacity 0.15s, transform 0.15s var(--ease);
}
.seg-ctl button:not([aria-pressed="true"]):hover { color: var(--ink-2); }
.btn:active, .pill-btn:active, .chip:active, .sync:active, .seg-ctl button:active { transform: scale(0.96); }
.icon-btn:active:not(:disabled) { transform: scale(0.9); }
.bday:active { transform: scale(0.96); }
.act:hover { transform: translateY(-1px); }
.act:active { transform: scale(0.99); }
.row:active { transform: scale(0.99); }

@media (max-width: 640px) {
	.sheet { animation-name: sheet-up; }
	.scrim.closing .sheet { animation-name: sheet-down; }
}

@media (prefers-reduced-motion: reduce) {
	*, ::before, ::after {
		animation-duration: 0.01ms !important; animation-delay: 0s !important;
		animation-iteration-count: 1 !important; transition-duration: 0.01ms !important;
	}
	.spinner { animation-duration: 0.8s !important; animation-iteration-count: infinite !important; }
	.sync.busy .dot::after { display: none; }
	.sync.busy .dot { opacity: 0.6; }
}

/* The food card inside Claude's chat (js/claude-card.js): only the day panel, on Claude's own background. */
body.claude-card { background: transparent; padding: 14px 16px 6px; }
.claude-card .daypanel { border-top: 0; margin-top: 0; padding-top: 0; }

/* --- sign-in (js/signin.js) -------------------------------------------------------------
   "Just say it. It's measured." Copy and the Strava button beside one glass card that plays the
   app: a message to an assistant (Claude, ChatGPT, …) becomes measured food, a weigh-in lands on
   the trend, and the week's lifts and runs sit below. Every class is si-, so nothing leaks. */

.si {
	--si-glass: light-dark(rgba(255, 255, 255, 0.5), rgba(34, 34, 32, 0.48));
	--si-edge: light-dark(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.11));
	--si-shine: light-dark(rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.09));
	--si-card: light-dark(rgba(255, 255, 255, 0.74), rgba(20, 20, 19, 0.56));
	--si-card-edge: light-dark(rgba(11, 11, 11, 0.06), rgba(255, 255, 255, 0.07));
	--si-solid: light-dark(#fff, #1b1b1a);
	--si-field: light-dark(rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.06));
	--si-track: light-dark(rgba(11, 11, 11, 0.06), rgba(255, 255, 255, 0.07));
	--si-claude: #d97757;
	--si-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--si-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
	position: relative; overflow-x: clip;
}
.si-light { position: fixed; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; }
.si-glow { position: absolute; width: 70vmax; height: 70vmax; border-radius: 50%; opacity: light-dark(0.6, 0.36); animation: si-drift 38s ease-in-out infinite alternate; }
.si-g-food { background: radial-gradient(closest-side, light-dark(rgba(27, 175, 122, 0.55), rgba(25, 158, 112, 0.6)), transparent); right: -18vmax; top: -26vmax; }
.si-g-weight { background: radial-gradient(closest-side, light-dark(rgba(98, 80, 214, 0.42), rgba(120, 104, 230, 0.6)), transparent); right: 4vmax; bottom: -40vmax; animation-duration: 46s; animation-direction: alternate-reverse; }
.si-g-lift { background: radial-gradient(closest-side, light-dark(rgba(42, 120, 214, 0.32), rgba(57, 135, 229, 0.42)), transparent); left: -34vmax; top: -30vmax; animation-duration: 52s; }
.si-g-run { background: radial-gradient(closest-side, light-dark(rgba(235, 104, 52, 0.26), rgba(217, 89, 38, 0.34)), transparent); left: -20vmax; bottom: -44vmax; width: 60vmax; height: 60vmax; animation-duration: 42s; animation-direction: alternate-reverse; }
@keyframes si-drift {
	0% { transform: translate3d(0, 0, 0) scale(1); }
	50% { transform: translate3d(-4vmax, 3vmax, 0) scale(1.06); }
	100% { transform: translate3d(3vmax, -2vmax, 0) scale(0.97); }
}

/* Layout: two columns on desktop. */
.si-page {
	position: relative; z-index: 1;
	min-height: 100vh; min-height: 100svh;
	display: grid; grid-template-columns: minmax(0, 430px) minmax(0, 480px);
	justify-content: center; align-items: center; column-gap: clamp(56px, 8vw, 120px);
	padding: max(32px, env(safe-area-inset-top)) max(40px, env(safe-area-inset-right)) max(32px, env(safe-area-inset-bottom)) max(40px, env(safe-area-inset-left));
}
.si-side { display: flex; flex-direction: column; align-items: flex-start; }
.si-lockup { display: flex; align-items: center; gap: 12px; margin: 0 0 40px; }
.si-lockup img { width: 44px; height: 44px; border-radius: 11px; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.16), 0 1px 2px rgba(0, 0, 0, 0.12); }
.si-lockup h1 { margin: 0; font: 700 24px/1 var(--display); letter-spacing: -0.015em; }
.si-copy { display: flex; flex-direction: column; align-items: flex-start; }
.si-hero { margin: 0; font: 700 clamp(52px, 5.2vw, 72px)/0.98 var(--display); letter-spacing: -0.04em; }
.si-hero span {
	display: block; padding-bottom: 0.06em; color: transparent;
	background: linear-gradient(100deg, var(--food) 0%, var(--lift) 30%, var(--weight) 55%, var(--lift) 80%, var(--food) 100%) 0 0 / 200% 100%;
	-webkit-background-clip: text; background-clip: text;
	animation: si-sheen-text 14s ease-in-out infinite alternate;
}
@keyframes si-sheen-text { to { background-position: 100% 0; } }
.si-lede { margin: 20px 0 32px; font-size: 18px; line-height: 1.5; color: var(--ink-2); max-width: 31ch; text-wrap: pretty; }

.si-strava {
	position: relative; overflow: hidden; isolation: isolate;
	display: inline-flex; align-items: center; justify-content: center; gap: 10px;
	height: 54px; padding: 0 20px 0 22px; border-radius: 16px;
	background: var(--strava); color: #fff; text-decoration: none;
	font: 650 16px/1 var(--font); letter-spacing: -0.005em;
	box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 -1px 0 rgba(0, 0, 0, 0.12) inset, 0 10px 28px -8px rgba(252, 76, 2, 0.6), 0 2px 6px rgba(252, 76, 2, 0.25);
	transition: transform 0.3s var(--si-ease), box-shadow 0.3s var(--si-ease), filter 0.2s;
	-webkit-tap-highlight-color: transparent;
}
.si-strava > svg:first-child { width: 20px; height: 20px; flex: none; }
.si-chev { width: 16px; height: 16px; flex: none; opacity: 0.85; transition: transform 0.3s var(--si-ease); }
/* One light sweep after the entrance, and again on hover. */
.si-strava::after {
	content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
	background: linear-gradient(105deg, transparent 30%, rgba(255, 255, 255, 0.38) 50%, transparent 70%);
	transform: translateX(-110%);
}
.si-strava:hover { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset, 0 -1px 0 rgba(0, 0, 0, 0.12) inset, 0 16px 34px -10px rgba(252, 76, 2, 0.7), 0 2px 6px rgba(252, 76, 2, 0.25); }
.si-strava:hover .si-chev { transform: translateX(3px); }
.si-strava:hover::after { animation: si-sweep 0.9s var(--si-ease); }
.si-strava:active { transform: translateY(0) scale(0.975); filter: brightness(0.95); transition-duration: 0.1s; }
.si-strava:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
@keyframes si-sweep { from { transform: translateX(-110%); } to { transform: translateX(110%); } }

.si-err { margin: 14px 0 0; padding: 8px 12px; border-radius: 10px; font-size: 14px; font-weight: 550; color: var(--bad); background: var(--bad-wash); display: flex; align-items: center; gap: 8px; }
.si-err svg { width: 16px; height: 16px; flex: none; }
.si-dev { margin: 14px 0 0 2px; font-size: 13px; color: var(--muted); text-underline-offset: 3px; text-decoration-color: var(--line); border-radius: 4px; }
.si-dev:hover { color: var(--ink-2); text-decoration-color: currentColor; }

/* The glass. */
.si-scene { position: relative; width: 100%; }
.si-tilt { transform: perspective(1400px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
.si-glass {
	position: relative; overflow: hidden; padding: 20px; border-radius: 34px;
	background: var(--si-glass);
	-webkit-backdrop-filter: blur(28px) saturate(170%); backdrop-filter: blur(28px) saturate(170%);
	border: 1px solid var(--si-edge);
	box-shadow: 0 1px 0 var(--si-shine) inset, 0 40px 80px -30px light-dark(rgba(40, 40, 60, 0.3), rgba(0, 0, 0, 0.6)), 0 12px 24px -12px light-dark(rgba(40, 40, 60, 0.14), rgba(0, 0, 0, 0.4));
}
.si-glass::before {
	content: ""; position: absolute; inset: 0 0 auto 0; height: 45%; pointer-events: none;
	background: linear-gradient(180deg, light-dark(rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0.04)), transparent);
}
/* A highlight that follows the pointer (desktop). */
.si-glass::after {
	content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 6; border-radius: inherit;
	background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 0%), light-dark(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.07)), transparent 45%);
	opacity: var(--glare, 0); mix-blend-mode: soft-light;
}

/* Chat: which assistant, the composer / sent bubble, and the reply. */
.si-chat { position: relative; display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 10px; height: 84px; }
.si-ais {
	--i: 0; position: relative; isolation: isolate; align-self: start;
	display: flex; gap: 2px; padding: 3px; border-radius: 999px; height: 44px; align-items: center;
	background: var(--si-track);
}
.si-ais::before {
	content: ""; position: absolute; left: 3px; top: 3px; width: 38px; height: 38px; border-radius: 50%; z-index: -1;
	background: var(--si-solid); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 4px 10px -4px rgba(0, 0, 0, 0.18);
	transform: translateX(calc(var(--i) * 40px)); transition: transform 0.55s var(--si-spring);
}
.si-ai { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 50%; color: var(--muted); opacity: 0.55; transition: color 0.4s, opacity 0.4s, transform 0.5s var(--si-spring); }
.si-ai svg { width: 18px; height: 18px; }
.si-ai.on { opacity: 1; transform: scale(1.06); }
.si-ai.si-claude.on, .si-av.si-claude { color: var(--si-claude); }
.si-ai.si-chatgpt.on, .si-av.si-chatgpt { color: var(--ink); }
.si-more svg { width: 14px; height: 14px; }
.si-box { position: relative; height: 44px; }
.si-msg {
	position: absolute; right: 0; top: 0; height: 44px; max-width: 100%;
	display: flex; align-items: center; padding: 0 16px; border-radius: 22px 22px 6px 22px;
	background: var(--ink); color: var(--page); white-space: nowrap; overflow: hidden;
	font: 500 15.5px/1 var(--font); letter-spacing: -0.005em;
	box-shadow: 0 8px 20px -8px rgba(0, 0, 0, 0.35);
	transition: width 0.55s var(--si-ease), background-color 0.45s, color 0.45s, border-radius 0.5s var(--si-ease), box-shadow 0.45s, opacity 0.35s var(--si-ease), transform 0.5s var(--si-ease);
}
.si-msg.compose {
	background: var(--si-field); color: var(--ink); border-radius: 22px; padding-right: 48px;
	box-shadow: 0 0 0 1px var(--si-card-edge) inset, 0 2px 8px -4px rgba(0, 0, 0, 0.1);
}
.si-msg.gone { opacity: 0; transform: translateY(-10px) scale(0.96); }
.si-msg.pre { opacity: 0; transform: translateY(6px); }
.si-w { display: inline-block; white-space: pre; transition: opacity 0.45s var(--si-ease), transform 0.6s var(--si-ease), filter 0.45s; }
.si-w.si-evap { opacity: 0; transform: translateY(6px); filter: blur(4px); }
.si-ph { position: absolute; left: 16px; color: var(--muted); opacity: 0; transition: opacity 0.3s; pointer-events: none; }
.si-msg.compose.empty .si-ph { opacity: 1; }
.si-caret { display: inline-block; width: 2px; height: 1.15em; margin-left: 1px; background: var(--lift); border-radius: 1px; animation: si-blink 1s steps(1) infinite; }
.si-msg.compose.empty .si-caret { position: absolute; left: 15px; }
@keyframes si-blink { 50% { opacity: 0; } }
.si-send {
	position: absolute; right: 6px; top: 6px; width: 32px; height: 32px; border-radius: 50%;
	display: grid; place-items: center; background: var(--si-track); color: var(--muted);
	opacity: 0; transform: scale(0.6); transition: opacity 0.3s, transform 0.4s var(--si-spring), background-color 0.25s, color 0.25s;
}
.si-send svg { width: 15px; height: 15px; }
.si-msg.compose .si-send { opacity: 1; transform: none; }
.si-msg.compose:not(.empty) .si-send { background: var(--ink); color: var(--page); }
.si-msg.tap .si-send { transform: scale(0.82); }

.si-reply {
	grid-column: 1 / -1; align-self: end; height: 32px;
	display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink-2);
	transition: opacity 0.45s var(--si-ease), transform 0.6s var(--si-ease);
}
.si-reply.pre { opacity: 0; transform: translateY(6px); }
.si-reply.gone { opacity: 0; transform: translateY(-6px); }
.si-who { display: inline-flex; align-items: center; gap: 7px; }
.si-who b { color: var(--ink); font-weight: 650; }
.si-av { width: 22px; height: 22px; display: grid; place-items: center; border-radius: 50%; background: var(--si-solid); box-shadow: 0 0 0 1px var(--si-card-edge); }
.si-av svg { width: 13px; height: 13px; }
.si-check { width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; background: var(--food); color: #fff; flex: none; animation: si-pop 0.5s var(--si-spring); }
.si-check svg { width: 11px; height: 11px; }
.si-done { display: inline-flex; align-items: center; gap: 6px; }
.si-done::before { content: "·"; color: var(--muted); margin-right: 1px; }
.si-dots { display: inline-flex; gap: 4px; }
.si-dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); animation: si-think 1s ease-in-out infinite; }
.si-dots i:nth-child(2) { animation-delay: 0.15s; }
.si-dots i:nth-child(3) { animation-delay: 0.3s; }
@keyframes si-think { 0%, 100% { opacity: 0.3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-2px); } }
@keyframes si-pop { from { transform: scale(0); } }

/* Cards inside the glass. */
.si-card {
	position: relative; border-radius: 22px; background: var(--si-card); border: 1px solid var(--si-card-edge);
	box-shadow: 0 1px 2px light-dark(rgba(11, 11, 11, 0.04), transparent), 0 10px 30px -14px light-dark(rgba(11, 11, 11, 0.16), rgba(0, 0, 0, 0.5));
}
.si-eyebrow { display: flex; align-items: center; gap: 7px; font-size: 12.5px; font-weight: 600; color: var(--muted); letter-spacing: 0.01em; }
.si-pip { width: 8px; height: 8px; border-radius: 3px; background: var(--k); }
.si-day { padding: 16px 18px 4px; margin-top: 12px; }
.si-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.si-kcal { font: 700 30px/1.1 var(--display); letter-spacing: -0.025em; margin-top: 2px; font-variant-numeric: tabular-nums; }
.si-kcal small, .si-wt-n small { font: 600 14px/1 var(--font); color: var(--muted); letter-spacing: 0; margin-left: 3px; }
.si-macros { font-size: 13px; color: var(--ink-2); margin-top: 3px; font-variant-numeric: tabular-nums; }
.si-macros b { font-weight: 650; color: var(--ink); }
.si-ring { width: 62px; height: 62px; position: relative; flex: none; }
.si-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.si-track { stroke: var(--food-wash); }
.si-fill { stroke: var(--food); transition: stroke-dashoffset 1.6s var(--si-ease), opacity 0.3s; }
.si-ring-l { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; font: 700 13px/1.05 var(--display); font-variant-numeric: tabular-nums; }
.si-ring-l small { display: block; font: 500 9.5px/1.1 var(--font); color: var(--muted); }

.si-rows { position: relative; }
.si-row {
	display: grid; grid-template-columns: 42px minmax(0, 1fr) auto auto; column-gap: 12px; align-items: center;
	padding: 10px 0; transition: opacity 0.6s var(--si-ease), transform 0.6s var(--si-ease);
}
.si-row + .si-row { border-top: 1px solid var(--line); }
.si-row img { width: 42px; height: 42px; border-radius: 12px; display: block; transition: transform 0.7s var(--si-spring), opacity 0.4s var(--si-ease); }
.si-t { min-width: 0; }
.si-title { font: 600 14.5px/1.3 var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.si-sub { font-size: 12.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.si-n { text-align: right; font: 650 14.5px/1.2 var(--font); font-variant-numeric: tabular-nums; min-width: 3ch; }
.si-n small { display: block; font-size: 11px; font-weight: 500; color: var(--muted); margin-top: 1px; }
.si-n.si-p { color: var(--ink-2); font-weight: 550; min-width: 4ch; }
.si-row .si-sub, .si-row .si-n { transition: opacity 0.5s var(--si-ease), transform 0.6s var(--si-ease); }
.si-row .si-p { transition-delay: 0.08s; }
.si-row.pre img { opacity: 0; transform: scale(0.5) rotate(-8deg); }
.si-row.pre .si-title { opacity: 0; }
.si-row.pre .si-sub, .si-row.pre .si-n { opacity: 0; transform: translateY(4px); }
.si-row.pre + .si-row { border-top-color: transparent; }
.si-row.out { opacity: 0; transform: translateY(-4px); }
.si-empty { position: absolute; inset: 0; display: grid; place-items: center; font-size: 13.5px; color: var(--muted); opacity: 0; pointer-events: none; transition: opacity 0.5s var(--si-ease); }
.si-empty.on { opacity: 1; }

/* This week, and the weight square beside it. */
.si-pair { display: grid; grid-template-columns: minmax(0, 1fr) 150px; gap: 12px; margin-top: 12px; }
.si-week { padding: 14px 16px; }
.si-range { margin-left: auto; font-weight: 500; letter-spacing: 0; font-variant-numeric: tabular-nums; }
.si-days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin: 12px 0; }
.si-wd { display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.si-wd.si-today { color: var(--ink); }
.si-slot { position: relative; width: 100%; max-width: 34px; aspect-ratio: 1; border-radius: 30%; background: var(--si-track); display: grid; place-items: center; }
.si-today .si-slot { box-shadow: 0 0 0 2px var(--si-solid), 0 0 0 3.5px var(--ink); }
.si-slot i { position: absolute; inset: 0; border-radius: inherit; background: var(--k); display: grid; place-items: center; }
.si-slot i svg { width: 55%; height: 55%; color: #fff; }
.si-slot.si-plan { background: color-mix(in srgb, var(--k) 15%, transparent); }
.si-slot.si-plan::after { content: ""; width: 24%; aspect-ratio: 1; border-radius: 50%; background: var(--k); opacity: 0.8; }
.si-lift { --k: var(--lift); }
.si-run { --k: var(--run); }
.si-tally { display: flex; gap: 14px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.si-tally span { display: inline-flex; align-items: center; gap: 5px; }
.si-tally span::before { content: ""; width: 8px; height: 8px; border-radius: 3px; background: var(--k); }
.si-tally b { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }

.si-wt { padding: 14px 14px 12px; display: flex; flex-direction: column; overflow: hidden; }
.si-wt-n { margin-top: 8px; font: 700 26px/1.05 var(--display); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.si-wt-sub { font-size: 12.5px; font-weight: 600; color: var(--weight); margin-top: 3px; transition: opacity 0.5s var(--si-ease); }
.si-spark { position: relative; margin-top: auto; padding-top: 8px; }
.si-spark svg { width: 100%; height: 34px; display: block; overflow: visible; }
.si-area { fill: var(--weight); opacity: 0.13; transition: opacity 0.6s; }
.si-ln { fill: none; stroke: var(--weight); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.si-seg { stroke-dasharray: 1; stroke-dashoffset: 0; transition: stroke-dashoffset 0.9s var(--si-ease), opacity 0.2s; }
.si-spark i { position: absolute; left: 98%; top: calc(8px + 34px * 0.875); width: 10px; height: 10px; margin: -5px 0 0 -5px; border-radius: 50%; background: var(--weight); }
.si-dot { box-shadow: 0 0 0 2.5px var(--si-solid); transition: transform 0.7s var(--si-spring), opacity 0.3s; }
.si-halo { opacity: 0; }
.si-wt-n { transition: opacity 0.35s; }
.si-wt.pre .si-seg { stroke-dashoffset: 1; opacity: 0; }
.si-wt.pre .si-seg-area { opacity: 0; }
.si-wt.pre .si-dot { transform: scale(0); opacity: 0; }
.si-wt.land .si-halo { animation: si-halo 1.2s var(--si-ease); }
@keyframes si-halo { from { opacity: 0.4; transform: scale(1); } to { opacity: 0; transform: scale(4); } }

/* Words in flight from the message to the card. */
.si-fly { position: absolute; left: 0; top: 0; z-index: 5; white-space: pre; pointer-events: none; transform-origin: 0 0; will-change: transform; }
.instant *, .instant *::before { transition: none !important; }
.si-paused *, .si-paused *::before, .si-paused *::after { animation-play-state: paused !important; }

/* Entrance: copy rises out of a soft blur, the glass settles, the week's ticks pop in. */
@media (prefers-reduced-motion: no-preference) {
	.si-in { animation: si-rise 1s var(--si-ease) both; }
	.si-d1 { animation-delay: 0.08s; }
	.si-d2 { animation-delay: 0.16s; }
	.si-d3 { animation-delay: 0.24s; }
	.si-d4 { animation-delay: 0.32s; }
	.si-hero.si-in { animation: si-rise 1s var(--si-ease) 0.08s both; }
	.si-hero.si-in span { animation: si-rise 1s var(--si-ease) 0.14s both, si-sheen-text 14s ease-in-out 1.2s infinite alternate; }
	.si-strava.si-in::after { animation: si-sweep 1.1s var(--si-ease) 1.6s; }
	.si-scene.si-in { animation: si-settle 1.3s var(--si-ease) 0.1s both; }
	.si-slot i { animation: si-pop 0.55s var(--si-spring) both; animation-delay: calc(0.9s + var(--n) * 0.1s); }
	.si-light { animation: si-fade 1.6s ease-out both; }
}
@keyframes si-rise { from { opacity: 0; transform: translateY(14px); filter: blur(6px); } }
@keyframes si-settle { from { opacity: 0; transform: translateY(22px) scale(0.97); } }
@keyframes si-fade { from { opacity: 0; } }

@media (max-width: 1100px) and (min-width: 821px) {
	.si-page { grid-template-columns: minmax(0, 370px) minmax(0, 450px); column-gap: 56px; }
	.si-hero { font-size: 54px; }
}

/* Phone: the glass on top, then the words, with the button under the thumb. */
@media (max-width: 820px) {
	.si-page {
		display: flex; flex-direction: column; align-items: stretch; max-width: 480px; margin: 0 auto;
		padding: max(14px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(18px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
	}
	.si-side { display: contents; }
	.si-lockup { order: 1; margin: 4px 4px 14px; gap: 10px; }
	.si-lockup img { width: 32px; height: 32px; border-radius: 8px; }
	.si-lockup h1 { font-size: 20px; }
	.si-scene { order: 2; margin: auto 0; }
	.si-copy { order: 3; padding: 20px 4px 0; }
	.si-hero { font-size: 38px; }
	.si-lede { font-size: 15.5px; line-height: 1.45; margin: 10px 0 18px; max-width: 36ch; }
	.si-strava { width: 100%; height: 56px; }
	.si-err { align-self: stretch; justify-content: center; margin-top: 10px; }
	.si-dev { align-self: center; margin: 12px 0 0; }

	.si-glass { padding: 12px; border-radius: 28px; }
	.si-chat { height: 80px; column-gap: 8px; }
	.si-ais { height: 40px; }
	.si-ais::before { width: 34px; height: 34px; transform: translateX(calc(var(--i) * 36px)); }
	.si-ai { width: 34px; height: 34px; }
	.si-ai svg { width: 16px; height: 16px; }
	.si-more { display: none; } /* room for the message; the two logos already say "either" */
	.si-box, .si-msg { height: 40px; }
	.si-msg { font-size: 14.5px; padding: 0 14px; border-radius: 20px 20px 6px 20px; }
	.si-msg.compose { border-radius: 20px; padding-right: 44px; }
	.si-ph { left: 14px; }
	.si-msg.compose.empty .si-caret { left: 13px; }
	.si-send { top: 5px; right: 5px; width: 30px; height: 30px; }
	.si-reply { font-size: 13px; height: 30px; }
	.si-day { padding: 12px 14px 2px; margin-top: 10px; border-radius: 20px; }
	.si-head { padding-bottom: 8px; }
	.si-kcal { font-size: 24px; }
	.si-macros { font-size: 12.5px; }
	.si-ring { width: 52px; height: 52px; }
	.si-ring-l { font-size: 12px; }
	.si-row { grid-template-columns: 36px minmax(0, 1fr) auto auto; column-gap: 10px; padding: 7px 0; }
	.si-row img { width: 36px; height: 36px; border-radius: 10px; }
	.si-title { font-size: 14px; }
	.si-sub { font-size: 12px; }
	.si-n { font-size: 14px; }
	.si-pair { grid-template-columns: minmax(0, 1fr) 108px; gap: 10px; margin-top: 10px; }
	.si-week { padding: 11px 12px; border-radius: 20px; }
	.si-days { gap: 4px; margin: 9px 0 8px; }
	.si-wd { font-size: 10.5px; gap: 4px; }
	.si-tally { gap: 10px; font-size: 11.5px; }
	.si-range { font-size: 11.5px; }
	.si-wt { padding: 11px 11px 10px; border-radius: 20px; }
	.si-wt-n { font-size: 21px; margin-top: 6px; }
	.si-wt-n small { font-size: 12px; }
	.si-wt-sub { font-size: 11.5px; }
	.si-spark svg { height: 26px; }
	.si-spark i { top: calc(8px + 26px * 0.875); }
}
@media (max-width: 820px) and (max-height: 760px) {
	.si-lede { display: none; }
	.si-hero { margin-bottom: 16px; }
}
@media (max-width: 820px) and (max-height: 700px) {
	.si-lockup { margin-bottom: 10px; }
	.si-tally { display: none; }
	.si-days { margin-bottom: 0; }
	.si-copy { padding-top: 14px; }
	.si-chat { height: 74px; }
	.si-row { padding: 5px 0; }
	.si-day { margin-top: 8px; }
	.si-pair { margin-top: 8px; }
}
