@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --primary:       #1a56a0;
  --primary-dark:  #0f3d7a;
  --primary-light: #e8f0fb;
  --accent:        #3b82f6;
  --success:       #16a34a;
  --danger:        #dc2626;
  --warning:       #d97706;
  --text:          #1e293b;
  --muted:         #64748b;
  --border:        #e2e8f0;
  --bg:            #f8fafc;
  --white:         #ffffff;
  --radius:        12px;
  --radius-sm:     8px;
  --shadow:        0 1px 3px rgba(0,0,0,0.06), 0 4px 12px rgba(0,0,0,0.06);
  --shadow-sm:     0 1px 2px rgba(0,0,0,0.05);
}

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

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  font-size: 15px;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

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

/* ── FLASH MESSAGES ─────────────────────────────── */
.flash {
  padding: 14px 18px;
  margin-bottom: 20px;
  border-radius: var(--radius-sm);
  border-left: 4px solid;
  font-size: 14px;
}
.flash-notice { background: #eff6ff; border-color: var(--accent); color: #1e40af; }
.flash-alert  { background: #fef2f2; border-color: var(--danger); color: #991b1b; }
.flash-token  { background: #fffbeb; border-color: var(--warning); color: #92400e; }
.flash-token code { display: block; margin-top: 8px; font-family: monospace; font-size: 13px; word-break: break-all; background: rgba(0,0,0,0.05); padding: 6px 10px; border-radius: 4px; }

/* ── BUTTONS ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  text-decoration: none;
  transition: all 0.15s ease;
  line-height: 1;
  white-space: nowrap;
}
.btn-primary   { background: var(--primary); color: var(--white); box-shadow: 0 1px 2px rgba(26,86,160,0.3); }
.btn-secondary { background: var(--white); color: var(--primary); border: 1.5px solid var(--border); }
.btn-danger    { background: var(--danger); color: var(--white); }
.btn-primary:hover   { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 8px rgba(26,86,160,0.25); text-decoration: none; color: var(--white); }
.btn-secondary:hover { background: var(--bg); border-color: var(--primary); text-decoration: none; }
.btn-danger:hover    { background: #b91c1c; transform: translateY(-1px); text-decoration: none; color: var(--white); }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-lg { padding: 13px 28px; font-size: 16px; }

/* ── ADMIN LAYOUT ────────────────────────────────── */
.admin-layout { display: flex; min-height: 100vh; }

.sidebar {
  width: 230px;
  background: linear-gradient(160deg, #1a3a6b 0%, #1a56a0 100%);
  color: var(--white);
  display: flex;
  flex-direction: column;
  padding: 0;
  flex-shrink: 0;
}
.sidebar-brand {
  padding: 28px 20px 22px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.sidebar-brand h2 { font-size: 20px; font-weight: 700; letter-spacing: -0.3px; color: #ffffff; text-shadow: 0 1px 4px rgba(0,0,0,0.3); }
.sidebar-brand small { opacity: 0.75; font-size: 12px; display: block; margin-top: 3px; color: #ffffff; }
.sidebar ul { list-style: none; margin-top: 12px; flex: 1; padding: 0 10px; }
.sidebar ul li a {
  display: flex;
  align-items: center;
  padding: 10px 14px;
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  margin-bottom: 2px;
}
.sidebar ul li a:hover { background: rgba(255,255,255,0.12); color: var(--white); text-decoration: none; }
.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.12);
  font-size: 13px;
}
.sidebar-footer small { color: rgba(255,255,255,0.6); display: block; margin-bottom: 6px; }
.sidebar-footer button, .sidebar-footer form { display: inline; }
.sidebar-footer button {
  background: none;
  border: none;
  color: rgba(255,255,255,0.7);
  cursor: pointer;
  font-size: 13px;
  padding: 0;
  font-family: inherit;
  transition: color 0.15s;
}
.sidebar-footer button:hover { color: var(--white); }

/* ── CLINICIAN LAYOUT ────────────────────────────── */
.clinician-layout { display: flex; flex-direction: column; min-height: 100vh; }

.topnav {
  background: linear-gradient(90deg, #1a3a6b 0%, #1a56a0 100%);
  display: flex;
  align-items: center;
  padding: 0 28px;
  height: 60px;
  gap: 24px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.topnav-brand { color: var(--white); font-weight: 700; font-size: 17px; letter-spacing: -0.3px; }
.topnav ul { display: flex; list-style: none; gap: 4px; margin-left: auto; align-items: center; }
.topnav ul li a {
  color: rgba(255,255,255,0.85);
  text-decoration: none;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}
.topnav ul li a:hover { background: rgba(255,255,255,0.15); color: var(--white); text-decoration: none; }
.topnav ul li button {
  background: none;
  border: none;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  font-size: 14px;
  font-family: inherit;
  font-weight: 500;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  transition: all 0.15s;
}
.topnav ul li button:hover { background: rgba(255,255,255,0.15); color: var(--white); }
.topnav-user {
  padding: 7px 14px 7px 18px;
  margin-left: 6px;
  border-left: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.65);
  font-size: 13px;
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── MAIN CONTENT ────────────────────────────────── */
.main-content { flex: 1; padding: 32px 36px; }
.admin-layout .main-content { overflow-y: auto; }

h1 { font-size: 24px; font-weight: 700; color: var(--text); letter-spacing: -0.4px; margin-bottom: 24px; }
h2 { font-size: 17px; font-weight: 600; color: var(--text); margin: 24px 0 12px; }
h3 { font-size: 15px; font-weight: 600; margin: 20px 0 10px; }
p  { line-height: 1.6; margin-bottom: 12px; color: var(--muted); }

/* ── PAGE HEADER ─────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.page-header h1 { margin-bottom: 0; }

/* ── STAT CARDS (legacy) ─────────────────────────── */
.stat-cards { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 32px; }
.stat-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  min-width: 160px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-number { font-size: 40px; font-weight: 700; color: var(--primary); }
.stat-label  { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* ── TABLE ───────────────────────────────────────── */
.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.table th { background: var(--primary); color: var(--white); padding: 13px 16px; text-align: left; font-size: 13px; font-weight: 600; letter-spacing: 0.02em; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; font-size: 14px; }
.table tr:last-child td { border-bottom: none; }
.table tr.inactive td { opacity: 0.5; }
.table tr:hover td { background: var(--bg); }
.text-center { text-align: center; }

/* ── BADGES ──────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
}
.badge-active   { background: #dcfce7; color: #15803d; }
.badge-inactive { background: #fee2e2; color: #dc2626; }
.badge-pending  { background: #fef9c3; color: #a16207; }
.badge-current  { background: #dcfce7; color: #15803d; }
.badge-desired  { background: #ede9fe; color: #6d28d9; }

/* ── FORMS ───────────────────────────────────────── */
.form-group { margin-bottom: 22px; }
.form-group label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 7px; color: var(--text); }
.form-control {
  width: 100%;
  max-width: 480px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-control:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px rgba(59,130,246,0.15); }
textarea.form-control { resize: vertical; }
.form-check { display: flex; align-items: center; gap: 10px; }
.form-check-input { width: 18px; height: 18px; cursor: pointer; accent-color: var(--primary); }
.form-actions { margin-top: 32px; display: flex; gap: 12px; align-items: center; }
.form-errors {
  background: #fef2f2;
  border-left: 4px solid var(--danger);
  padding: 14px 16px;
  margin-bottom: 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: #991b1b;
}
.form-errors ul { margin-left: 16px; }

/* ── DETAIL LIST ─────────────────────────────────── */
.detail-list { margin-bottom: 24px; }
.detail-list dt { font-weight: 600; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 0.05em; margin-top: 18px; }
.detail-list dd { font-size: 15px; margin-top: 3px; }

/* ── QUICK ACTIONS ───────────────────────────────── */
.quick-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }

/* ── SKILLS GRID ─────────────────────────────────── */
.skills-grid { display: flex; flex-direction: column; gap: 20px; }
.skill-category {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.skill-category h3 {
  background: var(--primary);
  color: var(--white);
  margin: 0;
  padding: 11px 18px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.skills-table { width: 100%; border-collapse: collapse; }
.skills-table th { background: var(--bg); padding: 10px 18px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); }
.skills-table td { padding: 12px 18px; border-bottom: 1px solid var(--border); font-size: 14px; }
.skills-table tr:last-child td { border-bottom: none; }
.skill-desc { display: block; color: var(--muted); font-size: 13px; margin-top: 2px; }

/* ── ALERT ───────────────────────────────────────── */
.alert { padding: 14px 18px; border-radius: var(--radius-sm); margin-bottom: 20px; font-size: 14px; }
.alert-info { background: #eff6ff; border-left: 4px solid var(--accent); color: #1e40af; }
.alert-info a { color: var(--primary); font-weight: 600; }

/* ── DEVISE FORMS ────────────────────────────────── */
#new_user, #edit_user {
  max-width: 440px;
  background: var(--white);
  padding: 36px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  margin: 60px auto;
}

/* ── SKILL SHOW ──────────────────────────────────── */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 24px;
}
.two-col h2 {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.two-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.two-col ul li {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 14px;
}
.two-col ul li:last-child { border-bottom: none; }

/* ── DASHBOARD CARDS ─────────────────────────────── */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 4px;
}
.dash-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: box-shadow 0.2s;
}
.dash-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,0.1); }
.dash-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 24px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--white) 100%);
}
.dash-stat {
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -1px;
}
.dash-label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 500;
  margin-top: 4px;
}
.dash-list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-height: 340px;
  overflow-y: auto;
}
.dash-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  transition: background 0.1s;
}
.dash-list li:last-child { border-bottom: none; }
.dash-list li:hover { background: var(--bg); }
.dash-list-category {
  font-size: 11px !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted) !important;
  background: var(--bg) !important;
  padding: 7px 24px !important;
}
.dash-empty {
  color: var(--muted);
  font-style: italic;
  font-size: 14px;
}
.dash-meta {
  font-size: 12px;
  color: var(--muted);
}
.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ── ANALYTICS ───────────────────────────────────── */
.analytics-bar {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.analytics-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  border-radius: 3px;
  transition: width 0.3s ease;
}
.analytics-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  margin-left: 16px;
  white-space: nowrap;
}

/* ── PLAN BADGES ─────────────────────────────────── */
.badge-gold   { background: #fef3c7; color: #92400e; }
.badge-silver { background: #f1f5f9; color: #475569; }
.badge-bronze { background: #fde8d8; color: #9a3412; }

/* ── SCHEDULE GRID ───────────────────────────────── */
.schedule-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.schedule-row {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s;
}
.schedule-row--active {
  border-color: var(--primary);
}
.schedule-row-header {
  padding: 14px 18px;
}
.schedule-toggle {
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  user-select: none;
}
.schedule-toggle input[type=checkbox] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
  flex-shrink: 0;
}
.schedule-slot-name {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
}
.schedule-locations {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 18px 14px;
}
.location-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--muted);
  background: var(--bg);
  transition: all 0.12s;
  user-select: none;
}
.location-chip:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.location-chip--selected {
  background: var(--primary);
  border-color: var(--primary);
  color: var(--white);
}

/* ── SCHEDULE SAVE BAR ───────────────────────────── */
.schedule-save-bar {
  position: fixed;
  bottom: 24px;
  right: 32px;
  z-index: 99;
}

/* Plain in-flow save bar — for pages with more than one save button (e.g.
   the admin clinician page has both Skills and Schedule forms at once);
   .schedule-save-bar's fixed positioning assumes exactly one per page, so
   two of them land on top of each other, hiding whichever paints first. */
.form-save-bar { margin-top: 16px; }

/* ── WCAG 2.2 AA ACCESSIBILITY ───────────────────── */

/* Skip link */
.skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  background: var(--primary);
  color: var(--white);
  padding: 12px 20px;
  font-weight: 600;
  font-size: 14px;
  z-index: 9999;
  text-decoration: none;
  border-radius: 0 0 var(--radius-sm) 0;
}
.skip-link:focus {
  top: 0;
}

/* Visible focus indicators — 2.4.11 Focus Appearance */
*:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
}
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 3px solid #f59e0b;
  outline-offset: 2px;
  border-radius: 2px;
}

/* Minimum target size 24x24px — 2.5.8 */
button, .btn, a.btn,
input[type="submit"],
input[type="checkbox"],
input[type="radio"] {
  min-height: 24px;
  min-width: 24px;
}

/* Badges include text so colour isn't the only indicator — 1.4.1 */
.badge::before {
  font-weight: 700;
}
.badge-active::before   { content: "✓ "; }
.badge-inactive::before { content: "✗ "; }
.badge-pending::before  { content: "⏳ "; }

/* ── PUBLIC PAGES (sign in / clinician search) ───── */
.public-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: linear-gradient(135deg, #1a3a6b 0%, #1a56a0 100%);
  padding: 32px 24px 48px;
}
.public-brand { margin-bottom: 24px; text-align: center; }
.public-brand h1 { color: var(--white); font-size: 26px; font-weight: 700; margin: 0; letter-spacing: -0.5px; }
.public-brand p  { color: rgba(255,255,255,0.65); font-size: 14px; margin: 6px 0 0; }

.public-tabs {
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  margin-bottom: 24px;
  background: rgba(255,255,255,0.12);
  border-radius: 999px;
}
.public-tab {
  padding: 9px 22px;
  border-radius: 999px;
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.public-tab:hover { background: rgba(255,255,255,0.15); color: var(--white); text-decoration: none; }
.public-tab--active { background: var(--white); color: var(--primary); }
.public-tab--active:hover { background: var(--white); color: var(--primary); }
.public-tab:focus-visible { outline-color: #FFD700; }

/* ── CLINICIAN SEARCH (web version of the desktop app) */
.cs-card {
  width: 100%;
  max-width: 900px;
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  box-shadow: 0 12px 40px rgba(0,0,0,0.2);
  overflow: hidden;
}
.cs-card--narrow { max-width: 460px; padding: 36px; }
.cs-card--narrow h2 { margin-top: 0; font-size: 18px; }
.cs-card--narrow .form-control { max-width: none; }
.cs-card--narrow .form-actions { margin-top: 20px; }
.cs-card--narrow small { display: block; color: var(--muted); font-size: 12px; margin-top: 6px; }
.cs-code-error { margin-top: 14px; }

.cs-header {
  background: var(--primary-dark);
  color: var(--white);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.cs-header h2 { color: var(--white); font-size: 18px; font-weight: 700; margin: 0; }
.cs-header-subtitle { font-size: 13px; opacity: 0.8; }
.cs-settings-btn {
  background: none;
  border: 1px solid rgba(255,255,255,0.35);
  color: var(--white);
  font-size: 13px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  padding: 7px 12px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
  white-space: nowrap;
}
.cs-settings-btn:hover { background: rgba(255,255,255,0.15); }

.cs-search-section {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  position: relative;
}
.cs-search-wrapper {
  display: flex;
  align-items: center;
  border: 2px solid var(--primary);
  border-radius: var(--radius-sm);
  background: var(--white);
  overflow: hidden;
}
.cs-search-wrapper:focus-within { box-shadow: 0 0 0 3px rgba(59,130,246,0.25); }
.cs-search-icon { padding: 0 12px; font-size: 18px; color: var(--muted); flex-shrink: 0; }
.cs-search-input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  font-size: 20px;
  font-family: inherit;
  padding: 14px 0;
  color: var(--text);
  background: transparent;
}
.cs-search-input:focus-visible { outline: none; }
.cs-search-input::placeholder { color: var(--muted); }
.cs-search-clear {
  background: none;
  border: none;
  font-size: 18px;
  color: var(--muted);
  cursor: pointer;
  padding: 0 14px;
  flex-shrink: 0;
}
.cs-search-clear:hover { color: var(--text); }

.cs-suggestions {
  position: absolute;
  top: calc(100% - 21px);
  left: 24px;
  right: 24px;
  background: var(--white);
  border: 2px solid var(--primary);
  border-top: none;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 100;
  box-shadow: 0 6px 16px rgba(0,0,0,0.12);
}
.cs-suggestion {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 15px;
  color: var(--text);
  border-bottom: 1px solid var(--border);
}
.cs-suggestion:last-child { border-bottom: none; }
.cs-suggestion:hover { background: var(--bg); }
.cs-suggestion strong { color: var(--primary); font-weight: 700; }
.cs-suggestion--no-match { color: var(--muted); cursor: default; font-style: italic; }
.cs-suggestion--no-match:hover { background: none; }

.cs-results {
  padding: 20px 24px;
  min-height: 320px;
  max-height: 60vh;
  overflow-y: auto;
  background: var(--bg);
}
.cs-placeholder { text-align: center; color: var(--muted); padding: 60px 20px; font-size: 16px; }
.cs-placeholder p { margin: 0; }
.cs-count {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.cs-clinician {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 20px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
  transition: border-color 0.15s, background 0.15s;
  width: 100%;
  text-align: left;
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}
.cs-clinician:hover { background: #f0f4f8; border-color: var(--primary); }
.cs-clinician-info { min-width: 220px; }
.cs-clinician-name  { font-size: 17px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.cs-priority-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary);
  color: var(--white);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.cs-clinician-title { font-size: 14px; color: var(--muted); margin-top: 2px; }
.cs-clinician-meta  { font-size: 13px; color: var(--muted); margin-top: 3px; }
.cs-clinician-skills { flex: 1; border-left: 2px solid var(--border); padding-left: 20px; }
.cs-skills-label { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; display: block; margin-bottom: 4px; }
.cs-skills-list  { font-size: 15px; color: var(--success); font-weight: 600; }
.cs-clinician-book { font-size: 12px; font-weight: 600; color: var(--primary); white-space: nowrap; opacity: 0; transition: opacity 0.15s; }
.cs-clinician:hover .cs-clinician-book, .cs-clinician:focus-visible .cs-clinician-book { opacity: 1; }

.cs-no-results { text-align: center; padding: 40px 20px; color: var(--muted); }
.cs-no-results strong { color: var(--text); }
.cs-no-results-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.cs-all-skills { display: flex; flex-wrap: wrap; gap: 8px; padding: 16px 0; }
.cs-skill-chip {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--primary);
  background: var(--white);
  color: var(--primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.12s;
  font-family: inherit;
}
.cs-skill-chip:hover { background: var(--primary); color: var(--white); }

.cs-loading { display: flex; align-items: center; gap: 12px; color: var(--muted); padding: 40px 0; }
.cs-spinner {
  width: 22px;
  height: 22px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: cs-spin 0.7s linear infinite;
}
@keyframes cs-spin { to { transform: rotate(360deg); } }
.cs-error {
  background: #fef2f2;
  border-left: 4px solid var(--danger);
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  color: #991b1b;
  font-size: 14px;
}

.cs-dialog {
  margin: auto; /* the global margin reset breaks the browser default centring for <dialog> */
  border: none;
  border-radius: 14px;
  padding: 28px;
  width: 400px;
  max-width: 90vw;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  font-family: inherit;
  color: var(--text);
}
.cs-dialog::backdrop { background: rgba(0,0,0,0.4); }
.cs-dialog h2 { font-size: 17px; font-weight: 700; margin: 0 0 4px; }
.cs-dialog .form-control { max-width: none; }
.cs-dialog-name { font-size: 14px; color: var(--primary); font-weight: 600; margin-bottom: 14px; }
.cs-dialog-question { font-size: 14px; color: var(--muted); margin-bottom: 16px; }
.cs-dialog-info {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: #f0f4f8;
  border-radius: var(--radius-sm);
  padding: 14px;
  margin-bottom: 20px;
  border-left: 4px solid var(--primary);
  white-space: pre-line;
}
.cs-booking-options { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.cs-booking-btn {
  padding: 11px 16px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--primary);
  background: var(--white);
  color: var(--primary);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
  transition: all 0.12s;
  font-family: inherit;
}
.cs-booking-btn:hover { background: var(--primary); color: var(--white); }
.cs-booking-btn--none { border-color: var(--danger); color: var(--danger); }
.cs-booking-btn--none:hover { background: var(--danger); color: var(--white); }
.cs-dialog-skip {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  cursor: pointer;
  width: 100%;
  text-align: center;
  padding: 4px;
  font-family: inherit;
}
.cs-dialog-skip:hover { color: var(--text); }
.cs-full { width: 100%; justify-content: center; }

@media (max-width: 640px) {
  .cs-clinician { flex-direction: column; align-items: flex-start; gap: 10px; }
  .cs-clinician-info { min-width: 0; }
  .cs-clinician-skills { border-left: none; padding-left: 0; }
  .cs-clinician-book { opacity: 1; }
  .cs-search-input { font-size: 17px; }
}

/* The `hidden` attribute must win over .btn's display:inline-flex etc. */
.public-page [hidden], .cs-dialog [hidden] { display: none !important; }

/* ── SKILL BOOKING PRIORITY (admin) ──────────────── */
.priority-list-item { display: flex; align-items: center; gap: 12px; }
.priority-input { width: 56px !important; max-width: 56px; padding: 6px 8px; text-align: center; margin: 0; }

/* ── MARKETING HOMEPAGE ──────────────────────────── */
.mk-page { display: flex; flex-direction: column; min-height: 100vh; background: var(--white); }

.mk-nav {
  border-bottom: 1px solid var(--border);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 10;
}
.mk-nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.mk-nav-left { display: flex; align-items: center; gap: 28px; }
.mk-brand { font-size: 18px; font-weight: 700; color: var(--text); letter-spacing: -0.3px; }
.mk-nav-tabs { display: flex; gap: 4px; }
.mk-nav-tab {
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  color: #475569; /* slightly lighter than --text, reads as "soft black" */
  text-decoration: none !important;
  transition: background 0.15s, color 0.15s;
}
.mk-nav-tab:hover { background: var(--bg); color: var(--text); }
.mk-nav-tab--active { background: var(--bg); color: var(--primary); }
.mk-login-btn {
  padding: 9px 22px;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: var(--white) !important;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none !important;
  transition: background 0.15s;
}
.mk-login-btn:hover { background: var(--primary-dark); }

.mk-hero {
  background-color: #11336b; /* fallback behind the inline gradient+photo */
  background-size: cover;
  background-position: center 28%;
  background-repeat: no-repeat;
  padding: 100px 24px 88px;
}
.mk-hero-inner { max-width: 760px; margin: 0 auto; text-align: center; animation: mk-fade-up 0.8s ease both; }
.mk-hero h1 {
  color: var(--white);
  font-size: 44px;
  font-weight: 700;
  letter-spacing: -0.8px;
  margin-bottom: 18px;
  line-height: 1.15;
  text-shadow: 0 2px 20px rgba(0,0,0,0.25);
}
.mk-hero-sub {
  color: rgba(255,255,255,0.88);
  font-size: 18px;
  line-height: 1.6;
  margin-bottom: 36px;
}
.mk-hero-ctas { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.mk-hero-ctas .btn-secondary {
  background: rgba(255,255,255,0.1);
  color: var(--white);
  border: 1.5px solid rgba(255,255,255,0.45);
  backdrop-filter: blur(2px);
}
.mk-hero-ctas .btn-secondary:hover { background: rgba(255,255,255,0.2); color: var(--white); }

.mk-cta-band .btn-secondary {
  background: var(--white);
  color: var(--primary);
  border: 1.5px solid var(--border);
  backdrop-filter: none;
}
.mk-cta-band .btn-secondary:hover { background: var(--bg); color: var(--primary); border-color: var(--primary); }

/* ── Narrative: two staggered paragraphs ─────────── */
.mk-narrative { padding: 80px 24px 64px; background: var(--white); }
.mk-narrative-inner { max-width: 880px; margin: 0 auto; }
.mk-stagger {
  font-size: 19px;
  line-height: 1.75;
  color: var(--text);
  max-width: 560px;
}
.mk-stagger--one {
  margin: 0 0 0 0;
  font-size: 22px;
  font-weight: 500;
}
.mk-stagger--two {
  margin: 36px 0 0 auto; /* offset to the right for the zigzag */
  color: var(--muted);
}

/* ── Feature panels: faded photo behind text, alternating sides ── */
.mk-feature-panel {
  background-color: #0a162e; /* fallback behind the inline gradient+photo */
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  padding: 90px 24px;
  display: flex;
}
.mk-feature-panel-inner { max-width: 1100px; margin: 0 auto; width: 100%; display: flex; }
.mk-feature-panel--left  .mk-feature-panel-inner { justify-content: flex-start; }
.mk-feature-panel--right .mk-feature-panel-inner { justify-content: flex-end; }
.mk-feature-text { max-width: 420px; }
.mk-feature-panel--right .mk-feature-text { text-align: right; }
.mk-feature-eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8fb8f0;
  margin-bottom: 10px;
}
.mk-feature-text h2 {
  color: var(--white);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin-bottom: 14px;
  line-height: 1.2;
}
.mk-feature-text p {
  color: rgba(255,255,255,0.85);
  font-size: 16px;
  line-height: 1.65;
  margin: 0;
}

.mk-cta-band { background: var(--bg); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 56px 24px; }
.mk-cta-band-inner { max-width: 560px; margin: 0 auto; text-align: center; }
.mk-cta-band h2 { font-size: 22px; margin-bottom: 10px; }
.mk-cta-band p { color: var(--muted); margin-bottom: 24px; }

.mk-footer { padding: 28px 24px; margin-top: auto; }
.mk-footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 13px;
  color: var(--muted);
}
.mk-footer-inner nav { display: flex; gap: 18px; }
.mk-footer-inner a { color: var(--muted); text-decoration: underline; }
.mk-footer-credit {
  max-width: 1100px;
  margin: 10px auto 0;
  font-size: 11px;
  color: var(--muted);
  opacity: 0.7;
}
.mk-footer-credit a { color: var(--muted); }

/* ── Scroll reveal ────────────────────────────────── */
/* Fully visible with no JS; .has-js on <html> means IntersectionObserver is
   wired up, so sections fade/slide in as they're scrolled to. */
@keyframes mk-fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: none; }
}
html.has-js .mk-reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
html.has-js .mk-reveal--visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html.has-js .mk-reveal { opacity: 1; transform: none; transition: none; }
  .mk-hero-inner { animation: none; }
}

@media (max-width: 560px) {
  .mk-nav-left { gap: 14px; }
  .mk-nav-tab { padding: 6px 10px; font-size: 13px; }
  .mk-brand { font-size: 16px; }
}

@media (max-width: 760px) {
  .mk-hero { padding: 72px 20px 64px; background-position: center 20%; }
  .mk-hero h1 { font-size: 30px; }
  .mk-narrative { padding: 56px 20px; }
  .mk-stagger { font-size: 17px; max-width: 100%; }
  .mk-stagger--one { font-size: 19px; }
  .mk-stagger--two { margin: 24px 0 0 0; }
  .mk-feature-panel { padding: 56px 20px; background-position: center; }
  .mk-feature-panel-inner { justify-content: flex-start !important; }
  .mk-feature-text,
  .mk-feature-panel--right .mk-feature-text {
    max-width: 100%;
    text-align: left;
    background: rgba(8,18,38,0.55);
    border-radius: var(--radius);
    padding: 18px 20px;
    backdrop-filter: blur(2px);
  }
  .mk-feature-text h2 { font-size: 22px; }
}

/* ── TUTORIALS PAGE ──────────────────────────────── */
.tut-page { flex: 1; padding: 40px 24px 80px; background: var(--bg); }
.tut-page-inner { max-width: 900px; margin: 0 auto; }
.tut-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.tut-page-header h1 { margin-bottom: 4px; }
.tut-page-header p { color: var(--muted); margin: 0; }

.tut-tabs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: fit-content;
  margin-bottom: 28px;
}
.tut-tab {
  padding: 9px 20px;
  border-radius: 999px;
  border: none;
  background: none;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.tut-tab:hover { color: var(--text); }
.tut-tab--active { background: var(--primary); color: var(--white); }

.tut-panel {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px; /* visible stacked spacing when JS is off */
}
.tut-panel h2 { margin: 0 0 8px; font-size: 18px; }
.tut-panel p { margin-bottom: 18px; }
.tut-video-placeholder {
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #e2e8f0, #f1f5f9);
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
}

/* With JS, only the active panel shows and the stacked margin isn't needed */
html.has-js .tut-panel { display: none; margin-bottom: 0; }
html.has-js .tut-panel--active { display: block; }

@media (max-width: 560px) {
  .tut-tabs { width: 100%; }
  .tut-tab { flex: 1; padding: 9px 8px; font-size: 13px; }
  .tut-panel { padding: 20px; }
}

/* ── NAV ACTIONS (sign up + login, right side of mk-nav) ──────────── */
.mk-nav-actions { display: flex; align-items: center; gap: 18px; }
.mk-signup-link {
  font-size: 14px;
  font-weight: 600;
  color: #475569;
  text-decoration: none !important;
}
.mk-signup-link:hover { color: var(--text); }

/* ── FORM PAGES (signup, Direct Debit setup) ───────────────────────── */
.mk-form-page {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  background: var(--bg);
}
.mk-form-card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px;
}
.mk-form-card h1 {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
  margin: 0 0 8px;
}
.mk-form-card p.mk-form-intro {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 24px;
}
.mk-form-card--centered { text-align: center; }
.mk-form-foot {
  text-align: center;
  margin-top: 18px;
  font-size: 14px;
}
.mk-form-foot a { color: var(--primary); }
