/* ============================================================
   Streetlifting University — Training Portal
   Mobile-first stylesheet
   ============================================================ */

/* --- SLU design tokens ------------------------------------ */
:root {
  /* Core palette */
  --slu-navy:         #0f1923;   /* header, strong backgrounds         */
  --slu-dark:         #1a2433;   /* secondary dark backgrounds          */
  --slu-accent:       #e63000;   /* primary action — SLU red-orange     */
  --slu-accent-dim:   #fff0eb;   /* light accent tint                   */
  --slu-accent-hover: #c72800;   /* accent on press / hover             */

  /* Surface & text */
  --slu-bg:           #f0f4f8;   /* page background                     */
  --slu-card:         #ffffff;   /* card / input surfaces               */
  --slu-border:       #e2e8f0;   /* borders and dividers                */
  --slu-text:         #111827;   /* primary text                        */
  --slu-muted:        #64748b;   /* secondary / label text              */
  --slu-subtle:       #94a3b8;   /* tertiary text, timestamps           */

  /* Feedback colours */
  --slu-green:        #15803d;   /* success / within-target text        */
  --slu-green-bg:     #dcfce7;   /* success background                  */
  --slu-amber:        #fefce8;   /* RPE awareness background            */
  --slu-amber-border: #fde68a;   /* RPE awareness border                */
  --slu-amber-text:   #78350f;   /* RPE awareness text                  */
  --slu-red:          #dc2626;   /* true errors only                    */
  --slu-red-bg:       #fee2e2;   /* error background                    */

  /* Shared tokens */
  --radius:   12px;
  --radius-sm: 8px;
  --shadow:   0 1px 3px rgba(0,0,0,.07), 0 4px 14px rgba(0,0,0,.07);
  --shadow-lg: 0 4px 8px rgba(0,0,0,.08), 0 12px 28px rgba(0,0,0,.1);
}

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

html {
  font-size: 16px;
  /* Prevent iOS from auto-scaling text in landscape */
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  overflow-x: hidden;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: var(--slu-bg);
  color: var(--slu-text);
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

/* ============================================================
   HEADER
   ============================================================ */

.site-header {
  background: var(--slu-navy);
  border-bottom: 2px solid var(--slu-accent);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
  height: 58px;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* Brand block — left side */
.site-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Logo slot — hidden until an image is placed here */
.site-logo-img {
  height: 28px;
  width: auto;
  display: block;
}

.site-brand-text {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.site-name {
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .07em;
  color: #ffffff;
  text-transform: uppercase;
  line-height: 1;
}

.site-portal {
  font-size: .6rem;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--slu-accent);
  text-transform: uppercase;
  line-height: 1;
}

/* Right-side header slot */
.header-right {
  display: flex;
  align-items: center;
}

.session-label {
  font-size: .72rem;
  font-weight: 700;
  color: var(--slu-subtle);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.back-link {
  font-size: .82rem;
  font-weight: 600;
  color: var(--slu-subtle);
  text-decoration: none;
  letter-spacing: .01em;
  transition: color .15s;
}
.back-link:hover { color: #fff; }

/* ============================================================
   FOOTER
   ============================================================ */

.site-footer {
  margin-top: auto;
  text-align: center;
  padding: 20px 16px;
  font-size: .72rem;
  font-weight: 500;
  color: var(--slu-muted);
  letter-spacing: .05em;
  text-transform: uppercase;
  border-top: 1px solid var(--slu-border);
}

/* ============================================================
   LAYOUT
   ============================================================ */

.main-content {
  flex: 1;
  max-width: 540px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 16px 48px;
  /* Prevent any child from pushing the page wider than the viewport */
  min-width: 0;
  overflow-x: hidden;
}

.session-page form,
.session-page .exercise-card {
  max-width: 100%;
}

/* ============================================================
   SESSION INTRO
   ============================================================ */

.session-intro {
  margin-bottom: 24px;
}

.session-intro h1 {
  font-size: 1.65rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.01em;
}

.athlete-name {
  font-size: 1rem;
  color: var(--slu-muted);
  margin-top: 4px;
  font-weight: 500;
}

/* ============================================================
   HOW-TO CARD
   ============================================================ */

.how-to-card {
  background: var(--slu-dark);
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
}

.how-to-label {
  display: block;
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--slu-accent);
  margin-bottom: 6px;
}

.how-to-card p {
  font-size: .88rem;
  color: #cbd5e1;
  line-height: 1.6;
}

/* ============================================================
   EXERCISE CARDS
   ============================================================ */

.exercise-card {
  background: var(--slu-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--slu-border);
  /* Left accent stripe — visual identity per card */
  border-left: 3px solid var(--slu-accent);
}

.exercise-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px 12px;
  background: #f8fafc;
  border-bottom: 1px solid var(--slu-border);
}

/* Numbered badge */
.exercise-number {
  background: var(--slu-accent);
  color: #fff;
  font-size: .72rem;
  font-weight: 900;
  width: 28px;
  height: 28px;
  border-radius: 6px;       /* square with soft corners — more technical */
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  letter-spacing: .02em;
}

.exercise-name {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
  flex: 1;
  color: var(--slu-text);
  overflow-wrap: break-word;
  min-width: 0; /* allow flex child to shrink below its content width */
}

/* Watch Demo link */
.video-link {
  font-size: .72rem;
  font-weight: 700;
  color: var(--slu-accent);
  text-decoration: none;
  white-space: nowrap;
  /* Taller tap target on mobile */
  padding: 8px 10px;
  border: 1.5px solid var(--slu-accent);
  border-radius: 20px;
  letter-spacing: .02em;
  transition: background .15s, color .15s;
  flex-shrink: 0;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.video-link:hover,
.video-link:active {
  background: var(--slu-accent);
  color: #fff;
}

/* ============================================================
   PRESCRIPTION PILLS
   ============================================================ */

.prescription-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--slu-border);
  background: var(--slu-card);
}

.pill {
  font-size: .75rem;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  letter-spacing: .01em;
}
.pill-sets      { background: #f1f5f9; color: #0f172a; }
.pill-reps      { background: #f1f5f9; color: #0f172a; }
.pill-time      { background: #fef3c7; color: #92400e; }
.pill-tempo     { background: #ede9fe; color: #4c1d95; }
.pill-rest      { background: #e0f2fe; color: #075985; }
.pill-intensity { background: var(--slu-accent-dim); color: var(--slu-accent); }

/* ============================================================
   COACH NOTES
   ============================================================ */

.coach-notes {
  padding: 12px 16px;
  /* Light navy tint — clearly distinct from the white logging area */
  background: #eef2f7;
  border-bottom: 1px solid var(--slu-border);
}

.coach-notes-label {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--slu-navy);
  display: block;
  margin-bottom: 5px;
  opacity: .7;
}

.coach-notes p {
  font-size: .9rem;
  color: var(--slu-text);
  line-height: 1.55;
  overflow-wrap: break-word;
}

/* ============================================================
   FEEDBACK SECTION — SET LOGGING
   ============================================================ */

.feedback-section {
  padding: 16px;
}

.feedback-heading {
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--slu-muted);
  margin-bottom: 12px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}
.field-group:last-child { margin-bottom: 0; }

label {
  font-size: .75rem;
  font-weight: 700;
  color: var(--slu-muted);
  letter-spacing: .01em;
}

/* Shared input styles */
input[type="text"],
input[type="number"],
textarea,
select {
  width: 100%;
  padding: 11px 12px;
  border: 1.5px solid var(--slu-border);
  border-radius: var(--radius-sm);
  /* 16px minimum required to prevent iOS Safari auto-zoom on focus */
  font-size: 1rem;
  font-family: inherit;
  color: var(--slu-text);
  background: var(--slu-card);
  -webkit-appearance: none;
  appearance: none;
  transition: border-color .15s, box-shadow .15s;
  line-height: 1.4;
  /* Remove tap highlight and delay on iOS */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  max-width: 100%;
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--slu-accent);
  box-shadow: 0 0 0 3px rgba(230, 48, 0, .1);
}

textarea { resize: vertical; }

/* Select-specific */
select {
  cursor: pointer;
  text-align: center;
  padding: 11px 8px;
}

/* --- Set grid --------------------------------------------- */
.set-log-area {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

/* Column headers */
.set-col-headers {
  display: grid;
  grid-template-columns: 50px 1fr 1fr 70px;
  gap: 6px;
  padding: 0 2px;
}
.set-col-headers span {
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--slu-muted);
  text-align: center;
}
.set-col-headers span:first-child { text-align: left; }

/* One row per set */
.set-block {
  display: grid;
  grid-template-columns: 50px 1fr 1fr 70px;
  gap: 6px;
  align-items: center;
}

.set-label {
  font-size: .78rem;
  font-weight: 800;
  color: var(--slu-navy);
  white-space: nowrap;
  letter-spacing: .01em;
}

/* Tighter padding for inputs inside set rows */
.set-block input,
.set-block select {
  padding: 10px 6px;
  /* Must be 16px+ to prevent iOS Safari auto-zoom on focus */
  font-size: 1rem;
  text-align: center;
  /* Comfortable tap target height */
  min-height: 44px;
}

/* ============================================================
   SESSION FEEDBACK CARD
   ============================================================ */

.session-feedback-card {
  background: var(--slu-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--slu-border);
  padding: 20px 16px;
  margin-bottom: 24px;
}
.session-feedback-card h2 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -.01em;
}
.session-feedback-hint {
  font-size: .85rem;
  color: var(--slu-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}
.session-feedback-card textarea { width: 100%; }

/* ============================================================
   AUTOSAVE NOTICE
   ============================================================ */

.autosave-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
  min-height: 18px;
}

.autosave-hint {
  font-size: .72rem;
  color: var(--slu-subtle);
  font-style: italic;
}

.autosave-status {
  font-size: .72rem;
  font-weight: 600;
  color: var(--slu-green);
  opacity: 0;
  transition: opacity .4s ease;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============================================================
   BUTTONS
   ============================================================ */

/* Primary — Submit Workout */
.submit-btn {
  display: block;
  width: 100%;
  padding: 18px 16px;
  background: var(--slu-accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-appearance: none;
  transition: background .15s, transform .08s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(230, 48, 0, .3);
  /* Eliminate 300ms tap delay and default blue tap flash on iOS */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.submit-btn:hover {
  background: var(--slu-accent-hover);
  box-shadow: 0 4px 16px rgba(230, 48, 0, .35);
}
.submit-btn:active {
  background: var(--slu-accent-hover);
  transform: scale(.98);
  box-shadow: none;
}

/* ============================================================
   SUCCESS PAGE
   ============================================================ */

.success-page {
  text-align: center;
  padding: 48px 0 32px;
}

.success-icon {
  width: 64px;
  height: 64px;
  background: var(--slu-green-bg);
  color: var(--slu-green);
  font-size: 1.8rem;
  font-weight: 900;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.success-page h1 {
  font-size: 1.8rem;
  font-weight: 800;
  letter-spacing: -.02em;
  margin-bottom: 8px;
}

.success-sub {
  color: var(--slu-muted);
  font-size: .95rem;
  margin-bottom: 6px;
  line-height: 1.5;
}

.success-athlete {
  font-weight: 700;
  color: var(--slu-accent);
  font-size: .9rem;
  margin-top: 10px;
  letter-spacing: .02em;
  text-transform: uppercase;
}

/* --- Session summary card --------------------------------- */
.summary-card {
  background: var(--slu-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--slu-border);
  padding: 20px 16px;
  margin-top: 28px;
  text-align: left;
}

.summary-heading {
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--slu-muted);
  margin-bottom: 16px;
  text-align: center;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

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

.summary-value {
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--slu-text);
  line-height: 1;
  letter-spacing: -.02em;
}

.summary-label {
  font-size: .65rem;
  font-weight: 700;
  color: var(--slu-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 5px;
  text-align: center;
}

.summary-volume {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--slu-accent-dim);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.summary-volume-label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--slu-accent);
}

.summary-volume-value {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--slu-accent);
  letter-spacing: -.01em;
}

/* ============================================================
   RPE AWARENESS CARDS
   ============================================================ */

.rpe-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  border-radius: var(--radius);
  padding: 16px;
  margin-top: 12px;
  text-align: left;
  font-size: .9rem;
  line-height: 1.55;
  border: 1.5px solid transparent;
}

.rpe-card-ok {
  background: var(--slu-green-bg);
  border-color: #bbf7d0;
  color: #14532d;
}

.rpe-card-warn {
  background: var(--slu-amber);
  border-color: var(--slu-amber-border);
  color: var(--slu-amber-text);
}

.rpe-card-icon {
  font-size: 1.05rem;
  font-weight: 800;
  flex-shrink: 0;
  margin-top: 2px;
}

.rpe-item-list {
  margin: 10px 0 0 0;
  padding-left: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.rpe-item {
  font-size: .87rem;
  line-height: 1.45;
}

/* --- RPE awareness (coach detail) ------------------------- */
.rpe-coach-ok {
  font-size: .9rem;
  color: var(--slu-green);
  font-weight: 600;
}

.rpe-coach-warn-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rpe-coach-item {
  background: var(--slu-amber);
  border: 1.5px solid var(--slu-amber-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.rpe-coach-exercise {
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: 4px;
  color: var(--slu-text);
}

.rpe-coach-detail {
  font-size: .85rem;
  color: var(--slu-amber-text);
}

/* ============================================================
   ERROR PAGE
   ============================================================ */

.error-page {
  text-align: center;
  padding: 60px 0 40px;
}

.error-icon {
  width: 64px;
  height: 64px;
  background: var(--slu-red-bg);
  color: var(--slu-red);
  font-size: 1.8rem;
  font-weight: 900;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.error-page h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 10px;
  letter-spacing: -.01em;
}
.error-message { color: var(--slu-text); margin-bottom: 8px; font-size: .95rem; }
.error-hint    { color: var(--slu-muted); font-size: .88rem; }

/* ============================================================
   COACH PAGES
   ============================================================ */

.coach-page { max-width: 700px; }

.coach-page h1 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 20px;
  letter-spacing: -.01em;
}

.empty-state {
  color: var(--slu-muted);
  font-style: italic;
  padding: 48px 0;
  text-align: center;
}

/* --- Submission list -------------------------------------- */
.submission-list { display: flex; flex-direction: column; gap: 10px; }

.submission-card {
  background: var(--slu-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--slu-border);
  padding: 16px;
  text-decoration: none;
  color: inherit;
  display: block;
  border-left: 4px solid transparent;
  transition: box-shadow .15s, transform .1s;
}
.submission-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}
.submission-card.status-needs-review { border-left-color: var(--slu-accent); }
.submission-card.status-reviewed     { border-left-color: var(--slu-green); }

.submission-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.submission-athlete {
  font-weight: 700;
  font-size: 1rem;
}

.submission-session {
  font-size: .85rem;
  color: var(--slu-muted);
}

.submission-block-id {
  font-size: .75rem;
  color: var(--slu-subtle);
  font-family: monospace;
}

.status-badge {
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 3px 9px;
  border-radius: 20px;
  margin-left: auto;
}
.status-needs-review .status-badge,
.status-badge.status-needs-review {
  background: var(--slu-accent-dim);
  color: var(--slu-accent);
}
.status-reviewed .status-badge,
.status-badge.status-reviewed {
  background: var(--slu-green-bg);
  color: var(--slu-green);
}

.status-badge-large { display: inline-block; font-size: .78rem; margin-top: 8px; }

.submission-preview {
  font-size: .87rem;
  color: var(--slu-muted);
  font-style: italic;
  margin-bottom: 8px;
  line-height: 1.45;
}

.submission-footer {
  display: flex;
  justify-content: space-between;
  font-size: .76rem;
  color: var(--slu-subtle);
}

/* --- Coach detail header ---------------------------------- */
.detail-header { margin-bottom: 28px; }
.detail-header h1 { font-size: 1.75rem; font-weight: 800; letter-spacing: -.02em; }
.detail-session   { font-size: 1rem; color: var(--slu-muted); margin-top: 4px; }
.detail-block-id  { font-size: .75rem; color: var(--slu-subtle); margin-top: 2px; font-family: monospace; }
.detail-time      { font-size: .8rem; color: var(--slu-subtle); margin-top: 2px; }

/* --- Coach summary tiles ---------------------------------- */
.coach-summary-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.coach-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--slu-card);
  border: 1px solid var(--slu-border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  padding: 12px 16px;
  min-width: 72px;
}

.coach-stat-wide { min-width: 140px; }

.coach-stat-value {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--slu-text);
  line-height: 1;
  letter-spacing: -.02em;
}

.coach-stat-label {
  font-size: .65rem;
  font-weight: 700;
  color: var(--slu-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-top: 5px;
}

/* --- Sections within coach detail ------------------------- */
.detail-section { margin-bottom: 32px; }

.detail-section h2 {
  font-size: .72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--slu-muted);
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--slu-border);
}

.session-feedback-text {
  font-size: .95rem;
  line-height: 1.6;
  background: var(--slu-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--slu-border);
  padding: 14px 16px;
}

/* --- Per-exercise compare blocks -------------------------- */
.detail-exercise {
  background: var(--slu-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--slu-border);
  margin-bottom: 14px;
  overflow: hidden;
}

.detail-exercise-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  /* Navy-tinted header distinguishes exercise name from data */
  background: #eef2f7;
  border-bottom: 1px solid var(--slu-border);
}
.detail-exercise-header h3 {
  font-size: .95rem;
  font-weight: 700;
  color: var(--slu-text);
}

.detail-compare {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
}

.detail-col { padding: 14px 16px; }
.detail-col:first-child { border-right: 1px solid var(--slu-border); }

.detail-col h4 {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--slu-muted);
  margin-bottom: 10px;
}

.compare-table { width: 100%; border-collapse: collapse; font-size: .84rem; }
.compare-table th {
  text-align: left;
  color: var(--slu-muted);
  font-weight: 600;
  padding: 3px 0;
  width: 50%;
}
.compare-table td { padding: 3px 0; font-weight: 500; }

.compare-notes {
  font-size: .82rem;
  color: var(--slu-muted);
  margin-top: 8px;
  line-height: 1.45;
}

/* --- Sets table (coach actual column) --------------------- */
.sets-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
}
.sets-table thead th {
  text-align: center;
  color: var(--slu-muted);
  font-weight: 800;
  font-size: .65rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 4px 4px 8px;
  border-bottom: 1px solid var(--slu-border);
}
.sets-table thead th:first-child { text-align: left; }
.sets-table tbody td {
  text-align: center;
  padding: 5px 4px;
  border-bottom: 1px solid #f3f4f6;
  font-weight: 500;
}
.sets-table tbody td.set-num {
  text-align: left;
  color: var(--slu-muted);
  font-weight: 700;
  font-size: .78rem;
}
.sets-table tbody tr:last-child td { border-bottom: none; }

/* ============================================================
   COACH REVIEW PANEL
   ============================================================ */

/* Form wrapper when status is needs_review */
.review-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* "Mark as Reviewed" — green, full-width */
.btn-reviewed {
  display: block;
  width: 100%;
  padding: 13px 20px;
  background: var(--slu-green);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .95rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  cursor: pointer;
  -webkit-appearance: none;
  transition: background .15s, transform .08s, box-shadow .15s;
  box-shadow: 0 2px 8px rgba(21, 128, 61, .25);
}
.btn-reviewed:hover {
  background: #166534;
  box-shadow: 0 4px 14px rgba(21, 128, 61, .3);
}
.btn-reviewed:active {
  transform: scale(.98);
  box-shadow: none;
}

/* Confirmed reviewed state */
.review-complete {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: var(--slu-green-bg);
  border: 1.5px solid #bbf7d0;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

.review-complete-icon {
  font-size: 1.1rem;
  font-weight: 900;
  color: var(--slu-green);
  flex-shrink: 0;
  margin-top: 2px;
}

.review-complete-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.review-complete-info strong {
  font-size: .8rem;
  color: var(--slu-green);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.review-complete-time {
  font-size: .8rem;
  color: #166534;
  display: block;
}

.review-complete-notes {
  font-size: .9rem;
  color: #14532d;
  margin-top: 8px;
  line-height: 1.55;
  white-space: pre-wrap;
}

/* ============================================================
   PREVIOUS PERFORMANCE (athlete session page)
   ============================================================ */

.prev-perf {
  background: var(--slu-dark);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
}

.prev-perf-label {
  display: block;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--slu-accent);
  margin-bottom: 4px;
}

.prev-perf-date {
  font-size: .78rem;
  color: var(--slu-subtle);
  margin-bottom: 2px;
}

.prev-perf-set {
  font-size: .9rem;
  font-weight: 600;
  color: #e2e8f0;
  overflow-wrap: break-word;
}

.prev-perf-empty {
  font-size: .82rem;
  color: var(--slu-subtle);
  font-style: italic;
  overflow-wrap: break-word;
}

/* ============================================================
   BEST RECORDED (athlete session page)
   ============================================================ */

.best-recorded {
  background: var(--slu-bg);
  border: 1px solid var(--slu-border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin-bottom: 14px;
}

.best-recorded-label {
  display: block;
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--slu-muted);
  margin-bottom: 4px;
}

.best-recorded-set {
  font-size: .9rem;
  font-weight: 600;
  color: var(--slu-text);
  overflow-wrap: break-word;
}

.best-recorded-band {
  font-size: .8rem;
  color: var(--slu-muted);
  font-weight: 600;
  margin-top: 2px;
}

.best-recorded-context {
  font-size: .75rem;
  color: var(--slu-subtle);
  margin-top: 3px;
}

/* ============================================================
   COACH EXERCISE REPLY — athlete-facing block in session view
   ============================================================ */

.coach-exercise-reply {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 16px;
}

.coach-reply-label {
  display: block;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #1d4ed8;
  margin-bottom: 6px;
}

.coach-reply-text {
  font-size: .9rem;
  color: var(--slu-text);
  margin: 0;
  line-height: 1.5;
  overflow-wrap: break-word;
}

/* ============================================================
   EXERCISE REPLY FORM — coach detail page
   ============================================================ */

.exercise-reply-display {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 8px;
  padding: 10px 14px;
  margin-top: 12px;
}

.exercise-reply-sent-label {
  display: block;
  font-size: .68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: #1d4ed8;
  margin-bottom: 4px;
}

.exercise-reply-sent-text {
  font-size: .88rem;
  color: var(--slu-text);
  margin: 0 0 4px;
  line-height: 1.5;
  overflow-wrap: break-word;
}

.exercise-reply-sent-time {
  font-size: .75rem;
  color: var(--slu-subtle);
}

.exercise-reply-form {
  margin-top: 10px;
}

.btn-exercise-reply {
  margin-top: 8px;
  padding: 7px 16px;
  font-size: .82rem;
  font-weight: 700;
  background: #1d4ed8;
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
}

.btn-exercise-reply:hover {
  background: #1e40af;
}

/* ============================================================
   PERFORMANCE DELTA (coach detail page)
   ============================================================ */

.delta-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.delta-row {
  background: var(--slu-bg);
  border: 1px solid var(--slu-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
}

.delta-exercise-name {
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--slu-muted);
  margin-bottom: 6px;
}

.delta-lines {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.delta-prev,
.delta-curr,
.delta-change {
  font-size: .88rem;
  color: var(--slu-text);
}

.delta-prev { color: var(--slu-muted); }

.delta-change {
  font-weight: 700;
  color: var(--slu-accent);
  margin-top: 2px;
}

.delta-empty {
  font-size: .85rem;
  color: var(--slu-subtle);
  font-style: italic;
}

/* ============================================================
   ATHLETE PORTAL INDEX
   ============================================================ */

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

.portal-intro {
  padding-top: 8px;
  margin-bottom: 20px;
}

.portal-intro h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--slu-text);
  margin-bottom: 4px;
}

/* Block info card */
.portal-block-card {
  background: var(--slu-card);
  border: 1px solid var(--slu-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 28px;
  box-shadow: var(--shadow);
}

.portal-block-label {
  display: block;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--slu-muted);
  margin-bottom: 4px;
}

.portal-block-name {
  font-size: 1rem;
  font-weight: 700;
  color: var(--slu-text);
  margin-bottom: 2px;
}

.portal-block-phase {
  font-size: .84rem;
  color: var(--slu-muted);
  margin: 0;
}

/* Week groups */
.portal-week {
  margin-bottom: 28px;
}

.portal-week-heading {
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--slu-muted);
  margin-bottom: 10px;
}

.portal-sessions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* Session tiles */
.portal-session-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 18px;
  background: var(--slu-card);
  border: 1px solid var(--slu-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--slu-text);
  font-weight: 600;
  font-size: .95rem;
  box-shadow: var(--shadow);
  transition: background .12s, border-color .12s, color .12s;
}

.portal-session-link:hover,
.portal-session-link:active {
  background: var(--slu-accent);
  border-color: var(--slu-accent);
  color: #fff;
}

.portal-day-label { flex-shrink: 0; }

/* Status badges */
.session-status {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .03em;
  padding: 3px 9px;
  border-radius: 20px;
  white-space: nowrap;
  margin-left: 12px;
  flex-shrink: 0;
  border: 1px solid transparent;
  transition: background .12s, color .12s, border-color .12s;
}

.status-reviewed {
  background: var(--slu-green-bg);
  color: var(--slu-green);
}

.status-submitted {
  background: var(--slu-accent-dim);
  color: var(--slu-accent);
}

.status-not-submitted {
  background: transparent;
  color: var(--slu-subtle);
  border-color: var(--slu-border);
}

.status-coach-feedback {
  background: #dbeafe;
  color: #1d4ed8;
}

/* Override badge colours on tile hover so they stay readable */
.portal-session-link:hover .session-status,
.portal-session-link:active .session-status {
  background: rgba(255, 255, 255, .18);
  color: #fff;
  border-color: rgba(255, 255, 255, .3);
}

.portal-empty {
  color: var(--slu-muted);
  font-size: .9rem;
  margin-top: 8px;
}

.portal-pilot-notice {
  margin-top: 40px;
  padding: 12px 16px;
  border-left: 3px solid var(--slu-border);
  font-size: .8rem;
  color: var(--slu-subtle);
  line-height: 1.55;
}

/* ============================================================
   COACH NAV
   ============================================================ */

.coach-nav {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.coach-nav-link {
  font-size: .78rem;
  font-weight: 700;
  color: var(--slu-muted);
  text-decoration: none;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--slu-border);
  letter-spacing: .03em;
  transition: color .15s, background .15s, border-color .15s;
}

.coach-nav-link:hover {
  color: var(--slu-text);
  border-color: var(--slu-muted);
}

.coach-nav-active {
  color: var(--slu-accent);
  border-color: var(--slu-accent);
  background: var(--slu-accent-dim);
}

/* ============================================================
   ATHLETE PORTAL — COMPETITION CARD
   ============================================================ */

.portal-comp-card {
  background: var(--slu-navy);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 28px;
  border-left: 3px solid var(--slu-accent);
}

.portal-comp-label {
  display: block;
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--slu-accent);
  margin-bottom: 6px;
}

.portal-comp-name {
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 4px;
}

.portal-comp-date {
  font-size: .88rem;
  color: #cbd5e1;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-comp-days {
  font-size: .72rem;
  font-weight: 700;
  background: rgba(230, 48, 0, .18);
  color: #ff7a52;
  padding: 2px 8px;
  border-radius: 12px;
}

.portal-comp-days-today {
  background: rgba(230, 48, 0, .3);
  color: #ff6b3d;
}

.portal-comp-location,
.portal-comp-type {
  font-size: .8rem;
  color: #94a3b8;
  margin: 0;
}

/* ============================================================
   COACH COMPETITIONS LIST
   ============================================================ */

.comp-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.comp-row {
  background: var(--slu-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--slu-border);
  border-left: 4px solid var(--slu-accent);
  padding: 14px 16px;
  display: grid;
  grid-template-columns: 110px 1fr auto;
  grid-template-rows: auto auto;
  column-gap: 12px;
  row-gap: 4px;
  align-items: start;
}

.comp-row-past  { border-left-color: var(--slu-border); opacity: .72; }
.comp-row-today { border-left-color: var(--slu-green); }

.comp-athlete {
  font-size: .75rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--slu-muted);
  grid-row: 1;
  grid-column: 1;
  align-self: center;
}

.comp-info {
  grid-row: 1;
  grid-column: 2;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.comp-name {
  font-size: .95rem;
  font-weight: 700;
  color: var(--slu-text);
}

.comp-type-tag {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  background: var(--slu-accent-dim);
  color: var(--slu-accent);
  padding: 2px 8px;
  border-radius: 12px;
}

.comp-days {
  grid-row: 1;
  grid-column: 3;
  text-align: right;
  align-self: center;
  white-space: nowrap;
}

.comp-days-out  { font-size: .8rem; font-weight: 800; color: var(--slu-accent); }
.comp-days-today{ font-size: .8rem; font-weight: 800; color: var(--slu-green); }
.comp-days-past { font-size: .78rem; font-weight: 600; color: var(--slu-muted); }
.comp-days-tbd  { font-size: .78rem; color: var(--slu-subtle); font-style: italic; }

.comp-meta {
  grid-row: 2;
  grid-column: 2 / 4;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.comp-date     { font-size: .82rem; color: var(--slu-muted); }
.comp-location { font-size: .82rem; color: var(--slu-subtle); }

@media (max-width: 500px) {
  .comp-row {
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto auto;
  }
  .comp-athlete { grid-column: 1; grid-row: 1; }
  .comp-days    { grid-column: 2; grid-row: 1; }
  .comp-info    { grid-column: 1 / 3; grid-row: 2; }
  .comp-meta    { grid-column: 1 / 3; grid-row: 3; }
}

/* ============================================================
   COACH EXERCISE REGISTRY
   ============================================================ */

.coach-page-wide { max-width: 980px; }

.registry-filter-bar {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.registry-filter-bar input[type="text"] {
  flex: 1;
  min-width: 180px;
  max-width: 300px;
  padding: 9px 12px;
  font-size: .9rem;
}

.registry-filter-check {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--slu-muted);
  cursor: pointer;
  user-select: none;
}

.registry-filter-check input[type="checkbox"] {
  width: auto;
  cursor: pointer;
}

.registry-count {
  font-size: .78rem;
  color: var(--slu-subtle);
  font-weight: 600;
  margin-bottom: 12px;
}

.registry-table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--slu-border);
  box-shadow: var(--shadow);
}

.registry-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .84rem;
  background: var(--slu-card);
}

.registry-table thead th {
  background: #eef2f7;
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--slu-muted);
  padding: 10px 12px;
  text-align: left;
  border-bottom: 2px solid var(--slu-border);
  white-space: nowrap;
}

.registry-table tbody tr {
  border-bottom: 1px solid #f3f4f6;
  transition: background .1s;
}

.registry-table tbody tr:last-child { border-bottom: none; }
.registry-table tbody tr:hover      { background: #f8fafc; }

.registry-table tbody td {
  padding: 10px 12px;
  vertical-align: top;
  line-height: 1.4;
}

.reg-name     { font-weight: 700; color: var(--slu-text); min-width: 130px; }

.reg-canonical {
  display: block;
  font-size: .73rem;
  font-weight: 500;
  color: var(--slu-subtle);
  margin-top: 1px;
}

.reg-cat,
.reg-family   { color: var(--slu-muted); white-space: nowrap; font-size: .82rem; }

.reg-badge {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.reg-badge-comp { background: var(--slu-accent-dim); color: var(--slu-accent); }
.reg-badge-no   { color: var(--slu-subtle); }

.reg-video-link {
  font-size: .78rem;
  font-weight: 700;
  color: var(--slu-green);
  text-decoration: none;
  background: var(--slu-green-bg);
  padding: 2px 8px;
  border-radius: 12px;
  white-space: nowrap;
}

.reg-video-link:hover   { text-decoration: underline; }
.reg-video-missing      { font-size: .78rem; color: var(--slu-subtle); font-style: italic; }

.reg-aliases { font-size: .76rem; color: var(--slu-subtle); max-width: 200px; }
.reg-notes   { font-size: .76rem; color: var(--slu-muted); max-width: 280px; line-height: 1.45; }

/* ============================================================
   PORTAL UPDATES CARD
   ============================================================ */

.updates-card {
  background: var(--slu-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--slu-border);
  padding: 18px 16px 14px;
  margin-bottom: 20px;
}

.updates-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}

.updates-title {
  font-size: .7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--slu-muted);
}

.updates-version {
  font-size: .68rem;
  font-weight: 700;
  color: var(--slu-card);
  background: var(--slu-navy);
  padding: 2px 8px;
  border-radius: 20px;
  letter-spacing: .03em;
}

.updates-subtitle {
  font-size: .8rem;
  color: var(--slu-muted);
  margin-bottom: 12px;
}

.updates-entry {
  padding: 10px 0 6px;
  border-top: 1px solid var(--slu-border);
}

/* No divider above the first entry — the subtitle acts as visual separator */
.updates-entry:first-of-type {
  border-top: none;
  padding-top: 0;
}

.updates-entry-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 3px;
  flex-wrap: wrap;
}

.updates-entry-title {
  font-size: .88rem;
  font-weight: 700;
  color: var(--slu-text);
}

.updates-entry-date {
  font-size: .72rem;
  color: var(--slu-subtle);
  white-space: nowrap;
}

.updates-entry-summary {
  font-size: .81rem;
  color: var(--slu-muted);
  line-height: 1.45;
  margin-bottom: 6px;
}

.updates-entry-items {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.updates-entry-items li {
  font-size: .8rem;
  color: var(--slu-text);
  line-height: 1.4;
  padding-left: 14px;
  position: relative;
}

.updates-entry-items li::before {
  content: '·';
  position: absolute;
  left: 3px;
  color: var(--slu-accent);
  font-weight: 900;
}

/* ============================================================
   BAND TRACKING
   ============================================================ */

/* Wrapper groups one set row + its band toggle + optional band detail */
.set-wrapper {
  display: flex;
  flex-direction: column;
}

/* "Used Band?" toggle row — always visible, intentionally subtle */
.band-toggle-row {
  padding: 4px 2px 0;
}

.band-toggle-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--slu-subtle);
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

/* Reset checkbox from global input styles — it must look like a checkbox */
input[type="checkbox"].band-checkbox {
  width: 15px;
  height: 15px;
  min-height: unset;
  padding: 0;
  margin: 0;
  border: none;
  border-radius: 3px;
  background: transparent;
  -webkit-appearance: auto;
  appearance: auto;
  accent-color: var(--slu-accent);
  cursor: pointer;
  flex-shrink: 0;
}

/* Band detail panel — hidden by default, revealed when checkbox is checked */
.band-detail {
  display: none;
  flex-direction: column;
  gap: 8px;
  margin-top: 7px;
  padding: 12px;
  background: #f8fafc;
  border: 1px solid var(--slu-border);
  border-radius: var(--radius-sm);
}

.band-detail.is-open {
  display: flex;
}

/* 2-column grid for Mode / Color / Strength / Notes */
.band-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.band-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* Band field labels — match the set column header style */
.band-field > label {
  font-size: .65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--slu-muted);
}

/* Tighter inputs inside band detail */
.band-field select,
.band-field input[type="text"] {
  padding: 8px 10px;
  font-size: .9rem;
  min-height: 40px;
}

/* Notes field spans both columns */
.band-field-notes {
  grid-column: 1 / -1;
}

/* Inline validation error — shown at top of band-detail when Mode is missing */
.band-error {
  font-size: .78rem;
  font-weight: 700;
  color: var(--slu-red);
  margin-bottom: 6px;
}

/* Previous-performance band annotation */
.prev-perf-band {
  font-size: .8rem;
  color: var(--slu-accent);
  font-weight: 600;
  margin-top: 2px;
}

/* Coach detail: band cell inside the sets table */
.set-band-cell {
  font-size: .8rem;
  color: var(--slu-muted);
  white-space: nowrap;
}

.set-band-tag {
  font-weight: 600;
  color: var(--slu-text);
}

.set-band-notes {
  font-size: .75rem;
  color: var(--slu-subtle);
  margin-top: 2px;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 400px) {
  .set-col-headers,
  .set-block { grid-template-columns: 42px 1fr 1fr 60px; }

  .summary-grid { grid-template-columns: repeat(2, 1fr); }

  .detail-compare { grid-template-columns: 1fr; }
  .detail-col:first-child {
    border-right: none;
    border-bottom: 1px solid var(--slu-border);
  }
}
