:root {
  --bg: #f6f7fb; --surface: #fff; --surface-2: #f1f3f9; --text: #0f172a; --muted: #64748b;
  --border: #e2e8f0; --accent: #4f46e5; --accent-2: #0ea5e9; --accent-soft: #eef2ff;
  --danger: #dc2626; --success: #16a34a; --radius: 16px; --shadow: 0 1px 2px rgb(15 23 42 / .04), 0 4px 16px rgb(15 23 42 / .06);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #0b0f19; --surface: #131a2a; --surface-2: #1b2438; --text: #e5e9f2; --muted: #94a3b8;
    --border: #253047; --accent: #818cf8; --accent-2: #38bdf8; --accent-soft: #1e2350; --danger: #f87171; --success: #4ade80;
    --shadow: 0 1px 2px rgb(0 0 0 / .3), 0 8px 24px rgb(0 0 0 / .25); }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.5; font-size: 16px; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); letter-spacing: -.02em; margin: 0; line-height: 1.2; }
h2 { font-size: 1.1rem; margin: 0; letter-spacing: -.01em; }
h3 { margin: 0 0 .25rem; }
.muted { color: var(--muted); }
.small, small { font-size: .85rem; }
.center { text-align: center; }
.icon { width: 20px; height: 20px; flex: none; }

/* layout */
.container { max-width: 880px; margin: 0 auto; padding: 1.25rem 1rem 6rem; display: flex; flex-direction: column; gap: 1rem; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.grid-2 { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 640px) { .grid-2 { grid-template-columns: 1fr 2fr; } }
.page-head, .section-head, .hero { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.section-head { margin-top: .5rem; }
.hero { padding: .5rem 0; }
.hero p { margin: 0; }
.spacer { flex: 1; }

/* top bar + nav */
.topbar { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 1rem; padding: .6rem 1rem;
  background: color-mix(in srgb, var(--surface) 85%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 700; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.logo { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; font-size: .8rem; font-weight: 800;
  color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); }
.logo-lg { width: 52px; height: 52px; border-radius: 16px; font-size: 1.1rem; margin: 0 auto .5rem; }
.nav { display: flex; gap: .25rem; margin-left: auto; }
.nav a { display: flex; align-items: center; gap: .4rem; padding: .5rem .75rem; border-radius: 10px; color: var(--muted); font-weight: 500; font-size: .95rem; }
.nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nav a.active { color: var(--accent); background: var(--accent-soft); }
.userbox { display: flex; align-items: center; gap: .25rem; margin: 0; }
.avatar { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-weight: 700; }
@media (max-width: 720px) {
  .topbar { backdrop-filter: none; background: var(--surface); }
  .brand { font-size: 0; gap: 0; }
  .nav { position: fixed; bottom: 0; left: 0; right: 0; margin: 0; justify-content: space-around; padding: .4rem .5rem calc(.4rem + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(12px); border-top: 1px solid var(--border); }
  .nav a { flex-direction: column; gap: .1rem; font-size: .7rem; padding: .35rem .5rem; }
  .nav a.nav-log .icon { background: var(--accent); color: #fff; border-radius: 50%; padding: 4px; width: 28px; height: 28px; }
  .userbox { margin-left: auto; }
}

/* cards */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); }
.card-title { margin-bottom: .75rem; display: flex; align-items: baseline; gap: .5rem; }
.empty { text-align: center; padding: 2.5rem 1rem; }
.empty .btn { margin-top: .75rem; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: .75rem; }
.stat { display: flex; flex-direction: column; gap: .15rem; }
.stat-value { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-value small { font-size: .9rem; color: var(--muted); font-weight: 500; }
.stat-label { color: var(--muted); font-size: .85rem; }

/* forms */
label { display: flex; flex-direction: column; gap: .35rem; font-weight: 500; font-size: .9rem; }
input, select { font: inherit; color: var(--text); background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  padding: .65rem .8rem; min-height: 44px; width: 100%; transition: border-color .15s, box-shadow .15s; }
input:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }
input::placeholder { color: var(--muted); opacity: .8; }

/* buttons */
.btn, .btn-ghost { font: inherit; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: .4rem; border-radius: 10px;
  padding: .6rem 1rem; min-height: 44px; border: 1px solid transparent; cursor: pointer; text-decoration: none !important; transition: background .15s, transform .05s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: color-mix(in srgb, var(--accent) 88%, #000); }
.btn-secondary { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-ghost { background: transparent; color: var(--muted); border: none; }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger-ghost { background: transparent; color: var(--danger); }
.btn-danger-ghost:hover { background: color-mix(in srgb, var(--danger) 10%, transparent); }
.btn-icon { padding: .5rem; min-height: 40px; min-width: 40px; }
.btn-sm { min-height: 36px; padding: .35rem .8rem; font-size: .9rem; }
.btn-lg { padding: .75rem 1.4rem; font-size: 1.05rem; }
.btn-block { width: 100%; }
.btn-dashed { border-style: dashed; background: transparent; color: var(--accent); }
.form-actions { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; position: sticky; bottom: 0; padding: .75rem 0; background: linear-gradient(transparent, var(--bg) 30%); }
@media (max-width: 720px) { .form-actions { bottom: 64px; } }

/* toasts */
.toast { padding: .75rem 1rem; border-radius: 12px; font-weight: 500; border: 1px solid; animation: fade-in .25s ease; }
.toast-success { color: color-mix(in srgb, var(--success) 75%, var(--text)); border-color: color-mix(in srgb, var(--success) 35%, transparent); background: color-mix(in srgb, var(--success) 10%, var(--surface)); }
.toast-error { color: color-mix(in srgb, var(--danger) 80%, var(--text)); border-color: color-mix(in srgb, var(--danger) 35%, transparent); background: color-mix(in srgb, var(--danger) 10%, var(--surface)); }
@keyframes fade-in { from { opacity: 0; transform: translateY(-4px); } }

/* auth */
.auth-card { max-width: 420px; width: 100%; margin: 8vh auto 0; text-align: center; padding: 2rem 1.5rem; }
.auth-card form { text-align: left; margin-top: 1.25rem; }

/* workout cards */
.workout-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.workout-date { font-weight: 700; font-size: 1.05rem; }
.ex-summary { list-style: none; padding: 0; margin: .75rem 0 0; display: flex; flex-direction: column; gap: .6rem; }
.ex-summary li { display: flex; flex-direction: column; gap: .3rem; }
.ex-name { font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: .15rem .6rem; font-size: .85rem; font-variant-numeric: tabular-nums; }
.chip small { color: var(--muted); font-size: .75rem; margin-left: 1px; }
.notes { margin: .75rem 0 0; color: var(--muted); font-style: italic; }
.month { margin-top: .75rem; display: flex; align-items: baseline; gap: .5rem; }

/* workout editor */
.exercise-block { display: flex; flex-direction: column; gap: .6rem; animation: fade-in .2s ease; }
.exercise-head { display: flex; gap: .5rem; align-items: center; }
.ex-input { font-weight: 600; font-size: 1.05rem; }
.last-time { margin: 0; }
.sets-head, .set-row { display: grid; grid-template-columns: 2.25rem 1fr 1fr 40px; gap: .5rem; align-items: center; }
.sets-head { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }
.sets { display: flex; flex-direction: column; gap: .4rem; }
.set-no { display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--surface-2); font-weight: 600; font-size: .85rem; color: var(--muted); }
.set-row input { text-align: center; font-variant-numeric: tabular-nums; font-size: 1.05rem; }
.add-set { align-self: flex-start; color: var(--accent); }

/* progress + exercises */
.chart-wrap { position: relative; height: 300px; }
.table-card { padding: 0; overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: .7rem 1rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: .75rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
tr:last-child td { border-bottom: none; }
.add-exercise { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.add-exercise .grow { flex: 1 1 220px; }
.ex-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: .75rem; }
.plain { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .35rem; }
/* group workouts */
.grid-even { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.badge { display: inline-flex; align-items: center; vertical-align: middle; font-size: .72rem; font-weight: 600; padding: .1rem .5rem; border-radius: 999px;
  background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); letter-spacing: .02em; }
.badge-live { background: color-mix(in srgb, var(--success) 15%, transparent); color: var(--success); border-color: transparent; }
.badge-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: .35rem; animation: pulse 1.6s infinite; }
.badge-group { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.badge-gold { background: #f59e0b; color: #fff; border-color: transparent; min-width: 1.4rem; justify-content: center; }
@keyframes pulse { 50% { opacity: .35; } }
.code-input { text-transform: uppercase; letter-spacing: .3em; font-weight: 700; font-size: 1.2rem; text-align: center; }
.code-pill { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-weight: 700; letter-spacing: .15em; background: var(--surface-2); padding: .3rem .6rem; border-radius: 8px; }
.session-card { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: var(--text); }
.session-card:hover { text-decoration: none; border-color: var(--accent); }
.invite { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  background: linear-gradient(135deg, var(--accent-soft), var(--surface)); }
.big-code { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 2.2rem; font-weight: 800; letter-spacing: .25em; color: var(--accent); line-height: 1.2; }
.join-url { word-break: break-all; }
.people { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .75rem; }
.people li { display: flex; align-items: center; gap: .75rem; }
.grow { flex: 1; }
.block { display: block; }
.table-title { padding: .9rem 1rem 0; margin: 0; font-size: 1rem; }
tr.is-me td { background: var(--accent-soft); }
.plain-actions { position: static; background: none; }
@media (max-width: 420px) { .nav a { padding: .35rem .3rem; } }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
.live-banner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; color: var(--text); flex-wrap: wrap;
  border-color: color-mix(in srgb, var(--success) 40%, var(--border)); }
.live-banner:hover { text-decoration: none; }
.start-session { display: flex; gap: .75rem; align-items: flex-end; flex-wrap: wrap; }
.start-session .grow { flex: 1 1 220px; }
.ranking { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .5rem; }
.ranking li { display: flex; align-items: center; gap: .6rem; padding: .35rem .4rem; border-radius: 10px; }
.ranking li.is-me { background: var(--accent-soft); }
.rank { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; border-radius: 50%; background: var(--surface-2); font-size: .8rem; font-weight: 700; color: var(--muted); flex: none; }
.rank-1 { background: #f59e0b; color: #fff; }
.chart-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; }
.chart-head select { width: auto; min-width: 180px; }
.invite-card .big-code { margin: .25rem 0 .5rem; }
@media (max-width: 480px) { .hide-sm { display: none; } th, td { padding: .6rem .7rem; } }

/* exercise guides */
.ex-links li a { display: block; color: var(--text); padding: .15rem 0; }
.ex-links li a:hover { color: var(--accent); text-decoration: none; }
.ex-overview { display: grid; gap: 1.25rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 640px) { .ex-overview { grid-template-columns: minmax(240px, 300px) 1fr; } }
.ex-info-panel { display: flex; flex-direction: column; gap: 1rem; }
.stack-sm { display: flex; flex-direction: column; gap: .85rem; }
.label { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: .35rem; }
.chips { display: flex; flex-wrap: wrap; gap: .4rem; }
.chip { padding: .2rem .65rem; border-radius: 999px; font-size: .85rem; font-weight: 500; }
.chip-p { background: var(--accent); color: #fff; }
.chip-s { background: var(--accent-soft); color: var(--accent); }
.meta { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem 1rem; margin: 0; }
.meta dt { font-size: .75rem; color: var(--muted); }
.meta dd { margin: 0; font-weight: 500; }
.mm { --mm-base: color-mix(in srgb, var(--muted) 22%, var(--surface)); --mm-m: color-mix(in srgb, var(--muted) 38%, var(--surface));
  display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; max-width: 300px; }
.mm-fig { margin: 0; text-align: center; }
.mm-fig svg { width: 100%; height: auto; display: block; }
.mm-fig figcaption { font-size: .75rem; color: var(--muted); }
.mm path, .mm ellipse { stroke: var(--surface); stroke-width: 1.2; stroke-linejoin: round; }
.mm-base { fill: var(--mm-base); }
.mm-m { fill: var(--mm-m); }
.mm-s { fill: color-mix(in srgb, var(--accent) 45%, var(--surface)); }
.mm-p { fill: var(--accent); }
.view-photos { align-self: flex-start; }
.photos { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: .75rem; }
.photos figure { margin: 0; }
.photos img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 12px; background: var(--surface-2); display: block; }
.photos figcaption { font-size: .8rem; color: var(--muted); margin-top: .25rem; }
.steps { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: .45rem; }
.lib-filters { display: flex; flex-wrap: wrap; gap: .75rem; align-items: flex-end; }
.lib-filters .grow { flex: 1 1 200px; }
.lib-filters select { width: auto; }
.list-card { padding: .25rem 0; }
.lib-row { display: flex; align-items: center; gap: .75rem; padding: .7rem 1.1rem; border-top: 1px solid var(--border); }
.lib-row:first-child { border-top: 0; }
.lib-row a { color: var(--text); }
.lib-row a:hover { text-decoration: none; }
.lib-row a:hover strong { color: var(--accent); }
.stat-link { color: var(--accent); }
.stat-link:hover { text-decoration: none; border-color: var(--accent); }
.credit { margin-top: .5rem; }
.ex-info { color: var(--muted); }
dialog.sheet { width: min(640px, 100%); max-height: min(88vh, 900px); border: 0; padding: 1.25rem; border-radius: 20px;
  background: var(--surface); color: var(--text); box-shadow: 0 20px 60px rgb(0 0 0 / .35); }
dialog.sheet::backdrop { background: rgb(15 23 42 / .5); backdrop-filter: blur(3px); }
dialog.sheet .sheet-body { margin-bottom: 1rem; }
.sheet-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
@media (max-width: 640px) {
  dialog.sheet { margin: auto 0 0; width: 100%; max-width: 100%; border-radius: 20px 20px 0 0; padding-bottom: calc(1.25rem + env(safe-area-inset-bottom)); }
}

/* warm-ups, calories, health */
button.set-no { border: 0; cursor: pointer; font: inherit; font-weight: 600; font-size: .85rem; padding: 0; }
button.set-no:hover { background: var(--accent-soft); color: var(--accent); }
.set-row.is-warmup .set-no { background: #f59e0b; color: #fff; }
.set-row.is-warmup input { color: var(--muted); }
.chip-w { opacity: .75; border: 1px dashed color-mix(in srgb, #f59e0b 60%, transparent); }
.chip-w b { color: #d97706; font-size: .75rem; }
.badge-injury { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.injury-banner { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; color: var(--text);
  border-color: color-mix(in srgb, var(--danger) 35%, var(--border)); }
.injury-banner:hover { text-decoration: none; }
.injury-warn { margin: 0; color: var(--danger); font-weight: 500; }
.tip { margin: 0; }
.health-grid { align-items: start; }
.injury { display: block; padding: .75rem .9rem; border-radius: 12px; background: var(--surface-2); color: var(--text); margin-bottom: .5rem; }
.injury.is-active { background: color-mix(in srgb, var(--danger) 8%, var(--surface)); border: 1px solid color-mix(in srgb, var(--danger) 25%, var(--border)); }
.injury.past:hover { text-decoration: none; background: var(--accent-soft); }
.injury .notes { margin: .4rem 0; }
.injury-head { display: flex; align-items: center; gap: .5rem; }
.injury-form { border-top: 1px solid var(--border); padding-top: 1rem; }
textarea { width: 100%; font: inherit; color: inherit; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .65rem .8rem; resize: vertical; }
.weight-form { display: flex; gap: .6rem; align-items: flex-end; flex-wrap: wrap; }
.weight-form label { flex: 1 1 120px; }
.weight-list li { display: flex; align-items: center; gap: .75rem; padding: .3rem 0; border-top: 1px solid var(--border); }
.weight-list li span { flex: 1; color: var(--muted); }
a.avatar { color: inherit; }
a.avatar:hover { text-decoration: none; box-shadow: 0 0 0 2px var(--accent); }
.manage summary { cursor: pointer; font-weight: 600; color: var(--muted); }
.manage[open] { display: flex; flex-direction: column; gap: .75rem; }
.manage[open] summary { margin-bottom: .25rem; }

/* exercise measures + own guides */
.measure-row { display: flex; flex-direction: row; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); font-weight: 500; flex-wrap: wrap; }
.measure-row[hidden] { display: none; }
.measure-row select { width: auto; padding: .35rem .6rem; font-size: .9rem; }
.measure-reps .sets-head, .measure-reps .set-row, .measure-time .sets-head, .measure-time .set-row { grid-template-columns: 2.25rem 1fr 40px; }
.measure-reps .w-input, .measure-reps .h-w, .measure-time .w-input, .measure-time .h-w { display: none; }
.muscle-pick { border: 0; padding: 0; margin: 0; min-width: 0; }
.muscle-pick legend { font-weight: 600; font-size: .9rem; margin-bottom: .5rem; padding: 0; }
label.chip-check { display: inline-flex; flex-direction: row; font-weight: 400; position: relative; }
.chip-check input { position: absolute; opacity: 0; pointer-events: none; }
.chip-check span { display: inline-block; padding: .25rem .7rem; border-radius: 999px; border: 1px solid var(--border); font-size: .85rem; cursor: pointer; user-select: none; }
.chip-check input:checked + span { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-check-s input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.chip-check input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.center-actions { justify-content: center; }

/* health */
.private-note { display: inline-flex; align-items: center; gap: .35rem; margin: .25rem 0 0; }
.private-note .icon { width: 14px; height: 14px; }
.tabs { display: flex; gap: .25rem; overflow-x: auto; padding: .25rem; background: var(--surface-2); border-radius: 14px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: 1 0 auto; text-align: center; padding: .5rem .9rem; border-radius: 10px; color: var(--muted); font-weight: 600; font-size: .9rem; white-space: nowrap; }
.tabs a:hover { text-decoration: none; color: var(--text); }
.tabs a.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.health-cards { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
.hcard { display: flex; flex-direction: column; gap: .3rem; color: var(--text); }
a.hcard:hover { text-decoration: none; border-color: var(--accent); }
.trend { font-weight: 600; }
.trend.down { color: var(--success); }
.trend.up { color: #d97706; }
.g-in { color: var(--success); }
.g-low { color: var(--danger); }
.g-high { color: #d97706; }
.gpill { display: inline-grid; place-items: center; min-width: 3.4rem; padding: .3rem .5rem; border-radius: 10px; font-weight: 700; font-variant-numeric: tabular-nums; }
.gpill.g-in { background: color-mix(in srgb, var(--success) 14%, transparent); }
.gpill.g-low { background: color-mix(in srgb, var(--danger) 14%, transparent); }
.gpill.g-high { background: color-mix(in srgb, #f59e0b 18%, transparent); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: .75rem; padding: .6rem 0; border-top: 1px solid var(--border); }
.rows li:first-child { border-top: 0; }
.rows.compact li { padding: .3rem 0; }
.rows .time { font-variant-numeric: tabular-nums; min-width: 3rem; }
.form-grid { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); align-items: end; }
.form-grid .span-2 { grid-column: span 2; }
@media (max-width: 480px) { .form-grid .span-2 { grid-column: 1 / -1; } }
.section-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
.section-row .right { text-align: right; }
.small-chart { height: 220px; }
.med-card { display: flex; flex-direction: column; gap: .6rem; }
.quick-log { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .25rem; }
.day-head { font-size: .75rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: .9rem 0 .1rem; }
details.inline summary { cursor: pointer; color: var(--accent); font-size: .85rem; font-weight: 600; }
details.inline[open] { display: flex; flex-direction: column; gap: .6rem; }
@media (max-width: 480px) { .tabs a { padding: .45rem .5rem; font-size: .8rem; } }
/* meals */
.fav-grid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.fav-grid form { display: contents; }
.fav { display: flex; flex-direction: column; align-items: flex-start; gap: .15rem; text-align: left; padding: .7rem .85rem; border-radius: 12px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; }
.fav:hover { border-color: var(--accent); background: var(--accent-soft); }
label.check { display: flex; flex-direction: row; align-items: center; gap: .5rem; font-weight: 500; }
label.check input { width: auto; margin: 0; }
.day-total { display: flex; justify-content: space-between; gap: 1rem; }
.nowrap { white-space: nowrap; }
.meal-link { color: var(--accent); }
details.day > summary { list-style: none; cursor: pointer; padding: .5rem 0; border-top: 1px solid var(--border); margin: 0; }
details.day:first-of-type > summary { border-top: 0; }
details.day > summary::-webkit-details-marker { display: none; }
details.day > summary span:first-child::before { content: "▸ "; }
details.day[open] > summary span:first-child::before { content: "▾ "; }

/* activities (duration-based) */
.k-input, .h-k { display: none; }
.measure-activity .k-input, .measure-activity .h-k { display: block; }
.measure-activity .sets-head, .measure-activity .set-row { grid-template-columns: 2.25rem 1fr 1fr 1fr 40px; }
.measure-activity .r-input, .measure-activity .h-r { order: 1; }
.measure-activity .w-input, .measure-activity .h-w { order: 2; }
.measure-activity .k-input, .measure-activity .h-k { order: 3; }
.measure-activity .remove-set, .measure-activity .h-x { order: 4; }
.effort-row { display: flex; flex-direction: row; align-items: center; gap: .5rem; font-size: .85rem; color: var(--muted); font-weight: 500; }
.effort-row[hidden] { display: none; }
.effort-row select { width: auto; padding: .35rem .6rem; font-size: .9rem; }
.span-all { grid-column: 1 / -1; }
a.btn-icon { display: inline-grid; place-items: center; color: var(--muted); }
a.btn-icon:hover { color: var(--accent); text-decoration: none; }
