:root {
  /* MFS brand — pulled from the Pick Your Market hero */
  --mfs-blue:        #2563eb;   /* primary action — buttons, links, accent */
  --mfs-blue-dark:   #1d4ed8;   /* hover, pressed */
  --mfs-blue-deep:   #1e3a8a;   /* deep brand / accents on dark */
  --mfs-blue-tint:   #eff6ff;   /* very pale brand wash */

  --bg:      #f1f5f9;   /* cool slate page background */
  --card:    #ffffff;
  --text:    #0f172a;   /* near-black headings */
  --body:    #475569;   /* body / secondary text */
  --muted:   #64748b;   /* tertiary / timestamps */
  --border:  #e2e8f0;
  --border-strong: #cbd5e1;

  --success: #15803d;
  --warn:    #b45309;
  --error:   #b91c1c;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
}

.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  margin-bottom: 16px;
}

h1, h2, h3 { margin-top: 0; }
h1 { font-size: 24px; }
h2 { font-size: 18px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }

label { display: block; font-weight: 600; margin-bottom: 6px; }
input[type=text], input[type=email], input[type=password], textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  background: white;
}
input:focus, textarea:focus { outline: 2px solid var(--mfs-blue); }

button, .btn {
  display: inline-block;
  background: var(--mfs-blue);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}
button:hover, .btn:hover { background: var(--mfs-blue-dark); }
button:disabled { background: var(--muted); cursor: not-allowed; }

.btn-secondary { background: white; color: var(--text); border: 1px solid var(--border); }
.btn-secondary:hover { background: #f1f5f9; }

.error { color: var(--error); font-size: 14px; margin-top: 8px; }
.muted { color: var(--muted); font-size: 13px; }

.progress-bar {
  width: 100%;
  height: 10px;
  background: #e2e8f0;
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill { height: 100%; background: var(--mfs-blue); }

.checklist-item {
  display: flex;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  gap: 12px;
}
.checklist-item:last-child { border-bottom: none; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
}
.badge-done { background: #dcfce7; color: var(--success); }
.badge-pending { background: #fef3c7; color: var(--warn); }
.badge-self { background: #dbeafe; color: var(--mfs-blue); }
.badge-caleb { background: #e0e7ff; color: #4338ca; }

table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; letter-spacing: 0.04em; }

.login-shell {
  max-width: 380px;
  margin: 80px auto;
}

/* Make admin dashboard wider than the default 1100px so cards can grid out nicely */
body.admin-dashboard .container,
.container.wide { max-width: 1400px; }

/* ---------- Admin dashboard ---------- */

body.admin-dashboard {
  background: var(--bg);
  color: var(--text);
}
body.admin-dashboard,
body.admin-dashboard input {
  font-family: 'IBM Plex Sans', system-ui, -apple-system, sans-serif;
  font-size: 14.5px;
  line-height: 1.5;
}
body.admin-dashboard .num,
body.admin-dashboard .mono {
  font-family: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  font-feature-settings: 'tnum', 'zero', 'ss01';
}

/* Page header — MFS brand mark + serif H1 */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin: 8px 0 18px;
  gap: 16px;
  flex-wrap: wrap;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}
.page-pretitle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.mfs-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  background: var(--mfs-blue);
  color: white;
  font-family: 'IBM Plex Sans', sans-serif;
  font-weight: 700;
  font-size: 10px;
  letter-spacing: 0.02em;
  border-radius: 6px;
  flex-shrink: 0;
}
.page-pretitle .crumbs {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13px;
  color: var(--body);
}
.page-pretitle .crumbs strong {
  color: var(--text);
  font-weight: 600;
}
.page-pretitle .crumbs .sep {
  margin: 0 6px;
  color: var(--muted);
}
.page-header h1 {
  font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  font-size: 44px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1;
  margin: 0;
  color: var(--text);
}
.page-header h1 .accent { color: var(--mfs-blue); }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }
body.admin-dashboard button,
body.admin-dashboard .btn,
body.admin-dashboard .btn-secondary {
  border-radius: 6px;
  padding: 9px 16px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: 0;
  border: 1px solid var(--mfs-blue);
  background: var(--mfs-blue);
  color: white;
  cursor: pointer;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}
body.admin-dashboard button:hover { background: var(--mfs-blue-dark); border-color: var(--mfs-blue-dark); }
body.admin-dashboard .btn-secondary {
  background: white;
  color: var(--text);
  border-color: var(--border-strong);
}
body.admin-dashboard .btn-secondary:hover {
  background: var(--mfs-blue-tint);
  border-color: var(--mfs-blue);
  color: var(--mfs-blue-dark);
}

/* Compact meta line */
.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  align-items: baseline;
  padding: 0;
  background: transparent;
  border: none;
  border-radius: 0;
  font-size: 13.5px;
  margin: 18px 0 28px;
  color: var(--body);
}
.meta-line strong {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  margin-right: 5px;
  color: var(--text);
  font-feature-settings: 'tnum';
}
.meta-line .sep {
  color: var(--border-strong);
  font-family: 'Source Serif 4', serif;
}

/* Section heading — italic serif + hairline rule */
.container > h2.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 18px;
  font-weight: 600;
  font-style: italic;
  color: var(--text);
  text-transform: none;
  letter-spacing: -0.005em;
  margin: 28px 0 14px;
  padding: 0;
  border: none;
}
.section-heading .rule {
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Card grid */
.closer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(360px, 1fr));
  gap: 12px;
  background: transparent;
  border: none;
  border-radius: 0;
  overflow: visible;
}
.empty-state {
  padding: 32px;
  text-align: center;
  background: white;
  color: var(--muted);
  border: 1px dashed var(--border-strong);
  border-radius: 8px;
  grid-column: 1 / -1;
  font-style: italic;
  font-family: 'Source Serif 4', Georgia, serif;
}

/* Each closer card */
.closer-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  text-decoration: none;
  color: inherit;
  transition: border-color 120ms ease, transform 120ms ease, box-shadow 120ms ease;
  cursor: pointer;
  position: relative;
}
.closer-card:hover {
  border-color: var(--mfs-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px -4px rgba(37, 99, 235, 0.18);
}
.closer-card.archived {
  background: #f8fafc;
  border-color: var(--border);
}
.closer-card.archived:hover {
  border-color: var(--border-strong);
  box-shadow: none;
  transform: none;
}
.closer-card.archived .closer-name { color: var(--muted); }

/* Card header — name (serif) + status label (italic right) */
.card-header {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.card-name { flex: 1; min-width: 0; }
.closer-name {
  font-family: 'Source Serif 4', Georgia, serif;
  font-weight: 600;
  font-size: 22px;
  letter-spacing: -0.015em;
  line-height: 1.1;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.closer-email {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 4px;
  font-feature-settings: 'tnum';
}
.status-label {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
  white-space: nowrap;
  margin-top: 4px;
}
.status-label.status-cleared { color: var(--success); }
.status-label.status-green   { color: var(--success); }
.status-label.status-yellow  { color: var(--warn); }
.status-label.status-red     { color: var(--error); }

/* Overall progress row */
.overall-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
}
.overall-progress {
  flex: 1;
  height: 6px;
  background: var(--bg);
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid var(--border);
}
.overall-progress-fill {
  height: 100%;
  background: var(--mfs-blue);
  transition: width 200ms ease;
}
.closer-card.status-cleared .overall-progress-fill { background: var(--success); }
.overall-count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--body);
  min-width: 56px;
  text-align: right;
  font-feature-settings: 'tnum';
}
.overall-count strong { color: var(--text); font-weight: 500; }

/* Section grid */
.sections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 28px;
}
.section-row {
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.section-row .label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  color: var(--body);
}
.section-row .label .name {
  font-family: 'Source Serif 4', Georgia, serif;
  font-style: italic;
  font-size: 13px;
  font-weight: 400;
}
.section-row .count {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 11px;
  color: var(--body);
  font-feature-settings: 'tnum';
}
.section-row.full .label .name { color: var(--success); }
.section-row.full .count { color: var(--success); font-weight: 500; }
.section-row.empty .count { color: var(--muted); }

.dots {
  display: flex;
  gap: 3px;
  align-items: center;
}
.dot {
  width: 10px; height: 10px;
  background: white;
  border: 1px solid var(--border-strong);
  border-radius: 2px;
  transition: background 120ms ease, border-color 120ms ease;
}
.dot.filled {
  background: var(--mfs-blue);
  border-color: var(--mfs-blue);
}
.section-row.full .dot.filled {
  background: var(--success);
  border-color: var(--success);
}

/* Card footer */
.card-footer {
  font-family: 'IBM Plex Mono', monospace;
  font-size: 10.5px;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-transform: lowercase;
  font-feature-settings: 'tnum';
}

/* Modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 50;
  align-items: center;
  justify-content: center;
}
.modal-card {
  max-width: 480px;
  width: 90%;
  margin: 0;
  border-radius: 10px;
  border: 1px solid var(--border);
}

body.admin-dashboard input[type=text],
body.admin-dashboard input[type=email] {
  border-radius: 6px;
  border-color: var(--border-strong);
  font-family: 'IBM Plex Sans', sans-serif;
}
body.admin-dashboard input:focus { outline: 2px solid var(--mfs-blue); outline-offset: -1px; }
body.admin-dashboard .error {
  font-style: italic;
  color: var(--error);
}

@media (max-width: 600px) {
  .closer-grid { grid-template-columns: 1fr; }
  .sections { grid-template-columns: 1fr; }
  .page-header h1 { font-size: 34px; }
}

/* ─────────────────────────────────────────────────────────────────────────
   Closer Detail page (admin-closer.html)
   Inherits typography + button styles from body.admin-dashboard.
   ───────────────────────────────────────────────────────────────────────── */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 13px;
  color: var(--muted);
  text-decoration: none;
  margin: 12px 0 4px;
  letter-spacing: 0;
  font-weight: 500;
}
.back-link:hover { color: var(--mfs-blue); }

.closer-header {
  margin-top: 4px;
}
.closer-header h1 {
  font-size: 38px;
  margin-top: 4px;
}
.closer-sub {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 13.5px;
  color: var(--body);
  flex-wrap: wrap;
}
.closer-sub-email {
  font-family: 'IBM Plex Mono', monospace;
  color: var(--text);
}
.closer-sub .sep {
  color: var(--border-strong);
  font-family: 'Source Serif 4', serif;
}

/* Progress strip — top-of-page summary band */
.closer-progress-strip {
  margin: 4px 0 28px;
  padding: 14px 18px;
  border-radius: 6px;
  background: white;
  border: 1px solid var(--border);
  border-left: 4px solid var(--mfs-blue);
}
.closer-progress-strip.status-cleared { border-left-color: var(--success); background: #f0fdf4; }
.closer-progress-strip.status-green   { border-left-color: var(--success); }
.closer-progress-strip.status-yellow  { border-left-color: var(--warn); }
.closer-progress-strip.status-red     { border-left-color: var(--error); }

.closer-progress-meta {
  display: flex;
  align-items: baseline;
  gap: 14px;
  margin-bottom: 10px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
}
.closer-progress-status {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  background: #e0e7ff;
  color: #4338ca;
}
.closer-progress-status.status-cleared { background: #dcfce7; color: var(--success); }
.closer-progress-status.status-green   { background: #dcfce7; color: var(--success); }
.closer-progress-status.status-yellow  { background: #fef3c7; color: var(--warn); }
.closer-progress-status.status-red     { background: #fee2e2; color: var(--error); }
.closer-progress-count {
  font-size: 13.5px;
  color: var(--body);
}
.closer-progress-count strong {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  color: var(--text);
}
.closer-progress-bar {
  width: 100%;
  height: 6px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
}
.closer-progress-bar-fill {
  height: 100%;
  background: var(--mfs-blue);
  transition: width 300ms ease;
}
.closer-progress-strip.status-cleared .closer-progress-bar-fill,
.closer-progress-strip.status-green   .closer-progress-bar-fill { background: var(--success); }
.closer-progress-strip.status-yellow  .closer-progress-bar-fill { background: var(--warn); }
.closer-progress-strip.status-red     .closer-progress-bar-fill { background: var(--error); }

.closer-section-hint {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 13px;
  color: var(--muted);
  margin: -8px 0 12px;
}

/* Checklist card — replaces .card for closer-detail */
.checklist-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 4px 18px;
  margin-bottom: 28px;
}

.row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 4px;
  border-bottom: 1px solid var(--border);
  min-height: 56px;
}
.row:last-child { border-bottom: none; }
.row-done { opacity: 0.65; }

/* Vertically center single-line rows but align top when a row has extra meta */
.row > .row-check { margin-top: 9px; }
.row > .row-body  { padding-top: 6px; padding-bottom: 6px; }
.row > .row-actions { margin-top: 4px; }

/* Checkbox — clean SVG-free disc using border + ::after for the check */
.row-check {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border-strong);
  border-radius: 5px;
  background: white;
  position: relative;
  transition: background 120ms ease, border-color 120ms ease;
}
.row-check.is-done {
  background: var(--success);
  border-color: var(--success);
}
.row-check.is-done::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 5px;
  height: 10px;
  border-right: 2px solid white;
  border-bottom: 2px solid white;
  transform: rotate(45deg);
}

.row-body { flex: 1; min-width: 0; }
.row-title {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--text);
  line-height: 1.4;
}
.row-done .row-title { text-decoration: line-through; text-decoration-color: var(--border-strong); }
.row-meta {
  margin-top: 3px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 12.5px;
  color: var(--muted);
}
.row-foot {
  margin-top: 6px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 12.5px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--border);
  white-space: normal;
}
.row-foot a { color: var(--mfs-blue); text-decoration: none; font-weight: 500; }
.row-foot a:hover { text-decoration: underline; }

.row-actions {
  flex-shrink: 0;
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
}
.row-actions .btn,
.row-actions button,
.row-actions a.btn-secondary,
.row-actions a.btn {
  font-size: 13px;
  padding: 8px 14px;
  white-space: nowrap;
  text-align: center;
}

/* Admin-only: reserve a fixed action column so every row's right edge lines
   up regardless of one vs two buttons. Scoped to body.admin-closer so the
   closer-facing dashboard (which uses .row too) isn't forced into the
   wide reservation. */
body.admin-closer .row-actions { min-width: 340px; }
body.admin-closer .row-actions .btn { min-width: 195px; }
body.admin-closer .row-actions .btn-secondary { min-width: 130px; }

/* Subtle differentiation between admin-action rows and self-paced rows */
.row-self .row-title { font-weight: 400; }

@media (max-width: 700px) {
  .row {
    flex-wrap: wrap;
    align-items: flex-start;
  }
  .row-actions {
    margin-left: 32px; /* align under title */
    margin-top: 2px;
    flex-wrap: wrap;
    min-width: 0;
    justify-content: flex-start;
  }
  .row-actions .btn,
  .row-actions .btn-secondary { min-width: 0; }
}

.closer-section-empty {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 13px;
  color: var(--muted);
  padding: 18px 0;
  text-align: center;
}

/* Status pills shown on the closer's dashboard for CALEB items they aren't
   actioning themselves — so each row's right edge has content matching the
   admin's button area (good for screen-sharing the admin view side-by-side
   with the closer's own dashboard). */
.status-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.01em;
  white-space: nowrap;
}
.status-pill-pending {
  background: var(--bg);
  color: var(--muted);
  border: 1px solid var(--border-strong);
}
.status-pill-done {
  background: #dcfce7;
  color: var(--success);
  border: 1px solid #bbf7d0;
}

/* ─────────────────────────────────────────────────────────────────────────
   Auth pages (login.html, change-password.html)
   ───────────────────────────────────────────────────────────────────────── */

body.admin-dashboard .login-shell {
  max-width: 460px;
  margin: 80px auto;
}

.auth-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 36px 36px 32px;
  box-shadow: 0 4px 24px -16px rgba(15, 23, 42, 0.18);
}

.auth-pretitle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.auth-pretitle .mfs-mark { width: 24px; height: 24px; font-size: 9px; border-radius: 5px; }
.auth-pretitle .crumbs {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  color: var(--body);
  letter-spacing: 0.005em;
}
.auth-pretitle .crumbs strong { color: var(--text); font-weight: 600; }
.auth-pretitle .crumbs .sep { margin: 0 6px; color: var(--muted); }

.auth-title {
  font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  font-size: 36px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--text);
  margin: 0 0 8px;
}
.auth-title .accent { color: var(--mfs-blue); }

.auth-sub {
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
  color: var(--body);
  margin: 0 0 22px;
}

.auth-field { margin-bottom: 14px; }
.auth-field:last-of-type { margin-bottom: 22px; }
.auth-field label {
  display: block;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  color: var(--body);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 6px;
}
.auth-field input {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 14.5px;
  background: white;
  color: var(--text);
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--mfs-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

body.admin-dashboard .auth-submit {
  width: 100%;
  padding: 12px 16px;
  font-size: 14.5px;
  font-weight: 600;
  margin-top: 4px;
}

/* ─────────────────────────────────────────────────────────────────────────
   SOP page polish — typography for long-form markdown
   ───────────────────────────────────────────────────────────────────────── */

body.admin-dashboard .sop-body {
  font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  padding: 36px 40px;
  max-width: 720px;
  margin: 18px auto 16px;
}
body.admin-dashboard .sop-body h1,
body.admin-dashboard .sop-body h2,
body.admin-dashboard .sop-body h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  color: var(--text);
  text-transform: none;
  letter-spacing: -0.01em;
  font-weight: 600;
}
body.admin-dashboard .sop-body h1 { font-size: 28px; margin-top: 0; }
body.admin-dashboard .sop-body h2 { font-size: 22px; margin-top: 28px; }
body.admin-dashboard .sop-body h3 { font-size: 18px; margin-top: 22px; }
body.admin-dashboard .sop-body p,
body.admin-dashboard .sop-body li { font-family: 'Source Serif 4', Georgia, serif; }
body.admin-dashboard .sop-body code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.85em;
}
body.admin-dashboard .sop-body pre {
  background: var(--text);
  color: white;
  padding: 14px 16px;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 13px;
}
body.admin-dashboard .sop-body pre code { background: transparent; padding: 0; }
body.admin-dashboard .sop-ack {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
}

/* SOP video banner — shown above written content when a Drive video is attached */
.sop-video-banner {
  max-width: 720px;
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid #3b82f6;
  border-radius: 8px;
}
.sop-video-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  background: #1d4ed8;
  color: #fff;
  border-radius: 6px;
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: background 0.15s;
}
.sop-video-btn:hover { background: #1e40af; }
.sop-video-hint {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 13px;
  color: #1e40af;
  line-height: 1.4;
}

/* ─────────────────────────────────────────────────────────────────────────
   Fathom setup page (fathom-setup.html)
   ───────────────────────────────────────────────────────────────────────── */

.fathom-saved-banner {
  margin: 8px 0 24px;
  padding: 14px 18px;
  border-radius: 6px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 4px solid var(--success);
  color: #14532d;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 14px;
}
.fathom-saved-banner .num {
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 500;
  color: var(--text);
}
.fathom-saved-banner .muted {
  color: var(--muted);
  font-size: 13px;
  margin-left: 6px;
}

.fathom-steps {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 720px;
}

.fathom-step {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 16px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px 24px;
}

.fathom-step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--mfs-blue-tint);
  color: var(--mfs-blue);
  font-family: 'IBM Plex Mono', monospace;
  font-weight: 600;
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border: 1px solid var(--mfs-blue);
}

.fathom-step-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 19px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.005em;
}

.fathom-step-desc {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  font-size: 14px;
  color: var(--body);
  line-height: 1.55;
  margin-bottom: 14px;
}
.fathom-step-desc strong { color: var(--text); font-weight: 600; }

.fathom-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.fathom-input-row input {
  flex: 1;
  padding: 11px 13px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 14px;
  background: white;
  color: var(--text);
}
.fathom-input-row input:focus {
  outline: none;
  border-color: var(--mfs-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.fathom-status {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 5px;
  font-family: 'IBM Plex Sans', sans-serif;
  font-size: 13.5px;
  line-height: 1.45;
}
.fathom-status-info  { background: var(--mfs-blue-tint); color: var(--mfs-blue-deep); border: 1px solid #bfdbfe; }
.fathom-status-ok    { background: #f0fdf4; color: #14532d; border: 1px solid #bbf7d0; }
.fathom-status-error { background: #fef2f2; color: #7f1d1d; border: 1px solid #fecaca; }

@media (max-width: 600px) {
  .fathom-step { grid-template-columns: 36px 1fr; padding: 18px; gap: 12px; }
  .fathom-step-num { width: 32px; height: 32px; font-size: 13px; }
  .fathom-step-title { font-size: 17px; }
  .fathom-input-row { flex-direction: column; }
}

/* ─────────────────────────────────────────────────────────────────────────
   Lesson page — Offer Mastery
   Magazine-style typography for the body + branded knowledge check at the
   bottom + Skool/Drive video buttons at the top.
   ───────────────────────────────────────────────────────────────────────── */

body.lesson-page { background: var(--bg); }
body.lesson-page .container { max-width: 760px; padding: 32px 24px 64px; }

/* Top bar: back link + position indicator */
body.lesson-page .page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0 0 28px;
  padding: 0;
  border: none;
  background: transparent;
}
body.lesson-page .back-link {
  font-size: 14px;
  color: var(--mfs-blue);
  text-decoration: none;
  font-weight: 500;
}
body.lesson-page .back-link:hover { text-decoration: underline; }
body.lesson-page .lesson-position {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

/* Title + meta */
body.lesson-page h1#lesson-title {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 36px;
  line-height: 1.15;
  font-weight: 700;
  color: var(--text);
  text-transform: none;
  letter-spacing: -0.02em;
  margin: 0 0 10px;
}
body.lesson-page .lesson-meta {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 16px;
}
body.lesson-page .lesson-summary {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 19px;
  line-height: 1.5;
  color: var(--body);
  margin: 0 0 32px;
  font-style: italic;
}

/* Skool / Drive video buttons */
body.lesson-page .skool-videos {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 32px;
}
body.lesson-page .skool-video-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 20px;
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  font-size: 15px;
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
body.lesson-page .skool-video-btn:hover {
  border-color: var(--mfs-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.08);
}
body.lesson-page .skool-video-btn .play-icon { font-size: 18px; flex-shrink: 0; }
body.lesson-page .skool-video-btn .video-title { flex: 1; }
body.lesson-page .skool-video-btn .arrow {
  color: var(--mfs-blue);
  font-weight: 700;
  font-size: 18px;
  flex-shrink: 0;
}

/* Markdown body — magazine treatment */
body.lesson-page .lesson-body {
  font-family: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;
  font-size: 17px;
  line-height: 1.7;
  color: var(--text);
}
body.lesson-page .lesson-body h1,
body.lesson-page .lesson-body h2,
body.lesson-page .lesson-body h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  color: var(--text);
  text-transform: none;
  letter-spacing: -0.01em;
  font-weight: 700;
}
body.lesson-page .lesson-body h1 { font-size: 28px; margin: 36px 0 16px; }
body.lesson-page .lesson-body h2 { font-size: 22px; margin: 32px 0 12px; }
body.lesson-page .lesson-body h3 { font-size: 18px; margin: 24px 0 10px; }
body.lesson-page .lesson-body p { margin: 0 0 16px; }
body.lesson-page .lesson-body ul,
body.lesson-page .lesson-body ol { margin: 0 0 16px; padding-left: 24px; }
body.lesson-page .lesson-body li { margin-bottom: 6px; }
body.lesson-page .lesson-body strong { color: var(--text); font-weight: 700; }
body.lesson-page .lesson-body em { color: var(--body); }
body.lesson-page .lesson-body a {
  color: var(--mfs-blue);
  text-decoration: underline;
  text-underline-offset: 2px;
}
body.lesson-page .lesson-body a:hover { color: var(--mfs-blue-dark); }
body.lesson-page .lesson-body blockquote {
  border-left: 3px solid var(--mfs-blue);
  background: var(--mfs-blue-tint);
  margin: 20px 0;
  padding: 14px 20px;
  border-radius: 0 8px 8px 0;
  color: var(--text);
  font-style: italic;
}
body.lesson-page .lesson-body blockquote p:last-child { margin-bottom: 0; }
body.lesson-page .lesson-body code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 3px;
  font-family: 'IBM Plex Mono', monospace;
  font-size: 0.88em;
}
body.lesson-page .lesson-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
}
body.lesson-page .lesson-body table th,
body.lesson-page .lesson-body table td {
  border: 1px solid var(--border);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
body.lesson-page .lesson-body table th {
  background: var(--mfs-blue-tint);
  font-weight: 600;
}
body.lesson-page .lesson-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 16px 0;
  border: 1px solid var(--border);
}
body.lesson-page .lesson-body hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 32px 0;
}

/* Divider between body and check */
body.lesson-page .lesson-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 48px 0 36px;
}

/* Knowledge check section */
body.lesson-page .lesson-check { padding-bottom: 32px; }
body.lesson-page .lesson-check h2 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  text-transform: none;
  letter-spacing: -0.01em;
  margin: 0 0 8px;
}
body.lesson-page .check-hint {
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 24px;
}

body.lesson-page .admin-banner {
  background: #fef3c7;
  border: 1px solid #fcd34d;
  color: #78350f;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
}

body.lesson-page .check-question {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 22px 24px;
  margin: 0 0 16px;
  background: var(--card);
}
body.lesson-page .check-question-stem {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text);
  margin-bottom: 16px;
}
body.lesson-page .check-options {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

body.lesson-page .check-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 10px 14px;
  margin: 6px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  background: var(--card);
  transition: border-color 0.12s, background 0.12s;
  font-weight: 400;
  font-size: 15px;
  color: var(--body);
}
body.lesson-page .check-option:hover {
  border-color: var(--mfs-blue);
  background: var(--mfs-blue-tint);
}
body.lesson-page .check-option input[type="radio"] {
  margin-top: 3px;
  accent-color: var(--mfs-blue);
  flex-shrink: 0;
}
body.lesson-page .check-option input[type="radio"]:checked ~ span {
  color: var(--text);
  font-weight: 500;
}

body.lesson-page #submit-check {
  background: var(--mfs-blue);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 14px 28px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  transition: background 0.15s;
}
body.lesson-page #submit-check:hover:not(:disabled) { background: var(--mfs-blue-dark); }
body.lesson-page #submit-check:disabled { opacity: 0.6; cursor: not-allowed; }

body.lesson-page .check-result {
  margin-top: 24px;
  padding: 20px 24px;
  border-radius: 10px;
  border-width: 1px;
  border-style: solid;
}
body.lesson-page .check-result h3 {
  font-family: 'Source Serif 4', Georgia, serif;
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 8px;
  text-transform: none;
  letter-spacing: -0.01em;
  color: inherit;
}
body.lesson-page .check-result p { margin: 0 0 12px; font-size: 15px; }
body.lesson-page .check-result.pass {
  background: #ecfdf5;
  border-color: #6ee7b7;
  color: #065f46;
}
body.lesson-page .check-result.fail {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #7f1d1d;
}
body.lesson-page .primary-link {
  display: inline-block;
  background: var(--mfs-blue);
  color: white;
  text-decoration: none;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  margin-top: 8px;
}
body.lesson-page .primary-link:hover { background: var(--mfs-blue-dark); }

/* Mobile */
@media (max-width: 640px) {
  body.lesson-page .container { padding: 20px 16px 48px; }
  body.lesson-page h1#lesson-title { font-size: 28px; }
  body.lesson-page .lesson-summary { font-size: 17px; }
  body.lesson-page .lesson-body { font-size: 16px; }
  body.lesson-page .skool-video-btn { padding: 14px 16px; font-size: 14px; }
}
