/* Member app – "New design (preview)" from the owner's reference (More → App design). Scoped to body.member.v2.
   So far: Home (sports members) and the bottom bar; other pages keep the Fresh look.
   Smoothness rules: solid colours only (no backdrop-filter / color-mix – old Android WebViews break or stutter
   on them), motion only with transform / opacity, nothing animates while scrolling, all off for reduced motion. */

body.member.v2 {
  color-scheme: light; /* the approved look is light, also when the phone is in dark mode */
  --v2-bg: #f3f3f6;
  --v2-card: #ffffff;
  --v2-ink: #141416;
  --v2-sub: #74757c;
  --v2-line: #ececf0;
  --v2-dark: #1b1b1f;
  --v2-dark-2: #2a2a30;
  --v2-lime: #cfe384;
  --v2-lime-ink: #2b3310;
  --v2-chip: #ffffff;
  --v2-ease: cubic-bezier(.22, .61, .36, 1);
  --v2-shadow: 0 1px 2px rgba(20, 20, 22, .04), 0 6px 18px rgba(20, 20, 22, .05);
}
/* soft lavender → peach wash at the top of Home, like the reference (scrolls with the page: no fixed background) */
body.member.v2.on-home { background: linear-gradient(170deg, #ecdff4 0, #f4e5e6 230px, var(--v2-bg) 470px) no-repeat, var(--v2-bg); }
/* Home has its own header row */
body.member.v2.on-home .m-top { display: none; }

/* ---------- Home ---------- */
.v2 { display: grid; gap: 16px; color: var(--v2-ink); padding-top: calc(4px + env(safe-area-inset-top)); }
.v2 > * { min-width: 0; }
.v2-head { display: flex; align-items: center; gap: 12px; }
.v2-me { flex: none; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; }
.v2-av { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: #e6dcef; color: var(--v2-ink); font-weight: 800; background-size: cover; background-position: center; }
.v2-av.has-photo { color: transparent; }
.v2-hi { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.v2-hi b { font-size: 1.12rem; font-weight: 600; }
.v2-hi small { color: var(--v2-sub); font-size: .9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-ib { position: relative; flex: none; width: 50px; height: 50px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--v2-card); color: var(--v2-ink); box-shadow: var(--v2-shadow); cursor: pointer; text-decoration: none; }
.v2-ib.dark { background: var(--v2-dark); color: #fff; }
.v2-ib svg { width: 22px; height: 22px; }
.v2-dot { position: absolute; top: 12px; right: 13px; width: 9px; height: 9px; border-radius: 50%; background: #ef4444; border: 2px solid var(--v2-card); }
.v2-title { margin: 6px 0 0; font-size: 2.15rem; line-height: 1.12; font-weight: 500; letter-spacing: -.025em; }
.v2-title b { font-weight: 650; }

/* dark progress card with the lime ring */
.v2-prog { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: 26px; background: var(--v2-dark); color: #fff; }
.v2-pl { flex: none; display: grid; gap: 10px; }
.v2-pl h2 { margin: 0; font-size: 1rem; font-weight: 600; color: #f2f2f4; }
.v2-ring { position: relative; width: 112px; height: 112px; }
.v2-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.v2-ring .trk { fill: none; stroke: #ffffff; stroke-width: 12; }
.v2-ring .val { fill: none; stroke: var(--v2-lime); stroke-width: 8; stroke-linecap: round; transition: stroke-dashoffset .9s var(--v2-ease); }
.v2-ring span { position: absolute; inset: 0; display: grid; place-content: center; grid-auto-flow: column; align-items: baseline; color: #fff; }
.v2-ring b { font-size: 1.7rem; font-weight: 600; color: #141416; }
.v2-ring i { font-style: normal; font-size: .8rem; font-weight: 600; color: #141416; }
.v2-ring::before { content: ""; position: absolute; inset: 16px; border-radius: 50%; background: #fff; }
.v2-stats { flex: 1; min-width: 0; display: grid; gap: 10px; padding-left: 14px; border-left: 1px solid rgba(255, 255, 255, .14); }
.v2-st { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.v2-sti { flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--v2-dark-2); font-size: .95rem; }
.v2-sti svg { width: 17px; height: 17px; }
.v2-st b { display: block; font-size: 1rem; font-weight: 600; }
.v2-st small { display: block; font-size: .7rem; color: #a7a8ae; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* section title + chips */
.v2-sec { display: flex; align-items: baseline; justify-content: space-between; margin-top: 4px; }
.v2-sec h2 { margin: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em; }
.v2-sec a { color: var(--v2-ink); font-size: .9rem; font-weight: 500; text-decoration: none; }
.v2-chips { display: flex; gap: 10px; overflow-x: auto; margin: 0 -1rem; padding: 2px 1rem 4px; scrollbar-width: none; }
.v2-chips::-webkit-scrollbar { display: none; }
.v2-chip { flex: none; display: inline-flex; align-items: center; gap: 10px; padding: 6px 18px 6px 6px; border-radius: 999px; background: var(--v2-chip); color: var(--v2-ink); font-weight: 500; font-size: .92rem; text-decoration: none; box-shadow: var(--v2-shadow); }
.v2-chip span { min-width: 38px; height: 38px; padding: 0 6px; border-radius: 999px; display: grid; place-items: center; background: var(--v2-bg); font-weight: 600; }
.v2-chip.on { background: var(--v2-lime); color: var(--v2-lime-ink); }
.v2-chip.on span { background: #fff; color: var(--v2-ink); }

/* white cards */
.v2-card { display: grid; gap: 12px; padding: 16px; border-radius: 26px; background: var(--v2-card); color: var(--v2-ink); text-decoration: none; box-shadow: var(--v2-shadow); }
.v2-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-width: 0; }
.v2-row.top { align-items: flex-start; }
.v2-tag { display: inline-flex; align-items: center; gap: 6px; justify-self: start; padding: 5px 12px; border-radius: 999px; border: 1px solid var(--v2-line); font-size: .74rem; font-weight: 600; }
.v2-tag i { width: 7px; height: 7px; border-radius: 50%; background: #9bbf2f; }
.v2-tag i.live { background: #ef4444; }
.v2-tag i.ok { background: #22c55e; }
.v2-arrow { flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--v2-bg); color: var(--v2-ink); }
.v2-arrow svg { width: 19px; height: 19px; }
.v2-pt { display: grid; gap: 4px; color: inherit; text-decoration: none; }
.v2-pt b { font-size: 1.15rem; font-weight: 600; }
.v2-pt small { color: var(--v2-sub); font-size: .85rem; }
.v2-time { display: inline-flex; align-items: center; gap: 6px; color: var(--v2-ink); font-size: .9rem; }
.v2-time svg { width: 17px; height: 17px; }
.v2-btn { display: inline-flex; align-items: center; gap: 6px; padding: 11px 20px; border: 0; border-radius: 999px; background: var(--v2-dark); color: #fff; font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; text-decoration: none; }
.v2-btn svg { width: 15px; height: 15px; }
.v2-big { display: block; font-size: 1.6rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.v2-live small { color: var(--v2-sub); }
.v2-ms { display: flex; align-items: center; gap: 12px; }
.v2-msi { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; background: var(--v2-lime); color: var(--v2-lime-ink); }
.v2-msi svg { width: 21px; height: 21px; }
.v2-mst { flex: 1; min-width: 0; display: grid; }
.v2-mst b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v2-mst small { color: var(--v2-sub); font-size: .85rem; }

/* press feedback: a quick scale, transform only */
.v2-ib, .v2-chip, .v2-card, .v2-btn, .v2-arrow, .v2-st, .v2-me { transition: transform .16s var(--v2-ease); }
.v2-ib:active, .v2-chip:active, a.v2-card:active, .v2-btn:active, .v2-arrow:active, .v2-me:active { transform: scale(.96); }

/* one gentle entrance when Home opens (the page's own fade handles the rest) */
body.member.v2.on-home .m-main.fade-in { animation: none; }
.v2 { animation: v2-in .32s var(--v2-ease) both; }
@keyframes v2-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ---------- bottom bar: white, rounded, a dark pill slides to the active tab ---------- */
body.member.v2 .m-tabs {
  left: 12px; right: 12px; bottom: calc(10px + env(safe-area-inset-bottom)); height: 68px; padding: 6px; max-width: 560px; margin: 0 auto;
  border: 0; border-radius: 34px; background: var(--v2-card); box-shadow: 0 8px 28px rgba(20, 20, 22, .12); isolation: isolate;
}
body.member.v2 .m-main { padding-bottom: calc(68px + 36px + env(safe-area-inset-bottom)); }
body.member.v2 .m-tabs a { position: relative; z-index: 1; border-radius: 28px; color: var(--v2-ink); font-size: .7rem; font-weight: 500; gap: 3px; transition: color .25s var(--v2-ease); }
body.member.v2 .m-tabs a svg { width: 22px; height: 22px; }
body.member.v2 .m-tabs a.active, body.member.v2 .m-tabs a.active svg { color: #fff; }
.v2-pill {
  position: absolute; z-index: 0; top: 6px; left: 0; bottom: 6px; width: 0; border-radius: 28px; background: var(--v2-dark);
  opacity: 0; transition: transform .32s var(--v2-ease), opacity .2s linear; will-change: transform; pointer-events: none;
}
/* the check-in button: dark circle in the middle (beats the older coloured rule) */
body.member.v2.v2 .m-tabs.m-tabs a.checkin-tab .tab-ring {
  width: 52px; height: 52px; margin-top: 0; border: 0; background: var(--v2-dark); color: #fff; box-shadow: 0 6px 14px rgba(20, 20, 22, .25); transition: transform .16s var(--v2-ease);
}
body.member.v2 .m-tabs a.checkin-tab:active .tab-ring { transform: scale(.92); }

@media (prefers-reduced-motion: reduce) {
  .v2, .v2-pill, .v2-ring .val, .v2-ib, .v2-chip, .v2-card, .v2-btn, .v2-arrow, .v2-st, .v2-me, body.member.v2 .m-tabs a { animation: none; transition: none; }
}

/* small phones (≤ 360 px): everything stays inside the screen */
.v2-st > span:last-child { min-width: 0; }
.v2-hi b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 360px) {
  .v2-title { font-size: 1.85rem; }
  .v2-prog { gap: 10px; padding: 14px; }
  .v2-ring { width: 92px; height: 92px; }
  .v2-ring::before { inset: 13px; }
  .v2-ring b { font-size: 1.35rem; }
  .v2-stats { padding-left: 10px; }
  .v2-sti { width: 30px; height: 30px; }
  .v2-ib { width: 44px; height: 44px; }
  .v2-av { width: 44px; height: 44px; }
}
.v2-chip.on span { color: #141416; }
/* alerts on the new Home stay light too */
.v2 .alert { border-radius: 20px; border: 0; }
.v2 .alert.bad { background: #fdecec; color: #b42318; }
.v2 .alert.warn { background: #fff4e0; color: #9a5b00; }
