/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --orange: #0F2044;
  --orange-light: #E8EDF5;
  --text-primary: #111111;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border: #E8E8E8;
  --bg: #FFFFFF;
  --bg-surface: #F8F8F8;
  --header-h: 56px;
  --nav-h: 64px;
  --radius: 12px;
  --radius-sm: 8px;
}

html, body {
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  color: var(--text-primary);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* ── Top Header ───────────────────────────────────────────────────────────── */
.top-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--header-h);
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
}

.header-logo {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--orange);
  letter-spacing: -0.01em;
}

.header-screen-name {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── Main Content ─────────────────────────────────────────────────────────── */
.main-content {
  position: fixed;
  top: var(--header-h);
  bottom: var(--nav-h);
  left: 0;
  right: 0;
  overflow: hidden;
}

/* ── Screens ──────────────────────────────────────────────────────────────── */
.screen {
  display: none;
  position: absolute;
  inset: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.screen.active {
  display: block;
}

.screen-inner {
  max-width: 768px;
  margin: 0 auto;
  padding: 24px 20px 32px;
}

/* ── Typography ───────────────────────────────────────────────────────────── */
.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.section-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin-bottom: 24px;
}

/* ── Home — Category Cards ────────────────────────────────────────────────── */
.card-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 32px;
}

.category-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  min-height: 100px;
  transition: background 0.15s, border-color 0.15s, transform 0.12s;
  user-select: none;
}

.category-card:active {
  background: var(--orange-light);
  border-color: var(--orange);
  transform: scale(0.97);
}

.category-icon {
  font-size: 2rem;
  line-height: 1;
}

.category-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

/* ── Quick Start ──────────────────────────────────────────────────────────── */
.quick-start {
  border-top: 1px solid var(--border);
  padding-top: 24px;
}

.quick-start-title {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 14px;
}

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-primary {
  display: block;
  width: 100%;
  min-height: 52px;
  background: var(--orange);
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.12s;
}

.btn-primary:active {
  background: #cc6619;
  transform: scale(0.98);
}

/* ── Library — Category Tabs ─────────────────────────────────────────────── */
.lib-header-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.btn-lib-create {
  flex-shrink: 0;
  margin-top: 4px;
  padding: 7px 12px;
  background: #0F2044;
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: opacity 0.15s;
}

.btn-lib-create:hover { opacity: 0.85; }

.lib-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(60px, 1fr));
  gap: 0;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 20px;
}

.lib-tab {
  min-height: 48px;
  padding: 0 4px;
  border: none;
  border-right: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}

.lib-tab:last-child {
  border-right: none;
}

.lib-tab.active {
  background: var(--orange);
  color: #fff;
}

/* ── Library — My Drills ─────────────────────────────────────────────────── */

.lib-my-empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.88rem;
  padding: 32px 0;
}

.lib-my-drill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.lib-my-drill-row:last-child { border-bottom: none; }

.lib-my-drill-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  min-width: 0;
}

.lib-my-drill-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.badge-mine {
  font-size: 0.68rem;
  font-weight: 700;
  background: #E8F0FE;
  color: #0F2044;
  padding: 2px 6px;
  border-radius: 4px;
}

.lib-my-drill-reps {
  font-size: 0.78rem;
  color: var(--text-secondary);
}

.lib-my-drill-del {
  background: none;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  color: #CCC;
  padding: 4px;
  flex-shrink: 0;
  transition: color 0.15s;
}

.lib-my-drill-del:hover { color: #E53935; }

/* ── Library — Level Groups ──────────────────────────────────────────────── */
.level-group {
  margin-bottom: 8px;
}

.level-group-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0 8px;
}

.level-group-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
}

.level-group-badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  line-height: 1.4;
}

.level-group-badge.current {
  background: var(--orange-light);
  color: var(--orange);
}

.level-group-badge.locked {
  background: #F0F0F0;
  color: var(--text-muted);
}

/* ── Drill Cards ──────────────────────────────────────────────────────────── */
.drill-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drill-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}

.drill-card.current-level {
  border-left: 3px solid var(--orange);
}

/* .drill-card.locked-level removed — all drills are accessible regardless of level */

.drill-card-summary {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  cursor: pointer;
  min-height: 56px;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.drill-card-summary:active {
  background: #F5F5F5;
}

.drill-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  line-height: 1.3;
}

.drill-badges {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.badge {
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.badge-level {
  background: var(--orange-light);
  color: var(--orange);
}

.badge-partner {
  background: #EBEBEB;
  color: #666;
}

.badge-video {
  background: #E8F0FF;
  color: #3355CC;
}

.expand-chevron {
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  transition: transform 0.2s;
  flex-shrink: 0;
}

.drill-card.expanded .expand-chevron {
  transform: rotate(180deg);
}

.drill-card-detail {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid var(--border);
}

.drill-card.expanded .drill-card-detail {
  display: block;
}

.drill-reps {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding-top: 12px;
}

.drill-cue {
  font-size: 0.88rem;
  color: var(--text-primary);
  line-height: 1.5;
  margin-bottom: 14px;
  padding: 10px 12px;
  background: #FAFAFA;
  border-left: 3px solid var(--border);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-style: italic;
}

.btn-watch {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: not-allowed;
  opacity: 0.6;
  text-decoration: none;
}

.btn-watch.btn-watch-link {
  border-color: var(--orange);
  color: var(--orange);
  cursor: pointer;
  opacity: 1;
  transition: background 0.15s;
}

.btn-watch.btn-watch-link:hover {
  background: var(--orange-light);
}

/* ── Drill Cards ──────────────────────────────────────────────────────────── */
.drill-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.drill-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  min-height: 44px;
}

.drill-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 6px;
}

.drill-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.drill-badges {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.badge {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 20px;
  text-transform: capitalize;
}

.badge-level {
  background: var(--orange-light);
  color: var(--orange);
}

.badge-partner {
  background: #E8F0FF;
  color: #3355CC;
}

.drill-reps {
  font-size: 0.82rem;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.drill-cue {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-style: italic;
  line-height: 1.45;
}

/* ── Session Setup ────────────────────────────────────────────────────────── */
.session-setup {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 28px;
}

.field-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: -8px;
}

.field-select {
  min-height: 52px;
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 1rem;
  padding: 0 14px;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.session-drills-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 14px;
}

/* ── Progress Screen ──────────────────────────────────────────────────────── */
.progress-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 28px;
}

.progress-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
  text-align: center;
}

.progress-stat {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--orange);
  line-height: 1;
  margin-bottom: 6px;
}

.progress-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* ── Level Bars ───────────────────────────────────────────────────────────── */
.level-list {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 16px;
}

.level-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
}

.level-row + .level-row {
  border-top: 1px solid var(--border);
}

.level-cat {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  width: 76px;
  flex-shrink: 0;
}

.level-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.level-bar {
  height: 100%;
  background: var(--orange);
  border-radius: 4px;
  transition: width 0.4s ease;
  width: 0%;
}

.level-num {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--orange);
  width: 20px;
  text-align: right;
  flex-shrink: 0;
}

/* ── Progress Dashboard ───────────────────────────────────────────────────── */

.prog-content {
  padding-bottom: calc(var(--nav-h) + 20px);
}

/* Streak banner */
.prog-streak-banner {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--orange);
  color: #fff;
  padding: 24px 20px;
}

.prog-streak-flame {
  font-size: 3rem;
  line-height: 1;
  flex-shrink: 0;
}

.prog-streak-count {
  font-size: 1.7rem;
  font-weight: 800;
  line-height: 1.1;
}

.prog-streak-sub {
  font-size: 0.85rem;
  opacity: 0.88;
  margin-top: 3px;
}

/* Sections */
.prog-section {
  padding: 20px 16px 0;
}

.prog-section--last {
  padding-bottom: 4px;
}

.prog-section-title {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin-bottom: 10px;
}

/* This Week */
.prog-week-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.prog-week-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 12px 14px;
  text-align: center;
}

.prog-week-emoji {
  font-size: 1.6rem;
  margin-bottom: 6px;
}

.prog-week-count {
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--orange);
  line-height: 1;
}

.prog-week-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-top: 4px;
}

.prog-week-goal {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* My Levels */
.prog-levels-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}

.prog-level-row {
  padding: 13px 14px 10px;
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto auto;
  column-gap: 10px;
  row-gap: 5px;
}

.prog-level-row + .prog-level-row {
  border-top: 1px solid var(--border);
}

.prog-level-cat {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  align-self: center;
}

.prog-level-badge {
  font-size: 0.65rem;
  font-weight: 800;
  background: var(--orange);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  align-self: center;
  white-space: nowrap;
}

.prog-level-bar-wrap {
  grid-column: 1 / -1;
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.prog-level-bar {
  height: 100%;
  background: var(--orange);
  border-radius: 3px;
  transition: width 0.6s ease;
}

.prog-level-sub {
  grid-column: 1 / -1;
  font-size: 0.7rem;
  color: var(--text-secondary);
}

/* Recent Sessions */
.prog-sessions-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.prog-session-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 13px 14px;
}

.prog-sess-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.prog-sess-dot--bball   { background: var(--orange); }
.prog-sess-dot--agility { background: #34A853; }

.prog-sess-info {
  flex: 1;
  min-width: 0;
}

.prog-sess-date {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-bottom: 1px;
}

.prog-sess-type {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.prog-sess-meta {
  text-align: right;
  flex-shrink: 0;
}

.prog-sess-time {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-primary);
}

.prog-sess-drills {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 1px;
}

.prog-empty {
  font-size: 0.88rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 24px 0 8px;
}

/* Extra bottom clearance on session screen (nav + back button) */
#screen-session .screen-inner {
  padding-bottom: calc(var(--nav-h) + 56px);
}

/* ── Session Back Button ──────────────────────────────────────────────────── */

.btn-back-session {
  position: fixed;
  bottom: var(--nav-h);
  left: 0;
  right: 0;
  z-index: 90;
  background: var(--bg);
  border: none;
  border-top: 1px solid var(--border);
  padding: 10px 20px;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  line-height: 1;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.btn-back-session:active {
  background: var(--surface);
  color: var(--text-primary);
}

/* ── Bottom Navigation ────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  background: var(--bg);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

.nav-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  min-height: 44px;
  padding: 0;
  transition: color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.nav-btn.active {
  color: var(--orange);
}

.nav-icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

.nav-label {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

/* ── Session Runner ──────────────────────────────────────────────────────── */
.sess-view {
  display: none;
}

.sess-view.active {
  display: block;
}

/* Setup */
.sess-label {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 10px;
  margin-top: 24px;
}

.sess-label:first-of-type {
  margin-top: 0;
}

.sess-type-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 4px;
}

.sess-type-btn {
  min-height: 56px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.sess-type-btn:last-child {
  border-right: none;
}

.sess-type-btn.active {
  background: var(--orange);
  color: #fff;
}

.sess-focus-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.sess-focus-btn {
  min-height: 48px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  border-right: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  padding: 0 4px;
}

.sess-focus-btn:last-child {
  border-right: none;
}

.sess-focus-btn.active {
  background: #111;
  color: #fff;
}

.sess-partner-row {
  margin-top: 24px;
  margin-bottom: 28px;
}

.sess-check-label {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  min-height: 44px;
}

.sess-check-label input[type="checkbox"] {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  accent-color: var(--orange);
  cursor: pointer;
  flex-shrink: 0;
}

.btn-letsgo {
  display: block;
  width: 100%;
  min-height: 60px;
  background: var(--orange);
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.1s;
}

.btn-letsgo:active {
  background: #cc6619;
  transform: scale(0.98);
}

/* Active drill view */
.sess-progress-wrap {
  padding: 16px 20px 0;
  max-width: 768px;
  margin: 0 auto;
}

.sess-progress-bar-bg {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
  margin-bottom: 8px;
}

.sess-progress-bar-fill {
  height: 100%;
  background: var(--orange);
  border-radius: 3px;
  transition: width 0.35s ease;
  width: 0%;
}

.sess-progress-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 0;
  text-align: right;
}

.sess-drill-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px 24px;
  margin-bottom: 24px;
  text-align: center;
}

.sess-drill-category {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--orange);
  margin-bottom: 10px;
}

.sess-drill-name {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 10px;
}

.sess-drill-reps {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.sess-timer {
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.sess-paused-label {
  font-size: 0.9rem;
  font-weight: 700;
  color: #E67E22;
  margin-top: 6px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.btn-pause-resume {
  display: block;
  width: 100%;
  min-height: 48px;
  background: #0F2044;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  margin-bottom: 12px;
  transition: background 0.15s, transform 0.1s;
}

.btn-pause-resume:active { transform: scale(0.98); }

.btn-pause-resume.resuming {
  background: #2E7D32;
}

.btn-undo {
  display: block;
  width: auto;
  margin: 0 auto 10px;
  padding: 5px 16px;
  background: #F0F0F0;
  color: #666;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-undo:hover { background: #E0E0E0; }

.btn-skip:disabled,
.btn-done:disabled {
  opacity: 0.35;
  cursor: default;
  pointer-events: none;
}

.sess-action-row {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 12px;
  margin-bottom: 20px;
}

.btn-skip {
  min-height: 60px;
  background: var(--bg);
  color: var(--text-secondary);
  font-size: 1rem;
  font-weight: 600;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s;
}

.btn-skip:active {
  background: var(--bg-surface);
}

.btn-done {
  min-height: 60px;
  background: var(--orange);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn-done:active {
  background: #cc6619;
  transform: scale(0.98);
}

.sess-end-wrap {
  text-align: center;
}

.sess-end-link {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.875rem;
  cursor: pointer;
  min-height: 44px;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Summary view */
.sess-complete-header {
  text-align: center;
  padding: 16px 0 28px;
}

.sess-complete-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 12px;
}

.sess-complete-title {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.sess-total-time {
  font-size: 1rem;
  color: var(--text-secondary);
}

.sess-summary-section {
  margin-bottom: 20px;
}

.sess-summary-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.sess-summary-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  min-height: 44px;
}

.sess-summary-item:first-of-type {
  border-top: 1px solid var(--border);
}

.sess-summary-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.sess-summary-item-time {
  font-size: 0.85rem;
  color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.sess-empty {
  font-size: 0.875rem;
  color: var(--text-muted);
  padding: 8px 0 20px;
  font-style: italic;
}

/* ── Home Screen ─────────────────────────────────────────────────────────── */
.home-greeting {
  margin-bottom: 28px;
}

.home-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.home-date {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 400;
}

/* ── Week Strip ───────────────────────────────────────────────────────────── */
.week-strip {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 10px;
  margin-bottom: 28px;
}

.week-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  justify-content: center;
}

.week-day-abbr {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.week-day-num {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
}

.week-day.is-today .week-day-num {
  background: var(--orange);
  color: #fff;
}

.week-day-dots {
  display: flex;
  gap: 3px;
  min-height: 7px;
  align-items: center;
}

.dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.dot-basketball {
  background: var(--orange);
}

.dot-agility {
  background: #34A853;
}

/* ── Today's Plan ─────────────────────────────────────────────────────────── */
.today-plan {
  margin-bottom: 24px;
}

.plan-heading {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.plan-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.plan-item:first-of-type {
  border-top: 1px solid var(--border);
}

.plan-item-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.plan-item-text {
  flex: 1;
}

.plan-item-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.plan-item-duration {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.plan-buttons {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 20px;
}

.btn-basketball {
  display: block;
  width: 100%;
  min-height: 56px;
  background: var(--orange);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.12s;
}

.btn-basketball:active {
  background: #cc6619;
  transform: scale(0.98);
}

.btn-agility {
  display: block;
  width: 100%;
  min-height: 52px;
  background: #fff;
  color: #2A9040;
  font-size: 1rem;
  font-weight: 600;
  border: 2px solid #34A853;
  border-radius: var(--radius);
  cursor: pointer;
  letter-spacing: 0.01em;
  transition: background 0.15s, transform 0.12s;
}

.btn-agility:active {
  background: #F0FFF4;
  transform: scale(0.98);
}

.rest-message {
  text-align: center;
  padding: 32px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.rest-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

.rest-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.rest-sub {
  font-size: 0.875rem;
  color: var(--text-secondary);
}

/* ── Streak Bar ───────────────────────────────────────────────────────────── */
.streak-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  min-height: 56px;
}

.streak-emoji {
  font-size: 1.4rem;
  line-height: 1;
}

.streak-text {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.streak-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-left: auto;
}

/* ── iPad optimisations (≥ 768px) ────────────────────────────────────────── */
@media (min-width: 768px) {
  :root {
    --header-h: 60px;
    --nav-h: 72px;
  }

  .top-header {
    padding: 0 32px;
  }

  .header-logo {
    font-size: 1.2rem;
  }

  .screen-inner {
    padding: 32px 32px 40px;
  }

  .card-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .nav-btn {
    gap: 5px;
  }

  .nav-icon {
    width: 24px;
    height: 24px;
  }

  .nav-label {
    font-size: 0.75rem;
  }
}

/* ── App shell visibility ─────────────────────────────────────────────────── */
.app-shell {
  display: none;
}

.app-shell.visible {
  display: flex;
}

.main-content.app-shell.visible {
  display: block;
}

/* ── Auth screens ─────────────────────────────────────────────────────────── */
.auth-screen {
  display: none;
  position: fixed;
  inset: 0;
  background: var(--bg);
  z-index: 200;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 20px 60px;
}

.auth-screen.active {
  display: flex;
}

.auth-card {
  width: 100%;
  max-width: 420px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.auth-logo {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--orange);
  letter-spacing: -0.02em;
  margin-bottom: 32px;
}

.auth-title {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.auth-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.form-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
}

.form-input {
  height: 48px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--bg);
  outline: none;
  transition: border-color 0.15s;
}

.form-input:focus {
  border-color: var(--orange);
}

.auth-error {
  font-size: 0.875rem;
  color: #d93025;
  min-height: 20px;
  margin-bottom: 8px;
}

.auth-success {
  font-size: 0.875rem;
  color: #1a7a4a;
  min-height: 20px;
  margin-bottom: 8px;
  font-weight: 500;
}

.btn-auth {
  width: 100%;
  height: 52px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity 0.15s;
}

.btn-auth:active {
  opacity: 0.85;
}

.btn-auth:disabled {
  opacity: 0.5;
  cursor: default;
}

.auth-switch {
  margin-top: 20px;
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.auth-switch a {
  color: var(--orange);
  text-decoration: none;
  font-weight: 600;
}

.parent-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

/* ── Logout button in header ──────────────────────────────────────────────── */
.header-logout-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.header-logout-btn:active {
  color: var(--orange);
  background: var(--orange-light);
}

.header-logout-btn svg {
  width: 20px;
  height: 20px;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 2px;
}

.header-settings-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: color 0.15s, background 0.15s;
}

.header-settings-btn:active {
  color: var(--orange);
  background: var(--orange-light);
}

.header-settings-btn svg {
  width: 20px;
  height: 20px;
}

.header-signin-btn {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  margin-right: 4px;
}

.header-signin-btn:active { opacity: 0.85; }

/* Guest banner */
.guest-banner {
  position: fixed;
  top: var(--header-h);
  left: 0;
  right: 0;
  background: var(--orange);
  color: #fff;
  font-size: 0.83rem;
  font-weight: 600;
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 99;
}

.guest-banner-btn {
  background: #fff;
  color: var(--orange);
  border: none;
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

/* "Browse as Guest" link on login screen */
.auth-guest-link {
  margin-top: 14px;
  text-align: center;
  font-size: 14px;
}

.auth-guest-link a {
  color: #0F2044;
  text-decoration: underline;
  font-weight: 500;
}

.auth-guest-link a:hover { opacity: 0.75; }

/* Account deletion section inside account settings modal */
.acct-delete-section {
  border: 1px solid #FEE2E2;
  border-radius: 10px;
  padding: 14px;
  background: #FFF5F5;
}

.acct-delete-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: #B91C1C;
  margin-bottom: 6px;
}

.acct-delete-warning {
  font-size: 0.85rem;
  color: #7F1D1D;
  line-height: 1.5;
}

.acct-delete-btn {
  background: #DC2626;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.acct-delete-btn:hover { opacity: 0.88; }

/* ── Parent Dashboard ─────────────────────────────────────────────────────── */

/* Override auth-screen to be column, not centered */
#screen-parent-dashboard.auth-screen {
  padding: 0;
  align-items: stretch;
}

.pd-shell {
  width: 100%;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
}

.pd-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  height: 56px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
  flex-shrink: 0;
}

.pd-header-left {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.pd-header-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1;
  margin-top: -2px;
}

.pd-header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pd-header-delete-btn {
  background: transparent;
  border: none;
  padding: 4px 6px;
  font-size: 0.73rem;
  font-weight: 500;
  color: #EF9A9A;
  cursor: pointer;
  border-radius: 5px;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}
.pd-header-delete-btn:hover {
  color: #C62828;
  background: #FFF3F3;
}

.pd-body {
  flex: 1;
  padding: 20px 16px 80px;
  max-width: 640px;
  width: 100%;
  margin: 0 auto;
}

.pd-welcome {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.pd-section-label {
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 20px 0 12px;
}

.pd-loading {
  color: var(--text-secondary);
  font-size: 0.95rem;
  padding: 24px 0;
  text-align: center;
}

.pd-empty {
  text-align: center;
  padding: 40px 20px;
}

.pd-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.pd-empty-text {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.pd-empty-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Child card */
.child-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.child-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
}

.child-card-name {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.child-card-username {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.child-card-age {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg-surface);
  border-radius: 20px;
  padding: 2px 10px;
  font-weight: 500;
}

/* Quick stats row */
.child-stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}

.child-stat {
  background: var(--bg-surface);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.child-stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--orange);
  line-height: 1;
}

.child-stat-label {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 3px;
  text-align: center;
}

/* Category levels */
.child-levels {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
}

.child-level-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.child-level-cat {
  font-size: 0.78rem;
  color: var(--text-secondary);
  width: 56px;
  flex-shrink: 0;
}

.child-level-bar-wrap {
  flex: 1;
  height: 5px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.child-level-bar {
  height: 100%;
  background: var(--orange);
  border-radius: 3px;
  transition: width 0.4s ease;
}

.child-level-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-primary);
  width: 16px;
  text-align: right;
}

/* View details toggle */
.btn-view-details {
  width: 100%;
  margin-top: 14px;
  padding: 10px;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}

.btn-view-details:active,
.btn-view-details.open {
  border-color: var(--orange);
  color: var(--orange);
}

/* Sessions detail panel */
.child-detail-panel {
  margin-top: 10px;
  display: none;
}

.child-detail-panel.open {
  display: block;
}

.child-detail-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.child-session-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.88rem;
}

.child-session-item:last-child {
  border-bottom: none;
}

.child-session-left {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.child-session-type {
  font-weight: 600;
  color: var(--text-primary);
}

.child-session-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.child-session-right {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: right;
}

.child-session-drills {
  font-weight: 600;
  color: var(--orange);
}

.child-no-sessions {
  font-size: 0.88rem;
  color: var(--text-muted);
  text-align: center;
  padding: 16px 0;
}

/* Add child button */
.btn-add-child {
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 14px;
  background: none;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
  font-family: inherit;
  transition: border-color 0.15s, color 0.15s;
}

.btn-add-child:active {
  border-color: var(--orange);
  color: var(--orange);
}

/* ── Admin Dashboard ──────────────────────────────────────────────────────── */

#screen-admin-dashboard.auth-screen {
  padding: 0;
  align-items: stretch;
}

/* "Admin" badge next to logo */
.ad-sub {
  background: var(--orange);
  color: #fff;
  border-radius: 4px;
  padding: 1px 7px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.ad-panel-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 14px;
}

/* ── Stats row ────────────────────────────────────────────────────────────── */

.ad-stats-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 4px;
}

.ad-stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ad-stat-skeleton {
  min-height: 70px;
  background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.2s infinite;
}

@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.ad-stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--orange);
  line-height: 1;
}

.ad-stat-label {
  font-size: 0.77rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.ad-stat-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Search ───────────────────────────────────────────────────────────────── */

.ad-search-wrap {
  margin-bottom: 10px;
}

.ad-search-input {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: #fff;
  color: var(--text-primary);
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s;
}

.ad-search-input:focus {
  border-color: var(--orange);
}

/* ── User table rows ──────────────────────────────────────────────────────── */

.ad-user-row {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 13px 14px;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
  -webkit-tap-highlight-color: transparent;
  min-height: 44px;
}

.ad-user-row:active {
  border-color: var(--orange);
  box-shadow: 0 0 0 2px rgba(232,119,34,0.18);
}

.ad-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  color: #fff;
}

.ad-avatar-kid    { background: var(--orange); }
.ad-avatar-parent { background: #5a7bbf; }
.ad-avatar-admin  { background: #555; }

.ad-user-info {
  flex: 1;
  min-width: 0;
}

.ad-user-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-user-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-user-chips {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  flex-shrink: 0;
}

.ad-chip {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.ad-chip-role-kid    { background: #e8edf5; color: var(--orange); }
.ad-chip-role-parent { background: #e8eeff; color: #5a7bbf; }
.ad-chip-role-admin  { background: #eee; color: #555; }

.ad-chip-streak { background: #e8edf5; color: var(--orange); }

.ad-no-results {
  text-align: center;
  color: var(--text-muted);
  padding: 28px 0;
  font-size: 0.9rem;
}

/* ── Detail slide-up panel ────────────────────────────────────────────────── */

.ad-detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 200;
}

.ad-detail-panel {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(768px, 100%);
  max-height: 70vh;
  background: #fff;
  border-radius: 18px 18px 0 0;
  z-index: 201;
  overflow-y: auto;
  padding: 0 16px 32px;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.16);
}

.ad-detail-close-row {
  position: sticky;
  top: 0;
  background: #fff;
  padding: 12px 0 10px;
  display: flex;
  justify-content: flex-end;
  border-bottom: 1px solid var(--border);
  margin-bottom: 16px;
}

.ad-detail-close-btn {
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
}

.ad-detail-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.ad-detail-username {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.ad-detail-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
}

.ad-detail-pill {
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 0.78rem;
  font-weight: 600;
}

.ad-detail-pill-role-kid    { background: #e8edf5; color: var(--orange); }
.ad-detail-pill-role-parent { background: #e8eeff; color: #5a7bbf; }
.ad-detail-pill-role-admin  { background: #eee; color: #555; }
.ad-detail-pill-age  { background: #f5f5f5; color: var(--text-secondary); }

.ad-detail-section {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 14px 0 8px;
}

.ad-detail-link-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.ad-detail-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 4px;
}

.ad-detail-stat-box {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  text-align: center;
}

.ad-detail-stat-box-val {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--orange);
}

.ad-detail-stat-box-lbl {
  font-size: 0.7rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.ad-detail-level-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.ad-detail-level-cat {
  width: 72px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.ad-detail-level-bar-wrap {
  flex: 1;
  height: 7px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.ad-detail-level-bar {
  height: 100%;
  background: var(--orange);
  border-radius: 4px;
  transition: width 0.4s ease;
}

.ad-detail-level-num {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--orange);
  width: 22px;
  text-align: right;
  flex-shrink: 0;
}

/* child-session-item reuse works here */

/* ── Workout Overview ─────────────────────────────────────────────────────── */

.overview-header {
  margin-bottom: 16px;
}

.overview-meta {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 4px 0 0;
}

.overview-empty {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
  padding: 24px 0 12px;
}

.overview-drill-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.overview-move-btns {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex-shrink: 0;
}

.overview-move-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  width: 28px;
  height: 22px;
  font-size: 0.65rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  line-height: 1;
  -webkit-tap-highlight-color: transparent;
}

.overview-move-btn:disabled {
  opacity: 0.25;
  cursor: default;
}

.overview-move-btn:not(:disabled):active {
  background: var(--surface);
}

.overview-drill-info {
  flex: 1;
  min-width: 0;
}

.overview-drill-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.overview-drill-sub {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.overview-remove-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  font-size: 1.4rem;
  line-height: 1;
  color: #e05252;
  cursor: pointer;
  padding: 4px 6px;
  -webkit-tap-highlight-color: transparent;
}

.overview-remove-btn:active {
  opacity: 0.6;
}

/* Tappable reps button — styled as inline text */
.overview-reps-btn {
  display: inline;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  line-height: inherit;
  vertical-align: baseline;
}
.overview-reps-btn:active {
  opacity: 0.6;
}
.overview-reps-pencil {
  font-size: 0.7rem;
  opacity: 0.5;
  margin-left: 2px;
}

/* Inline reps editor */
.overview-reps-edit {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  vertical-align: middle;
}
.overview-reps-input {
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--orange);
  border-radius: 4px;
  padding: 2px 6px;
  width: 9ch;
  outline: none;
}
.overview-reps-confirm {
  font-family: inherit;
  font-size: 0.75rem;
  color: var(--orange);
  background: none;
  border: 1px solid var(--orange);
  border-radius: 4px;
  padding: 2px 6px;
  cursor: pointer;
  line-height: 1;
  min-height: 0;
  touch-action: manipulation;
}
.overview-reps-confirm:active {
  background: var(--orange);
  color: #fff;
}

.overview-add-row {
  display: flex;
  gap: 10px;
  margin-top: 16px;
}

.btn-overview-add {
  flex: 1;
  padding: 12px 8px;
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-align: center;
}

.btn-overview-add:active {
  background: var(--border);
}

/* ── Modals (Add Drill / Create Drill) ───────────────────────────────────── */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1000;
}

.modal-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 82vh;
  background: var(--bg);
  border-radius: 20px 20px 0 0;
  z-index: 1001;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.modal-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
}

.modal-close-btn {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 8px;
  -webkit-tap-highlight-color: transparent;
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 16px;
}

.modal-cat-header {
  position: sticky;
  top: 0;
  background: var(--surface);
  padding: 10px 20px 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border);
  z-index: 1;
}

.modal-drill-row {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}

.modal-drill-info {
  flex: 1;
  min-width: 0;
}

.modal-drill-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
}

.modal-drill-reps {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.modal-drill-add-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--orange);
  color: white;
  border: none;
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-drill-add-btn:active {
  opacity: 0.75;
}

.modal-drill-check-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #34A853;
  color: white;
  border: none;
  font-size: 1rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-drill-check-btn:active {
  opacity: 0.75;
  background: #2d8e47;
}

.modal-empty {
  padding: 32px 20px;
  color: var(--text-secondary);
  text-align: center;
}

/* modal reuses .form-group, .form-label, .form-input, .btn-auth, .auth-error */
.modal-body .form-group { padding: 0 20px; margin-top: 16px; }
.modal-body .btn-auth   { margin: 16px 20px 0; width: calc(100% - 40px); }
.modal-body .auth-error { padding: 0 20px; }

/* ── Admin Tabs ───────────────────────────────────────────────────────────── */

.ad-tab-bar {
  display: flex;
  gap: 0;
  margin: 16px 0 0;
  border-bottom: 2px solid var(--border);
}

.ad-tab {
  flex: 1;
  background: none;
  border: none;
  padding: 10px 12px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s, border-color 0.15s;
}

.ad-tab.active {
  color: var(--orange);
  border-bottom-color: var(--orange);
}

/* ── Admin Custom Drills Table ────────────────────────────────────────────── */

.ad-custom-drills-table {
  margin-top: 4px;
}

.ad-cd-head,
.ad-cd-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 0.9fr 0.75fr;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.ad-cd-head {
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
  background: var(--surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

.ad-cd-row {
  color: var(--text-primary);
}

.ad-cd-row:active {
  background: var(--surface);
}

.ad-cd-kid  { font-weight: 600; }
.ad-cd-name { color: var(--text-primary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-cd-reps { color: var(--text-secondary); font-size: 0.78rem; }
.ad-cd-date { color: var(--text-muted, var(--text-secondary)); font-size: 0.75rem; }

/* ── User Drills table (Admin) ───────────────────────────────────────────── */

.ad-ud-table {
  margin-top: 4px;
}

.ad-ud-head,
.ad-ud-row {
  display: grid;
  grid-template-columns: 1fr 1.4fr 0.9fr 0.7fr 1.1fr;
  gap: 8px;
  padding: 10px 16px;
  font-size: 0.8rem;
  border-bottom: 1px solid var(--border);
  align-items: center;
}

.ad-ud-head {
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.72rem;
  background: var(--bg-surface);
  position: sticky;
  top: 0;
  z-index: 1;
}

.ad-ud-row { color: var(--text-primary); }

.ad-ud-kid  { font-weight: 600; }
.ad-ud-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-ud-reps { color: var(--text-secondary); font-size: 0.78rem; }
.ad-ud-date { color: var(--text-muted, var(--text-secondary)); font-size: 0.75rem; }
.ad-ud-action { display: flex; align-items: center; }

.ad-ud-atl-btn {
  background: #0F2044;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.ad-ud-atl-btn:hover { background: #1a3260; }

.badge-in-lib {
  display: inline-block;
  background: #E8F5E9;
  color: #2E7D32;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}

.atl-success {
  margin-top: 12px;
  background: #E8F5E9;
  color: #2E7D32;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  padding: 10px;
  border-radius: 8px;
}

/* ── Archive UI (user Library My Drills) ─────────────────────────────────── */

.lib-my-drill-archive {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.1rem;
  padding: 4px 6px;
  border-radius: 6px;
  color: var(--text-secondary);
  transition: background 0.15s;
}
.lib-my-drill-archive:hover { background: var(--bg-surface); }

.lib-archive-row {
  display: flex;
  justify-content: center;
  margin: 16px 0 8px;
}

.lib-view-archive-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.lib-view-archive-btn:hover { background: var(--bg-surface); }

.lib-archived-section {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.lib-archived-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  margin-bottom: 8px;
  padding: 0 4px;
}

.lib-archived-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 4px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.lib-archived-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.lib-restore-btn {
  background: #E8F5E9;
  color: #2E7D32;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.lib-restore-btn:hover { background: #C8E6C9; }

.lib-perm-del-btn {
  background: #FFEBEE;
  color: #C62828;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
}
.lib-perm-del-btn:hover { background: #FFCDD2; }

/* ── Archive UI (admin) ──────────────────────────────────────────────────── */

.ad-dl-archive-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.ad-dl-archive-btn:hover { background: var(--bg-surface); }

.ad-ud-archive-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1rem;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 4px;
  color: var(--text-secondary);
}
.ad-ud-archive-btn:hover { background: var(--bg-surface); }

.ad-archive-toggle-row {
  display: flex;
  justify-content: center;
  padding: 16px 0 8px;
}

.ad-archive-toggle-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 18px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
}
.ad-archive-toggle-btn:hover { background: var(--bg-surface); }

.ad-archive-section-header {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  padding: 8px 16px 4px;
  border-top: 1px solid var(--border);
}

.ad-archived-drill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  gap: 8px;
}

.ad-archived-drill-info {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.ad-archived-drill-name {
  font-weight: 600;
  font-size: 0.85rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ad-archived-drill-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.ad-restore-btn {
  background: #E8F5E9;
  color: #2E7D32;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.ad-restore-btn:hover { background: #C8E6C9; }

.ad-perm-del-btn {
  background: #FFEBEE;
  color: #C62828;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}
.ad-perm-del-btn:hover { background: #FFCDD2; }

/* ── My Sessions ─────────────────────────────────────────────────────────── */

.my-sessions-section {
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--border, #eee);
}

.my-sessions-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.my-sessions-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0;
  color: var(--text-primary);
}

.btn-build-new {
  background: transparent;
  border: 2px solid var(--color-primary, #0F2044);
  color: var(--color-primary, #0F2044);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
  touch-action: manipulation;
}

.btn-build-new:active {
  background: var(--color-primary, #0F2044);
  color: #fff;
}

.my-sessions-empty {
  color: var(--text-secondary);
  font-size: 0.88rem;
  text-align: center;
  padding: 16px 0 8px;
  margin: 0;
}

.my-session-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface, #f7f7f7);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
  gap: 10px;
}

.my-session-info {
  flex: 1;
  min-width: 0;
}

.my-session-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.my-session-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.my-session-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.btn-sess-start {
  background: var(--color-primary, #0F2044);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  min-height: 36px;
}

.btn-sess-start:active { opacity: 0.85; }

.btn-sess-delete {
  background: transparent;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--text-secondary);
  touch-action: manipulation;
  min-height: 36px;
}

.btn-sess-delete:active { background: #fee; border-color: #f99; }

/* ── Toast ───────────────────────────────────────────────────────────────── */

.app-toast {
  position: fixed;
  bottom: 88px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: #222;
  color: #fff;
  padding: 10px 22px;
  border-radius: 24px;
  font-size: 0.9rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
  z-index: 500;
  white-space: nowrap;
}

.app-toast.visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Custom Session Builder ──────────────────────────────────────────────── */

.cb-screen {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: #fff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cb-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--border, #eee);
  background: #fff;
  flex-shrink: 0;
}

.cb-back-btn {
  background: none;
  border: none;
  color: var(--color-primary, #0F2044);
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  padding: 6px 4px;
  flex-shrink: 0;
  touch-action: manipulation;
}

.cb-name-input {
  flex: 1;
  border: 1.5px solid #ddd;
  border-radius: 8px;
  padding: 9px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background: var(--surface, #f7f7f7);
  outline: none;
  min-width: 0;
}

.cb-name-input:focus {
  border-color: var(--color-primary, #0F2044);
  background: #fff;
}

.cb-tabs-wrap {
  flex-shrink: 0;
  border-bottom: 1px solid var(--border, #eee);
  background: #fff;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.cb-tabs {
  display: flex;
  gap: 0;
  padding: 0 12px;
  white-space: nowrap;
}

.cb-tab {
  background: none;
  border: none;
  border-bottom: 3px solid transparent;
  padding: 10px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  touch-action: manipulation;
  flex-shrink: 0;
  transition: color 0.15s;
}

.cb-tab.active {
  color: var(--color-primary, #0F2044);
  border-bottom-color: var(--color-primary, #0F2044);
}

.cb-drill-list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 4px 0 100px;
}

.cb-cat-header {
  padding: 10px 16px 4px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-secondary);
  background: var(--surface, #f7f7f7);
  position: sticky;
  top: 0;
  z-index: 1;
}

.cb-drill-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border, #f0f0f0);
  gap: 10px;
}

.cb-drill-info {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.cb-drill-name {
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
}

.cb-drill-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 10px;
  background: #f0f0f0;
  color: var(--text-secondary);
  flex-shrink: 0;
}

.cb-drill-reps {
  font-size: 0.78rem;
  color: var(--text-secondary);
  flex-shrink: 0;
  white-space: nowrap;
}

.cb-toggle-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 2px solid #ddd;
  background: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  flex-shrink: 0;
  touch-action: manipulation;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}

.cb-toggle-btn.selected {
  border-color: var(--color-primary, #0F2044);
  background: var(--color-primary, #0F2044);
  color: #fff;
}

.cb-empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.88rem;
  padding: 32px 24px;
  margin: 0;
}

.cb-bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 768px;
  margin: 0 auto;
  background: #fff;
  border-top: 1px solid var(--border, #eee);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  z-index: 151;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
}

.cb-summary {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.cb-save-btn {
  background: var(--color-primary, #0F2044);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 11px 22px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  transition: opacity 0.15s;
}

.cb-save-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.cb-save-btn:not(:disabled):active { opacity: 0.85; }

/* ── Admin Custom Sessions table ─────────────────────────────────────────── */

.ad-cs-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: 0.82rem;
}

.ad-cs-head {
  display: grid;
  grid-template-columns: 20% 22% 9% 35% 14%;
  background: var(--surface, #f7f7f7);
  border-radius: 6px 6px 0 0;
  padding: 8px 12px;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.7rem;
  position: sticky;
  top: 0;
  z-index: 1;
}

.ad-cs-row {
  display: grid;
  grid-template-columns: 20% 22% 9% 35% 14%;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border, #f0f0f0);
  align-items: start;
  gap: 4px;
}

.ad-cs-row:nth-child(even) { background: var(--surface, #fafafa); }

.ad-cs-kid   { font-weight: 600; color: var(--text-primary); word-break: break-word; }
.ad-cs-name  { color: var(--text-primary); word-break: break-word; }
.ad-cs-count { color: var(--text-secondary); text-align: center; }
.ad-cs-names { color: var(--text-secondary); word-break: break-word; }
.ad-cs-date  { color: var(--text-muted, var(--text-secondary)); font-size: 0.72rem; }

.ad-cs-more-btn {
  background: none;
  border: none;
  color: var(--color-primary, #0F2044);
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-left: 2px;
}

/* ── Featured session card ───────────────────────────────────────────────── */

.my-session-card--featured {
  border-left: 3px solid var(--color-primary, #0F2044);
  background: #eef1f7;
}

.badge-featured {
  display: inline-block;
  background: var(--color-primary, #0F2044);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 10px;
  vertical-align: middle;
  margin-right: 6px;
  line-height: 1.5;
}

/* ── Session runner — step-by-step instructions ──────────────────────────── */

.sess-drill-instructions {
  margin: 10px 0 0 0;
  padding: 0 0 0 20px;
  list-style: decimal;
  text-align: left;
}

.sess-drill-instructions li {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 6px;
  padding-right: 4px;
}

.sess-drill-instructions li:last-child { margin-bottom: 0; }

/* ── Admin Drill Library ─────────────────────────────────────────────────── */

.ad-dl-controls {
  padding: 12px 0 4px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ad-dl-cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding-bottom: 4px;
}

.ad-dl-cat-tab {
  background: #F5F5F5;
  border: none;
  border-radius: 16px;
  padding: 5px 13px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.ad-dl-cat-tab.active {
  background: var(--orange);
  color: #fff;
}

.ad-dl-count {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 600;
}

.ad-dl-drill-card {
  background: #fff;
  border: 1px solid #EBEBEB;
  border-radius: 12px;
  padding: 14px 14px 12px;
  margin-bottom: 10px;
}

.ad-dl-drill-top {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.ad-dl-drill-name {
  font-size: 0.97rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

.ad-dl-badge {
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 10px;
  padding: 2px 9px;
  white-space: nowrap;
  flex-shrink: 0;
}

.ad-dl-badge-level {
  background: #F3F3F3;
  color: #555;
}

.ad-dl-drill-reps {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--orange);
  margin-bottom: 4px;
}

.ad-dl-drill-cue {
  font-size: 0.83rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin-bottom: 6px;
}

.ad-dl-drill-instructions {
  margin: 6px 0 6px 18px;
  padding: 0;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.ad-dl-drill-instructions li {
  margin-bottom: 4px;
}

.ad-dl-video-btn {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--orange);
  text-decoration: none;
  border: 1px solid var(--orange);
  border-radius: 8px;
  padding: 4px 11px;
}

.ad-dl-video-btn:hover { background: var(--orange); color: #fff; }

.ad-dl-drill-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 8px;
}

.ad-dl-edit-btn,
.ad-dl-delete-btn,
.ad-dl-add-video-btn {
  border: none;
  border-radius: 8px;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity 0.15s;
}

.ad-dl-edit-btn {
  background: #E8EDF5;
  color: var(--orange);
}

.ad-dl-delete-btn {
  background: #FEE2E2;
  color: #B91C1C;
}

.ad-dl-add-video-btn {
  background: transparent;
  color: #999;
  border: 1px dashed #ccc;
}

.ad-dl-edit-btn:hover,
.ad-dl-delete-btn:hover,
.ad-dl-add-video-btn:hover { opacity: 0.8; }

/* Drill Library header row */
.ad-dl-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 4px;
}

.ad-dl-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.ad-dl-add-btn {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 7px 15px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
}

.ad-dl-add-btn:hover { opacity: 0.88; }

/* ── Add / Edit Drill Modal ──────────────────────────────────────────────── */

.dm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.dm-box {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 8px 40px rgba(0,0,0,0.2);
}

.dm-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid #EBEBEB;
}

.dm-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.dm-close-btn {
  background: none;
  border: none;
  font-size: 1rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 4px 6px;
}

.dm-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.dm-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 2px;
}

.dm-hint {
  font-weight: 400;
  color: var(--text-secondary);
}

.dm-required {
  color: #E53E3E;
}

.dm-input,
.dm-select,
.dm-textarea {
  width: 100%;
  border: 1px solid #DDD;
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text-primary);
  background: #fff;
  box-sizing: border-box;
}

.dm-input:focus,
.dm-select:focus,
.dm-textarea:focus {
  outline: 2px solid var(--orange);
  border-color: transparent;
}

.dm-textarea { resize: vertical; min-height: 60px; }

.dm-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--text-primary);
  cursor: pointer;
}

.dm-error {
  font-size: 0.82rem;
  color: #B91C1C;
  min-height: 18px;
}

.dm-footer {
  padding: 12px 18px;
  border-top: 1px solid #EBEBEB;
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.dm-cancel-btn {
  background: none;
  border: 1px solid #DDD;
  border-radius: 10px;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-secondary);
}

.dm-save-btn {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 20px;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
}

.dm-save-btn:hover,
.dm-cancel-btn:hover { opacity: 0.85; }

/* ── Admin Build Workout ─────────────────────────────────────────────────── */

.ad-bw-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 12px;
}

@media (max-width: 640px) {
  .ad-bw-layout { grid-template-columns: 1fr; }
}

.ad-bw-picker,
.ad-bw-builder {
  background: #FAFAFA;
  border: 1px solid #EBEBEB;
  border-radius: 14px;
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-height: 300px;
}

.ad-bw-panel-title {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: 0.01em;
}

.ad-bw-pick-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid #F0F0F0;
}

.ad-bw-pick-row:last-child { border-bottom: none; }

.ad-bw-pick-info { flex: 1; min-width: 0; }

.ad-bw-pick-name {
  display: block;
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-bw-pick-meta {
  display: block;
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.ad-bw-pick-btn {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  width: 30px;
  height: 30px;
  font-size: 1.1rem;
  cursor: pointer;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.ad-bw-pick-btn--added {
  background: #E8F5E9;
  color: #2E7D32;
  cursor: default;
}

.ad-bw-name-input {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #DDD;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 0.9rem;
  font-family: inherit;
  outline: none;
}

.ad-bw-name-input:focus { border-color: var(--orange); }

.ad-bw-drill-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 0;
  border-bottom: 1px solid #F0F0F0;
}

.ad-bw-drill-row:last-child { border-bottom: none; }

.ad-bw-move-btns { display: flex; flex-direction: column; gap: 2px; }

.ad-bw-move-btn {
  background: none;
  border: 1px solid #DDD;
  border-radius: 5px;
  font-size: 0.65rem;
  padding: 1px 5px;
  cursor: pointer;
  color: var(--text-secondary);
}

.ad-bw-move-btn:disabled { opacity: 0.3; cursor: default; }

.ad-bw-drill-info { flex: 1; min-width: 0; }

.ad-bw-drill-name {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ad-bw-drill-reps {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.ad-bw-remove-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #CCC;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
}

.ad-bw-remove-btn:hover { color: #E53935; }

.ad-bw-empty {
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-align: center;
  padding: 20px 0;
}

.ad-bw-meta {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-align: right;
}

.ad-bw-save-btn {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  width: 100%;
}

.ad-bw-save-btn:disabled { opacity: 0.5; cursor: default; }

.ad-bw-existing-header {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid #EBEBEB;
}

.ad-bw-featured-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid #F0F0F0;
}

.ad-bw-featured-row:last-child { border-bottom: none; }

.ad-bw-featured-info {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  flex-wrap: wrap;
}

.ad-bw-featured-name {
  font-size: 0.87rem;
  font-weight: 600;
  color: var(--text-primary);
}

.ad-bw-featured-count {
  font-size: 0.75rem;
  color: var(--text-secondary);
}

.ad-bw-featured-del {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: #CCC;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
}

.ad-bw-featured-del:hover { color: #E53935; }

.ad-bw-featured-edit {
  background: none;
  border: none;
  font-size: 0.8rem;
  color: #0F2044;
  cursor: pointer;
  padding: 0 4px;
  flex-shrink: 0;
  opacity: 0.6;
}

.ad-bw-featured-edit:hover { opacity: 1; }

.ad-bw-cancel-edit {
  display: block;
  text-align: center;
  font-size: 0.78rem;
  color: #999;
  margin-top: 6px;
  text-decoration: none;
}

.ad-bw-cancel-edit:hover { color: #555; }

/* ── Family Code — Parent Dashboard ─────────────────────────────────────────── */

.pd-code-section {
  padding: 20px 20px 0;
}

.pd-section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.pd-code-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.pd-code-display {
  font-size: 1.6rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--orange);
  font-variant-numeric: tabular-nums;
  user-select: all;
}

.btn-copy-code {
  flex-shrink: 0;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-copy-code:hover {
  opacity: 0.88;
}

.pd-code-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.4;
}

/* ── Admin Family Code chips ─────────────────────────────────────────────── */

.ad-chip-code {
  background: #E8EDF5;
  color: var(--orange);
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.72rem;
}

.ad-chip-no-code {
  background: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ── Admin Generate Codes button ─────────────────────────────────────────── */

.ad-gen-codes-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
}

.ad-gen-codes-btn {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.ad-gen-codes-btn:hover {
  opacity: 0.88;
}

.ad-gen-codes-result {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

/* ── Team Screen ─────────────────────────────────────────────────────────── */

#screen-team {
  overflow-y: auto;
}

.team-screen-body {
  padding: 12px 16px 100px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.team-section-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Challenge cards */
.team-challenge-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
}

.team-ch-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.team-ch-name {
  font-weight: 700;
  font-size: 0.97rem;
}

.team-ch-badge {
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 7px;
  flex-shrink: 0;
}

.team-ch-badge-weekly { background: #E8EDF5; color: var(--orange); }
.team-ch-badge-season { background: #FFF3E0; color: #E65100; }

.team-ch-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
}

.team-ch-days {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* Leaderboard table */
.team-board-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.team-board-table thead th {
  text-align: left;
  padding: 4px 6px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.team-board-table tbody tr {
  border-bottom: 1px solid var(--border);
}

.team-board-table tbody tr:last-child { border-bottom: none; }

.team-board-table td {
  padding: 7px 6px;
  vertical-align: middle;
}

.team-board-rank  { color: var(--text-muted); width: 28px; }
.team-board-name  { font-weight: 500; }
.team-board-score { text-align: right; font-weight: 700; color: var(--orange); }

.team-board-me {
  background: var(--orange-light);
}

.team-board-me .team-board-name  { color: var(--orange); }
.team-board-me .team-board-score { color: var(--orange); }

.team-board-empty,
.team-board-more {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  padding: 8px;
}

/* My teams list */
.team-groups-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.team-group-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  gap: 12px;
}

.team-group-info { flex: 1; min-width: 0; }

.team-group-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.team-group-meta {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.team-leave-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  flex-shrink: 0;
}

.team-leave-btn:hover { border-color: #E53935; color: #E53935; }

.btn-join-team {
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  padding: 11px 16px;
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  width: 100%;
  text-align: center;
}

.btn-join-team:hover { opacity: 0.88; }

/* Empty state */
.team-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 10px;
  text-align: center;
}

.team-empty-icon  { font-size: 2.5rem; }
.team-empty-title { font-weight: 700; font-size: 1rem; }
.team-empty-sub   { font-size: 0.85rem; color: var(--text-secondary); }

/* ── Parent Teams & Challenges sections ──────────────────────────────────── */

.pd-teams-section,
.pd-challenges-section {
  padding: 20px 20px 0;
}

.pd-team-row {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 8px;
}

.pd-team-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.pd-team-name { font-weight: 600; font-size: 0.9rem; }
.pd-team-meta { font-size: 0.75rem; color: var(--text-muted); }

.pd-team-code-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.pd-team-code {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--orange);
}

.pd-view-members-btn {
  background: none;
  border: none;
  font-size: 0.78rem;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0;
  text-align: left;
}

.pd-view-members-btn:hover { color: var(--orange); }

.pd-team-members {
  padding-top: 6px;
  border-top: 1px solid var(--border);
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.pd-team-member {
  font-size: 0.8rem;
  background: var(--orange-light);
  color: var(--orange);
  border-radius: 4px;
  padding: 2px 8px;
  font-weight: 500;
}

.btn-pd-action {
  display: block;
  width: 100%;
  background: none;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 10px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  margin-top: 8px;
  text-align: center;
}

.btn-pd-action:hover { border-color: var(--orange); color: var(--orange); }

.pd-challenge-row {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 8px;
}

.pd-challenge-name { font-weight: 600; font-size: 0.88rem; }
.pd-challenge-meta { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }

/* ── Admin Challenges tab ────────────────────────────────────────────────── */

.ad-ch-header-row {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 8px 0 12px;
  gap: 10px;
}

.ad-ch-row {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 8px;
}

.ad-ch-row-active {
  border-color: #A5D6A7;
  background: #F1F8E9;
}

.ad-ch-row-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.ad-ch-row-name { font-weight: 600; font-size: 0.9rem; }

.ad-ch-status {
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 7px;
  flex-shrink: 0;
  text-transform: uppercase;
}

.ad-ch-status-active   { background: #C8E6C9; color: #2E7D32; }
.ad-ch-status-upcoming { background: #E3F2FD; color: #1565C0; }
.ad-ch-status-ended    { background: #F5F5F5; color: #9E9E9E; }

.ad-ch-row-meta    { font-size: 0.78rem; color: var(--text-secondary); margin-bottom: 2px; }
.ad-ch-row-creator { font-size: 0.75rem; color: var(--text-muted); }

/* dm-note / dm-success reuse */
.dm-note {
  font-size: 0.82rem;
  color: var(--text-secondary);
  background: var(--orange-light);
  border-radius: 6px;
  padding: 8px 12px;
  margin-bottom: 12px;
}

.dm-success {
  font-size: 0.85rem;
  color: #2E7D32;
  font-weight: 600;
  padding: 6px 0;
}

.dm-success-box {
  background: #E8F5E9;
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.85rem;
  color: #2E7D32;
  line-height: 1.5;
}

/* ── Challenge Drill / Workout Pickers ─────────────────────────────────────── */

.ch-drill-picker,
.ch-workout-picker {
  background: var(--surface-2, #F8F9FC);
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 10px;
  padding: 10px 12px;
  margin-bottom: 10px;
}

.ch-dp-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Category tabs inside picker */
.ch-dp-cat-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.ch-dp-cat-tab {
  background: transparent;
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 20px;
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.ch-dp-cat-tab.active,
.ch-dp-cat-tab:hover {
  background: var(--navy-blue, #0F2044);
  color: #fff;
  border-color: var(--navy-blue, #0F2044);
}

/* Scrollable drill list */
.ch-dp-list {
  max-height: 160px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-bottom: 8px;
}

.ch-dp-drill-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: background 0.1s;
}
.ch-dp-drill-item:hover { background: rgba(15, 32, 68, 0.05); }

.ch-dp-drill-item input[type="checkbox"] {
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  cursor: pointer;
  accent-color: var(--navy-blue, #0F2044);
}

.ch-dp-drill-name {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
}

.ch-dp-drill-cat {
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: capitalize;
}

.ch-dp-empty {
  font-size: 0.8rem;
  color: var(--text-muted);
  padding: 8px 0;
  text-align: center;
}

/* Selected drill tags */
.ch-dp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-height: 24px;
}

.ch-dp-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-style: italic;
}

.ch-dp-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(15, 32, 68, 0.10);
  color: var(--navy-blue, #0F2044);
  border-radius: 20px;
  padding: 2px 8px 2px 10px;
  font-size: 0.75rem;
  font-weight: 500;
}

.ch-dp-tag-remove {
  background: none;
  border: none;
  color: var(--navy-blue, #0F2044);
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.15s;
}
.ch-dp-tag-remove:hover { opacity: 1; }

/* Detail line under challenge meta */
.team-ch-detail {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-bottom: 2px;
  line-height: 1.35;
}

.pd-challenge-detail {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 1px;
  line-height: 1.3;
}

/* ── Team card edit / delete buttons (parent dashboard) ────────────────────── */

.pd-team-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.pd-team-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.pd-team-edit-btn {
  background: transparent;
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 6px;
  padding: 3px 9px;
  font-size: 0.75rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pd-team-edit-btn:hover {
  background: var(--navy-blue, #0F2044);
  color: #fff;
  border-color: var(--navy-blue, #0F2044);
}

.pd-team-del-btn {
  background: transparent;
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 6px;
  padding: 3px 7px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.pd-team-del-btn:hover {
  background: #FFEBEE;
  color: #C62828;
  border-color: #EF9A9A;
}

/* ── Admin groups table action buttons ─────────────────────────────────────── */

.ad-group-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}

.ad-group-edit-btn,
.ad-group-del-btn {
  background: transparent;
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.ad-group-edit-btn { color: var(--text-secondary); }
.ad-group-edit-btn:hover {
  background: var(--navy-blue, #0F2044);
  color: #fff;
  border-color: var(--navy-blue, #0F2044);
}

.ad-group-del-btn { color: var(--text-muted); }
.ad-group-del-btn:hover {
  background: #FFEBEE;
  color: #C62828;
  border-color: #EF9A9A;
}

/* ── Admin challenge row: status + delete aligned right ────────────────────── */

.ad-ch-row-top-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.ad-ch-del-btn {
  background: transparent;
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 0.78rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1.4;
}
.ad-ch-del-btn:hover {
  background: #FFEBEE;
  color: #C62828;
  border-color: #EF9A9A;
}

/* ── Parent challenge row: name + status badge ─────────────────────────────── */

.pd-challenge-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 2px;
}

.pd-ch-status {
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 7px;
  flex-shrink: 0;
  text-transform: uppercase;
  margin-top: 1px;
}
.pd-ch-status-active   { background: #C8E6C9; color: #2E7D32; }
.pd-ch-status-upcoming { background: #E3F2FD; color: #1565C0; }
.pd-ch-status-ended    { background: #F5F5F5; color: #9E9E9E; }

/* ── Parent challenge row: actions (status + edit + delete) ────────────────── */

.pd-ch-actions {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.pd-ch-edit-btn,
.pd-ch-del-btn {
  background: transparent;
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 0.78rem;
  color: var(--text-muted, #6B7280);
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1.4;
}
.pd-ch-edit-btn:hover {
  background: #E8EEF6;
  color: #1a3a5c;
  border-color: #9EB4D0;
}
.pd-ch-del-btn:hover {
  background: #FFEBEE;
  color: #C62828;
  border-color: #EF9A9A;
}

/* ── Invite a Parent section (parent dashboard) ────────────────────────────── */

.pd-invite-section {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border, #E5E7EB);
}

.pd-invite-text {
  font-size: 0.85rem;
  color: var(--text-muted, #6B7280);
  margin-bottom: 10px;
}

.pd-invite-result {
  margin-top: 12px;
  background: #F0F4FF;
  border: 1px solid #C7D7F7;
  border-radius: 8px;
  padding: 12px 14px;
}

.pd-invite-code-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.pd-invite-code-display {
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: #0F2044;
  font-family: "SF Mono", "Fira Code", monospace;
}

.pd-invite-code-hint {
  font-size: 0.78rem;
  color: #5a6a8a;
  line-height: 1.4;
}

.pd-invite-codes-list {
  margin-top: 14px;
}

.pd-ic-history-label {
  font-size: 0.73rem;
  font-weight: 600;
  color: var(--text-muted, #6B7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.pd-ic-history-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 5px 0;
  border-bottom: 1px solid var(--border, #F3F4F6);
  font-size: 0.83rem;
}

.pd-ic-history-code {
  font-family: "SF Mono", "Fira Code", monospace;
  font-weight: 700;
  color: #0F2044;
  letter-spacing: 0.05em;
}

.pd-ic-history-status {
  font-size: 0.68rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 7px;
  text-transform: uppercase;
}
.pd-ic-status-unused  { background: #C8E6C9; color: #2E7D32; }
.pd-ic-status-used    { background: #F5F5F5; color: #9E9E9E; }
.pd-ic-status-expired { background: #FFF8E1; color: #F57F17; }

/* ── Admin Invite Codes tab ────────────────────────────────────────────────── */

.ad-ic-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  padding-top: 4px;
}

.ad-ic-title {
  font-size: 1rem;
  font-weight: 700;
  color: #0F2044;
}

.ad-ic-table-header {
  display: grid;
  grid-template-columns: 1.1fr 1.8fr 0.6fr 0.8fr 0.8fr 0.7fr;
  gap: 8px;
  padding: 6px 10px;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-muted, #6B7280);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 2px solid var(--border, #E5E7EB);
  margin-bottom: 4px;
}

.ad-ic-row {
  display: grid;
  grid-template-columns: 1.1fr 1.8fr 0.6fr 0.8fr 0.8fr 0.7fr;
  gap: 8px;
  padding: 8px 10px;
  align-items: center;
  font-size: 0.82rem;
  border-bottom: 1px solid var(--border, #F3F4F6);
}
.ad-ic-row:hover { background: #F9FAFB; }

.ad-ic-code {
  font-family: "SF Mono", "Fira Code", monospace;
  font-weight: 800;
  color: #0F2044;
  letter-spacing: 0.06em;
  font-size: 0.88rem;
}

.ad-ic-note  { color: #374151; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ad-ic-uses  { color: #374151; font-weight: 600; }
.ad-ic-expires { color: #6B7280; font-size: 0.78rem; }

.ad-ic-status {
  font-size: 0.65rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 2px 7px;
  text-transform: uppercase;
  display: inline-block;
}
.ad-ic-status-active    { background: #C8E6C9; color: #2E7D32; }
.ad-ic-status-expired   { background: #FFF8E1; color: #F57F17; }
.ad-ic-status-exhausted { background: #FFEBEE; color: #C62828; }

.ad-ic-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.ad-ic-copy-btn,
.ad-ic-del-btn {
  background: transparent;
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 0.78rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  line-height: 1.4;
}
.ad-ic-copy-btn:hover { background: #EEF2FF; border-color: #A5B4FC; }
.ad-ic-del-btn:hover  { background: #FFEBEE; color: #C62828; border-color: #EF9A9A; }

/* ── Create Invite Code modal: success box ─────────────────────────────────── */

.ad-ic-success-box {
  background: #F0F7F0;
  border: 1px solid #A5D6A7;
  border-radius: 8px;
  padding: 14px 16px;
  margin-top: 14px;
}

.ad-ic-success-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: #2E7D32;
  margin-bottom: 6px;
}

.ad-ic-success-code-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.ad-ic-success-code {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: #0F2044;
  font-family: "SF Mono", "Fira Code", monospace;
}

/* ── Parent dashboard: Danger Zone ─────────────────────────────────────────── */

.pd-danger-section {
  margin-top: 28px;
  padding: 16px;
  border: 1.5px solid #FFCDD2;
  border-radius: 10px;
  background: #FFF8F8;
}

.pd-danger-label {
  color: #C62828 !important;
}

.pd-danger-warning {
  font-size: 0.82rem;
  color: #6B7280;
  line-height: 1.5;
  margin-bottom: 12px;
}

.btn-pd-danger {
  display: inline-block;
  background: transparent;
  border: 1.5px solid #EF9A9A;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #C62828;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn-pd-danger:hover {
  background: #FFEBEE;
  border-color: #C62828;
}

/* ── Parent delete modal ────────────────────────────────────────────────────── */

.pd-delete-modal-warning {
  font-size: 0.87rem;
  color: #374151;
  line-height: 1.55;
  background: #FFF3F3;
  border: 1px solid #FFCDD2;
  border-radius: 8px;
  padding: 12px 14px;
}

/* ── Admin user row: delete button ─────────────────────────────────────────── */

.ad-user-del-btn {
  background: transparent;
  border: 1px solid var(--border, #E5E7EB);
  border-radius: 5px;
  padding: 2px 7px;
  font-size: 0.78rem;
  color: var(--text-muted, #9CA3AF);
  cursor: pointer;
  margin-left: 4px;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  line-height: 1.4;
  flex-shrink: 0;
}
.ad-user-del-btn:hover {
  background: #FFEBEE;
  color: #C62828;
  border-color: #EF9A9A;
}

/* ── Session List View ───────────────────────────────────────────────────── */

.sesslist-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.sesslist-back-btn {
  background: none;
  border: none;
  color: var(--color-primary, #0F2044);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 0;
  flex-shrink: 0;
  touch-action: manipulation;
}

.sesslist-back-btn:hover { text-decoration: underline; }

.sesslist-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.sesslist-loading {
  padding: 32px 0;
  text-align: center;
}

.sesslist-empty-state {
  padding: 24px 0 8px;
}

.sesslist-empty-msg {
  color: var(--text-secondary);
  font-size: 0.9rem;
  text-align: center;
  line-height: 1.5;
  margin: 0 0 16px;
}

.sesslist-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  touch-action: manipulation;
  transition: background 0.1s, border-color 0.1s;
}

.sesslist-card:hover  { background: #F5F7FF; border-color: #B0BFEE; }
.sesslist-card:active { background: #ECF0FF; }

.sesslist-card-main {
  flex: 1;
  min-width: 0;
}

.sesslist-card-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sesslist-card-meta {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.sesslist-card-badges {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.btn-sesslist-new {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 12px;
  background: transparent;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  text-align: center;
  transition: border-color 0.15s, color 0.15s;
}

.btn-sesslist-new:hover {
  border-color: var(--color-primary, #0F2044);
  color: var(--color-primary, #0F2044);
}

/* ── Overview save row ───────────────────────────────────────────────────── */

.overview-save-row {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

.btn-overview-save {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  touch-action: manipulation;
}

.btn-overview-save:hover {
  background: #F0F4FF;
  border-color: var(--color-primary, #0F2044);
  color: var(--color-primary, #0F2044);
}

/* ── Overview title input (editable session name) ────────────────────────── */

.overview-title-input {
  width: 100%;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-primary);
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--border);
  padding: 4px 0;
  margin-bottom: 4px;
  outline: none;
  box-sizing: border-box;
}

.overview-title-input:focus {
  border-bottom-color: var(--color-primary, #0F2044);
}

/* ── Create Drill Modal extras ───────────────────────────────────────────── */

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-required {
  color: var(--color-danger, #D32F2F);
  font-weight: 700;
}

.form-hint {
  font-size: 0.75rem;
  color: var(--text-secondary);
  font-weight: 400;
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
  font-family: inherit;
  line-height: 1.5;
}

.form-check-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: var(--text-primary);
  cursor: pointer;
}

/* ── Drill card detail extras ────────────────────────────────────────────── */

.drill-instructions {
  margin: 6px 0 8px 0;
  padding-left: 20px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.drill-instructions li {
  margin-bottom: 3px;
}

.drill-partner-note {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin-top: 6px;
}

/* ── My Drills custom card actions ───────────────────────────────────────── */

.lib-custom-drill-actions {
  margin-top: 10px;
  display: flex;
  justify-content: flex-end;
}

/* ── Weekly Plan Summary (Sessions tab) ─────────────────────────────────── */

.weekly-plan-section {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.weekly-plan-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.weekly-plan-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.weekly-plan-edit-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 10px;
  font-size: 0.8rem;
  color: var(--text-secondary);
  cursor: pointer;
  touch-action: manipulation;
}

.weekly-plan-edit-btn:hover { background: var(--bg-surface); }

.weekly-plan-empty,
.weekly-plan-loading {
  color: var(--text-secondary);
  font-size: 0.88rem;
  margin: 0 0 10px;
}

.btn-plan-create {
  display: block;
  width: 100%;
  padding: 11px;
  background: transparent;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  touch-action: manipulation;
  text-align: center;
}

.btn-plan-create:hover {
  border-color: var(--color-primary, #0F2044);
  color: var(--color-primary, #0F2044);
}

.weekly-plan-summary { display: flex; flex-direction: column; gap: 5px; }

.wps-day-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 24px;
}

.wps-day-label {
  width: 30px;
  flex-shrink: 0;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding-top: 3px;
}

.wps-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.wps-session-pill {
  display: inline-block;
  background: var(--orange-light, #FFF3E0);
  color: var(--orange, #E65100);
  font-size: 0.72rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.wps-rest-label {
  font-size: 0.78rem;
  color: var(--text-muted, #bbb);
  padding-top: 3px;
}

/* ── Plan Builder Screen ─────────────────────────────────────────────────── */

.cb-header-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  flex: 1;
}

.pb-duration-wrap {
  display: flex;
  gap: 6px;
  padding: 10px 14px;
  overflow-x: auto;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
}

.pb-duration-wrap::-webkit-scrollbar { display: none; }

.pb-duration-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
}

.pb-duration-btn.active {
  background: var(--color-primary, #0F2044);
  color: #fff;
  border-color: var(--color-primary, #0F2044);
}

.pb-days-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 16px;
}

.pb-day-section {
  margin-bottom: 18px;
}

.pb-day-header {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.pb-day-sessions { display: flex; flex-direction: column; gap: 4px; margin-bottom: 6px; }

.pb-session-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
}

.pb-session-name {
  font-size: 0.85rem;
  color: var(--text-primary);
  flex: 1;
}

.pb-remove-btn {
  background: none;
  border: none;
  color: var(--text-muted, #ccc);
  font-size: 1.1rem;
  cursor: pointer;
  padding: 0 4px;
  line-height: 1;
  flex-shrink: 0;
  touch-action: manipulation;
}

.pb-remove-btn:hover { color: #c0392b; }

.pb-add-btn {
  display: block;
  width: 100%;
  padding: 8px;
  background: transparent;
  border: 1px dashed var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  cursor: pointer;
  text-align: center;
  touch-action: manipulation;
}

.pb-add-btn:hover { border-color: var(--color-primary, #0F2044); color: var(--color-primary, #0F2044); }

.pb-remove-wrap {
  padding: 8px 16px;
  text-align: center;
  flex-shrink: 0;
}

.pb-remove-link {
  background: none;
  border: none;
  font-size: 0.82rem;
  color: #c0392b;
  cursor: pointer;
  text-decoration: underline;
  touch-action: manipulation;
}

/* ── Plan Session Picker ─────────────────────────────────────────────────── */

.psp-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 500;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.psp-modal {
  width: 100%;
  max-width: 520px;
  height: 75vh;          /* fixed 75% sheet — always fully visible */
  background: #fff;
  border-radius: 20px 20px 0 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 -4px 32px rgba(0,0,0,0.2);
}

.psp-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.psp-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.psp-cat-tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  padding: 8px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  scrollbar-width: none;
}

.psp-cat-tabs::-webkit-scrollbar { display: none; }

.psp-cat-btn {
  flex-shrink: 0;
  padding: 5px 12px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
}

.psp-cat-btn.active {
  background: var(--color-primary, #0F2044);
  color: #fff;
}

.psp-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 14px 16px;
}

.psp-session-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.psp-session-row:last-child { border-bottom: none; }

.psp-session-info { flex: 1; min-width: 0; }

.psp-session-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.psp-session-meta {
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin-top: 2px;
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.psp-add-btn {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--color-primary, #0F2044);
  color: #fff;
  border: none;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  touch-action: manipulation;
}

.psp-added-btn {
  flex-shrink: 0;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: #34A853;
  color: #fff;
  border: none;
  font-size: 0.9rem;
  cursor: default;
  display: flex; align-items: center; justify-content: center;
}

.psp-auto-hint {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0 0 12px;
}

.psp-auto-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.psp-auto-btn {
  padding: 12px 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  touch-action: manipulation;
  text-align: center;
}

.psp-auto-btn:hover {
  background: var(--color-primary, #0F2044);
  color: #fff;
  border-color: var(--color-primary, #0F2044);
}

/* ── Today's Plan — plan-driven session rows ─────────────────────────────── */

.plan-progress {
  font-size: 0.78rem;
  color: var(--text-secondary);
  margin: 0 0 8px;
}

.plan-item--sess {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  margin-bottom: 8px;
  gap: 10px;
}

.plan-item--done {
  opacity: 0.7;
}

.plan-item--sess .plan-item-text {
  flex: 1;
  min-width: 0;
}

.plan-item--sess .plan-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.plan-item-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.plan-sess-done-badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: #34A853;
  background: #E8F5E9;
  padding: 3px 8px;
  border-radius: 20px;
  white-space: nowrap;
}

.btn-plan-sess {
  background: var(--color-primary, #0F2044);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  white-space: nowrap;
}

.btn-plan-sess:active { opacity: 0.8; }

.btn-plan-sess-redo {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  padding: 6px 10px;
  font-size: 0.9rem;
}

/* ── Countdown timer bar ─────────────────────────────────────────────────── */

.sess-countdown-bar-wrap {
  width: 100%;
  height: 6px;
  background: rgba(255,255,255,0.15);
  border-radius: 3px;
  margin: 8px 0 4px;
  overflow: hidden;
}

.sess-countdown-bar-fill {
  height: 100%;
  background: var(--orange, #E65100);
  border-radius: 3px;
  transition: width 0.9s linear, background 0.3s;
  width: 100%;
}

.sess-round-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  text-align: center;
  margin: 0;
}

/* ── Rest-period overlay ─────────────────────────────────────────────────── */

.sess-rest-overlay {
  position: absolute;
  inset: 0;
  background: var(--bg-surface, #f7f7f7);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  z-index: 10;
  text-align: center;
  padding: 20px;
}

.sess-rest-icon {
  font-size: 1.8rem;
}

.sess-rest-title {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--text-primary);
}

.sess-rest-sub {
  font-size: 0.9rem;
  color: var(--text-secondary);
  margin: 0;
}

.sess-rest-countdown {
  font-size: 2.5rem;
  font-weight: 900;
  color: var(--color-primary, #0F2044);
  font-variant-numeric: tabular-nums;
}
