:root {
  --teal:     #1D9E75;
  --teal-lt:  #E1F5EE;
  --teal-dk:  #085041;
  --border:   #D3D1C7;
  --text:     #2C2C2A;
  --text-m:   #5F5E5A;
  --text-s:   #888780;
  --bg:       #F8F7F4;
  --white:    #FFFFFF;
  --error:    #993C1D;
  --error-lt: #FAECE7;
  --success:  #1D9E75;
  --info:     #185FA5;
}

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

html, body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

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

.bg-pattern {
  position: fixed;
  inset: 0;
  background-image:
    radial-gradient(circle at 20% 50%, rgba(29,158,117,0.06) 0%, transparent 60%),
    radial-gradient(circle at 80% 20%, rgba(24,95,165,0.05) 0%, transparent 50%);
  pointer-events: none;
  z-index: 0;
}

.page {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
  position: relative;
  z-index: 1;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 40px;
}
.brand-mark {
  width: 42px;
  height: 42px;
  background: var(--teal);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}
.brand-text { display: flex; flex-direction: column; }
.brand-name { font-size: 15px; font-weight: 600; color: var(--text); line-height: 1.2; }
.brand-sub  { font-size: 11px; color: var(--text-s); letter-spacing: 0.04em; text-transform: uppercase; }

.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 40px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 2px 16px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.03);
}

.card-title { font-size: 20px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.card-sub   { font-size: 14px; color: var(--text-m); margin-bottom: 28px; }

.form-group { margin-bottom: 18px; }
label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }

input[type="email"],
input[type="password"],
input[type="text"] {
  width: 100%;
  padding: 10px 13px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color 0.15s;
  font-family: inherit;
}
input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(29,158,117,0.12);
}
input::placeholder { color: var(--text-s); }

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}
.remember { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-m); cursor: pointer; }
.remember input[type="checkbox"] { width: 15px; height: 15px; accent-color: var(--teal); cursor: pointer; }
.forgot { font-size: 13px; color: var(--teal); font-weight: 500; }

.btn-primary {
  /* Natural-width by default; use .btn-block for full-width (login form etc). */
  display: inline-block;
  padding: 9px 16px;
  background: var(--teal);
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
  transition: background 0.15s;
}
.btn-primary:hover { background: #189265; text-decoration: none; }
.btn-primary:disabled { background: var(--text-s); cursor: not-allowed; }

.btn-block { width: 100%; padding: 11px; }

.footer { padding: 24px; text-align: center; font-size: 12px; color: var(--text-s); }
.footer a { color: var(--text-s); }

.locations {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.loc-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-s);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
}
.loc-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--teal); }

.flash {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  margin-bottom: 18px;
  transition: opacity 700ms ease, transform 700ms ease;
}
.flash-msg { flex: 1; }
.flash-close {
  background: transparent;
  border: 0;
  color: inherit;
  opacity: 0.55;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 0 4px;
  font-family: inherit;
}
.flash-close:hover { opacity: 1; }
.flash-fade { opacity: 0; transform: translateY(-4px); }
.flash-error   { background: var(--error-lt); color: var(--error); border: 1px solid #f1c5b5; }
.flash-success { background: var(--teal-lt);  color: var(--teal-dk); border: 1px solid #b8e0d0; }
.flash-info    { background: #E7F0FB; color: var(--info); border: 1px solid #c5d8ef; }

.muted { color: var(--text-m); font-size: 13px; }
.text-error { color: var(--error); }

/* Honeypot spam-trap field (Tier 1 mitigation, see docs/security.md
   discussion) — off-screen for real users; tabindex="-1" and aria-hidden on
   the field itself keep it out of tab order / screen readers too. Bots that
   auto-fill every input still see and fill it since it's real markup, not
   display:none (some bots skip those). */
.hp-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ────────── Dashboard layout ────────── */

:root {
  --sidebar-w: 220px;
  --topnav-h:  56px;
}

body.dashboard-body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow: hidden;
  font-size: 14px;
}

.topnav {
  height: var(--topnav-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 20px;
  gap: 16px;
  flex-shrink: 0;
  z-index: 10;
}

.topnav .brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  font-size: 13px;
}

.topnav-spacer { flex: 1; }

.notif-bell {
  position: relative;
}
.notif-bell-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  line-height: 1;
}
.notif-badge {
  position: absolute;
  top: 0;
  right: 2px;
  background: var(--error);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 8px;
  min-width: 14px;
  text-align: center;
}
.notif-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  max-height: 420px;
  overflow-y: auto;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 20;
}
.notif-dropdown-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.notif-mark-all {
  background: none;
  border: none;
  color: var(--info);
  font-size: 12px;
  cursor: pointer;
}
.notif-empty {
  padding: 20px 14px;
  color: var(--text-s);
  font-size: 13px;
  text-align: center;
}
.notif-list { list-style: none; }
.notif-item {
  display: flex;
  align-items: stretch;
  border-bottom: 1px solid var(--border);
}
.notif-item:last-child { border-bottom: none; }
.notif-item-unread { background: var(--teal-lt); }
.notif-item-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--text);
}
.notif-item-title { font-size: 13px; font-weight: 600; }
.notif-item-text { font-size: 12px; color: var(--text-m); }
.notif-item-time { font-size: 11px; color: var(--text-s); }
.notif-item-mark {
  background: none;
  border: none;
  color: var(--teal-dk);
  cursor: pointer;
  padding: 0 12px;
  font-size: 13px;
}

.topnav-user {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-m);
}
.topnav-user .role-pill {
  background: var(--teal-lt);
  color: var(--teal-dk);
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.topnav-user a {
  color: var(--text-m);
  font-size: 13px;
}

.shell {
  display: flex;
  flex: 1;
  min-height: 0;
}

.sidebar {
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  overflow-y: auto;
  padding: 12px 0;
}
.nav-section { padding: 4px 12px; margin-top: 8px; margin-bottom: 2px; }
.nav-section-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-s);
  padding: 0 4px;
}
.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-m);
  cursor: pointer;
  text-decoration: none;
  margin: 1px 8px;
  border-radius: 7px;
}
.nav-item:hover { background: var(--bg); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--teal-lt); color: var(--teal-dk); }
.nav-icon {
  width: 18px;
  text-align: center;
  flex-shrink: 0;
  color: var(--text-s);
}
.nav-item.active .nav-icon { color: var(--teal); }

.sidebar-footer {
  margin-top: auto;
  padding: 12px 8px;
  border-top: 1px solid var(--border);
}

/* Off-canvas toggle (M22.3) — hidden on desktop; shown + wired up only
   inside the ≤768px block below. Kept here so both the button and the
   backdrop it drives are defined next to the sidebar they control. */
.sidebar-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  padding: 4px 8px;
  color: var(--text);
}
.sidebar-backdrop {
  display: none;
}

.main {
  flex: 1;
  overflow-y: auto;
  padding: 24px;
  background: var(--bg);
}
.main h1 {
  font-size: 18px;
  font-weight: 600;
  margin-bottom: 8px;
}

/* ── Dashboard shell, mobile (M22.3) ──────────────────────────────────────── */
/* The sidebar is a fixed 220px column at every width above this — on a
   375px phone that alone would consume ~59% of the viewport, before .main
   even gets a look-in. Below 768px it becomes an off-canvas drawer:
   position:fixed + translateX, toggled by the hamburger button in
   dashboardTopNav (views/layouts/dashboard.templ) flipping a class on
   <body> — plain onclick attributes, no JS file needed for two lines. */
@media (max-width: 768px) {
  .sidebar-toggle { display: block; }
  .sidebar {
    position: fixed;
    top: var(--topnav-h);
    bottom: 0;
    left: 0;
    z-index: 30;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.15);
  }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop {
    display: block;
    position: fixed;
    inset: var(--topnav-h) 0 0 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 29;
  }
  .main { padding: 16px; }
}

.context-panel {
  width: 320px;
  background: var(--white);
  border-left: 1px solid var(--border);
  overflow-y: auto;
  padding: 20px;
  flex-shrink: 0;
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 40px;
  text-align: center;
  color: var(--text-m);
  background: var(--white);
}
.empty-state h2 { font-size: 16px; margin-bottom: 6px; color: var(--text); }
.empty-state p { font-size: 13px; }

/* ────────── Card grid + settings forms ────────── */

.section-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
  max-width: 720px;
}
.section-card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.section-card-sub {
  font-size: 13px;
  color: var(--text-m);
  margin-bottom: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}
.form-grid .full { grid-column: span 2; }
@media (max-width: 480px) {
  /* Two cramped ~150px fields side by side isn't a broken layout (minmax(0,
     1fr) already prevents overflow), but a single touch-friendly column
     reads much better on a phone. */
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: span 1; }
}
.form-grid label { margin-bottom: 4px; }
.form-grid input,
.form-grid textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  font-family: inherit;
  background: var(--white);
}
.form-grid textarea { min-height: 80px; resize: vertical; }
.form-grid input:focus,
.form-grid textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(29,158,117,0.12);
  outline: none;
}

.form-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.btn-secondary {
  display: inline-block;
  padding: 9px 14px;
  background: var(--white);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  text-decoration: none;
}
.btn-secondary:hover { background: var(--bg); text-decoration: none; }
.btn-danger {
  padding: 7px 12px;
  background: var(--white);
  color: var(--error);
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
}
.btn-danger:hover { background: var(--error-lt); border-color: #f1c5b5; }

.location-list { list-style: none; }
.location-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.location-row:last-child { border-bottom: none; }
.location-meta {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}
.location-name { font-size: 14px; font-weight: 500; color: var(--text); }
.location-sub  { font-size: 12px; color: var(--text-s); }
.status-pill {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 10px;
}
.status-pill.active   { background: var(--teal-lt);  color: var(--teal-dk); }
.status-pill.inactive { background: #EEE; color: var(--text-s); }
.status-pill.invited  { background: #FFF3CD; color: #6B4F00; }
.status-pill.archived { background: #EEE; color: var(--text-s); }

/* ────────── Page header (M7) ────────── */
.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.page-header h1 { margin-bottom: 4px; }

/* ────────── Filter bar (M7) ────────── */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.filter-bar input[type=search] {
  flex: 1;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
}
.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-s);
}

/* ────────── Athlete card + grid (M7) ────────── */
.athlete-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.athlete-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: background 0.1s, border-color 0.1s;
}
.athlete-card:hover {
  background: var(--bg);
  border-color: var(--teal);
  text-decoration: none;
}
.athlete-card-body {
  flex: 1;
  min-width: 0;
}
.athlete-card-name { font-weight: 500; font-size: 14px; color: var(--text); }
.athlete-card-meta { font-size: 12px; color: var(--text-s); margin-top: 2px; }
.athlete-card-tags { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.athlete-avatar {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}
.athlete-avatar-initials {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: var(--teal-dk);
  background: var(--teal-lt);
}

/* ────────── Squad tier badges (M7) ────────── */
.squad-badge {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 10px;
}
.squad-badge-gold   { background: #FFE8A3; color: #6B4F00; }
.squad-badge-silver { background: #E5E7EB; color: #374151; }
.squad-badge-bronze { background: #F3C8A9; color: #6B3814; }

/* ────────── Profile page (M7) ────────── */
.profile-header {
  display: flex;
  gap: 24px;
  align-items: center;
  flex-wrap: wrap;
}
.profile-meta {
  font-size: 13px;
  color: var(--text-s);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.profile-meta span.muted { color: var(--text-s); }

/* ────────── Tab bar (M7 stub) ────────── */
.profile-tabs { margin-top: 16px; }
.tab-bar {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.tab {
  background: none;
  border: none;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-s);
  cursor: pointer;
  border-bottom: 2px solid transparent;
}
.tab-active { color: var(--teal-dk); border-bottom-color: var(--teal); font-weight: 500; }
.tab-disabled { opacity: 0.5; cursor: not-allowed; }
.tab-panel { background: var(--card); }

/* ────────── Alerts (M7) ────────── */
.alert {
  padding: 10px 12px;
  border-radius: 6px;
  font-size: 13px;
}
.alert-info { background: #E0F2FE; color: #075985; border: 1px solid #BAE6FD; }

/* ────────── Guardian list (M8) ────────── */
.guardian-list { list-style: none; margin: 0 0 0; padding: 0; }
.guardian-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.guardian-row:last-child { border-bottom: none; }
.guardian-meta { display: flex; flex-direction: column; }
.guardian-name { font-size: 14px; font-weight: 500; color: var(--text); }
.guardian-sub  { font-size: 12px; color: var(--text-s); }

.form-grid select {
  width: 100%;
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: var(--card);
}
.form-grid select:focus {
  outline: none;
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-lt);
}

/* ────────── Guardian dashboard (M8) ────────── */
.athlete-switcher {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.athlete-switcher-chip {
  padding: 6px 14px;
  border-radius: 16px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text-s);
  font-size: 13px;
  text-decoration: none;
}
.athlete-switcher-chip:hover {
  background: var(--bg);
  text-decoration: none;
}
.athlete-switcher-chip-active {
  background: var(--teal-lt);
  border-color: var(--teal);
  color: var(--teal-dk);
  font-weight: 500;
}
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

/* ────────── Squads (M9) ────────── */
.squad-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.squad-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.1s;
}
.squad-card:hover {
  border-color: var(--teal);
  text-decoration: none;
}
.squad-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.squad-card-title { font-size: 15px; font-weight: 600; color: var(--text); }
.squad-card-meta { font-size: 12px; color: var(--text-s); display: flex; gap: 6px; align-items: center; }

.capacity-wrap { display: flex; flex-direction: column; gap: 6px; }
.capacity-meter {
  height: 10px;
  background: var(--bg);
  border-radius: 6px;
  overflow: hidden;
}
.capacity-fill {
  height: 100%;
  background: var(--teal);
  transition: width 0.2s;
}
.capacity-label { font-size: 12px; color: var(--text-s); }

.roster-list, .rule-list, .waitlist-list { list-style: none; margin: 0; padding: 0; }
.roster-row, .rule-row, .waitlist-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.roster-row:last-child, .rule-row:last-child, .waitlist-row:last-child { border-bottom: none; }
.roster-meta, .rule-meta, .waitlist-meta { display: flex; flex-direction: column; flex: 1; }
.roster-name, .rule-day, .waitlist-name { font-size: 14px; font-weight: 500; color: var(--text); }
.roster-sub, .rule-sub, .waitlist-sub { font-size: 12px; color: var(--text-s); }
.rule-time { font-size: 13px; color: var(--text); }
.waitlist-notes { font-size: 12px; color: var(--text); font-style: italic; margin-top: 4px; }
.waitlist-position {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--teal-lt);
  color: var(--teal-dk);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 13px;
}

/* Tab links (anchor variant so non-Alpine tabs work) */
a.tab { text-decoration: none; }
a.tab:hover { color: var(--teal-dk); text-decoration: none; }

/* ────────── Calendar (M10) ────────── */
.cal-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 16px;
  align-items: flex-start;
}
/* .cal-main scrolls the 7-day grid horizontally rather than crushing every
   column illegibly — a fixed min-width on .cal-grid (below) is what makes
   there be something to scroll. Same ≤768px breakpoint as the sidebar. */
.cal-main { min-width: 0; overflow-x: auto; }
@media (max-width: 768px) {
  .cal-layout { grid-template-columns: 1fr; }
}
.cal-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.cal-week-label { flex: 1; text-align: center; font-weight: 500; color: var(--text); }

.cal-grid {
  display: grid;
  grid-template-columns: 60px repeat(7, 1fr);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  min-width: 700px;
}
.cal-time-col, .cal-day-col {
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
}
.cal-day-col:last-child { border-right: none; }
.cal-time-col { background: var(--bg); }

.cal-day-head {
  height: 44px;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4px;
  background: var(--bg);
}
.cal-day-name { font-size: 11px; text-transform: uppercase; color: var(--text-s); letter-spacing: 0.04em; }
.cal-day-num { font-size: 13px; font-weight: 500; }

.cal-slot {
  height: 22px;
  border-bottom: 1px dashed transparent;
  position: relative;
}
.cal-slot-hour { border-bottom-color: var(--border); }
.cal-time-label {
  position: absolute;
  top: -6px;
  right: 6px;
  font-size: 10px;
  color: var(--text-s);
}

.cal-day-body { position: relative; flex: 1; }

.cal-event {
  position: absolute;
  left: 4px;
  right: 4px;
  padding: 4px 6px;
  border-radius: 4px;
  font-size: 11px;
  line-height: 1.2;
  color: white;
  text-decoration: none;
  overflow: hidden;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  cursor: pointer;
}
.cal-event:hover { text-decoration: none; opacity: 0.92; }
.cal-event-time { font-weight: 600; font-size: 10px; opacity: 0.85; }
.cal-event-title { font-weight: 600; }
.cal-event-sub { opacity: 0.85; font-size: 10px; }
.cal-event-badge {
  display: inline-block;
  background: rgba(255,255,255,0.25);
  border-radius: 2px;
  padding: 0 4px;
  margin-left: 4px;
  font-size: 9px;
  font-weight: 700;
}

.cal-event-squad { background: #3B82F6; }
.cal-event-private { background: #8B5CF6; }
.cal-event-clinic { background: #14B8A6; }
.cal-event-nutrition { background: #F59E0B; }
.cal-event-scan_due { background: #D97706; }
.cal-event-billing_due { background: #EF4444; }
.cal-event-google_cal { background: #6B7280; }
.cal-event-bookable { background: #10B981; border: 1px dashed rgba(255,255,255,0.6); }

/* Booking panel slot grid */
.booking-form { display: flex; flex-direction: column; gap: 8px; }
.booking-slots { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.booking-slot {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; padding: 6px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--card); color: var(--text);
}
.booking-slot-open { cursor: pointer; border-color: #10B981; color: #0f7a55; font-weight: 600; }
.booking-slot-open:hover { background: #10B981; color: #fff; }
.booking-slot-taken { opacity: 0.6; }

.cal-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  min-height: 200px;
}
.cal-panel-inner { padding: 14px; }
.cal-panel-head { display: flex; gap: 8px; margin-bottom: 8px; }
.cal-panel-section { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--border); }
.cal-panel-section-title { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-s); margin-bottom: 6px; }
.cal-panel-actions { display: flex; gap: 8px; margin-top: 16px; }

.session-meta { display: grid; grid-template-columns: 70px 1fr; gap: 6px 12px; margin-top: 8px; font-size: 13px; }
.session-meta dt { color: var(--text-s); }
.session-meta dd { color: var(--text); margin: 0; }

.session-pill {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--teal-lt);
  color: var(--teal-dk);
}
.session-pill-squad { background: #DBEAFE; color: #1E40AF; }
.session-pill-private { background: #EDE9FE; color: #5B21B6; }
.session-pill-clinic { background: #CCFBF1; color: #115E59; }

/* ────────── Library (M11) ────────── */

/* Page header actions cluster (multiple buttons on the right). */
.page-header-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

/* Filter card variant: vertical stacking, no flex collapse. */
.library-filter { margin-bottom: 16px; }
.library-filter .form-grid { display: grid; gap: 12px; }

/* Tag chip group used for both filter selection and form input. */
.tag-chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: #FFF;
  color: var(--text);
  font-size: 12px;
  cursor: pointer;
  user-select: none;
}
.tag-chip:hover { border-color: var(--teal-dk); }
.tag-chip input { display: none; }
.tag-chip-on {
  background: var(--teal-lt);
  border-color: var(--teal-dk);
  color: var(--teal-dk);
  font-weight: 600;
}

/* Tag pills are read-only versions used on cards / detail pages. */
.tag-pill {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  background: #EEF2FF;
  color: #3730A3;
  margin: 2px;
}
.tag-pill.tag-stroke { background: #DBEAFE; color: #1E40AF; }
.tag-pill.tag-level  { background: #DCFCE7; color: #166534; }
.tag-pill.tag-focus  { background: #FEF3C7; color: #92400E; }

.status-pill.library-type {
  background: #E0E7FF;
  color: #3730A3;
}

/* Library card grid mirrors squad-grid. */
.library-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.library-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 14px;
  text-decoration: none;
  transition: border-color 120ms ease;
}
.library-card:hover { border-color: var(--teal-dk); }
.library-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.library-card-title { font-size: 15px; font-weight: 600; color: var(--text); }
.library-card-pills { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.library-card-desc { font-size: 13px; color: var(--text-s); margin: 0; }
.library-card-tags { display: flex; flex-wrap: wrap; gap: 4px; }

/* Plan composer + version chain (M23 Phase 2). */
.module-chain { list-style: decimal inside; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.module-chain-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; background: var(--bg-subtle, #f6f7f9); border-radius: 8px; }
.module-chain-name { font-weight: 600; }
.library-picker-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 12px; border-bottom: 1px solid var(--border, #e5e7eb); }
.library-picker-row > div { display: flex; align-items: center; gap: 8px; }

/* Detail page row layout. */
.library-detail-row {
  display: grid;
  grid-template-columns: 70px 1fr;
  align-items: center;
  gap: 12px;
  padding: 6px 0;
}
.library-detail-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-s);
}
.library-detail-value { display: flex; flex-wrap: wrap; gap: 4px; }
.library-detail-prose { font-size: 14px; line-height: 1.55; color: var(--text); margin: 0; white-space: pre-wrap; }

/* Picker modal (consumed by M12 plan builder). */
.library-picker { display: flex; flex-direction: column; gap: 12px; max-height: 70vh; }
.library-picker-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.library-picker-filter input[type=search],
.library-picker-filter select {
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
}
.library-picker-results {
  flex: 1;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.library-picker-list { list-style: none; margin: 0; padding: 0; }
.library-picker-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
}
.library-picker-row:last-child { border-bottom: 0; }
.library-picker-row-main { flex: 1; min-width: 0; }
.library-picker-row-title { font-size: 14px; font-weight: 600; color: var(--text); }
.library-picker-row-meta { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.library-picker-add { padding: 4px 12px; font-size: 12px; }
.library-picker-empty { padding: 24px; text-align: center; }

/* Calendar polish (post-M10) */
.cal-day-today { background: rgba(31, 168, 111, 0.04); }
.cal-day-today .cal-day-head {
  background: var(--teal-lt);
  color: var(--teal-dk);
}
.cal-day-today .cal-day-name,
.cal-day-today .cal-day-num { color: var(--teal-dk); }
.cal-now {
  position: absolute;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--teal-dk);
  z-index: 2;
  pointer-events: none;
}
.cal-now::before {
  content: '';
  position: absolute;
  left: -3px;
  top: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--teal-dk);
}
.cal-empty {
  padding: 12px;
  text-align: center;
  font-size: 13px;
}

.cal-empty-state {
  text-align: center;
  padding: 32px 16px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: var(--white);
  margin-top: 16px;
}
.cal-empty-state h3 { font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text); }
.cal-empty-state p { margin-bottom: 12px; }
.cal-panel-hint { padding: 12px; }

/* ────────── Utilities ────────── */
.mt-4  { margin-top: 4px; }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; }
.mt-20 { margin-top: 20px; }
.mt-24 { margin-top: 24px; }
.mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; }
.mb-20 { margin-bottom: 20px; }
.mb-24 { margin-bottom: 24px; }
.my-12 { margin: 12px 0; }
.text-center { text-align: center; }

/* Forms rendered inline (no extra margins, sits next to siblings). Used for
   single-button POST forms that act like delete/unlink controls. */
.inline-form { display: inline; margin: 0; }

/* profile-meta defaults to a column; .profile-meta-row arranges horizontally. */
.profile-meta-row { flex-direction: row; gap: 12px; }

/* form-grid variant where the last input takes the row and a button sits to
   its right. Used by add-athlete / add-rule / add-guardian forms. Pair with
   .mt-12 or .mt-16 for top spacing. */
.form-grid-inline-action {
  grid-template-columns: 1fr auto;
  align-items: end;
}
.form-grid-inline-action > .full-1 { grid-column: 1; }

/* ────────── Plan library (M12) ────────── */

.plan-card-sub { font-size: 12px; margin: 4px 0; }

/* Versions list */
.version-list { list-style: none; margin: 0; padding: 0; }
.version-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.version-row:last-child { border-bottom: 0; }
.version-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.version-num { font-size: 14px; font-weight: 600; color: var(--text); }
.version-label { color: var(--text-m); }
.version-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* Bulk mark-as-paid bar (unpaid invoices) */
.bulk-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.bulk-selectall {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-m);
}
.data-table .col-check { width: 32px; text-align: center; }

/* CMS version-history block summaries */
.version-blocks {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.version-blocks li {
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.block-type-pill {
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--text-m);
  background: var(--surface-2, #f1f3f5);
  border-radius: 4px;
  padding: 2px 8px;
  white-space: nowrap;
}
.block-preview {
  color: var(--text);
  font-size: 14px;
  overflow-wrap: anywhere;
}

/* Locked banner */
.locked-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: #FFF7E6;
  border: 1px solid #F2C66A;
  border-radius: 8px;
  margin-bottom: 16px;
}
.locked-banner-icon { font-size: 22px; }
.locked-banner-body { flex: 1; }
.locked-banner-body strong { display: block; color: #6B4F00; margin-bottom: 2px; }

/* Block list (swim builder + read-only) */
.block-list { list-style: none; margin: 0; padding: 0; }
.block-row {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  background: var(--white);
}
.block-row-editable { cursor: grab; }
.block-row-editable.dragging { opacity: 0.5; }
.block-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.block-title { font-weight: 600; margin: 4px 0; }
.block-stats {
  display: flex;
  gap: 12px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--text-s);
  flex-wrap: wrap;
}
.drag-handle {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  cursor: grab;
  font-size: 16px;
  color: var(--text-s);
}
.block-add-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 16px;
}

/* Picker modal (used by both library-item picker and plan picker) */
.library-picker-host {
  position: relative;
  z-index: 50;
}
.library-picker-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 50;
}
.library-picker-modal {
  position: fixed;
  top: 10vh;
  left: 50%;
  transform: translateX(-50%);
  width: min(640px, 90vw);
  max-height: 80vh;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.15);
  z-index: 51;
  display: flex;
  flex-direction: column;
}
.library-picker-modal .library-picker { padding: 16px; max-height: 70vh; }
.library-picker-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
}

[x-cloak] { display: none !important; }

/* ── Attendance form (M13) ─────────────────────────────────────────────── */
.attendance-shell { max-width: 720px; margin: 0 auto; padding: 0 0 96px; }

.attendance-sticky-head {
  position: sticky; top: 0; z-index: 5;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  margin: -16px -16px 12px;
}
.attendance-head-row {
  display: flex; align-items: center; gap: 12px;
  flex-wrap: wrap;
}
.attendance-back { font-weight: 600; color: var(--text-m); }
.attendance-head-title { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.attendance-head-title strong { font-size: 16px; }
.attendance-head-title span { font-size: 13px; color: var(--text-m); }
.attendance-mark-all { font-size: 14px; padding: 6px 10px; }

.attendance-counts {
  display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap;
  font-size: 13px;
}
.att-count {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px; background: var(--bg);
}
.att-count-present  { color: var(--success); }
.att-count-late     { color: var(--info); }
.att-count-absent   { color: var(--error); }
.att-count-notified { color: var(--text-m); }
.att-count-todo     { color: var(--text-s); }

.attendance-progress {
  height: 4px; background: var(--bg); border-radius: 2px; margin-top: 8px;
  overflow: hidden;
}
.attendance-progress-bar { height: 100%; background: var(--success); transition: width .15s; }

.attendance-form { padding: 0 16px; }
.attendance-list { display: flex; flex-direction: column; gap: 10px; }

.att-row {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  display: flex; flex-direction: column; gap: 10px;
}
.att-row-present  { border-left-color: var(--success); }
.att-row-late     { border-left-color: var(--info); }
.att-row-absent   { border-left-color: var(--error); }
.att-row-notified { border-left-color: var(--text-m); background: var(--bg); }
.att-row-unmarked { border-left-color: var(--border); }

.att-row-head { display: flex; align-items: center; gap: 10px; }
.att-avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--teal-lt); color: var(--teal-dk);
  display: flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 14px;
  overflow: hidden; flex-shrink: 0;
}
.att-avatar img { width: 100%; height: 100%; object-fit: cover; }
.att-name { flex: 1; display: flex; flex-direction: column; }
.att-name strong { font-size: 15px; }
.att-tag {
  display: inline-block; font-size: 11px; padding: 1px 6px;
  border-radius: 999px; margin-top: 2px; background: var(--bg);
  color: var(--text-m); align-self: flex-start;
}
.att-tag-notified { background: var(--error-lt); color: var(--error); }

.att-buttons { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.att-btn {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 4px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  font-size: 12px; font-weight: 600;
  color: var(--text-m);
  cursor: pointer;
  min-height: 56px;
  transition: background .1s, border-color .1s, color .1s;
}
.att-glyph { font-size: 22px; line-height: 1; }
.att-btn:hover { border-color: var(--text-m); }
.att-btn-present.active { background: var(--success); border-color: var(--success); color: var(--white); }
.att-btn-late.active    { background: var(--info);    border-color: var(--info);    color: var(--white); }
.att-btn-absent.active  { background: var(--error);   border-color: var(--error);   color: var(--white); }

.att-notes input {
  width: 100%; padding: 8px 10px; border: 1px solid var(--border);
  border-radius: 6px; font-size: 14px;
}

.attendance-sticky-foot {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--white); border-top: 1px solid var(--border);
  padding: 12px 16px;
  display: flex; justify-content: center;
  z-index: 6;
}
.attendance-save { width: 100%; max-width: 640px; padding: 14px; font-size: 16px; }

.attendance-empty { text-align: center; padding: 32px 16px; color: var(--text-m); }

/* ── Attendance history (athlete profile tab, session panel) ───────────── */
.att-history-list { display: flex; flex-direction: column; gap: 8px; }
.att-history-row {
  display: grid; grid-template-columns: 90px 1fr auto;
  align-items: center; gap: 12px;
  padding: 10px 12px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
}
.att-history-date { font-weight: 600; font-size: 14px; }
.att-history-meta { color: var(--text-m); font-size: 13px; }
.att-pill {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 999px;
  font-size: 12px; font-weight: 600;
  background: var(--bg); color: var(--text-m);
}
.att-pill-present  { background: #DCF1E8; color: #0F5F46; }
.att-pill-late     { background: #DDE9F6; color: #1B4982; }
.att-pill-absent   { background: var(--error-lt); color: var(--error); }
.att-pill-notified { background: var(--bg); color: var(--text-m); }

.att-rate-card {
  background: var(--white); border: 1px solid var(--border);
  border-radius: 10px; padding: 14px 16px;
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: 12px;
}
.att-rate-value { font-size: 28px; font-weight: 700; color: var(--teal-dk); }
.att-rate-label { color: var(--text-m); font-size: 13px; }

/* Session-panel attendance ring + chips */
.cal-att-ring {
  display: flex; align-items: center; gap: 12px;
  padding: 8px 0;
}
.cal-att-ring-svg { flex-shrink: 0; }
.cal-att-ring-text { display: flex; flex-direction: column; }
.cal-att-ring-rate { font-weight: 700; font-size: 18px; color: var(--teal-dk); }
.cal-att-ring-detail { font-size: 12px; color: var(--text-m); }
.cal-att-chips {
  display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px;
}
.cal-att-chip {
  display: inline-flex; align-items: center; gap: 3px;
  padding: 2px 8px; border-radius: 999px;
  font-size: 11px; background: var(--bg); color: var(--text-m);
}
.cal-att-chip-present  { background: #DCF1E8; color: #0F5F46; }
.cal-att-chip-late     { background: #DDE9F6; color: #1B4982; }
.cal-att-chip-absent   { background: var(--error-lt); color: var(--error); }
.cal-att-chip-notified { background: var(--bg); color: var(--text-m); }
.cal-att-take-link { font-size: 13px; }

@media (max-width: 480px) {
  .attendance-shell { padding-bottom: 92px; }
  .att-buttons { gap: 4px; }
  .att-btn { padding: 12px 2px; font-size: 11px; min-height: 52px; }
  .att-glyph { font-size: 20px; }
}

/* ── Body scans (M14) ───────────────────────────────────────────────────── */

.body-scan-delta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-top: 8px;
}
.body-scan-delta-card {
  background: var(--white); border: 1px solid var(--border);
  border-left: 4px solid var(--border);
  border-radius: 10px; padding: 12px 14px;
}
.body-scan-delta-better { border-left-color: #1D9E75; }
.body-scan-delta-worse  { border-left-color: #C0892F; }
.body-scan-delta-flat   { border-left-color: var(--border); }
.body-scan-delta-label  { color: var(--text-m); font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; }
.body-scan-delta-value  { font-size: 22px; font-weight: 700; color: var(--text); margin-top: 4px; }
.body-scan-delta-unit   { font-weight: 400; font-size: 13px; color: var(--text-m); margin-left: 2px; }
.body-scan-delta-change { font-size: 13px; margin-top: 6px; color: var(--text-m); }
.body-scan-delta-better .body-scan-delta-change { color: #0F5F46; }
.body-scan-delta-worse  .body-scan-delta-change { color: #8A6321; }
.body-scan-delta-empty  { padding: 8px 0; }
.body-scan-delta-foot   { font-size: 12px; margin-top: 12px; }

.body-scan-chart-svg {
  width: 100%; height: auto; max-height: 280px; display: block;
  background: var(--white); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px; box-sizing: border-box;
}
.body-scan-chart-empty { padding: 16px 0; }
.body-scan-chart-legend {
  display: flex; flex-wrap: wrap; gap: 16px; margin-top: 10px; font-size: 13px; color: var(--text-m);
}
.body-scan-legend-item { display: inline-flex; align-items: center; gap: 6px; }
.body-scan-swatch { display: inline-block; width: 14px; height: 4px; border-radius: 2px; }
.body-scan-swatch-weight { background: #1D9E75; }
.body-scan-swatch-fat    { background: #C0892F; }
.body-scan-swatch-muscle { background: #3A6EA5; }

.body-scan-list { display: flex; flex-direction: column; gap: 10px; }
.body-scan-row {
  background: var(--white); border: 1px solid var(--border); border-radius: 10px;
  padding: 12px 14px; display: flex; flex-direction: column; gap: 6px;
}
.body-scan-row-date    { font-weight: 600; color: var(--text); }
.body-scan-row-metrics {
  display: flex; flex-wrap: wrap; gap: 12px; color: var(--text-m); font-size: 14px;
}
.body-scan-row-metrics strong { color: var(--text); }
.body-scan-row-notes   { font-size: 13px; }
.body-scan-row-file    { font-size: 13px; }

/* Documents (M14) */
.document-list { display: flex; flex-direction: column; gap: 8px; }
.document-row {
  background: var(--white); border: 1px solid var(--border); border-radius: 10px;
  padding: 10px 14px; display: grid; grid-template-columns: 1fr auto; gap: 6px;
  align-items: center;
}
.document-row-main { grid-column: 1; display: flex; align-items: center; gap: 10px; }
.document-row-meta { grid-column: 1; font-size: 12px; }
.document-row-name { font-weight: 600; color: var(--text); }
.document-row form { grid-column: 2; grid-row: 1 / span 2; }

.doc-type-badge {
  display: inline-flex; padding: 2px 8px; border-radius: 999px;
  font-size: 11px; font-weight: 600; background: var(--bg); color: var(--text-m);
  text-transform: uppercase; letter-spacing: 0.04em;
}
.doc-type-consent       { background: #DDE9F6; color: #1B4982; }
.doc-type-medical       { background: var(--error-lt); color: var(--error); }
.doc-type-assessment    { background: #DCF1E8; color: #0F5F46; }
.doc-type-body_scan_raw { background: #F1E9D7; color: #8A6321; }

.tab-link {
  text-decoration: none;
  display: inline-block;
}

/* ── Skills library ──────────────────────────────────────────────────────── */
.skill-media-badge { font-size: 12px; color: var(--text-m); }

.skill-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.skill-photo-card { display: flex; flex-direction: column; gap: 6px; }
.skill-photo-img {
  width: 100%; aspect-ratio: 4/3; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--border);
}
.skill-photo-caption { font-size: 12px; color: var(--text-m); }

.skill-video-list { display: flex; flex-direction: column; gap: 24px; margin-top: 12px; }
.skill-video-card { display: flex; flex-direction: column; gap: 8px; }
.skill-video-title { font-weight: 600; }
.skill-video-embed { position: relative; width: 100%; padding-bottom: 56.25%; /* 16:9 */ }
.skill-video-embed iframe,
.skill-video-embed video {
  position: absolute; inset: 0; width: 100%; height: 100%;
  border-radius: 8px; border: 1px solid var(--border);
}
.skill-video-link a { color: var(--accent); text-decoration: underline; }

.skill-instructions p { margin: 0 0 8px; line-height: 1.6; }
.skill-instructions p:last-child { margin-bottom: 0; }

/* Skill badge — shown on plan builder blocks and version detail */
.skill-badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px; border-radius: 999px;
  background: #DCF1E8; color: #0F5F46;
  font-size: 12px; font-weight: 600; text-decoration: none;
  white-space: nowrap;
}
.skill-badge:hover { background: #c7e9d8; }

/* Skill link row in the plan builder block */
.skill-link-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-height: 32px; }

/* Block skill link on version detail */
.block-skill-link { margin-top: 4px; }

/* btn-xs: extra-small destructive/action button */
.btn-xs {
  padding: 2px 8px; font-size: 12px;
  border: 1px solid var(--border); border-radius: 4px;
  background: var(--bg); color: var(--text); cursor: pointer;
}
.btn-xs:hover { background: var(--error-lt); color: var(--error); border-color: var(--error); }

/* tag-chip-label: checkbox-inside-chip for edit forms */
.tag-chip-label {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  border: 1px solid var(--border); font-size: 13px; cursor: pointer;
  user-select: none;
}
.tag-chip-label input[type="checkbox"] { width: 14px; height: 14px; }
.tag-chip-label:hover { background: var(--bg); }

/* req: required field asterisk */
.req { color: var(--error); }

/* alert-error: inline validation error block */
.alert-error {
  padding: 10px 14px; border-radius: 6px;
  background: var(--error-lt); color: var(--error);
  border: 1px solid var(--error); font-size: 14px;
}

/* Skill picker search box inside modal */
.library-picker-search { padding: 12px; border-bottom: 1px solid var(--border); }
.library-picker-search input { width: 100%; padding: 8px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }

/* ══════════ Billing (M16) ══════════ */

/* Summary stat cards */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 3px solid var(--teal);
  border-radius: 8px;
  padding: 14px 16px;
}
.stat-card-label { font-size: 12px; color: var(--text-s); text-transform: uppercase; letter-spacing: 0.04em; }
.stat-card-value { font-size: 24px; font-weight: 600; color: var(--text); margin-top: 4px; }
.stat-card-warn { border-left-color: var(--error); }
.stat-card-warn .stat-card-value { color: var(--error); }

.audit-list { list-style: none; padding: 0; margin: 0; font-size: 13px; }
.audit-row { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.audit-row:last-child { border-bottom: none; }
.audit-time { color: var(--text-s); width: 110px; flex-shrink: 0; }
.audit-action { font-weight: 600; width: 140px; flex-shrink: 0; }
.audit-resource { color: var(--text-s); }

/* Section card head with an action on the right */
.section-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.section-card-head .section-card-title { margin-bottom: 0; }

/* Invoice list table (clickable rows) */
.inv-table { display: flex; flex-direction: column; }
.inv-row {
  display: grid;
  grid-template-columns: 1.2fr 1.6fr 1fr 1fr 0.9fr 0.9fr;
  gap: 12px;
  align-items: center;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  text-decoration: none;
  font-size: 14px;
}
.inv-row:last-child { border-bottom: none; }
a.inv-row:hover { background: var(--teal-lt); }
.inv-row-head {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-s);
  font-weight: 600;
}
.inv-row-head:hover { background: transparent; }
.inv-number { font-weight: 600; }
.inv-col-right { text-align: right; }
@media (max-width: 768px) {
  /* 6 proportional columns still means ~60px each on a phone — column
     headers stop being meaningful once every row is a stacked card, so
     the head row is hidden rather than also squeezed. */
  .inv-row { grid-template-columns: 1fr; gap: 2px; text-align: left; }
  .inv-row-head { display: none; }
  .inv-col-right { text-align: left; }
}

/* Status badges */
.inv-badge {
  display: inline-block;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.inv-badge-draft     { background: #ECEBE6; color: var(--text-m); }
.inv-badge-sent      { background: #E3EEFA; color: var(--info); }
.inv-badge-paid      { background: var(--teal-lt); color: var(--teal-dk); }
.inv-badge-overdue   { background: var(--error-lt); color: var(--error); }
.inv-badge-cancelled { background: #ECEBE6; color: var(--text-s); text-decoration: line-through; }

/* Detail layout */
.billing-detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
  align-items: start;
}
.billing-detail-side { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 900px) {
  .billing-detail-grid { grid-template-columns: 1fr; }
}

/* Line items (read-only on detail) */
.inv-items { display: flex; flex-direction: column; }
.inv-items-row {
  display: grid;
  grid-template-columns: 3fr 0.6fr 1fr 1fr;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.inv-items-head {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-s);
  font-weight: 600;
}

/* Totals block */
.inv-totals { margin-top: 12px; margin-left: auto; max-width: 280px; }
.inv-total-line {
  display: flex;
  justify-content: space-between;
  padding: 4px 0;
  font-size: 14px;
  color: var(--text-m);
}
.inv-total-grand {
  border-top: 2px solid var(--border);
  margin-top: 6px;
  padding-top: 8px;
  font-size: 18px;
  font-weight: 600;
  color: var(--teal-dk);
}
.inv-notes { margin-top: 16px; }

/* Payments */
.payment-row { padding: 8px 0; border-bottom: 1px solid var(--border); }
.payment-row:last-child { border-bottom: none; }
.payment-row-main { display: flex; justify-content: space-between; align-items: baseline; }
.payment-amount { font-weight: 600; }
.payment-row-meta { font-size: 13px; margin-top: 2px; }

/* Invoice form — editable line item rows */
.inv-form-items { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.inv-form-row {
  display: grid;
  grid-template-columns: 3fr 1.1fr 0.7fr 1fr 36px;
  gap: 8px;
  align-items: center;
}
.inv-form-row input { width: 100%; padding: 7px 9px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; }
@media (max-width: 480px) {
  /* No sub-classes on the 5 anonymous cells (description/amount/qty/total/
     remove) to collapse into a neater 2-column layout without templ
     changes — stacking every field full-width is the safe, correct option. */
  .inv-form-row { grid-template-columns: 1fr; gap: 4px; padding-bottom: 10px; border-bottom: 1px dashed var(--border); }
  .inv-form-head { display: none; }
}
.inv-form-head {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-s);
  font-weight: 600;
}
.btn-danger-link {
  background: none;
  border: none;
  color: var(--error);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 4px;
}
.btn-danger-link:hover { color: #c0492a; }
.checkbox-field { display: flex; align-items: center; }
.checkbox-field label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-field input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--teal); }

/* ── Marketing / Public website ─────────────────────────────────────────────
   Body class: marketing-body
   Layout: full-width nav, sections with constrained inner, sticky footer
   ─────────────────────────────────────────────────────────────────────────── */

.marketing-body { display: flex; flex-direction: column; min-height: 100vh; }
.marketing-body .bg-pattern { display: none; }

/* ── Nav ──────────────────────────────────────────────────────────────────── */
.mkt-nav {
  background: var(--teal-dk);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.18);
}
.mkt-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 60px;
}
.mkt-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: #fff;
  white-space: nowrap;
}
.mkt-brand:hover { text-decoration: none; }
.mkt-brand-mark {
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.mkt-brand-name {
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}
.mkt-nav-links {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 4px;
}
.mkt-nav-links a {
  color: rgba(255,255,255,0.82);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.mkt-nav-links a:hover { color: #fff; background: rgba(255,255,255,0.1); text-decoration: none; }
.mkt-nav-cta {
  background: var(--teal) !important;
  color: #fff !important;
  border-radius: 6px !important;
  padding: 7px 16px !important;
  font-weight: 600 !important;
}
.mkt-nav-cta:hover { background: #17b882 !important; }

/* ── Main / Sections ──────────────────────────────────────────────────────── */
.mkt-main { flex: 1; }

.mkt-section { padding: 64px 0; }
.mkt-section.mkt-bg-alt { background: #fff; }
.mkt-section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}
.mkt-section h2 {
  font-size: 28px;
  font-weight: 700;
  color: var(--teal-dk);
  margin-bottom: 24px;
  letter-spacing: -0.02em;
}

/* ── Hero ─────────────────────────────────────────────────────────────────── */
.mkt-hero {
  background: linear-gradient(135deg, var(--teal-dk) 0%, #0d6b56 60%, #1a8e6e 100%);
  color: #fff;
  padding: 80px 24px;
  text-align: center;
}
.mkt-hero-content {
  max-width: 720px;
  margin: 0 auto;
}
.mkt-hero h1 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 16px;
}
.mkt-hero-sub {
  font-size: 18px;
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
  margin-bottom: 32px;
}
.mkt-page-hero {
  background: linear-gradient(135deg, var(--teal-dk) 0%, #0d6b56 100%);
  padding: 48px 0;
  color: #fff;
}
.mkt-page-hero .mkt-section-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; }
.mkt-page-hero h1 {
  font-size: clamp(26px, 4vw, 40px);
  font-weight: 800;
  color: #fff;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}
.mkt-lead {
  font-size: 17px;
  color: rgba(255,255,255,0.85);
  line-height: 1.6;
  max-width: 680px;
}

/* ── Error pages (M22.1) ──────────────────────────────────────────────────── */
.error-hero { min-height: 60vh; display: flex; align-items: center; }
.error-code {
  font-size: 72px;
  font-weight: 800;
  color: rgba(255,255,255,0.35);
  line-height: 1;
  margin-bottom: 8px;
}
.error-actions { display: flex; gap: 12px; margin-top: 24px; }
.error-actions button { cursor: pointer; font-family: inherit; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn-mkt-primary {
  display: inline-block;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  padding: 13px 28px;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s, transform 0.1s;
  border: none;
  cursor: pointer;
}
.btn-mkt-primary:hover { background: #17b882; color: #fff; text-decoration: none; transform: translateY(-1px); }
.btn-mkt-secondary {
  display: inline-block;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-weight: 600;
  font-size: 15px;
  padding: 12px 24px;
  border-radius: 8px;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.3);
  margin-left: 12px;
  transition: background 0.15s;
}
.btn-mkt-secondary:hover { background: rgba(255,255,255,0.25); color: #fff; text-decoration: none; }

/* ── Cards ────────────────────────────────────────────────────────────────── */
.mkt-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  margin-top: 16px;
}
.mkt-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 28px;
  transition: box-shadow 0.2s;
}
.mkt-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.08); }
.mkt-card h3 {
  font-size: 18px;
  font-weight: 700;
  color: var(--teal-dk);
  margin-bottom: 10px;
  letter-spacing: -0.01em;
}
.mkt-card p { font-size: 15px; line-height: 1.6; color: var(--text-m); margin-bottom: 14px; }
.mkt-card a { font-size: 14px; font-weight: 600; color: var(--teal); }
.mkt-card-icon { font-size: 28px; margin-bottom: 14px; }

/* ── Two-col layout ───────────────────────────────────────────────────────── */
.mkt-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.mkt-col h2 { font-size: 26px; font-weight: 700; color: var(--teal-dk); margin-bottom: 16px; letter-spacing: -0.02em; }
.mkt-col p { font-size: 15px; line-height: 1.7; color: var(--text-m); margin-bottom: 14px; }
.mkt-list { padding-left: 20px; margin: 12px 0 16px; }
.mkt-list li { font-size: 15px; line-height: 1.7; color: var(--text-m); margin-bottom: 6px; }
.mkt-col-aside { position: relative; }
.mkt-service-tag {
  font-size: 18px;
  font-weight: 700;
  color: var(--teal-dk);
  padding: 16px 20px;
  background: var(--teal-lt);
  border-radius: 10px;
  margin-bottom: 16px;
  display: inline-block;
}
.mkt-service-detail {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--text-m);
}

/* ── Testimonials ─────────────────────────────────────────────────────────── */
.mkt-testimonials { padding: 64px 0; background: var(--bg); }
.mkt-testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 8px;
}
.mkt-testimonial-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
}
.mkt-testimonial-stars { margin-bottom: 12px; }
.star { font-size: 18px; color: var(--border); }
.star.filled { color: #f0a500; }
.mkt-testimonial-text {
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  font-style: italic;
  margin-bottom: 16px;
}
.mkt-testimonial-author { font-size: 14px; }
.mkt-testimonial-author strong { display: block; color: var(--teal-dk); font-weight: 600; }
.mkt-testimonial-author span { color: var(--text-s); }
.mkt-cta-row { margin-top: 32px; text-align: center; }

/* ── CTA band ─────────────────────────────────────────────────────────────── */
.mkt-cta-band {
  background: var(--teal-dk);
  color: #fff;
  padding: 64px 0;
  text-align: center;
}
.mkt-cta-band h2 { font-size: 28px; font-weight: 700; color: #fff; margin-bottom: 12px; }
.mkt-cta-band p { font-size: 16px; color: rgba(255,255,255,0.82); margin-bottom: 28px; }

/* ── Locations ────────────────────────────────────────────────────────────── */
.mkt-location-card-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: start;
}
.mkt-location-card-detail--reverse > *:first-child { order: 2; }
.mkt-location-card-detail--reverse > *:last-child { order: 1; }
.mkt-location-info h2 { font-size: 24px; font-weight: 700; color: var(--teal-dk); margin-bottom: 10px; }
.mkt-location-info address { font-style: normal; font-size: 15px; color: var(--text-m); margin-bottom: 14px; line-height: 1.6; }
.mkt-location-info p { font-size: 15px; line-height: 1.7; color: var(--text-m); margin-bottom: 16px; }
.mkt-detail-list { font-size: 14px; }
.mkt-detail-list dt { font-weight: 600; color: var(--text); margin-top: 8px; }
.mkt-detail-list dd { color: var(--text-m); margin-left: 0; }
.mkt-location-map-placeholder {
  background: var(--teal-lt);
  border-radius: 12px;
  min-height: 220px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--teal-dk);
  font-weight: 600;
  font-size: 15px;
  text-align: center;
  border: 1px solid rgba(29,158,117,0.2);
}

/* ── Coach profile ────────────────────────────────────────────────────────── */
.mkt-profile-card {
  background: var(--teal-lt);
  border-radius: 12px;
  padding: 28px;
  text-align: center;
}
.mkt-profile-initials {
  width: 72px;
  height: 72px;
  background: var(--teal);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 14px;
}
.mkt-profile-name { font-size: 17px; font-weight: 700; color: var(--teal-dk); margin-bottom: 6px; }
.mkt-profile-credentials { font-size: 13px; color: var(--text-m); line-height: 1.6; }

/* ── Blog ─────────────────────────────────────────────────────────────────── */
.mkt-blog-list { display: flex; flex-direction: column; gap: 24px; }
.mkt-blog-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.mkt-blog-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mkt-blog-card-body { padding: 24px 24px 24px 0; }
.mkt-blog-tags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.mkt-tag {
  background: var(--teal-lt);
  color: var(--teal-dk);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.mkt-blog-card-title a {
  font-size: 20px;
  font-weight: 700;
  color: var(--teal-dk);
  text-decoration: none;
  display: block;
  margin-bottom: 8px;
}
.mkt-blog-card-title a:hover { color: var(--teal); }
.mkt-blog-card-excerpt { font-size: 14px; color: var(--text-m); line-height: 1.6; margin-bottom: 14px; }
.mkt-blog-read-more { font-size: 14px; font-weight: 600; color: var(--teal); }

/* ── Article / Blog post ──────────────────────────────────────────────────── */
.mkt-article {}
.mkt-article-header { background: linear-gradient(135deg, var(--teal-dk) 0%, #0d6b56 100%); padding: 48px 0; }
.mkt-article-header .mkt-section-inner { max-width: 800px; }
.mkt-article-header h1 { font-size: clamp(22px,4vw,36px); font-weight: 800; color: #fff; margin: 12px 0 10px; letter-spacing: -0.02em; line-height: 1.2; }
.mkt-article-date { font-size: 14px; color: rgba(255,255,255,0.7); }
.mkt-article-hero-img { max-height: 440px; overflow: hidden; }
.mkt-article-hero-img img { width: 100%; object-fit: cover; }
.mkt-article-body { max-width: 800px; padding-top: 40px; padding-bottom: 40px; }
.mkt-article-body h2 { font-size: 22px; font-weight: 700; color: var(--teal-dk); margin: 32px 0 12px; }
.mkt-article-body h3 { font-size: 18px; font-weight: 700; color: var(--teal-dk); margin: 24px 0 10px; }
.mkt-article-body p { font-size: 16px; line-height: 1.8; color: var(--text); margin-bottom: 16px; }
.mkt-article-quote {
  border-left: 4px solid var(--teal);
  padding: 16px 20px;
  background: var(--teal-lt);
  border-radius: 0 8px 8px 0;
  margin: 20px 0;
  font-style: italic;
  color: var(--teal-dk);
}
.mkt-article-figure { margin: 20px 0; }
.mkt-article-figure img { width: 100%; border-radius: 8px; }
.mkt-article-figure figcaption { font-size: 13px; color: var(--text-s); margin-top: 6px; text-align: center; }
.mkt-article-footer { padding: 24px 0 48px; max-width: 800px; }

/* ── Contact form ─────────────────────────────────────────────────────────── */
.mkt-form-section { max-width: 720px; }
.mkt-contact-form h2 { font-size: 20px; font-weight: 700; color: var(--teal-dk); margin-bottom: 20px; }
.req { color: var(--error); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.mkt-footer { background: var(--teal-dk); color: rgba(255,255,255,0.8); padding: 40px 0 0; }
.mkt-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px 32px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
}
.mkt-footer-brand strong { display: block; color: #fff; font-size: 16px; margin-bottom: 8px; }
.mkt-footer-brand p { font-size: 14px; margin-bottom: 4px; line-height: 1.6; }
.mkt-footer-brand a { color: rgba(255,255,255,0.7); font-size: 14px; }
.mkt-footer-brand a:hover { color: #fff; }
.mkt-footer-nav { display: flex; flex-direction: column; gap: 8px; padding-top: 4px; }
.mkt-footer-nav a { color: rgba(255,255,255,0.7); font-size: 14px; text-decoration: none; }
.mkt-footer-nav a:hover { color: #fff; text-decoration: none; }
.mkt-footer-copy {
  border-top: 1px solid rgba(255,255,255,0.12);
  text-align: center;
  font-size: 13px;
  color: rgba(255,255,255,0.45);
  padding: 16px 24px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .mkt-nav-links { display: none; }
  .mkt-two-col { grid-template-columns: 1fr; gap: 24px; }
  .mkt-location-card-detail { grid-template-columns: 1fr; }
  .mkt-location-card-detail--reverse > *:first-child { order: unset; }
  .mkt-location-card-detail--reverse > *:last-child { order: unset; }
  .mkt-blog-card { grid-template-columns: 1fr; }
  .mkt-blog-card-img { height: 180px; }
  .mkt-blog-card-body { padding: 16px; }
  .mkt-footer-inner { grid-template-columns: 1fr; }
}

/* ── CMS editor additions ─────────────────────────────────────────────────── */
.breadcrumb-link { display: inline-block; font-size: 13px; color: var(--text-s); margin-bottom: 4px; }
.breadcrumb-link:hover { color: var(--teal); }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.page-header h1 { font-size: 22px; font-weight: 700; }
.page-header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-s); font-weight: 600; padding: 8px 12px; border-bottom: 2px solid var(--border); }
.data-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.table-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.btn-sm { font-size: 13px; padding: 5px 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 6px; color: var(--text); text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn-sm:hover { border-color: var(--teal); color: var(--teal); text-decoration: none; }
.btn-success { background: var(--success); color: #fff; border: none; padding: 10px 20px; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-success:hover { background: #17b882; }
.btn-danger-sm { background: none; border: 1px solid var(--error); color: var(--error); border-radius: 4px; padding: 2px 8px; font-size: 13px; cursor: pointer; }
.btn-danger-sm:hover { background: var(--error-lt); }
.mt-8 { margin-top: 8px; }
.mt-16 { margin-top: 16px; }

/* Block editor */
.block-editor { border: 1px solid var(--border); border-radius: 8px; padding: 12px; background: var(--bg); }
.block-row { display: grid; grid-template-columns: 130px auto 1fr 90px; gap: 8px; align-items: start; margin-bottom: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border); }
.block-row:last-child { border-bottom: none; margin-bottom: 0; }
.block-type-select { padding: 7px 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; }
.block-content { width: 100%; padding: 8px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; resize: vertical; font-family: inherit; }
.block-image-fields { display: flex; flex-direction: column; gap: 6px; }
.block-image-fields input { padding: 7px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 14px; width: 100%; }
.block-actions { display: flex; flex-direction: column; gap: 4px; }
.block-actions button { font-size: 14px; padding: 4px 8px; border: 1px solid var(--border); background: #fff; border-radius: 4px; cursor: pointer; }
.block-actions button:hover { background: var(--bg); }
.block-add-row { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }

/* Testimonial manager */
.testimonial-row { margin-bottom: 12px; }
.testimonial-row:last-child { margin-bottom: 0; }
.testimonial-row-meta { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.testimonial-row-text { font-size: 14px; color: var(--text-m); margin-bottom: 8px; font-style: italic; }
.star-rating { font-size: 15px; color: #f0a500; letter-spacing: 1px; }
.badge { background: var(--teal-lt); color: var(--teal-dk); font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.testimonial-edit-form summary { font-size: 13px; color: var(--teal); cursor: pointer; font-weight: 600; }
.checkbox-row { display: flex; gap: 20px; align-items: center; }
.checkbox-row label { display: flex; align-items: center; gap: 6px; font-size: 14px; cursor: pointer; }

/* ── CMS prose section (content blocks on public pages) ─────────────────── */
.mkt-prose { max-width: 720px; }
.mkt-prose h2 { font-size: 26px; font-weight: 700; color: var(--teal-dk); margin: 32px 0 12px; }
.mkt-prose h3 { font-size: 20px; font-weight: 600; color: var(--teal-dk); margin: 24px 0 8px; }
.mkt-prose h4 { font-size: 17px; font-weight: 600; margin: 20px 0 6px; }
.mkt-prose p { font-size: 16px; line-height: 1.7; color: var(--text-m); margin-bottom: 16px; }
.mkt-prose blockquote { border-left: 4px solid var(--teal); padding: 12px 20px; margin: 24px 0; background: var(--teal-lt); border-radius: 0 6px 6px 0; font-style: italic; color: var(--teal-dk); }
.mkt-prose figure { margin: 24px 0; }
.mkt-prose figure img { width: 100%; border-radius: 8px; }
.mkt-prose figcaption { font-size: 13px; color: var(--text-lt); text-align: center; margin-top: 6px; }

/* ── Shared free-form tag input (components/tag_input.templ) ───────────────── */
.tag-input {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 7px 9px; background: #fff; cursor: text; min-height: 42px;
}
.tag-input:focus-within { border-color: var(--teal); }
.tag-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--teal-lt); color: var(--teal-dk);
  border-radius: 6px; padding: 3px 8px; font-size: 13px; font-weight: 500;
}
.tag-chip-x {
  border: none; background: none; color: var(--teal-dk); cursor: pointer;
  font-size: 15px; line-height: 1; padding: 0; opacity: .65;
}
.tag-chip-x:hover { opacity: 1; }
.tag-entry-wrap { position: relative; flex: 1; min-width: 120px; }
.tag-entry {
  width: 100%; border: none; outline: none; font-size: 14px;
  background: transparent; padding: 4px 2px;
}
.tag-suggestions {
  position: absolute; top: 100%; left: 0; z-index: 20; margin-top: 4px;
  min-width: 180px; max-height: 220px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.08); padding: 4px;
}
.tag-suggestion {
  display: block; width: 100%; text-align: left; border: none; background: none;
  padding: 7px 10px; font-size: 13px; color: var(--text-m); cursor: pointer;
  border-radius: 6px;
}
.tag-suggestion:hover { background: var(--teal-lt); color: var(--teal-dk); }

/* ── Drill library: tag rows + item list / composer (M24) ─────────────────── */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.drill-item-list { margin: 0; padding-left: 20px; }
.drill-item { padding: 4px 0; font-size: 14px; color: var(--text-d, #2A2A28); }
.drill-edit-row { display: flex; align-items: center; gap: 8px; }
.drill-item-input {
  flex: 1; border: 1px solid var(--border); border-radius: 8px;
  padding: 8px 10px; font-size: 14px; outline: none;
}
.drill-item-input:focus { border-color: var(--teal); }

/* ── Skill media + drill-skill chain (M24 Phase 2) ────────────────────────── */
.skill-video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.skill-video iframe, .skill-video video { width: 100%; aspect-ratio: 16/9; border: 0; border-radius: 8px; background: #000; }
.skill-video-title { font-size: 13px; color: var(--text-m); margin-top: 6px; }
.skill-video-edit { display: flex; flex-direction: column; gap: 6px; }
.skill-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 12px; }
.skill-photo img { width: 100%; border-radius: 8px; display: block; }
.skill-photo figcaption { font-size: 12px; color: var(--text-lt); text-align: center; margin-top: 4px; }
.media-add-form { border: 1px dashed var(--border); border-radius: 8px; padding: 12px; margin-bottom: 14px; }
.skill-badge { display: inline-flex; align-items: center; gap: 4px; background: var(--teal-lt); color: var(--teal-dk); border-radius: 6px; padding: 3px 8px; font-size: 13px; font-weight: 500; }
.drill-skill-chain { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 14px; }

/* ── Trial pipeline kanban (M19) ──────────────────────────────────────────── */
.trial-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(200px, 1fr));
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.trial-column {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  min-height: 200px;
}
.trial-column-over { border-color: var(--teal); background: var(--teal-lt); }
.trial-column-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
  font-weight: 600;
  color: var(--text-m);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.trial-column-count {
  background: var(--bg);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
}
.trial-column-body { padding: 8px; display: flex; flex-direction: column; gap: 8px; }
.trial-column-empty { padding: 8px 4px; font-size: 12px; }
.trial-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  text-decoration: none;
  color: var(--text);
  cursor: grab;
}
.trial-card:hover { border-color: var(--teal); }
.trial-card-name { font-size: 13px; font-weight: 600; }
.trial-card-meta { font-size: 12px; color: var(--text-m); margin-top: 2px; }
.trial-card-date { font-size: 11px; color: var(--text-s); margin-top: 6px; }

.trial-activity { list-style: none; display: flex; flex-direction: column; gap: 10px; }
.trial-activity-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.trial-activity-note { font-size: 13px; }
.trial-activity-time { font-size: 11px; color: var(--text-s); margin-left: auto; }

/* Live-search input at the top of the composer picker modals (M25). */
.library-picker-modal .library-picker-filter { padding: 10px 12px 0; }
.library-picker-modal .library-picker-filter input[type=search] { flex: 1; }

/* Inline quick-create block at the bottom of picker modals (M25). */
.library-picker-quick { border-top: 1px solid var(--border); padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 8px; }
.library-picker-quick-title { font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-s); }
.library-picker-quick-fields { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.library-picker-quick-fields input[type=text],
.library-picker-quick-fields select { height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; }
.library-picker-quick-fields input[type=text] { flex: 1; min-width: 140px; }

/* Session plan picker: module-chain preview per plan row (M25). */
.plan-picker-row { align-items: flex-start; }
.library-picker-row > div.plan-picker-main { display: block; flex: 1; min-width: 0; }
.plan-picker-chain { margin-top: 8px; }

/* "Update to vN" chip on composer rows whose pinned child version is stale (M25). */
.version-chip {
  border: 1px solid var(--teal-dk, #14785a);
  background: var(--teal-lt, #e3f4ee);
  color: var(--teal-dk, #14785a);
  border-radius: 999px;
  font-size: 12px;
  padding: 2px 10px;
  cursor: pointer;
}
.version-chip:hover { background: var(--teal-dk, #14785a); color: #fff; }
