/* Gym720 design system, shared by the web portal and the mobile app.
   Visual reference: docs/mockups. Colours are chosen for WCAG AA contrast:
   white text only sits on --g7-green (4.6:1); lime surfaces always carry dark text. */
:root {
    --g7-green: #178a1b;          /* primary actions, positive figures (AA with white) */
    --g7-green-strong: #0f6e13;
    --g7-green-bright: #2fb52f;   /* charts, progress, dots */
    --g7-lime: #9be31f;           /* score/data CTAs, with dark text */
    --g7-lime-strong: #86cc0f;
    --g7-tint: #eaf8e0;           /* pale green highlights */
    --g7-tint-2: #f3fbec;
    --g7-ink: #0f1b2d;            /* headings */
    --g7-text: #1d2939;
    --g7-muted: #5d6878;
    --g7-bg: #f5f6f4;
    --g7-surface: #ffffff;
    --g7-border: #e6e9e4;
    --g7-amber: #f08c00;          /* below-peer bars */
    --g7-amber-text: #b45309;
    --g7-amber-tint: #fff4e5;
    --g7-blue: #2f7be8;           /* near-average bars */
    --g7-blue-text: #1d5fc4;
    --g7-blue-tint: #e8f1fe;
    --g7-red: #c62828;
    --g7-radius: 18px;
    --g7-radius-sm: 12px;
    --g7-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 6px 20px rgba(16, 24, 40, .06);
    --g7-font: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --g7-safe-top: env(safe-area-inset-top, 0px);
    --g7-safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--g7-bg); color: var(--g7-text); font-family: var(--g7-font); font-size: 16px; line-height: 1.45; -webkit-text-size-adjust: 100%; }
h1, h2, h3 { color: var(--g7-ink); line-height: 1.15; margin: 0 0 .5rem; letter-spacing: -.02em; }
h1 { font-size: 2rem; font-weight: 800; }
h2 { font-size: 1.3rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .5rem; }
a { color: var(--g7-green); font-weight: 600; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--g7-green-bright); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.muted { color: var(--g7-muted); }
.small { font-size: .875rem; }
.nowrap { white-space: nowrap; }
.skip-link { position: absolute; left: -999px; top: 0; background: var(--g7-ink); color: #fff; padding: .5rem 1rem; z-index: 100; }
.skip-link:focus { left: .5rem; top: .5rem; }
.link-arrow { display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; color: var(--g7-green); }
.link-arrow svg { width: 18px; height: 18px; }

/* ---------- Shell ---------- */
.g7-shell { overflow-x: clip; min-height: 100vh; display: grid; grid-template-columns: 248px 1fr; }
.g7-side { background: var(--g7-surface); border-right: 1px solid var(--g7-border); padding: 1.25rem .9rem; position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 1.25rem; }
.g7-logo { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.45rem; color: var(--g7-ink); letter-spacing: -.03em; text-decoration: none !important; }
.g7-logo svg { width: 30px; height: 30px; flex: none; }
.g7-nav { display: flex; flex-direction: column; gap: .3rem; }
.g7-nav a { color: var(--g7-muted); padding: .7rem .85rem; border-radius: 14px; display: flex; gap: .7rem; align-items: center; font-weight: 600; text-decoration: none; }
.g7-nav a:hover { background: var(--g7-tint-2); color: var(--g7-ink); }
.g7-nav a.active { background: var(--g7-tint); color: var(--g7-green-strong); }
.g7-nav svg { width: 22px; height: 22px; flex: none; }
.g7-side-footer { margin-top: auto; font-size: .85rem; color: var(--g7-muted); overflow-wrap: anywhere; }
.g7-side-footer button { background: none; border: 0; color: var(--g7-green); padding: .25rem 0; cursor: pointer; font-weight: 700; }
.g7-main { min-width: 0; display: flex; flex-direction: column; }
.g7-topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 2rem; position: sticky; top: 0; z-index: 10; background: rgba(245, 246, 244, .92); backdrop-filter: blur(8px); }
.g7-topbar .g7-logo { display: none; }
.g7-topbar-right { display: flex; align-items: center; gap: .75rem; margin-left: auto; min-width: 0; }
.g7-gym-switch select { border: 1px solid var(--g7-border); border-radius: 12px; padding: .5rem .7rem; background: var(--g7-surface); max-width: 240px; font-weight: 600; }
.g7-gym-name { font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--g7-ink); }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: linear-gradient(135deg, var(--g7-tint), #d4f0bd); color: var(--g7-green-strong); font-weight: 800; letter-spacing: .02em; text-decoration: none !important; border: 2px solid #fff; box-shadow: var(--g7-shadow); }
.avatar.lg { width: 84px; height: 84px; font-size: 1.8rem; }
.g7-content { padding: .5rem 2rem 2.5rem; max-width: 1120px; width: 100%; margin: 0 auto; flex: 1; }
.g7-tabs { display: none; }

@media (max-width: 899px) {
    .g7-shell { grid-template-columns: 1fr; }
    .g7-side { display: none; }
    .g7-topbar { padding: calc(.75rem + var(--g7-safe-top)) 1.1rem .6rem; }
    .g7-topbar .g7-logo { display: inline-flex; }
    .g7-content { padding: .25rem 1.1rem calc(6rem + var(--g7-safe-bottom)); }
    .g7-tabs { display: grid; grid-template-columns: repeat(4, 1fr); gap: .25rem; position: fixed; bottom: 0; left: 0; right: 0; background: var(--g7-surface); border-top: 1px solid var(--g7-border); padding: .4rem .5rem calc(.4rem + var(--g7-safe-bottom)); z-index: 20; }
    .g7-tabs a { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .45rem 0; border-radius: 16px; font-size: .78rem; color: var(--g7-muted); text-decoration: none; font-weight: 600; }
    .g7-tabs a.active { color: var(--g7-green-strong); background: var(--g7-tint); }
    .g7-tabs svg { width: 24px; height: 24px; }
    .g7-gym-switch select { max-width: 150px; }
    h1 { font-size: 1.85rem; }
}

/* ---------- Building blocks ---------- */
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: .5rem 0 1.25rem; }
.page-head h1 { margin: 0; }
.page-head p { margin: .2rem 0 0; color: var(--g7-muted); font-size: 1.05rem; }
.card { background: var(--g7-surface); border: 1px solid var(--g7-border); border-radius: var(--g7-radius); box-shadow: var(--g7-shadow); padding: 1.25rem 1.35rem; }
.card + .card { margin-top: 1rem; }
.grid > .card + .card, .hero > .card + .card, .stack > .card + .card { margin-top: 0; }
.card-tint { background: linear-gradient(135deg, #f3fbec 0%, #e6f7d8 100%); border-color: #dcefcc; }
.card h2 { display: flex; align-items: center; gap: .5rem; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; margin-bottom: .6rem; }
.card-head h2 { margin: 0; }
.stack { display: flex; flex-direction: column; gap: 1rem; }
.section-title { font-size: 1.45rem; font-weight: 800; color: var(--g7-ink); margin: 1.6rem 0 .8rem; letter-spacing: -.02em; }
.grid { display: grid; gap: 1rem; }
.grid > *, .stack > *, .hero > * { min-width: 0; }
svg.sm { width: 18px; height: 18px; flex: none; }
.owner-card .who .muted, .list-row .grow span { overflow-wrap: anywhere; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hero { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: stretch; }
@media (max-width: 899px) { .grid-2, .grid-3, .hero { grid-template-columns: 1fr; } }
@media (min-width: 600px) and (max-width: 899px) { .grid-2.tablet-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.icon-tile { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; flex: none; background: var(--g7-tint); color: var(--g7-green-strong); }
.icon-tile svg { width: 28px; height: 28px; }
.icon-tile.lg { width: 72px; height: 72px; border-radius: 20px; }
.icon-tile.lg svg { width: 40px; height: 40px; }
.icon-tile.amber { background: var(--g7-amber-tint); color: var(--g7-amber-text); }
.icon-tile.blue { background: var(--g7-blue-tint); color: var(--g7-blue-text); }
.icon-tile.grey { background: #eef0f3; color: var(--g7-muted); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; border: 1.5px solid transparent; border-radius: 14px; padding: .7rem 1.15rem; font-weight: 700; cursor: pointer; text-decoration: none !important; min-height: 48px; font-size: 1rem; }
.btn svg { width: 20px; height: 20px; flex: none; }
.btn-primary { background: var(--g7-green); color: #fff; }
.btn-primary:hover { background: var(--g7-green-strong); }
.btn-lime { background: var(--g7-lime); color: var(--g7-ink); }
.btn-lime:hover { background: var(--g7-lime-strong); }
.btn-secondary { background: var(--g7-surface); color: var(--g7-ink); border-color: #cfd5cc; }
.btn-secondary:hover { border-color: var(--g7-muted); }
.btn-outline-green { background: transparent; color: var(--g7-green-strong); border-color: var(--g7-green); }
.btn-danger { background: #fff; color: var(--g7-red); border-color: #f5c2c2; }
.btn-link { background: none; border: 0; color: var(--g7-green); padding: 0; min-height: 0; cursor: pointer; font-weight: 700; }
.btn-icon { background: var(--g7-surface); border: 1.5px solid #cfd5cc; border-radius: 12px; width: 44px; height: 44px; display: inline-grid; place-items: center; cursor: pointer; color: var(--g7-ink); padding: 0; }
.btn-icon svg { width: 22px; height: 22px; }
.btn-icon.ghost { border-color: transparent; background: transparent; }
.btn[disabled], .btn-icon[disabled] { opacity: .55; cursor: not-allowed; }
.btn-block { width: 100%; }
.btn-lg { min-height: 56px; font-size: 1.1rem; border-radius: 16px; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

.pill { display: inline-flex; align-items: center; gap: .3rem; font-size: .85rem; font-weight: 700; padding: .25rem .7rem; border-radius: 999px; background: #eef0f3; color: var(--g7-muted); white-space: nowrap; }
.pill svg { width: 16px; height: 16px; }
.pill-green, .pill-great, .pill-good { background: var(--g7-tint); color: var(--g7-green-strong); }
.pill-lime { background: #e2f8b8; color: #2f5600; }
.pill-amber, .pill-fair, .pill-warn { background: var(--g7-amber-tint); color: var(--g7-amber-text); }
.pill-blue, .pill-info { background: var(--g7-blue-tint); color: var(--g7-blue-text); }
.pill-low { background: #fde8e8; color: #9b1c1c; }
.pill-stack { display: inline-flex; flex-direction: column; align-items: center; line-height: 1.1; padding: .35rem .8rem; border-radius: 12px; background: var(--g7-tint); color: var(--g7-green-strong); font-weight: 800; }
.pill-stack.amber { background: var(--g7-amber-tint); color: var(--g7-amber-text); } .pill-stack.blue { background: var(--g7-blue-tint); color: var(--g7-blue-text); } .pill-stack.grey { background: #eef0f3; color: var(--g7-muted); }
.pill-stack span { font-size: .72rem; font-weight: 600; color: var(--g7-muted); }

.alert { border-radius: 14px; padding: .85rem 1rem; border: 1px solid; margin: 0 0 1rem; }
.alert-info { background: var(--g7-blue-tint); border-color: #c8dcfb; color: #123f7a; }
.alert-warn { background: var(--g7-amber-tint); border-color: #fbd9a5; color: #7a3d03; }
.alert-error { background: #fdecec; border-color: #f5c2c2; color: #7f1d1d; }
.alert-success { background: var(--g7-tint); border-color: #cdeab7; color: #164d17; }

.check-line { display: flex; align-items: center; gap: .55rem; margin: .8rem .25rem 0; color: var(--g7-text); font-weight: 500; }
.check-dot { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--g7-tint); color: var(--g7-green); flex: none; }
.check-dot svg { width: 16px; height: 16px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.field label, .field .label { font-weight: 600; font-size: .95rem; color: var(--g7-ink); }
.field .hint, .hint { font-size: .84rem; color: var(--g7-muted); }
.field input, .field select, .field textarea, .input { border: 1.5px solid #cfd5cc; border-radius: 12px; padding: .65rem .8rem; background: #fff; min-height: 46px; width: 100%; }
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .input[aria-invalid="true"] { border-color: var(--g7-red); box-shadow: 0 0 0 3px #fdecec; }
.error { display: block; color: var(--g7-red); font-size: .85rem; font-weight: 600; margin-top: .2rem; }
.warning { display: block; color: var(--g7-amber-text); font-size: .85rem; margin-top: .2rem; }
.check { display: flex; gap: .6rem; align-items: flex-start; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--g7-green); }
.select-pill { appearance: none; -webkit-appearance: none; border: 1.5px solid #cfd5cc; border-radius: 14px; padding: .7rem 2.6rem .7rem 1rem; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230f1b2d' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right .9rem center / 18px; font-weight: 600; min-height: 50px; width: 100%; color: var(--g7-ink); }
.select-pill.tint { background-color: var(--g7-tint); border-color: var(--g7-tint); }

.switch { position: relative; display: inline-block; width: 58px; height: 34px; flex: none; }
.switch input { opacity: 0; width: 100%; height: 100%; position: absolute; inset: 0; margin: 0; cursor: pointer; z-index: 1; }
.switch .track { position: absolute; inset: 0; border-radius: 999px; background: #cfd5cc; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 4px; left: 4px; width: 26px; height: 26px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .15s; }
.switch input:checked + .track { background: var(--g7-green-bright); }
.switch input:checked + .track::after { transform: translateX(24px); }
.switch input:focus-visible + .track { outline: 3px solid var(--g7-green-bright); outline-offset: 2px; }
.switch input:disabled + .track { opacity: .5; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: 100vh; display: flex; flex-direction: column; align-items: center; justify-content: safe center; padding: calc(1.5rem + var(--g7-safe-top)) 1rem calc(2.5rem + var(--g7-safe-bottom)); background: radial-gradient(900px 500px at 90% -10%, #e2f6d1 0%, var(--g7-bg) 60%); }
.auth-card { width: 100%; max-width: 440px; background: #fff; border-radius: 22px; padding: 2rem 1.75rem; box-shadow: 0 20px 60px rgba(16, 24, 40, .10); border: 1px solid var(--g7-border); }
.auth-card .g7-logo { margin-bottom: 1.25rem; }
.auth-card h1 { font-size: 1.6rem; }
.auth-foot { margin-top: 1.25rem; font-size: .92rem; text-align: center; }

/* ---------- Home ---------- */
.greeting h1 { font-size: 2.2rem; margin: 0; }
.greeting p { color: var(--g7-muted); font-size: 1.1rem; margin: .2rem 0 0; }
.month-card { position: relative; overflow: hidden; }
.month-card::after { content: ""; position: absolute; right: -60px; top: -40px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(155, 227, 31, .22), transparent 65%); pointer-events: none; }
.month-card .row { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 1rem; position: relative; z-index: 1; }
.month-card h2 { font-size: 1.5rem; margin: 0 0 .35rem; }
.month-card p { color: var(--g7-text); margin: .45rem 0 0; }
.score-card .score-top { display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.score-card .label { font-weight: 600; color: var(--g7-text); display: inline-flex; align-items: center; gap: .35rem; }
.score-card .label svg { width: 20px; height: 20px; color: var(--g7-muted); }
.score-body { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; margin-top: .6rem; }
.score-figure { font-size: 3.6rem; font-weight: 800; color: var(--g7-ink); letter-spacing: -.04em; line-height: 1; }
.score-figure small { font-size: 1.6rem; color: var(--g7-muted); font-weight: 600; letter-spacing: 0; }
.score-figure.green { color: var(--g7-green); }
.score-meta { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start; flex: 1; min-width: 150px; }
@media (max-width: 899px) { .g7-gym-name { display: none; } }
@media (max-width: 420px) { .score-ring { width: 128px; height: 128px; } .score-body { gap: .9rem; flex-wrap: nowrap; } .score-meta { min-width: 0; } }
.score-ring { width: 150px; height: 150px; flex: none; }
.score-ring .track { stroke: #eceee9; }
.score-ring .value-text { font-size: 46px; font-weight: 800; fill: var(--g7-ink); }
.score-ring .sub-text { font-size: 15px; fill: var(--g7-muted); font-weight: 600; }
.eyebrow { font-size: .8rem; font-weight: 800; text-transform: uppercase; letter-spacing: .12em; color: var(--g7-muted); }
.eyebrow.green { color: var(--g7-green-strong); }

.metric-list { display: flex; flex-direction: column; gap: .75rem; }
.metric-row { display: grid; grid-template-columns: auto 1fr auto; gap: 1rem; align-items: center; background: var(--g7-surface); border: 1px solid var(--g7-border); border-radius: var(--g7-radius); box-shadow: var(--g7-shadow); padding: 1rem 1.1rem; }
.metric-row .name { font-weight: 800; color: var(--g7-ink); font-size: 1.08rem; }
.metric-row .sub { color: var(--g7-muted); font-size: .92rem; }
.metric-row .delta { border-left: 1px solid var(--g7-border); padding-left: 1rem; min-width: 128px; }
.metric-row .delta strong { display: block; font-size: 1.25rem; }
.metric-row .delta span { color: var(--g7-muted); font-size: .85rem; }
.metric-row details { grid-column: 1 / -1; }
.tone-green { color: var(--g7-green); } .tone-amber { color: var(--g7-amber-text); } .tone-blue { color: var(--g7-blue-text); } .tone-muted { color: var(--g7-muted); }
@media (max-width: 520px) { .metric-row { grid-template-columns: auto 1fr; } .metric-row .delta { grid-column: 2; border-left: 0; padding-left: 0; min-width: 0; } .metric-row .delta strong { display: inline; font-size: 1.05rem; margin-right: .3rem; } }

.bar { height: 10px; background: #e9ece7; border-radius: 999px; overflow: hidden; margin-top: .45rem; }
.bar > i { display: block; height: 100%; border-radius: 999px; background: var(--g7-green-bright); }
.bar > i.amber { background: var(--g7-amber); } .bar > i.blue { background: var(--g7-blue); } .bar > i.grey { background: #c4c9c1; }

.focus-card { display: flex; gap: 1.1rem; align-items: flex-start; }
.focus-card .divider { width: 1px; align-self: stretch; background: #cfe5bd; }
.focus-card h3 { font-size: 1.2rem; margin: .25rem 0 .35rem; }

.sparkline { width: 100%; height: auto; display: block; }

/* ---------- Benchmarks ---------- */
.peer-card .peer-title { font-size: 1.4rem; font-weight: 800; color: var(--g7-ink); margin: .1rem 0 .8rem; }
.filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
@media (min-width: 900px) { .filters { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.caption { color: var(--g7-muted); font-size: .92rem; margin: .6rem .25rem 1rem; }
.bench-score { display: grid; grid-template-columns: minmax(180px, 1fr) 1.6fr; gap: 1.25rem; align-items: center; }
.bench-score .divider-v { border-left: 1px solid var(--g7-border); padding-left: 1.25rem; }
@media (max-width: 600px) { .bench-score { grid-template-columns: 1fr; } .bench-score .divider-v { border-left: 0; padding-left: 0; } }
.bell { width: 100%; height: auto; display: block; }
.bell .lbl { font-size: 13px; fill: var(--g7-text); }
.legend { display: flex; gap: 1.1rem; font-size: .88rem; color: var(--g7-text); flex-wrap: wrap; align-items: center; }
.legend .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--g7-green-bright); display: inline-block; margin-right: .35rem; vertical-align: middle; }
.legend .tick { width: 3px; height: 14px; background: var(--g7-ink); display: inline-block; margin-right: .35rem; vertical-align: middle; border-radius: 2px; }
.legend .dash { width: 22px; height: 0; border-top: 2px dashed #8a948a; display: inline-block; margin-right: .35rem; vertical-align: middle; }
.legend .line { width: 22px; height: 3px; background: var(--g7-green); display: inline-block; margin-right: .35rem; vertical-align: middle; border-radius: 2px; }
.compare-row { display: grid; grid-template-columns: minmax(0, 1.25fr) auto minmax(0, 1.4fr); gap: 1rem; align-items: center; padding: .85rem 0; border-top: 1px solid var(--g7-border); }
.compare-row .name { font-weight: 800; color: var(--g7-ink); font-size: 1.05rem; }
.compare-row .sub { color: var(--g7-text); font-size: .92rem; }
@media (max-width: 600px) { .compare-row { grid-template-columns: 1fr auto; } .compare-row .track-wrap { grid-column: 1 / -1; } }
.track { position: relative; height: 12px; border-radius: 999px; background: #eceee9; margin: .35rem 0 .3rem; }
.track .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; background: #cdeeb4; }
.track .median { position: absolute; top: -6px; width: 3px; height: 24px; margin-left: -1.5px; background: var(--g7-ink); border-radius: 2px; }
.track .you { position: absolute; top: -4px; width: 20px; height: 20px; margin-left: -10px; border-radius: 50%; background: var(--g7-green-bright); border: 3px solid #fff; box-shadow: 0 0 0 1px var(--g7-green-bright); }
.track-scale { display: flex; justify-content: space-between; font-size: .78rem; color: var(--g7-muted); }
.insight { display: flex; gap: 1.1rem; align-items: center; }
.insight .divider { width: 1px; align-self: stretch; background: #cfe5bd; }
@media (max-width: 520px) { .insight p { font-size: 1.02rem !important; } .insight .icon-tile.lg { width: 52px; height: 52px; } }
.insight p { font-size: 1.2rem; font-weight: 800; color: var(--g7-ink); margin: 0; }

/* ---------- Trends ---------- */
.segmented { display: inline-flex; background: #eceee9; border-radius: 999px; padding: 4px; gap: 4px; flex-wrap: wrap; }
.segmented button { white-space: nowrap; border: 0; background: none; padding: .55rem 1.2rem; cursor: pointer; font-weight: 700; color: var(--g7-muted); min-height: 40px; border-radius: 999px; }
.segmented button[aria-pressed="true"] { background: var(--g7-green); color: #fff; }
.segmented.full { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
.chart { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: #eceee9; }
.chart .axis { stroke: #c9cec6; }
.chart .axis-label { font-size: 12px; fill: var(--g7-muted); }
.chart .value-label { font-size: 13px; font-weight: 800; fill: var(--g7-ink); }
.chart .series { fill: none; stroke: var(--g7-green); stroke-width: 3; stroke-linejoin: round; }
.chart .area { fill: url(#g7-area); }
.chart .peer { fill: none; stroke: #8a948a; stroke-width: 1.6; stroke-dasharray: 6 5; }
.chart .peer-label { font-size: 12px; fill: var(--g7-muted); }
.chart .dot { fill: #fff; stroke: var(--g7-green); stroke-width: 2.5; }
.chart .dot.low-conf { stroke-dasharray: 2 2; }
.move-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(70px, .9fr) auto auto; gap: .9rem; align-items: center; padding: .75rem 0; border-top: 1px solid var(--g7-border); }
.move-row:first-of-type { border-top: 0; }
.move-row .name { font-weight: 800; color: var(--g7-ink); }
.move-row .chg strong { display: block; }
.move-row .chg span { font-size: .82rem; color: var(--g7-muted); }
@media (max-width: 520px) {
    .move-row { grid-template-columns: 1fr auto; grid-template-areas: "name pill" "spark chg"; row-gap: .35rem; }
    .move-row .name { grid-area: name; } .move-row .pill { grid-area: pill; justify-self: end; }
    .move-row .spark { grid-area: spark; max-width: 170px; } .move-row .chg { grid-area: chg; text-align: right; }
    .chart .axis-label, .chart .peer-label { font-size: 20px; } .chart .value-label { font-size: 22px; }
}

/* ---------- Profile ---------- */
.owner-card { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.owner-card .who { flex: 1; min-width: 160px; }
.owner-card .who h2 { font-size: 1.6rem; margin: 0; }
.gym-card .gym-row { display: flex; gap: 1.1rem; align-items: center; }
.gym-card .gym-row .divider { width: 1px; align-self: stretch; background: var(--g7-border); }
.gym-card h3 { font-size: 1.3rem; margin: 0 0 .25rem; }
.gym-facts { display: flex; gap: 1.25rem; flex-wrap: wrap; margin-top: 1rem; color: var(--g7-muted); }
.gym-facts span { display: inline-flex; align-items: center; gap: .45rem; }
.gym-facts strong { color: var(--g7-ink); }
.gym-facts svg { width: 20px; height: 20px; }
.list-row { display: flex; align-items: center; gap: .9rem; padding: .85rem 0; border-top: 1px solid var(--g7-border); color: var(--g7-text); text-decoration: none !important; }
.list-row:first-child { border-top: 0; }
.list-row > svg, .list-row .lead svg { width: 22px; height: 22px; color: var(--g7-muted); flex: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .grow strong { display: block; color: var(--g7-ink); }
.list-row .grow span { color: var(--g7-muted); font-size: .9rem; }
.list-row .value { font-weight: 800; color: var(--g7-ink); text-align: right; }
.list-row .chev { width: 20px; height: 20px; color: var(--g7-ink); }
a.list-row:hover .grow strong { text-decoration: underline; }

/* ---------- Monthly entry ---------- */
.entry-head { display: grid; grid-template-columns: 44px 1fr 44px; align-items: center; gap: .5rem; margin: .25rem 0 .75rem; }
.entry-head h1 { text-align: center; margin: 0; font-size: 1.8rem; }
.month-pick { max-width: 360px; margin: 0 auto .6rem; position: relative; }
.month-pick svg.cal { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--g7-green); pointer-events: none; }
.month-pick .select-pill { padding-left: 3rem; font-size: 1.1rem; }
.intro { text-align: center; color: var(--g7-muted); margin: 0 auto 1.1rem; max-width: 560px; }
.entry-layout { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1rem; align-items: start; }
@media (max-width: 960px) { .entry-layout { grid-template-columns: 1fr; } }
.entry-section { display: grid; grid-template-columns: 36px 1fr; gap: .25rem .9rem; }
.entry-section > svg { width: 30px; height: 30px; color: var(--g7-green); margin-top: 2px; }
.entry-section h2 { font-size: 1.3rem; margin: 0 0 .4rem; }
.entry-row { display: grid; grid-template-columns: 1fr minmax(110px, 190px); gap: .4rem .75rem; align-items: center; padding: .3rem 0; }
.entry-row label { font-weight: 500; color: var(--g7-ink); }
.entry-row .msg { grid-column: 1 / -1; }
.entry-row input { text-align: left; font-size: 1.05rem; }
@media (max-width: 340px) { .entry-row { grid-template-columns: 1fr; } }
@media (max-width: 520px) { .entry-head h1 { font-size: 1.4rem; } .entry-row { grid-template-columns: 1fr 118px; } .entry-section { grid-template-columns: 28px 1fr; gap: .25rem .6rem; } .entry-section > svg { width: 24px; height: 24px; } }
.calc-card h2 { display: flex; align-items: center; gap: .6rem; font-size: 1.3rem; }
.calc-card h2 svg { width: 28px; height: 28px; color: var(--g7-green); }
.calc-row { display: grid; grid-template-columns: 1fr minmax(120px, 46%); gap: .75rem; align-items: center; padding: .25rem 0; }
.calc-row .v { background: #dff3cb; border-radius: 10px; padding: .35rem .8rem; font-weight: 800; color: var(--g7-ink); }
.calc-row .formula { grid-column: 1 / -1; font-size: .78rem; color: var(--g7-muted); margin-top: -.2rem; }
.lock-note { display: flex; justify-content: center; align-items: center; gap: .45rem; color: var(--g7-muted); font-size: .92rem; margin-top: .7rem; text-align: center; }
.lock-note svg { width: 18px; height: 18px; flex: none; }
.sticky { position: sticky; top: 84px; }

details.definition { margin-top: .4rem; }
details.definition summary { cursor: pointer; color: var(--g7-green); font-weight: 700; font-size: .85rem; }
details.definition p { margin: .35rem 0 0; font-size: .85rem; color: var(--g7-muted); }

/* ---------- Generic ---------- */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th, .table td { text-align: left; padding: .6rem .5rem; border-bottom: 1px solid var(--g7-border); vertical-align: top; }
.table th { font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--g7-muted); }
.table-wrap { overflow-x: auto; }
.kv { display: grid; grid-template-columns: 150px 1fr; gap: .45rem 1rem; margin: 0; }
.kv dt { color: var(--g7-muted); font-weight: 600; font-size: .9rem; }
.kv dd { margin: 0; }
@media (max-width: 520px) { .kv { grid-template-columns: 1fr; } .kv dd { margin-bottom: .4rem; } }
.spinner { width: 30px; height: 30px; border: 3px solid #dfe3dc; border-top-color: var(--g7-green); border-radius: 50%; animation: g7spin .8s linear infinite; margin: 2.5rem auto; }
@keyframes g7spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation-duration: 3s; } }
.admin-nav { display: flex; gap: .4rem; flex-wrap: wrap; margin-bottom: 1rem; }
.admin-nav a { padding: .45rem .9rem; border-radius: 999px; background: #fff; border: 1px solid var(--g7-border); text-decoration: none; color: var(--g7-ink); font-weight: 600; font-size: .9rem; }
.admin-nav a.active { background: var(--g7-green); color: #fff; border-color: var(--g7-green); }
.stat { font-size: 1.9rem; font-weight: 800; color: var(--g7-ink); }
