/* Lean Archers Club — tokens from Figma 01 Brand Guide. Mobile first; desktop from 900px. */
:root {
	--ink: #0E100F;
	--accent: #1E4D36;
	--accent-hover: #163B29;
	--accent-subtle: #E7EFE9;
	--n0: #FFFFFF;
	--n50: #F7F7F5;
	--n100: #EFEFEC;
	--n200: #E2E2DE;
	--n300: #C9C9C4;
	--n500: #6B6B66;
	--n700: #3A3B38;
	--cardio: #A3472B;
	--strength: #2E4A6B;
	--sports: #6E5C1C;
	--other: #5E5E59;
	--error: #B42318;
	--r-sm: 8px;
	--r-md: 12px;
	--r-lg: 20px;
	--gutter: 16px;
	--container: 1120px;
	--font: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
	--dock-h: 160px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--n0);
	color: var(--ink);
	font: 400 16px/24px var(--font);
	font-variant-numeric: tabular-nums;
	-webkit-font-smoothing: antialiased;
}
h1, h2, h3, p { margin: 0; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- Type scale ---------- */
.t-display { font-size: 32px; line-height: 38px; font-weight: 600; letter-spacing: -0.02em; }
.t-h1 { font-size: 32px; line-height: 38px; font-weight: 600; letter-spacing: -0.02em; }
.t-h2 { font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.015em; }
.t-h3 { font-size: 20px; line-height: 26px; font-weight: 600; letter-spacing: -0.01em; }
.t-h4 { font-size: 17px; line-height: 24px; font-weight: 600; letter-spacing: -0.005em; }
.t-stat { font-size: 28px; line-height: 32px; font-weight: 600; letter-spacing: -0.02em; }
.t-body { font-size: 16px; line-height: 24px; }
.t-body-strong { font-size: 16px; line-height: 24px; font-weight: 500; }
.t-body-sm { font-size: 14px; line-height: 20px; }
.t-label { font-size: 14px; line-height: 20px; font-weight: 500; }
.t-caption { font-size: 12px; line-height: 16px; }
.t-overline { font-size: 12px; line-height: 16px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; }
.muted { color: var(--n500); }
@media (min-width: 900px) { .t-display { font-size: 40px; line-height: 44px; } }

.icon { flex-shrink: 0; display: block; }

/* ---------- Page shell ---------- */
.page {
	max-width: calc(var(--container) + 2 * var(--gutter));
	margin: 0 auto;
	padding: 8px var(--gutter) calc(var(--dock-h) + 32px + env(safe-area-inset-bottom));
}
@media (min-width: 900px) {
	:root { --gutter: 32px; }
	.page { padding-top: 48px; padding-bottom: 96px; }
}

.topbar { position: sticky; top: 0; z-index: 20; background: var(--n0); }
.topbar__inner {
	height: 56px; display: flex; align-items: center; justify-content: space-between;
	padding: 0 10px 0 var(--gutter); max-width: calc(var(--container) + 2 * var(--gutter)); margin: 0 auto;
}
.topbar__left { display: flex; align-items: center; gap: 48px; }
.topbar__right { display: flex; align-items: center; gap: 12px; }
.topbar__avatar { width: 44px; height: 44px; display: grid; place-items: center; }
.topnav, .btn.topbar__cta { display: none; }
@media (min-width: 900px) {
	.topbar { border-bottom: 1px solid var(--n200); }
	.topbar__inner { height: 72px; padding: 0 var(--gutter); }
	.topnav { display: flex; gap: 8px; }
	.btn.topbar__cta { display: inline-flex; }
}
.topnav__link { height: 40px; padding: 0 12px; display: flex; align-items: center; border-radius: 999px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--n500); }
.topnav__link:hover { color: var(--ink); }
.topnav__link.is-active { background: var(--n100); color: var(--ink); }

.wordmark { display: inline-flex; align-items: center; gap: 8px; font-size: 17px; line-height: 24px; font-weight: 600; letter-spacing: -0.005em; }
.wordmark__mark { width: 18px; height: 18px; border-radius: 50%; border: 3px solid var(--accent); }

/* Sticky dock: check-in bar + tab bar (mobile only). */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; }
.dock__bar { padding: 12px var(--gutter); background: linear-gradient(to bottom, rgba(255,255,255,0) 0, var(--n0) 12px); }
.tabbar { display: flex; background: var(--n0); border-top: 1px solid var(--n200); padding-bottom: max(20px, env(safe-area-inset-bottom)); }
.tabbar__link { flex: 1; height: 64px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--n500); font-size: 12px; line-height: 16px; }
.tabbar__link.is-active { color: var(--ink); font-size: 14px; line-height: 20px; font-weight: 500; }
@media (min-width: 900px) { .dock { display: none; } }

/* ---------- Basics ---------- */
.avatar {
	flex-shrink: 0; display: inline-grid; place-items: center; overflow: hidden; border-radius: 999px;
	background: var(--n100); color: var(--n700); width: 32px; height: 32px; font-size: 12px; line-height: 16px;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar--md { width: 48px; height: 48px; font-size: 14px; line-height: 20px; font-weight: 500; }
.avatar--lg { width: 80px; height: 80px; font-size: 24px; line-height: 30px; font-weight: 600; letter-spacing: -0.015em; }

.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 52px; padding: 0 24px;
	border-radius: 999px; border: 0; font-size: 16px; line-height: 20px; font-weight: 500; white-space: nowrap;
	transition: background-color .15s ease;
}
.btn--sm { height: 44px; }
.btn--block { width: 100%; }
.btn--primary { background: var(--accent); color: var(--n0); }
.btn--primary:hover { background: var(--accent-hover); }
.btn--primary:disabled { background: var(--n200); color: var(--n500); cursor: default; }
.btn--primary.is-loading { background: var(--accent-hover); }
.btn--secondary { background: var(--n0); color: var(--ink); border: 1px solid var(--n300); }
.btn--secondary:hover { background: var(--n50); }
.btn--ghost { background: none; color: var(--ink); }
.btn--ghost:hover { background: var(--n50); }
.btn--danger { color: var(--error); }

.icon-btn { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 999px; background: var(--n100); border: 0; color: var(--ink); }
.icon-btn--outline { background: var(--n0); border: 1px solid var(--n200); }
.icon-btn--outline:hover { background: var(--n50); }
.icon-btn.is-disabled { color: var(--n300); }
.pager { display: flex; gap: 4px; flex-shrink: 0; }

.chip { display: inline-grid; place-items: center; border-radius: 999px; color: var(--n0); width: 20px; height: 20px; flex-shrink: 0; }
.chip--md { width: 32px; height: 32px; }
.chip--cardio { background: var(--cardio); }
.chip--strength { background: var(--strength); }
.chip--sports { background: var(--sports); }
.chip--other { background: var(--other); }
.chips { display: flex; gap: 4px; flex-shrink: 0; }

.badge {
	display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px 6px 10px; border-radius: 999px;
	font-size: 14px; line-height: 20px; font-weight: 500; white-space: nowrap; background: var(--n50); color: var(--n500);
}
.badge--active, .badge--record { background: var(--accent); color: var(--n0); }

.section-header { display: flex; align-items: center; justify-content: space-between; min-height: 44px; gap: 12px; }
.section-header__action { display: flex; align-items: center; gap: 2px; min-height: 44px; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--n700); }
.section-header__action:hover { color: var(--ink); }
.section-sub { margin: 12px 0 0; }

.empty {
	background: var(--n50); border-radius: var(--r-md); padding: 32px 24px; margin-top: 12px;
	display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center;
}
.empty__icon { width: 48px; height: 48px; border-radius: 999px; background: var(--n0); border: 1px solid var(--n200); display: grid; place-items: center; }
.empty__body { color: var(--n700); max-width: 320px; }
.empty .btn { margin-top: 4px; }

/* ---------- Home ---------- */
.greeting { display: flex; flex-direction: column; gap: 4px; }
.greeting h1 { margin-top: 0; }
.greeting__week { display: flex; align-items: center; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
/* Owner-only motivation lines under the weekly badge. Ink icons, no red/green. */
.insights { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; color: var(--n700); }
.insights li { display: flex; align-items: flex-start; gap: 8px; }
.insights .icon { margin-top: 2px; color: var(--ink); }
.goal { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 4px; }
.goal__select select { color: var(--ink); }
.goal [data-goal-status] { flex-basis: 100%; }

.home-grid { display: grid; gap: 40px; margin-top: 40px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 900px) {
	/* Main column: Today, Progress. Side column: Calendar, Recent activity. */
	.home-grid {
		margin-top: 48px; column-gap: 32px; row-gap: 56px;
		grid-template-columns: minmax(0, 720fr) minmax(0, 368fr);
		grid-template-areas: "today calendar" "progress calendar" "progress recent";
		grid-template-rows: auto auto 1fr;
	}
	.home-grid__today { grid-area: today; }
	.home-grid__calendar { grid-area: calendar; }
	.home-grid__progress { grid-area: progress; }
	.home-grid__recent { grid-area: recent; }
}

.tiles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px 8px; margin-top: 12px; }
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(auto-fill, minmax(80px, 1fr)); } }
.tile { display: flex; flex-direction: column; align-items: center; gap: 8px; min-width: 0; }
.tile__ring { position: relative; width: 56px; height: 56px; border-radius: 999px; border: 1.5px dashed var(--n300); display: grid; place-items: center; }
.tile__ring .avatar { opacity: .55; }
.tile--done .tile__ring { border: 2px solid var(--accent); }
.tile--done .tile__ring .avatar { opacity: 1; }
.tile__badge { position: absolute; left: 34px; top: 34px; width: 20px; height: 20px; border-radius: 999px; background: var(--accent); border: 2px solid var(--n0); color: var(--n0); display: grid; place-items: center; }
.tile__name { color: var(--n700); max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tile--done .tile__name { color: var(--ink); }
.tile__status { height: 20px; display: flex; gap: 4px; align-items: center; }

.calendar__header { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.calendar__grid { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: 12px; margin-top: 12px; }
.calendar__weekday { text-align: center; }
.day { display: flex; flex-direction: column; align-items: center; gap: 4px; height: 56px; padding-top: 2px; position: relative; border-radius: var(--r-sm); }
.day[role="button"] { cursor: pointer; }
.day__disc { width: 36px; height: 36px; border-radius: 999px; display: grid; place-items: center; font-size: 14px; line-height: 20px; font-weight: 500; color: var(--n500); }
.day--worked-out .day__disc, .day--logged-late .day__disc, .day--today-done .day__disc { background: var(--accent); color: var(--n0); }
.day--today-done .day__disc { box-shadow: 0 0 0 2px var(--ink); }
.day--today .day__disc { box-shadow: inset 0 0 0 1.5px var(--ink); color: var(--ink); }
.day--future .day__disc { color: var(--n300); }
.day--logged-late::after { content: ""; position: absolute; top: 2px; left: calc(50% + 13px); width: 9px; height: 9px; border-radius: 50%; background: var(--n0); box-shadow: inset 0 0 0 2px var(--ink); }
.day__marks { height: 6px; display: flex; gap: 3px; align-items: center; justify-content: center; }
.mark { width: 5px; height: 5px; border-radius: 50%; }
.mark--cardio { background: var(--cardio); }
.mark--strength { background: var(--strength); }
.mark--sports { background: var(--sports); }
.mark--other { background: var(--other); }
.dash { display: block; width: 8px; height: 1.5px; border-radius: 1px; background: var(--n300); }

.legend { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; color: var(--n700); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.lg-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.lg-dash { width: 8px; height: 1.5px; background: var(--n300); }
.lg-ring { width: 8px; height: 8px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--ink); }
.lg-cell { position: relative; width: 20px; height: 18px; border-radius: 4px; display: grid; place-items: center; }
.lg-cell--done { background: var(--accent); }
.lg-cell--missed { background: var(--n50); }
.lg-cell--missed .dash { width: 6px; }
.lg-cell--today { border: 1.5px dashed var(--ink); }
.lg-cell--late::after { content: ""; position: absolute; top: -3px; right: -3px; width: 7px; height: 7px; border-radius: 50%; background: var(--n0); box-shadow: inset 0 0 0 1.5px var(--ink); }

/* Tabs + trend chart */
.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tab { height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--n200); background: var(--n0); font-size: 14px; line-height: 20px; font-weight: 500; }
.tab[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: var(--n0); }

.chart { margin-top: 12px; background: var(--n0); border: 1px solid var(--n200); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 16px; }
.chart__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.chart__label { color: var(--n700); }
.chart__plot { position: relative; height: 120px; }
.chart__grid { position: absolute; left: 0; right: 0; height: 1px; background: var(--n100); }
.chart__line { position: absolute; inset: 0; width: 100%; height: 120px; overflow: visible; }
.chart__line polyline { fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.chart__point { position: absolute; width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--n0); box-shadow: inset 0 0 0 1.5px var(--ink); }
.chart__point--latest { width: 10px; height: 10px; margin: -5px 0 0 -5px; background: var(--accent); box-shadow: 0 0 0 2px var(--n0); }
.chart__value { position: absolute; transform: translateX(-50%); }
.chart__baseline { position: absolute; left: 3px; top: 55px; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); }
.chart__pending { position: absolute; left: 18px; right: 8px; top: 59px; border-top: 1.5px dashed var(--n300); }
.chart__empty { position: absolute; left: 50%; top: 74px; width: 240px; transform: translateX(-50%); text-align: center; color: var(--n500); }
.chart__axis { display: flex; font-size: 12px; line-height: 16px; color: var(--n500); }
.chart__axis span { flex: 1; text-align: center; }
.chart__axis--spread { justify-content: space-between; }
.chart__axis--spread span { flex: none; }

.stat-card__value { display: flex; align-items: baseline; gap: 4px; flex-wrap: wrap; }
.change { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; color: var(--n500); white-space: nowrap; }
.change b { font-weight: 500; color: var(--ink); }
.change .icon { color: var(--ink); }

.stat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; margin-top: 12px; }
.stat-grid--home { margin-top: 12px; }
@media (min-width: 900px) {
	.stat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	.stat-grid--home { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
.stat-card { background: var(--n0); border: 1px solid var(--n200); border-radius: var(--r-md); padding: 16px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.stat-card__label { color: var(--n700); }
.stat-card__changes { display: flex; flex-direction: column; gap: 4px; }

.feed { margin-top: 4px; }
.feed-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--n100); }
.feed-item__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.feed-item__detail { display: flex; align-items: center; gap: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.feed-item__time { white-space: nowrap; }

/* ---------- Week ---------- */
.week-header { display: flex; flex-direction: column; gap: 24px; }
.week-header__left { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; }
.summary { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.summary__stat { background: var(--n50); border-radius: var(--r-md); padding: 14px 16px; display: flex; flex-direction: column; gap: 2px; color: var(--n700); }
.summary__stat .t-stat { color: var(--ink); }
.summary--three { grid-template-columns: repeat(3, 1fr); }
@media (min-width: 900px) {
	.week-header { flex-direction: row; align-items: flex-end; justify-content: space-between; }
	.week-header__left { justify-content: flex-start; gap: 24px; }
	.week-header .summary { width: 372px; }
}

.week-table { margin-top: 24px; }
.week-table__head { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; padding-bottom: 8px; }
.week-table__friend, .week-table__count, .week-table__badge { display: none; }
.week-day { display: flex; flex-direction: column; align-items: center; padding: 6px 0; border-radius: var(--r-sm); }
.week-day .t-caption { color: var(--n500); }
.week-day.is-today { background: var(--ink); color: var(--n0); }
.week-day.is-today .t-caption { color: var(--n0); }
.week-day__short { display: none; }

.week-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "friend badge count" "cells cells cells"; gap: 10px; align-items: center; padding: 14px 0; border-top: 1px solid var(--n100); }
.week-row__friend { grid-area: friend; display: flex; align-items: center; gap: 10px; min-width: 0; }
.week-row__friend .t-body-strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.week-row__badge { grid-area: badge; }
.week-row__count { grid-area: count; display: flex; align-items: baseline; gap: 2px; }
.week-row__of { display: none; }
.week-row__cells { grid-area: cells; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }

.cell { position: relative; height: 40px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; gap: 2px; color: var(--n0); }
.cell[role="button"] { cursor: pointer; }
.cell--worked-out, .cell--logged-late { background: var(--accent); }
.cell--logged-late::after { content: ""; position: absolute; top: 3px; right: 3px; width: 8px; height: 8px; border-radius: 50%; background: var(--n0); box-shadow: inset 0 0 0 2px var(--ink); }
.cell--missed { background: var(--n50); }
.cell--missed .dash { width: 10px; }
.cell--today { border: 1.5px dashed var(--ink); }
.cell--future { border: 1px solid var(--n100); }

.week-footer { display: flex; flex-direction: column; gap: 24px; margin-top: 24px; }

@media (min-width: 900px) {
	.week-table { margin-top: 32px; }
	.week-table__head, .week-row { display: grid; grid-template-columns: 240px repeat(7, minmax(0, 1fr)) 104px 168px; gap: 8px; grid-template-areas: none; }
	.week-table__head { padding-bottom: 12px; align-items: center; }
	.week-table__friend, .week-table__count, .week-table__badge { display: block; }
	.week-day__short { display: inline; }
	.week-day__letter { display: none; }
	.week-row { padding: 12px 0; }
	.week-row__friend, .week-row__badge, .week-row__count { grid-area: auto; }
	.week-row__friend { gap: 12px; }
	.week-row__cells { display: contents; }
	.week-row__count { gap: 4px; order: 9; }
	.week-row__badge { order: 10; }
	.week-row__of { display: inline; }
	.week-row__slash { display: none; }
	.cell { height: 44px; }
	.week-footer { flex-direction: row; justify-content: space-between; align-items: center; }
}

/* ---------- Profile ---------- */
.profile-grid { display: flex; flex-direction: column; gap: 40px; }
.profile-grid__side, .profile-grid__main { display: flex; flex-direction: column; gap: 40px; min-width: 0; }
.profile-head { display: flex; align-items: center; gap: 16px; }
.profile-head > div { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.profile-head .badge { margin-top: 4px; }
.profile-grid__side > .summary { margin-top: -16px; }
/* Mobile order from Figma: header, stats, body stats, trends, history. */
@media (max-width: 899px) {
	.profile-grid__side, .profile-grid__main { display: contents; }
	.profile-head { order: 1; }
	.profile-grid__side > .summary { order: 2; }
	#body-stats { order: 3; }
	.profile-trends { order: 4; }
	.profile-checkins { order: 5; }
	.profile-history { order: 6; }
	.account { order: 7; }
}
@media (min-width: 900px) {
	.profile-grid { display: grid; grid-template-columns: minmax(0, 352px) minmax(0, 1fr); gap: 48px; align-items: start; }
	.profile-grid__side { gap: 32px; }
	.profile-grid__side > .summary { margin-top: -8px; }
}

.history { margin-top: 4px; }
.history-row { width: 100%; display: flex; align-items: center; gap: 16px; padding: 14px 0; border: 0; border-bottom: 1px solid var(--n100); background: none; text-align: left; }
button.history-row:hover { background: var(--n50); }
.history-row__date { width: 40px; display: flex; flex-direction: column; align-items: center; flex-shrink: 0; }
.history-row__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.history-row__detail { display: flex; align-items: center; gap: 4px; }
.profile-history .btn--ghost, .profile-checkins .btn--ghost { margin-top: 8px; }
a.history-row:hover { background: var(--n50); }
.history-row__edit { color: var(--n500); flex-shrink: 0; }
.tag { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 999px; background: var(--n100); color: var(--n700); font-size: 12px; line-height: 20px; font-weight: 500; vertical-align: 2px; }
.body-form__delete { margin-right: auto; padding: 0 12px; }
.body-form.is-editing [data-last] { visibility: hidden; }
@media (max-width: 899px) {
	.body-form__actions { flex-direction: column-reverse; }
	.body-form__actions .btn { width: 100%; }
	.body-form__delete { margin-right: 0; }
}

.month-select { position: relative; display: inline-flex; align-items: center; gap: 2px; min-height: 44px; color: var(--n700); }
.month-select select { appearance: none; border: 0; background: none; font-size: 14px; line-height: 20px; font-weight: 500; padding-right: 20px; cursor: pointer; }
.month-select .icon { position: absolute; right: 0; pointer-events: none; }

.account { display: flex; flex-direction: column; align-items: flex-start; }
.account__link { display: inline-flex; align-items: center; gap: 8px; color: var(--n700); min-height: 44px; border: 0; background: none; padding: 0; }
.account__link:hover { color: var(--ink); }

/* Own avatar: tap to change photo. */
.photo-picker { position: relative; flex-shrink: 0; cursor: pointer; border-radius: 999px; }
.photo-picker input { position: absolute; inset: 0; width: 100%; opacity: 0; cursor: pointer; }
.photo-picker:focus-within { outline: 2px solid var(--ink); outline-offset: 2px; }
.photo-picker__badge { position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 999px; background: var(--n0); border: 1px solid var(--n200); display: grid; place-items: center; pointer-events: none; }
.photo-picker.is-busy .avatar { opacity: .5; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.field__box {
	position: relative; height: 52px; display: flex; align-items: center; gap: 10px; padding: 0 16px;
	background: var(--n0); border: 1px solid var(--n300); border-radius: var(--r-sm);
}
.field__box:focus-within { border: 2px solid var(--ink); padding: 0 15px; }
.field--error .field__box { border: 2px solid var(--error); padding: 0 15px; }
.field__box input { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: none; font-size: 16px; line-height: 24px; padding: 0; }
.field__box input::placeholder { color: var(--n500); }
.field__unit { font-size: 14px; line-height: 20px; color: var(--n500); }
.field__error { color: var(--error); }
.field__toggle { border: 0; background: none; text-decoration: underline; font-weight: 500; padding: 4px; }
.field__box--date { cursor: pointer; }
.field__box--date .field__text { flex: 1; }
.field__box--date input[type="date"] { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.field__box--date input::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.form-error { color: var(--error); }

.checkbox { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.checkbox input { position: absolute; opacity: 0; }
.checkbox__box { width: 20px; height: 20px; border-radius: 4px; border: 1.5px solid var(--n300); display: grid; place-items: center; color: transparent; }
.checkbox input:checked + .checkbox__box { background: var(--ink); border-color: var(--ink); color: var(--n0); }
.checkbox input:focus-visible + .checkbox__box { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Activity options (2 x 2) */
.activities { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; }
.activities__legend { display: flex; justify-content: space-between; align-items: center; width: 100%; padding: 0; margin-bottom: 12px; }
.activities__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.option { position: relative; height: 104px; padding: 16px; border: 1px solid var(--n200); border-radius: var(--r-md); display: flex; flex-direction: column; justify-content: space-between; cursor: pointer; background: var(--n0); }
.option input { position: absolute; opacity: 0; }
.option__top { display: flex; justify-content: space-between; align-items: flex-start; }
.option__check { width: 22px; height: 22px; border-radius: 999px; border: 1.5px solid var(--n300); display: grid; place-items: center; color: transparent; }
.option:has(input:checked) { background: var(--n50); border: 2px solid var(--ink); padding: 15px; }
.option:has(input:checked) .option__check { background: var(--accent); border-color: var(--accent); color: var(--n0); }
.option:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Sheet (mobile) / modal (desktop) */
body.has-sheet { overflow: hidden; }
.sheet { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.sheet__scrim { position: absolute; inset: 0; background: rgba(14, 16, 15, .4); animation: fade .2s ease; }
.sheet__panel {
	position: relative; width: 100%; max-height: calc(100dvh - 24px); overflow-y: auto; background: var(--n0);
	border-radius: var(--r-lg) var(--r-lg) 0 0; padding: 8px 16px calc(32px + env(safe-area-inset-bottom));
	box-shadow: 0 -8px 32px rgba(14, 16, 15, .1); animation: rise .25s ease;
}
.sheet__grabber { width: 36px; height: 4px; border-radius: 2px; background: var(--n300); margin: 0 auto 16px; }
.sheet__form, .sheet__saved { display: flex; flex-direction: column; gap: 16px; }
.sheet__header { display: flex; align-items: center; justify-content: space-between; }
.sheet__saved { align-items: center; text-align: center; padding-top: 24px; }
.saved__tick { width: 64px; height: 64px; border-radius: 999px; background: var(--accent); color: var(--n0); display: grid; place-items: center; }
.saved__summary { color: var(--n700); }
.saved__actions { width: 100%; display: flex; flex-direction: column; gap: 4px; padding-top: 8px; }
.sheet--modal-only { align-items: stretch; }
.sheet--modal-only .sheet__panel { border-radius: 0; max-height: 100dvh; height: 100%; }
@media (min-width: 900px) {
	.sheet { align-items: center; padding: 24px; }
	.sheet__panel { width: 520px; border-radius: var(--r-lg); padding: 24px; max-height: calc(100vh - 48px); animation: pop .2s ease; box-shadow: 0 16px 48px rgba(14, 16, 15, .16); }
	.sheet__panel--wide { width: 740px; }
	.sheet__grabber { display: none; }
	.sheet--modal-only { align-items: center; }
	.sheet--modal-only .sheet__panel { height: auto; max-height: calc(100vh - 48px); border-radius: var(--r-lg); }
}
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { transform: translateY(24px); opacity: 0; } }
@keyframes pop { from { transform: scale(.97); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .sheet__scrim, .sheet__panel { animation: none; } }

/* Body check-in */
.body-form { display: flex; flex-direction: column; gap: 24px; }
.body-form__header { display: flex; justify-content: space-between; gap: 16px; align-items: flex-start; }
.body-form__header > div { display: flex; flex-direction: column; gap: 4px; }
.body-form__date { padding-bottom: 24px; border-bottom: 1px solid var(--n200); }
.body-form__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px 12px; }
.field--kcal { grid-column: 1 / -1; }
.field__helper:empty::before { content: "\00a0"; }
.body-form__actions { display: flex; gap: 12px; justify-content: flex-end; }
.body-form__note { text-align: center; margin-top: -12px; }
@media (min-width: 900px) {
	.body-form__grid { grid-template-columns: repeat(3, 1fr); gap: 20px 16px; }
	.field--kcal { grid-column: auto; }
	.sheet .body-form__date { max-width: 50%; }
}
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; margin: -8px 0 8px -4px; }
.body-page { max-width: 740px; }
/* Mobile body check-in is a focused screen: back link only, no app header or tab bar. */
.view-body-check-in .dock { display: none; }
.view-body-check-in .page { padding-top: 8px; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }
@media (max-width: 899px) { .view-body-check-in .topbar { display: none; } }
@media (min-width: 900px) {
	.body-page { margin: 0 auto; border: 1px solid var(--n200); border-radius: var(--r-lg); padding: 32px; }
	.view-body-check-in .back { display: none; }
}

/* ---------- Login ---------- */
.view-login { background: var(--n0); }
.view-login .page { padding-bottom: 32px; }
.login { min-height: calc(100dvh - 40px); display: flex; align-items: flex-start; justify-content: center; }
.login__card { width: 100%; max-width: 420px; display: flex; flex-direction: column; gap: 16px; padding-top: 24px; }
.login__intro { display: flex; flex-direction: column; gap: 8px; margin: 32px 0 8px; }
.login__intro .t-body-sm { color: var(--n700); }
.login__help { text-align: center; }
@media (min-width: 900px) {
	.view-login { background: var(--n50); }
	.login { align-items: center; }
	.login__card { background: var(--n0); border: 1px solid var(--n200); border-radius: var(--r-lg); padding: 40px; max-width: 448px; }
	.login__intro { margin-top: 24px; }
}
