/* ============================================================
   Sports & Mind Platform — Design System
   ============================================================ */
:root {
  --bg: #0a0f1e;
  --bg-soft: #0e1526;
  --bg-raise: #121b30;
  --card: #131c33;
  --card-2: #182340;
  --border: rgba(148, 176, 219, 0.14);
  --border-strong: rgba(148, 176, 219, 0.28);
  --text: #e9eef9;
  --text-dim: #9ba8c2;
  --text-faint: #6b7794;
  --brand: #a3e635;
  --brand-2: #22c55e;
  --brand-3: #06b6d4;
  --grad: linear-gradient(120deg, #a3e635 0%, #22c55e 48%, #06b6d4 100%);
  --grad-soft: linear-gradient(120deg, rgba(163, 230, 53, .16), rgba(6, 182, 212, .16));
  --danger: #f43f5e;
  --warn: #f59e0b;
  --ok: #22c55e;
  --info: #38bdf8;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, .25);
  --shadow: 0 14px 40px -12px rgba(0, 0, 0, .55);
  --shadow-lg: 0 30px 70px -20px rgba(0, 0, 0, .65);
  --ring: rgba(34, 197, 94, .45);
  --radius: 18px;
  --radius-lg: 24px;
  --radius-sm: 12px;
  --nav-h: 68px;
  --bottnav-h: 0px;
  --grad-text: linear-gradient(120deg, #d9f99d, #4ade80 45%, #22d3ee);
  font-size: 16px;
}

[data-theme="light"] {
  --bg: #f4f7fb;
  --bg-soft: #eef2f8;
  --bg-raise: #ffffff;
  --card: #ffffff;
  --card-2: #f2f6fc;
  --border: rgba(15, 40, 90, .12);
  --border-strong: rgba(15, 40, 90, .22);
  --text: #0d1930;
  --text-dim: #4b5a77;
  --text-faint: #8290ab;
  --grad-text: linear-gradient(120deg, #65a30d, #15803d 45%, #0e7490);
  --shadow-sm: 0 2px 10px rgba(30, 50, 90, .08);
  --shadow: 0 14px 40px -14px rgba(20, 40, 80, .20);
  --shadow-lg: 0 30px 70px -24px rgba(20, 40, 80, .28);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  background:
    radial-gradient(900px 480px at 85% -5%, rgba(34, 197, 94, .14), transparent 60%),
    radial-gradient(800px 500px at 5% 10%, rgba(6, 182, 212, .12), transparent 60%),
    radial-gradient(1000px 600px at 50% 115%, rgba(163, 230, 53, .10), transparent 60%);
}
[data-theme="light"] body::before { opacity: .55; }

body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 26px 26px;
}

::selection { background: rgba(34, 197, 94, .35); }

::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(148, 176, 219, .25); border-radius: 8px; }
::-webkit-scrollbar-thumb:hover { background: rgba(148, 176, 219, .42); }

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, select, textarea { font-family: inherit; color: inherit; }
ul { list-style: none; }
h1, h2, h3, h4 { line-height: 1.35; font-weight: 800; }

.container { width: min(1180px, 100% - 40px); margin-inline: auto; }
.container.wide { width: min(1300px, 100% - 32px); }

/* ---------------- Splash ---------------- */
#splash {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: opacity .5s ease, visibility .5s;
}
#splash.hide { opacity: 0; visibility: hidden; }
.splash-inner { text-align: center; }
.splash-logo svg { width: 92px; height: 92px; filter: drop-shadow(0 18px 40px rgba(34,197,94,.35)); animation: float 2.6s ease-in-out infinite; }
.splash-inner h1 { margin-top: 18px; font-size: 26px; font-weight: 900; letter-spacing: -.5px; }
.splash-inner p { color: var(--text-dim); font-size: 14px; margin-top: 2px; }
.splash-bar { width: 190px; height: 4px; margin: 26px auto 0; border-radius: 8px; background: var(--border); overflow: hidden; }
.splash-bar span { display: block; height: 100%; width: 40%; border-radius: 8px; background: var(--grad); animation: loadbar 1.1s ease-in-out infinite; }
@keyframes loadbar { 0% { transform: translateX(150%);} 100% { transform: translateX(-150%);} }
@keyframes float { 0%,100% { transform: translateY(0);} 50% { transform: translateY(-8px);} }

/* ---------------- Layout ---------------- */
#app { min-height: 100vh; padding-bottom: var(--bottnav-h); }

/* ---------------- Navbar ---------------- */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(18px);
  background: color-mix(in srgb, var(--bg) 78%, transparent);
  border-bottom: 1px solid var(--border);
}
.nav-inner { height: var(--nav-h); display: flex; align-items: center; gap: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 900; font-size: 18px; }
.brand .mark { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; }
.brand .mark svg { width: 38px; height: 38px; }
.brand small { display: block; font-size: 10px; color: var(--text-dim); font-weight: 500; margin-top: -4px; }

.nav-links { display: flex; gap: 4px; margin-inline-start: 8px; }
.nav-links a { padding: 7px 14px; border-radius: 999px; font-size: 14px; font-weight: 500; color: var(--text-dim); transition: .2s; }
.nav-links a:hover { color: var(--text); background: var(--card-2); }
.nav-links a.active { color: #0a0f1e; background: var(--grad); font-weight: 700; }
[data-theme="light"] .nav-links a.active { color: #fff; }

.nav-actions { display: flex; align-items: center; gap: 10px; margin-inline-start: auto; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--border); transition: .2s; position: relative;
}
.icon-btn:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn .dot {
  position: absolute; top: 8px; inset-inline-end: 9px; width: 8px; height: 8px;
  border-radius: 50%; background: var(--danger); border: 2px solid var(--card);
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 22px; border-radius: 14px; font-weight: 700; font-size: 14px;
  transition: .22s; border: 1px solid transparent; white-space: nowrap; line-height: 1.4;
}
.btn svg { width: 18px; height: 18px; }
.btn-primary { background: var(--grad); color: #0a0f1e; box-shadow: 0 8px 24px -8px rgba(34,197,94,.6); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -8px rgba(34,197,94,.7); }
[data-theme="light"] .btn-primary { color: #fff; }
.btn-ghost { background: var(--card); border-color: var(--border); color: var(--text); }
.btn-ghost:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.btn-soft { background: var(--grad-soft); color: var(--brand-2); border-color: rgba(34,197,94,.25); }
.btn-danger { background: rgba(244,63,94,.12); color: var(--danger); border-color: rgba(244,63,94,.3); }
.btn-sm { padding: 8px 14px; border-radius: 11px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

.avatar {
  border-radius: 50%; display: grid; place-items: center; font-weight: 800; flex-shrink: 0;
  background: var(--grad); color: #0a0f1e; position: relative; user-select: none;
}
[data-theme="light"] .avatar { color: #fff; }
.avatar-lg { width: 72px; height: 72px; font-size: 24px; }
.avatar-md { width: 48px; height: 48px; font-size: 17px; }
.avatar-sm { width: 36px; height: 36px; font-size: 13px; }
.avatar .live { position: absolute; bottom: 0; inset-inline-end: 0; width: 13px; height: 13px; border-radius: 50%; background: var(--ok); border: 2.5px solid var(--card); }

/* ---------------- Bottom nav (mobile) ---------------- */
.bottom-nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 100;
  display: none; gap: 4px; padding: 8px 12px calc(10px + env(safe-area-inset-bottom));
  background: color-mix(in srgb, var(--bg-raise) 92%, transparent);
  backdrop-filter: blur(18px); border-top: 1px solid var(--border);
}
.bottom-nav a {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 7px 4px; border-radius: 14px; font-size: 10.5px; font-weight: 600; color: var(--text-faint); transition: .2s;
}
.bottom-nav a svg { width: 22px; height: 22px; }
.bottom-nav a.active { color: #0a0f1e; background: var(--grad); font-weight: 800; }
[data-theme="light"] .bottom-nav a.active { color: #fff; }

/* ---------------- Hero ---------------- */
.hero { position: relative; padding: 44px 0 30px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.15fr .85fr; gap: 40px; align-items: center; }
.hero-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 15px; border-radius: 999px;
  background: var(--grad-soft); border: 1px solid rgba(34,197,94,.3); color: var(--brand-2);
  font-size: 13px; font-weight: 700; margin-bottom: 20px;
}
.hero-badge .pulse { width: 8px; height: 8px; border-radius: 50%; background: var(--brand-2); animation: pulse 1.8s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(34,197,94,.5);} 70% { box-shadow: 0 0 0 9px rgba(34,197,94,0);} 100% { box-shadow: 0 0 0 0 rgba(34,197,94,0);} }
.hero h1 { font-size: clamp(30px, 5vw, 54px); font-weight: 900; letter-spacing: -1.5px; line-height: 1.3; }
.hero h1 .grad { background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { color: var(--text-dim); font-size: 16.5px; margin-top: 16px; max-width: 520px; }

.hero-search {
  margin-top: 28px; display: flex; align-items: center; gap: 6px;
  background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 8px;
  box-shadow: var(--shadow); max-width: 520px;
}
.hero-search input {
  flex: 1; background: none; border: none; outline: none; padding: 12px 14px; font-size: 15px; color: var(--text);
}
.hero-search input::placeholder { color: var(--text-faint); }
.hero-search .btn { border-radius: 12px; }
.hero-quick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; max-width: 520px; }
.chip {
  display: inline-flex; align-items: center; gap: 7px; padding: 7px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border); font-size: 13px; font-weight: 600; color: var(--text-dim);
  transition: .2s; cursor: pointer;
}
.chip:hover { transform: translateY(-1px); border-color: var(--border-strong); color: var(--text); }
.chip svg { width: 15px; height: 15px; }

.hero-stats { display: flex; gap: 34px; margin-top: 34px; flex-wrap: wrap; }
.hero-stats .stat b { font-size: 26px; font-weight: 900; background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-stats .stat span { display: block; font-size: 12.5px; color: var(--text-faint); }

.hero-visual { position: relative; }
.hero-card {
  position: relative; border-radius: var(--radius-lg); padding: 18px; background: var(--card);
  border: 1px solid var(--border); box-shadow: var(--shadow-lg); overflow: hidden;
}
.hero-card .workout {
  height: 190px; border-radius: var(--radius); display: grid; place-items: center;
  background: radial-gradient(600px 300px at 50% -20%, rgba(163,230,53,.28), transparent 60%), radial-gradient(500px 260px at 90% 120%, rgba(6,182,212,.25), transparent 60%), var(--card-2);
  border: 1px solid var(--border);
}
.hero-card .workout svg { width: 130px; height: 130px; filter: drop-shadow(0 16px 30px rgba(163,230,53,.3)); }
.hero-feed-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 6px 8px; }
.hero-feed-head b { font-size: 14px; }
.hero-feed { display: grid; gap: 8px; }
.hero-feed-item {
  display: flex; align-items: center; gap: 12px; padding: 9px 10px; border-radius: 13px;
  background: var(--card-2); border: 1px solid var(--border);
}
.hero-feed-item .ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; font-size: 18px; }
.hero-feed-item .tx { flex: 1; min-width: 0; }
.hero-feed-item .tx b { display: block; font-size: 13px; }
.hero-feed-item .tx span { font-size: 11.5px; color: var(--text-faint); }
.hero-feed-item .st { font-size: 11px; font-weight: 800; padding: 4px 9px; border-radius: 8px; }
.hero-float {
  position: absolute; display: flex; align-items: center; gap: 10px; padding: 12px 15px;
  background: color-mix(in srgb, var(--bg-raise) 88%, transparent); backdrop-filter: blur(14px);
  border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); animation: float 5s ease-in-out infinite;
}
.hero-float.f1 { top: -16px; inset-inline-end: -8px; }
.hero-float.f2 { bottom: -14px; inset-inline-start: -14px; animation-delay: 1.6s; }
.hero-float .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 16px; }
.hero-float b { font-size: 13px; display: block; }
.hero-float span { font-size: 11px; color: var(--text-faint); }

/* ---------------- Sections ---------------- */
.section { padding: 46px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px; }
.section-head .kicker { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 800; color: var(--brand-2); letter-spacing: .4px; }
.section-head .kicker::before { content: ""; width: 22px; height: 3px; border-radius: 3px; background: var(--grad); }
.section-head h2 { font-size: clamp(22px, 3vw, 30px); margin-top: 6px; letter-spacing: -.5px; }
.section-head p { color: var(--text-dim); font-size: 14px; margin-top: 6px; max-width: 560px; }
.link-more { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 700; color: var(--brand-2); white-space: nowrap; }
.link-more svg { width: 17px; height: 17px; transition: transform .2s; }
.link-more:hover svg { transform: translateX(-4px); }

/* ---------------- Category tabs ---------------- */
.cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 12px; scrollbar-width: none; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  padding: 9px 18px; border-radius: 999px; background: var(--card); border: 1px solid var(--border);
  font-size: 13.5px; font-weight: 700; color: var(--text-dim); transition: .2s; white-space: nowrap; display: inline-flex; align-items: center; gap: 7px;
}
.cat-tab:hover { color: var(--text); transform: translateY(-1px); }
.cat-tab.active { background: var(--grad); color: #0a0f1e; border-color: transparent; box-shadow: 0 8px 20px -6px rgba(34,197,94,.55); }
[data-theme="light"] .cat-tab.active { color: #fff; }
.cat-tab svg { width: 16px; height: 16px; }

/* ---------------- Grid / scroller ---------------- */
.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.scroller { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr); gap: 16px; overflow-x: auto; padding: 4px 2px 16px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.scroller::-webkit-scrollbar { display: none; }
.scroller > * { scroll-snap-align: start; }

/* ---------------- Cards ---------------- */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); transition: .25s; position: relative; }
.card-hover:hover { transform: translateY(-5px); box-shadow: var(--shadow); border-color: var(--border-strong); }

/* Activity card */
.act-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.act-card .act-head { display: flex; align-items: center; justify-content: space-between; }
.act-card .em { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; }
.act-card .fave { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--card-2); border: 1px solid var(--border); color: var(--text-faint); transition: .2s; }
.act-card .fave.on { color: var(--danger); border-color: rgba(244,63,94,.35); background: rgba(244,63,94,.1); }
.act-card .fave svg { width: 17px; height: 17px; }
.act-card h3 { font-size: 16.5px; }
.act-card p { font-size: 13px; color: var(--text-dim); line-height: 1.7; flex: 1; }
.act-meta { display: flex; gap: 14px; color: var(--text-faint); font-size: 12px; font-weight: 600; }
.act-meta span { display: inline-flex; align-items: center; gap: 5px; }
.act-meta svg { width: 14px; height: 14px; }
.act-type { position: absolute; top: 14px; inset-inline-end: 14px; font-size: 10.5px; font-weight: 800; padding: 4px 9px; border-radius: 8px; }
.act-type.mental { background: rgba(6,182,212,.14); color: #22d3ee; }
.act-type.hybrid { background: rgba(163,230,53,.14); color: #a3e635; }
.act-type.physical { background: rgba(244,63,94,.13); color: #fb7185; }

.big-act {
  border-radius: 22px; overflow: hidden; border: 1px solid var(--border); position: relative;
  min-height: 230px; display: flex; flex-direction: column; justify-content: flex-end; padding: 20px;
  transition: .28s;
}
.big-act:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); }
.big-act .bg { position: absolute; inset: 0; z-index: -1; }
.big-act .bg::after { content:""; position:absolute; inset:0; background: linear-gradient(10deg, rgba(5,10,22,.92) 18%, transparent 70%); }
.big-act h3 { font-size: 20px; }
.big-act p { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.big-act .em { font-size: 44px; position: absolute; top: 18px; inset-inline-end: 18px; filter: drop-shadow(0 8px 16px rgba(0,0,0,.4)); }

/* Coach card */
.coach-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.coach-top { display: flex; gap: 13px; align-items: center; }
.coach-top .nm b { display: flex; align-items: center; gap: 6px; font-size: 15.5px; }
.coach-top .nm span { font-size: 12.5px; color: var(--text-dim); }
.coach-top .nm .lk { width: 17px; height: 17px; color: var(--brand-2); }
.coach-sports { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 8px; background: var(--card-2); border: 1px solid var(--border); color: var(--text-dim); }
.tag.green { background: var(--grad-soft); color: var(--brand-2); border-color: rgba(34,197,94,.25); }
.coach-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border); }
.rating { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; color: #fbbf24; }
.rating svg { width: 16px; height: 16px; fill: #fbbf24; }
.rating small { color: var(--text-faint); font-weight: 600; font-size: 11px; }
.price b { font-size: 15px; } .price span { font-size: 11px; color: var(--text-faint); }

/* Club card */
.club-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.club-head { display: flex; gap: 13px; align-items: center; }
.club-logo { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 26px; border: 1px solid var(--border); background: var(--card-2); }
.club-card .row { display: flex; gap: 12px; flex-wrap: wrap; color: var(--text-dim); font-size: 12.5px; font-weight: 600; }
.club-card .row span { display: inline-flex; align-items: center; gap: 5px; }
.club-card .row svg { width: 14px; height: 14px; }

/* Course card */
.course-card { padding: 0; overflow: hidden; }
.course-cover { height: 130px; position: relative; display: grid; place-items: center; font-size: 46px; }
.course-cover .lvl { position: absolute; top: 12px; inset-inline-start: 12px; font-size: 10.5px; font-weight: 800; padding: 4px 10px; border-radius: 8px; background: rgba(10,15,30,.6); backdrop-filter: blur(6px); color: #fff; }
.course-body { padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.course-body h3 { font-size: 15.5px; line-height: 1.5; }
.course-meta { display: flex; gap: 14px; font-size: 12px; color: var(--text-faint); font-weight: 600; flex-wrap: wrap; }
.course-meta span { display: inline-flex; align-items: center; gap: 5px; }
.course-meta svg { width: 14px; height: 14px; }
.course-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; border-top: 1px dashed var(--border); }
.progress-ring { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--brand-2); }
.ring { --val: 0; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--brand-2) calc(var(--val)*1%), rgba(148,176,219,.16) 0); position: relative; }
.ring::before { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--card); }
.ring b { position: relative; font-size: 10px; }

/* Article card */
.article-card { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.article-card .thumb { height: 110px; border-radius: var(--radius-sm); display: grid; place-items: center; font-size: 40px; border: 1px solid var(--border); }
.article-card h3 { font-size: 15px; line-height: 1.6; }
.article-meta { display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-faint); }
.article-meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }
.article-meta .auth { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }

/* Event / competition card */
.event-card { padding: 18px; display: flex; gap: 15px; align-items: center; }
.event-date { min-width: 58px; text-align: center; border-radius: 14px; padding: 10px 6px; background: var(--grad); color: #0a0f1e; }
[data-theme="light"] .event-date { color: #fff; }
.event-date b { display: block; font-size: 22px; font-weight: 900; line-height: 1; }
.event-date span { font-size: 11.5px; font-weight: 700; }
.event-body { flex: 1; min-width: 0; }
.event-body h3 { font-size: 15.5px; }
.event-body .row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 5px; color: var(--text-faint); font-size: 12.5px; font-weight: 600; }
.event-body .row span { display: inline-flex; align-items: center; gap: 5px; }
.event-body .row svg { width: 14px; height: 14px; }
.event-side { text-align: center; }
.reg-btn { margin-top: 8px; }

/* ---------------- Detail pages ---------------- */
.page-head { position: relative; padding: 34px 0 26px; }
.page-head .crumb { display: flex; align-items: center; gap: 7px; color: var(--text-faint); font-size: 13px; font-weight: 600; flex-wrap: wrap; }
.page-head .crumb a:hover { color: var(--brand-2); }
.page-head .crumb svg { width: 14px; height: 14px; }
.page-head h1 { font-size: clamp(26px, 4vw, 40px); margin-top: 12px; letter-spacing: -.8px; }
.page-head .sub { color: var(--text-dim); margin-top: 10px; max-width: 640px; font-size: 15px; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }

.hero-banner {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; border: 1px solid var(--border);
  min-height: 250px; display: flex; align-items: flex-end; padding: 30px; box-shadow: var(--shadow);
}
.hero-banner .bg { position: absolute; inset: 0; z-index: -1; }
.hero-banner .bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(5,10,22,.95) 12%, rgba(5,10,22,.3) 55%, rgba(5,10,22,.15)); }
.hero-banner > div { max-width: 640px; }
.hero-banner h1 { font-size: clamp(24px, 3.6vw, 38px); color: #fff; }
.hero-banner p { color: rgba(255,255,255,.85); margin-top: 8px; }
.hero-banner .em { position: absolute; top: 24px; inset-inline-end: 26px; font-size: 80px; filter: drop-shadow(0 20px 40px rgba(0,0,0,.5)); }

.tabs { display: flex; gap: 8px; overflow-x: auto; border-bottom: 1px solid var(--border); margin-bottom: 26px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  padding: 11px 18px; font-size: 14px; font-weight: 700; color: var(--text-faint);
  border-bottom: 2.5px solid transparent; margin-bottom: -1px; transition: .2s; white-space: nowrap;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--brand-2); border-color: var(--brand-2); }

.info-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.info-grid > * { min-width: 0; }
.side-panel { position: sticky; top: calc(var(--nav-h) + 18px); display: grid; gap: 16px; }
@media (max-width: 900px) { .info-grid { grid-template-columns: 1fr; } .side-panel { position: static; } }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.panel h3 { font-size: 17px; margin-bottom: 14px; display: flex; align-items: center; gap: 9px; }
.panel h3 svg { width: 19px; height: 19px; color: var(--brand-2); }

.desc-list { display: grid; gap: 10px; }
.desc-item { display: flex; gap: 12px; align-items: flex-start; }
.desc-item .ic { width: 30px; height: 30px; border-radius: 9px; background: var(--card-2); border: 1px solid var(--border); display: grid; place-items: center; flex-shrink: 0; }
.desc-item .ic svg { width: 15px; height: 15px; }
.desc-item b { font-size: 14px; display: block; }
.desc-item p { font-size: 13px; color: var(--text-dim); }

.spec-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px dashed var(--border); flex-wrap: wrap; }
.spec-row:last-child { border-bottom: none; }
.spec-row .k { color: var(--text-dim); font-size: 13.5px; display: inline-flex; align-items: center; gap: 8px; }
.spec-row .k svg { width: 16px; height: 16px; }
.spec-row .v { font-weight: 700; font-size: 13.5px; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }

/* ---------------- Filters ---------------- */
.filter-bar { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; margin-bottom: 24px; }
.filter-group { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.filter-label { font-size: 12.5px; font-weight: 800; color: var(--text-faint); }



/* ---------------- Forms ---------------- */
.field { display: grid; gap: 7px; }
.field > label { font-size: 13px; font-weight: 700; color: var(--text-dim); }
.input, .select, .textarea {
  width: 100%; background: var(--bg-raise); border: 1px solid var(--border); border-radius: 13px;
  padding: 13px 15px; font-size: 14.5px; outline: none; transition: .2s; color: var(--text);
}
.input:focus, .select:focus, .textarea:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--ring); }
.input::placeholder, .textarea::placeholder { color: var(--text-faint); }
.textarea { resize: vertical; min-height: 100px; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-faint) 50%), linear-gradient(135deg, var(--text-faint) 50%, transparent 50%); background-position: 20px 50%, 15px 50%; background-size: 5px 5px; background-repeat: no-repeat; cursor: pointer; padding-inline-end: 34px; }
.select option { background: var(--bg-raise); }

.input-icon { position: relative; }
.input-icon svg { position: absolute; top: 50%; inset-inline-start: 14px; transform: translateY(-50%); width: 18px; height: 18px; color: var(--text-faint); }
.input-icon .input { padding-inline-start: 44px; }

.phone-prefix { display: flex; align-items: center; gap: 12px; }
.phone-prefix .fixed { font-weight: 800; color: var(--text-dim); font-size: 15px; }

.otp { display: flex; gap: 10px; justify-content: center; direction: ltr; }
.otp input {
  width: 52px; height: 60px; text-align: center; font-size: 24px; font-weight: 800;
  background: var(--bg-raise); border: 1px solid var(--border); border-radius: 14px; outline: none; transition: .2s;
}
.otp input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px var(--ring); transform: translateY(-2px); }

.check-card {
  display: flex; align-items: center; gap: 12px; padding: 13px 15px; border-radius: 14px;
  background: var(--card); border: 1px solid var(--border); cursor: pointer; transition: .2s; position: relative;
}
.check-card:hover { border-color: var(--border-strong); transform: translateY(-1px); }
.check-card input { position: absolute; opacity: 0; }
.check-card .ck {
  width: 22px; height: 22px; border-radius: 8px; border: 2px solid var(--border-strong);
  display: grid; place-items: center; transition: .2s; flex-shrink: 0;
}
.check-card .ck svg { width: 13px; height: 13px; color: transparent; }
.check-card input:checked + .ck { background: var(--grad); border-color: transparent; }
.check-card input:checked + .ck svg { color: #fff; }
.check-card:has(input:checked) { border-color: rgba(34,197,94,.45); background: var(--grad-soft); }
.check-card .em { font-size: 24px; }
.check-card b { font-size: 14px; display: block; }
.check-card small { font-size: 11.5px; color: var(--text-faint); }

/* ---------------- Steps wizard ---------------- */
.steps { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 26px 0 30px; }
.step { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.step .bub { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 15px; background: var(--card); border: 2px solid var(--border); color: var(--text-faint); transition: .3s; }
.step .lb { font-size: 11px; font-weight: 700; color: var(--text-faint); }
.step.done .bub { background: var(--grad); color: #0a0f1e; border-color: transparent; }
.step.done .lb { color: var(--brand-2); }
[data-theme="light"] .step.done .bub { color: #fff; }
.step.active .bub { border-color: var(--brand-2); box-shadow: 0 0 0 5px var(--ring); color: var(--brand-2); }
.step.active .lb { color: var(--text); }
.step-line { width: 46px; height: 2px; background: var(--border); border-radius: 2px; margin-bottom: 26px; }
.step-line.done { background: var(--grad); }

/* ---------------- Auth ---------------- */
.auth-wrap { min-height: calc(100vh - var(--nav-h)); display: grid; place-items: center; padding: 30px 0; }
.auth-card { width: min(430px, 100%); }
.auth-logo { text-align: center; margin-bottom: 24px; }
.auth-logo .mark { width: 64px; height: 64px; margin-inline: auto; }
.auth-logo .mark svg { width: 64px; height: 64px; }
.auth-logo h1 { font-size: 22px; margin-top: 14px; }
.auth-logo p { color: var(--text-dim); font-size: 13.5px; }

.choose-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 640px) { .choose-grid { grid-template-columns: repeat(2, 1fr); } }
.choose-item { border-radius: 16px; padding: 14px; text-align: center; }
.choose-item .em { font-size: 30px; }
.choose-item b { display: block; font-size: 13px; margin-top: 6px; }

/* ---------------- Dashboard ---------------- */
.dash-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 22px; align-items: start; }
@media (max-width: 980px) { .dash-grid { grid-template-columns: 1fr; } }
.dash-main { display: grid; gap: 22px; }
.dash-main > * { min-width: 0; }
.dash-side-widget { position: sticky; top: calc(var(--nav-h) + 18px); display: grid; gap: 16px; }
@media (max-width: 980px) { .dash-side-widget { position: static; } }

.welcome-card {
  position: relative; border-radius: var(--radius-lg); overflow: hidden; padding: 26px;
  border: 1px solid var(--border); background: linear-gradient(130deg, rgba(34,197,94,.16), rgba(6,182,212,.1)), var(--card);
}
.welcome-card h1 { font-size: clamp(20px, 2.6vw, 27px); }
.welcome-card p { color: var(--text-dim); margin-top: 6px; font-size: 14px; }
.wc-stats { display: flex; gap: 26px; flex-wrap: wrap; margin-top: 20px; }
.wc-stat b { font-size: 24px; font-weight: 900; }
.wc-stat span { display: block; font-size: 12px; color: var(--text-faint); }
.wc-art { position: absolute; inset-inline-end: 24px; top: 50%; transform: translateY(-50%); opacity: .9; }
.wc-art svg { width: 130px; height: 130px; opacity: .9; }
@media (max-width: 720px) { .wc-art { display: none; } }

.day-tiles { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.day-tile { text-align: center; padding: 10px 4px; border-radius: 13px; background: var(--card); border: 1px solid var(--border); }
.day-tile span { display: block; font-size: 11px; color: var(--text-faint); }
.day-tile b { font-size: 15px; }
.day-tile.today { background: var(--grad); color: #0a0f1e; border-color: transparent; box-shadow: 0 8px 18px -6px rgba(34,197,94,.5); }
[data-theme="light"] .day-tile.today { color: #fff; }
.day-tile.done b { color: var(--brand-2); }

.exercise { display: flex; align-items: center; gap: 13px; padding: 13px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); }
.exercise.done { border-color: rgba(34,197,94,.4); background: var(--grad-soft); }
.exercise .chk { width: 26px; height: 26px; border-radius: 9px; border: 2px solid var(--border-strong); display: grid; place-items: center; cursor: pointer; transition: .2s; flex-shrink: 0; }
.exercise .chk svg { width: 15px; height: 15px; color: transparent; }
.exercise.done .chk { background: var(--grad); border-color: transparent; }
.exercise.done .chk svg { color: #fff; }
.exercise .em { font-size: 24px; }
.exercise .nm { flex: 1; min-width: 0; }
.exercise .nm b { font-size: 14px; display: block; }
.exercise .nm span { font-size: 12px; color: var(--text-faint); display: flex; gap: 8px; flex-wrap: wrap; }
.exercise .nm span i { font-style: normal; display: inline-flex; align-items: center; gap: 4px; }
.exercise .nm span svg { width: 12px; height: 12px; }
.exercise .sets { font-size: 12px; font-weight: 800; color: var(--brand-2); background: var(--grad-soft); padding: 6px 11px; border-radius: 9px; white-space: nowrap; }

.meal { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--card-2, rgba(148,176,219,.06)); border: 1px solid var(--border); }
.meal .em { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 18px; background: var(--card); flex-shrink: 0; }
.meal .nm { flex: 1; min-width: 0; }
.meal .nm b { display: block; font-size: 13.5px; }
.meal .nm span { font-size: 12px; color: var(--text-faint); }
.meal .cal { font-size: 13px; font-weight: 800; color: var(--brand-2); white-space: nowrap; }

.session-card { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); }
.session-time { text-align: center; min-width: 62px; }
.session-time b { display: block; font-size: 20px; font-weight: 900; color: var(--brand-2); line-height: 1.1; }
.session-time span { font-size: 11px; color: var(--text-faint); }
.session-info { flex: 1; }
.session-info b { font-size: 15px; }

.progress-list { display: grid; gap: 13px; }
.progress-row { display: grid; grid-template-columns: 34px 1fr auto; gap: 12px; align-items: center; padding: 13px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); }
.progress-row .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; font-size: 17px; background: var(--card-2); }
.progress-row b { font-size: 14px; }
.progress-row .val { font-weight: 800; font-size: 15px; }
.progress-row .trend { font-size: 11px; font-weight: 800; display: inline-flex; align-items: center; gap: 3px; }

.trend.up { color: var(--ok); } .trend.down { color: var(--danger); }
.trend svg { width: 13px; height: 13px; }

.bar-track { height: 8px; border-radius: 6px; background: var(--card-2); border: 1px solid var(--border); overflow: hidden; }
.bar { height: 100%; border-radius: 6px; background: var(--grad); transition: width 1s cubic-bezier(.2,.8,.3,1); }

/* ---------------- Chat ---------------- */
.chat-list { display: grid; gap: 10px; }
.chat-item { display: flex; gap: 12px; align-items: center; padding: 13px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); transition: .2s; }
.chat-item:hover { border-color: var(--border-strong); transform: translateX(-3px); }
.chat-item .tx { flex: 1; min-width: 0; }
.chat-item .tx b { font-size: 14px; display: block; }
.chat-item .tx span { font-size: 12.5px; color: var(--text-faint); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-item .tm { font-size: 11px; color: var(--text-faint); }
.chat-item .unread { width: 20px; height: 20px; border-radius: 50%; background: var(--grad); color: #0a0f1e; font-size: 11px; font-weight: 800; display: grid; place-items: center; }

.bubble-row { display: flex; gap: 10px; margin-bottom: 14px; }
.bubble-row.me { justify-content: flex-start; flex-direction: row-reverse; }
.bubble { max-width: 78%; padding: 11px 15px; border-radius: 16px; font-size: 14px; line-height: 1.7; }
.bubble.them { background: var(--card-2); border: 1px solid var(--border); border-start-start-radius: 5px; }
.bubble.me { background: var(--grad); color: #0a0f1e; border-end-end-radius: 5px; }
[data-theme="light"] .bubble.me { color: #fff; }
.bubble .tm { display: block; font-size: 10.5px; opacity: .65; margin-top: 5px; direction: ltr; text-align: end; }
.msg-input { display: flex; gap: 10px; padding: 12px; background: var(--card); border: 1px solid var(--border); border-radius: 16px; }
.msg-input .input { border: none; background: transparent; }
.msg-input .btn { border-radius: 12px; }

/* ---------------- Notifications ---------------- */
.notif { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); }
.notif .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.notif .ic svg { width: 19px; height: 19px; }
.notif.sys .ic { background: rgba(59,130,246,.13); color: #60a5fa; }
.notif.workout .ic { background: rgba(34,197,94,.13); color: var(--brand-2); }
.notif.book .ic { background: rgba(245,158,11,.13); color: var(--warn); }
.notif.chat .ic { background: rgba(168,85,247,.13); color: #c084fc; }
.notif .tx { flex: 1; }
.notif .tx b { font-size: 14px; display: block; }
.notif .tx p { font-size: 13px; color: var(--text-dim); }
.notif .tx span { font-size: 11px; color: var(--text-faint); }

/* ---------------- Stats / progress bars ---------------- */
.stat-card { padding: 18px; display: flex; gap: 14px; align-items: center; }
.stat-card .ic { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; flex-shrink: 0; }
.stat-card .ic svg { width: 22px; height: 22px; }
.stat-card b { font-size: 22px; font-weight: 900; display: block; line-height: 1.2; }
.stat-card span { font-size: 12.5px; color: var(--text-faint); }

.timeline { position: relative; padding-inline-start: 24px; }
.timeline::before { content: ""; position: absolute; inset-inline-start: 8px; top: 6px; bottom: 6px; width: 2px; background: var(--border); }
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item::before { content: ""; position: absolute; inset-inline-start: -20px; top: 6px; width: 12px; height: 12px; border-radius: 50%; background: var(--grad); box-shadow: 0 0 0 4px var(--grad-soft); }
.tl-item b { font-size: 14px; display: block; }
.tl-item span { font-size: 12.5px; color: var(--text-dim); }
.tl-item .d { font-size: 11px; color: var(--text-faint); direction: ltr; text-align: end; margin-top: 2px; }

/* ---------------- Tables ---------------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 560px; }
thead th { text-align: start; padding: 13px 16px; background: var(--card-2); color: var(--text-faint); font-size: 12px; font-weight: 800; white-space: nowrap; }
tbody td { padding: 13px 16px; border-top: 1px solid var(--border); }
tbody tr { transition: .15s; }
tbody tr:hover { background: var(--card-2); }
.pill { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 800; padding: 4px 11px; border-radius: 999px; }
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.ok { background: rgba(34,197,94,.12); color: var(--ok); }
.pill.warn { background: rgba(245,158,11,.12); color: var(--warn); }
.pill.danger { background: rgba(244,63,94,.12); color: var(--danger); }
.pill.info { background: rgba(59,130,246,.12); color: #60a5fa; }
.pill.neutral { background: var(--card-2); color: var(--text-dim); }

/* ---------------- Footer ---------------- */
.footer { margin-top: 50px; border-top: 1px solid var(--border); background: var(--bg-soft); }
.footer-inner { padding: 44px 0 30px; display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 30px; }
@media (max-width: 900px) { .footer-inner { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .footer-inner { grid-template-columns: 1fr; } }
.footer h5 { font-size: 14px; margin-bottom: 14px; }
.footer ul { display: grid; gap: 9px; }
.footer ul a { color: var(--text-dim); font-size: 13.5px; transition: .2s; display: inline-flex; align-items: center; gap: 6px; }
.footer ul a:hover { color: var(--brand-2); transform: translateX(-3px); }
.footer-about p { color: var(--text-dim); font-size: 13.5px; margin-top: 12px; max-width: 340px; }
.footer-bottom { border-top: 1px solid var(--border); padding: 18px 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--text-faint); font-size: 12.5px; }
.social { display: flex; gap: 9px; }
.social a { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--card); border: 1px solid var(--border); color: var(--text-dim); transition: .2s; }
.social a:hover { color: var(--brand-2); border-color: var(--border-strong); transform: translateY(-2px); }
.social svg { width: 18px; height: 18px; }

/* ---------------- Modal / Toast ---------------- */
#modal-root { position: fixed; inset: 0; z-index: 300; display: none; place-items: center; padding: 20px; }
#modal-root.open { display: grid; }
.modal-back { position: absolute; inset: 0; background: rgba(4,8,18,.72); backdrop-filter: blur(6px); }
.modal {
  position: relative; width: min(520px, 100%); max-height: 88vh; overflow-y: auto;
  background: var(--bg-raise); border: 1px solid var(--border-strong); border-radius: 22px;
  padding: 26px; box-shadow: var(--shadow-lg); animation: pop .35s cubic-bezier(.2,.9,.3,1.2);
}
.modal-x {
  position: absolute; top: 13px; inset-inline-end: 13px; z-index: 2;
  width: 30px; height: 30px; border-radius: 50%; padding: 0;
  display: grid; place-items: center;
  background: var(--card); border: 1px solid var(--border-strong);
  color: var(--text-dim); cursor: pointer; transition: .2s;
}
.modal-x:hover { color: var(--danger); border-color: var(--danger); background: color-mix(in srgb, var(--danger) 9%, transparent); }
.modal-x svg { width: 15px; height: 15px; pointer-events: none; }
@keyframes pop { from { opacity: 0; transform: scale(.92) translateY(10px); } to { opacity: 1; transform: none; } }

#toast-root { position: fixed; bottom: 24px; inset-inline: 0; z-index: 400; display: grid; gap: 10px; justify-items: center; pointer-events: none; }
.toast {
  display: flex; align-items: center; gap: 11px; padding: 13px 20px; border-radius: 14px;
  background: var(--bg-raise); border: 1px solid var(--border-strong); box-shadow: var(--shadow);
  font-size: 14px; font-weight: 600; animation: rise .35s cubic-bezier(.2,.9,.3,1.2);
  pointer-events: auto; max-width: 92vw;
}
.toast svg { width: 19px; height: 19px; color: var(--brand-2); flex-shrink: 0; }
.toast.ok svg { color: var(--ok); } .toast.err svg { color: var(--danger); } .toast.warn svg { color: var(--warn); }
.toast.out { animation: riseout .3s forwards; }
@keyframes rise { from { opacity: 0; transform: translateY(20px) scale(.95);} to { opacity: 1; transform: none;} }
@keyframes riseout { to { opacity: 0; transform: translateY(14px) scale(.96);} }

/* ---------------- Weekly plan + motivational moments ---------------- */
.week-card { padding: 18px; background: var(--grad-soft); border-color: transparent; }
.week-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.week-head b { font-size: 16px; }
.week-sub { font-size: 12.5px; color: var(--text-dim); margin-bottom: 12px; }
.week-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.week-day {
  display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 9px 2px;
  border-radius: 13px; border: 1px solid var(--border); background: var(--bg-raise);
  cursor: pointer; transition: transform .18s, border-color .18s, background .18s;
  position: relative; overflow: hidden; min-width: 0;
}
.week-day:hover { transform: translateY(-3px); border-color: var(--brand-2); }
.week-day .wd-name { font-size: 12px; font-weight: 700; }
.week-day .wd-date { font-size: 11px; color: var(--text-faint); }
.week-day .wd-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.week-day.has-plan .wd-dot { background: var(--brand-2); }
/* days the athlete has club time: distinct colour */
.week-day.club-time { background: linear-gradient(160deg, rgba(34,197,94,.22), rgba(34,197,94,.06)); border-color: rgba(34,197,94,.45); }
.week-day.club-time .wd-date { color: var(--ok); font-weight: 700; }
.week-day.club-time::after {
  content: ""; position: absolute; inset-inline: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, transparent, var(--ok), transparent);
}
.week-day.today { box-shadow: 0 0 0 2px var(--brand-2) inset; }
.week-day.sel { border-color: var(--brand-2); background: color-mix(in srgb, var(--brand-2) 14%, var(--bg-raise)); }
.week-day .wd-clock { font-size: 10px; color: var(--ok); font-weight: 700; }
.week-legend { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: 11.5px; color: var(--text-faint); }
.week-legend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; margin-inline-end: 4px; }
.week-legend .lg-club { background: var(--ok); }
.week-legend .lg-plan { background: var(--brand-2); }
.week-plan-box { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }
.week-plan-box h4 { margin: 0 0 4px; font-size: 14px; }
.week-plan-box p { margin: 0; font-size: 12.5px; color: var(--text-dim); }

/* power burst on a completed tick */
@keyframes powerBurst {
  0% { transform: scale(.4); opacity: 0; }
  35% { transform: scale(1.25); opacity: 1; }
  60% { transform: scale(.9); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes powerRing {
  0% { transform: scale(.5); opacity: .9; }
  100% { transform: scale(2.4); opacity: 0; }
}
@keyframes boltFlash { 0%,100% { filter: none; } 50% { filter: brightness(1.8) saturate(1.5); } }
.power-fx { position: fixed; inset: 0; pointer-events: none; z-index: 420; display: grid; place-items: center; }
.power-ring {
  position: absolute; width: 120px; height: 120px; border-radius: 50%;
  border: 3px solid var(--brand-2); animation: powerRing .6s ease-out forwards;
}
.power-core { animation: powerBurst .7s cubic-bezier(.2,.9,.3,1.4), boltFlash .5s ease-in-out 2; font-size: 54px; }
.power-fade { animation: riseout .45s ease-in .95s forwards; }

/* motivational message overlay */
.motiv-overlay {
  position: fixed; inset: 0; z-index: 430; display: grid; place-items: center;
  background: radial-gradient(circle at 50% 45%, rgba(10,15,30,.72), rgba(4,8,18,.92));
  padding: 20px; animation: motivIn .3s ease;
}
.motiv-box {
  max-width: 560px; width: 100%; text-align: center; padding: 30px 26px; border-radius: 24px;
  background: var(--bg-raise); border: 1px solid var(--border-strong); box-shadow: var(--shadow-lg, var(--shadow));
  animation: powerBurst .6s cubic-bezier(.2,.9,.3,1.3);
}
.motiv-box .mb-em { font-size: 52px; line-height: 1; }
.motiv-box .mb-text { font-size: 19px; font-weight: 800; margin: 14px 0 6px; line-height: 1.7; }
.motiv-box .mb-sub { font-size: 13px; color: var(--text-dim); }
.motiv-box .mb-ok { margin-top: 18px; }
@keyframes motivIn { from { opacity: 0; } to { opacity: 1; } }
.motiv-box.shake-win { animation: bigShake .6s ease; }
@keyframes bigShake {
  0%,100% { transform: translateX(0); }
  10% { transform: translateX(-14px) rotate(-1.5deg); }
  20% { transform: translateX(12px) rotate(1.2deg); }
  30% { transform: translateX(-10px) rotate(-1deg); }
  40% { transform: translateX(8px) rotate(.8deg); }
  50% { transform: translateX(-6px); }
  60% { transform: translateX(5px); }
  70% { transform: translateX(-3px); }
  80% { transform: translateX(2px); }
}
body.sm-shake { animation: bodyShake .55s cubic-bezier(.36,.07,.19,.97); }
@keyframes bodyShake {
  0%,100% { transform: translate(0,0); }
  10% { transform: translate(-10px, 4px); }
  20% { transform: translate(9px, -5px); }
  30% { transform: translate(-8px, 3px); }
  40% { transform: translate(7px, -3px); }
  50% { transform: translate(-5px, 2px); }
  60% { transform: translate(4px, -2px); }
  70% { transform: translate(-3px, 1px); }
  80% { transform: translate(2px, -1px); }
  90% { transform: translate(-1px, 0); }
}
@media (prefers-reduced-motion: reduce) {
  body.sm-shake { animation: none; }
  .motiv-box, .motiv-box.shake-win { animation: none; }
  .power-core, .power-ring { animation: none; }
}

/* ---------------- Misc ---------------- */
.hero-dots { display: flex; gap: 6px; }
.hero-dots span { width: 7px; height: 7px; border-radius: 50%; background: var(--border-strong); transition: .2s; }
.hero-dots span.on { background: var(--brand-2); width: 22px; border-radius: 6px; }

.empty { text-align: center; padding: 50px 20px; color: var(--text-faint); }
.empty .em { font-size: 56px; margin-bottom: 12px; }
.empty h3 { color: var(--text); margin-bottom: 6px; }
.empty p { font-size: 13.5px; max-width: 380px; margin-inline: auto; }

.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--text-faint); font-size: 13px; font-weight: 600; flex-wrap: wrap; margin-bottom: 18px; }
.breadcrumb a { transition: .2s; } .breadcrumb a:hover { color: var(--brand-2); }
.breadcrumb svg { width: 14px; height: 14px; }

.divider { height: 1px; background: var(--border); margin: 18px 0; }

.pagination { display: flex; justify-content: center; gap: 8px; margin-top: 26px; }
.pagination button { width: 40px; height: 40px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); font-weight: 700; color: var(--text-dim); transition: .2s; }
.pagination button:hover { border-color: var(--border-strong); color: var(--text); }
.pagination button.active { background: var(--grad); color: #0a0f1e; border-color: transparent; }
[data-theme="light"] .pagination button.active { color: #fff; }

.lesson-list { display: grid; gap: 8px; }
.lesson { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 13px; background: var(--card); border: 1px solid var(--border); }
.lesson .idx { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; font-weight: 800; font-size: 13px; background: var(--card-2); color: var(--text-dim); flex-shrink: 0; }
.lesson.done .idx { background: var(--grad); color: #0a0f1e; }
[data-theme="light"] .lesson.done .idx { color: #fff; }
.lesson .tx { flex: 1; }
.lesson .tx b { font-size: 13.5px; display: block; }
.lesson .tx span { font-size: 11.5px; color: var(--text-faint); }
.lesson .play { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--grad-soft); color: var(--brand-2); flex-shrink: 0; }
.lesson .play svg { width: 15px; height: 15px; }

.list-big { display: grid; gap: 14px; }
.row-item { display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 16px; background: var(--card); border: 1px solid var(--border); transition: .2s; }
.row-item:hover { border-color: var(--border-strong); transform: translateX(-3px); }
.row-item .em { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 25px; flex-shrink: 0; border: 1px solid var(--border); }
.row-item .tx { flex: 1; min-width: 0; }
.row-item .tx b { font-size: 15px; display: block; }
.row-item .tx p { font-size: 12.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-item .meta { font-size: 12px; color: var(--text-faint); font-weight: 700; }

.search-empty-line { text-align:center; color: var(--text-faint); padding: 30px 10px; font-size: 14px; }

/* ---------------- Profile card sections ---------------- */
.pf-card .panel h3 { margin-bottom: 10px; }
.tr-wrap { display: flex; align-items: flex-end; gap: 8px; height: 84px; }
.tr-bar { flex: 1; min-width: 12px; border-radius: 8px 8px 0 0; background: linear-gradient(180deg, var(--brand-2), rgba(34,197,94,.28)); position: relative; transition: .2s; }
.tr-bar:hover { filter: brightness(1.15); }
.tr-bar i { position: absolute; top: -18px; left: 50%; transform: translateX(-50%); font-style: normal; font-weight: 700; font-size: 10.5px; color: var(--text-dim); white-space: nowrap; }
.av-field { display: block; margin: 10px 0 2px; }
.av-field .k, .av-check { font-size: 12.5px; font-weight: 600; color: var(--text-dim); margin-bottom: 6px; display: block; }
.av-field .input { width: 100%; }
.av-times { display: flex; gap: 10px; }
.av-times .av-field { flex: 1; }
.av-check { display: flex; align-items: center; gap: 8px; margin-top: 12px; color: var(--text); }
.av-check input { width: 16px; height: 16px; accent-color: var(--brand-2); }
.modal-acts { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* ---------------- Sport combobox (Google-style) ---------------- */
.sm-combo { position: relative; }
.sm-combo-input { width: 100%; }
.sm-combo-list { position: absolute; z-index: 90; top: calc(100% + 6px); right: 0; left: 0; max-height: 270px; overflow: auto; background: var(--card); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.28); padding: 6px; }
.sm-combo-head { font-size: 11.5px; font-weight: 700; color: var(--text-faint); padding: 6px 8px 4px; }
.sm-combo-item { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; color: var(--text); text-decoration: none; }
.sm-combo-item:hover { background: color-mix(in srgb, var(--brand-2) 14%, transparent); }
.sm-combo-item.sel { background: color-mix(in srgb, var(--brand-2) 10%, transparent); }
.sm-combo-item .em { font-size: 16px; width: 26px; text-align: center; }
.sm-combo-item .tx { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.sm-combo-item b { font-size: 13px; font-weight: 600; }
.sm-combo-item i { font-style: normal; font-size: 11px; color: var(--text-faint); direction: ltr; text-align: right; }
.sm-combo-item .ck { color: var(--brand-2); }
.sm-combo-empty { padding: 16px 10px; text-align: center; color: var(--text-faint); font-size: 13px; }

/* ---------------- Body history chart ---------------- */
.bc-chart { width: 100%; height: auto; margin-top: 8px; }
.bc-chart polyline { fill: none; stroke: var(--brand-2); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.bc-chart circle { stroke: var(--card); stroke-width: 2; }
.bc-grid { stroke: var(--line); stroke-width: 1; stroke-dasharray: 4 5; }
.bc-txt { font-size: 10.5px; fill: var(--text-faint); font-weight: 600; }
.meas-lock { color: var(--text-faint); font-size: 13px; padding: 4px 2px; cursor: default; }

/* ---------------- Body history charts grid ---------------- */
.meas-charts { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; margin: 4px 0 16px; }
.meas-chart { background: var(--card-2); border: 1px solid var(--border); border-radius: 14px; padding: 12px 12px 8px; }
.meas-chart .mc-title { font-size: 12.5px; font-weight: 700; color: var(--text-dim); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.meas-chart .mc-last { font-size: 11px; color: var(--brand-2); font-weight: 800; }
.meas-chart .bc-chart { margin-top: 4px; }
.meas-chart .spec-row { padding: 8px 0; }
@media (max-width: 760px) { .meas-charts { grid-template-columns: 1fr; } }

/* ---------------- Daily body-status form ---------------- */
.meas-daily-note { font-size: 12px; color: var(--text-faint); margin-top: 8px; line-height: 1.9; }
@media (max-width: 760px) { .meas-daily-grid { grid-template-columns: 1fr; } }

/* ---------------- Responsive ---------------- */
@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 520px; margin-top: 10px; }
  .hero-float.f1 { inset-inline-end: auto; inset-inline-start: 12px; }
}
@media (max-width: 760px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .pf-card .grid-2 { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .nav-cta { display: none; }
  :root { --bottnav-h: 68px; }
  .bottom-nav { display: flex; }
  main { margin-bottom: calc(var(--bottnav-h) / 2); }
  .hero { padding-top: 28px; }
  .section { padding: 34px 0; }
  .link-more { display: none; }
  .footer-inner { gap: 20px; }
  .event-card { flex-wrap: wrap; }
  .event-side { width: 100%; text-align: start; }
}
@media (max-width: 520px) {
  .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .av-times { flex-direction: column; gap: 0; }
  .choose-grid { grid-template-columns: repeat(2, 1fr); }
  .hero-stats { gap: 22px; }
  .hero-float.f2 { inset-inline-start: 6px; }
  .otp input { width: 46px; height: 54px; font-size: 21px; }
}

/* profile skeleton (loading) */
.pf-skel {
  background: linear-gradient(100deg, var(--bg-raise) 25%, var(--border) 50%, var(--bg-raise) 75%);
  background-size: 200% 100%;
  animation: pfShimmer 1.2s linear infinite;
  border-radius: 10px;
}
@keyframes pfShimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }

/* ============================================================
   Chat UI (Gate 6)
   ============================================================ */
.chat-toolbar { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.chat-toolbar .kicker { font-size: 12.5px; font-weight: 800; color: var(--brand-2); }
.chat-toolbar .kicker::before { content: ""; width: 22px; height: 3px; border-radius: 3px; background: var(--grad); display: inline-block; vertical-align: middle; margin-inline-end: 6px; }
.chat-title { font-size: 26px; font-weight: 900; margin-top: 4px; }
.chat-toolbar-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.chat-search { position: relative; }
.chat-search svg { position: absolute; inset-inline-start: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-faint); pointer-events: none; }
.chat-search .input { padding-inline-start: 38px; width: 230px; }

.chat-shell { display: grid; grid-template-columns: minmax(300px, 360px) 1fr; gap: 16px; align-items: start; }
.chat-pane { min-width: 0; border-radius: 18px; border: 1px solid var(--border); background: var(--bg-raise); overflow: hidden; }
.chat-pane-list { display: flex; flex-direction: column; height: calc(100vh - 250px); min-height: 420px; }
.chat-pane-detail { display: flex; flex-direction: column; height: calc(100vh - 250px); min-height: 420px; }

/* ---------------- list ---------------- */
.chat-list, .chat-flex { display: flex; flex-direction: column; }
.chat-list { gap: 8px; flex: 1; overflow-y: auto; padding: 12px; margin: 0; }
.chat-flex { align-items: center; justify-content: center; flex: 1; }
.chat-item-row { cursor: pointer; }
.chat-item-row:hover { border-color: var(--border-strong); transform: translateX(-3px); }
.chat-item-row.active { border-color: var(--brand-2); background: var(--grad-soft); }
.chat-item-row.active .chat-item-title { color: var(--brand-2); }
.chat-av {
  --av: #22c55e;
  width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0;
  display: grid; place-items: center; font-size: 15px; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--av), rgba(0,0,0,.38));
}
.chat-av.md { width: 44px; height: 44px; font-size: 17px; border-radius: 14px; }
.chat-item-top { display: flex; align-items: center; gap: 8px; }
.chat-item-title { font-size: 14px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-hide-btn {
  flex-shrink: 0; display: grid; place-items: center; width: 26px; height: 26px;
  border-radius: 9px; border: none; background: transparent; color: var(--text-faint);
  cursor: pointer; opacity: 0; transition: .15s;
}
.chat-item-row:hover .chat-hide-btn,
.chat-hide-btn:hover, .chat-hide-btn:focus-visible { opacity: 1; }
.chat-hide-btn:hover { color: var(--danger, #ef4444); background: rgba(239, 68, 68, .12); }
.chat-del-btn { opacity: 0; color: var(--danger, #ef4444); }
.chat-del-btn:hover { background: rgba(239, 68, 68, .18); opacity: 1; }
.tm { font-size: 11px; color: var(--text-faint); direction: ltr; white-space: nowrap; flex-shrink: 0; }
.chat-item-sub { display: flex; align-items: center; margin-top: 5px; min-width: 0; gap: 6px; }
.chat-preview { font-size: 12.5px; color: var(--text-dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; min-width: 0; }
.chat-preview.muted { color: var(--text-faint); }
.chat-unread { min-width: 20px; height: 20px; border-radius: 999px; background: var(--grad); color: #0a0f1e; font-size: 11px; font-weight: 800; display: grid; place-items: center; padding-inline: 6px; flex-shrink: 0; }
[data-theme="light"] .chat-unread { color: #fff; }
.chat-closed { font-size: 10.5px; font-weight: 800; color: var(--warn); background: rgba(245,158,11,.12); padding: 3px 8px; border-radius: 7px; white-space: nowrap; }

/* ---------------- detail ---------------- */
.chat-detail { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.chat-head { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.chat-head-tx { flex: 1; min-width: 0; }
.chat-head-tx b { font-size: 15px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head-tx span { font-size: 12px; color: var(--text-faint); }
.chat-head-actions { display: flex; gap: 6px; }
.chat-scroll { flex: 1; overflow-y: auto; padding: 16px 14px; min-height: 0; }
.chat-older { text-align: center; padding: 4px 0 14px; }

/* bubbles */
.bubble-row { display: flex; margin-bottom: 12px; }
.bubble-row.me { justify-content: flex-end; }
.bubble-row.them { justify-content: flex-start; }
.bubble-sender { font-size: 11.5px; font-weight: 700; color: var(--brand-2); margin-bottom: 3px; }
.bubble-ref { border-inline-start: 3px solid var(--border-strong); padding-inline-start: 9px; margin-bottom: 6px; }
.bubble-ref span { font-size: 11px; color: var(--text-faint); font-weight: 600; }
.bubble-ref p { font-size: 12px; color: var(--text-dim); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bubble-body { overflow-wrap: anywhere; }
.bubble-meta { display: flex; align-items: center; gap: 8px; margin-top: 6px; direction: ltr; justify-content: flex-end; }
.bubble.me .bubble-meta { flex-direction: row-reverse; }
.edited { font-size: 10px; color: var(--text-faint); font-weight: 600; }
.bubble-acts { display: inline-flex; gap: 2px; align-items: center; }
.mini-btn { width: 25px; height: 25px; border-radius: 8px; display: inline-grid; place-items: center; background: transparent; border: 1px solid transparent; color: var(--text-faint); cursor: pointer; transition: .15s; }
.mini-btn svg { width: 13px; height: 13px; }
.mini-btn:hover { background: var(--card-2); color: var(--text); }
.mini-btn.danger:hover { color: var(--danger); border-color: rgba(244,63,94,.35); background: rgba(244,63,94,.12); }

/* composer */
.chat-composer { border-top: 1px solid var(--border); padding: 12px 14px; background: var(--bg-raise); flex-shrink: 0; }
.composer-strip { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; padding: 8px 12px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--border); }
.cs-tx { flex: 1; min-width: 0; }
.cs-tx b { font-size: 12.5px; display: block; }
.cs-tx span { font-size: 12px; color: var(--text-faint); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-ta { min-height: 44px; max-height: 140px; resize: none; line-height: 1.6; padding: 11px 13px; }
.chat-ta[dir="auto"] { text-align: start; }
.chat-send { flex-shrink: 0; }
.chat-counter { font-size: 11px; color: var(--text-faint); text-align: end; margin-top: 6px; }
.spinner-mini { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--brand-2); animation: spin .7s linear infinite; display: inline-block; }
.chat-send .spinner-mini { border-color: rgba(255,255,255,.4); border-top-color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }

/* compat shims for classes referenced by JS but missing from the kit */
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--border-strong); border-top-color: var(--brand-2); animation: spin .7s linear infinite; display: inline-block; vertical-align: -3px; }
.text-dim { color: var(--text-dim, var(--text-faint)); }
.ltr { direction: ltr; unicode-bidi: embed; }
.chat-page { display: flex; flex-direction: column; gap: 12px; }
.col-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 720px) { .col-2 { grid-template-columns: 1fr; } }

/* members */
.mem-row { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 13px; background: var(--card); border: 1px solid var(--border); }
.mem-row .tx { flex: 1; min-width: 0; }
.mem-row .tx b { font-size: 13.5px; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mem-row .tx span { font-size: 12px; color: var(--text-faint); }

/* settings */
.set-row { display: flex; align-items: center; gap: 12px; padding: 11px 13px; border-radius: 13px; background: var(--card); border: 1px solid var(--border); }
.set-row .text { flex: 1; min-width: 0; }
.set-row .text b { font-size: 13.5px; display: block; }
.set-row .text small { font-size: 11.5px; color: var(--text-faint); }
.set-row.off { cursor: default; }
.set-row .badge { width: 10px; height: 10px; border-radius: 50%; background: var(--border-strong); flex-shrink: 0; }
.set-row .badge.on { background: var(--brand-2); box-shadow: 0 0 0 4px var(--grad-soft); }
.switch { appearance: none; -webkit-appearance: none; width: 42px; height: 24px; border-radius: 999px; background: var(--card-2); border: 1px solid var(--border-strong); position: relative; cursor: pointer; transition: .2s; flex-shrink: 0; }
.switch::after { content: ""; position: absolute; top: 2px; inset-inline-start: 2px; width: 18px; height: 18px; border-radius: 50%; background: var(--text-dim); transition: .2s; }
.switch:checked { background: var(--grad); border-color: transparent; }
.switch:checked::after { inset-inline-start: calc(100% - 20px); background: #fff; }

/* skeleton */
.ske-row { display: flex; gap: 12px; align-items: center; padding: 13px 4px; }
.ske-av { width: 42px; height: 42px; border-radius: 13px; flex-shrink: 0; }
.ske-av.md { width: 44px; height: 44px; border-radius: 14px; }
.ske-tx { flex: 1; height: 13px; border-radius: 8px; }
.ske-hd { width: 180px; height: 14px; border-radius: 8px; }
.ske-line { height: 12px; border-radius: 8px; margin-bottom: 10px; }
.ske-line.short { width: 55%; }
.ske-inp { height: 46px; border-radius: 12px; }
.ske-av, .ske-tx, .ske-hd, .ske-line, .ske-inp {
  background: linear-gradient(100deg, var(--bg-raise) 25%, var(--border) 50%, var(--bg-raise) 75%);
  background-size: 200% 100%;
  animation: pfShimmer 1.2s linear infinite;
}

/* responsive chat */
@media (max-width: 899px) {
  .chat-shell { grid-template-columns: 1fr; align-items: stretch; }
  .chat-pane-list, .chat-pane-detail { height: auto; min-height: 0; }
  .chat-pane-detail { display: none; }
  body.chat-open .chat-pane-list { display: none; }
  body.chat-open .chat-pane-detail { display: flex; min-height: calc(100vh - 320px); }
  .chat-list { overflow: visible; max-height: none; }
  .chat-search { flex: 1; }
  .chat-search .input { width: 100%; }
  .chat-scroll { padding-inline: 10px; }
}

/* ---------- Club manager panel ---------- */
.club-ctx { display: flex; align-items: center; gap: 14px; padding: 18px; flex-wrap: wrap; }
.club-av { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; flex-shrink: 0; font-size: 22px; font-weight: 800; color: var(--brand-2); background: var(--grad-soft); border: 1px solid rgba(34,197,94,.25); }
.club-ctx .tx { flex: 1; min-width: 200px; }
.club-ctx .tx b { font-size: 17px; display: block; }
.club-ctx .meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 6px; color: var(--text-faint); font-size: 12.5px; }
.club-ctx .meta svg { width: 13px; height: 13px; }

.pnav { display: flex; gap: 7px; flex-wrap: wrap; margin: 18px 0; }
.pnav a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 700; color: var(--text-dim); background: var(--card); border: 1px solid var(--border); transition: .18s; }
.pnav a svg { width: 14px; height: 14px; }
.pnav a:hover { border-color: var(--border-strong); color: var(--text); transform: translateY(-1px); }
.pnav a.on { background: var(--grad); border-color: transparent; color: #fff; }

.stat-link { appearance: none; -webkit-appearance: none; background: none; border: none; padding: 0; margin: 0; text-align: start; cursor: pointer; width: 100%; font: inherit; }
.stat-link .stat-card { transition: .18s; height: 100%; }
.stat-link:hover .stat-card { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow); }

.mini-btn { appearance: none; -webkit-appearance: none; width: 100%; display: flex; align-items: center; gap: 8px; padding: 11px 13px; border-radius: 12px; background: var(--card-2); border: 1px solid var(--border); color: var(--text-dim); font-size: 13px; font-weight: 700; cursor: pointer; transition: .18s; }
.mini-btn svg { width: 15px; height: 15px; }
.mini-btn:hover { border-color: var(--border-strong); color: var(--text); background: var(--bg-raise); }

.banner-note { display: flex; gap: 8px; align-items: center; font-size: 12.5px; line-height: 1.7; color: #60a5fa; background: rgba(59,130,246,.08); border: 1px dashed rgba(59,130,246,.35); border-radius: 12px; padding: 11px 13px; }
.banner-note svg { width: 15px; height: 15px; flex-shrink: 0; }

.modal-head { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.modal-head svg { width: 17px; height: 17px; color: var(--brand-2); }

.form-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }

.avpick { display: grid; gap: 8px; }
.avpick label, label.avpick { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.avpick input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--brand-2); flex-shrink: 0; }

.tbl-user { display: flex; gap: 10px; align-items: center; min-width: 0; }
.tbl-user b { font-size: 13.5px; display: block; }
.tbl-user small { font-size: 11.5px; color: var(--text-faint); display: block; }
.tbl-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

@media (max-width: 640px) {
  .form-grid2 { grid-template-columns: 1fr; }
  .pnav { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
  .pnav::-webkit-scrollbar { display: none; }
  .club-ctx { padding: 14px; }
}

/* ---- role panel shell: right sidebar (RTL: first grid column = right) ---- */
.panel-layout { display: grid; grid-template-columns: 264px minmax(0, 1fr); gap: 18px; align-items: start; margin-top: 18px; }
.pside { position: sticky; top: calc(var(--nav-h) + 18px); background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 18px 14px; }
.pside-head { display: flex; align-items: center; gap: 12px; padding: 2px 4px 12px; border-bottom: 1px solid var(--border); }
.pside-head .mark { width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center; background: var(--grad-soft, rgba(34,197,94,.12)); color: var(--brand-2); flex-shrink: 0; font-size: 22px; }
.pside-head b { display: block; font-size: 14.5px; }
.pside-head span { display: block; font-size: 12px; color: var(--text-faint); margin-top: 2px; line-height: 1.6; }
.pside-ctx { margin-top: 12px; font-size: 12.5px; color: var(--text-dim); background: var(--bg-raise, rgba(148,176,219,.07)); border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; line-height: 1.9; }
.pside-sec { font-size: 11.5px; font-weight: 800; color: var(--text-faint); margin: 14px 4px 6px; }
.pside-nav { display: grid; gap: 5px; }
.pside-nav a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 13.5px; font-weight: 700; color: var(--text-dim); border: 1px solid transparent; transition: .16s; text-decoration: none; }
.pside-nav a svg { width: 17px; height: 17px; flex-shrink: 0; }
.pside-nav a small { margin-inline-start: auto; font-size: 11px; color: var(--text-faint); font-weight: 400; }
.pside-nav a:hover { border-color: var(--border-strong); color: var(--text); background: var(--bg-raise, rgba(148,176,219,.07)); }
.pside-nav a.on { background: var(--grad); border-color: transparent; color: #fff; }
.pside-nav a.on small { color: rgba(255,255,255,.75); }
.pbody { min-width: 0; }
.pbody > .panel:first-child, .pbody > .breadcrumb + .panel { margin-top: 0; }
@media (max-width: 920px) {
  .panel-layout { grid-template-columns: 1fr; }
  .pside { position: static; padding: 12px; }
  .pside-head { border: 0; padding-bottom: 8px; }
  .pside-ctx, .pside-sec { display: none; }
  .pside-nav { grid-auto-flow: column; grid-template-rows: auto auto; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
  .pside-nav::-webkit-scrollbar { display: none; }
  .pside-nav a { white-space: nowrap; }
}

/* ---------------- Profile avatar uploader ---------------- */
.pf-avatar-row { grid-column: 1 / -1; }
.pf-avatar-upload {
  display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 14px 16px; border: 1.5px dashed var(--border-strong);
  border-radius: var(--radius); background: var(--bg-raise);
  cursor: pointer; transition: .18s;
}
.pf-avatar-upload:hover, .pf-avatar-upload.drag { border-color: var(--brand-2); background: var(--grad-soft); }
.pf-avatar-pick { position: relative; width: 92px; height: 92px; flex-shrink: 0; }
.pf-avatar-frame {
  width: 92px; height: 92px; border-radius: 50%; overflow: hidden;
  display: grid; place-items: center;
  background: var(--grad-soft); border: 2px solid var(--border);
}
.pf-avatar-frame img, .pf-avatar-frame .avatar {
  width: 100% !important; height: 100% !important;
  object-fit: cover; border-radius: 50%; font-size: 30px;
}
.pf-avatar-cam {
  position: absolute; bottom: 2px; inset-inline-end: 2px; width: 26px; height: 26px;
  border-radius: 50%; display: grid; place-items: center;
  background: var(--brand-2); color: #fff;
  border: 2.5px solid var(--card); box-shadow: 0 2px 8px rgba(0,0,0,.18);
}
.pf-avatar-cam svg { width: 13px; height: 13px; }
.pf-avatar-meta { flex: 1; min-width: 170px; display: grid; gap: 3px; }
.pf-avatar-meta b { font-size: 13.5px; color: var(--text); }
.pf-avatar-meta small { font-size: 12px; color: var(--text-faint); line-height: 1.6; }

/* ---------------- User menu (profile avatar in the navbar) ---------------- */
.user-menu { position: relative; display: inline-flex; }
.user-chip {
  appearance: none; -webkit-appearance: none;
  display: inline-flex; align-items: center; gap: 7px;
  height: 40px; padding: 3px 9px 3px 7px;
  border-radius: 999px; background: var(--card);
  border: 1px solid var(--border); cursor: pointer; transition: .18s;
  color: var(--text-dim);
}
.user-chip .avatar { width: 32px; height: 32px; font-size: 13px; }
.user-chip svg { width: 13px; height: 13px; transition: transform .2s; }
.user-chip[aria-expanded="true"] svg { transform: rotate(90deg); }
.user-chip:hover { border-color: var(--brand-2); color: var(--text); transform: translateY(-1px); }

.user-dd {
  position: absolute; top: calc(100% + 10px); inset-inline-end: 0;
  width: 266px; background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: 0 18px 48px rgba(0,0,0,.28);
  padding: 10px; z-index: 300;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: .18s; pointer-events: none;
}
.user-dd.open { opacity: 1; visibility: visible; transform: translateY(0); pointer-events: auto; }
.user-dd-head {
  display: flex; align-items: center; gap: 12px; padding: 10px 8px 12px;
  border-bottom: 1px solid var(--border); margin-bottom: 8px;
}
.user-dd-head .avatar { width: 46px; height: 46px; font-size: 18px; flex-shrink: 0; }
.user-dd-head img.avatar { width: 46px; height: 46px; }
.user-dd-head b { font-size: 14.5px; display: block; color: var(--text); }
.user-dd-head span { font-size: 12px; color: var(--text-faint); display: block; margin-top: 2px; }
.user-dd-grid { display: grid; gap: 2px; max-height: 320px; overflow: auto; }
.user-dd-i {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: 10px; font-size: 13.5px; font-weight: 600; color: var(--text-dim);
  transition: .15s; text-decoration: none;
}
.user-dd-i svg { width: 17px; height: 17px; color: var(--brand-2); flex-shrink: 0; }
.user-dd-i:hover { background: var(--grad-soft); color: var(--text); }
.user-dd-foot { padding-top: 8px; margin-top: 8px; border-top: 1px solid var(--border); }
.user-dd-foot .btn { width: 100%; }

/* ---- cascading (grouped) sidebar sections ---- */
.pside-group { border: 0; padding: 0; margin: 0; }
.pside-group + .pside-group, .pside-nav > a + .pside-group, .pside-group + a { margin-top: 4px; }
.pside-group summary { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; font-size: 12px; font-weight: 800; color: var(--text-faint); cursor: pointer; list-style: none; transition: .16s; user-select: none; }
.pside-group summary::-webkit-details-marker { display: none; }
.pside-group summary svg { width: 16px; height: 16px; }
.pside-group summary .chev { margin-inline-start: auto; transition: transform .2s; }
.pside-group[open] summary .chev { transform: rotate(90deg); }
.pside-group summary:hover { color: var(--text); background: var(--bg-raise, rgba(148,176,219,.07)); }
.pside-group.has-on summary { color: var(--brand-2); }
.pside-group .kids { display: grid; gap: 4px; margin-top: 4px; padding-inline-start: 10px; border-inline-start: 2px solid var(--border); margin-inline-start: 18px; }
/* Expand/collapse animation: the grid row height is the animated property, so
   the panel slides open instead of snapping. The UA hides a closed <details>
   with content-visibility/display:none, so that rule is overridden here to keep
   the row in flow — the row height alone decides what is visible. */
.pside-group .kids-in { display: grid; gap: 4px; min-height: 0; overflow: hidden; }
/* Chrome/سافاری محتوای <details> را در ::details-content با content-visibility
   پنهان می‌کنند؛ خنثی‌سازی آن اجازه می‌دهد انیمیشن باز و بسته هر دو اجرا شود و
   پنهان‌سازی فقط با ارتفاع ردیف شبکه انجام شود. */
.pside-group::details-content { content-visibility: visible; }
details.pside-group:not([open]) > .kids { display: grid; grid-template-rows: 0fr; opacity: 0; }
details.pside-group > .kids { grid-template-rows: 1fr; opacity: 1; transition: grid-template-rows .24s cubic-bezier(.22,.61,.36,1), opacity .18s ease; }

/* ---- Missing UI component classes ---------- */
.select-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.select-grid select { width: 100%; }

.input-group { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.input-group label { font-size: 12px; font-weight: 600; color: var(--text-dim); margin-bottom: 4px; }
.input-group select, .input-group input { width: 100%; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--border); background: var(--input); color: var(--text); font-size: 13px; }
.input-group select:focus, .input-group input:focus { border-color: var(--brand-2); outline: none; }

.pf-cell { display: flex; align-items: center; gap: 8px; padding: 8px; border-radius: 10px; background: var(--card-2); }
.pf-cell .ic { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: var(--card); flex-shrink: 0; font-size: 16px; }
.pf-cell .tx { flex: 1; min-width: 0; }
.pf-cell .tx b { font-size: 13px; font-weight: 700; color: var(--text); display: block; }
.pf-cell .tx span { font-size: 11px; color: var(--text-faint); display: block; }

.kv { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 10px; background: var(--card-2); }
.kv .k { font-size: 12px; font-weight: 600; color: var(--text-dim); min-width: 80px; }
.kv .v { font-size: 13px; font-weight: 700; color: var(--text); }

.result-count { font-size: 13px; color: var(--text-faint); margin-bottom: 10px; font-weight: 600; }

.sup-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.sup-tabs .chip { padding: 8px 12px; border-radius: 10px; font-size: 12px; font-weight: 600; color: var(--text-dim); border: 1px solid var(--border); background: var(--card); cursor: pointer; transition: .18s; }
.sup-tabs .chip.active { background: var(--grad); border-color: transparent; color: #fff; }

.dim { color: var(--text-faint); font-size: 12px; }

.chat-my-btn, .chat-club-btn, .chat-new-btn { display: inline-flex; align-items: center; gap: 6px; padding: 10px 14px; border-radius: 12px; background: var(--card); border: 1px solid var(--border); color: var(--text-dim); font-size: 13px; font-weight: 600; cursor: pointer; transition: .18s; }
.chat-my-btn svg, .chat-club-btn svg, .chat-new-btn svg { width: 16px; height: 16px; }
.chat-my-btn:hover, .chat-club-btn:hover, .chat-new-btn:hover { border-color: var(--border-strong); color: var(--text); background: var(--bg-raise); }
/* ============================================================
   Panel shell v2 — modern & simple (club + athlete panels)
   The sidebar is ALWAYS visible: sticky on desktop, a fixed icon
   rail on phones. Flat sections, no collapsing groups, no shadows.
   ============================================================ */
.pmain { width: min(1240px, 100% - 32px); padding-top: 18px; padding-bottom: 48px; }
.panel-layout { grid-template-columns: 232px minmax(0, 1fr); gap: 22px; margin-top: 0; }
.pside {
  top: calc(var(--nav-h) + 14px); max-height: calc(100vh - var(--nav-h) - 28px); overflow-y: auto;
  padding: 12px 10px; border-radius: 14px; box-shadow: none; scrollbar-width: thin;
}
.pside-head { padding: 4px 6px 12px; gap: 10px; }
.pside-head .mark { width: 36px; height: 36px; border-radius: 10px; font-size: 16px; font-weight: 800; background: var(--card-2); color: var(--brand-2); }
.pside-head > div { min-width: 0; }
.pside-head b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pside-head span { font-size: 11.5px; }
.pside-nav { display: grid; gap: 2px; margin-top: 4px; }
.pside-sec { display: block; font-size: 11px; font-weight: 700; color: var(--text-faint); margin: 12px 10px 4px; }
.pside-nav a { padding: 8px 10px; border: 0; border-radius: 10px; font-size: 13.5px; font-weight: 600; gap: 10px; color: var(--text-dim); }
.pside-nav a svg { width: 18px; height: 18px; opacity: .85; }
.pside-nav a:hover { background: var(--card-2); color: var(--text); border: 0; }
.pside-nav a.on { background: color-mix(in srgb, var(--brand-2) 14%, transparent); color: var(--brand-2); font-weight: 800; }
.pside-nav a.on svg { opacity: 1; }
.pside-count { margin-inline-start: auto; font-style: normal; font-size: 11px; font-weight: 800; padding: 0 7px; border-radius: 99px; background: var(--card-2); }

/* page body — the same calm look for every panel page */
/* Grid/flex items default to min-width:auto, so one wide table inside a
   panel stretched the whole page sideways on phones instead of scrolling in
   its own .table-wrap. Panels and their direct grid children may shrink. */
.pbody, .pbody .panel, .pbody .card, .pbody .table-wrap, .pbody [style*="display:grid"] > *,
.pbody .dash-grid > *, .pbody .grid > * { min-width: 0; }
.pbody .table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
/* list rows: long text wraps instead of pushing the row's buttons off-screen */
.pbody .row-item { flex-wrap: wrap; }
.pbody .row-item .tx { flex: 1 1 160px; min-width: 0; overflow-wrap: anywhere; }
.pbody img, .pbody video, .pbody canvas { max-width: 100%; height: auto; }
.pbody .container { width: auto; max-width: none; margin: 0; padding: 0; }
.pbody section.container, .pbody main.container { padding-top: 0 !important; }
.pbody .breadcrumb { display: none; }
.pbody .page-head { padding: 0 0 14px !important; }
.pbody .page-head h1, .ptitle h1 { font-size: 22px; line-height: 1.5; }
.pbody .page-head .sub { font-size: 13px; }
.ptitle { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.ptitle p { color: var(--text-faint); font-size: 13px; margin-top: 2px; }
.ptitle-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pbody .panel, .pbody .card { box-shadow: none; border-radius: 14px; }
.pbody .panel { padding: 18px; margin-top: 0; }
.pbody .panel + .panel, .pbody .dash-main > * + *, .pbody .dash-side-widget > * + * { margin-top: 0; }
.pbody .dash-main, .pbody .dash-side-widget { display: grid; gap: 16px; align-content: start; }
.pbody .panel h3 { font-size: 15px; margin-bottom: 12px; }
.pbody .grid-4 { gap: 12px; }
.pbody .stat-card { padding: 14px; box-shadow: none; }
.pbody .stat-link:hover .stat-card { transform: none; box-shadow: none; border-color: var(--brand-2); }
.pbody .dash-grid { margin-top: 16px !important; gap: 16px; }
.pbody .dash-side-widget { top: calc(var(--nav-h) + 14px); }
.pbody table th { font-size: 12px; font-weight: 700; color: var(--text-faint); }
.pbody .btn { box-shadow: none; }

/* collapse button + icon-only (mini) rail */
.pside-toggle { margin-inline-start: auto; flex-shrink: 0; width: 32px; height: 32px; display: grid; place-items: center; border-radius: 9px; border: 1px solid var(--border); background: transparent; color: var(--text-dim); cursor: pointer; transition: .16s; }
.pside-toggle:hover { color: var(--text); background: var(--card-2); }
.pside-nav a span { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.panel-layout { transition: grid-template-columns .2s ease; }
html.pside-mini .panel-layout { grid-template-columns: 64px minmax(0, 1fr); }
html.pside-mini .pside { padding-inline: 6px; }
html.pside-mini .pside-head { flex-direction: column; padding-inline: 0; gap: 8px; }
html.pside-mini .pside-head > div, html.pside-mini .pside-sec, html.pside-mini .pside-count, html.pside-mini .pside-nav a span { display: none; }
html.pside-mini .pside-toggle { margin: 0; }
html.pside-mini .pside-nav a { justify-content: center; padding: 10px 0; }

/* phones / small tablets: fixed icon rail, still always visible; the
   toggle opens it as a drawer with full labels */
@media (max-width: 920px) {
  .pmain { width: auto; margin-inline-start: 74px; margin-inline-end: 12px; }
  .panel-layout { display: block; }
  .pside {
    position: fixed; top: var(--nav-h); bottom: 0; inset-inline-start: 0; z-index: 60;
    width: 64px; max-height: none; padding: 8px 6px; border-radius: 0;
    border-width: 0; border-inline-end: 1px solid var(--border); overflow-y: auto;
    transition: width .2s ease;
  }
  .pside-head { flex-direction: column; justify-content: center; padding: 4px 0 8px; border: 0; gap: 8px; }
  .pside-head > div, .pside-sec, .pside-count, .pside-nav a span { display: none; }
  .pside-toggle { margin: 0; }
  .pside-nav { grid-auto-flow: row; grid-template-rows: none; overflow-x: visible; gap: 4px; }
  .pside-nav a { justify-content: center; padding: 10px 0; }
  html.pside-open .pside { width: 248px; padding: 10px; box-shadow: 0 10px 40px rgba(0,0,0,.35); }
  html.pside-open .pside-head { flex-direction: row; justify-content: flex-start; padding: 4px 6px 12px; }
  html.pside-open .pside-head > div, html.pside-open .pside-sec, html.pside-open .pside-nav a span { display: block; }
  html.pside-open .pside-toggle { margin-inline-start: auto; }
  html.pside-open .pside-nav a { justify-content: flex-start; padding: 9px 10px; }
}
@media (max-width: 760px) {
  .pside { bottom: calc(74px + env(safe-area-inset-bottom)); }
}

/* panel pages: one navigation only — the rail replaces the site bottom bar */
body:has(.pside) .bottom-nav { display: none !important; }
@media (max-width: 920px) {
  body:has(.pside) .pside { bottom: 0; }
  .pbody .grid-4, .pbody .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pbody .stat-card { padding: 12px; gap: 10px; }
  .pbody .stat-card .ic { width: 36px; height: 36px; }
  .pbody .ptitle h1, .pbody .page-head h1 { font-size: 19px; }
}
/* readiness hearts: wrap instead of overflowing on narrow screens */
.pbody [data-readiness-form] > div:nth-of-type(2) { flex-wrap: wrap; }
.pbody [data-readiness-score] { padding: 4px 8px !important; font-size: 13px !important; line-height: 1.4; }

/* panel pages read like an app: no marketing footer under the panel */
body:has(.pside) .footer { display: none; }
@media (max-width: 920px) {
  .pbody .stat-card b { font-size: 16px; line-height: 1.5; }
  .pbody .stat-card span { font-size: 11.5px; }
}

/* coach month calendar */
.cal-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-head b { font-size: 15px; min-width: 120px; text-align: center; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-wd { text-align: center; font-size: 12px; font-weight: 700; color: var(--text-faint); padding: 2px 0 4px; }
.cal-cell { min-height: 86px; display: flex; flex-direction: column; align-items: stretch; gap: 3px; padding: 6px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text); font: inherit; text-align: start; cursor: pointer; transition: .15s; overflow: hidden; }
.cal-cell b { font-size: 13px; font-weight: 700; color: var(--text-dim); }
.cal-cell:hover { border-color: var(--border-strong); background: var(--card-2); }
.cal-cell.today b { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 99px; background: var(--brand-2); color: #fff; }
.cal-cell.sel { border-color: var(--brand-2); box-shadow: inset 0 0 0 1px var(--brand-2); }
.cal-pad { border: 0; cursor: default; background: transparent; }
.cal-ev { display: flex; align-items: center; gap: 4px; font-size: 11px; line-height: 1.5; padding: 1px 5px; border-radius: 6px; background: color-mix(in srgb, var(--c) 16%, transparent); color: var(--text); min-width: 0; }
.cal-ev i { width: 7px; height: 7px; border-radius: 99px; background: var(--c); flex-shrink: 0; }
.cal-ev em { font-style: normal; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-ev.off { opacity: .45; text-decoration: line-through; }
.cal-more { font-size: 10.5px; color: var(--text-faint); }
.cal-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 12px; font-size: 12px; color: var(--text-dim); }
.cal-leg { display: inline-flex; align-items: center; gap: 6px; }
.cal-leg i { width: 10px; height: 10px; border-radius: 99px; }
@media (max-width: 760px) {
  .cal-head { gap: 4px; }
  .cal-head b { min-width: 0; flex: 1; font-size: 14px; }
  .cal-grid { gap: 3px; }
  .cal-cell { min-height: 54px; padding: 4px 3px; align-items: center; }
  .cal-ev { padding: 0; background: none; width: auto; justify-content: center; }
  .cal-ev em, .cal-more { display: none; }
  .cal-cell { flex-direction: column; }
}

/* program & diet builders (pages_plans.js) */
.plan-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.plan-card h3 { font-size: 15px; }
.plan-stats { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--text-dim); }
.plan-stats span { display: inline-flex; align-items: center; gap: 5px; }
.plan-form { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.plan-form .span2 { grid-column: span 2; }
.plan-form .field label { display: block; font-size: 12.5px; color: var(--text-dim); margin-bottom: 5px; font-weight: 600; }
.plan-guide { display: flex; gap: 6px; align-items: flex-start; font-size: 12.5px; color: var(--text-dim); background: var(--card-2); border-radius: 10px; padding: 9px 12px; margin-top: 12px; line-height: 1.9; }
.plan-table td, .plan-table th { padding: 6px 4px; vertical-align: middle; }
.plan-table .input { padding: 7px 8px; font-size: 13px; }
.plan-ath { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.plan-ath:last-child { border-bottom: 0; }
.plan-calc { margin-top: 14px; border-top: 1px dashed var(--border); padding-top: 12px; }
.plan-calc summary { cursor: pointer; font-size: 13px; font-weight: 700; color: var(--brand-2); display: inline-flex; gap: 6px; align-items: center; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { padding: 7px 14px; border-radius: 99px; border: 1px solid var(--border); background: transparent; color: var(--text-dim); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.chips .chip em { font-style: normal; font-size: 11px; margin-inline-start: 4px; opacity: .8; }
.chips .chip.active { background: var(--brand-2); border-color: var(--brand-2); color: #fff; }
.meal-block { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; }
.meal-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 6px; }
.macro-grid { display: grid; gap: 10px 18px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.macro-top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-dim); margin-bottom: 4px; }
.macro-top b { color: var(--text); font-weight: 700; }
.macro-bar { height: 7px; border-radius: 99px; background: var(--card-2); overflow: hidden; }
.macro-bar i { display: block; height: 100%; background: var(--brand-2); opacity: .55; border-radius: 99px; }
.macro-bar.ok i { opacity: 1; background: #22c55e; }
.macro-bar.over i { background: #f59e0b; opacity: 1; }
@media (max-width: 600px) {
  .plan-form { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .plan-form .span2 { grid-column: 1 / -1; }
  .meal-head .input[data-pd-m="name"] { flex-basis: 100%; order: -1; }
  .meal-block { padding: 10px; }
  .plan-ath { flex-wrap: wrap; }
}

/* stacked tables (SM.labelTables): on phones every panel table row becomes a
   card — the column title is printed above each value, inputs fill the
   width, the first cell (who / what) and the actions span the full card. */
@media (max-width: 640px) {
  .pbody .table-wrap:has(table.stack) { overflow: visible; border: 0; }
  .pbody table.stack { min-width: 0 !important; width: 100%; border: 0; }
  .pbody table.stack thead { display: none; }
  .pbody table.stack tbody { display: grid; gap: 10px; }
  .pbody table.stack tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
  .pbody table.stack td { display: block; padding: 0 !important; border: 0 !important; min-width: 0; text-align: start; white-space: normal; }
  .pbody table.stack td[data-l]::before { content: attr(data-l); display: block; font-size: 11px; font-weight: 600; color: var(--text-faint); margin-bottom: 3px; }
  .pbody table.stack td:first-child, .pbody table.stack td:last-child, .pbody table.stack td:not([data-l]) { grid-column: 1 / -1; }
  .pbody table.stack td:first-child::before { display: none; }
  .pbody table.stack td:empty { display: none; }
  .pbody table.stack .input, .pbody table.stack select { width: 100% !important; min-width: 0 !important; }
  .pbody table.stack td .tbl-actions, .pbody table.stack td > div[style*="flex"] { flex-wrap: wrap; }
}

/* profile photos everywhere (UI.avatar with a url) */
img.avatar.avatar-img { object-fit: cover; border-radius: 50%; padding: 0; background: var(--card-2); flex-shrink: 0; }
img.chat-av.chat-av-img { object-fit: cover; border-radius: 50%; padding: 0; }

/* ---- profile v2: header + tabs ---- */
.pf2 { max-width: 920px; padding-top: 4px !important; display: grid; gap: 14px; }
.pf2-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pf2-photo { position: relative; width: 84px; height: 84px; border-radius: 50%; flex-shrink: 0; overflow: hidden; background: var(--grad-soft, var(--card-2)); display: grid; place-items: center; }
.pf2-photo img { width: 100%; height: 100%; object-fit: cover; }
.pf2-ini { font-size: 30px; font-weight: 800; color: var(--brand-2); }
.pf2-photo-edit { cursor: pointer; }
.pf2-cam { position: absolute; inset: auto 0 0 0; height: 28px; display: grid; place-items: center; background: rgba(0,0,0,.55); color: #fff; opacity: .9; }
.pf2-photo-edit:hover .pf2-cam { opacity: 1; }
.pf2-id { flex: 1 1 220px; min-width: 0; }
.pf2-id h1 { font-size: 22px; line-height: 1.5; }
.pf2-id p { color: var(--text-dim); font-size: 13px; margin-top: 2px; }
.pf2-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pf2-acts { display: flex; gap: 8px; flex-wrap: wrap; }
.pf2-tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; border-bottom: 1px solid var(--border); padding-bottom: 0; }
.pf2-tabs::-webkit-scrollbar { display: none; }
.pf2-tab { display: inline-flex; align-items: center; gap: 7px; padding: 10px 14px; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--text-dim); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; white-space: nowrap; margin-bottom: -1px; }
.pf2-tab:hover { color: var(--text); }
.pf2-tab.on { color: var(--brand-2); border-bottom-color: var(--brand-2); }
.pf2-body { display: grid; gap: 14px; }
.pf2-body > .divider { display: none; }
.pf2-sportform { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.pf2-check { display: inline-flex; align-items: center; gap: 6px; padding-bottom: 10px; font-size: 13px; }
.pf2-mini { display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center; }
.pf2-mini div { display: grid; }
.pf2-mini b { font-size: 20px; }
.pf2-mini span { font-size: 12px; color: var(--text-faint); }
.pf2-mini .btn { margin-inline-start: auto; }
.pf2-clubtop { display: flex; gap: 14px; align-items: center; }
.pf2-clubtop img, .pf2-clubem { width: 56px; height: 56px; border-radius: 14px; object-fit: cover; display: grid; place-items: center; font-size: 30px; background: var(--card-2); }
.pf2-clubname { font-size: 17px; margin: 6px 0 -4px; }
@media (max-width: 640px) {
  .pf2-photo { width: 68px; height: 68px; }
  .pf2-id h1 { font-size: 19px; }
  .pf2-acts { width: 100%; }
  .pf2-tab { padding: 9px 11px; font-size: 13px; }
  .pf2-sportform > label { flex: 1 1 100%; }
}

/* ---- relationships / member ID / privacy (pages_relations.js) ---- */
.rel-id b { letter-spacing: .5px; }
.rel-copy { border: 0; background: transparent; color: inherit; cursor: pointer; padding: 0 2px; display: inline-flex; }
.rel-switches { display: grid; gap: 4px; }
.rel-sw { display: flex; align-items: center; gap: 10px; padding: 10px 4px; border-bottom: 1px solid var(--border); font-size: 13.5px; cursor: pointer; }
.rel-sw:last-child { border-bottom: 0; }
.rel-sw input { width: 18px; height: 18px; accent-color: var(--brand-2); flex-shrink: 0; }
.rel-find { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.rel-find .input, .rel-find select { flex: 1 1 200px; min-width: 0; }
.rel-card, .rel-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; margin-top: 8px; }
.rel-acts { display: flex; gap: 6px; flex-wrap: wrap; }
/* fingerprint / face sign-in */
.pk-login { margin-top: 14px; }
.pk-or { display: flex; align-items: center; gap: 10px; color: var(--text-faint); font-size: 12px; margin: 0 0 12px; }
.pk-or::before, .pk-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.pk-btn { justify-content: center; font-weight: 800; border: 1.5px solid var(--border-strong); }
.pk-msg { font-size: 12.5px; margin-top: 8px; min-height: 18px; text-align: center; color: var(--text-dim); }
.pk-msg.err { color: var(--danger, #ef4444); }
.rel-invite { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 0; }
@media (max-width: 640px) { .rel-acts { width: 100%; } }

/* ---- coach → athlete report ---- */
.row-link { cursor: pointer; }
.row-link:hover td { background: var(--card-2); }
.ath-link { color: inherit; text-decoration: none; }
.ath-link:hover b { color: var(--brand-2); }
.rp-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.rp-kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.rp-kpi { display: grid; gap: 2px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; background: var(--card); }
.rp-kpi svg { color: var(--brand-2); }
.rp-kpi b { font-size: 19px; }
.rp-kpi span { font-size: 12px; color: var(--text-faint); }
.rp-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rp-grid > .panel:first-child { grid-column: 1 / -1; }
.rp-chart { width: 100%; height: 120px; display: block; }
.rp-chart rect.on { fill: var(--brand-2); }
.rp-chart rect.off { fill: var(--border); }
.rp-chart polyline { fill: none; stroke: var(--brand-2); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.rp-chart circle { fill: var(--brand-2); }
.rp-empty { font-size: 13px; color: var(--text-faint); padding: 18px; text-align: center; border: 1px dashed var(--border); border-radius: 12px; }
.rp-axis { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-faint); margin-top: 4px; }
.rp-list { display: grid; gap: 8px; margin-top: 12px; }
.rp-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.rp-row-main { flex: 1 1 200px; min-width: 0; display: grid; gap: 2px; }
.rp-row-main span { font-size: 12px; }
.rp-adh { flex: 0 1 220px; display: grid; gap: 4px; min-width: 150px; }
.rp-adh small { font-size: 11.5px; color: var(--text-dim); }
.rp-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px; }
.rp-metrics > div { padding: 10px; border-radius: 12px; background: var(--card-2); display: grid; gap: 2px; }
.rp-metrics > div > span { font-size: 12px; color: var(--text-faint); }
.rp-metric b { font-size: 17px; }
.rp-metric em { font-style: normal; font-size: 12px; font-weight: 700; }
.rp-metric em.good { color: #22c55e; }
.rp-metric em.bad { color: #f59e0b; }
@media (max-width: 860px) { .rp-grid { grid-template-columns: minmax(0, 1fr); } }

/* small phones: dialogs use nearly the full screen */
@media (max-width: 480px) {
  #modal-root { padding: 10px; }
  .modal { padding: 18px 16px; border-radius: 16px; max-height: 92vh; max-height: 92dvh; }
  .pmain { margin-inline-end: 8px; }
  .pbody .panel { padding: 14px; }
  .ptitle { margin-bottom: 12px; }
  .ptitle-actions .btn { padding-inline: 12px; }
}

/* Shamsi date picker (SM.enhanceDateInputs) */
.jdate { display: flex; gap: 6px; align-items: center; width: 100%; }
.jdate select { flex: 1 1 0; min-width: 0; padding-inline: 8px; }
.jdate .jd-m { flex-grow: 1.6; }
.jdate-text { display: block; width: 100%; color: var(--text-dim); }
