@font-face { font-family: Heebo; font-weight: 400; src: url(/fonts/heebo-400.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: Heebo; font-weight: 500; src: url(/fonts/heebo-500.ttf) format('truetype'); font-display: swap; }
@font-face { font-family: Heebo; font-weight: 700; src: url(/fonts/heebo-700.ttf) format('truetype'); font-display: swap; }

:root {
  --bg: #0d0d0d; --surface: #181818; --surface2: #222; --line: #2d2d2d;
  --gold: #d4af37; --gold-soft: #b8932b; --gold-text: #e6c768;
  --text: #f2efe6; --muted: #a39d8c; --danger: #e07a6a; --ok: #7fc58d;
  --radius: 16px; --nav-h: 64px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: Heebo, 'Segoe UI', Arial, sans-serif; font-size: 16px; line-height: 1.6; }
body { min-height: 100vh; min-height: 100dvh; padding-top: env(safe-area-inset-top); }
h1, h2, h3 { margin: 0 0 .4em; line-height: 1.25; text-wrap: balance; }
h1 { font-size: 1.6rem; } h2 { font-size: 1.2rem; } h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; text-wrap: pretty; }
a { color: var(--gold-text); }
.muted { color: var(--muted); } .small { font-size: .86rem; }
.gold { color: var(--gold-text); }
.center { text-align: center; }
.balance { text-wrap: balance; }

/* layout */
.shell { max-width: 760px; margin: 0 auto; padding: 18px 16px calc(var(--nav-h) + 34px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 14px; }
.topbar img { height: 44px; }
.topbar .who { font-size: .9rem; color: var(--muted); }
.page-title { margin: 6px 0 16px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; }
.card.gold-edge { border-color: var(--gold-soft); background: linear-gradient(160deg, #1e1b12, var(--surface) 60%); }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.grid2 .card { margin: 0; }
.row { display: flex; gap: 10px; align-items: center; }
.row.between { justify-content: space-between; }
.row.wrap { flex-wrap: wrap; }
.stack > * + * { margin-top: 12px; }

.stat { display: flex; flex-direction: column; gap: 2px; }
.stat .v { font-size: 1.7rem; font-weight: 700; color: var(--gold-text); line-height: 1.15; }
.stat .l { font-size: .85rem; color: var(--muted); }

/* buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid var(--gold); background: linear-gradient(135deg, #e6c768, #b8932b); color: #14110a; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--gold-text); }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: .9rem; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: default; }
label { display: block; font-size: .9rem; color: var(--muted); margin-bottom: 4px; }
input, select, textarea { width: 100%; min-height: 46px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); font: inherit; }
textarea { min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--gold-soft); outline-offset: 1px; }
input[type=file] { padding: 9px 10px; }
.field { margin-bottom: 12px; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--text); }
.check input { width: 20px; min-height: 20px; margin-top: 4px; accent-color: var(--gold); flex: none; }
.err { background: #2a1613; border: 1px solid #5c2b24; color: #f1b3a8; padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; }
.note { background: #1c1a10; border: 1px solid #4a3f17; color: var(--gold-text); padding: 10px 14px; border-radius: 12px; margin-bottom: 12px; font-size: .92rem; }
.badge { display: inline-block; padding: 1px 10px; border-radius: 999px; font-size: .78rem; border: 1px solid var(--line); color: var(--muted); }
.badge.gold { border-color: var(--gold-soft); color: var(--gold-text); }
.badge.dot { background: var(--gold); color: #14110a; border-color: var(--gold); font-weight: 700; }

/* nav */
.nav { position: fixed; inset-inline: 0; bottom: 0; z-index: 10; display: flex; justify-content: space-around; background: rgba(13,13,13,.96); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(8px); }
.nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 4px 2px; color: var(--muted); text-decoration: none; font-size: .72rem; position: relative; }
.nav a svg { width: 24px; height: 24px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.nav a.on { color: var(--gold-text); }
.nav .pip { position: absolute; top: 2px; inset-inline-start: 50%; margin-inline-start: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--gold); }

/* lists */
.list { list-style: none; margin: 0; padding: 0; }
.list li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.list li:last-child { border-bottom: 0; }
.list .t { min-width: 0; }
.list .t b { display: block; overflow-wrap: anywhere; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 12px; }
.chip { flex: none; padding: 6px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font: inherit; font-size: .88rem; cursor: pointer; }
.chip.on { border-color: var(--gold); color: var(--gold-text); }

/* chat */
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 52vh; overflow-y: auto; padding: 4px 0; }
.bubble { max-width: 84%; padding: 9px 14px; border-radius: 16px; background: var(--surface2); white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.mine { align-self: flex-start; background: #2a2412; border: 1px solid #4a3f17; }
.bubble.theirs { align-self: flex-end; }
.bubble time { display: block; font-size: .72rem; color: var(--muted); margin-top: 2px; }

/* chart */
.chart { width: 100%; height: auto; direction: ltr; display: block; }
.chart text { fill: var(--muted); font-size: 11px; font-family: Heebo, Arial, sans-serif; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .line { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .goal { stroke: var(--ok); stroke-dasharray: 5 5; stroke-width: 1.5; }
.chart .pt { fill: var(--bg); stroke: var(--gold); stroke-width: 2; }
.progress { height: 10px; background: var(--surface2); border-radius: 99px; overflow: hidden; }
.progress i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold-soft), var(--gold-text)); border-radius: 99px; }

.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photos img { width: 100%; aspect-ratio: 3/4; object-fit: cover; border-radius: 12px; background: var(--surface2); }

.prose p { white-space: pre-line; }
.foot { margin-top: 26px; text-align: center; font-size: .82rem; color: var(--muted); }
.foot { text-wrap: balance; }
.foot .bl { display: block; margin-bottom: 6px; }
.foot b { color: var(--text); }

/* auth screens */
.auth { max-width: 420px; margin: 0 auto; padding: 28px 18px 40px; min-height: 100dvh; display: flex; flex-direction: column; justify-content: center; }
.auth .logo { width: min(260px, 72%); margin: 0 auto 18px; display: block; }
.auth h1 { text-align: center; }
.auth .sub { text-align: center; color: var(--muted); margin-bottom: 22px; }

.modal-back { position: fixed; inset: 0; z-index: 30; background: rgba(0,0,0,.7); display: flex; align-items: flex-end; justify-content: center; }
.modal { width: 100%; max-width: 560px; max-height: 92dvh; overflow-y: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 22px 22px 0 0; padding: 20px 18px calc(24px + env(safe-area-inset-bottom)); }
.linkbox { direction: ltr; text-align: left; word-break: break-all; background: var(--surface2); border: 1px dashed var(--gold-soft); padding: 10px 12px; border-radius: 12px; font-size: .85rem; user-select: all; }
.skeleton { color: var(--muted); padding: 40px 0; text-align: center; }

@media (min-width: 900px) {
  .shell { max-width: 980px; padding-bottom: 60px; padding-top: 80px; }
  .nav { inset-block: 0 auto; top: 0; bottom: auto; border-top: 0; border-bottom: 1px solid var(--line); justify-content: center; gap: 8px; padding: 8px 20px; }
  .nav a { flex: none; flex-direction: row; gap: 8px; font-size: .95rem; padding: 8px 16px; }
  .nav a svg { width: 20px; height: 20px; }
  .nav .pip { position: static; margin: 0; }
  .photos { grid-template-columns: repeat(5, 1fr); }
  .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; align-items: start; }
  .cols > .card { margin: 0; }
  .modal-back { align-items: center; } .modal { border-radius: 22px; }
}
@media (prefers-reduced-motion: no-preference) { .btn { transition: transform .1s; } }

.tbl { width: 100%; border-collapse: collapse; font-size: .9rem; }
.tbl th, .tbl td { text-align: start; padding: 8px 6px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th { color: var(--muted); font-weight: 500; }

.bl { display: block; text-wrap: balance; margin-bottom: 4px; }
input[type=range] { padding: 0; accent-color: var(--gold); background: transparent; border: 0; }

/* ===================== premium refresh (2026-11-18) ===================== */
:root {
  --bg: #0a0a0b; --surface: #141416; --surface2: #1c1c20; --line: #2a2a2f; --line-gold: rgba(212,175,55,.28);
  --gold: #d4af37; --gold-soft: #b8932b; --gold-text: #ecd27e; --gold-grad: linear-gradient(135deg, #f6e39d 0%, #d4af37 45%, #a87f22 100%);
  --text: #f4f1e8; --muted: #9d978a; --radius: 20px; --shadow: 0 10px 30px rgba(0,0,0,.45);
}
body { background: radial-gradient(1200px 600px at 85% -10%, rgba(212,175,55,.13), transparent 60%), radial-gradient(900px 500px at -10% 10%, rgba(212,175,55,.06), transparent 60%), var(--bg); background-attachment: fixed; }
h1 { font-size: 1.75rem; letter-spacing: -.01em; } h2 { font-size: 1.18rem; letter-spacing: -.005em; }
.page-title { font-size: 1.85rem; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.card { background: linear-gradient(180deg, rgba(255,255,255,.025), rgba(255,255,255,0)), var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card.gold-edge { border-color: var(--line-gold); background: radial-gradient(500px 200px at 100% 0, rgba(212,175,55,.12), transparent 70%), var(--surface); }
.btn { background: var(--gold-grad); border: 0; box-shadow: 0 6px 18px rgba(212,175,55,.22), inset 0 1px 0 rgba(255,255,255,.35); letter-spacing: .01em; }
.btn.ghost { background: transparent; border: 1px solid var(--line-gold); box-shadow: none; }
.btn.danger { box-shadow: none; border: 1px solid var(--danger); }
.btn .ic { width: 18px; height: 18px; }
.btn { white-space: nowrap; }
.ic { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; flex: none; }
input, select, textarea { background: #101012; border-color: var(--line); border-radius: 14px; }
.chip { background: #111113; }
.chip.on { background: rgba(212,175,55,.12); border-color: var(--gold); color: var(--gold-text); }
.chips.seg { background: #101012; border: 1px solid var(--line); border-radius: 999px; padding: 4px; display: inline-flex; gap: 4px; max-width: 100%; }
.chips.seg .chip { border: 0; background: transparent; }
.chips.seg .chip.on { background: var(--gold-grad); color: #14110a; font-weight: 700; }
.eyebrow { display: block; font-size: .78rem; letter-spacing: .06em; color: var(--gold-text); margin: 0 0 4px; }
.topbar img { height: 46px; filter: drop-shadow(0 2px 10px rgba(212,175,55,.25)); }
.topbar .who { color: var(--gold-text); text-decoration: none; border: 1px solid var(--line-gold); padding: 4px 12px; border-radius: 999px; }

/* hero */
.hero { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 22px 20px; margin-bottom: 14px; border-radius: 26px; overflow: hidden;
  background: radial-gradient(420px 220px at 100% 0%, rgba(212,175,55,.22), transparent 70%), linear-gradient(160deg, #1b1810, #121214 70%); border: 1px solid var(--line-gold); box-shadow: var(--shadow); }
.hero h1 { font-size: 1.9rem; margin: 0 0 14px; }
.hero-stats { display: flex; gap: 18px; flex-wrap: wrap; }
.hero-stats .v { font-size: 1.45rem; }
.ring-wrap { position: relative; width: 118px; height: 118px; flex: none; }
.ring { width: 100%; height: 100%; display: block; }
.ring-bg { fill: none; stroke: rgba(255,255,255,.07); stroke-width: 9; }
.ring-fg { fill: none; stroke: url(#rg); stroke-width: 9; stroke-linecap: round; }
.ring-label { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.ring-label b { font-size: 1.5rem; color: var(--gold-text); line-height: 1; }
.ring-label span { font-size: .75rem; color: var(--muted); }

/* quick action tiles */
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px 12px; border-radius: 18px; text-decoration: none; color: var(--text);
  background: linear-gradient(180deg, rgba(255,255,255,.03), transparent), var(--surface); border: 1px solid var(--line); min-height: 112px; transition: border-color .2s, transform .15s; }
.tile b { font-size: .95rem; line-height: 1.25; }
.tile .small { font-size: .76rem; line-height: 1.3; }
.tile:hover, .tile:focus-visible { border-color: var(--line-gold); }
.tile:active { transform: scale(.98); }
.tile-ic { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 13px; background: rgba(212,175,55,.12); color: var(--gold-text); border: 1px solid var(--line-gold); flex: none; }
.tile-ic.sm { width: 26px; height: 26px; border-radius: 9px; }
.tile-ic.sm .ic { width: 15px; height: 15px; }
.docs { margin-bottom: 14px; }
.grid2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card.doc { padding: 14px 12px; min-width: 0; }
.card.doc > div { min-width: 0; }
.card.doc h3 { font-size: .98rem; }
.tile b { white-space: nowrap; font-size: clamp(.8rem, 3.5vw, .95rem); }
.tile .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-size: clamp(.68rem, 2.9vw, .78rem); }
.tile { min-height: 104px; padding: 12px 10px; }
.card.doc { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); margin: 0; }

/* steps */
.steps-card .steps-n { display: block; font-size: 2.4rem; font-weight: 700; margin-top: 10px; background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent; line-height: 1.1; }
.steps-card.live { border-color: var(--line-gold); }
.steps-card.live .tile-ic { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { box-shadow: 0 0 0 7px rgba(212,175,55,.12); } }

/* media */
.vid { width: 100%; border-radius: 16px; background: #000; display: block; margin: 10px 0; max-height: 70vh; }
.vid-box { margin-top: 6px; }
.card.bc { border-color: var(--line-gold); }

/* guides */
.guide-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.card.guide { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); margin: 0; }
.card.guide b { display: block; }
details.how summary { cursor: pointer; color: var(--gold-text); margin: 8px 0; }

/* workout session */
.ex-card .row.between { align-items: flex-start; }
.sets { margin: 10px 0 8px; }
.set-row { display: grid; grid-template-columns: 30px 1fr 1fr 44px; gap: 8px; align-items: end; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.set-no { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface2); color: var(--gold-text); font-weight: 700; align-self: center; }
.set-f { margin: 0; } .set-f span { display: block; font-size: .74rem; color: var(--muted); }
.set-f input { min-height: 44px; text-align: center; }
.set-done { width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line-gold); background: transparent; color: var(--gold-text); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.set-done.on { background: var(--gold-grad); color: #14110a; border-color: transparent; }
.set-prev { grid-column: 2 / -1; font-size: .76rem; color: var(--muted); }
input::placeholder { color: #6f6a60; }
.rest { position: fixed; z-index: 20; inset-inline: 16px; bottom: calc(var(--nav-h) + 16px + env(safe-area-inset-bottom)); display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px; border-radius: 18px; background: rgba(20,18,12,.96); border: 1px solid var(--gold); box-shadow: var(--shadow); backdrop-filter: blur(10px); max-width: 560px; margin: 0 auto; }
.rest[hidden] { display: none; }
.rest b { font-size: 1.6rem; color: var(--gold-text); font-variant-numeric: tabular-nums; }

/* technique feedback */
.fixes { margin: 0 0 10px; padding-inline-start: 20px; }
.fixes li { margin-bottom: 10px; } .fixes li b { display: block; } .fixes li span { color: var(--muted); }
.list.good li { justify-content: flex-start; padding: 8px 0; }
.steps-list { padding-inline-start: 20px; margin: 0 0 12px; } .steps-list li { margin-bottom: 6px; }

/* install */
.btn.install .ic { width: 18px; height: 18px; }
.btn.install[hidden] { display: none; }
.top-install { width: 100%; margin-bottom: 12px; background: transparent; color: var(--gold-text); border: 1px dashed var(--line-gold); box-shadow: none; }
.login-install { margin-top: 14px; }

/* nav polish */
.nav { background: rgba(10,10,11,.88); backdrop-filter: blur(14px) saturate(140%); border-top: 1px solid rgba(212,175,55,.14); }
.nav a.on svg { filter: drop-shadow(0 0 6px rgba(212,175,55,.45)); }

/* motion */
@media (prefers-reduced-motion: no-preference) {
  .shell > *:not(.topbar) { animation: rise .35s ease-out backwards; }
  @keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
}

@media (max-width: 430px) {
  .hero { padding: 18px 16px; gap: 10px; }
  .hero h1 { font-size: 1.6rem; margin-bottom: 10px; }
  .hero-stats { gap: 12px; } .hero-stats .v { font-size: 1.2rem; } .hero-stats .l { font-size: .74rem; }
  .ring-wrap { width: 92px; height: 92px; } .ring-label b { font-size: 1.15rem; }
}
@media (max-width: 340px) {
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { flex-direction: column; align-items: flex-start; }
  .ring-wrap { align-self: center; }
}
@media (min-width: 900px) { .tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
@media (min-width: 900px) {
  .tiles { grid-template-columns: repeat(5, 1fr); }
  .guide-grid { grid-template-columns: 1fr 1fr; }
  .nav a.on { background: rgba(212,175,55,.1); border-radius: 999px; }
  .rest { bottom: 24px; }
  .hero { padding: 30px 32px; } .hero h1 { font-size: 2.3rem; }
  .ring-wrap { width: 140px; height: 140px; }
}

/* cartoon exercise demos */
.anim { position: relative; border-radius: 18px; overflow: hidden; border: 1px solid var(--line-gold); background: radial-gradient(260px 160px at 70% 0%, rgba(212,175,55,.12), transparent 70%), #0e0e10; margin: 8px 0; }
.anim svg { display: block; width: 100%; height: auto; max-height: 300px; }
.anim-badge { position: absolute; inset-block-start: 8px; inset-inline-start: 10px; font-size: .72rem; color: var(--gold-text); border: 1px solid var(--line-gold); border-radius: 999px; padding: 0 10px; background: rgba(10,10,11,.7); }
.anim-cap { padding: 10px 14px 12px; border-top: 1px solid var(--line); text-align: center; min-height: 64px; }
.anim-cap b { display: block; color: var(--gold-text); }
.anim-cap span { font-size: .86rem; color: var(--muted); text-wrap: balance; }

/* ---- merged from the parallel build (19.11): password eye, camera, donuts, accordions, exercise video ---- */
.namelink { background: none; border: 0; padding: 0; font: inherit; font-weight: 700; color: var(--gold-text); text-align: start; cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 4px; overflow-wrap: anywhere; }
.video-wrap { position: relative; width: 100%; aspect-ratio: 9 / 16; max-height: 62vh; border-radius: 14px; overflow: hidden; background: #000; margin: 0 auto; }
.video-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.t .namelink { display: block; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-inline-end: 52px; }
.pw-eye { position: absolute; inset-inline-end: 4px; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; background: none; border: 0; color: var(--muted); cursor: pointer; border-radius: 12px; }
.pw-eye:hover, .pw-eye[aria-pressed=true] { color: var(--gold-text); }
.pw-eye svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.camera-btn { width: 100%; min-height: 120px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 22px; background: linear-gradient(135deg, #e6c768, #b8932b); color: #14110a; font: inherit; font-weight: 700; font-size: 1.15rem; cursor: pointer; }
.camera-btn:active { transform: scale(.985); }
.camera-btn[disabled] { opacity: .65; cursor: default; }
.camera-btn .cam-ico { width: 46px; height: 46px; fill: none; stroke: #14110a; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (prefers-reduced-motion: no-preference) { .camera-btn.busy { animation: camPulse 1.2s ease-in-out infinite; } }
@keyframes camPulse { 50% { opacity: .55; } }
.donut { width: 96px; height: 96px; display: block; margin: 0 auto 6px; }
.donut.big { width: 132px; height: 132px; margin: 0; flex: none; }
.donut-track { fill: none; stroke: var(--surface2); stroke-width: 12; }
.donut-arc { fill: none; stroke: var(--gold); stroke-width: 12; stroke-linecap: round; transition: stroke-dasharray .6s; }
.donut-arc.over { stroke: var(--danger); }
.donut-pct { fill: var(--text); font-size: 17px; font-weight: 700; font-family: Heebo, Arial, sans-serif; }
.don-main { display: flex; align-items: center; gap: 16px; margin-bottom: 14px; }
.don-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; text-align: center; }
.don-item { display: flex; flex-direction: column; gap: 2px; align-items: center; }
.acc > summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; cursor: pointer; font-weight: 700; list-style: none; padding: 12px 0; min-height: 48px; }
.acc > summary::-webkit-details-marker { display: none; }
.acc > summary::after { content: ''; width: 9px; height: 9px; border-inline-end: 2px solid var(--gold-text); border-bottom: 2px solid var(--gold-text); transform: rotate(45deg); flex: none; transition: transform .2s; margin-inline-start: 4px; }
.acc[open] > summary::after { transform: rotate(-135deg); }
.acc > summary > span:first-child { flex: 1; }
.acc-main { padding-top: 4px; padding-bottom: 4px; }
.acc-venue { border-top: 1px solid var(--line); }
.acc-venue > summary { font-size: 1.05rem; }
.acc-plan { margin-inline-start: 10px; padding-inline-start: 12px; border-inline-start: 2px solid var(--gold-soft); margin-bottom: 8px; }
.acc-plan > summary { font-weight: 500; }
.cam-mini { gap: 6px; }
.cam-mini .cam-ico { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.set-no.warm { width: auto; min-width: 30px; padding: 0 8px; border-radius: 15px; font-size: .78rem; }
.set-row { grid-template-columns: auto 1fr 1fr 44px; }

/* WhatsApp link */
.wa-link { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 16px; border-radius: 999px; border: 1px solid var(--gold-soft); color: var(--gold-text); text-decoration: none; font-weight: 500; }
.wa-link .ic, .wa-btn .ic { width: 20px; height: 20px; fill: currentColor; }
.wa-btn { display: inline-flex; align-items: center; gap: 8px; text-decoration: none; }

/* assistant */
.bubble.typing { color: var(--muted); font-style: italic; }

/* food scan */
.scan-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 14px; }
.scan-pair .camera-btn { min-height: 130px; }
.camera-btn small { font-weight: 500; font-size: .78rem; opacity: .85; text-wrap: balance; padding: 0 8px; }
.camera-btn.alt { background: var(--surface2); color: var(--gold-text); border: 1px solid var(--gold-soft); margin-bottom: 10px; }
.scan-pair .camera-btn.alt { margin-bottom: 0; }
.camera-btn.alt .cam-ico { stroke: var(--gold-text); }
.scan-frame { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 4 / 3; }
.scan-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-line { position: absolute; inset: 22% 10%; border: 2px solid var(--gold); border-radius: 12px; box-shadow: 0 0 0 999px rgba(0,0,0,.35); }
@media (prefers-reduced-motion: no-preference) { .scan-line::after { content: ''; position: absolute; left: 6%; right: 6%; height: 2px; background: var(--gold); top: 50%; animation: scanY 1.6s ease-in-out infinite alternate; } }
@keyframes scanY { from { top: 12%; } to { top: 88%; } }

/* body scan */
.checks { margin: 0 0 12px; padding-inline-start: 20px; }
.checks li { margin-bottom: 4px; text-wrap: pretty; }
.cap-stage { position: relative; border-radius: 16px; overflow: hidden; background: #000; aspect-ratio: 3 / 4; max-height: 62vh; margin: 0 auto; width: 100%; }
.cap-video { width: 100%; height: 100%; object-fit: cover; display: block; }
.cap-video.mirror { transform: scaleX(-1); }
.scan-sil { position: absolute; inset: 6% 0; width: 100%; height: 88%; fill: none; stroke: rgba(230,199,104,.7); stroke-width: 1.2; stroke-dasharray: 3 2; pointer-events: none; }
.cap-count { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 5rem; font-weight: 700; color: var(--gold-text); text-shadow: 0 2px 12px #000; pointer-events: none; }
.cap-step { position: absolute; left: 0; right: 0; bottom: 0; padding: 10px 14px; background: rgba(0,0,0,.65); color: var(--text); font-weight: 500; text-align: center; text-wrap: balance; }
.cap-step:empty { display: none; }
.cap-stage.flash::after { content: ''; position: absolute; inset: 0; background: #fff; opacity: .7; }
.scan-thumbs, .scan-compare { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.scan-compare { grid-template-columns: repeat(2, 1fr); margin-top: 10px; }
.scan-thumbs figure, .scan-compare figure { margin: 0; text-align: center; }
.scan-thumbs img, .scan-compare img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 12px; background: #000; }
.scan-thumbs figcaption, .scan-compare figcaption { font-size: .82rem; color: var(--muted); margin-top: 4px; }
.stat .v.good { color: var(--ok); }
.tbl td.dir-down.fat, .tbl td.dir-up.mus { color: var(--ok); }
.tbl td.dir-up.fat, .tbl td.dir-down.mus { color: var(--danger); }
.tbl td.dir-na { color: var(--muted); }
.tbl td.small { white-space: normal; min-width: 140px; }

/* workout: previous session */
.last-box { background: var(--surface2); border-radius: 12px; padding: 8px 12px; margin: 6px 0 10px; font-size: .9rem; }
.last-box .bl { display: block; color: var(--gold-text); margin-top: 4px; }
.scan-tbl td { white-space: normal; vertical-align: top; }
.scan-tbl td:first-child { width: 58%; }
.scan-tbl td .bl { display: block; margin-top: 2px; text-wrap: pretty; }
.nw { white-space: nowrap; }

/* in-app document viewer */
.no-scroll { overflow: hidden; }
.doc-view { position: fixed; inset: 0; z-index: 50; background: var(--bg); display: flex; flex-direction: column; }
.doc-bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; padding-top: max(10px, env(safe-area-inset-top)); border-bottom: 1px solid var(--line); background: var(--surface); }
.doc-x { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--line-gold, var(--gold)); background: var(--surface2); color: var(--gold-text); font: inherit; font-weight: 700; cursor: pointer; flex: none; }
.doc-x svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.doc-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-ext { color: var(--gold-text); white-space: nowrap; }
.doc-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 8px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.doc-page { width: 100%; max-width: 1000px; height: auto; background: #fff; border-radius: 6px; box-shadow: var(--shadow); }
.doc-img { max-width: 100%; max-height: 100%; border-radius: 12px; }
@media (max-width: 480px) { .doc-ext { display: none; } }

/* warm-up guide: no disclosure arrow, reads as a gold link */
.warm > summary { list-style: none; cursor: pointer; font-weight: 700; color: var(--gold-text); }
.warm > summary::-webkit-details-marker { display: none; }
.warm > summary::marker { content: ''; }
.warm.card > summary { font-size: 1.1rem; color: var(--text); }
.warm.flat { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }

/* food diary */
.food-results { display: flex; flex-direction: column; gap: 6px; max-height: 210px; overflow: auto; }
.food-opt { display: flex; justify-content: space-between; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); color: var(--text); font: inherit; text-align: start; cursor: pointer; }
.food-opt:hover, .food-opt:focus-visible { border-color: var(--gold); }
.sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* scan polish: bigger tap targets, no lone tile on the last row */
.namelink { padding: 8px 0; }
.chip { min-height: 38px; display: inline-flex; align-items: center; }
@media (min-width: 341px) and (max-width: 899px) {
  .tiles > .tile:last-child:nth-child(3n+1) { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 12px; min-height: 0; }
}

/* home: today's diary card */
.day-card { display: block; text-decoration: none; color: var(--text); }
.mini-bar { height: 8px; border-radius: 99px; background: var(--surface2); overflow: hidden; margin-top: 4px; }
.mini-bar i { display: block; height: 100%; border-radius: 99px; background: var(--gold-grad, var(--gold)); }
.mini-bar i.over { background: var(--danger, #e07a6a); }
@media (min-width: 900px) {
  .day-card .stack { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px 24px; }
  .day-card .stack > :nth-child(-n+2) { grid-column: 1 / -1; }
}

/* water cups, weekly card, food map */
.cups { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 12px; }
.cup { flex: 1 0 28px; max-width: 48px; height: 50px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface2); color: var(--muted); font: inherit; font-size: 1.3rem; cursor: pointer; padding: 0; }
.cup-ic { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cup.on { border-color: var(--gold); color: var(--gold-text); background: rgba(212,175,55,.12); }
.cup.on .cup-ic { fill: rgba(212,175,55,.35); }
.cup.add { color: var(--gold-text); border-style: dashed; }
.week-card { display: block; text-decoration: none; color: var(--text); }
.food-row td { border-top: 0; padding-top: 0; font-size: .82rem; }
.map-group { margin: 10px 0; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); }
.map-group h3 { margin: 0 0 6px; font-size: 1rem; }
.map-group.ok { border-color: rgba(127,197,141,.45); } .map-group.ok h3 { color: var(--ok, #7fc58d); }
.map-group.reaction { border-color: rgba(224,122,106,.5); } .map-group.reaction h3 { color: var(--danger, #e07a6a); }
.map-group.unclear { border-color: rgba(212,175,55,.3); } .map-group.unclear h3 { color: var(--gold-text); }

/* steps goal: small pie and numbers */
.steps-goal { display: flex; align-items: center; gap: 16px; margin: 10px 0 4px; }
.steps-goal .donut { width: 84px; height: 84px; flex: none; margin: 0; }
.steps-n[hidden] { display: none; }
