@import url('https://fonts.googleapis.com/css2?family=Anton&family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* BPS brand palette, sampled from the official logo/marketing assets */
  --navy: #142144;
  --navy-dark: #0a1730;
  --navy-light: #1e2f5c;
  --lime: #a7cc00;
  --lime-dark: #7f9c00;
  --gold: #f9a708;
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1c2333;
  --muted: #6b7385;
  --border: #e3e6ec;
  --success: #1e8a5f;
  --danger: #c73e3e;
  --radius: 10px;
  --shadow: 0 1px 3px rgba(10, 23, 48, 0.08), 0 1px 2px rgba(10, 23, 48, 0.06);

  /* Legacy aliases used across pages built before the brand pass —
     keep these mapped to the real palette so nothing needs re-touching. */
  --orange: var(--lime-dark);
  --orange-light: var(--lime);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Inter", "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: var(--lime-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 {
  font-family: "Anton", "Inter", sans-serif;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  margin: 0 0 0.5rem;
}

/* ---- App shell photo background ---- */
/* Applied inline per-page via a <body style="background-image: ..."> so each
   page can use a different duotone action photo (see README/build notes) —
   this rule just supplies the shared cover/fixed mechanics and fallback colour. */
body.app-shell {
  background-color: var(--navy-dark);
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-repeat: no-repeat;
  min-height: 100vh;
}

/* ---- Nav ---- */
#site-nav {
  background: rgba(10, 23, 48, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  color: #fff;
  box-shadow: 0 1px 0 rgba(255,255,255,0.06), 0 4px 20px rgba(0,0,0,0.25);
  position: sticky;
  top: 0;
  z-index: 20;
}
.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 0.55rem; color: #fff; font-family: "Anton", sans-serif; letter-spacing: 0.02em; font-size: 1.15rem; }
.brand img { height: 34px; width: 34px; display: block; }
.brand span { color: var(--lime); }
.nav-links { display: flex; gap: 1.1rem; flex: 1; flex-wrap: wrap; }
.nav-links a { color: #b9c2d8; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.03em; font-weight: 600; }
.nav-links a:hover, .nav-links a.active { color: #fff; text-decoration: none; }
.nav-links a.active { border-bottom: 2px solid var(--lime); padding-bottom: 2px; }
.nav-user { display: flex; align-items: center; gap: 0.8rem; font-size: 0.9rem; color: #b9c2d8; }

.btn-link {
  background: none; border: none; color: var(--lime); cursor: pointer;
  font-size: 0.9rem; padding: 0;
}
.btn-link:hover { text-decoration: underline; }

/* ---- Layout ---- */
main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}
.page-header { margin-bottom: 1.75rem; }
.page-header h1 { color: #fff; text-shadow: 0 2px 12px rgba(0,0,0,0.35); }
.page-header p { color: #cdd6ea; margin: 0; }

.grid { display: grid; gap: 1.25rem; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }

.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(6, 14, 32, 0.28), 0 1px 2px rgba(6, 14, 32, 0.08);
  padding: 1.5rem;
  border: 1px solid var(--border);
}
.card h2, .card h3 { margin-top: 0; }

/* ---- Auth screen ---- */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background-image:
    radial-gradient(circle at 20% 15%, rgba(30,47,92,0.45) 0%, rgba(20,33,68,0.72) 45%, rgba(10,23,48,0.84) 100%),
    url('../img/bg-celebration.jpg');
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  padding: 1.5rem;
}
.auth-card {
  background: rgba(255,255,255,0.98);
  border-radius: 14px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.45);
  padding: 2.25rem;
  width: 100%;
  max-width: 400px;
}
.auth-logo { display: block; height: 64px; width: 64px; margin: 0 auto 1rem; }
.auth-card h1 { font-size: 1.6rem; text-align: center; }
.auth-card .tagline { color: var(--muted); margin-bottom: 1.5rem; font-size: 0.9rem; }
.auth-tabs { display: flex; gap: 0.5rem; margin-bottom: 1.25rem; }
.auth-tabs button {
  flex: 1; padding: 0.5rem; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg); cursor: pointer; font-size: 0.9rem; color: var(--muted);
}
.auth-tabs button.active { background: var(--navy); color: #fff; border-color: var(--navy); }

/* ---- Forms ---- */
label { display: block; font-size: 0.85rem; font-weight: 600; margin: 0.9rem 0 0.3rem; }
input, textarea, select {
  width: 100%; padding: 0.6rem 0.7rem; border: 1px solid var(--border);
  border-radius: 8px; font-size: 0.95rem; font-family: inherit; background: #fff; color: var(--text);
}
textarea { resize: vertical; min-height: 80px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--lime); border-color: var(--lime-dark); }

.btn {
  display: inline-block; padding: 0.65rem 1.2rem; border-radius: 8px;
  background: var(--lime); color: var(--navy-dark); border: none; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.02em; font-size: 0.85rem;
  cursor: pointer; margin-top: 1.1rem;
}
.btn:hover { background: var(--lime-dark); color: #fff; }
.btn.secondary { background: var(--navy); color: #fff; }
.btn.secondary:hover { background: var(--navy-light); }
.btn.small { padding: 0.4rem 0.8rem; font-size: 0.75rem; margin-top: 0; }
.btn.danger { background: var(--danger); color: #fff; }
.btn:disabled { opacity: 0.6; cursor: not-allowed; }

.error-msg {
  background: #fdecec; color: var(--danger); border: 1px solid #f5c6c6;
  padding: 0.6rem 0.8rem; border-radius: 8px; font-size: 0.85rem; margin-top: 1rem;
}
.success-msg {
  background: #e9f7f0; color: var(--success); border: 1px solid #bfe8d4;
  padding: 0.6rem 0.8rem; border-radius: 8px; font-size: 0.85rem; margin-top: 1rem;
}
.hidden { display: none !important; }

/* ---- Lists / tables ---- */
.list-item {
  padding: 0.9rem 0; border-bottom: 1px solid var(--border);
}
.list-item:last-child { border-bottom: none; }
.list-item .meta { color: var(--muted); font-size: 0.8rem; margin-bottom: 0.2rem; }
.tag {
  display: inline-block; font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em; padding: 0.15rem 0.5rem; border-radius: 20px; margin-right: 0.4rem;
}
.tag.physical { background: #fff2d9; color: #b8790a; }
.tag.mental { background: #e6ecfb; color: #3552b5; }
.tag.social { background: #eef6d9; color: var(--lime-dark); }

table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
th, td { text-align: left; padding: 0.6rem 0.5rem; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 600; font-size: 0.8rem; text-transform: uppercase; }

.stat-tile { text-align: center; }
.stat-tile .value { font-size: 1.9rem; font-weight: 800; color: var(--navy); }
.stat-tile .label { color: var(--muted); font-size: 0.85rem; }

.empty-state { color: var(--muted); font-size: 0.9rem; padding: 1rem 0; }

.athlete-picker {
  margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
  .nav-inner { flex-direction: column; align-items: flex-start; }
  .nav-links { gap: 0.8rem; }
}

/* ---- Public landing page ---- */
.public-nav {
  background: var(--navy-dark);
  padding: 0.9rem 1.25rem;
}
.public-nav .nav-inner { justify-content: space-between; padding: 0; }
.public-nav .brand { font-size: 1.3rem; }
.public-nav .brand img { height: 40px; width: 40px; }

.hero {
  background: radial-gradient(circle at 15% 0%, var(--navy-light) 0%, var(--navy) 45%, var(--navy-dark) 100%);
  color: #fff;
  padding: 3.5rem 1.25rem 5rem;
  text-align: center;
  position: relative;
}
.hero-photo {
  background-image:
    linear-gradient(180deg, rgba(10,23,48,0.62) 0%, rgba(10,23,48,0.58) 45%, var(--navy-dark) 100%),
    url('../img/bg-team-run.jpg');
  background-size: cover;
  background-position: center 42%;
}
.hero-badge {
  height: 108px; width: 108px; margin: 0 auto 1.25rem; display: block;
  filter: drop-shadow(0 8px 24px rgba(0,0,0,0.4));
}
.hero .eyebrow {
  display: inline-block; color: var(--lime); font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; font-size: 0.8rem; margin-bottom: 1rem;
}
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.6rem); color: #fff; max-width: 780px; margin: 0 auto 1rem;
}
.hero p.lede {
  font-family: "Inter", sans-serif; text-transform: none; letter-spacing: normal;
  color: #cdd6ea; font-size: 1.1rem; max-width: 620px; margin: 0 auto 2rem;
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.section-photo {
  position: relative;
  background-size: cover;
  background-position: center 25%;
  color: #fff;
}
.section-photo .card { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.15); backdrop-filter: blur(2px); }
.section-photo .step-card h3 { color: #fff; }
.section-photo .step-card p { color: #cdd6ea; }
.section-photo .num { background: var(--lime); color: var(--navy-dark); }

section.block { max-width: 1100px; margin: 0 auto; padding: 4rem 1.25rem; }
section.block.tight { padding-top: 0; }
.section-head { text-align: center; max-width: 680px; margin: 0 auto 2.5rem; }
.section-head .eyebrow { color: var(--lime-dark); font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.8rem; }
.section-head h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.section-head p { color: var(--muted); font-family: "Inter", sans-serif; }

.step-card { text-align: center; }
.step-card .num {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 50%; background: var(--navy); color: var(--lime); font-family: "Anton", sans-serif;
  font-size: 1.2rem; margin-bottom: 0.9rem;
}
.step-card h3 { font-size: 1.05rem; }
.step-card p { color: var(--muted); font-family: "Inter", sans-serif; font-size: 0.92rem; }

.feature-card { border-top: 3px solid var(--lime); }
.feature-card h3 { font-size: 1rem; }
.feature-card p { color: var(--muted); font-family: "Inter", sans-serif; font-size: 0.9rem; }

.pricing-card { display: flex; flex-direction: column; }
.pricing-card .price { font-family: "Anton", sans-serif; font-size: 2rem; color: var(--navy); margin: 0.3rem 0 1rem; }
.pricing-card .price span { font-family: "Inter", sans-serif; font-size: 0.85rem; color: var(--muted); text-transform: none; }
.pricing-card ul { list-style: none; padding: 0; margin: 0 0 1.5rem; flex: 1; }
.pricing-card li { padding: 0.4rem 0; font-size: 0.9rem; color: var(--text); border-bottom: 1px solid var(--border); }
.pricing-card.featured { border: 2px solid var(--lime); position: relative; }
.pricing-card.featured::before {
  content: "Most popular"; position: absolute; top: -13px; left: 50%; transform: translateX(-50%);
  background: var(--lime); color: var(--navy-dark); font-size: 0.7rem; font-weight: 800; text-transform: uppercase;
  padding: 0.25rem 0.7rem; border-radius: 20px; letter-spacing: 0.03em;
}

.public-footer {
  background: var(--navy-dark); color: #b9c2d8; padding: 2.5rem 1.25rem; text-align: center; font-size: 0.85rem;
}
.public-footer .brand { justify-content: center; margin-bottom: 0.75rem; }
.public-footer a { color: var(--lime); }

/* ==========================================================================
   v2 components — nav extras, gauges, ratings, classroom, feed, blog, chat
   ========================================================================== */

/* ---- Nav extras ---- */
.nav-links { display: flex; gap: 1.15rem; flex: 1; flex-wrap: nowrap; }
.nav-links a { white-space: nowrap; }
.nav-toggle {
  display: none;
  background: none; border: 1px solid rgba(255,255,255,0.25); color: #fff;
  border-radius: 8px; font-size: 1.1rem; line-height: 1; padding: 0.35rem 0.6rem;
  cursor: pointer;
}
.credit-chip {
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: rgba(167,204,0,0.16); border: 1px solid rgba(167,204,0,0.45);
  color: var(--lime); border-radius: 999px; padding: 0.2rem 0.6rem;
  font-size: 0.8rem; font-weight: 700; text-decoration: none;
}
.credit-chip:hover { background: rgba(167,204,0,0.28); text-decoration: none; }
.credit-chip.empty { background: rgba(255,255,255,0.08); border-color: rgba(255,255,255,0.2); color: #b9c2d8; }
.credit-dot { font-size: 0.7rem; }
.nav-links a.coach-link { color: var(--lime); }

/* Account dropdown — keeps Calls, Files and Profile off the main bar */
.account { position: relative; }
.account-btn {
  display: flex; align-items: center; gap: 0.3rem; background: none;
  border: none; cursor: pointer; padding: 0; color: #b9c2d8;
}
.account-btn .caret { font-size: 0.7rem; }
.account-menu {
  display: none; position: absolute; right: 0; top: calc(100% + 0.6rem);
  background: #fff; border-radius: 10px; min-width: 200px; overflow: hidden;
  box-shadow: 0 12px 40px rgba(6,14,32,0.4); border: 1px solid var(--border);
  z-index: 40;
}
.account.open .account-menu { display: block; }
.account-head {
  padding: 0.8rem 1rem; border-bottom: 1px solid var(--border); background: var(--bg);
}
.account-head strong { display: block; font-size: 0.9rem; color: var(--text); }
.account-head span { font-size: 0.78rem; color: var(--muted); }
.account-menu a, .account-menu button {
  display: block; width: 100%; text-align: left; padding: 0.62rem 1rem;
  font-size: 0.88rem; color: var(--text); background: none; border: none;
  cursor: pointer; font-family: inherit; text-decoration: none;
}
.account-menu a:hover, .account-menu button:hover { background: var(--bg); text-decoration: none; }
.account-menu button { border-top: 1px solid var(--border); color: var(--danger); }

/* Avatars */
.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid;
  place-items: center; background: var(--navy); color: #fff;
  font-size: 0.78rem; font-weight: 800; overflow: hidden;
}
.avatar.sm { width: 30px; height: 30px; font-size: 0.7rem; }
.avatar.lg { width: 88px; height: 88px; font-size: 1.6rem; }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.has-photo { background: none; }
#nav-avatar { box-shadow: 0 0 0 2px rgba(167,204,0,0.55); }

@media (max-width: 1080px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none; flex-basis: 100%; order: 4; flex-direction: column;
    gap: 0.15rem; padding-top: 0.5rem;
  }
  #site-nav.nav-open .nav-links { display: flex; }
  .nav-links a { padding: 0.5rem 0; border-bottom: 1px solid rgba(255,255,255,0.06); }
  .nav-inner { gap: 0.9rem; }
  .nav-user { margin-left: auto; }
}

/* ---- Gauges ---- */
.gauge-grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  align-items: end;
}
.gauge-cell { text-align: center; }
.gauge { display: block; margin: 0 auto; max-width: 100%; }
.gauge-caption {
  font-size: 0.8rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--muted); margin-top: 0.15rem;
}
.gauge-sub { font-size: 0.78rem; color: var(--muted); margin-top: 0.15rem; }
.gauge-hero { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: center; }
.gauge-hero .gauge-legend { flex: 1; min-width: 210px; }
.gauge-legend ul { list-style: none; margin: 0; padding: 0; }
.gauge-legend li {
  display: flex; align-items: center; gap: 0.5rem; font-size: 0.85rem;
  padding: 0.22rem 0; color: var(--text);
}
.legend-swatch {
  width: 10px; height: 10px; border-radius: 3px; flex: none;
  box-shadow: 0 0 0 2px #fff;
}
.legend-count { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; }

/* ---- Daily check-in ---- */
.checkin-item {
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0.9rem 1rem; margin-bottom: 0.7rem; background: #fff;
}
.checkin-item.done { border-color: rgba(12,163,12,0.35); background: #fbfdfb; }
.checkin-top { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.checkin-title { font-weight: 700; }
.cat-pill {
  font-size: 0.68rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  background: var(--navy); color: #fff; border-radius: 999px; padding: 0.16rem 0.55rem;
}
.checkin-detail { color: var(--muted); font-size: 0.86rem; margin: 0.3rem 0 0; }
.rating-row { display: flex; gap: 0.5rem; margin-top: 0.7rem; flex-wrap: wrap; }
.rating-btn {
  display: inline-flex; align-items: center; gap: 0.4rem;
  border: 1.5px solid var(--border); background: #fff; cursor: pointer;
  border-radius: 8px; padding: 0.42rem 0.8rem; font-size: 0.82rem; font-weight: 700;
  font-family: inherit; color: var(--muted); transition: all 0.12s ease;
}
.rating-btn:hover { border-color: var(--muted); color: var(--text); }
.rating-btn .glyph { font-size: 0.9rem; font-weight: 800; }
.rating-btn.selected { color: #fff; border-color: transparent; }
.rating-btn[data-rating="unacceptable"].selected { background: #d03b3b; }
.rating-btn[data-rating="acceptable"].selected   { background: #b8820a; }
.rating-btn[data-rating="exceptional"].selected  { background: #0ca30c; }
.test-input-row { display: flex; gap: 0.5rem; align-items: center; margin-top: 0.6rem; flex-wrap: wrap; }
.test-input-row input { max-width: 130px; margin: 0; }
.test-input-row .unit { color: var(--muted); font-size: 0.85rem; }
.checkin-empty { color: var(--muted); font-size: 0.9rem; }

/* ---- Rating history strip ---- */
.history-strip { display: flex; flex-wrap: wrap; gap: 3px; margin-top: 0.6rem; }
.history-cell {
  width: 15px; height: 15px; border-radius: 3px; background: #e3e6ec;
  position: relative;
}
.history-cell[data-r="unacceptable"] { background: #d03b3b; }
.history-cell[data-r="acceptable"]   { background: #b8820a; }
.history-cell[data-r="exceptional"]  { background: #0ca30c; }
.history-legend { display: flex; gap: 0.9rem; flex-wrap: wrap; margin-top: 0.6rem; font-size: 0.78rem; color: var(--muted); }
.history-legend span { display: inline-flex; align-items: center; gap: 0.32rem; }

/* ---- Tabs (classroom pillars, coach admin) ---- */
.tabs {
  display: flex; gap: 0.4rem; flex-wrap: wrap; margin-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255,255,255,0.14); padding-bottom: 0.6rem;
}
.tabs button {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
  color: #cdd6ea; border-radius: 8px; padding: 0.45rem 0.95rem; cursor: pointer;
  font-family: inherit; font-size: 0.82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
}
.tabs button:hover { color: #fff; background: rgba(255,255,255,0.14); }
.tabs button.active { background: var(--lime); border-color: var(--lime); color: var(--navy-dark); }

/* ---- Classroom ---- */
.pillar-intro { color: #cdd6ea; margin: -0.6rem 0 1.25rem; max-width: 640px; }
.folder-head { display: flex; align-items: baseline; gap: 0.6rem; flex-wrap: wrap; }
.item-row {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.7rem 0;
  border-top: 1px solid var(--border);
}
.item-row:first-of-type { border-top: none; }
.item-icon {
  width: 34px; height: 34px; flex: none; border-radius: 8px; display: grid;
  place-items: center; background: var(--bg); font-size: 0.95rem;
}
.item-main { flex: 1; min-width: 0; }
.item-main .t { font-weight: 600; }
.item-main .d { color: var(--muted); font-size: 0.82rem; }
.embed-wrap {
  position: relative; width: 100%; padding-top: 56.25%; margin-top: 0.7rem;
  border-radius: 8px; overflow: hidden; background: #000;
}
.embed-wrap iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.embed-wrap.audio { padding-top: 0; height: 172px; background: none; }
.embed-wrap.audio iframe { position: static; height: 172px; }

/* Small type badge — used by the daily check-in "Test" marker */
.type-pill {
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  border-radius: 999px; padding: 0.14rem 0.5rem; margin-left: auto;
}
.type-pill.question { background: #e8ecff; color: #2c3d8f; }
.type-pill.win { background: #e6f6e6; color: #14661a; }
.type-pill.post { background: var(--bg); color: var(--muted); }

/* ---- Blog ---- */
.blog-card { display: block; color: inherit; text-decoration: none; }
.blog-card:hover { text-decoration: none; transform: translateY(-2px); }
.blog-card { transition: transform 0.15s ease; }
.blog-cover { width: 100%; height: 170px; object-fit: cover; border-radius: 8px; margin-bottom: 0.8rem; }
.blog-date { font-size: 0.78rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-weight: 700; }
.blog-body { font-size: 1rem; line-height: 1.7; }
.blog-body h2 { font-size: 1.3rem; margin-top: 1.6rem; }
.blog-body h3 { font-size: 1.1rem; margin-top: 1.3rem; }
.blog-body p { margin: 0 0 1rem; }

/* ---- Coach chat ---- */
.chat-log {
  min-height: 320px; max-height: 55vh; overflow-y: auto; padding-right: 0.4rem;
  display: flex; flex-direction: column; gap: 0.8rem;
}
.msg { display: flex; gap: 0.6rem; max-width: 88%; }
.msg .bubble {
  padding: 0.7rem 0.95rem; border-radius: 12px; font-size: 0.92rem; line-height: 1.55;
}
.msg .bubble p { margin: 0 0 0.55rem; }
.msg .bubble p:last-child { margin-bottom: 0; }
.msg.coach .bubble { background: var(--bg); border: 1px solid var(--border); border-top-left-radius: 3px; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bubble { background: var(--navy); color: #fff; border-top-right-radius: 3px; }
.chat-form { display: flex; gap: 0.5rem; margin-top: 1rem; }
.chat-form input { margin: 0; }
.chat-form button { flex: none; }
.typing span {
  display: inline-block; width: 6px; height: 6px; margin-right: 3px; border-radius: 50%;
  background: var(--muted); animation: blink 1.2s infinite;
}
.typing span:nth-child(2) { animation-delay: 0.2s; }
.typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes blink { 0%, 60%, 100% { opacity: 0.25; } 30% { opacity: 1; } }

/* ---- Coach admin ---- */
.admin-section { display: none; }
.admin-section.active { display: block; }
.athlete-row {
  display: flex; align-items: center; gap: 0.9rem; padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}
.athlete-row:first-of-type { border-top: none; }
.athlete-row .who { flex: 1; min-width: 0; }
.athlete-row .who strong { display: block; }
.athlete-row .who span { color: var(--muted); font-size: 0.8rem; }
.mini-gauge { flex: none; width: 132px; }
.inline-form { display: flex; gap: 0.5rem; align-items: flex-end; flex-wrap: wrap; }
.inline-form > div { flex: 1; min-width: 130px; }
.inline-form label { margin-top: 0; }
.inline-form input, .inline-form select { margin-bottom: 0; }
.inline-form button { flex: none; margin-top: 0; }
.dow-picker { display: flex; gap: 0.3rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.dow-picker label {
  margin: 0; cursor: pointer; border: 1.5px solid var(--border); border-radius: 7px;
  padding: 0.3rem 0.55rem; font-size: 0.75rem; font-weight: 700; user-select: none;
  text-transform: uppercase; letter-spacing: 0.03em;
}
.dow-picker input { display: none; }
.dow-picker input:checked + span { color: var(--navy); }
.dow-picker label:has(input:checked) { border-color: var(--lime-dark); background: #f6faea; }
.pill-list { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.5rem; }
.pill {
  display: inline-flex; align-items: center; gap: 0.4rem; background: var(--bg);
  border: 1px solid var(--border); border-radius: 999px; padding: 0.25rem 0.7rem;
  font-size: 0.8rem;
}
.pill button { background: none; border: none; cursor: pointer; color: var(--danger); font-size: 0.9rem; padding: 0; line-height: 1; }
.subtle-note { font-size: 0.82rem; color: var(--muted); margin-top: 0.5rem; }

/* ---- Shared bits ---- */
.section-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 0.9rem; }
.badge-count { background: var(--navy); color: #fff; border-radius: 999px; font-size: 0.72rem; font-weight: 800; padding: 0.12rem 0.5rem; }
.stack > * + * { margin-top: 1.25rem; }
.muted-link { color: var(--muted); font-size: 0.85rem; }
.on-photo { color: #fff; }
.on-photo a { color: var(--lime); }

/* Collapsed media embeds in the classroom — keeps folders scannable */
.embed-details { margin: 0 0 0.5rem 3.4rem; }
.embed-details summary {
  cursor: pointer; display: inline-block; font-size: 0.8rem; font-weight: 700;
  color: var(--lime-dark); list-style: none; padding: 0.2rem 0;
}
.embed-details summary::-webkit-details-marker { display: none; }
.embed-details summary:hover { text-decoration: underline; }
.embed-details .embed-wrap { max-width: 620px; }

/* ==========================================================================
   v3 — profile, goals, onboarding, public article slideshow
   ========================================================================== */

/* ---- Profile page ---- */
.profile-head { display: flex; align-items: center; gap: 1.25rem; flex-wrap: wrap; }
.profile-head .who h2 { margin: 0 0 0.2rem; }
.profile-head .who p { margin: 0; color: var(--muted); font-size: 0.9rem; }
.avatar-upload { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.avatar-upload input[type="file"] { display: none; }
.avatar-upload label.pick {
  margin: 0; cursor: pointer; font-size: 0.78rem; font-weight: 700; color: var(--lime-dark);
}
.avatar-upload label.pick:hover { text-decoration: underline; }

/* ---- Goals ---- */
.goal-group + .goal-group { margin-top: 1.4rem; }
.goal-group > h3 {
  font-size: 0.82rem; letter-spacing: 0.07em; color: var(--muted);
  border-bottom: 1px solid var(--border); padding-bottom: 0.4rem; margin-bottom: 0.6rem;
}
.goal {
  display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.55rem 0;
}
.goal + .goal { border-top: 1px solid var(--border); }
.goal .tick {
  flex: none; width: 22px; height: 22px; border-radius: 6px; border: 1.5px solid var(--border);
  background: #fff; cursor: pointer; display: grid; place-items: center;
  font-size: 0.8rem; font-weight: 800; color: transparent; padding: 0; margin-top: 1px;
}
.goal .tick:hover { border-color: var(--muted); }
.goal.done .tick { background: #0ca30c; border-color: #0ca30c; color: #fff; }
.goal.done .goal-body { color: var(--muted); text-decoration: line-through; }
.goal-body { flex: 1; font-size: 0.93rem; }
.goal-when { font-size: 0.78rem; color: var(--muted); display: block; margin-top: 0.1rem; }
.goal .remove { background: none; border: none; cursor: pointer; color: var(--danger); font-size: 1rem; padding: 0; }
.goal-empty { color: var(--muted); font-size: 0.88rem; padding: 0.3rem 0; }
.pillar-pill {
  display: inline-block; font-size: 0.68rem; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.06em; padding: 0.14rem 0.5rem; border-radius: 999px; margin-right: 0.4rem;
}
.pillar-pill.bio { background: #fff2d9; color: #b8790a; }
.pillar-pill.psycho { background: #e6ecfb; color: #3552b5; }
.pillar-pill.social { background: #eef6d9; color: var(--lime-dark); }

/* ---- Onboarding ---- */
.onboard-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  padding: 2rem 1.25rem;
}
.onboard-card {
  background: #fff; border-radius: 14px; padding: 2.25rem; width: 100%; max-width: 560px;
  box-shadow: 0 25px 60px rgba(0,0,0,0.45);
}
.onboard-logo { display: block; height: 58px; width: 58px; margin: 0 auto 1rem; }
.steps { display: flex; gap: 0.4rem; margin-bottom: 1.5rem; }
.steps span {
  flex: 1; height: 4px; border-radius: 2px; background: var(--border);
}
.steps span.on { background: var(--lime); }
.step { display: none; }
.step.active { display: block; }
.step h2 { font-size: 1.35rem; }
.step > p { color: var(--muted); font-size: 0.92rem; margin: 0 0 1.2rem; }
.onboard-actions { display: flex; justify-content: space-between; align-items: center; margin-top: 1.5rem; gap: 1rem; }
.goal-inputs { display: flex; flex-direction: column; gap: 0.8rem; }

/* ---- Public article slideshow (landing page) ---- */
.articles { background: var(--navy-dark); }
.slideshow { position: relative; max-width: 1000px; margin: 0 auto; }
.slide-track { position: relative; min-height: 260px; }
.slide {
  display: none; background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius); padding: 2rem; color: #fff;
}
.slide.on { display: block; animation: fadein 0.4s ease; }
@keyframes fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.slide .date {
  font-size: 0.75rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase;
  color: var(--lime);
}
.slide h3 { color: #fff; font-size: clamp(1.3rem, 2.6vw, 1.9rem); margin: 0.5rem 0 0.7rem; }
.slide p { color: #cdd6ea; margin: 0 0 1.2rem; max-width: 70ch; }
.slide-nav { display: flex; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 1.25rem; }
.slide-nav button {
  background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.2); color: #fff;
  width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 1rem; line-height: 1;
}
.slide-nav button:hover { background: rgba(255,255,255,0.18); }
.dots { display: flex; gap: 0.4rem; margin: 0 0.6rem; }
.dots button {
  width: 9px; height: 9px; border-radius: 50%; padding: 0; border: none; cursor: pointer;
  background: rgba(255,255,255,0.3);
}
.dots button.on { background: var(--lime); width: 22px; border-radius: 5px; }

/* ---- Public article page ---- */
.article-wrap { max-width: 720px; margin: 0 auto; padding: 2.5rem 1.25rem 5rem; }
.article-wrap .card { padding: 2.5rem; }
.article-body { font-size: 1.05rem; line-height: 1.75; color: var(--text); }
.article-body h2 { font-size: 1.35rem; margin-top: 1.8rem; }
.article-body h3 { font-size: 1.12rem; margin-top: 1.4rem; }
.article-body p { margin: 0 0 1.1rem; }
.article-cta {
  margin-top: 2.5rem; padding-top: 1.75rem; border-top: 1px solid var(--border); text-align: center;
}
