/* Member app ("My Gym") – builds on styles.css tokens */
body.member {
  --primary: #2563eb;
  --primary-ink: #fff;
  --primary-soft: #e6eeff;
  --accent: #ff7a3d;
  --grad: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  --grad-warm: linear-gradient(135deg, #ff7a3d 0%, #f43f5e 100%);
  --grad-green: linear-gradient(135deg, #10b981 0%, #059669 100%);
  --topbar-h: 56px;
  --tab-h: 66px;
  background: var(--bg);
}
@media (prefers-color-scheme: dark) {
  body.member { --primary: #7aa2ff; --primary-ink: #0b1020; --primary-soft: #1a2342; }
}

/* top bar */
.m-top {
  position: sticky; top: 0; z-index: 30; height: var(--topbar-h); display: flex; align-items: center; gap: .5rem;
  padding: 0 .5rem; padding-top: env(safe-area-inset-top); background: var(--surface); border-bottom: 1px solid var(--border);
}
.m-top h1 { font-size: 1.05rem; margin: 0; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { width: 42px; height: 42px; border-radius: 12px; border: none; background: none; color: var(--text); display: grid; place-items: center; cursor: pointer; font-size: 1.25rem; }
.icon-btn:active { background: var(--surface-2); }
.icon-btn svg { width: 24px; height: 24px; }

.m-main { max-width: 640px; margin: 0 auto; padding: 1rem 1rem calc(var(--tab-h) + 1.5rem); }

/* bottom tabs */
.m-tabs {
  position: fixed; bottom: 0; left: 0; right: 0; height: var(--tab-h); z-index: 30; display: flex;
  background: var(--surface); border-top: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom);
}
.m-tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: .7rem; font-weight: 600; }
.m-tabs a svg { width: 23px; height: 23px; }
.m-tabs a.active { color: var(--primary); }
.m-tabs a.checkin-tab .tab-ring {
  width: 58px; height: 58px; border-radius: 50%; background: var(--grad); color: #fff; display: grid; place-items: center;
  margin-top: -26px; box-shadow: 0 6px 18px rgba(37, 99, 235, .45); border: 4px solid var(--surface);
}
.m-tabs a.checkin-tab .tab-ring svg { width: 26px; height: 26px; }

/* drawer (side window) */
.drawer-backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 60; opacity: 0; pointer-events: none; transition: opacity .25s; }
.drawer {
  position: fixed; top: 0; bottom: 0; left: 0; width: min(82vw, 320px); z-index: 61; background: var(--surface);
  transform: translateX(-102%); transition: transform .28s cubic-bezier(.2,.8,.2,1); display: flex; flex-direction: column; overflow-y: auto;
}
body.drawer-open .drawer { transform: none; }
body.drawer-open .drawer-backdrop { opacity: 1; pointer-events: auto; }
.drawer-hero { background: var(--grad); color: #fff; padding: 1rem 1rem 1.1rem; padding-top: calc(1rem + env(safe-area-inset-top)); position: relative; overflow: hidden; }
.drawer-hero .fig { width: 130px; height: 130px; margin: 0 auto; color: #fff; --ground: rgba(255,255,255,.35); --accent: #ffd166; }
.drawer-hero .fig-name { text-align: center; font-size: .8rem; opacity: .9; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; min-height: 1.2em; transition: opacity .3s; }
.drawer-hero .who { display: flex; align-items: center; gap: .6rem; margin-top: .75rem; }
.drawer-hero .who .av { width: 44px; height: 44px; border-radius: 50%; background: rgba(255,255,255,.22); display: grid; place-items: center; font-weight: 800; }
.drawer-hero .who b { display: block; font-size: 1.05rem; }
.drawer-hero .who small { color: rgba(255,255,255,.85); }
.drawer-hero::after { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; background: rgba(255,255,255,.08); right: -80px; top: -90px; }
.drawer nav { padding: .5rem; display: flex; flex-direction: column; }
.drawer nav a { display: flex; align-items: center; gap: .85rem; padding: .75rem .8rem; border-radius: 12px; color: var(--text); font-weight: 600; }
.drawer nav a .ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); font-size: 1.05rem; }
.drawer nav a.active { background: var(--primary-soft); color: var(--primary); }
.drawer .foot { margin-top: auto; padding: 1rem; color: var(--muted); font-size: .8rem; text-align: center; }

/* cards */
.m-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 1rem; box-shadow: var(--shadow); margin-bottom: 1rem; }
.m-card h2 { font-size: 1.02rem; margin: 0 0 .6rem; display: flex; align-items: center; gap: .4rem; }
.m-card h2 .spacer { flex: 1; }
.m-card h2 small { font-weight: 500; }
.section-title { font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 1.25rem 0 .6rem; }

.hero-card { background: var(--grad); color: #fff; border: none; position: relative; overflow: hidden; }
.hero-card::before { content: ""; position: absolute; width: 200px; height: 200px; border-radius: 50%; background: rgba(255,255,255,.08); right: -60px; top: -80px; }
.hero-card .hello { font-size: .9rem; opacity: .9; }
.hero-card .name { font-size: 1.45rem; font-weight: 800; margin: .1rem 0 .75rem; }
.hero-card .btn-white { background: #fff; color: #2563eb; border: none; font-weight: 800; width: 100%; min-height: 50px; font-size: 1.05rem; border-radius: 14px; }
.hero-card .btn-white svg { width: 22px; height: 22px; }
.hero-card .state { display: flex; align-items: center; gap: .75rem; background: rgba(255,255,255,.15); border-radius: 14px; padding: .7rem .8rem; margin-bottom: .75rem; }
.hero-card .state .big { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.pulse-dot { width: 12px; height: 12px; border-radius: 50%; background: #4ade80; box-shadow: 0 0 0 0 rgba(74,222,128,.7); animation: pulse 1.6s infinite; flex-shrink: 0; }
@keyframes pulse { to { box-shadow: 0 0 0 12px rgba(74,222,128,0); } }

.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-bottom: 1rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: .75rem .6rem; text-align: center; box-shadow: var(--shadow); color: var(--text); }
.tile .emo { font-size: 1.35rem; }
.tile .val { font-size: 1.35rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.tile .lbl { font-size: .72rem; color: var(--muted); font-weight: 600; }

.alert { border-radius: 14px; padding: .75rem .9rem; margin-bottom: 1rem; font-weight: 600; font-size: .92rem; display: flex; gap: .6rem; align-items: flex-start; }
.alert.warn { background: var(--amber-soft); color: var(--amber); }
.alert.bad { background: var(--red-soft); color: var(--red); }
.alert.info { background: var(--primary-soft); color: var(--primary); }

.quote { font-style: italic; font-size: 1rem; line-height: 1.5; }
.quote small { display: block; font-style: normal; margin-top: .35rem; }

/* workout preview */
.wk { display: flex; gap: .9rem; align-items: center; }
.wk .anim { width: 96px; height: 96px; flex-shrink: 0; border-radius: 16px; background: var(--primary-soft); color: var(--primary); padding: 4px; }
.wk .day { font-size: .78rem; font-weight: 700; color: var(--primary); text-transform: uppercase; letter-spacing: .05em; }
.wk .title { font-weight: 800; font-size: 1.05rem; margin: .1rem 0 .2rem; }

/* exercise grid */
.ex-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .75rem; }
@media (min-width: 560px) { .ex-grid { grid-template-columns: repeat(3, 1fr); } }
.ex-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; color: var(--text); box-shadow: var(--shadow); display: block; }
.ex-card .anim { aspect-ratio: 1; background: var(--primary-soft); color: var(--primary); padding: 8px; }
.ex-card .body { padding: .6rem .7rem .75rem; }
.ex-card .n { font-weight: 800; font-size: .95rem; }
.ex-card .g { font-size: .75rem; color: var(--muted); }
.ex-detail .anim { height: 260px; background: var(--primary-soft); color: var(--primary); border-radius: 20px; padding: 10px; }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; }
.steps li { counter-increment: s; display: flex; gap: .7rem; padding: .5rem 0; align-items: flex-start; }
.steps li::before { content: counter(s); width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: var(--primary-ink); display: grid; place-items: center; font-weight: 800; font-size: .8rem; flex-shrink: 0; }
.pill { display: inline-block; padding: .2rem .6rem; border-radius: 999px; font-size: .75rem; font-weight: 700; background: var(--surface-2); color: var(--text); margin: 0 .25rem .25rem 0; }
.pill.blue { background: var(--primary-soft); color: var(--primary); }
.pill.orange { background: var(--amber-soft); color: var(--amber); }

.week { display: flex; flex-direction: column; gap: .4rem; }
.week .d { display: flex; gap: .7rem; padding: .55rem .7rem; border-radius: 12px; background: var(--surface-2); font-size: .9rem; }
.week .d b { min-width: 2.6rem; }
.week .d.today { background: var(--grad); color: #fff; }

/* player */
.player { position: fixed; inset: 0; z-index: 80; background: var(--bg); display: flex; flex-direction: column; padding: 1rem; padding-top: calc(1rem + env(safe-area-inset-top)); }
.player .top { display: flex; align-items: center; gap: .5rem; }
.player .dots { display: flex; gap: 4px; flex: 1; }
.player .dots i { flex: 1; height: 5px; border-radius: 3px; background: var(--surface-2); }
.player .dots i.done { background: var(--primary); }
.player .dots i.cur { background: var(--accent); }
.player .stage { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: .5rem; }
.player .stage .anim { width: min(70vw, 300px); height: min(70vw, 300px); color: var(--primary); }
.player .phase { font-weight: 800; letter-spacing: .1em; text-transform: uppercase; font-size: .85rem; }
.player .phase.rest { color: var(--green); }
.player .phase.work { color: var(--accent); }
.player .exname { font-size: 1.5rem; font-weight: 800; }
.timer-ring { width: 120px; height: 120px; position: relative; }
.timer-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.timer-ring circle { fill: none; stroke-width: 10; }
.timer-ring .bg { stroke: var(--surface-2); }
.timer-ring .fg { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s linear; }
.timer-ring.rest .fg { stroke: var(--green); }
.timer-ring .t { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.player .controls { display: flex; gap: .75rem; justify-content: center; padding-bottom: env(safe-area-inset-bottom); }
.player .controls .btn { min-width: 90px; min-height: 52px; border-radius: 16px; }

/* scanner overlay */
.scan-overlay { position: fixed; inset: 0; z-index: 90; background: #000; color: #fff; display: flex; flex-direction: column; }
.scan-overlay .bar { display: flex; align-items: center; gap: .5rem; padding: .75rem; padding-top: calc(.75rem + env(safe-area-inset-top)); }
.scan-overlay .bar .icon-btn { color: #fff; }
.scan-overlay #m-reader { flex: 1; }
.scan-overlay #m-reader video { object-fit: cover; }
.scan-overlay .hint { text-align: center; padding: 1rem; padding-bottom: calc(1rem + env(safe-area-inset-bottom)); display: grid; gap: .6rem; }
.scan-overlay .hint .btn { background: rgba(255,255,255,.15); color: #fff; border-color: transparent; }

/* result overlay */
.result-overlay { position: fixed; inset: 0; z-index: 95; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem; color: #fff; }
.result-overlay.ok { background: var(--grad-green); }
.result-overlay.out { background: var(--grad); }
.result-overlay.warn { background: linear-gradient(135deg, #f59e0b, #d97706); }
.result-overlay.bad { background: var(--grad-warm); }
.result-overlay .big { font-size: 1.9rem; font-weight: 800; margin-top: 1rem; }
.result-overlay .sub { font-size: 1.05rem; opacity: .95; margin-top: .4rem; }
.result-overlay .btn { margin-top: 1.5rem; background: #fff; color: #111; border: none; min-width: 180px; min-height: 50px; border-radius: 14px; }
.check-anim { width: 120px; height: 120px; }
.check-anim circle { fill: none; stroke: rgba(255,255,255,.9); stroke-width: 6; stroke-dasharray: 340; stroke-dashoffset: 340; animation: draw .6s ease-out forwards; }
.check-anim path { fill: none; stroke: #fff; stroke-width: 8; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 100; stroke-dashoffset: 100; animation: draw .4s .5s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 96; overflow: hidden; }
.confetti i { position: absolute; top: -12px; width: 8px; height: 14px; border-radius: 2px; animation: fall linear forwards; }
@keyframes fall { to { transform: translateY(110vh) rotate(720deg); } }

/* progress */
.goal-ring { display: flex; align-items: center; gap: 1rem; }
.ring { width: 96px; height: 96px; position: relative; flex-shrink: 0; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 10; }
.ring .bg { stroke: var(--surface-2); }
.ring .fg { stroke: url(#ringgrad); stroke-linecap: round; transition: stroke-dashoffset 1s ease-out; }
.ring .t { position: absolute; inset: 0; display: grid; place-items: center; font-weight: 800; font-size: 1.15rem; text-align: center; line-height: 1.1; }
.ring .t small { display: block; font-size: .65rem; color: var(--muted); font-weight: 600; }
.bmi-scale { position: relative; height: 12px; border-radius: 999px; background: linear-gradient(90deg, #60a5fa 0 18%, #22c55e 18% 50%, #f59e0b 50% 75%, #ef4444 75%); margin: 1.4rem 0 .4rem; }
.bmi-scale .mk { position: absolute; top: -9px; width: 4px; height: 30px; border-radius: 2px; background: var(--text); transform: translateX(-50%); }
.bmi-scale .mk span { position: absolute; top: -22px; left: 50%; transform: translateX(-50%); font-size: .8rem; font-weight: 800; white-space: nowrap; }
.bmi-labels { display: flex; justify-content: space-between; font-size: .68rem; color: var(--muted); }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cal .h { text-align: center; font-size: .65rem; color: var(--muted); font-weight: 700; }
.cal .c { aspect-ratio: 1; border-radius: 7px; background: var(--surface-2); display: grid; place-items: center; font-size: .7rem; color: var(--muted); }
.cal .c.on { background: var(--grad-green); color: #fff; font-weight: 700; }
.cal .c.today { outline: 2px solid var(--primary); outline-offset: 1px; }
.cal .c.empty { background: none; }
.log-row { display: flex; justify-content: space-between; padding: .55rem 0; border-bottom: 1px solid var(--border); font-size: .9rem; }
.log-row:last-child { border-bottom: none; }

/* water */
.water { display: grid; grid-template-columns: repeat(8, 1fr); gap: 6px; margin: .5rem 0; }
.glass { aspect-ratio: .7; border: 2.5px solid #60a5fa; border-radius: 4px 4px 10px 10px; position: relative; overflow: hidden; cursor: pointer; background: none; padding: 0; }
.glass::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 0; background: linear-gradient(#93c5fd, #3b82f6); transition: height .35s ease-out; }
.glass.full::after { height: 85%; }
.macro { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; text-align: center; }
.macro div { background: var(--surface-2); border-radius: 12px; padding: .55rem .25rem; }
.macro b { display: block; font-size: 1.1rem; }
.macro small { color: var(--muted); font-size: .72rem; }
.meal { display: flex; gap: .75rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.meal:last-child { border-bottom: none; }
.meal .t { font-size: 1.4rem; }
.meal b { display: block; font-size: .9rem; }
.meal span { color: var(--muted); font-size: .88rem; }
.tips li { margin-bottom: .35rem; }

/* membership card */
.mcard { background: var(--grad); color: #fff; border-radius: 22px; padding: 1.1rem; position: relative; overflow: hidden; box-shadow: 0 10px 30px rgba(37,99,235,.35); margin-bottom: 1rem; }
.mcard::after { content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%; background: rgba(255,255,255,.08); right: -90px; bottom: -110px; }
.mcard .gym { font-weight: 800; letter-spacing: .06em; font-size: .85rem; opacity: .95; }
.mcard .nm { font-size: 1.35rem; font-weight: 800; margin: .5rem 0 .1rem; }
.mcard .qr { background: #fff; border-radius: 14px; padding: 8px; width: 132px; height: 132px; float: right; margin-left: .75rem; position: relative; z-index: 1; }
.mcard .qr img { width: 100%; height: 100%; display: block; }
.mcard .meta { font-size: .85rem; opacity: .92; line-height: 1.6; }
.mcard .badge { background: rgba(255,255,255,.2); color: #fff; }
.mcard::before { content: ""; display: table; clear: both; }
.info-row { display: flex; gap: .75rem; align-items: center; padding: .65rem 0; border-bottom: 1px solid var(--border); color: var(--text); }
.info-row:last-child { border-bottom: none; }
.info-row .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--primary-soft); display: grid; place-items: center; flex-shrink: 0; }

/* welcome / login */
.welcome { min-height: 100vh; display: flex; flex-direction: column; background: var(--grad); color: #fff; padding: 1.5rem; padding-top: calc(1.5rem + env(safe-area-inset-top)); }
.welcome .fig { width: 190px; height: 190px; margin: 1rem auto 0; color: #fff; --ground: rgba(255,255,255,.35); --accent: #ffd166; }
.welcome h1 { text-align: center; font-size: 2rem; margin: .5rem 0 .25rem; }
.welcome p.lead { text-align: center; opacity: .92; margin: 0 0 1.5rem; }
.w-feats { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin: 0 auto 1.25rem; max-width: 420px; width: 100%; }
.w-feats span { background: rgba(255,255,255,.16); border-radius: 14px; padding: .55rem .2rem; text-align: center; font-size: 1.4rem; }
.w-feats small { display: block; color: #fff; opacity: .95; font-size: .68rem; font-weight: 700; margin-top: .15rem; }
.w-or { display: flex; align-items: center; gap: .6rem; color: var(--muted); font-size: .8rem; }
.w-or::before, .w-or::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; }
.quick-grid .q { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: .6rem .2rem; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text); font: inherit; font-size: .72rem; font-weight: 700; text-align: center; cursor: pointer; }
.quick-grid .q:active { transform: scale(.94); }
.quick-grid .qi { font-size: 1.5rem; line-height: 1; }
.welcome .panel { min-width: 0; grid-template-columns: minmax(0, 1fr); background: var(--surface); color: var(--text); border-radius: 22px; padding: 1.1rem; margin-top: auto; display: grid; gap: .65rem; }
.welcome .panel .btn { min-height: 50px; border-radius: 14px; font-size: 1rem; white-space: normal; text-align: center; line-height: 1.25; }
.welcome .panel .btn.primary { background: var(--grad); border: none; color: #fff; }
.welcome .panel input { min-height: 50px; font-size: 1.05rem; border-radius: 14px; }
.pin-input { letter-spacing: .6em; text-align: center; font-weight: 800; }
.linkish { background: none; border: none; color: var(--primary); font: inherit; font-weight: 600; cursor: pointer; padding: .3rem; }
.err { color: var(--red); font-weight: 600; font-size: .9rem; }

.fade-in { animation: fadein .3s ease-out; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } }

/* ---------- find gyms ---------- */
.gym-list { display: grid; gap: .9rem; }
@media (min-width: 560px) { .gym-list { grid-template-columns: 1fr 1fr; } }
.gym-card { display: block; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; overflow: hidden; color: var(--text); box-shadow: var(--shadow); }
.gym-card .cover { position: relative; aspect-ratio: 16 / 9; background: var(--grad); }
.gym-card .cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gym-card .ph, .ph-big { width: 100%; height: 100%; display: grid; place-items: center; font-size: 3rem; color: #fff; background: var(--grad); }
.ph-big { aspect-ratio: 16 / 9; border-radius: 18px; }
.gym-card .dist { position: absolute; left: 10px; bottom: 10px; background: rgba(0,0,0,.6); color: #fff; font-size: .78rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; }
.gym-card .body { padding: .7rem .85rem .85rem; position: relative; }
.gym-card .n { font-weight: 800; font-size: 1.05rem; }
.gym-card .r { font-size: .9rem; margin: .1rem 0; }
.gym-card .meta { color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gym-card .price { position: absolute; right: .85rem; top: .7rem; font-weight: 800; color: var(--primary); }
.gym-card .price small { font-weight: 600; color: var(--muted); font-size: .7rem; }
.stars { color: #f59e0b; letter-spacing: 1px; }
.stars .off { color: var(--border); }
.stars.small { font-size: .85rem; margin-left: .35rem; }

.carousel { display: flex; gap: .5rem; overflow-x: auto; scroll-snap-type: x mandatory; margin-bottom: .75rem; scrollbar-width: none; border-radius: 18px; height: min(56vw, 340px); }
.carousel img { flex: 0 0 100%; width: 100%; height: 100%; min-width: 0; object-fit: cover; border-radius: 18px; scroll-snap-align: center; background: var(--surface-2); }
.carousel .ph-big { flex: 0 0 100%; height: 100%; aspect-ratio: auto; }
.gym-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem; }
.gym-actions .btn { flex: 1 1 0; min-width: 0; min-height: 46px; border-radius: 14px; padding: .5rem .4rem; }
.gym-actions .btn.primary { flex: 1 1 100%; background: var(--grad); border: none; font-size: 1.05rem; }
.review { padding: .6rem 0; border-bottom: 1px solid var(--border); font-size: .92rem; }
.review:last-child { border-bottom: none; }
.legend-row { display: flex; gap: .8rem; flex-wrap: wrap; font-size: .72rem; color: var(--muted); margin-top: .35rem; }
.legend-row i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.star-pick { display: flex; justify-content: center; gap: .3rem; margin: .25rem 0 1rem; }
.star-pick button { font-size: 2.4rem; background: none; border: none; color: var(--border); cursor: pointer; padding: 0 .1rem; transition: transform .15s; }
.star-pick button.on { color: #f59e0b; transform: scale(1.1); }

/* ---------- celebrations ---------- */
.celebrate { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 2rem; color: #fff; animation: cel-in .35s ease-out; overflow: hidden; }
.celebrate.out { animation: cel-out .25s ease-in forwards; }
.c-water { background: radial-gradient(circle at 50% 35%, #38bdf8 0%, #2563eb 55%, #1e3a8a 100%); }
.c-fire { background: radial-gradient(circle at 50% 35%, #fb923c 0%, #ef4444 55%, #7f1d1d 100%); }
.c-gold { background: radial-gradient(circle at 50% 35%, #fde047 0%, #f59e0b 50%, #92400e 100%); }
.c-goal { background: radial-gradient(circle at 50% 35%, #a78bfa 0%, #7c3aed 50%, #312e81 100%); }
@keyframes cel-in { from { opacity: 0; transform: scale(1.05); } }
@keyframes cel-out { to { opacity: 0; transform: scale(.96); } }
.c-title { font-size: 2rem; font-weight: 900; margin-top: 1.2rem; text-shadow: 0 3px 12px rgba(0,0,0,.25); animation: rise .6s .5s both cubic-bezier(.2,1.4,.4,1); }
.c-sub { font-size: 1.05rem; opacity: .95; margin-top: .5rem; max-width: 320px; animation: rise .6s .7s both ease-out; }
.c-btn { margin-top: 1.8rem; background: #fff; color: #111; border: none; min-width: 190px; min-height: 52px; border-radius: 16px; font-size: 1.05rem; font-weight: 800; animation: rise .5s 1s both ease-out; box-shadow: 0 8px 20px rgba(0,0,0,.2); }
@keyframes rise { from { opacity: 0; transform: translateY(24px) scale(.9); } }

/* badge: pop + glowing rings + spinning rays */
.badge-wrap { position: relative; width: 190px; height: 190px; display: grid; place-items: center; }
.medal { position: relative; z-index: 2; width: 130px; height: 130px; border-radius: 50%; display: grid; place-items: center; font-size: 4.2rem; background: rgba(255,255,255,.2); border: 5px solid rgba(255,255,255,.85); box-shadow: 0 0 40px rgba(255,255,255,.5); animation: pop .7s cubic-bezier(.2,1.6,.4,1) both, float 2.6s 1s ease-in-out infinite; }
.c-ring { position: absolute; inset: 20px; border-radius: 50%; border: 3px solid rgba(255,255,255,.6); animation: ripple 1.8s ease-out infinite; }
.c-ring.r2 { animation-delay: .9s; }
.rays { position: absolute; inset: -60px; border-radius: 50%; background: repeating-conic-gradient(rgba(255,255,255,.18) 0 10deg, transparent 10deg 20deg); animation: spin 14s linear infinite; mask: radial-gradient(circle, #000 30%, transparent 70%); -webkit-mask: radial-gradient(circle, #000 30%, transparent 70%); }
@keyframes pop { 0% { transform: scale(0) rotate(-30deg); } 70% { transform: scale(1.15) rotate(6deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes float { 50% { transform: translateY(-8px); } }
@keyframes ripple { from { transform: scale(.8); opacity: .9; } to { transform: scale(1.6); opacity: 0; } }
@keyframes spin { to { transform: rotate(360deg); } }

/* water glass filling up */
.water-glass { width: 170px; height: 210px; filter: drop-shadow(0 10px 25px rgba(0,0,0,.25)); animation: pop .6s cubic-bezier(.2,1.5,.4,1) both; }
.water-fill { animation: fill-up 2.2s .3s cubic-bezier(.3,.8,.3,1) both; }
@keyframes fill-up { from { transform: translateY(180px); } to { transform: translateY(18px); } }
.wave { animation: wave 1.6s linear infinite; }
.wave.w2 { animation-duration: 2.4s; animation-direction: reverse; }
@keyframes wave { to { transform: translateX(160px); } }
.bubble { fill: rgba(255,255,255,.7); animation: bubble 2.2s ease-in infinite both; }
@keyframes bubble { 0% { transform: translateY(0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translateY(-150px); opacity: 0; } }

/* particles */
.particles { position: fixed; inset: 0; pointer-events: none; z-index: 121; overflow: hidden; }
.particles i { position: absolute; top: -20px; animation: fall-p linear forwards; transform: scale(var(--s)); }
.p-confetti i { width: 9px; height: 15px; border-radius: 2px; }
.p-drops i { width: 12px; height: 16px; background: linear-gradient(#e0f2fe, #60a5fa); border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%; opacity: .9; }
.p-stars i::before { content: "✦"; color: #fde68a; font-size: 18px; }
.p-embers i { top: auto; bottom: -20px; width: 8px; height: 8px; border-radius: 50%; background: radial-gradient(#fff7ae, #fb923c 60%, transparent 70%); animation-name: rise-p; }
@keyframes fall-p { to { transform: translate(var(--x), 110vh) rotate(540deg) scale(var(--s)); } }
@keyframes rise-p { to { transform: translate(var(--x), -110vh) scale(var(--s)); opacity: 0; } }

/* water glass tap: drop falls in + wobble */
.glass.just { animation: wobble .5s ease-out; }
.glass.just::before { content: ""; position: absolute; left: 50%; top: -14px; width: 8px; height: 11px; margin-left: -4px; z-index: 1; background: #3b82f6; border-radius: 50% 50% 50% 50% / 65% 65% 35% 35%; animation: drop-in .35s ease-in forwards; }
@keyframes drop-in { to { transform: translateY(30px); opacity: 0; } }
@keyframes wobble { 30% { transform: rotate(-6deg) scale(1.08); } 60% { transform: rotate(4deg); } }
/* Phones with "reduce animations" (often on in battery saver): keep the celebration, just calmer */
@media (prefers-reduced-motion: reduce) { .rays, .particles { display: none; } .c-ring { animation-iteration-count: 1; } }

/* badges */
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.badge-tile { border: 1px solid var(--border); border-radius: 16px; padding: .7rem .4rem; text-align: center; background: var(--surface); color: var(--text); font: inherit; cursor: pointer; }
.badge-tile .b-emo { font-size: 1.9rem; display: block; transition: transform .2s; }
.badge-tile b { display: block; font-size: .78rem; margin-top: .2rem; }
.badge-tile small { display: block; font-size: .68rem; color: var(--muted); }
.badge-tile.locked { opacity: .45; filter: grayscale(1); cursor: default; }
.badge-tile:not(.locked):active .b-emo { transform: scale(1.25); }
.badge-tile:not(.locked) { box-shadow: 0 0 0 2px var(--primary-soft); }
.celebrate .particles { position: absolute; z-index: 0; }
.celebrate > :not(.particles) { position: relative; z-index: 1; }

/* diet */
.pref-pick { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-bottom: .35rem; }
.pref { border: 1.5px solid var(--border); background: var(--surface); color: var(--text); border-radius: 14px; padding: .65rem .3rem; font: inherit; font-weight: 700; cursor: pointer; }
.pref.on { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); }
.trainer-plan { border-left: 4px solid var(--primary); }

.w-lang { position: absolute; top: calc(.75rem + env(safe-area-inset-top)); right: .75rem; background: rgba(255,255,255,.18); color: #fff; border: 1px solid rgba(255,255,255,.35); border-radius: 999px; padding: .4rem .8rem; font: inherit; font-size: .85rem; font-weight: 700; cursor: pointer; }
.welcome { position: relative; }
.lang-pick { display: grid; gap: .6rem; }
.lang-pick [data-lang] { display: flex; flex-direction: column; align-items: flex-start; min-height: 56px; font-size: 1.05rem; text-align: left; }
.lang-pick [data-lang] small { font-size: .75rem; font-weight: 500; opacity: .8; }
.lang-pick .btn.primary small { color: #fff; opacity: .9; }

/* explore: category grid + chips */
.cat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .55rem; }
.cat-tile { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .35rem; min-height: 96px; padding: .6rem .3rem; border-radius: 16px; background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow); color: var(--text); text-align: center; font-size: .8rem; font-weight: 700; line-height: 1.2; }
.cat-tile .ce { font-size: 2rem; line-height: 1; }
.cat-tile.last { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary-soft); }
.cat-tile:active { transform: scale(.95); }
.cat-chips { display: flex; flex-wrap: wrap; gap: .3rem; margin: .2rem 0 .35rem; }
.cat-chips span { font-size: .72rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; background: var(--primary-soft); color: var(--primary); }
.demo-pick .cat-grid { max-height: 58vh; overflow-y: auto; padding: 2px; }
.demo-pick .cat-tile { font: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; min-height: 84px; }

/* member photo (added by the gym) */
.drawer-hero .who .av.has-photo, .mphoto { background-size: cover; background-position: center; color: transparent; }
.mphoto { width: 64px; height: 64px; border-radius: 50%; border: 3px solid rgba(255,255,255,.85); margin-top: .6rem; position: relative; z-index: 1; }

/* offline */
.off-bar { position: sticky; top: var(--topbar-h); z-index: 25; background: #fef3c7; color: #92400e; font-size: .82rem; font-weight: 700; text-align: center; padding: .4rem .75rem; }
.off-bar[hidden] { display: none; }

.upi-pay { margin-top: .5rem; display: grid; gap: .3rem; }
.upi-pay .btn { justify-self: start; }
.upi-pay small { font-size: .74rem; opacity: .85; font-weight: 500; }

.fac-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem .75rem; }
.fac-list > span { display: flex; align-items: center; gap: .45rem; font-size: .9rem; }
.fac-list b { font-size: 1.15rem; }

/* practice checklist (chess etc.) */
.prac-row { display: flex; align-items: center; gap: .65rem; padding: .65rem 0; border-bottom: 1px solid var(--border); cursor: pointer; }
.prac-row:last-child { border-bottom: none; }
.prac-row input { width: 22px; height: 22px; accent-color: var(--primary); }
.prac-row .pi { font-size: 1.5rem; }
.prac-row small { display: block; }
.prac-row input:checked ~ span b { text-decoration: line-through; opacity: .6; }
/* side menu: keep the animated header full size and scroll the whole menu */
.drawer-hero, .drawer nav, .drawer .foot { flex-shrink: 0; }

/* =====================================================================
   v2 design – soft cards, indigo accent, sport-coloured hero
   ===================================================================== */
body.member {
  --primary: #4f46e5; --primary-2: #6366f1; --primary-ink: #fff; --primary-soft: #eef0ff;
  --bg: #f5f6fb; --surface: #fff; --surface-2: #f1f3f9; --border: #e8eaf3; --text: #14162b; --muted: #6b7088;
  --grad: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
  --sport-a: #4f46e5; --sport-b: #7c3aed;
  --sport: linear-gradient(135deg, var(--sport-a) 0%, var(--sport-b) 100%);
  --card-shadow: 0 6px 22px rgba(35, 41, 92, .07);
  --radius: 20px;
  --topbar-h: 60px; --tab-h: 70px;
  font-family: Inter, "Segoe UI", Roboto, system-ui, -apple-system, sans-serif;
  -webkit-tap-highlight-color: transparent;
}
@media (prefers-color-scheme: dark) {
  body.member { --primary: #8b87ff; --primary-2: #a5a1ff; --primary-ink: #0e0f1d; --primary-soft: #23244a;
    --bg: #0d0e1a; --surface: #171829; --surface-2: #202238; --border: #2a2c45; --text: #eceefb; --muted: #9a9fbd; --card-shadow: none; }
}
body.member .m-main { padding: .9rem 1rem calc(var(--tab-h) + 2rem); }
body.member .m-card { border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--card-shadow); }
body.member .btn { border-radius: 14px; }
body.member .btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }
body.member .btn.primary:active { transform: scale(.98); }
.chev { color: var(--muted); display: grid; place-items: center; flex-shrink: 0; }
.chev svg { width: 20px; height: 20px; }

/* --- top bar: home (menu · name · bell · avatar) / page (back · title) --- */
.m-top { background: var(--bg); border-bottom: none; padding: 0 .75rem; padding-top: env(safe-area-inset-top); height: calc(var(--topbar-h) + env(safe-area-inset-top)); }
.m-top.scrolled { background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); box-shadow: 0 1px 0 var(--border); }
.m-top .gym-name { flex: 1; min-width: 0; display: flex; align-items: center; gap: .25rem; font-weight: 800; font-size: 1.08rem; color: var(--text); background: none; border: none; padding: 0; text-align: left; cursor: pointer; }
.m-top .gym-name span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-top .gym-name svg { width: 18px; height: 18px; flex-shrink: 0; transform: rotate(90deg); color: var(--muted); }
.m-top h1 { text-align: center; font-size: 1.08rem; font-weight: 800; }
.m-top .bell { position: relative; }
.m-top .bell .dot { position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; border: 2px solid var(--bg); }
.top-av { width: 38px; height: 38px; border-radius: 50%; background: var(--sport); color: #fff; display: grid; place-items: center; font-weight: 800; font-size: .85rem;
  background-size: cover; background-position: center; border: 2px solid var(--surface); box-shadow: 0 2px 8px rgba(0,0,0,.12); flex-shrink: 0; }
.top-av.has-photo { color: transparent; }
body:not(.on-home) .m-top .home-only, body.on-home .m-top .page-only { display: none !important; }
.m-top .page-only.spacer-btn { width: 42px; }

/* --- bottom nav with floating scan button --- */
.m-tabs { height: calc(var(--tab-h) + env(safe-area-inset-bottom)); background: var(--surface); border-top: none; box-shadow: 0 -4px 24px rgba(35, 41, 92, .08); border-radius: 22px 22px 0 0; }
.m-tabs a { font-size: .7rem; gap: 4px; transition: color .2s; }
.m-tabs a svg { width: 24px; height: 24px; }
.m-tabs a.active { color: var(--primary); }
.m-tabs a.checkin-tab .tab-ring { width: 62px; height: 62px; margin-top: -34px; background: var(--grad); box-shadow: 0 10px 24px rgba(79, 70, 229, .45); border: 5px solid var(--bg); transition: transform .15s; }
.m-tabs a.checkin-tab:active .tab-ring { transform: scale(.94); }
.m-tabs a.checkin-tab > span:last-child { display: none; }

/* --- home hero --- */
.hero2 { position: relative; overflow: hidden; border-radius: 24px; padding: 1.15rem 1.1rem 1.05rem; color: #fff; background: var(--sport); box-shadow: 0 12px 30px color-mix(in srgb, var(--sport-a) 35%, transparent); margin-bottom: 1rem; }
.hero2::before { content: ""; position: absolute; inset: 0; background:
  radial-gradient(circle at 85% 30%, rgba(255,255,255,.22), transparent 42%),
  linear-gradient(115deg, transparent 58%, rgba(255,255,255,.12) 58.4%, transparent 59.2%),
  linear-gradient(100deg, transparent 72%, rgba(255,255,255,.1) 72.4%, transparent 73.2%); pointer-events: none; }
.hero2 .art { position: absolute; right: -6px; top: 18px; font-size: 5.6rem; line-height: 1; filter: drop-shadow(0 12px 18px rgba(0,0,0,.28)); animation: float 4s ease-in-out infinite; pointer-events: none; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-6deg); } 50% { transform: translateY(-8px) rotate(4deg); } }
.hero2 .hello { font-size: .92rem; opacity: .95; position: relative; }
.hero2 .name { font-size: 1.75rem; font-weight: 850; line-height: 1.15; margin: .15rem 0 .25rem; position: relative; letter-spacing: -.01em; }
.hero2 .tag { font-size: .95rem; opacity: .95; position: relative; margin-bottom: 1rem; max-width: 68%; }
.ci-card { position: relative; display: flex; align-items: center; gap: .85rem; width: 100%; background: var(--surface); color: var(--text); border: none; border-radius: 18px; padding: .8rem .9rem; text-align: left; font: inherit; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,.12); }
.ci-card:active { transform: scale(.985); }
.ci-card .ci-ico { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; }
.ci-card .ci-ico svg { width: 24px; height: 24px; }
.ci-card .ci-txt { flex: 1; min-width: 0; }
.ci-card b { display: block; font-size: 1.02rem; }
.ci-card small { color: var(--muted); font-size: .82rem; }
.ci-card .timer { font-size: 1.35rem; font-weight: 850; font-variant-numeric: tabular-nums; color: var(--text); }
.ci-card.live .ci-ico { background: #dcfce7; color: #16a34a; }
.ci-card.done .ci-ico { background: #dcfce7; color: #16a34a; font-size: 1.4rem; }
.ci-card .mini-btn { background: var(--primary); color: #fff; border: none; border-radius: 12px; padding: .55rem .8rem; font-weight: 700; font: inherit; font-size: .85rem; cursor: pointer; }

/* --- stat cards --- */
.stat3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; margin-bottom: 1.1rem; }
.stat3 .st { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: .85rem .5rem .8rem; text-align: center; box-shadow: var(--card-shadow); color: var(--text); display: flex; flex-direction: column; align-items: center; gap: .1rem; }
.stat3 .si { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 1.25rem; margin-bottom: .25rem; }
.stat3 .st b { font-size: 1.45rem; font-weight: 850; font-variant-numeric: tabular-nums; line-height: 1.15; }
.stat3 .st small { font-size: .74rem; color: var(--muted); font-weight: 600; line-height: 1.2; }
.stat3 .st .delta { font-size: .72rem; font-weight: 700; color: #16a34a; margin-top: .15rem; }
.t-orange { background: #fff1e6; } .t-pink { background: #ffe8ef; } .t-amber { background: #fff6d6; } .t-blue { background: #e8f0ff; }
.t-green { background: #e4f8ec; } .t-violet { background: #f0eaff; } .t-teal { background: #e0f7f4; } .t-red { background: #ffe9e9; }
@media (prefers-color-scheme: dark) {
  .t-orange, .t-pink, .t-amber, .t-blue, .t-green, .t-violet, .t-teal, .t-red { background: var(--surface-2); }
}

/* --- section heads & quick access --- */
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin: .3rem .1rem .65rem; }
.sec-head h2 { font-size: 1.12rem; font-weight: 850; margin: 0; }
.sec-head a, .sec-head button { color: var(--primary); font-weight: 700; font-size: .85rem; background: none; border: none; cursor: pointer; }
.qa-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .6rem; margin-bottom: 1.1rem; }
.qa { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .7rem .2rem .6rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); color: var(--text); font: inherit; font-size: .74rem; font-weight: 650; cursor: pointer; box-shadow: var(--card-shadow); text-align: center; }
.qa:active { transform: scale(.96); }
.qa .qi { width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.45rem; }

/* --- notice / list rows --- */
.notice-card { display: flex; align-items: center; gap: .8rem; padding: .85rem .9rem; border-radius: 18px; background: linear-gradient(135deg, #eef2ff, #f5f3ff); color: var(--text); margin-bottom: 1rem; border: 1px solid #e0e4ff; }
@media (prefers-color-scheme: dark) { .notice-card { background: var(--primary-soft); border-color: var(--border); } }
.notice-card .ni { font-size: 1.6rem; }
.notice-card b { color: var(--primary); display: block; font-size: .95rem; }
.notice-card p { margin: .1rem 0 0; font-size: .85rem; color: var(--muted); line-height: 1.35; }
.notice-card > div { flex: 1; min-width: 0; }
.today-card { display: flex; align-items: center; gap: .85rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .75rem; box-shadow: var(--card-shadow); color: var(--text); margin-bottom: 1rem; }
.today-card .tc-art { width: 78px; height: 78px; border-radius: 16px; background: var(--sport); color: #fff; padding: 4px; flex-shrink: 0; --ground: rgba(255,255,255,.35); --accent: #fde047; }
.today-card .tc-body { flex: 1; min-width: 0; }
.today-card small { color: var(--primary); font-weight: 700; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; }
.today-card b { display: block; font-size: 1.02rem; margin: .1rem 0; }
.today-card span.sub { color: var(--muted); font-size: .82rem; }
.list-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--card-shadow); margin-bottom: 1rem; overflow: hidden; }
.lrow { display: flex; align-items: center; gap: .85rem; padding: .85rem 1rem; color: var(--text); width: 100%; background: none; border: none; font: inherit; text-align: left; cursor: pointer; }
.lrow + .lrow { border-top: 1px solid var(--border); }
.lrow:active { background: var(--surface-2); }
.lrow .li { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); flex-shrink: 0; font-size: 1.05rem; }
.lrow .li svg { width: 19px; height: 19px; }
.lrow .lt { flex: 1; min-width: 0; font-weight: 650; font-size: .95rem; }
.lrow .lt small { display: block; color: var(--muted); font-weight: 500; font-size: .8rem; }
.lrow .count { background: #ef4444; color: #fff; font-size: .72rem; font-weight: 800; min-width: 20px; height: 20px; border-radius: 10px; display: grid; place-items: center; padding: 0 .35rem; }
.lrow .tagp { background: var(--primary-soft); color: var(--primary); font-size: .72rem; font-weight: 700; padding: .15rem .5rem; border-radius: 999px; }
.lrow.danger, .lrow.danger .li { color: #dc2626; }
.lrow.danger .li { background: #fee2e2; }

/* --- page tabs (segmented) --- */
.seg { display: flex; gap: .4rem; padding: .3rem; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; margin-bottom: 1rem; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg a, .seg button { flex: 1; text-align: center; padding: .55rem .7rem; border-radius: 12px; font-weight: 700; font-size: .85rem; color: var(--muted); white-space: nowrap; background: none; border: none; font-family: inherit; cursor: pointer; }
.seg .on { background: var(--primary); color: #fff; box-shadow: 0 4px 12px rgba(79, 70, 229, .3); }

/* --- practice: week strip, session card, drills --- */
.week-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: .35rem; margin-bottom: 1rem; }
.week-strip a { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .5rem 0 .45rem; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); color: var(--muted); font-size: .72rem; font-weight: 650; position: relative; }
.week-strip a b { font-size: 1.05rem; color: var(--text); font-weight: 800; }
.week-strip a.on { background: var(--primary); border-color: var(--primary); color: rgba(255,255,255,.85); box-shadow: 0 6px 16px rgba(79, 70, 229, .35); }
.week-strip a.on b { color: #fff; }
.week-strip a .dt { width: 5px; height: 5px; border-radius: 50%; background: #22c55e; position: absolute; bottom: 4px; }
.week-strip a.on .dt { background: #fff; }
.session-card { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; overflow: hidden; box-shadow: var(--card-shadow); margin-bottom: 1.1rem; }
.session-card .sc-art { position: relative; height: 150px; background: var(--sport); overflow: hidden; }
.session-card .sc-art::before { content: ""; position: absolute; inset: 0; background:
  linear-gradient(180deg, transparent 55%, rgba(255,255,255,.18) 55.5%, transparent 56.5%),
  linear-gradient(90deg, transparent 49.7%, rgba(255,255,255,.22) 50%, transparent 50.3%),
  radial-gradient(circle at 20% 20%, rgba(255,255,255,.25), transparent 45%); }
.session-card .sc-art .fig { position: absolute; left: 50%; bottom: -6px; transform: translateX(-50%); width: 150px; height: 150px; color: #fff; --ground: rgba(255,255,255,0); --accent: #fde047; }
.session-card .sc-art .ball { position: absolute; right: 18px; top: 22px; font-size: 2.6rem; filter: drop-shadow(0 6px 10px rgba(0,0,0,.25)); }
.session-card .sc-badge { position: absolute; right: 12px; top: 12px; background: rgba(255,255,255,.95); color: #16a34a; font-weight: 800; font-size: .74rem; padding: .25rem .6rem; border-radius: 999px; }
.session-card .sc-badge.up { color: var(--primary); }
.session-card .sc-badge.miss { color: var(--muted); }
.session-card .sc-body { padding: .9rem 1rem 1rem; }
.session-card h3 { margin: 0 0 .45rem; font-size: 1.2rem; font-weight: 850; }
.sc-row { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .88rem; padding: .12rem 0; }
.sc-row svg { width: 16px; height: 16px; flex-shrink: 0; }
.big-btn { display: flex; align-items: center; justify-content: center; gap: .5rem; width: 100%; min-height: 52px; border-radius: 16px; border: none; font: inherit; font-weight: 800; font-size: 1rem; cursor: pointer; background: var(--grad); color: #fff; margin-top: .85rem; box-shadow: 0 8px 20px rgba(79, 70, 229, .3); }
.big-btn svg { width: 20px; height: 20px; }
.big-btn:active { transform: scale(.985); }
.big-btn.green { background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 8px 20px rgba(22, 163, 74, .3); }
.big-btn.ghost { background: var(--surface-2); color: var(--text); box-shadow: none; }
.big-btn.done { background: #dcfce7; color: #15803d; box-shadow: none; cursor: default; }
.drill-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: .65rem; margin-bottom: 1rem; }
.drill { display: flex; align-items: center; gap: .55rem; padding: .6rem; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; color: var(--text); box-shadow: var(--card-shadow); position: relative; min-width: 0; }
.drill .df { width: 46px; height: 46px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); flex-shrink: 0; padding: 2px; display: grid; place-items: center; font-size: 1.5rem; }
.drill .dt { min-width: 0; flex: 1; }
.drill b { display: block; font-size: .86rem; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drill small { color: var(--muted); font-size: .75rem; }
.drill .tick { position: absolute; top: 6px; right: 6px; width: 20px; height: 20px; border-radius: 50%; background: #22c55e; color: #fff; display: grid; place-items: center; font-size: .7rem; font-weight: 900; }
.drill.check { cursor: pointer; }
.drill.check input { position: absolute; opacity: 0; pointer-events: none; }

/* --- drill detail --- */
.drill-hero { margin: -.9rem -1rem 0; height: 270px; background: var(--sport); position: relative; overflow: hidden; }
.drill-hero::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 75% 25%, rgba(255,255,255,.28), transparent 45%), linear-gradient(180deg, transparent 70%, rgba(0,0,0,.18)); }
.drill-hero .anim { position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%); width: 230px; height: 230px; color: #fff; --ground: rgba(255,255,255,.4); --accent: #fde047; }
.drill-sheet { background: var(--bg); border-radius: 26px 26px 0 0; margin: -26px -1rem 0; padding: 1.2rem 1rem 0; position: relative; }
.drill-sheet h1 { font-size: 1.6rem; font-weight: 850; margin: 0; letter-spacing: -.01em; }
.drill-sheet .sub { color: var(--muted); margin: .2rem 0 .75rem; }
.drill-meta { display: flex; gap: 1rem; flex-wrap: wrap; color: var(--muted); font-size: .86rem; font-weight: 600; margin-bottom: .9rem; }
.drill-meta span { display: flex; align-items: center; gap: .3rem; }
.ul-tabs { display: flex; border-bottom: 1px solid var(--border); margin-bottom: .9rem; }
.ul-tabs button { flex: 1; background: none; border: none; padding: .7rem 0; font: inherit; font-weight: 700; color: var(--muted); border-bottom: 2.5px solid transparent; cursor: pointer; }
.ul-tabs button.on { color: var(--primary); border-bottom-color: var(--primary); }
.num-steps { display: flex; flex-direction: column; gap: .9rem; margin-bottom: 1rem; }
.num-steps .ns { display: flex; gap: .8rem; align-items: flex-start; }
.num-steps .ns i { font-style: normal; width: 30px; height: 30px; border-radius: 50%; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; font-weight: 800; flex-shrink: 0; }
.num-steps .ns b { display: block; font-size: .96rem; }
.num-steps .ns small { color: var(--muted); }
.sticky-cta { position: sticky; bottom: calc(var(--tab-h) + .6rem); z-index: 5; padding-top: .4rem; }

/* --- progress --- */
.cal2 { display: grid; grid-template-columns: repeat(7, 1fr); row-gap: .35rem; text-align: center; }
.cal2 .h { font-size: .72rem; font-weight: 700; color: var(--muted); padding-bottom: .3rem; }
.cal2 .c { position: relative; height: 38px; display: grid; place-items: center; font-size: .86rem; font-weight: 600; }
.cal2 .c span { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; }
.cal2 .c.on span { background: #dcfce7; color: #15803d; font-weight: 800; }
.cal2 .c.on::after { content: ""; position: absolute; bottom: -1px; width: 5px; height: 5px; border-radius: 50%; background: #22c55e; }
.cal2 .c.today span { background: var(--primary); color: #fff; font-weight: 800; }
.cal2 .c.future { color: color-mix(in srgb, var(--muted) 60%, transparent); }
.legend { display: flex; gap: 1rem; font-size: .78rem; color: var(--muted); margin-top: .7rem; }
.legend i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: .3rem; }
.month-nav { display: flex; align-items: center; gap: .5rem; margin-bottom: .6rem; }
.month-nav b { flex: 1; font-size: 1rem; }
.month-nav a { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text); }
.month-nav a svg { width: 18px; height: 18px; }

/* --- diet --- */
.cal-ring { display: flex; align-items: center; gap: 1.1rem; }
.cal-ring .ring { width: 128px; height: 128px; }
.cal-ring .ring .fg { stroke: url(#ringgrad2); }
.cal-ring .ring .t { font-size: 1.5rem; }
.cal-ring .macros { flex: 1; display: flex; flex-direction: column; gap: .55rem; }
.cal-ring .macros div { display: flex; align-items: center; gap: .45rem; font-size: .88rem; }
.cal-ring .macros i { width: 9px; height: 9px; border-radius: 50%; }
.cal-ring .macros span { flex: 1; color: var(--muted); }
.meal2 { display: flex; align-items: center; gap: .8rem; padding: .7rem; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--card-shadow); margin-bottom: .6rem; cursor: pointer; }
.meal2 .me { width: 54px; height: 54px; border-radius: 14px; display: grid; place-items: center; font-size: 1.7rem; flex-shrink: 0; }
.meal2 .mt { flex: 1; min-width: 0; }
.meal2 .mt b { display: block; font-size: .95rem; }
.meal2 .mt span { color: var(--muted); font-size: .82rem; line-height: 1.35; display: block; }
.meal2 .ck { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; color: #fff; flex-shrink: 0; transition: all .2s; }
.meal2.ate .ck { background: #22c55e; border-color: #22c55e; }
.meal2.ate .mt b { color: var(--muted); }

/* --- membership & card --- */
.mem-card { position: relative; overflow: hidden; border-radius: 24px; padding: 1.1rem 1.1rem 1rem; color: #fff; background: var(--sport); box-shadow: 0 12px 28px color-mix(in srgb, var(--sport-a) 35%, transparent); margin-bottom: .85rem; }
.mem-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 90% 20%, rgba(255,255,255,.22), transparent 40%); }
.mem-card .art { position: absolute; right: 10px; bottom: 6px; font-size: 4.4rem; filter: drop-shadow(0 10px 16px rgba(0,0,0,.25)); }
.mem-card .crown { display: flex; align-items: center; gap: .45rem; font-size: 1.2rem; font-weight: 850; position: relative; }
.mem-card .pillw { display: inline-block; margin: .5rem 0 .7rem; background: rgba(255,255,255,.22); padding: .2rem .65rem; border-radius: 999px; font-size: .78rem; font-weight: 800; position: relative; }
.mem-card .pillw.bad { background: #fee2e2; color: #b91c1c; }
.mem-card .pillw.warn { background: #fef3c7; color: #92400e; }
.mem-card .gymn { opacity: .9; font-size: .88rem; position: relative; }
.mem-card .valid { margin-top: .35rem; font-size: .8rem; opacity: .85; position: relative; }
.mem-card .valid b { display: block; font-size: 1.1rem; opacity: 1; }
.mem-stats { display: grid; grid-template-columns: repeat(3, 1fr); background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--card-shadow); margin-bottom: 1rem; }
.mem-stats div { text-align: center; padding: .8rem .3rem; }
.mem-stats div + div { border-left: 1px solid var(--border); }
.mem-stats b { display: block; font-size: 1.3rem; font-weight: 850; }
.mem-stats small { color: var(--muted); font-size: .75rem; }
.id-card { border-radius: 26px; padding: 1.4rem 1.1rem 1.2rem; background: var(--sport); color: #fff; text-align: center; position: relative; overflow: hidden; box-shadow: 0 14px 32px color-mix(in srgb, var(--sport-a) 35%, transparent); margin-bottom: 1rem; }
.id-card::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 15% 10%, rgba(255,255,255,.25), transparent 40%), radial-gradient(circle at 95% 90%, rgba(255,255,255,.15), transparent 40%); }
.id-card .gym { position: relative; font-size: .78rem; letter-spacing: .12em; font-weight: 800; opacity: .9; }
.id-card .pic { position: relative; width: 92px; height: 92px; margin: .8rem auto .55rem; border-radius: 50%; border: 4px solid rgba(255,255,255,.9); background: rgba(255,255,255,.2) center/cover; display: grid; place-items: center; font-size: 2rem; font-weight: 850; }
.id-card .pic.has-photo { color: transparent; }
.id-card h2 { position: relative; margin: 0; font-size: 1.45rem; font-weight: 850; }
.id-card .role { position: relative; opacity: .92; font-size: .9rem; }
.id-card .mid { position: relative; opacity: .85; font-size: .82rem; margin-top: .15rem; letter-spacing: .04em; }
.id-card .qrbox { position: relative; background: #fff; border-radius: 20px; padding: .8rem; width: min(230px, 70vw); margin: 1rem auto .6rem; box-shadow: 0 10px 24px rgba(0,0,0,.18); }
.id-card .qrbox img { display: block; width: 100%; aspect-ratio: 1; }
.id-card .cap { position: relative; font-size: .82rem; opacity: .92; }
.qr-full { position: fixed; inset: 0; z-index: 99; background: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; padding: 2rem; color: #111; }
.qr-full img { width: min(86vw, 420px); aspect-ratio: 1; }
.profile-head { display: flex; align-items: center; gap: .9rem; padding: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--card-shadow); margin-bottom: 1rem; }
.profile-head .top-av { width: 60px; height: 60px; font-size: 1.3rem; }
.profile-head b { display: block; font-size: 1.15rem; }
.profile-head small { display: block; color: var(--muted); font-size: .82rem; }
.profile-head > div { flex: 1; min-width: 0; }

/* --- scanner (dark, framed) & bottom sheet --- */
.scan-overlay { background: #0b0c16; }
.scan-overlay .bar { justify-content: space-between; }
.scan-overlay .bar b { text-align: center; font-size: 1.05rem; }
.scan-overlay .cam { position: relative; flex: 1; overflow: hidden; min-height: 0; }
.scan-overlay #m-reader { position: absolute; inset: 0; }
.scan-overlay #m-reader video { width: 100% !important; height: 100% !important; object-fit: cover; }
.scan-overlay #qr-shaded-region { border-color: rgba(11,12,22,.55) !important; }
.scan-overlay #qr-shaded-region > div { display: none !important; }
.scan-frame { position: absolute; left: 50%; top: 44%; width: 240px; height: 240px; transform: translate(-50%, -50%); pointer-events: none; }
.scan-frame i { position: absolute; width: 46px; height: 46px; border: 5px solid #7c7cff; }
.scan-frame i:nth-child(1) { left: 0; top: 0; border-right: 0; border-bottom: 0; border-top-left-radius: 20px; }
.scan-frame i:nth-child(2) { right: 0; top: 0; border-left: 0; border-bottom: 0; border-top-right-radius: 20px; }
.scan-frame i:nth-child(3) { left: 0; bottom: 0; border-right: 0; border-top: 0; border-bottom-left-radius: 20px; }
.scan-frame i:nth-child(4) { right: 0; bottom: 0; border-left: 0; border-top: 0; border-bottom-right-radius: 20px; }
.scan-frame .line { position: absolute; left: 12px; right: 12px; height: 3px; border-radius: 3px; background: linear-gradient(90deg, transparent, #8b87ff, transparent); box-shadow: 0 0 12px #8b87ff; animation: scanline 2.2s ease-in-out infinite; }
@keyframes scanline { 0%, 100% { top: 14px; } 50% { top: calc(100% - 17px); } }
.scan-cap { position: absolute; left: 0; right: 0; top: calc(44% + 140px); text-align: center; pointer-events: none; }
.scan-cap b { display: block; font-size: 1.15rem; }
.scan-cap small { opacity: .8; }
.torch { position: absolute; left: 50%; top: calc(44% + 205px); transform: translateX(-50%); width: 52px; height: 52px; border-radius: 50%; border: none; background: rgba(255,255,255,.14); color: #fff; display: grid; place-items: center; cursor: pointer; }
.torch.on { background: #fde047; color: #111; }
.torch svg { width: 22px; height: 22px; }
.scan-sheet { background: var(--surface); color: var(--text); border-radius: 26px 26px 0 0; padding: .9rem 1rem calc(1rem + env(safe-area-inset-bottom)); display: grid; gap: .55rem; }
.scan-sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto .3rem; }
.sheet-row { display: flex; align-items: center; gap: .85rem; padding: .75rem .8rem; border-radius: 16px; background: var(--surface-2); color: var(--text); border: none; font: inherit; text-align: left; cursor: pointer; width: 100%; }
.sheet-row .li { width: 40px; height: 40px; border-radius: 12px; background: var(--primary-soft); color: var(--primary); display: grid; place-items: center; flex-shrink: 0; }
.sheet-row .li svg { width: 20px; height: 20px; }
.sheet-row b { display: block; font-size: .95rem; }
.sheet-row small { color: var(--muted); font-size: .8rem; }
.sheet-row > span:nth-child(2) { flex: 1; min-width: 0; }

/* --- check-in success page --- */
.ci-done { position: fixed; inset: 0; z-index: 95; background: var(--bg); display: flex; flex-direction: column; overflow-y: auto; padding: calc(1rem + env(safe-area-inset-top)) 1.1rem calc(1rem + env(safe-area-inset-bottom)); }
.ci-done .top { display: flex; }
.ci-done .badge-ok { width: 108px; height: 108px; border-radius: 50%; margin: 1.6rem auto .9rem; display: grid; place-items: center; background: linear-gradient(135deg, #22c55e, #16a34a); box-shadow: 0 0 0 14px #dcfce7, 0 16px 34px rgba(22, 163, 74, .35); animation: popin .5s cubic-bezier(.2,1.6,.4,1) both; }
.ci-done.out .badge-ok { background: var(--grad); box-shadow: 0 0 0 14px var(--primary-soft), 0 16px 34px rgba(79, 70, 229, .35); }
.ci-done.warn .badge-ok { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 0 0 14px #fef3c7, 0 16px 34px rgba(217, 119, 6, .35); }
.ci-done .badge-ok svg { width: 56px; height: 56px; color: #fff; }
.ci-done .badge-ok svg path { stroke-dasharray: 40; stroke-dashoffset: 40; animation: draw .45s .35s ease-out forwards; }
@keyframes popin { from { transform: scale(.3); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.ci-done h1 { text-align: center; font-size: 1.6rem; font-weight: 850; margin: .4rem 0 .2rem; }
.ci-done .welcome-l { text-align: center; color: var(--muted); margin-bottom: 1.2rem; }
.ci-done .warnp { text-align: center; margin: -.6rem 0 1rem; }
.ci-done .warnp span { display: inline-block; background: #fef3c7; color: #92400e; font-weight: 700; font-size: .85rem; padding: .3rem .75rem; border-radius: 999px; }
.ci-done .acts { margin-top: auto; padding-top: 1rem; display: grid; gap: .6rem; }
.ci-done .acts .big-btn { margin: 0; }
.ci-done .dlist .lrow { cursor: default; }
.ci-done .dlist .li { background: var(--primary-soft); color: var(--primary); }
.drill-meta span { white-space: nowrap; }
.drill-meta svg { width: 17px; height: 17px; }
.profile-head { color: var(--text); }
.session-card .sc-art .ball { right: auto; left: 18px; }
.torch[hidden] { display: none; }
.scan-overlay .cam.nocam .scan-frame, .scan-overlay .cam.nocam .scan-cap { display: none; }
.nocam-msg { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .4rem; color: #c7c9e0; text-align: center; padding: 2rem; font-size: 2.4rem; }
.nocam-msg b { font-size: 1.1rem; color: #fff; }
.nocam-msg small { font-size: .9rem; }
.ci-card .timer { display: block; }
.drawer-hero { background: var(--sport); }

/* ---------- personal trainer ---------- */
.pt-search { display: flex; gap: .5rem; margin-bottom: .9rem; }
.pt-search input { flex: 1; min-width: 0; }
.pt-list { display: grid; gap: .75rem; }
.pt-card {
  display: flex; gap: .8rem; align-items: center; padding: .9rem; border-radius: 20px; background: var(--surface);
  border: 1px solid var(--border); color: var(--text); text-decoration: none; transition: transform .18s;
}
.pt-card:active { transform: scale(.98); }
.pt-av {
  width: 54px; height: 54px; flex: none; border-radius: 18px; display: grid; place-items: center; font-weight: 900; font-size: 1.1rem;
  background: var(--grad); color: #fff;
}
.pt-av.big { width: 72px; height: 72px; border-radius: 22px; font-size: 1.5rem; }
.pt-body { flex: 1; min-width: 0; display: grid; gap: 3px; }
.pt-body b { font-size: 1.05rem; font-weight: 800; }
.pt-meta { font-size: .8rem; color: var(--muted); font-weight: 600; }
.pt-tags { display: flex; flex-wrap: wrap; }
.pt-star { color: #f59e0b; font-weight: 800; }
.pt-price { text-align: right; flex: none; }
.pt-price small { display: block; color: var(--muted); font-size: .7rem; font-weight: 600; }
.pt-price b { font-size: 1.05rem; font-weight: 900; }
.pt-hero { display: flex; gap: 1rem; align-items: center; }
.pt-hero h2 { margin: 0 0 .2rem; font-size: 1.35rem; font-weight: 900; }
.pt-pkgs { display: grid; gap: .6rem; }
.pt-pkg { display: flex; gap: .75rem; align-items: center; justify-content: space-between; padding: .9rem 1rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); }
.pt-pkg b { display: block; font-weight: 800; }
.pt-pkg small { display: block; color: var(--muted); font-size: .8rem; }
.pt-pkr { text-align: right; display: grid; gap: .35rem; justify-items: end; }
.pt-pkr b { font-size: 1.1rem; font-weight: 900; }
.pt-bk { padding: .9rem 1rem; border-radius: 18px; background: var(--surface); border: 1px solid var(--border); display: grid; gap: .4rem; }
.pt-bkh { display: flex; align-items: center; gap: .5rem; justify-content: space-between; }
.pt-bkh b { font-size: 1.02rem; font-weight: 800; }
.pt-reply { background: var(--surface-2); border-radius: 12px; padding: .5rem .7rem; font-size: .9rem; }
.pt-acts { display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.pt-bk .nx-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.pt-bk .nx-chip.ok { background: #e2f8ec; color: #08703a; }
.pt-bk .nx-chip.warn { background: #fff2cc; color: #8a5a00; }
.pt-bk .nx-chip.bad { background: #ffe1e7; color: #b4123a; }
