/* Gym Coach: photo-first, dark by default, the yellow pin from his machines as the accent. */
@font-face { font-family: 'Barlow'; src: url(/fonts/barlow-400.woff2) format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url(/fonts/barlow-500.woff2) format('woff2'); font-weight: 500; font-display: swap; }
@font-face { font-family: 'Barlow'; src: url(/fonts/barlow-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Semi Condensed'; src: url(/fonts/barlow-sc-600.woff2) format('woff2'); font-weight: 600; font-display: swap; }
@font-face { font-family: 'Barlow Semi Condensed'; src: url(/fonts/barlow-sc-700.woff2) format('woff2'); font-weight: 700; font-display: swap; }

:root {
  --bg: #0d0f11; --bg2: #121519; --card: #171b1f; --card2: #1f2429; --line: #2b3137; --ink: #f2f1ec; --mute: #a1a8ae; --faint: #6f777e;
  --pin: #f6c500; --pin-ink: #141414; --pin-soft: rgba(246, 197, 0, .14); --pin-line: rgba(246, 197, 0, .55);
  --good: #63d395; --good-soft: rgba(99, 211, 149, .14); --bad: #ff8f86; --bad-soft: rgba(255, 143, 134, .13);
  --on-photo: #fff; --shade: rgba(8, 10, 12, .72);
  --r: 18px; --r-s: 12px; --shadow: 0 10px 28px rgba(0, 0, 0, .35);
  --head: 'Barlow Semi Condensed', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;
  --body: 'Barlow', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --tabs-h: 64px; --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: dark;
}
:root[data-theme=light] {
  --bg: #f3f2ed; --bg2: #ebe9e2; --card: #fff; --card2: #f5f4ef; --line: #dfddd5; --ink: #151617; --mute: #565b60; --faint: #858b91;
  --pin-soft: rgba(246, 197, 0, .22); --pin-line: #c99f00; --good: #17703c; --good-soft: rgba(23, 112, 60, .1); --bad: #b3261e; --bad-soft: rgba(179, 38, 30, .08);
  --shadow: 0 6px 18px rgba(20, 20, 20, .08); color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme=dark]) {
    --bg: #f3f2ed; --bg2: #ebe9e2; --card: #fff; --card2: #f5f4ef; --line: #dfddd5; --ink: #151617; --mute: #565b60; --faint: #858b91;
    --pin-soft: rgba(246, 197, 0, .22); --pin-line: #c99f00; --good: #17703c; --good-soft: rgba(23, 112, 60, .1); --bad: #b3261e; --bad-soft: rgba(179, 38, 30, .08);
    --shadow: 0 6px 18px rgba(20, 20, 20, .08); color-scheme: light;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.45 var(--body); -webkit-font-smoothing: antialiased; overscroll-behavior-y: none; }
img { display: block; max-width: 100%; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--pin); outline-offset: 2px; }
[hidden] { display: none !important; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--head); font-weight: 700; margin: 0; line-height: 1.1; letter-spacing: .2px; }
p { margin: 0; }
.mute { color: var(--mute); }
.small { font-size: 14px; }
.tiny { font-size: 13px; }
.num { font-family: var(--head); font-weight: 700; font-variant-numeric: tabular-nums; }
.lab { font-family: var(--head); font-weight: 600; font-size: 13px; letter-spacing: 1.2px; text-transform: uppercase; color: var(--mute); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- boot and login ---------- */
.bootmsg { text-align: center; color: var(--mute); padding: 40vh 20px 0; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login form { width: 100%; max-width: 360px; background: var(--card); border: 1px solid var(--line); border-radius: 24px; padding: 28px 22px; box-shadow: var(--shadow); }
.login .logo { width: 72px; height: 72px; margin: 0 auto 14px; }
.login h1 { text-align: center; font-size: 34px; margin-bottom: 20px; }
.login label { display: block; font-weight: 600; margin-bottom: 6px; }
.login .msg { min-height: 22px; margin-top: 12px; color: var(--bad); text-align: center; }

/* ---------- layout ---------- */
#app { max-width: 560px; margin: 0 auto; }
#view { padding: 12px 14px calc(var(--tabs-h) + var(--safe-b) + 96px); outline: none; min-height: 100vh; }
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 6px 2px 14px; }
.top .hello { font-family: var(--head); font-weight: 700; font-size: 26px; line-height: 1.1; }
.top .date { color: var(--mute); font-size: 15px; }
.top h1 { font-size: 30px; }
.iconbtn { width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); display: grid; place-items: center; flex: none; }
.iconbtn svg { width: 22px; height: 22px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.nowrap { flex-wrap: nowrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 12px; }

/* ---------- buttons and chips ---------- */
.btn { min-height: 48px; padding: 10px 18px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; }
.btn.main { background: var(--pin); color: var(--pin-ink); border-color: var(--pin); font-family: var(--head); font-weight: 700; font-size: 19px; letter-spacing: .4px; }
.btn.wide { width: 100%; }
.btn.ghost { background: transparent; }
.btn.danger { color: var(--bad); }
.btn:disabled { opacity: .5; cursor: default; }
.btn svg { width: 20px; height: 20px; }
.chip { min-height: 40px; padding: 7px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--card2); font-weight: 500; font-size: 15px; display: inline-flex; align-items: center; gap: 6px; }
.chip[aria-pressed=true] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip.warn { border-color: var(--pin-line); background: var(--pin-soft); }
.chip.info { cursor: default; }
.chip svg { width: 16px; height: 16px; }
.linkbtn { background: none; border: 0; padding: 4px 0; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; font-weight: 600; min-height: 32px; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; margin-top: 12px; }
.card > h3 { font-size: 21px; margin-bottom: 8px; }
.card .head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card .head h3 { font-size: 21px; }
.note { background: var(--pin-soft); border: 1px solid var(--pin-line); border-radius: var(--r-s); padding: 12px 14px; margin-top: 12px; font-size: 15px; }
.note.bad { background: var(--bad-soft); border-color: var(--bad); }
.note.good { background: var(--good-soft); border-color: var(--good); }
.banner { background: var(--card2); border: 1px solid var(--line); border-radius: var(--r-s); padding: 10px 14px; margin: 0 0 10px; font-size: 14px; }

/* ---------- photos ---------- */
.photo { position: relative; border-radius: var(--r-s); overflow: hidden; background: var(--card2); aspect-ratio: 4 / 3; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo.contain img { object-fit: contain; background: #fff; }
.badge { position: absolute; left: 8px; bottom: 8px; padding: 3px 9px; border-radius: 999px; font-size: 12.5px; font-weight: 600; background: var(--shade); color: var(--on-photo); backdrop-filter: blur(4px); display: inline-flex; align-items: center; gap: 5px; }
.badge.own::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: var(--pin); }
.nophoto { display: grid; place-items: center; color: var(--faint); font-family: var(--head); font-weight: 700; font-size: 44px; background: repeating-linear-gradient(135deg, var(--card2) 0 12px, var(--bg2) 12px 24px); }
.nophoto small { display: block; font: 500 13px/1.3 var(--body); color: var(--mute); text-align: center; padding: 0 10px; }

/* ---------- Today ---------- */
.status { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.status::-webkit-scrollbar { display: none; }
.status .chip { flex: none; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--good); display: inline-block; }
.dot.off { background: var(--faint); }
.hero { margin-top: 12px; border-radius: 24px; padding: 18px 16px 16px; background: radial-gradient(120% 90% at 100% 0%, rgba(246, 197, 0, .16), transparent 55%), linear-gradient(165deg, #222930, #14181c 70%); color: #f3f2ed; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.hero .lab { color: #b6bdc3; }
.hero h1 { font-size: 64px; letter-spacing: .5px; line-height: .95; margin: 6px 0 4px; text-transform: uppercase; }
.hero .sub { color: #c9ced2; font-size: 15px; }
.hero .btn.main { margin-top: 14px; min-height: 56px; font-size: 22px; }
.hero .chip { background: rgba(255, 255, 255, .08); border-color: rgba(255, 255, 255, .16); color: #f3f2ed; }
.strip { display: flex; gap: 10px; overflow-x: auto; margin: 16px -16px 0; padding: 0 16px 4px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.strip::-webkit-scrollbar { display: none; }
.tile { flex: none; width: 112px; scroll-snap-align: start; background: none; border: 0; padding: 0; text-align: left; color: inherit; text-decoration: none; }
.tile .photo { aspect-ratio: 4 / 5; border-radius: 14px; }
.tile .n { position: absolute; top: 6px; left: 6px; width: 24px; height: 24px; border-radius: 50%; background: var(--pin); color: var(--pin-ink); font: 700 14px/24px var(--head); text-align: center; }
.tile .t { display: block; font-size: 13.5px; font-weight: 600; line-height: 1.2; margin-top: 6px; }
.tile .w { display: block; font-size: 12.5px; color: #b6bdc3; margin-top: 2px; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; text-align: center; margin-top: 6px; }
.week .d { font-size: 12.5px; color: var(--mute); }
.week i { display: grid; place-items: center; width: 38px; height: 38px; margin: 4px auto; border-radius: 50%; font-style: normal; font: 700 16px var(--head); border: 2px solid transparent; }
.week i.s { background: var(--pin); color: var(--pin-ink); }
.week i.c { border: 2px dashed var(--mute); }
.week i.t { border-color: var(--ink); }
.week i.s.t { box-shadow: 0 0 0 2px var(--bg), 0 0 0 4px var(--ink); border-color: var(--pin); }
.week .k { font-size: 11.5px; color: var(--mute); min-height: 16px; }
.meter { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; margin: 10px 0 8px; }
.meter i { height: 10px; border-radius: 5px; background: var(--card2); border: 1px solid var(--line); }
.meter i.on { background: var(--pin); border-color: var(--pin); }
.big { font-family: var(--head); font-weight: 700; font-size: 30px; line-height: 1.05; }
.stat { display: flex; gap: 18px; flex-wrap: wrap; }
.stat div { min-width: 80px; }
.stat b { display: block; font: 700 26px/1.1 var(--head); }
.stat span { color: var(--mute); font-size: 13.5px; }

/* ---------- workout ---------- */
.wtop { position: sticky; top: 0; z-index: 5; margin: -12px -14px 0; padding: 10px 14px 8px; background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.wtop .row { flex-wrap: nowrap; }
.wtop h1 { font-size: 26px; }
.wtop .el { font: 700 24px var(--head); font-variant-numeric: tabular-nums; }
.dots { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; scrollbar-width: none; }
.dots::-webkit-scrollbar { display: none; }
.dots button { flex: none; min-width: 34px; height: 34px; padding: 0 8px; border-radius: 17px; display: grid; place-items: center; font: 700 15px var(--head); text-decoration: none; border: 1px solid var(--line); background: var(--card); color: var(--mute); }
.dots button.on { background: var(--pin); color: var(--pin-ink); border-color: var(--pin); }
.dots button.part { border-color: var(--pin-line); color: var(--ink); }
.dots button.sk { text-decoration: line-through; }
.exc { margin-top: 14px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; overflow: hidden; scroll-margin-top: 110px; }
.exc-photo { display: block; width: 100%; padding: 0; border: 0; background: none; position: relative; color: inherit; }
.exc-photo .photo { border-radius: 0; aspect-ratio: 16 / 10; }
.exc-photo .howto { position: absolute; right: 10px; bottom: 10px; padding: 7px 13px; border-radius: 999px; background: var(--pin); color: var(--pin-ink); font: 700 15px var(--head); letter-spacing: .3px; }
.exc-photo .more { position: absolute; right: 10px; top: 10px; padding: 3px 9px; border-radius: 999px; background: var(--shade); color: #fff; font-size: 12.5px; font-weight: 600; }
.exc-body { padding: 14px 14px 16px; }
.exc-title { display: flex; gap: 12px; align-items: flex-start; }
.exc-title .n { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--ink); color: var(--bg); font: 700 18px/34px var(--head); text-align: center; }
.exc-title h3 { font-size: 24px; }
.tgt { color: var(--mute); font-size: 15px; margin-top: 2px; }
.setting { margin-top: 10px; display: flex; gap: 8px; align-items: flex-start; font-size: 15px; background: var(--card2); border-radius: var(--r-s); padding: 9px 12px; }
.setting svg { width: 18px; height: 18px; flex: none; margin-top: 2px; color: var(--pin); }
.stepper { display: grid; grid-template-columns: 64px 1fr 64px; align-items: center; gap: 10px; margin-top: 14px; }
.stepper button { height: 64px; border-radius: 16px; border: 1px solid var(--line); background: var(--card2); font: 700 34px/1 var(--head); }
.stepper .v { text-align: center; }
.stepper .v b { display: block; font: 700 46px/1 var(--head); font-variant-numeric: tabular-nums; }
.stepper .v span { color: var(--mute); font-size: 14px; }
.ladder { display: flex; gap: 6px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.ladder button { min-width: 52px; min-height: 40px; padding: 4px 10px; border-radius: 10px; border: 1px solid var(--line); background: transparent; font: 600 16px var(--head); }
.ladder button[aria-pressed=true] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.why { margin-top: 10px; font-size: 15px; color: var(--mute); }
.why.up { color: var(--good); }
.ramps { margin-top: 12px; }
.ramps .row { margin-top: 6px; }
.ramp { min-height: 40px; padding: 6px 12px; border-radius: 10px; border: 1px dashed var(--faint); background: transparent; font: 600 16px var(--head); display: inline-flex; gap: 6px; align-items: center; }
.ramp[aria-pressed=true] { border-style: solid; border-color: var(--good); background: var(--good-soft); }
.ramp[aria-pressed=true]::before { content: '✓'; color: var(--good); }
.sets { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.set { min-height: 72px; border-radius: 16px; border: 2px dashed var(--line); background: var(--card2); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 13.5px; color: var(--mute); }
.set b { font: 700 30px/1 var(--head); color: var(--ink); }
.set.on { border: 2px solid var(--ink); background: var(--ink); color: var(--bg); }
.set.on b { color: var(--bg); }
.set.next { border-color: var(--pin); border-style: solid; }
.exc-actions { margin-top: 14px; }
.flag { margin-top: 10px; font-size: 15px; padding: 9px 12px; border-radius: var(--r-s); background: var(--card2); }
.flag.bad { background: var(--bad-soft); color: var(--bad); }
.exc.done .exc-sum, .exc.skip .exc-sum { display: flex; gap: 12px; align-items: center; width: 100%; padding: 10px; border: 0; background: none; text-align: left; color: inherit; }
.exc-sum .photo { width: 64px; flex: none; aspect-ratio: 1; border-radius: 12px; }
.exc-sum h3 { font-size: 19px; }
.exc-sum p { font-size: 14px; color: var(--mute); margin-top: 2px; }
.exc-sum .tick { margin-left: auto; flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--good-soft); color: var(--good); display: grid; place-items: center; font-weight: 700; }
.exc.skip { opacity: .75; }
.checks { list-style: none; padding: 0; margin: 4px 0 0; }
.checks li + li { border-top: 1px solid var(--line); }
.check { width: 100%; display: flex; gap: 12px; align-items: center; padding: 10px 0; background: none; border: 0; text-align: left; color: inherit; min-height: 56px; }
.check .box { flex: none; width: 28px; height: 28px; border-radius: 8px; border: 2px solid var(--faint); display: grid; place-items: center; }
.check[aria-pressed=true] .box { background: var(--good); border-color: var(--good); }
.check[aria-pressed=true] .box::after { content: '✓'; color: var(--bg); font-weight: 700; }
.check[aria-pressed=true] .txt { color: var(--mute); text-decoration: line-through; }
.check .thumb { flex: none; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; background: var(--card2); }
.check .thumb img { width: 100%; height: 100%; object-fit: cover; }
.check .go { margin-left: auto; flex: none; color: var(--mute); font-size: 22px; padding-left: 6px; }
details.card > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; min-height: 32px; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary h3 { font-size: 21px; }
details.card > summary::after { content: '⌄'; font-size: 22px; color: var(--mute); margin-left: 8px; }
details.card[open] > summary::after { content: '⌃'; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
label.f, p.f { display: block; font-weight: 600; font-size: 14.5px; margin: 12px 0 6px; }
input[type=text], input[type=number], input[type=date], input[type=password], textarea, select { width: 100%; min-height: 48px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg2); font-size: 17px; }
textarea { min-height: 96px; resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--faint); }

/* ---------- timer and snackbar ---------- */
.floaters { position: fixed; left: 0; right: 0; bottom: calc(var(--tabs-h) + var(--safe-b) + 8px); z-index: 30; pointer-events: none; }
.floaters > * { pointer-events: auto; max-width: 532px; margin: 8px auto 0; }
#timer { display: block; padding: 8px 10px 10px 14px; border-radius: 18px; background: #1d2328; color: #f3f2ed; box-shadow: var(--shadow); margin-left: 14px; margin-right: 14px; position: relative; overflow: hidden; }
#timer .tt { display: flex; align-items: center; gap: 12px; }
#timer .tb { display: flex; gap: 6px; margin-top: 6px; }
#timer .tb button { flex: 1; min-height: 40px; }
#timer .bar { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--pin); }
#timer .tn { font: 700 34px/1 var(--head); font-variant-numeric: tabular-nums; min-width: 82px; }
#timer .tl { font-size: 14px; color: #c3c9ce; flex: 1; line-height: 1.25; }
#timer button { min-height: 44px; padding: 6px 12px; border-radius: 12px; border: 1px solid rgba(255, 255, 255, .18); background: rgba(255, 255, 255, .06); color: inherit; font-weight: 600; }
#timer.go { background: var(--pin); color: var(--pin-ink); }
#timer.go .tl { color: var(--pin-ink); }
#timer.go button { border-color: rgba(0, 0, 0, .2); background: rgba(0, 0, 0, .06); }
#snack { display: flex; align-items: center; gap: 12px; padding: 8px 8px 8px 16px; border-radius: 14px; background: #1d2328; color: #f3f2ed; border: 1px solid #3a434b; box-shadow: var(--shadow); font-size: 15px; margin-left: 14px; margin-right: 14px; min-height: 52px; }
#snack span { flex: 1; }
#snack button { min-height: 40px; padding: 6px 14px; border: 0; border-radius: 10px; background: transparent; color: #f6c500; font: 700 16px var(--head); letter-spacing: .5px; text-transform: uppercase; }

/* ---------- tabs ---------- */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); padding-bottom: var(--safe-b); }
.tabs .in { max-width: 560px; margin: 0 auto; display: grid; grid-template-columns: repeat(5, 1fr); }
.tabs a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: var(--tabs-h); text-decoration: none; color: var(--mute); font-size: 12.5px; font-weight: 600; }
.tabs a svg { width: 24px; height: 24px; }
.tabs a[aria-current=page] { color: var(--ink); }
.tabs a[aria-current=page]::before { content: ''; position: absolute; top: 0; left: 28%; right: 28%; height: 3px; border-radius: 0 0 3px 3px; background: var(--pin); }

/* ---------- sheets ---------- */
#sheet { position: fixed; inset: 0; z-index: 60; background: rgba(0, 0, 0, .55); display: flex; align-items: flex-end; justify-content: center; }
#panel { width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; background: var(--card); border-radius: 24px 24px 0 0; padding: 10px 16px calc(18px + var(--safe-b)); outline: none; animation: rise .22s ease-out; }
#panel::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 12px; }
#panel h3 { font-size: 24px; }
#panel .actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 16px; }
#panel .actions .btn { flex: 1; }
@keyframes rise { from { transform: translateY(30px); opacity: .6; } to { transform: none; opacity: 1; } }
.pad { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin: 14px 0; }
.pad button { height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--card2); font: 700 22px var(--head); }
.pad button.tg { border: 2px solid var(--pin); background: var(--pin-soft); }
.pickb { justify-content: space-between; margin-bottom: 8px; min-height: 64px; }
.pickb b { font: 700 22px var(--head); }
.lightbox img { width: 100%; border-radius: var(--r-s); background: #fff; }

/* ---------- guide ---------- */
.segs { display: flex; gap: 8px; overflow-x: auto; margin: 0 -14px; padding: 2px 14px 6px; scrollbar-width: none; position: sticky; top: 0; z-index: 4; background: var(--bg); }
.segs::-webkit-scrollbar { display: none; }
.segs a { flex: none; min-height: 40px; padding: 8px 15px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); text-decoration: none; font-weight: 600; font-size: 15px; }
.segs a[aria-current=page] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.gintro { margin: 8px 2px 4px; color: var(--mute); font-size: 15px; }
.ggrid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.gtile { background: var(--card); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; padding: 0; text-align: left; color: inherit; text-decoration: none; display: flex; flex-direction: column; }
.gtile .photo { border-radius: 0; }
.gtile .tx { padding: 9px 11px 12px; }
.gtile b { display: block; font: 700 18px/1.15 var(--head); }
.gtile span { display: block; font-size: 13.5px; color: var(--mute); margin-top: 3px; }
.gtile .n { position: absolute; top: 8px; left: 8px; width: 26px; height: 26px; border-radius: 50%; background: var(--pin); color: var(--pin-ink); font: 700 15px/26px var(--head); text-align: center; }
.gtop { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 2px 0 10px; }
.back { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; padding: 6px 12px 6px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); font-weight: 600; text-decoration: none; }
.carousel { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: 10px; margin: 0 -14px; padding: 0 14px; scrollbar-width: none; }
.carousel::-webkit-scrollbar { display: none; }
.carousel figure { flex: none; width: 100%; margin: 0; scroll-snap-align: center; }
.carousel figure .photo { border-radius: 18px; aspect-ratio: 4 / 3; }
.swaprow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.swaprow .photo { aspect-ratio: 3 / 4; padding: 0; border: 0; display: block; width: 100%; }
.carousel figcaption { font-size: 14px; color: var(--mute); margin-top: 6px; }
.cdots { display: flex; justify-content: center; gap: 6px; margin-top: 8px; }
.cdots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.cdots i.on { background: var(--ink); }
.gname { font-size: 34px; margin-top: 14px; }
.muscles { color: var(--mute); margin-top: 2px; }
.steps { margin: 4px 0 0; padding: 0; list-style: none; counter-reset: s; }
.steps li { counter-increment: s; position: relative; padding: 8px 0 8px 42px; min-height: 40px; }
.steps li::before { content: counter(s); position: absolute; left: 0; top: 6px; width: 30px; height: 30px; border-radius: 50%; background: var(--pin); color: var(--pin-ink); font: 700 16px/30px var(--head); text-align: center; }
.mistakes { margin: 4px 0 0; padding: 0; list-style: none; }
.mistakes li { position: relative; padding: 6px 0 6px 30px; }
.mistakes li::before { content: '✕'; position: absolute; left: 4px; top: 6px; color: var(--bad); font-weight: 700; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; font-size: 15px; }
.kv dt { color: var(--mute); }
.kv dd { margin: 0; font-weight: 500; }
table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
table.t th, table.t td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t th { font-family: var(--head); font-weight: 600; color: var(--mute); font-size: 14px; }
table.t tr.now td { font-weight: 700; }
.prose p + p, .prose p + ul, .prose ul + p { margin-top: 8px; }
.prose ul { margin: 6px 0 0; padding-left: 20px; }
.prose li + li { margin-top: 4px; }

/* ---------- lists, charts, chat ---------- */
.list { list-style: none; padding: 0; margin: 0; }
.list > li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.list > li:first-child { border-top: 0; }
.list > li.stk { flex-direction: column; align-items: flex-start; gap: 2px; }
.rowb { width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: none; border: 0; padding: 0; text-align: left; color: inherit; min-height: 44px; }
.rowb .r { text-align: right; font-weight: 600; flex: none; }
.rowb .thumb { width: 44px; height: 44px; flex: none; border-radius: 10px; overflow: hidden; background: var(--card2); }
.rowb .thumb img { width: 100%; height: 100%; object-fit: cover; }
.up { color: var(--good); }
.down { color: var(--bad); }
.bars .b { display: grid; grid-template-columns: 64px 1fr 22px; align-items: center; gap: 10px; padding: 4px 0; font-size: 14px; }
.bars .t { height: 12px; border-radius: 6px; background: var(--card2); overflow: hidden; }
.bars .t i { display: block; height: 100%; background: var(--pin); border-radius: 6px; }
.chart { height: 190px; margin-top: 8px; }
.chart svg { width: 100%; height: 100%; overflow: visible; }
.c-axis { stroke: var(--line); }
.c-line { fill: none; stroke: var(--pin); stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.c-dot { fill: var(--ink); }
.c-dot.m { fill: var(--mute); }
.c-t { fill: var(--mute); font: 500 12.5px var(--body); }
.c-v { fill: var(--ink); font: 700 15px var(--head); }
.spark { width: 72px; height: 28px; flex: none; }
.spark polyline { fill: none; stroke: var(--pin); stroke-width: 2.2; stroke-linejoin: round; stroke-linecap: round; }
[dir=auto], textarea, input[type=text] { unicode-bidi: plaintext; }

@media (prefers-reduced-motion: reduce) { #panel { animation: none; } * { scroll-behavior: auto !important; } }
@media (min-width: 420px) { .hero h1 { font-size: 72px; } }
/* Samsung Health */
.c-bar { fill: var(--mute); opacity: .55; }
.c-bar.hit { fill: var(--pin); opacity: 1; }
.c-goal { stroke: var(--pin-line); stroke-width: 1.5; stroke-dasharray: 5 4; }
.c-line.thin { stroke-width: 2; }
.watch { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-s); background: var(--card2); border: 1px solid var(--line); }
.watch p { margin-top: 4px; font-size: 15px; }
.hrc { margin-top: 8px; }
.hrc svg { width: 100%; height: auto; overflow: visible; }
.prop .propi + .propi { border-top: 1px solid var(--line); margin-top: 14px; padding-top: 14px; }
.chip.yes { background: var(--pin); color: var(--pin-ink); border-color: var(--pin); font-weight: 600; }
.paircode { font: 700 30px/1.2 var(--head); letter-spacing: 2px; }
a.chip, a.btn { text-decoration: none; color: inherit; }

/* ---------- the coach everywhere (docs/mockups/coach-v2.html) ---------- */
.iconbtn.sm { width: 40px; height: 40px; text-decoration: none; font-size: 20px; }
.iconbtn.sm svg { width: 19px; height: 19px; }
.iconbtn.xs { width: 34px; height: 34px; background: transparent; color: var(--mute); font-size: 14px; }
.iconbtn:disabled { opacity: .35; cursor: default; }
.iconbtn.undo:not(:disabled) { color: var(--pin); border-color: var(--pin-line); }
:root[data-theme=light] .iconbtn.undo:not(:disabled) { color: var(--ink); }
.wtop .el.paused { color: var(--faint); }
.center { text-align: center; }
/* today's check */
.ckc .head { margin-bottom: 4px; }
.cks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 4px; }
.ck { display: flex; flex-direction: column; min-height: 80px; padding: 8px 9px 9px; border: 0; border-radius: var(--r-s); background: var(--card2); color: inherit; text-align: left; text-decoration: none; }
.ck .l { font-size: 12.5px; color: var(--mute); }
.ck .v { font: 700 21px/1.1 var(--head); margin-top: 3px; }
.ck .s { font-size: 12px; line-height: 1.25; color: var(--faint); margin-top: 3px; }
.ck.todo { box-shadow: inset 0 0 0 1.5px var(--pin-line); }
.ck.bad { box-shadow: inset 0 0 0 1.5px var(--bad); }
.ck.bad .v { color: var(--bad); }
.ck { position: relative; }
.ck.ok::after { content: '✓'; position: absolute; top: 7px; right: 9px; color: var(--good); font-weight: 700; font-size: 15px; }
.pbar { display: block; height: 5px; margin-top: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.pbar b { display: block; height: 100%; border-radius: 3px; background: var(--pin); }
.pbar.g b { background: var(--good); }
.pbar.w b { background: #4a90c2; }
.pbar.k b { background: var(--mute); }
.due { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 8px; padding: 10px 12px; border-radius: var(--r-s); background: var(--bad-soft); color: var(--bad); font-size: 14.5px; text-decoration: none; }
.due u { color: var(--ink); font-weight: 600; text-decoration: none; white-space: nowrap; }
.ckdays { margin-top: 10px; font-size: 14px; color: var(--mute); }
.ckdays b, .ckdays a { color: var(--ink); font-weight: 600; }
.wkpick { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.wkpick .chip { justify-content: center; padding: 7px 0; font-size: 14px; }
.week i.p { border: 2px solid var(--pin-line); }
.week i.x { border: 2px solid var(--bad); color: var(--bad); }
/* the chat */
.thread { display: flex; flex-direction: column; margin-top: 14px; }
.dayline { margin: 6px 0 10px; text-align: center; font-size: 12.5px; color: var(--faint); }
.msg { max-width: 88%; margin: 0 0 8px; padding: 9px 12px; border-radius: 16px; font-size: 15.5px; overflow-wrap: anywhere; }
.msg .t { display: block; margin-bottom: 3px; font-size: 12px; color: var(--faint); }
.msg .x { display: block; white-space: pre-wrap; unicode-bidi: plaintext; }
.msg.c { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-top-left-radius: 5px; }
.msg.c.firm { border-left: 3px solid var(--pin); }
.msg.me { align-self: flex-end; background: color-mix(in srgb, var(--pin) 13%, var(--card)); border: 1px solid var(--pin-line); border-top-right-radius: 5px; }
.msg.pend { opacity: .75; border-style: dashed; }
.acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.cb { min-height: 38px; padding: 6px 13px; border: 1px solid var(--line); border-radius: 999px; background: var(--card2); color: var(--ink); font: 600 14px var(--body); white-space: nowrap; display: inline-flex; align-items: center; justify-content: center; gap: 4px; }
.cb.y { background: var(--pin); color: var(--pin-ink); border-color: var(--pin); }
.cb.sm { min-height: 34px; padding: 4px 11px; font-size: 13.5px; }
.cb:disabled { opacity: .4; cursor: default; }
.picked { margin-top: 8px; font-size: 13.5px; font-weight: 600; color: var(--good); }
.cc .msg { max-width: 100%; margin: 0; }
.dock { position: sticky; bottom: calc(var(--tabs-h) + var(--safe-b)); z-index: 6; margin: 6px -14px 0; padding: 8px 14px 10px; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(8px); border-top: 1px solid var(--line); }
.dchips { display: flex; gap: 6px; margin-bottom: 8px; overflow-x: auto; scrollbar-width: none; }
.dchips::-webkit-scrollbar { display: none; }
.dchips .cb { flex: none; }
.field { display: flex; align-items: flex-end; gap: 6px; padding: 5px 5px 5px 14px; border: 1px solid var(--line); border-radius: 24px; background: var(--card); }
.field:focus-within { border-color: var(--pin-line); }
.field textarea { flex: 1; min-height: 38px; max-height: 124px; padding: 8px 0; border: 0; border-radius: 0; background: transparent; font-size: 16px; line-height: 1.35; resize: none; }
.field textarea:focus-visible { outline: none; }
.field .ic { flex: none; width: 38px; height: 38px; border: 0; border-radius: 50%; background: var(--card2); color: var(--mute); display: grid; place-items: center; }
.field .ic svg { width: 19px; height: 19px; }
.field .ic.send { background: var(--pin); color: var(--pin-ink); }
.field .ic[aria-pressed=true] { background: var(--bad); color: #fff; }
body[data-view=coach] #view { padding-bottom: calc(var(--tabs-h) + var(--safe-b)); }
body[data-view=coach] .floaters { bottom: calc(var(--tabs-h) + var(--safe-b) + 118px); }
.tabs a.new::after { content: ''; position: absolute; top: 9px; left: calc(50% + 9px); width: 10px; height: 10px; border-radius: 50%; background: var(--pin); box-shadow: 0 0 0 2px var(--bg); }
/* the ask sheet and the ask button */
.live { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; padding: 7px 11px; border-radius: 10px; background: var(--card2); font-size: 13.5px; color: var(--mute); }
.live b { color: var(--good); font-weight: 600; font-variant-numeric: tabular-nums; }
.sheetthread { max-height: 46vh; overflow-y: auto; margin: 8px 0 10px; }
.floaters > .fab { width: 56px; height: 56px; margin: 8px max(14px, calc(50% - 266px)) 0 auto; border: 0; border-radius: 50%; background: var(--pin); color: var(--pin-ink); box-shadow: var(--shadow); display: grid; place-items: center; }
.fab svg { width: 26px; height: 26px; }
.floaters > .fab.wide { width: auto; height: 52px; margin: 8px 14px 0; padding: 0 7px 0 18px; border: 1px solid var(--line); border-radius: 999px; background: var(--card); color: var(--mute); display: flex; align-items: center; gap: 10px; font-size: 15.5px; text-align: left; }
.fab.wide span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fab.wide svg { flex: none; width: 38px; height: 38px; padding: 8px; border-radius: 50%; background: var(--pin); color: var(--pin-ink); }
@media (min-width: 600px) { .floaters > .fab.wide { margin-left: auto; margin-right: auto; } }
body[data-view=workout] #view { padding-bottom: calc(var(--tabs-h) + var(--safe-b) + 150px); }
/* coaching in the workout */
.cue { margin-top: 12px; padding: 9px 12px; border-left: 3px solid var(--pin); border-radius: 0 var(--r-s) var(--r-s) 0; background: var(--card2); font-size: 15px; }
.cue .lab { display: block; margin-bottom: 2px; font-size: 12px; }
.fb { margin-top: 8px; font-size: 14.5px; color: var(--good); }
/* food */
.fx { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 12px; }
.fx:first-child { margin-top: 0; }
.fnum { font: 700 22px var(--head); }
.glasses { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; margin-top: 8px; }
.glasses i { width: 16px; height: 22px; border: 2px solid #4a90c2; border-top-width: 1px; border-radius: 2px 2px 5px 5px; }
.glasses i.f { background: #4a90c2; }
.flist { padding: 4px 12px; }
.mrow { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.mrow:first-child { border-top: 0; }
.mrow .tk { flex: none; color: var(--good); font-weight: 700; }
.mrow .mt { flex: 1; min-width: 0; padding: 0; border: 0; background: none; color: inherit; text-align: left; line-height: 1.35; }
.mrow .g { font-weight: 600; white-space: nowrap; }
.meal { display: flex; gap: 12px; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: var(--r); background: var(--card); }
.meal .tick { flex: none; width: 26px; height: 26px; margin-top: 1px; border: 2px solid var(--faint); border-radius: 50%; }
.meal .mb { flex: 1; min-width: 0; }
.meal .nm { font-weight: 600; }
.meal .what { margin-top: 2px; font-size: 14px; color: var(--mute); }
.fitems { list-style: none; margin: 10px 0 0; padding: 0; }
.fitems li { display: flex; align-items: center; gap: 6px; padding: 7px 0; border-top: 1px solid var(--line); }
.fitems li:first-child { border-top: 0; }
.fitems .fi { flex: 1; display: flex; flex-direction: column; }
.ftot { margin-top: 10px; font-size: 15.5px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* the AI coach (Claude, server/bridge.py): who answers, Claude's name on its answers, and dots while it writes */
.aist { margin: 2px 0 10px; font-size: 13px; color: var(--faint); display: flex; align-items: center; gap: 7px; }
.aist::before { content: ''; width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid var(--faint); flex: none; }
.aist.on { color: var(--good); }
.aist.on::before { background: var(--good); border-color: var(--good); box-shadow: 0 0 0 3px var(--good-soft); }
.msg .t .by { color: var(--ink); font-weight: 600; }
.msg.typing .x { display: flex; gap: 5px; padding: 5px 2px 3px; }
.msg.typing .x i { width: 7px; height: 7px; border-radius: 50%; background: var(--mute); opacity: .3; animation: gc-dot 1.2s infinite ease-in-out; }
.msg.typing .x i:nth-child(2) { animation-delay: .16s; }
.msg.typing .x i:nth-child(3) { animation-delay: .32s; }
@keyframes gc-dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: .95; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .msg.typing .x i { animation: none; opacity: .6; } }
