:root {
  --green: #758F60;
  --blush: #E1CCBE;
  --olive: #757263;
  --blue: #C8DCE5;
  --dark: #3D3D3D;
  --bg: #F7F5F2;
  --white: #ffffff;
  --text: #3D3D3D;
  --text-muted: #757263;
  --border: rgba(61,61,61,0.12);
  --radius: 12px;
  --radius-sm: 8px;
  --nav-h: 64px;
  --header-h: 0px;
}

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

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

.page {
  min-height: 100vh;
  padding-bottom: calc(var(--nav-h) + 16px);
}

.page-content {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 16px 0;
}

.page-loader {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}

.empty-state {
  text-align: center;
  padding: 48px 16px;
  color: var(--text-muted);
}

.empty-icon {
  font-size: 48px;
  margin-bottom: 12px;
}

/* ── LOGO ── */
.join-logo {
  text-align: center;
  margin-bottom: 24px;
}
.logo-level {
  font-size: 18px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--dark);
}
.logo-10 {
  font-size: 52px;
  font-weight: 700;
  color: var(--green);
  line-height: 1;
}

/* ── JOIN PAGE ── */
.join-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 32px 20px;
}

.join-title {
  font-size: 22px;
  font-weight: 500;
  margin-bottom: 6px;
  text-align: center;
}

.join-sub {
  font-size: 14px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 20px;
}

.welcome-back-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 8px;
  text-align: center;
}

.lang-switcher {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-bottom: 16px;
}

.lang-btn {
  padding: 4px 14px;
  border: 1px solid var(--border);
  background: var(--white);
  border-radius: 99px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-muted);
}
.lang-btn.active {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

.join-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}
.join-tab {
  flex: 1;
  padding: 10px;
  background: none;
  border: none;
  font-size: 14px;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.join-tab.active {
  color: var(--green);
  border-bottom-color: var(--green);
  font-weight: 500;
}

/* ── FORMS ── */
.form-group {
  margin-bottom: 12px;
}
.form-group label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
}
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  font-size: 16px;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color 0.15s;
}
input:focus, textarea:focus {
  border-color: var(--green);
}
textarea {
  resize: vertical;
  min-height: 64px;
}

.checkbox-group { display: flex; align-items: flex-start; }
.checkbox-label {
  display: flex;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.4;
}
.checkbox-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  accent-color: var(--green);
}

.error-msg {
  color: #A32D2D;
  font-size: 13px;
  padding: 8px 0;
}

/* ── BUTTONS ── */
.btn-primary {
  background: var(--green);
  color: white;
  border: none;
  border-radius: 0;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.15s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-secondary {
  background: var(--white);
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 0;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}
.btn-secondary:hover { background: var(--bg); }

.btn-danger {
  background: #A32D2D;
  color: white;
  border: none;
  border-radius: 0;
  padding: 14px 20px;
  font-size: 16px;
  font-weight: 500;
  cursor: pointer;
}

.btn-tiny {
  padding: 4px 10px;
  font-size: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 0;
  cursor: pointer;
}
.btn-tiny:hover { background: var(--bg); }

.btn-full { width: 100%; }

/* ── NAVIGATION ── */
#bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--white);
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-around;
  z-index: 100;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  cursor: pointer;
  padding: 6px 12px;
  color: var(--text-muted);
  font-size: 11px;
  flex: 1;
  max-width: 80px;
  border: none;
  background: none;
  -webkit-tap-highlight-color: transparent;
}
.nav-item .nav-icon { font-size: 20px; transition: transform 0.15s; }
.nav-item:hover { color: var(--green); }
.nav-item:active { opacity: 0.7; transform: scale(0.93); }
.nav-item.active { color: var(--green); }
.nav-item.active .nav-icon { transform: scale(1.15); }

/* ── WELCOME ── */
.welcome-container {
  max-width: 400px;
  margin: 0 auto;
  padding: 32px 20px;
}
.welcome-container h1 {
  font-size: 24px;
  font-weight: 500;
  margin-bottom: 20px;
  text-align: center;
}
.welcome-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.welcome-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.welcome-row:last-child { border-bottom: none; }
.welcome-label { color: var(--text-muted); }
.welcome-value { font-weight: 500; }
.info-banner {
  background: #FAEEDA;
  color: #633806;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  text-align: center;
}

/* ── CHECK-IN ── */
.checkin-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  margin: -16px -16px 16px;
}
.checkin-score-row {
  display: flex;
  gap: 8px;
}
.score-card {
  flex: 1;
  text-align: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 4px;
}
.score-num {
  font-size: 24px;
  font-weight: 500;
  color: var(--green);
}
.score-lbl {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
}

.streak-risk-banner {
  margin-top: 8px;
  background: #FAEEDA;
  color: #633806;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  text-align: center;
}

.strike-banner {
  background: var(--green);
  color: white;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  text-align: center;
  font-weight: 500;
  margin-bottom: 12px;
  animation: pulse 0.5s ease;
}

.coach-msg-banner {
  background: var(--blush);
  color: #5a3e2b;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  margin-bottom: 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.coach-msg-icon { font-size: 16px; flex-shrink: 0; }

.cheer-notifications {
  margin-bottom: 12px;
}
.cheer-notif {
  background: #EAF3DE;
  color: var(--green);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 4px;
}

/* ── HABITS ── */
.habits-section { margin-bottom: 16px; }
.habits-date {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: -4px;
  margin-bottom: 10px;
  text-transform: capitalize;
}
.section-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}

.habit-row {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 12px 12px 16px;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: background 0.15s;
}
.habit-row.habit-done { background: #f0f7ea; }
.habit-row.habit-locked { opacity: 0.55; cursor: pointer; transition: opacity 0.2s; }
.habit-row.habit-locked:hover { opacity: 0.75; }
.habit-unlock-hint {
  font-size: 0.78em;
  font-weight: 400;
  color: var(--text-muted);
  white-space: nowrap;
}
.lock-explain-overlay { z-index: 300; }

.habit-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  flex: 1;
}
.habit-left input[type="checkbox"] {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: var(--green);
  cursor: pointer;
}
.habit-lock { font-size: 16px; flex-shrink: 0; }

.habit-label {
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.habit-name { font-size: 15px; font-weight: 500; }
.habit-pillar { font-size: 11px; font-weight: 500; margin-top: 1px; }
.habit-hormone { font-size: 11px; color: var(--text-muted); }
.habit-short { font-size: 12px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }
.habit-more-toggle { font-size: 11px; color: var(--primary); font-weight: 500; margin-top: 3px; cursor: pointer; user-select: none; }
.habit-more-toggle:hover { text-decoration: underline; }
.habit-long { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.6; padding: 8px 10px; background: var(--surface); border-radius: 6px; }

.habit-right { flex-shrink: 0; margin-left: 8px; }
.habit-pts {
  font-size: 13px;
  font-weight: 500;
  color: var(--green);
  background: #EAF3DE;
  padding: 2px 8px;
  border-radius: 99px;
}
.habit-pts-locked {
  font-size: 12px;
  color: var(--text-muted);
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 99px;
}
.habit-pts-dim {
  opacity: 0.45;
}

/* ── SUB-HABITS (Super-Start & Meals) ── */
.sub-habits-list {
  background: var(--white);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  overflow: hidden;
}
.sub-habit-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px 9px 16px;
  font-size: 13px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}
.sub-habit-row:last-child { border-bottom: none; }
.sub-habit-row:hover:not(.sub-disabled) { background: #f7f7f5; }
.sub-habit-row.sub-done { background: #f0f7ea; }
.sub-habit-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--green);
  cursor: pointer;
}
.sub-habit-label { flex: 1; color: var(--text); }
.sub-habit-check {
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  width: 16px;
  text-align: center;
}
.sub-disabled { opacity: 0.6; cursor: default; }
.sub-disabled input { cursor: default; }

/* ── MOOD ── */
.mood-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 16px;
}
.mood-label {
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.mood-optional { font-weight: 400; opacity: 0.7; }
.mood-buttons {
  display: flex;
  gap: 8px;
  justify-content: space-between;
}
.mood-btn {
  font-size: 24px;
  background: none;
  border: 2px solid transparent;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s;
}
.mood-btn.selected {
  border-color: var(--green);
  background: #EAF3DE;
  transform: scale(1.15);
}
.mood-btn.mood-disabled { cursor: default; }

/* ── TEAM CHALLENGES (coach-side only) ── */
.team-challenges-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 16px;
}
.challenge-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 6px 0;
}
.challenge-desc { flex: 1; }
.challenge-bonus {
  font-size: 12px;
  font-weight: 500;
  color: var(--green);
  background: #EAF3DE;
  padding: 2px 8px;
  border-radius: 99px;
  flex-shrink: 0;
}

/* ── LEADERBOARD ── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 8px;
}
.page-title {
  font-size: 20px;
  font-weight: 500;
}
/* lb-tabs kept for legacy safety but no longer rendered */
.lb-tabs { display: none; }

.lb-section-label {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.lb-sub {
  font-size: 12px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.lb-avg-pill {
  font-size: 12px;
  color: var(--olive);
  background: rgba(225,204,190,0.4);  /* Blush tint */
  padding: 2px 7px;
  border-radius: 99px;
  flex-shrink: 0;
  white-space: nowrap;
}

.lb-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
  font-size: 14px;
}
.lb-row-highlight { border-color: var(--green); background: #f0f7ea; }
.lb-rank {
  width: 28px;
  text-align: center;
  font-weight: 500;
  color: var(--text-muted);
  flex-shrink: 0;
}
.lb-name { flex: 1; font-weight: 500; min-width: 0; }
.lb-name-main {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-player-team {
  display: block;
  font-size: 11px;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.lb-streak {
  font-size: 12px;
  color: var(--green);
  background: #EAF3DE;
  padding: 2px 6px;
  border-radius: 99px;
}
.lb-pts {
  font-weight: 500;
  color: var(--green);
  flex-shrink: 0;
}
.rounds-badge {
  font-size: 11px;
  background: var(--blush);
  color: #5a3e2b;
  padding: 1px 6px;
  border-radius: 99px;
  margin-left: 4px;
}

.hof-section { margin-top: 24px; }
.hof-row { background: #FFF9F5; }
.hof-round { font-size: 12px; color: var(--text-muted); }

/* ── TEAM ── */
.team-score-card {
  background: var(--green);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  text-align: center;
}
.team-name-big {
  font-size: 18px;
  font-weight: 500;
  color: white;
  margin-bottom: 4px;
}
.team-pts-big {
  font-size: 32px;
  font-weight: 700;
  color: white;
}
.team-score-inner { text-align: center; }

.member-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 4px;
}
.member-me { border-color: var(--green); }
.member-not-checked { opacity: 0.7; }
.member-info { display: flex; flex-direction: column; gap: 2px; }
.member-name { font-weight: 500; font-size: 15px; }
.member-badges { font-size: 14px; }
.member-streak {
  font-size: 12px;
  color: var(--green);
  background: #EAF3DE;
  padding: 1px 6px;
  border-radius: 99px;
  display: inline-block;
}
.member-right { display: flex; align-items: center; gap: 8px; }
.member-pts { font-weight: 500; color: var(--green); }
.checked-badge { color: var(--green); font-size: 18px; }
.btn-cheer {
  font-size: 12px;
  padding: 4px 10px;
  background: #EAF3DE;
  color: var(--green);
  border: 1px solid var(--green);
  border-radius: 0;
  cursor: pointer;
}

/* ── HABIT UNLOCK POPUP ── */
.unlock-overlay { z-index: 300; }
.unlock-modal {
  text-align: center;
  overflow: hidden;
  padding: 0 0 24px;
  max-width: 320px;
  animation: unlockPop 0.35s cubic-bezier(0.34,1.56,0.64,1) both;
}
@keyframes unlockPop {
  from { transform: scale(0.7) translateY(20px); opacity: 0; }
  to   { transform: scale(1) translateY(0);      opacity: 1; }
}
.unlock-pillar-bar {
  height: 8px;
  width: 100%;
  border-radius: var(--radius) var(--radius) 0 0;
}
.unlock-emoji {
  font-size: 3rem;
  margin: 20px 0 4px;
}
.unlock-title {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.unlock-habit-name {
  font-size: 1.4rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.unlock-science {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
  padding: 0 20px;
  margin-bottom: 20px;
}
.unlock-go-btn { margin: 0 auto; width: calc(100% - 40px); }

/* ── MODALS ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal {
  background: var(--white);
  border-radius: var(--radius);
  padding: 20px;
  width: 100%;
  max-width: 360px;
}
.modal h3 {
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 16px;
}
.cheer-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.cheer-option {
  padding: 10px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  font-size: 14px;
}
.cheer-option:hover { background: #EAF3DE; border-color: var(--green); }

/* ── GRADUATION CARD (end-card variant of .weekly-card) ── */
/* The end card reuses the .weekly-card / .wc-* visual system; only the
   bits unique to graduation (improvements list, badges, rounds badge,
   28-dot hero) live here. */
.end-card .wc-hero-sub {
  font-size: 14px;
  font-weight: 500;
  color: #757263;
  padding: 4px 16px 0;
}
.grad-rounds-inline {
  font-weight: 700;
  color: #758F60;
}
/* 28-dot hero grid — four rows of seven so the shape echoes the four weeks. */
.end-dots {
  display: grid;
  grid-template-columns: repeat(7, 14px);
  gap: 5px;
  justify-content: center;
  margin-top: 10px;
}
.end-dots .wc-hero-dot {
  width: 14px;
  height: 14px;
}
/* Habit rows on the end card use a progress bar (out of 28) instead of
   per-day dots — 28 dots would crowd the row. */
.end-habit-row { gap: 10px; }
.end-habit-bar {
  flex: 1;
  height: 8px;
  background: #e4e0db;
  border-radius: 4px;
  overflow: hidden;
}
.end-habit-bar-fill {
  height: 100%;
  border-radius: 4px;
  transition: width 0.3s;
}
.grad-badges { display: flex; flex-wrap: wrap; gap: 6px; }
.grad-badge {
  font-size: 12px;
  background: var(--blush);
  color: #5a3e2b;
  padding: 3px 10px;
  border-radius: 99px;
}
.mood-graph {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 48px;
}
.mood-bar {
  flex: 1;
  min-width: 4px;
  border-radius: 2px 2px 0 0;
  transition: height 0.3s;
}
.mood-legend {
  display: flex;
  gap: 10px;
  margin-top: 6px;
  flex-wrap: wrap;
}
.mood-legend-item {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
}
.mood-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.grad-teammate {
  margin-bottom: 8px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}
.grad-teammate:last-child { border-bottom: none; }
.grad-teammate strong { font-size: 13px; }
.grad-teammate p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

.grad-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.grad-actions .btn-primary,
.grad-actions .btn-secondary {
  flex: 1;
  min-width: 100px;
  text-align: center;
  font-size: 14px;
  padding: 10px;
}

.grad-measurements-form {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.grad-measurements-form h3 {
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 12px;
  color: var(--text-muted);
}
.meas-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}

/* ── TEAMMATE MESSAGES ── */
.tm-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.tm-note {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.tm-row {
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.tm-row:last-child { border-bottom: none; }
.tm-name {
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
}
.tm-input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  font-size: 0.85rem;
  font-family: inherit;
  resize: none;
  margin-bottom: 6px;
  background: var(--bg);
}
.tm-input:focus { outline: none; border-color: var(--green); }
.tm-sent {
  font-size: 0.85rem;
  color: var(--green);
  font-weight: 500;
}

.whats-next-box {
  background: var(--green);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}
.whats-next-box h3 {
  color: white;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 8px;
}
.whats-next-box p {
  color: rgba(255,255,255,0.9);
  font-size: 14px;
  line-height: 1.6;
}

/* ── COACH DASHBOARD ── */
.coach-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.coach-section h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.coach-hint {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: -6px 0 12px;
  line-height: 1.5;
}
.role-badge {
  font-size: 12px;
  background: var(--green);
  color: white;
  padding: 3px 10px;
  border-radius: 99px;
}
.coach-team-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
}
.coach-team-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.team-code-badge {
  font-size: 12px;
  background: var(--white);
  border: 1px solid var(--border);
  padding: 2px 8px;
  border-radius: 99px;
  font-family: monospace;
  font-weight: 600;
  letter-spacing: 0.08em;
}
.coach-team-pts {
  font-size: 18px;
  font-weight: 500;
  color: var(--green);
  margin-bottom: 8px;
}
.checkedin-msg {
  text-align: center;
  color: var(--green);
  font-size: 14px;
  padding: 12px;
}

/* ── ADMIN ── */
.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  text-align: center;
}
.stat-num {
  font-size: 28px;
  font-weight: 500;
  color: var(--green);
}
.stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.admin-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
}
.admin-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
@media (max-width: 480px) {
  .admin-two-col { grid-template-columns: 1fr; }
}
.admin-two-col .admin-section { margin-bottom: 0; }
.coach-row-main { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.admin-section h2 {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 12px;
}
.game-status {
  font-size: 14px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  margin-bottom: 12px;
  font-weight: 500;
}
.status-active { background: #EAF3DE; color: var(--green); }
.status-inactive { background: var(--bg); color: var(--text-muted); }
.current-pw { font-size: 13px; color: var(--text-muted); margin-top: 8px; }
.pending-row, .coach-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.pending-row:last-child, .coach-row:last-child { border-bottom: none; }
.pending-row span, .coach-row span { flex: 1; }
.role-tag {
  font-size: 11px;
  background: var(--bg);
  color: var(--text-muted);
  padding: 2px 8px;
  border-radius: 99px;
}
.btn-approve {
  background: var(--green);
  color: white;
  border-color: var(--green);
}

/* ── TOAST ── */
#toast {
  position: fixed;
  bottom: calc(var(--nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(80px);
  background: var(--dark);
  color: white;
  padding: 10px 20px;
  border-radius: 99px;
  font-size: 14px;
  z-index: 300;
  opacity: 0;
  transition: all 0.3s;
  white-space: nowrap;
  max-width: 90vw;
  text-align: center;
}
#toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* ── CELEBRATION ── */
#celebration {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 250;
  cursor: pointer;
}
.celebration-inner {
  background: var(--white);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  font-size: 22px;
  font-weight: 500;
  max-width: 320px;
  animation: pop 0.3s ease;
}

@keyframes pop {
  0% { transform: scale(0.7); opacity: 0; }
  80% { transform: scale(1.05); }
  100% { transform: scale(1); opacity: 1; }
}

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.02); }
  100% { transform: scale(1); }
}

/* ── LEVEL 10 DAY CELEBRATION (rich variant) ── */
.l10-celebration {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f5f1ec 100%);
  max-width: 380px;
  padding: 36px 28px 28px;
}
.l10-glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle, rgba(117,143,96,0.35) 0%, rgba(117,143,96,0) 70%);
  animation: l10glow 2.4s ease-out;
  pointer-events: none;
}
@keyframes l10glow {
  0%   { opacity: 0; transform: scale(0.6); }
  40%  { opacity: 1; transform: scale(1.0); }
  100% { opacity: 0; transform: scale(1.4); }
}
.l10-strike {
  position: relative;
  font-size: 24px;
  font-weight: 700;
  color: #758F60;
  margin-bottom: 6px;
}
.l10-affirmation {
  position: relative;
  font-size: 18px;
  font-weight: 500;
  color: #3D3D3D;
}
.l10-milestone-banner {
  position: relative;
  margin-top: 18px;
  padding: 14px 12px;
  border-radius: 12px;
  background: #757263;
  color: #ffffff;
  animation: pop 0.4s ease 0.4s both;
}
.l10-milestone-emoji {
  font-size: 32px;
  line-height: 1;
}
.l10-milestone-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.85;
  margin-top: 4px;
}
.l10-milestone-name {
  font-size: 20px;
  font-weight: 700;
  margin: 2px 0 6px;
}
.l10-milestone-msg {
  font-size: 14px;
  line-height: 1.4;
  opacity: 0.95;
}
.l10-confetti-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}
.l10-confetti {
  position: absolute;
  top: -14px;
  width: 8px;
  height: 14px;
  border-radius: 2px;
  opacity: 0.92;
  animation: l10confetti 2.6s ease-in forwards;
}
@keyframes l10confetti {
  0%   { transform: translateY(-20px) rotate(0deg); opacity: 0; }
  10%  { opacity: 1; }
  100% { transform: translateY(420px) rotate(540deg); opacity: 0.4; }
}

/* ── LIFETIME COUNTER & MILESTONE HINT ── */
/* Lifetime cards intentionally use the same neutral background as the other
   score cards — emphasis sits in the milestone hint banner below, not in
   the card itself. (Was Blush gradient; de-emphasized 2026-05-17.) */
.score-card-lifetime {
  /* inherits .score-card neutral background */
}
.lifetime-next {
  margin-top: 8px;
  padding: 8px 12px;
  background: #C8DCE5;
  color: #1a4a5a;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}
.lifetime-next.lifetime-empty {
  background: #f5f1ec;
  color: #757263;
  font-style: italic;
}
/* Days-played card (Stars ladder) — neutral background to match the rest;
   the milestone hint banner carries the visual weight. */
.score-card-days {
  /* inherits .score-card neutral background */
}
/* Allow the score row to wrap once we have five cards on narrow viewports. */
.checkin-score-row {
  flex-wrap: wrap;
}
.checkin-score-row .score-card {
  min-width: 60px;
}
/* Star ladder "next hint" — Green-tinted so the two hint rows are
   visually distinct from each other at a glance. */
.lifetime-next.lifetime-next-star {
  background: #ecf1e6;
  color: #3D3D3D;
}

/* (?) button inside the milestone hint banner — opens the full ladder.
   Subtle, on-brand circle that uses the banner's own text colour so it
   inherits the blue/green/blush tones automatically. */
.lifetime-next-info {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  color: inherit;
  border: 1px solid currentColor;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  margin-left: 6px;
  padding: 0;
  vertical-align: middle;
  opacity: 0.75;
  transition: opacity 0.15s, background 0.15s;
}
.lifetime-next-info:hover,
.lifetime-next-info:focus {
  opacity: 1;
  background: rgba(255,255,255,0.9);
  outline: none;
}

/* ── MILESTONE LADDER MODAL ── */
.ladder-modal .modal-title {
  margin-bottom: 8px;
}
.ladder-intro {
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 16px;
}
.ladder-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ladder-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px solid transparent;
}
.ladder-row.ladder-locked {
  opacity: 0.55;
}
.ladder-row.ladder-achieved {
  background: #ecf1e6;
}
.ladder-row.ladder-current {
  background: #C8DCE5;
  border-color: #758F60;
}
.ladder-emoji {
  font-size: 22px;
  line-height: 1.2;
  flex-shrink: 0;
  min-width: 28px;
  text-align: center;
}
.ladder-body {
  flex: 1;
  min-width: 0;
}
.ladder-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--dark);
  line-height: 1.3;
}
.ladder-threshold {
  font-weight: 400;
  color: var(--text-muted);
  font-size: 13px;
}
.ladder-msg {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
  line-height: 1.45;
}
.ladder-state {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 12px;
  white-space: nowrap;
  flex-shrink: 0;
  align-self: center;
}
.ladder-state-done {
  background: #758F60;
  color: #fff;
}
.ladder-state-here {
  background: #757263;
  color: #fff;
}

/* ── CELEBRATION: NEXT-BADGE HINT INSIDE BANNER ── */
/* Thin divider + muted styling so the "next badge" row reads as
   secondary information, not a second celebration. */
.l10-milestone-next {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
  font-size: 13px;
  line-height: 1.4;
  opacity: 0.95;
}
.l10-milestone-next-lbl {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  opacity: 0.75;
  margin-bottom: 2px;
}
.l10-milestone-next-body {
  font-weight: 500;
}
.l10-milestone-next.l10-milestone-top {
  font-style: italic;
  text-align: center;
}
/* Star milestone banner — Green background to mirror the Stars ladder
   identity, keeping the Olive medal banner distinct. */
.l10-milestone-banner.l10-milestone-banner-star {
  background: #758F60;
}
/* Star-only celebration (no Level 10 day on the same check-in) — keep
   the celebration overlay but skip the heavy backdrop/glow that the
   strike celebration uses. */
.l10-celebration-star-only .l10-milestone-banner {
  margin-top: 0;
}

/* ── WINNERS ANNOUNCEMENT ── */
.winners-announcement {
  background: var(--dark);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.winners-title {
  font-size: 15px;
  font-weight: 500;
  color: var(--white);
  margin-bottom: 12px;
  text-align: center;
}
.winners-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.winner-cat {
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius-sm);
  padding: 10px 8px;
}
.winner-cat-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--blush);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.winner-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}
.winner-emoji {
  font-size: 14px;
  width: 18px;
  flex-shrink: 0;
}
.winner-name {
  font-size: 12px;
  color: var(--white);
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.winner-pts {
  font-size: 11px;
  color: var(--green);
  flex-shrink: 0;
}
.winner-none {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

/* ── LEADERBOARD EXTRAS ── */
.lb-sub {
  font-size: 11px;
  color: var(--text-muted);
  flex: 0 0 auto;
  margin-right: auto;
}


/* ── COACH MEASUREMENTS PANEL ── */
.measurements-panel {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.coach-meas-panel {
  display: flex;
  flex-direction: column;
}
.coach-meas-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 0 10px;
}
.coach-meas-name {
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text);
}
.meas-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}
.meas-table th {
  text-align: left;
  color: var(--text-muted);
  font-weight: 500;
  font-size: 0.72rem;
  padding: 2px 4px 4px;
}
.meas-table td {
  padding: 2px 4px;
  vertical-align: middle;
}
.meas-week-label {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  padding-right: 8px !important;
}
.meas-day-label {
  font-size: 0.68rem;
  color: var(--text-muted);
  font-weight: 400;
}
/* Targets BOTH legacy number inputs and the current text-mode inputs with
   inputmode="decimal". Sized to fit 5 characters ("137.5", "−123.4") with
   breathing room — at 0.9rem the longest realistic value needs ~70px of
   text, plus padding and border, so 92px is safe even with bold rendering. */
.meas-table input[type="number"],
.meas-table .meas-input:not(.meas-notes-input) {
  width: 92px;
  min-width: 92px;
  padding: 6px 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  background: var(--surface);
  color: var(--text);
  box-sizing: border-box;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.meas-table { table-layout: auto; }
.meas-table td { padding: 3px 3px; }
.meas-table th { white-space: nowrap; }
.meas-notes-row {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 4px;
}
.meas-notes-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
}
.meas-notes-input {
  width: 100%;
  padding: 5px 7px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  background: var(--surface);
  color: var(--text);
  resize: vertical;
  box-sizing: border-box;
}
.meas-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 4px 0;
}

/* ── PARTICIPANT MEASUREMENTS SECTION ── */
.participant-meas-section {
  margin-top: 20px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.meas-toggle-btn {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: inherit;
}
.meas-toggle-btn:hover { background: var(--border); }
.meas-toggle-arrow { margin-left: auto; font-size: 0.85rem; color: var(--text-muted); }
.participant-meas-form {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 14px 16px;
}

/* Measurement bonus banner — sits at top of the measurement form.
   Default: Blush bg + black text (the "earn 20 stig" framing).
   Full state: Olive bg + white text (the "100 / 100 ✓" celebration). */
.meas-bonus-banner {
  display: flex;
  flex-direction: column;
  gap: 2px;
  background: var(--blush);
  color: #000000;
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 12px;
}
.meas-bonus-banner-title {
  font-size: 0.92rem;
  font-weight: 600;
}
.meas-bonus-banner-sub {
  font-size: 0.78rem;
  opacity: 0.78;
}
.meas-bonus-banner-full {
  background: var(--olive);
  color: #FFFFFF;
}
.meas-bonus-banner-full .meas-bonus-banner-title {
  font-weight: 600;
}

/* Home-screen nudge — only shown when no measurement is logged this game-week
   and the bonus cap isn't hit. White card with Green left-border accent. */
.meas-bonus-nudge {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-left: 4px solid var(--green);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin: 10px 0 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.meas-bonus-nudge-title {
  font-size: 0.92rem;
  font-weight: 600;
  color: #000000;
}
.meas-bonus-nudge-body {
  font-size: 0.84rem;
  color: var(--text);
}
.meas-bonus-nudge-cta {
  align-self: flex-start;
  margin-top: 6px;
  padding: 6px 14px;
  background: var(--olive);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
}
.meas-bonus-nudge-cta:hover { filter: brightness(1.06); }

/* Score-breakdown line: measurement bonus appears under daily Level 10 points
   in the player + coach scoreboards. Green to signal it's a separate bucket. */
.meas-bonus-score-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: var(--text);
  margin-top: 4px;
}
.meas-bonus-score-pts { color: var(--green); font-weight: 600; }

/* Coach view: small chip next to each member's points showing their
   measurement-bonus total. Green to match the score-line styling. */
.member-meas-bonus {
  display: inline-block;
  padding: 1px 8px;
  margin-left: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--green);
  background: rgba(117, 143, 96, 0.10);
  border-radius: 10px;
  white-space: nowrap;
}

/* Emotional / wellbeing measurement section — five dimensions, each rated
   1-10 via a tap-friendly chip grid. Chips are wide enough for 40-80
   demographic fingers (min-width 32px) and high-contrast on selection. */
.emotion-section {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}
.emotion-section-title {
  font-size: 0.98rem;
  font-weight: 600;
  color: #000000;
  margin: 0 0 4px 0;
}
.emotion-section-desc {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0 0 12px 0;
  line-height: 1.4;
}
.emotion-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 10px;
}
.emotion-label {
  font-size: 0.86rem;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.emotion-chips {
  display: grid;
  grid-template-columns: repeat(10, 1fr);
  gap: 3px;
}
.emotion-chip {
  min-width: 0;
  width: 100%;
  height: 34px;
  padding: 0 2px;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: inherit;
  background: #FFFFFF;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  text-align: center;
}
.emotion-chip:hover { border-color: var(--green); }
.emotion-chip.is-active {
  background: var(--green);
  color: #FFFFFF;
  border-color: var(--green);
  font-weight: 600;
}
.emotion-composite {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--blush);
  color: #000000;
  border-radius: var(--radius-sm);
}
.emotion-composite-label {
  font-size: 0.85rem;
  font-weight: 500;
}
.emotion-composite-num {
  font-size: 1.4rem;
  font-weight: 700;
  color: #000000;
}
.emotion-composite-max {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Radar chart container on the graduation card. SVG is sized via viewBox
   and scales with the parent. Max-width keeps it readable on big screens. */
.wc-radar-section { text-align: center; }
.wc-radar-svg {
  width: 100%;
  max-width: 360px;
  height: auto;
  margin: 4px auto 0;
  display: block;
}

/* Welcome page onboarding card — introduces the +10 measurement bonus
   to new players. Blush bg + black headline matches the in-app banner. */
.welcome-bonus-card {
  background: var(--blush);
  color: #000000;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-top: 14px;
}
.welcome-bonus-title {
  font-size: 1.0rem;
  font-weight: 600;
  margin-bottom: 4px;
}
.welcome-bonus-body {
  font-size: 0.88rem;
  line-height: 1.45;
  margin: 0;
  color: var(--text);
}

.meas-custom-setup {
  margin-bottom: 12px;
}
.meas-field-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.meas-text-input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
}
.meas-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.meas-field { display: flex; flex-direction: column; }
.meas-num-input {
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  width: 100%;
  box-sizing: border-box;
}
.meas-num-input:disabled { opacity: 0.4; cursor: not-allowed; }
.meas-history-section {
  margin-top: 16px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
}
.meas-history-title {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 8px;
}
.meas-history-entry {
  font-size: 0.82rem;
  color: var(--text);
  padding: 5px 0;
  border-bottom: 1px solid var(--border);
  line-height: 1.5;
}
.meas-history-entry:last-child { border-bottom: none; }
.meas-entry-date {
  font-weight: 500;
  color: var(--text-muted);
}
.meas-empty-msg {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}

/* ── Goals picker (wellness goals chosen at baseline, editable anytime) ── */
.goals-section {
  background: var(--blush);
  border-radius: var(--radius-sm);
  padding: 14px 14px 12px;
  margin-bottom: 14px;
}
.goals-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  color: #000;
  margin: 0 0 4px;
}
.goals-section-desc {
  font-size: 0.78rem;
  color: var(--text);
  margin: 0 0 10px;
  line-height: 1.4;
}
.goals-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.goal-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.08);
  font-size: 0.82rem;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.goal-chip:hover { border-color: var(--green); }
.goal-chip[aria-pressed="true"] {
  background: var(--green);
  border-color: var(--green);
  color: var(--white);
  font-weight: 500;
}
.goal-chip[aria-pressed="true"] .goal-chip-check { opacity: 1; }
.goal-chip-check {
  display: inline-block;
  width: 14px;
  text-align: center;
  opacity: 0;
  transition: opacity 0.15s ease;
}
.goals-status {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin: 8px 0 0;
  min-height: 1em;
}

/* Level selector — join form */
.level-selector { display: flex; gap: 10px; margin-top: 4px; }
.level-opt {
  flex: 1;
  padding: 12px 8px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  cursor: pointer;
  font-size: 0.85rem;
  text-align: center;
  line-height: 1.4;
  transition: border-color 0.15s, background 0.15s;
}
.level-opt small { display: block; font-size: 0.75rem; color: var(--text-muted); margin-top: 4px; }
.level-opt-active {
  border-color: var(--green);
  background: #f0f7eb;
  font-weight: 600;
}

/* Leaderboard coach note */
.lb-coach-note {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 12px;
  padding: 8px;
  border-top: 1px solid var(--border);
}
}

/* ── HELP MODAL ── */
#help-modal.modal-overlay {
  z-index: 400;
}
.modal-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  max-width: 420px;
  width: 100%;
  position: relative;
  max-height: 88vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 18px;
  line-height: 1;
  padding: 4px 6px;
  cursor: pointer;
  color: var(--text-muted);
  border-radius: 50%;
  transition: background 0.15s;
}
.modal-close:hover { background: var(--bg); }
.modal-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 18px;
  padding-right: 28px;
  line-height: 1.3;
}
.help-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.help-steps li {
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}

/* ── HELP FAB ── */
.help-fab {
  position: fixed;
  bottom: calc(var(--nav-h) + 12px);
  right: 16px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--green);
  color: white;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.help-fab:hover { opacity: 1; }
.help-fab.no-nav {
  bottom: 20px;
}

/* Global language switcher — floats top-right on authenticated pages */
.lang-switcher-global {
  position: fixed;
  top: 10px;
  right: 12px;
  display: flex;
  gap: 4px;
  background: rgba(255,255,255,0.9);
  padding: 4px;
  border-radius: 99px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
  z-index: 90;
}
.lang-switcher-global .lang-btn {
  padding: 3px 10px;
  font-size: 11px;
}

/* On phone-width screens the floating IS / EN / DK switcher sits over the
   top-right of the dashboard and was hiding the "Level 10 dage" and star
   cards. Push the check-in header down so its score row clears the switcher. */
@media (max-width: 480px) {
  .checkin-header {
    padding-top: 44px;
  }
}

/* ─── WEEKLY PROGRESS CARD ─────────────────────────────────────────────── */
.wc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}
.wc-overlay.hidden { display: none; }
.wc-modal {
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.18);
}
.wc-scroll {
  overflow-y: auto;
  flex: 1;
  padding: 0 0 8px 0;
}
.wc-actions {
  padding: 12px 16px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
/* Card itself */
.weekly-card {
  background: #F7F5F2;
  font-family: 'Noto Sans', 'Helvetica Neue', sans-serif;
  overflow: hidden;
}
.wc-top-bar {
  background: #757263;  /* Olive — CTA style */
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
}
.wc-tag {
  font-size: 10px;
  color: #ffffff;
  letter-spacing: 0.08em;
  font-weight: 500;
  opacity: 0.85;
}
.wc-logo {
  font-size: 14px;
  font-weight: 300;
  color: #fff;
}
.wc-logo strong { font-weight: 700; }
.wc-title {
  font-size: 20px;
  font-weight: 700;
  color: #000000;  /* Black for headings */
  text-align: center;
  padding: 20px 16px 4px;
  letter-spacing: -0.02em;
}
.wc-name {
  font-size: 16px;
  font-weight: 600;
  color: #3D3D3D;  /* Dark body text */
  text-align: center;
  padding: 0 16px 2px;
}
.wc-team {
  font-size: 13px;
  color: #758F60;  /* Green accent */
  text-align: center;
  padding: 0 16px 12px;
  font-weight: 500;
}
/* Compact lifetime tier pills shown on weekly + graduation cards.
   One pill per ladder (medals = quality, stars = consistency). Sits
   above the L10 block so the per-round hero remains the headline. */
.wc-lifetime-pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  padding: 0 16px 12px;
}
.wc-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: #f5f1ec;
  color: #3D3D3D;
  white-space: nowrap;
}
.wc-pill-medal {
  background: #E1CCBE;   /* Blush — pairs with the medal hero */
  color: #3D3D3D;
}
.wc-pill-star {
  background: #ecf1e6;   /* Soft green tint — pairs with star ladder */
  color: #3D3D3D;
}

/* ── Goals row on weekly + graduation cards (static pills, not clickable) ── */
.wc-goals-section .wc-goals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.wc-goal-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  background: #ecf1e6;        /* Soft green tint — same family as star pill */
  color: #3D3D3D;
  border: 1px solid #d4dec5;
  white-space: nowrap;
}
.wc-stats-row {
  display: flex;
  gap: 0;
  border-top: 1px solid #e4e0db;
  border-bottom: 1px solid #e4e0db;
  margin: 0 0 16px 0;
}
.wc-meas-row-stats {
  background: #757263;  /* Olive */
  border-color: #757263;
  margin-top: -16px; /* close the gap after the stats row */
}
.wc-meas-row-stats .wc-stat { border-color: rgba(255,255,255,0.2); }
.wc-meas-row-stats .wc-stat-num { color: white; }
.wc-meas-row-stats .wc-stat-lbl { color: rgba(255,255,255,0.8); }
.wc-stat {
  flex: 1;
  text-align: center;
  padding: 12px 8px;
  border-right: 1px solid #e4e0db;
}
.wc-stat:last-child { border-right: none; }
.wc-stat-num {
  font-size: 22px;
  font-weight: 700;
  color: #758F60;  /* Green accent */
}
.wc-stat-lbl {
  font-size: 10px;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 2px;
}
.wc-section {
  padding: 0 16px 16px;
}
.wc-section-title {
  font-size: 11px;
  font-weight: 600;
  color: #777;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 10px;
}
.wc-habit-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.wc-habit-name {
  font-size: 12px;
  color: #333;
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wc-dots {
  display: flex;
  gap: 3px;
}
.wc-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #e4e0db;
}
.wc-dot-done { opacity: 1; }
.wc-habit-count {
  font-size: 11px;
  font-weight: 600;
  color: #758F60;  /* Green accent */
  min-width: 24px;
  text-align: right;
}
.wc-compare {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: #E1CCBE;  /* Blush — sections/cards */
  margin: 0 16px 16px;
  border-radius: 10px;
  padding: 12px 16px;
}
.wc-compare-col { text-align: center; }
.wc-compare-num {
  font-size: 24px;
  font-weight: 700;
  color: #757263;  /* Olive */
}
.wc-compare-lbl {
  font-size: 10px;
  color: #555;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.wc-compare-now .wc-compare-num { color: #758F60; }  /* Green for current */
.wc-compare-arrow {
  font-size: 18px;
  color: #757263;  /* Olive */
  opacity: 0.5;
}
.wc-msg {
  font-size: 13px;
  color: #444;
  line-height: 1.6;
  padding: 0 16px 16px;
  font-style: italic;
  text-align: center;
}
.wc-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px 14px;
  border-top: 1px solid #e4e0db;
}
.member-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.member-row:last-child { border-bottom: none; }
.member-name { flex: 1; }
.member-pts { font-size: 12px; color: var(--text-muted); min-width: 30px; text-align: right; }

.wc-coach-msg {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  background: #fff;
  border: 1px solid #e4e0db;
  border-left: 3px solid #758F60;  /* Green accent */
  border-radius: 8px;
  padding: 10px 14px;
  margin: 0 16px 16px;
}
.wc-coach-msg-icon { font-size: 16px; flex-shrink: 0; margin-top: 1px; }
.wc-coach-msg p { font-size: 13px; color: #333; line-height: 1.5; margin: 0; }
.wc-coach { font-size: 11px; color: #777; }
.wc-l10 { font-size: 11px; color: #758F60; font-weight: 600; }  /* Green */

/* ── Redesigned weekly card hero ───────────────────────────────────────── */
.wc-hero-title-block {
  text-align: center;
  padding: 22px 18px 6px;
}
.wc-title-eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #757263;  /* Olive */
  font-weight: 500;
  text-transform: uppercase;
}
.wc-hero-name {
  font-size: 22px;
  font-weight: 500;
  color: #000000;
  margin: 4px 0 2px;
  letter-spacing: -0.01em;
}
.wc-hero-sub {
  font-size: 13px;
  color: #3D3D3D;
  line-height: 1.4;
  padding: 0 8px;
}
.wc-hero-title-block .wc-team {
  padding: 6px 16px 0;
}

/* Level 10 hero block (green, the brand-name metric) */
.wc-l10-block {
  background: #758F60;  /* Green — Level 10 colour */
  color: #FFFFFF;
  margin: 16px 14px 14px;
  border-radius: 14px;
  padding: 18px 16px;
  text-align: center;
}
.wc-l10-eyebrow {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.9;
  font-weight: 500;
}
.wc-l10-num {
  font-size: 52px;
  font-weight: 500;
  line-height: 1.1;
  margin: 4px 0 6px;
}
.wc-l10-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 6px;
}
.wc-hero-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: inline-block;
}
.wc-hero-dot-on { background: #FFFFFF; }
.wc-l10-desc {
  font-size: 12px;
  opacity: 0.9;
  margin-top: 10px;
  line-height: 1.4;
}

/* 3-up white stat cards (replaces the cryptic Day 1 → Avg block) */
.wc-stats-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding: 0 14px;
  margin-bottom: 14px;
}
/* 2-up variant — used on the weekly card after the streak stat was
   dropped. Inherits .wc-stat3 / .wc-stat3-num / .wc-stat3-lbl. */
.wc-stats-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 14px;
  margin-bottom: 14px;
}
.wc-stat3 {
  background: #FFFFFF;
  border-radius: 10px;
  padding: 12px 6px;
  text-align: center;
}
.wc-stat3-num {
  font-size: 22px;
  font-weight: 500;
  color: #758F60;  /* Green */
  line-height: 1.1;
}
.wc-stat3-lbl {
  font-size: 10px;
  color: #757263;  /* Olive */
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 4px;
  line-height: 1.2;
}

/* 4-week journey bar */
.wc-journey-section { padding-top: 4px; }
.wc-journey-segs {
  display: flex;
  gap: 6px;
  margin-top: 4px;
}
.wc-journey-seg {
  flex: 1;
  height: 8px;
  border-radius: 4px;
}
.wc-journey-done { background: #758F60; }      /* Green — completed week */
.wc-journey-future { background: #E5E2DA; }    /* Neutral — upcoming */
.wc-journey-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #757263;
  margin-top: 6px;
  letter-spacing: 0.04em;
}

/* ── WEEKLY MEASUREMENT BUTTON (above habits) ── */
/* Compact persistent button — shows on non-measurement days, or after a
   measurement has been saved/skipped for the day. Tapping expands the
   full measurement form below it. */
.meas-weekly-section { margin: 0 0 14px; }
.meas-weekly-btn {
  width: 100%;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: border-color 0.15s, background 0.15s;
}
.meas-weekly-btn:hover { border-color: var(--green); }
.meas-weekly-btn .mw-icon {
  font-size: 22px;
  line-height: 1;
  flex-shrink: 0;
}
.meas-weekly-btn .mw-body { flex: 1; min-width: 0; }
.meas-weekly-btn .mw-title {
  display: block;
  font-size: 0.95rem;
  font-weight: 600;
  color: #000;
}
.meas-weekly-btn .mw-sub {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.meas-weekly-btn .mw-arrow {
  color: var(--text-muted);
  font-size: 18px;
  flex-shrink: 0;
}
.meas-weekly-btn.is-saved { background: rgba(117,143,96,0.08); border-color: rgba(117,143,96,0.25); }
.meas-weekly-btn.is-saved .mw-title { color: var(--green); }

/* Mini 5-dot progress under the button title */
.meas-mini-dots {
  display: flex;
  gap: 5px;
  margin-top: 6px;
}
.meas-mini-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
}
.meas-mini-dot.done { background: var(--green); }
.meas-mini-dot.today {
  background: var(--olive);
  box-shadow: 0 0 0 2px rgba(117,114,99,0.25);
}
/* Past milestone that was never saved or skipped — faint olive outline */
.meas-mini-dot.missed {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(117,114,99,0.45);
}

/* ── EXPANDED MEASUREMENT-DAY BANNER ── */
.meas-day-banner {
  background: var(--blush);
  border-radius: var(--radius);
  padding: 16px 16px 14px;
  margin: 0 0 14px;
  color: var(--dark);
}
.meas-day-banner.is-day1 {
  background: var(--green);
  color: var(--white);
}
.meas-day-banner.is-final {
  background: var(--olive);
  color: var(--white);
}
.meas-day-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}
.meas-day-icon { font-size: 24px; line-height: 1; }
.meas-day-title {
  font-size: 1.05rem;
  font-weight: 600;
  flex: 1;
}
.meas-day-banner.is-day1 .meas-day-title,
.meas-day-banner.is-final .meas-day-title { color: var(--white); }
.meas-day-pill {
  background: var(--olive);
  color: var(--white);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 600;
}
.meas-day-banner.is-day1 .meas-day-pill,
.meas-day-banner.is-final .meas-day-pill {
  background: var(--white);
  color: var(--olive);
}
.meas-day-desc {
  font-size: 0.85rem;
  margin: 0 0 10px;
  line-height: 1.45;
}
.meas-day-banner.is-day1 .meas-day-desc,
.meas-day-banner.is-final .meas-day-desc { color: rgba(255,255,255,0.95); }

.meas-day-progress {
  display: flex;
  gap: 6px;
  margin: 6px 0 12px;
}
.meas-day-progress .meas-mini-dot { width: 10px; height: 10px; }
.meas-day-banner.is-day1 .meas-mini-dot,
.meas-day-banner.is-final .meas-mini-dot { background: rgba(255,255,255,0.35); }
.meas-day-banner.is-day1 .meas-mini-dot.today,
.meas-day-banner.is-final .meas-mini-dot.today {
  background: var(--white);
  box-shadow: 0 0 0 2px rgba(255,255,255,0.5);
}
.meas-day-banner.is-day1 .meas-mini-dot.done,
.meas-day-banner.is-final .meas-mini-dot.done { background: var(--white); }

/* Catch-up variant — same blush bg, subtle olive accent bar on the left to
   communicate "you're catching up on an earlier milestone". */
.meas-day-banner.is-catchup {
  border-left: 3px solid var(--olive);
  padding-left: 13px;
}
.meas-day-banner.is-day1 .meas-mini-dot.missed,
.meas-day-banner.is-final .meas-mini-dot.missed {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px rgba(255,255,255,0.55);
}

.meas-day-fields {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  margin-bottom: 8px;
}
.meas-day-fields .meas-field-label {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.meas-day-banner.is-day1 .meas-day-fields .meas-field-label,
.meas-day-banner.is-final .meas-day-fields .meas-field-label {
  color: rgba(255,255,255,0.85);
}
.meas-day-fields .meas-num-input {
  background: var(--white);
  border: 1px solid rgba(0,0,0,0.08);
  font-size: 1rem;
  padding: 10px;
  text-align: center;
}

.meas-day-hint {
  font-size: 0.72rem;
  font-style: italic;
  color: var(--text-muted);
  text-align: center;
  margin: 4px 0 12px;
}
.meas-day-banner.is-day1 .meas-day-hint,
.meas-day-banner.is-final .meas-day-hint {
  color: rgba(255,255,255,0.85);
}

.meas-day-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}
.meas-day-save {
  flex: 1;
  background: var(--olive);
  color: var(--white);
  border: none;
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.meas-day-save:disabled { opacity: 0.6; cursor: wait; }
.meas-day-banner.is-day1 .meas-day-save,
.meas-day-banner.is-final .meas-day-save {
  background: var(--white);
  color: var(--olive);
}
.meas-day-skip {
  background: transparent;
  color: var(--olive);
  border: none;
  padding: 11px 4px;
  font-size: 0.85rem;
  text-decoration: underline;
  cursor: pointer;
  font-family: inherit;
}
.meas-day-banner.is-day1 .meas-day-skip,
.meas-day-banner.is-final .meas-day-skip { color: var(--white); }

/* ========================================================================
   Coach dashboard: enriched Members panel (default-open under each team card)
   Mobile-first — designed to fit inside the 480px page width while still
   surfacing rank, name, points, Level 10 days, weight loss kg + %, status.
   ======================================================================== */
.coach-members-panel {
  margin-top: 10px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.coach-members-loading,
.coach-members-empty {
  padding: 14px;
  font-size: 13px;
  color: var(--text-muted);
  text-align: center;
}
.coach-sort-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 10px 8px;
  border-bottom: 1px solid var(--border);
  background: #FCFAF7;
}
.coach-sort-label {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
  margin-right: 4px;
}
.coach-sort-pill {
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--text);
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}
.coach-sort-pill:hover { border-color: var(--green); color: var(--green); }
.coach-sort-pill.active {
  background: var(--olive);
  color: var(--white);
  border-color: var(--olive);
}

.coach-members-list { display: flex; flex-direction: column; }

.coach-mrow {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.12s ease;
}
.coach-mrow:last-child { border-bottom: none; }
.coach-mrow:hover { background: #FCFAF7; }
.coach-mrow.expanded { background: #F7F1E7; }

.coach-mrow-head {
  display: grid;
  grid-template-columns: 22px 1fr auto 12px;
  align-items: center;
  gap: 8px;
}
.coach-mrank {
  font-size: 15px;
  font-weight: 500;
  color: var(--olive);
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.coach-mrank.gold   { color: #B8860B; }
.coach-mrank.silver { color: #8A8A8A; }
.coach-mrank.bronze { color: #A86F3F; }

.coach-mwho { min-width: 0; }
.coach-mname {
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.coach-mbadge {
  display: inline-block;
  font-size: 11px;
  vertical-align: middle;
  margin-left: 2px;
  line-height: 1;
}
.coach-mbadge.one  { opacity: 0.75; }
.coach-mbadge.two  { opacity: 1; }
.coach-mgoal {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 2px;
  font-size: 11px;
  color: var(--text-muted);
}
.coach-mgoal-icon { width: 11px; height: 11px; flex-shrink: 0; }

.coach-mpts {
  font-size: 15px;
  font-weight: 500;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.coach-mpts .u {
  font-size: 10px;
  font-weight: 400;
  color: var(--text-muted);
  margin-left: 2px;
}
.coach-mstatus {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: rgba(61,61,61,0.18);
  display: inline-block;
}
.coach-mstatus.good { background: var(--green); }
.coach-mstatus.warn { background: #C9A66B; }
.coach-mstatus.quiet { background: rgba(61,61,61,0.18); }

.coach-mrow-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 6px;
  padding-left: 30px;
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.coach-mmeta-l10 strong {
  color: var(--text);
  font-weight: 500;
}
.coach-mflame {
  margin-right: 4px;
  font-size: 11px;
  display: inline-block;
  vertical-align: middle;
  line-height: 1;
}
.coach-mflame.off {
  filter: grayscale(1);
  opacity: 0.35;
}
.coach-mdots {
  display: inline-flex;
  gap: 2px;
  margin-left: 4px;
  vertical-align: middle;
}
.coach-mdots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(61,61,61,0.18);
  display: inline-block;
}
.coach-mdots span.on { background: var(--green); }
.coach-mmeta-loss {
  font-weight: 500;
}
.coach-mmeta-loss.good { color: var(--green); }
.coach-mmeta-loss.bad  { color: #B85C5C; }
.coach-mmeta-loss.flat { color: var(--text-muted); }
.coach-mmeta-loss.none { color: rgba(61,61,61,0.4); font-style: italic; font-weight: 400; }

/* Expanded panel inside a member row */
.coach-mrow-expand {
  margin-top: 10px;
  padding: 10px 0 4px;
  border-top: 1px dashed var(--border);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.coach-exp-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
}
.coach-exp-panel h4 {
  margin: 0 0 8px;
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}
.coach-spark { width: 100%; height: 64px; display: block; }
.coach-meas-list {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12px;
}
.coach-meas-list li { display: flex; flex-direction: column; }
.coach-meas-list .k { color: var(--text-muted); font-size: 10px; }
.coach-meas-list .v { color: var(--text); font-weight: 500; }
.coach-no-meas {
  font-size: 12px;
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  padding: 12px 0;
}

.coach-habit-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  gap: 4px;
  font-size: 10px;
  align-items: center;
}
.coach-habit-grid .hdr { color: var(--text-muted); text-align: center; padding: 2px 0; }
.coach-habit-grid .pillar { color: var(--text); padding: 4px 0; font-weight: 500; }
.coach-habit-grid .pillar.habit-breakfast  { color: #8A6E5D; }
.coach-habit-grid .pillar.habit-superStart { color: var(--green); }
.coach-habit-grid .pillar.habit-meals      { color: #8A6E5D; }
.coach-habit-grid .pillar.habit-strength   { color: #6B8A99; }
.coach-habit-grid .cell {
  aspect-ratio: 1;
  border-radius: 4px;
  background: rgba(61,61,61,0.12);
}
.coach-habit-grid .cell.on { background: var(--green); }
/* Parent vs sub-habit styling: parent rows stay bold; sub rows are
   indented, lighter, and use smaller cells so the grid stays scannable
   even with 15+ rows (4 parents + 4 + 5 + 6 sub-habits). */
.coach-habit-grid .pillar.habit-parent {
  font-weight: 600;
  margin-top: 6px;
  font-size: 11px;
}
.coach-habit-grid .pillar.habit-parent:first-of-type { margin-top: 0; }
.coach-habit-grid .pillar.habit-sub {
  padding-left: 10px;
  font-weight: 400;
  font-size: 9.5px;
  opacity: 0.75;
}
.coach-habit-grid .cell.sub {
  transform: scale(0.72);
  border-radius: 3px;
  opacity: 0.92;
}

/* ──────────────────────────────────────────────────────────────────────
   Custom remove-player confirm modal. Native confirm() is jarring and
   only works in English on iOS Safari, so we render our own overlay with
   localised copy and a clear destructive button. */
.l10-confirm-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 1000;
  padding: 20px;
}
.l10-confirm-box {
  background: var(--white);
  border-radius: var(--radius);
  padding: 18px 18px 14px;
  max-width: 360px;
  width: 100%;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
}
.l10-confirm-msg {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
}
.l10-confirm-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

/* ──────────────────────────────────────────────────────────────────────
   Per-player measurement editor modal — same week-grid as the team-level
   editor but shown in an overlay so the coach can fix one person's
   numbers without leaving the player-detail view. */
.l10-meas-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 1000;
  padding: 24px 12px;
  overflow-y: auto;
}
.l10-meas-modal {
  background: var(--white);
  border-radius: var(--radius);
  width: 100%;
  max-width: 520px;
  box-shadow: 0 12px 40px rgba(0,0,0,0.25);
  margin: auto;
}
.l10-meas-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 15px;
}
.l10-meas-close {
  background: transparent;
  border: none;
  font-size: 20px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 4px;
}
.l10-meas-body { padding: 14px 16px 18px; }
.l10-meas-loading { color: var(--text-muted); font-size: 13px; }

.coach-reco {
  background: var(--blush);
  color: var(--text);
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  line-height: 1.45;
}
.coach-exp-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 8px;
}

/* Head Coach overview: team + coach context line under the goal */
.coach-mctx {
  margin-top: 3px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 10px;
  color: var(--text-muted);
}
.coach-mctx-team,
.coach-mctx-coach {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.coach-mctx-team { color: var(--green); }
.coach-mctx-coach { color: var(--olive); }

/* Filter dropdowns above the Head Coach sort pills */
.coach-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  padding: 10px 10px 0;
  background: #FCFAF7;
}
.coach-filter-group {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.coach-filter-label {
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 600;
}
.coach-filter-sel {
  font-family: inherit;
  font-size: 12px;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 10px;
  max-width: 160px;
  cursor: pointer;
}
.coach-filter-sel:focus {
  outline: none;
  border-color: var(--green);
}
.coach-filter-count {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

