/* Mojo Academy admin styles. Extracted verbatim from admin.html; linked before
   /theme.css so brand overrides still win the cascade. */

/* ─── Tokens ────────────────────────────────────────────── */
:root {
  --ground:     #151A16;
  --surface:    #1E2420;
  --surface2:   #252C27;
  --border:     #2E3830;
  --text:       #EAE5DB;
  --muted:      #8A9189;
  --accent:     #9B51E0;
  --accent-dim: #7C3AED;
  --danger:     #E05C5C;
  --success:    #5C9E6A;
  --warn:       #C8873A;
  --info:       #4A90B8;
  --score-1: #E05C5C; --score-2: #C8873A; --score-3: #7BAF62; --score-4: #5C9E6A;
  --sam-bg: #1E2824; --sam-border: #2E4035;
  --coach-bg: #2A2520; --coach-border: #3D342A;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ground: #EDEBE4; --surface: #E4E1D9; --surface2: #D8D4CB;
    --border: #C5C0B5; --text: #171C18; --muted: #6B7068;
    --accent: #7C3AED; --accent-dim: #5B21B6;
    --sam-bg: #DFF0E5; --sam-border: #B8D8C0;
    --coach-bg: #EDE8DF; --coach-border: #D0C8BC;
  }
}
:root[data-theme="light"] {
  --ground: #EDEBE4; --surface: #E4E1D9; --surface2: #D8D4CB;
  --border: #C5C0B5; --text: #171C18; --muted: #6B7068;
  --accent: #7C3AED; --accent-dim: #5B21B6;
  --sam-bg: #DFF0E5; --sam-border: #B8D8C0;
  --coach-bg: #EDE8DF; --coach-border: #D0C8BC;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; background: var(--ground); color: var(--text);
  font-family: var(--font-body, 'DM Sans'), system-ui, sans-serif; font-size: 14px; line-height: 1.5; }

/* ─── App shell ─────────────────────────────────────────── */
.app { display: flex; flex-direction: row; height: 100dvh; overflow: hidden; }

/* ─── Sidebar ────────────────────────────────────────────── */
.sidebar {
  width: 216px; flex-shrink: 0;
  background: var(--surface); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; height: 100dvh;
  position: sticky; top: 0; overflow: hidden;
}
.sidebar-logo {
  padding: 16px 16px 14px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.logo { font-family: var(--font-heading, 'DM Serif Display'), Georgia, serif; font-size: 15px; color: var(--accent); text-decoration: none; display: block; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 8px 0; scrollbar-width: thin; }
.nav-group { margin-bottom: 2px; }
.nav-group-label {
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--text); padding: 12px 16px 3px;
  cursor: pointer; user-select: none;
  display: flex; align-items: center; justify-content: space-between;
}
.nav-group-label::after {
  content: '▾'; font-size: 9px; opacity: .6;
  transition: transform .2s ease; display: inline-block;
}
.nav-group.collapsed .nav-group-label::after { transform: rotate(-90deg); }
.nav-group-items {
  overflow: hidden;
  max-height: 300px;
.nav-link-ext {
  display: block; padding: 6px 16px; font-size: 13px; color: var(--muted);
  text-decoration: none; border-radius: 6px; margin: 1px 6px;
  transition: background .15s, color .15s;
}
.nav-link-ext:hover { background: var(--surface2); color: var(--text); }
  transition: max-height .22s ease, opacity .18s ease;
  opacity: 1;
}
.nav-group.collapsed .nav-group-items { max-height: 0; opacity: 0; }
.tab-btn {
  display: block; width: calc(100% - 16px); margin: 1px 8px;
  text-align: left; background: none; border: none; border-radius: 6px;
  color: var(--text); font-family: var(--font-body, 'DM Sans'), sans-serif;
  font-size: 13px; font-weight: 400; padding: 6px 10px 6px 28px; cursor: pointer;
  transition: background .12s, color .12s; letter-spacing: .01em;
}
.tab-btn:hover { background: rgba(0,0,0,.05); color: var(--text); }
.tab-btn.active { background: rgba(124,58,237,.1); color: var(--accent); font-weight: 600; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tab-btn:hover { background: rgba(255,255,255,.08); }
}
:root[data-theme="dark"] .tab-btn:hover { background: rgba(255,255,255,.08); }
.sidebar-footer {
  padding: 12px 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}
.btn-icon {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 13px; transition: border-color .15s, color .15s;
}
.btn-icon:hover { border-color: var(--accent); color: var(--accent); }
.btn-sm {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; padding: 5px 12px; font-family: var(--font-body, 'DM Sans'), sans-serif;
  font-size: 12px; cursor: pointer; transition: all .15s; white-space: nowrap;
}
.btn-sm:hover { border-color: var(--text); color: var(--text); }
.btn-danger { border-color: #7a2020 !important; color: #c0504d !important; }
.btn-danger:hover { background: #c0504d !important; border-color: #c0504d !important; color: #fff !important; }
.btn-primary {
  background: var(--accent); border: none; color: var(--ground);
  border-radius: 6px; padding: 6px 14px; font-family: var(--font-body, 'DM Sans'), sans-serif;
  font-size: 12px; font-weight: 500; cursor: pointer; transition: background .15s;
  white-space: nowrap;
}
.btn-primary:hover { background: var(--accent-dim); }
#mmSave { display: inline-flex; align-items: center; gap: 7px; }
#mmSave:disabled { cursor: default; }
.mm-save-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; display: inline-block; flex-shrink: 0; }
#mmSave.mm-save-saving .mm-save-dot { animation: mmSaveDotPulse 1s ease-in-out infinite; }
#mmSave.mm-save-saved { background: var(--success) !important; }
#mmSave.mm-save-error { background: var(--danger) !important; }
@keyframes mmSaveDotPulse { 0%, 100% { opacity: .3; } 50% { opacity: 1; } }
.btn-danger {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; padding: 5px 12px; font-family: var(--font-body, 'DM Sans'), sans-serif;
  font-size: 12px; cursor: pointer; transition: all .15s;
}
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }

        /* Scenario Library filter chips */
        .scn-filter-bar { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:16px; }
        .scn-filter-btn { padding:5px 14px; border-radius:20px; border:1px solid var(--border); background:transparent; color:var(--text-muted); font-size:0.8rem; cursor:pointer; transition:all .15s; }
        .scn-filter-btn:hover { border-color:var(--primary); color:var(--primary); }
        .scn-filter-btn.active { background:var(--primary); border-color:var(--primary); color:#fff; }
        .scn-status-badge { display:inline-block; padding:2px 8px; border-radius:12px; font-size:0.72rem; font-weight:600; text-transform:uppercase; letter-spacing:.04em; }
        .scn-badge-draft { background:#e8f4fd; color:#1a73e8; }
        .scn-badge-in_validation { background:#fff3cd; color:#856404; }
        .scn-badge-locked { background:#d1e7dd; color:#0a5e33; }
        .scn-layer-dot { display:inline-block; width:8px; height:8px; border-radius:50%; margin-right:3px; }
        .scn-layer-ok { background:#2e7d32; }
        .scn-layer-missing { background:#d32f2f; }
        .scn-card { background:var(--card-bg); border:1px solid var(--border); border-radius:8px; padding:16px 20px; margin-bottom:12px; display:flex; align-items:flex-start; gap:16px; }
        .scn-card-meta { flex:1; min-width:0; }
        .scn-card-title { font-weight:600; font-size:1rem; margin-bottom:4px; }
        .scn-card-sub { font-size:0.82rem; color:var(--text-muted); margin-bottom:8px; }
        .scn-card-actions { display:flex; gap:8px; flex-wrap:wrap; align-items:center; }
        .scn-folder-picker { font-size:0.78rem; padding:3px 6px; border-radius:6px; border:1px solid var(--border); background:var(--card-bg); color:var(--text); cursor:pointer; }
        .scn-folder-section { margin-bottom:22px; padding:6px; border-radius:8px; }
        .scn-folder-header { display:flex; align-items:center; justify-content:space-between; gap:10px; padding:4px 2px 8px; margin-bottom:10px; border-bottom:1px solid var(--border); }
        .scn-folder-toggle { display:flex; align-items:center; gap:7px; cursor:pointer; user-select:none; min-width:0; }
        .scn-folder-chevron { font-size:10px; color:var(--text-muted); flex-shrink:0; width:1em; display:inline-block; text-align:center; }
        .scn-folder-name { font-weight:700; font-size:0.9rem; }
        .scn-folder-count { font-size:0.75rem; color:var(--text-muted); font-weight:500; }
        .scn-folder-actions { display:flex; gap:4px; flex-shrink:0; }
        .scn-folder-body { min-height:44px; }
        .scn-folder-section.scn-folder-collapsed .scn-folder-body { display:none; }
        .scn-folder-section.scn-folder-collapsed .scn-folder-header { margin-bottom:0; border-bottom:none; padding-bottom:4px; }
        .scn-folder-empty { color:var(--text-muted); font-size:0.82rem; padding:6px 4px; margin:0; }
        /* Scenario detail view */
        .scn-detail-header { display:flex; align-items:center; gap:16px; margin-bottom:20px; flex-wrap:wrap; padding-bottom:16px; border-bottom:1px solid var(--border); }
        .scn-section-nav { display:flex; gap:0; border-bottom:1px solid var(--border); margin-bottom:24px; overflow-x:auto; }
        .scn-section-btn { background:none; border:none; border-bottom:2px solid transparent; padding:8px 18px; cursor:pointer; color:var(--text-muted); font-size:0.875rem; white-space:nowrap; transition:all .15s; }
        .scn-section-btn:hover { color:var(--text); }
        .scn-section-btn.active { border-bottom-color:var(--accent); color:var(--accent); font-weight:600; }
        .scn-field-block { margin-bottom:24px; }
        .scn-field-label { font-size:0.72rem; font-weight:700; text-transform:uppercase; letter-spacing:.06em; color:var(--text-muted); }
        .scn-field-value { font-size:0.875rem; line-height:1.6; color:var(--text); white-space:pre-wrap; }
        .scn-json-pre { background:var(--surface2); border:1px solid var(--border); border-radius:6px; padding:12px 14px; font-size:0.78rem; font-family:monospace; overflow:auto; max-height:420px; white-space:pre; line-height:1.5; }
        /* Contextual "?" help -- a native <details> disclosure so it needs no JS and matches
           the anchor-descriptions/coaching-reference pattern already used elsewhere in this editor. */
        .scn-help { margin:0 0 16px; }
        .scn-help > summary { display:inline-flex; align-items:center; gap:6px; font-size:0.75rem; color:var(--text-muted); cursor:pointer; user-select:none; list-style:none; }
        .scn-help > summary::-webkit-details-marker { display:none; }
        .scn-help > summary::before { content:'?'; display:inline-flex; align-items:center; justify-content:center; flex-shrink:0; width:15px; height:15px; border-radius:50%; border:1px solid var(--border); font-size:10px; font-weight:700; color:var(--text-muted); }
        .scn-help > summary:hover { color:var(--text); }
        .scn-help[open] > summary { color:var(--text); margin-bottom:8px; }
        .scn-help-body { padding:10px 14px; background:var(--surface2); border:1px solid var(--border); border-radius:6px; font-size:0.8rem; line-height:1.6; color:var(--text); max-width:640px; }
        .scn-help-body p { margin:0 0 8px; }
        .scn-help-body p:last-child { margin-bottom:0; }
        .scn-help-body ul { margin:0 0 8px; padding-left:18px; }
        .scn-help-body ul:last-child { margin-bottom:0; }
        .scn-help-body code { font-family:monospace; font-size:0.78rem; background:var(--surface); border:1px solid var(--border); border-radius:3px; padding:1px 4px; }
        .scn-help-body pre { font-family:monospace; font-size:0.74rem; background:var(--surface); border:1px solid var(--border); border-radius:4px; padding:8px 10px; overflow:auto; white-space:pre; margin:6px 0; line-height:1.45; }
        .scn-help-body .scn-help-note { color:var(--danger,#c0392b); }


/* Tab panels */
.tab-panels { flex: 1; overflow: hidden; }
.tab-panel { display: none; height: 100%; }
.tab-panel.active { display: flex; flex-direction: column; padding: 20px 24px; overflow-y: auto; }

/* Full-height layout panels manage their own internal padding and scrolling */
#tab-courses.active, #tab-users.active, #tab-sessions.active,
#tab-cohorts.active, #tab-branding.active, #tab-resources.active,
#tab-feedback.active, #tab-comments.active, #tab-whats-coming.active,
#tab-whats-new.active, #tab-archived.active {
  padding: 0;
  overflow: hidden;
}
    .resources-grid { display: grid; grid-template-columns: repeat(auto-fill,minmax(260px,1fr)); gap: 16px; padding: 24px; align-content: start; }
    .resource-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 20px; display: flex; flex-direction: column; gap: 10px; }
    .resource-card-icon { font-size: 28px; line-height: 1; }
    .resource-card-title { font-size: 14px; font-weight: 600; color: var(--text); }
    .resource-card-desc { font-size: 12px; color: var(--muted); line-height: 1.6; flex: 1; }
    .resource-card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 4px; }

/* ─── Courses tab ──────────────────────────────────────── */
.programs-layout { display: flex; flex: 1; overflow: hidden; }

.prog-sidebar {
  width: 300px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border); display: flex;
  flex-direction: column; overflow: hidden;
}
.sidebar-top {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; flex-shrink: 0;
}
.sidebar-label { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.prog-list { flex: 1; overflow-y: auto; }
.prog-item {
  padding: 12px 14px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .12s;
}
.prog-item:hover { background: var(--surface2); }
.prog-item.active { background: var(--surface2); border-left: 3px solid var(--accent); padding-left: 11px; }
.prog-item-title { font-size: 13px; font-weight: 500; margin-bottom: 3px; }
.prog-item-meta { font-size: 11px; color: var(--muted); display: flex; gap: 10px; }
.badge-pub { font-size: 10px; padding: 1px 7px; border-radius: 20px; font-weight: 600; letter-spacing: .04em; }
.badge-pub.yes { background: rgba(92,158,106,.15); color: var(--success); }
.badge-pub.no  { background: var(--surface2); color: var(--muted); }

/* Notification workflow rows */
.notif-row { background:var(--surface);border:1px solid var(--border);border-radius:8px;padding:12px 16px;display:flex;align-items:center;gap:12px; }
.notif-row:hover { border-color:var(--accent); }
.notif-badge { font-size:10px;padding:2px 8px;border-radius:20px;font-weight:600;letter-spacing:.04em;flex-shrink:0; }
.notif-badge.active   { background:rgba(92,158,106,.15);color:var(--success); }
.notif-badge.inactive { background:var(--surface2);color:var(--muted); }
.notif-var { font-size:11px;font-family:monospace;background:var(--surface);border:1px solid var(--border);border-radius:4px;padding:2px 6px;cursor:pointer;color:var(--accent);transition:background .12s; }
.notif-var:hover { background:var(--border); }

.prog-detail { flex: 1; overflow-y: auto; display: flex; flex-direction: column; }
.prog-placeholder {
  flex: 1; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--muted); padding: 40px; text-align: center;
}
.prog-header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 16px 24px; display: flex; align-items: flex-start;
  justify-content: space-between; gap: 16px; flex-shrink: 0;
}
.prog-header-info {}
.prog-title-row { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.prog-title { font-family: var(--font-heading, 'DM Serif Display'), Georgia, serif; font-size: 20px; font-weight: 400; }
.prog-slug { font-size: 11px; color: var(--muted); font-family: monospace; }
.prog-desc { font-size: 13px; color: var(--muted); margin-top: 4px; }
.prog-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }
.prog-version-info { font-size: 11px; color: var(--muted); margin-top: 6px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.prog-version-edit { background: none; border: none; color: var(--accent); cursor: pointer; font-size: 11px; padding: 0; font-family: inherit; text-decoration: none; }
.prog-version-edit:hover { text-decoration: underline; }

/* Modules list */
.modules-section { padding: 20px 24px; flex: 1; }
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.section-title { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.module-list { display: flex; flex-direction: column; gap: 8px; }
.module-row {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 16px;
  display: flex; align-items: center; gap: 12px;
  transition: border-color .12s;
}
.module-row:hover { border-color: var(--accent); }
.module-order { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; width: 20px; flex-shrink: 0; text-align: right; }
.module-type-icon { font-size: 14px; flex-shrink: 0; }
.module-info { flex: 1; min-width: 0; }
.module-title { font-size: 13px; font-weight: 500; }
.module-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.module-actions { display: flex; gap: 6px; flex-shrink: 0; flex-wrap: wrap; }
.icon-btn {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 5px; width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; font-size: 11px; transition: all .12s;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn.del:hover { border-color: var(--danger); color: var(--danger); }
.mod-btn {
  background: none; border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 5px 11px;
  display: inline-flex; align-items: center; gap: 5px;
  cursor: pointer; font-family: inherit; font-size: 12px; font-weight: 500;
  transition: all .12s; white-space: nowrap;
}
.mod-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-dim, rgba(217,119,6,0.08)); }
.mod-btn:disabled { opacity: 0.35; cursor: not-allowed; }
.mod-btn.mod-del { color: var(--danger, #e05252); border-color: transparent; }
.mod-btn.mod-del:hover { border-color: var(--danger, #e05252); background: rgba(224,82,82,0.08); }

/* ─── Users tab ─────────────────────────────────────────── */
.users-layout { flex: 1; overflow: hidden; display: flex; flex-direction: column; }
.users-toolbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 10px 20px; display: flex; align-items: center; gap: 12px; flex-shrink: 0;
}
.users-table-wrap { flex: 1; overflow-y: auto; }
table { width: 100%; border-collapse: collapse; }
thead th {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 10px 16px; text-align: left; font-size: 11px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted);
  position: sticky; top: 0; z-index: 1;
}
tbody tr { border-bottom: 1px solid var(--border); transition: background .1s; }
tbody tr:hover { background: var(--surface2); }
tbody td { padding: 11px 16px; font-size: 13px; vertical-align: middle; }
.user-email { font-weight: 500; }
.user-name { color: var(--muted); font-size: 12px; }
.role-badge {
  font-size: 10px; padding: 2px 8px; border-radius: 20px; font-weight: 600;
  letter-spacing: .04em; display: inline-block;
}
.role-badge.admin { background: rgba(193,154,62,.15); color: var(--accent); }
.role-badge.learner { background: var(--surface2); color: var(--muted); }
.role-badge.lifetime { background: transparent; color: var(--accent); border: 1px solid var(--accent); }
.role-checklist { display: flex; flex-direction: column; gap: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; max-height: 180px; overflow-y: auto; }
.role-check-item { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; }
.role-check-item input { margin: 0; }
.enroll-count { color: var(--muted); font-size: 12px; }
.joined-date { color: var(--muted); font-size: 12px; }

/* Enrollment chips */
.enroll-chips { display: flex; flex-wrap: wrap; gap: 5px; }
.enroll-chip {
  font-size: 11px; background: var(--surface2); border: 1px solid var(--border);
  border-radius: 20px; padding: 2px 8px; display: flex; align-items: center; gap: 5px;
}
.enroll-chip button {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 11px; line-height: 1; padding: 0; transition: color .1s;
}
.enroll-chip button:hover { color: var(--danger); }

/* ─── Enrollment expand rows ────────────────────────── */
.enr-expand-row td {
  padding: 0 !important;
  background: var(--surface2);
}
.enr-expand-inner {
  padding: 10px 16px 14px 16px;
  border-top: 1px solid var(--border);
}
.enr-row-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
}
.enr-row-item:last-child { border-bottom: none; }
.enr-row-item-info { flex: 1; min-width: 0; }
.enr-row-program { font-size: 13px; font-weight: 500; color: var(--text); }
.enr-row-meta { font-size: 11px; color: var(--muted); margin-top: 2px; }
.enr-row-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.enr-status {
  font-size: 10px; font-weight: 600; letter-spacing: .04em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 20px;
}
.enr-status.complete  { background: rgba(74,222,128,.12); color: #4ade80; }
.enr-status.progress  { background: rgba(193,154,62,.12); color: var(--accent); }
.enr-status.notstarted { background: var(--surface); color: var(--muted); border: 1px solid var(--border); }
.btn-toggle-enr {
  background: none; border: 1px solid var(--border); border-radius: 4px;
  color: var(--muted); cursor: pointer; font-size: 11px; padding: 3px 7px;
  transition: color .1s, border-color .1s;
}
.btn-toggle-enr:hover { color: var(--text); border-color: var(--text); }
.enr-loading { font-size: 12px; color: var(--muted); padding: 10px 0; }

/* ─── Sessions tab (from original admin.html) ───────────── */
.sessions-layout { display: flex; flex: 1; overflow: hidden; }
.sess-sidebar {
  width: 300px; flex-shrink: 0; background: var(--surface);
  border-right: 1px solid var(--border); display: flex; flex-direction: column; overflow: hidden;
}
.session-list { flex: 1; overflow-y: auto; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.session-item {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .12s; display: flex; flex-direction: column; gap: 5px;
}
.session-item:hover { background: var(--surface2); }
.session-item.active { background: var(--surface2); border-left: 3px solid var(--accent); }
.session-item-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
/* Bulk select (Sessions tab) */
.sess-select-btn { padding: 3px 9px; font-size: 11px; }
.sess-select-btn.on { border-color: var(--accent); color: var(--accent); }
.sess-bulk-bar {
  padding: 6px 12px; border-bottom: 1px solid var(--border); background: var(--surface2);
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-shrink: 0;
}
.sess-bulk-bar .btn-sm { padding: 3px 10px; font-size: 11px; }
.sess-bulk-bar .btn-sm:disabled { opacity: .45; cursor: default; }
.sess-bulk-all { font-size: 11px; color: var(--muted); display: flex; align-items: center; gap: 6px; cursor: pointer; user-select: none; }
.session-item.selectable { user-select: none; flex-direction: row; align-items: flex-start; gap: 10px; }
.session-item.selectable .sess-item-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 5px; }
.sess-check { margin-top: 2px; flex-shrink: 0; cursor: pointer; accent-color: var(--accent); }
.session-item.selected { background: var(--surface2); box-shadow: inset 3px 0 0 var(--accent); }
.session-date { font-size: 12px; color: var(--muted); }
.score-pill { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 20px; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.session-item-bottom { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--muted); }
.crit-dots { display: flex; gap: 3px; }
.crit-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.crit-dot.hit { background: var(--success); }
.session-status-tag { display: inline-block; font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 20px; letter-spacing: .04em; text-transform: uppercase; flex-shrink: 0; }
.session-status-tag.tag-certified  { background: #d4edda; color: #2e7d45; }
.session-status-tag.tag-reviewed   { background: #d0eaf8; color: #1a5f8a; }
.session-status-tag.tag-needs-review { background: #fff3cd; color: #8a5c00; }
.session-status-tag.tag-in-progress { background: var(--surface2); color: var(--muted); border: 1px solid var(--border); }
.config-title { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.config-row { display: flex; flex-direction: column; gap: 5px; }
.config-label { font-size: 12px; color: var(--muted); }
.config-select, .config-input {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px; padding: 6px 10px;
  font-family: var(--font-body, 'DM Sans'), sans-serif; font-size: 13px; width: 100%; outline: none; transition: border-color .15s;
}
.config-select:focus, .config-input:focus { border-color: var(--accent); }
.config-save {
  background: var(--accent); border: none; border-radius: 6px; color: var(--ground);
  font-family: var(--font-body, 'DM Sans'), sans-serif; font-size: 12px; font-weight: 500; padding: 7px 14px;
  cursor: pointer; align-self: flex-start; transition: background .15s;
}
.config-save:hover { background: var(--accent-dim); }
.config-saved { font-size: 11px; color: var(--success); display: none; }

.detail-pane { flex: 1; overflow-y: auto; display: flex; flex-direction: column; scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
.detail-placeholder { flex: 1; display: flex; align-items: center; justify-content: center; font-size: 13px; color: var(--muted); padding: 40px; text-align: center; }
.detail-header { background: var(--surface); border-bottom: 1px solid var(--border); padding: 14px 24px; display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-shrink: 0; flex-wrap: wrap; }
.detail-meta { display: flex; flex-direction: column; gap: 4px; }
.detail-id { font-size: 11px; color: var(--muted); font-family: monospace; }
.detail-date { font-size: 13px; }
.detail-stats { display: flex; gap: 16px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.detail-overall { font-family: var(--font-heading, 'DM Serif Display'), Georgia, serif; font-size: 32px; line-height: 1; font-variant-numeric: tabular-nums; }
.scores-section { padding: 20px 24px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.scores-section-title { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 14px; }
.scores-grid { display: flex; flex-direction: column; gap: 14px; }
.score-row { display: flex; flex-direction: column; gap: 6px; }
.score-row-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.score-crit-label { font-size: 13px; font-weight: 500; }
.score-crit-num { color: var(--muted); font-weight: 400; margin-right: 5px; font-size: 12px; }
.score-values { display: flex; align-items: center; gap: 8px; }
.score-ai { font-size: 12px; color: var(--muted); }
.score-override-btns { display: flex; gap: 4px; }
.score-btn { width: 26px; height: 26px; border-radius: 5px; border: 1px solid var(--border); background: var(--surface2); color: var(--muted); font-size: 11px; font-weight: 600; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .12s; font-variant-numeric: tabular-nums; }
.score-btn:hover { border-color: var(--accent); color: var(--accent); }
.score-btn.selected { border-color: transparent; color: var(--ground); }
.score-bar-track { background: var(--surface2); border-radius: 4px; height: 5px; overflow: hidden; }
.score-bar-fill { height: 100%; border-radius: 4px; transition: width .4s ease; }
.score-evidence { font-size: 11.5px; color: var(--muted); font-style: italic; line-height: 1.5; }
.score-evidence::before { content: '"'; }
.score-evidence::after  { content: '"'; }
.score-notes-input { background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; color: var(--text); font-family: var(--font-body, 'DM Sans'), sans-serif; font-size: 12px; padding: 6px 10px; width: 100%; resize: vertical; min-height: 52px; outline: none; transition: border-color .15s; }
.score-notes-input:focus { border-color: var(--accent); }
.score-save-btn { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 5px; padding: 4px 12px; font-family: var(--font-body, 'DM Sans'), sans-serif; font-size: 11px; cursor: pointer; transition: all .12s; align-self: flex-start; margin-top: 2px; }
.score-save-btn:hover { border-color: var(--accent); color: var(--accent); }
.score-saved-msg { font-size: 11px; color: var(--success); display: none; }
.transcript-section { padding: 20px 24px; flex: 1; }
.transcript-title { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 14px; }
.transcript { display: flex; flex-direction: column; gap: 14px; }
.t-msg { display: flex; gap: 10px; }
.t-avatar { width: 28px; height: 28px; border-radius: 7px; display: flex; align-items: center; justify-content: center; font-size: 14px; flex-shrink: 0; margin-top: 2px; }
.t-msg.coach .t-avatar { background: var(--coach-bg); border: 1px solid var(--coach-border); }
.t-msg.sam   .t-avatar { background: var(--sam-bg);   border: 1px solid var(--sam-border); }
.t-body { flex: 1; min-width: 0; }
.t-name { font-size: 10.5px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.t-msg.coach .t-name { color: var(--accent); }
.t-msg.sam   .t-name { color: var(--success); }
.t-text { font-size: 13.5px; line-height: 1.6; color: var(--text); padding: 8px 12px; border-radius: 6px; background: var(--surface2); border: 1px solid var(--border); }
.t-msg.coach .t-text { border-left: 3px solid var(--accent); }
.t-msg.sam   .t-text { border-left: 3px solid var(--success); }
.notes-section { padding: 16px 24px; border-top: 1px solid var(--border); flex-shrink: 0; }
    /* ── Sessions detail redesign ─────────────────────────────────────── */
    .fac-layout { display: grid; grid-template-columns: 1fr 1fr; min-height: 440px; flex: 1; overflow: hidden; }
    .fac-turn-num { display: inline-block; background: var(--surface2); border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; font-size: 9.5px; font-weight: 700; color: var(--muted); margin-right: 6px; text-transform: none; letter-spacing: 0; vertical-align: middle; }
    mark.banned-phrase { background: rgba(239,68,68,.18); color: inherit; border-bottom: 2px solid rgba(239,68,68,.7); border-radius: 2px; padding: 0 1px; cursor: help; }
    .fac-header-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px 20px; font-size: 11.5px; color: var(--muted); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
    .fac-header-grid span { display: flex; flex-direction: column; gap: 2px; }
    .fac-header-grid strong { font-size: 9.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--accent); font-weight: 600; }
    .fac-cmp-notes { font-size: 11px; color: var(--text); margin-top: 6px; padding: 6px 8px; background: var(--surface2); border-left: 3px solid var(--accent); border-radius: 4px; line-height: 1.5; }
    .fac-cmp-notes strong { display: block; text-transform: uppercase; font-size: 9.5px; letter-spacing: .05em; color: var(--muted); margin-bottom: 2px; }
    .fac-transcript-col { overflow-y: auto; border-right: 1px solid var(--border); padding: 20px 24px; }
    .fac-scoring-col { overflow-y: auto; padding: 20px 24px; display: flex; flex-direction: column; gap: 12px; }
    .fac-crit-print-table { display: none; }
    .fac-col-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 14px; }
    .fac-crit-card { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--surface); transition: border-color .15s; }
    .fac-crit-card.fac-rated { border-color: var(--accent); }
    .fac-crit-header { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 10px; }
    .fac-crit-num { font-size: 11px; font-weight: 600; color: var(--muted); padding-top: 2px; min-width: 16px; }
    .fac-crit-label { font-size: 13px; font-weight: 600; color: var(--text); flex: 1; line-height: 1.35; }
    .fac-gate-badge { font-size: 10px; background: var(--accent); color: var(--ground); border-radius: 4px; padding: 2px 6px; white-space: nowrap; flex-shrink: 0; }
    .fac-btns { display: flex; gap: 6px; margin-bottom: 10px; }
    .fac-btn { flex: 1; height: 40px; border-radius: 7px; border: 1.5px solid var(--border); background: var(--surface2); color: var(--muted); font-size: 16px; font-weight: 700; cursor: pointer; transition: all .12s; }
    .fac-btn:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-1px); }
    .fac-btn.sel-1 { background: var(--score-1); border-color: var(--score-1); color: #fff; }
    .fac-btn.sel-2 { background: var(--score-2); border-color: var(--score-2); color: #fff; }
    .fac-btn.sel-3 { background: var(--score-3); border-color: var(--score-3); color: #fff; }
    .fac-btn.sel-4 { background: var(--score-4); border-color: var(--score-4); color: #fff; }
    .fac-saved-flag { font-size: 10px; color: var(--success); align-self: center; margin-left: 4px; }
    .fac-notes-input { background: var(--surface2); border: 1px solid var(--border); border-radius: 7px; color: var(--text); font-family: var(--font-body, 'DM Sans'), sans-serif; font-size: 12px; padding: 8px 12px; width: 100%; resize: vertical; min-height: 52px; outline: none; transition: border-color .15s; box-sizing: border-box; }
    .fac-notes-input:focus { border-color: var(--accent); }
    .fac-merge-bar { padding: 14px 24px; border-top: 1px solid var(--border); background: var(--surface2); flex-shrink: 0; display: flex; align-items: center; gap: 14px; }
    .fac-merge-progress { font-size: 12px; color: var(--muted); flex: 1; }
    .fac-prog-wrap { height: 4px; background: var(--border); border-radius: 2px; width: 120px; flex-shrink: 0; }
    .fac-prog-fill { height: 100%; border-radius: 2px; background: var(--accent); transition: width .3s; }
    .fac-results { padding: 24px; border-top: 2px solid var(--border); }
  .fac-timing-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 20px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); }
  .fac-timing-table thead { background: var(--surface2); }
  .fac-timing-table th { padding: 7px 12px; text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; border-bottom: 1px solid var(--border); }
  .fac-timing-table td { padding: 10px 12px; font-size: 13px; color: var(--text); font-weight: 500; }
    .fac-results-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); margin-bottom: 18px; }
    .fac-stat-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 12px; margin-bottom: 24px; }
    .fac-stat-tile { border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; background: var(--surface2); text-align: center; }
    .fac-stat-val { font-size: 26px; font-weight: 800; color: var(--text); line-height: 1.1; }
    .fac-stat-lbl { font-size: 11px; color: var(--muted); margin-top: 4px; }
    .fac-stat-sub { font-size: 10px; color: var(--muted); margin-top: 2px; }
    .fac-cmp-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 24px; }
    .fac-cmp-table th { text-align: left; padding: 7px 12px; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); border-bottom: 2px solid var(--border); }
    .fac-cmp-table td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
    .fac-cmp-table tr:last-child td { border-bottom: none; }
    .fac-sub { border: 1px solid var(--border); border-radius: 10px; padding: 16px 18px; margin-bottom: 16px; background: var(--surface2); }
    .fac-sub-title { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 10px; }
    .fac-verdict { border-radius: 12px; padding: 20px 24px; display: flex; align-items: center; gap: 20px; margin-top: 4px; }
    .fac-verdict-label { font-size: 28px; font-weight: 800; letter-spacing: -.02em; }
    .fac-verdict-detail { font-size: 13px; color: var(--muted); line-height: 1.6; }
.notes-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.notes-area { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); font-family: var(--font-body, 'DM Sans'), sans-serif; font-size: 13px; padding: 10px 14px; width: 100%; resize: vertical; min-height: 60px; outline: none; transition: border-color .15s; }
.notes-area:focus { border-color: var(--accent); }
.notes-save { display: flex; gap: 10px; align-items: center; margin-top: 8px; }
.btn-save { background: var(--accent); border: none; border-radius: 7px; color: var(--ground); padding: 7px 18px; font-family: var(--font-body, 'DM Sans'), sans-serif; font-size: 12px; font-weight: 500; cursor: pointer; transition: background .15s; }
.btn-save:hover { background: var(--accent-dim); }
.save-confirm { font-size: 11px; color: var(--success); display: none; }
.detail-actions { display: flex; gap: 8px; align-items: center; }
.action-btn { display: flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; font-family: var(--font-body, 'DM Sans'), sans-serif; cursor: pointer; border: 1px solid var(--border); background: var(--surface2); color: var(--muted); transition: all .15s; white-space: nowrap; }
.action-btn:hover { border-color: var(--accent); color: var(--accent); }
.action-btn.danger:hover { border-color: var(--danger); color: var(--danger); }

/* ─── Modal ─────────────────────────────────────────────── */
.modal-backdrop {
  display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6);
  z-index: 100; align-items: center; justify-content: center; padding: 20px;
}
.modal-backdrop.open { display: flex; }
.modal {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 24px; width: 100%; max-width: 540px;
  max-height: 90vh; overflow-y: auto;
}
.modal-title { font-family: var(--font-heading, 'DM Serif Display'), Georgia, serif; font-size: 18px; font-weight: 400; margin-bottom: 20px; }
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.form-label { font-size: 12px; color: var(--muted); }
.form-input, .form-textarea, .form-select {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: 7px; padding: 8px 12px;
  font-family: var(--font-body, 'DM Sans'), sans-serif; font-size: 13px;
  width: 100%; outline: none; transition: border-color .15s;
}
.form-input:focus, .form-textarea:focus, .form-select:focus { border-color: var(--accent); }
.form-textarea { resize: vertical; min-height: 80px; }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }
.modal-footer { display: flex; justify-content: flex-end; gap: 10px; margin-top: 4px; }
.form-error { font-size: 12px; color: var(--danger); margin-top: -8px; margin-bottom: 4px; display: none; }
/* ── Command palette ──────────────────────────────────────── */
.cmdk-backdrop { align-items: flex-start; padding-top: 12vh; z-index: 200; }
.cmdk-modal { max-width: 640px; padding: 0; overflow: hidden; display: flex; flex-direction: column; max-height: 70vh; }
.cmdk-input-row { display: flex; align-items: center; gap: 10px; padding: 14px 18px; border-bottom: 1px solid var(--border); flex-shrink: 0; }
.cmdk-input-icon { color: var(--muted); font-size: 15px; }
.cmdk-input { flex: 1; background: none; border: none; outline: none; color: var(--text); font-family: var(--font-body, 'DM Sans'), sans-serif; font-size: 15px; }
.cmdk-input::placeholder { color: var(--muted); }
.cmdk-hint { font-size: 11px; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 2px 6px; flex-shrink: 0; }
.cmdk-results { overflow-y: auto; padding: 6px; }
.cmdk-group-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 10px 4px; }
.cmdk-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 7px; cursor: pointer; font-size: 13px; }
.cmdk-item:hover, .cmdk-item.active { background: var(--surface2); }
.cmdk-item-icon { width: 20px; text-align: center; flex-shrink: 0; color: var(--muted); font-size: 13px; }
.cmdk-item-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmdk-item-sub { color: var(--muted); font-size: 11px; flex-shrink: 0; margin-left: 8px; }
.cmdk-empty { padding: 24px 16px; text-align: center; color: var(--muted); font-size: 13px; }
.cmdk-trigger-btn { display: flex; align-items: center; gap: 6px; background: var(--surface2); border: 1px solid var(--border); color: var(--muted); border-radius: 6px; padding: 5px 8px; font-size: 11px; cursor: pointer; font-family: var(--font-body, 'DM Sans'), sans-serif; transition: border-color .15s, color .15s; width: 100%; margin-top: 8px; }
.cmdk-trigger-btn:hover { border-color: var(--accent); color: var(--accent); }
.cmdk-trigger-kbd { margin-left: auto; font-size: 10px; border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; }
/* ── Module editor modal ──────────────────────────────────── */
#mmModal {
  transition: max-width .2s, width .2s;
  /* Full-width module editor: settles at 1200px on desktop, scales down to
     92% of the viewport on anything narrower (tablet included) rather than
     hard-cutting at a fixed pixel width -- the previous 680px cap was what
     left large desktop displays with a narrow editing column and a lot of
     unused space either side. */
  width: 100%; max-width: min(1200px, 92vw);
}
.lxs-tiptap table { border-collapse: collapse; width: 100%; margin: 0.75em 0; font-size: 13px; }
.lxs-tiptap th, .lxs-tiptap td { border: 1px solid var(--border); padding: 6px 10px; text-align: left; min-width: 60px; }
.lxs-tiptap th { background: var(--surface); font-weight: 600; color: var(--accent); }
.lxs-tiptap .selectedCell { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.lxs-tiptap .column-resize-handle { position: absolute; right: -2px; top: 0; bottom: 0; width: 4px; background: var(--accent,#A65015); opacity: 0; cursor: col-resize; z-index: 10; }
.lxs-tiptap .column-resize-handle:hover, .lxs-tiptap.resize-cursor .column-resize-handle { opacity: 0.5; }
.lxs-tiptap.resize-cursor { cursor: col-resize; }
.preview-toggle-btn { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--surface2); color: var(--text); font-size: 12px; font-weight: 500; cursor: pointer; line-height: 1; transition: all .15s; }
.preview-toggle-btn:hover { border-color: var(--accent); color: var(--accent); }
/* ── Emoji picker ───────────────────────────────────────────────────── */
.mm-emoji-picker {
  position: fixed; z-index: 10000;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px;
  display: grid; grid-template-columns: repeat(8, 36px); gap: 4px;
  width: auto; box-shadow: 0 8px 24px rgba(0,0,0,.3);
}
.mm-emoji-picker button {
  font-size: 22px; width: 36px; height: 36px; padding: 0;
  border: none; background: none; display: flex;
  align-items: center; justify-content: center;
  cursor: pointer; border-radius: 4px; line-height: 1;
}
.mm-emoji-picker button:hover { background: var(--surface2); }
button

/* Quiz builder */
.quiz-questions { display: flex; flex-direction: column; gap: 16px; }
.quiz-q-block { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; padding: 14px; }
.quiz-q-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.quiz-q-num { font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.quiz-options { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.quiz-opt-row { display: flex; align-items: center; gap: 8px; }
.quiz-opt-row input[type="radio"] { flex-shrink: 0; accent-color: var(--accent); }
.quiz-opt-row .form-input { flex: 1; }

/* Empty states */
.empty-state { padding: 40px 20px; text-align: center; font-size: 13px; color: var(--muted); line-height: 1.7; }

/* Toast */
.toast {
  position: fixed; bottom: 20px; right: 20px; z-index: 200;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 8px; padding: 10px 16px; font-size: 13px;
  transform: translateY(80px); opacity: 0;
  transition: transform .25s ease, opacity .25s ease;
  max-width: 280px;
}
.toast.show { transform: translateY(0); opacity: 1; }
.toast.ok  { border-color: var(--success); color: var(--success); }
.toast.err { border-color: var(--danger);  color: var(--danger); }

@media (max-width: 640px) {
  .programs-layout, .sessions-layout { flex-direction: column; }
  .prog-sidebar, .sess-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); max-height: 35vh; }
}
@media print {
  @page { margin: 18mm; size: A4; }

  /* ── Hide app chrome ── */
  header, .sidebar, .sess-sidebar, .detail-actions,
  .score-override-btns, .score-notes-input, .score-save-btn,
  .notes-section, .fac-merge-bar, #facMergeBar,
  .score-save-btn, .fac-notes-wrap > div,
  #lxs-fb-root { display: none !important; }

  /* ── Unselected score buttons — hide, keep only chosen ── */
  .fac-btn:not([class*="sel-"]) { display: none !important; }
  .fac-btn[class*="sel-"] { flex: 0 0 auto; width: 32px; height: 32px; font-size: 14px; border-radius: 5px; }

  /* ── Page & layout ── */
  html, body { background: #fff !important; color: #1a1a2e !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .app { display: block !important; height: auto !important; overflow: visible !important; }
  .sessions-layout { display: block !important; }
  .detail-pane { overflow: visible !important; width: 100% !important; height: auto !important; }

  /* ── Two-col → single col ── */
  .fac-layout { display: block !important; overflow: visible !important; }
  .fac-transcript-col { overflow: visible !important; border-right: none !important; border-bottom: 2px solid #4C1D95 !important; padding: 0 0 20px !important; margin-bottom: 20px !important; }
  .fac-scoring-col { overflow: visible !important; padding: 0 !important; }
  .transcript { max-height: none !important; overflow: visible !important; }

  /* ── Print header ── */
  .fac-print-header { display: block !important; margin-bottom: 28px; background: none !important; }
  .fac-print-logo-row { display: flex !important; align-items: center; justify-content: space-between; padding-bottom: 14px; border-bottom: 3px solid #9B51E0; margin-bottom: 14px; }
  .fac-print-logomark { width: 38px; height: 38px; border-radius: 8px; background: #4C1D95 !important; color: #fff !important; font-size: 20px; font-weight: 900; font-family: Georgia, serif; display: flex; align-items: center; justify-content: center; flex-shrink: 0; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .fac-print-logo-text { margin-left: 12px; flex: 1; }
  .fac-print-brand { display: block; font-size: 20px; font-weight: 800; color: #4C1D95 !important; letter-spacing: -.02em; font-family: Georgia, serif; line-height: 1.1; }
  .fac-print-subtitle { display: block; font-size: 10px; color: #9B51E0 !important; text-transform: uppercase; letter-spacing: .1em; margin-top: 3px; }
  .fac-print-report-date { font-size: 11px; color: #6b7280 !important; text-align: right; }
  .fac-print-meta { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px 24px; font-size: 12px; color: #374151 !important; }
  .fac-print-meta span { display: flex; flex-direction: column; gap: 2px; }
  .fac-print-meta strong { font-size: 10px; text-transform: uppercase; letter-spacing: .07em; color: #9B51E0 !important; }
  .fac-print-meta-divider { border: none; border-top: 1px solid #DDD6FE; margin: 0 0 14px; }
  .fac-header-grid { display: none !important; } /* fac-print-meta already covers this for print */
  mark.banned-phrase { background: #fde68a !important; color: #1a1a2e !important; border-bottom: 2px solid #b45309 !important; border-radius: 2px; padding: 0 1px; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .fac-turn-num { background: #ede9fe !important; color: #4C1D95 !important; border: 1px solid #ddd6fe !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

  /* ── Section headings ── */
  .fac-col-title, .fac-results-title, .fac-sub-title { color: #4C1D95 !important; }

  /* ── Cards & tiles — force white/light bg; no surface tones ── */
  .fac-crit-card, .fac-sub, .fac-stat-tile, .fac-results,
  .detail-pane, .fac-layout, .fac-transcript-col, .fac-scoring-col { background: #fff !important; }
  /* ── Session timing table ── */
  .fac-timing-table { display: table !important; width: 100%; border-collapse: collapse; font-size: 11px; margin-bottom: 16px; border: 1px solid #e0d9ff !important; }
  .fac-timing-table th { background: #ede9fe !important; color: #4C1D95 !important; padding: 5px 8px; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .fac-timing-table td { padding: 7px 8px; color: #1a1a2e !important; border-bottom: 1px solid #e0d9ff; }

  /* ── Criteria print table ── */
  .fac-crit-print-table { display: table !important; width: 100%; border-collapse: collapse; font-size: 12px; margin-bottom: 16px; }
  .fac-crit-print-table thead { background: #ede9fe !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .fac-crit-print-table th { text-align: left; padding: 6px 8px; border-bottom: 2px solid #4C1D95; color: #4C1D95 !important; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
  .fac-crit-print-table td { padding: 7px 8px; border-bottom: 1px solid #e0d9ff; vertical-align: top; color: #1a1a2e !important; }
  .fac-ps-cell { text-align: center; font-weight: 800; font-size: 14px; width: 48px; }
  .fac-pn-cell { white-space: pre-wrap; font-size: 11px; }
  .fac-crit-card { display: none !important; }

  .fac-crit-card, .fac-sub, .fac-stat-tile { background: #f5f3ff !important; border-color: #c4b5fd !important; }
  .fac-results { border-color: #4C1D95 !important; background: #fff !important; }
  .fac-notes-input { border: 1px solid #c4b5fd !important; background: #faf9ff !important; color: #1a1a2e !important; min-height: 0 !important; }

  /* ── Verdict block ── */
  .fac-verdict { border-width: 2px !important; }

  /* ── Page breaks ── */
  .fac-results { page-break-before: always; }
  .fac-crit-card, .t-msg, .fac-stat-tiles, .fac-sub { page-break-inside: avoid; }

  /* ── Table ── */
  .fac-cmp-table th { background: #ede9fe !important; color: #4C1D95 !important; }
  .fac-cmp-table tr:nth-child(even) td { background: #faf9ff !important; }

  /* ── Score colors must print ── */
  .fac-btn.sel-1 { background: #E05C5C !important; color: #fff !important; }
  .fac-btn.sel-2 { background: #C8873A !important; color: #fff !important; }
  .fac-btn.sel-3 { background: #7BAF62 !important; color: #fff !important; }
  .fac-btn.sel-4 { background: #5C9E6A !important; color: #fff !important; }
}

/* ─── Branding Tab ───────────────────────────────────────── */
.branding-layout {
  flex: 1; overflow-y: auto; padding: 32px 24px;
  display: flex; justify-content: center;
  scrollbar-width: thin; scrollbar-color: var(--border) transparent;
}
.branding-form {
  width: 100%; max-width: 640px;
  display: flex; flex-direction: column; gap: 32px;
}
.branding-section {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px;
  /* No overflow:hidden — use border-radius on children instead so text never clips */
}
.branding-section-head {
  padding: 14px 18px 16px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 4px;
  border-radius: 10px 10px 0 0; /* clips head background to card's top corners */
}
.branding-section-head h3 {
  font-size: 13px; font-weight: 600; color: var(--text);
}
.branding-section-head p {
  font-size: 12px; color: var(--muted); line-height: 1.4;
}
.branding-section-body {
  padding: 18px; display: flex; flex-direction: column; gap: 16px;
}
.branding-row {
  display: flex; align-items: center; gap: 14px;
}
.branding-row label {
  flex: 1; font-size: 13px; color: var(--text); min-width: 0;
}
.branding-row .brand-sub {
  font-size: 11px; color: var(--muted); margin-top: 1px;
}
.color-swatch-wrap {
  display: flex; align-items: center; gap: 8px;
}
.color-swatch {
  width: 38px; height: 38px; border-radius: 6px;
  border: 1px solid var(--border); cursor: pointer;
  overflow: hidden; position: relative; flex-shrink: 0;
}
.color-swatch input[type="color"] {
  position: absolute; inset: -4px; width: calc(100% + 8px); height: calc(100% + 8px);
  opacity: 0; cursor: pointer; border: none; padding: 0;
}
.color-hex {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px; padding: 6px 10px;
  font-size: 13px; font-family: var(--font-body, 'DM Sans'), monospace; width: 94px;
  outline: none; transition: border-color .15s;
}
.color-hex:focus { border-color: var(--accent); }
.font-select {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px; padding: 8px 10px;
  font-family: var(--font-body, 'DM Sans'), sans-serif; font-size: 13px; width: 100%;
  outline: none; transition: border-color .15s; cursor: pointer;
}
.font-select:focus { border-color: var(--accent); }
.font-preview {
  font-size: 17px; color: var(--text); line-height: 1.5;
  min-height: 32px; padding-bottom: 4px; transition: font-family .2s;
  overflow: visible;
}
.branding-actions {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 18px; border-top: 1px solid var(--border);
}
.branding-reset {
  background: none; border: 1px solid var(--border); color: var(--muted);
  border-radius: 6px; font-size: 12px; font-family: var(--font-body, 'DM Sans'), sans-serif;
  padding: 7px 14px; cursor: pointer; transition: border-color .15s, color .15s;
}
.branding-reset:hover { border-color: var(--danger); color: var(--danger); }
.branding-note {
  font-size: 12px; color: var(--muted); line-height: 1.5; padding: 0 18px 16px;
}
.branding-section-label {
  font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em;
  color: var(--muted); margin-bottom: 12px;
}
.mod-icon-row {
  display: flex; flex-direction: column; gap: 4px;
}
.mod-icon-label {
  font-size: 12px; color: var(--muted);
}
/* Emoji picker trigger button */
.emoji-trigger-btn {
  width: 60px; height: 44px; border-radius: 6px;
  background: var(--surface2); border: 1px solid var(--border);
  font-size: 22px; cursor: pointer; transition: border-color .15s;
  display: flex; align-items: center; justify-content: center;
}
.emoji-trigger-btn:hover { border-color: var(--accent); }
/* Emoji picker popover */
.emoji-popover {
  position: fixed; z-index: 9999;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.35);
  width: 296px; padding: 10px; display: none;
}
.emoji-popover.open { display: block; }
.emoji-search {
  width: 100%; box-sizing: border-box; padding: 6px 10px;
  background: var(--surface2); border: 1px solid var(--border);
  border-radius: 6px; color: var(--text); font-size: 12px;
  outline: none; margin-bottom: 8px;
}
.emoji-cats {
  display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px;
}
.emoji-cat-btn {
  padding: 3px 8px; border-radius: 4px;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); font-size: 11px; cursor: pointer; line-height: 1.4;
}
.emoji-cat-btn.active { background: var(--accent); color: #111; border-color: var(--accent); }
.emoji-grid {
  display: grid; grid-template-columns: repeat(8, 1fr);
  gap: 2px; max-height: 192px; overflow-y: auto;
}
.emoji-grid-btn {
  width: 32px; height: 32px; border: none; background: transparent;
  border-radius: 4px; font-size: 18px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .1s;
}
.emoji-grid-btn:hover { background: var(--surface2); }

/* Auto-brand card */
.auto-brand-card { border: 1px solid var(--accent); }
.new-badge {
  display: inline-flex; align-items: center;
  font-size: 9.5px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; padding: 2px 7px; border-radius: 20px;
  background: var(--accent); color: var(--ground);
  vertical-align: middle; margin-left: 7px; line-height: 1;
  animation: badge-pulse 2.8s ease-in-out infinite;
}
@keyframes badge-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent); }
  50%       { box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 0%, transparent); }
}
.auto-brand-card .branding-section-head { background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.auto-brand-card h3 { color: var(--accent); }
.brand-swatch-chip {
  display: flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 6px; padding: 4px 10px 4px 6px; font-size: 12px;
}
.brand-swatch-dot { width: 18px; height: 18px; border-radius: 4px; flex-shrink: 0; border: 1px solid var(--border); }

/* Custom font upload */
.custom-font-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.custom-font-label { font-size: 13px; color: var(--text); min-width: 90px; }
.custom-font-name  { font-size: 13px; color: var(--accent); flex: 1; font-style: italic; }
.custom-font-upload-btn {
  background: var(--surface2); border: 1px solid var(--border);
  color: var(--text); border-radius: 6px; padding: 6px 12px;
  font-size: 12px; cursor: pointer; transition: border-color .15s;
  font-family: inherit;
}
.custom-font-upload-btn:hover { border-color: var(--accent); }
.custom-font-certify {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 12px; color: var(--muted); line-height: 1.5; cursor: pointer;
}
.custom-font-certify input[type="checkbox"] { margin-top: 2px; flex-shrink: 0; accent-color: var(--accent); }
    /* ── Layout picker modal ── */
    .layout-modal { max-width: 720px; }
    .layout-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 4px; }
    .layout-card {
      border: 2px solid var(--border); border-radius: 10px; padding: 14px 12px 10px;
      cursor: pointer; transition: border-color 0.15s, background 0.15s; text-align: center;
    }
    .layout-card:hover { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
    .layout-card.selected { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, var(--surface)); }
    .layout-thumb {
      width: 100%; height: 70px; border-radius: 6px; background: var(--surface2);
      margin-bottom: 8px; display: flex; flex-direction: column; gap: 4px;
      padding: 8px; box-sizing: border-box; overflow: hidden;
    }
    .lt-bar { background: var(--border); border-radius: 3px; }
    .lt-row { display: flex; gap: 4px; flex: 1; }
    .lt-col { background: var(--border); border-radius: 3px; flex: 1; }
    .layout-name { font-size: 11px; font-weight: 600; color: var(--text); }
    .layout-desc { font-size: 10px; color: var(--muted); margin-top: 2px; line-height: 1.4; }
    .layout-trigger-btn {
      font-size: 11px; padding: 3px 10px; border-radius: 20px; border: 1px solid var(--border);
      background: none; color: var(--muted); cursor: pointer; transition: all 0.15s;
      margin-left: 8px; vertical-align: middle;
    }
    .layout-trigger-btn:hover { border-color: var(--accent); color: var(--accent); }
    .mm-source-toggle-btn.active { border-color: var(--accent); color: var(--accent); background: color-mix(in srgb, var(--accent) 10%, transparent); }
    .mm-source-editor {
      width: 100%; min-height: 200px; box-sizing: border-box;
      background: #0d1117; color: #e6edf3; border: 1px solid var(--border);
      border-radius: 0 0 6px 6px; font-family: 'Fira Code', 'Cascadia Code', Consolas, monospace;
      font-size: 12px; line-height: 1.6; padding: 12px; resize: vertical;
      tab-size: 2; -moz-tab-size: 2;
    }
    /* ── Block drag-over indicators ── */
    [data-block-id].drag-over-top { box-shadow: 0 -3px 0 var(--accent); }
    [data-block-id].drag-over-bot { box-shadow: 0 3px 0 var(--accent); }
    /* ── Snippet coaching panel ── */
    .snippet-trigger {
      position: fixed; bottom: 28px; right: 28px; z-index: 80;
      background: var(--accent); color: #fff; border: none; border-radius: 28px;
      padding: 10px 18px; font-size: 13px; font-weight: 600; cursor: pointer;
      box-shadow: 0 4px 16px rgba(0,0,0,.3); display: none; align-items: center;
      gap: 7px; transition: transform 0.15s, box-shadow 0.15s;
    }
    .snippet-trigger.visible { display: flex; }
    .snippet-trigger:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.35); }
    .snippet-panel {
      position: fixed; top: 0; right: -420px; width: 400px; height: 100vh;
      background: var(--surface); border-left: 1px solid var(--border);
      z-index: 85; overflow-y: auto; transition: right 0.3s cubic-bezier(.4,0,.2,1);
      box-shadow: -8px 0 32px rgba(0,0,0,.2);
    }
    .snippet-panel.open { right: 0; }
    .snippet-panel-head {
      display: flex; align-items: center; justify-content: space-between;
      padding: 20px 20px 16px; border-bottom: 1px solid var(--border);
      position: sticky; top: 0; background: var(--surface); z-index: 1;
    }
    .snippet-panel-head h2 { font-family: var(--font-heading, 'DM Serif Display'),Georgia,serif; font-size: 18px; font-weight: 400; margin: 0; }
    .snippet-close-btn { background: none; border: none; font-size: 20px; color: var(--muted); cursor: pointer; padding: 4px; line-height: 1; transition: color 0.15s; }
    .snippet-close-btn:hover { color: var(--text); }
    .snippet-panel-intro { padding: 12px 20px 0; font-size: 12px; color: var(--muted); line-height: 1.5; }
    .snippet-list { padding: 16px; display: flex; flex-direction: column; gap: 12px; }
    .snippet-card { border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
    .snippet-card-head { padding: 12px 14px 10px; background: var(--surface2); border-bottom: 1px solid var(--border); }
    .snippet-card-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 2px; }
    .snippet-card-desc { font-size: 11px; color: var(--muted); line-height: 1.4; }
    .snippet-preview { padding: 12px 14px; background: #fff; color: #222; border-bottom: 1px solid var(--border); min-height: 50px; font-size: 12px; }
    .snippet-actions { display: flex; gap: 8px; padding: 10px 14px; }
    .snippet-copy-btn, .snippet-insert-btn {
      flex: 1; padding: 7px 0; font-size: 12px; font-weight: 500;
      border-radius: 6px; cursor: pointer; border: 1px solid var(--border); transition: all 0.15s;
    }
    .snippet-copy-btn { background: none; color: var(--muted); }
    .snippet-copy-btn:hover { border-color: var(--text); color: var(--text); }
    .snippet-insert-btn { background: var(--accent); color: #fff; border-color: var(--accent); }
    .snippet-insert-btn:hover { opacity: .88; }
    .snippet-show-code-btn { font-size: 10px; color: var(--muted); background: none; border: none; cursor: pointer; padding: 0 14px 8px; text-decoration: underline; text-underline-offset: 2px; }
    .snippet-show-code-btn:hover { color: var(--text); }
    .snippet-code {
      padding: 10px 14px; background: var(--surface2); border-top: 1px solid var(--border);
      font-size: 10px; font-family: monospace; color: var(--muted); white-space: pre-wrap;
      word-break: break-all; display: none; max-height: 140px; overflow-y: auto;
    }
    .snippet-card.show-code .snippet-code { display: block; }


  .k-card { background:var(--surface2);border:1px solid var(--border);border-radius:8px;padding:14px 16px; }
  .k-val  { font-size:26px;font-weight:700;color:var(--text);line-height:1; }
  .k-lbl  { font-size:11px;color:var(--muted);margin-top:4px;text-transform:uppercase;letter-spacing:.04em; }
  .kappa-row-archived { opacity:0.5; }
  .cert-badge { display:inline-block;font-size:10px;font-weight:700;padding:2px 7px;border-radius:10px;background:var(--success);color:#fff;letter-spacing:.04em; }
    .skip-link {
      position: absolute; left: -9999px; top: 8px;
      padding: 8px 20px; background: var(--accent, #9B51E0);
      color: #fff; font-weight: 600; font-size: 0.875rem;
      border-radius: 6px; text-decoration: none; z-index: 9999;
    }
    .skip-link:focus { left: 16px; }
    /* WCAG Audit */
    .wcag-audit-card { border: 1px solid #6366f1; }
    .wcag-audit-card .branding-section-head { background: rgba(99,102,241,0.07); }
    .wcag-audit-card h3 { color: #6366f1; }
    .wcag-audit-btn {
      background: #6366f1; color: #fff; border: none;
      border-radius: 7px; padding: 9px 20px; font-size: 13px; font-weight: 600;
      font-family: var(--font-body, 'DM Sans'), sans-serif; cursor: pointer; transition: background .15s;
      display: flex; align-items: center; gap: 8px;
    }
    .wcag-audit-btn:hover { background: #4f46e5; }
    .wcag-audit-btn:disabled { opacity: .55; cursor: not-allowed; }
    .wcag-audit-results {
      margin: 0 18px 18px; border-radius: 8px; overflow: hidden;
      border: 1px solid var(--border);
    }
    .wcag-audit-header {
      display: flex; align-items: center; justify-content: space-between;
      padding: 10px 14px; font-size: 13px; font-weight: 600;
    }
    .wcag-audit-header.pass { background: rgba(74,222,128,.1); color: #16a34a; }
    .wcag-audit-header.warn { background: rgba(251,191,36,.1); color: #b45309; }
    .wcag-audit-header.fail { background: rgba(239,68,68,.1); color: #dc2626; }
    .wcag-pairs-table { width: 100%; border-collapse: collapse; font-size: 12px; }
    .wcag-pairs-table th {
      background: var(--surface2); padding: 6px 10px; text-align: left;
      font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em;
      color: var(--muted);
    }
    .wcag-pairs-table td { padding: 7px 10px; border-top: 1px solid var(--border); vertical-align: middle; }
    .wcag-pairs-table tr:hover td { background: var(--surface2); }
    .wcag-pill {
      display: inline-flex; align-items: center; gap: 4px;
      padding: 2px 8px; border-radius: 99px; font-size: 11px; font-weight: 600;
    }
    .wcag-pill.pass { background: rgba(74,222,128,.12); color: #16a34a; }
    .wcag-pill.fail { background: rgba(239,68,68,.12); color: #dc2626; }
    .wcag-swatch {
      width: 16px; height: 16px; border-radius: 3px;
      border: 1px solid rgba(128,128,128,.3); flex-shrink: 0; display: inline-block;
    }
    .wcag-ai-recs {
      padding: 14px 16px; border-top: 1px solid var(--border);
      font-size: 13px; line-height: 1.65; color: var(--text); white-space: pre-wrap;
    }
    .wcag-ai-recs-label {
      font-size: 11px; font-weight: 600; text-transform: uppercase;
      letter-spacing: .07em; color: #6366f1; margin-bottom: 8px;
    }

    /* ── Cohorts tab ─────────────────────────────────────── */
    .cohorts-layout { display:flex; flex:1; overflow:hidden; }
    .cohort-list-col { width:260px; min-width:220px; border-right:1px solid var(--border); display:flex; flex-direction:column; overflow-y:auto; }
    .cohort-detail-col { flex:1; overflow-y:auto; padding:24px 28px; }
    .cohort-item { padding:12px 16px; cursor:pointer; border-bottom:1px solid var(--border); }
    .cohort-item:hover { background:var(--surface2); }
    .cohort-item.active { background:var(--surface2); border-left:3px solid var(--accent); }
    .cohort-item-name { font-size:13px; font-weight:600; }
    .cohort-item-meta { font-size:11px; color:var(--muted); margin-top:3px; }
    .cohort-roster { width:100%; border-collapse:collapse; margin-top:16px; font-size:13px; }
    .cohort-roster th { text-align:left; padding:8px 10px; font-size:11px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); border-bottom:1px solid var(--border); }
    .cohort-roster td { padding:10px; border-bottom:1px solid var(--border); vertical-align:middle; }
    .cohort-roster tr:last-child td { border-bottom:none; }
    .progress-bar-wrap { background:var(--border); border-radius:4px; height:6px; width:80px; display:inline-block; vertical-align:middle; margin-right:6px; }
    .progress-bar-fill { background:var(--accent); border-radius:4px; height:6px; }
    .cert-badge { display:inline-flex; align-items:center; gap:4px; font-size:11px; padding:2px 8px; border-radius:12px; background:#1a4a2a; color:#7aba8a; }
    .notify-form { background:var(--surface); border:1px solid var(--border); border-radius:8px; padding:20px; margin-top:24px; }
    .notify-form h4 { margin:0 0 14px; font-size:13px; font-weight:600; }
    .cohort-section-title { font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.08em; color:var(--muted); margin:28px 0 10px; }
    @media(max-width:700px) { .cohorts-layout { flex-direction:column; } .cohort-list-col { width:100%; border-right:none; border-bottom:1px solid var(--border); } }
    /* Feedback tab sub-nav */
    .fb-sub-btn { width:100%; text-align:left; padding:8px 10px; border:none; border-radius:6px; cursor:pointer; font-size:13px; background:transparent; color:var(--text); }
    .fb-sub-btn:hover { background:var(--hover,rgba(107,70,193,.08)); }
    .fb-sub-btn.active { background:var(--accent); color:#fff; }
    .fb-response-card { border:1px solid var(--border); border-radius:8px; padding:14px 16px; margin-bottom:10px; }
    .fb-stars { color:#f59e0b; letter-spacing:1px; }
    .fb-answer { font-size:13px; color:var(--muted); margin-top:6px; }
    .fb-answer strong { color:var(--text); }
    .fb-q-row { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:10px 12px; border:1px solid var(--border); border-radius:6px; margin-bottom:8px; }

/* ── Media library (WordPress-style) ─────────────────────── */
.media-wrap { position: relative; padding: 20px 24px 32px; max-width: 1400px; margin: 0 auto; }
.media-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.media-toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 8px 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--surface); margin-bottom: 12px;
}
.media-select, .media-search {
  background: var(--surface2); border: 1px solid var(--border); color: var(--text);
  border-radius: 6px; padding: 5px 8px; font-size: 12px; font-family: inherit;
}
.media-search { width: 220px; max-width: 100%; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.media-empty { grid-column: 1 / -1; padding: 48px 0; text-align: center; color: var(--muted); font-size: 13px; }
.media-tile {
  position: relative; aspect-ratio: 1; padding: 0; border: 1px solid var(--border); border-radius: 4px;
  overflow: hidden; background: var(--surface2); cursor: pointer; display: block; width: 100%;
}
.media-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-tile.is-svg img { object-fit: contain; padding: 10px; }
.media-tile:hover, .media-tile:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.media-tile-badge {
  position: absolute; top: 5px; right: 5px; font-size: 10px; font-weight: 600; line-height: 1;
  padding: 3px 6px; border-radius: 10px; background: rgba(0,0,0,.72); color: #fff;
}
.media-tile-badge.unused { background: rgba(120,120,120,.85); }
.media-uploader {
  position: relative; border: 1px solid var(--border); border-radius: 8px; background: var(--surface);
  padding: 18px; margin-bottom: 14px;
}
.media-uploader-close {
  position: absolute; top: 8px; right: 10px; background: none; border: none; color: var(--muted);
  font-size: 14px; cursor: pointer;
}
.media-drop {
  border: 2px dashed var(--border); border-radius: 8px; padding: 36px 16px; text-align: center;
  transition: border-color .15s, background .15s;
}
.media-drop.over { border-color: var(--accent); background: var(--surface2); }
.media-upload-list { margin-top: 10px; display: flex; flex-direction: column; gap: 6px; }
.media-upload-row { display: grid; grid-template-columns: 1fr 140px auto; gap: 10px; align-items: center; font-size: 12px; }
.media-upload-row .name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.media-upload-bar { height: 6px; border-radius: 3px; background: var(--surface2); overflow: hidden; }
.media-upload-bar > div { height: 100%; width: 0; background: var(--accent); transition: width .15s; }
.media-upload-row .status { color: var(--muted); white-space: nowrap; }
.media-upload-row .status.ok { color: var(--success, #16a34a); }
.media-upload-row .status.err { color: var(--danger); white-space: normal; }
.media-dragcover {
  display: none; position: absolute; inset: 0; z-index: 5; border: 3px dashed var(--accent); border-radius: 10px;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  align-items: center; justify-content: center; font-size: 20px; color: var(--text); pointer-events: none;
}
.media-wrap.dragging .media-dragcover { display: flex; }
.media-dupe-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 10px 14px; border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 6px; background: var(--surface); font-size: 13px; color: var(--text); margin-bottom: 12px;
}
.media-dupe-group { border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 12px 14px; margin-bottom: 12px; }
.media-dupe-group-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; font-size: 12px; color: var(--muted); }
.media-dupe-copies { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.media-dupe-copy { border: 1px solid var(--border); border-radius: 6px; padding: 8px; font-size: 11px; color: var(--muted); cursor: pointer; }
.media-dupe-copy.keep { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.media-dupe-copy img { width: 100%; aspect-ratio: 4 / 3; object-fit: contain; background: var(--surface2); border-radius: 4px; margin-bottom: 6px; display: block; }
.media-dupe-copy .fn { color: var(--text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-detail-modal { max-width: 1100px; padding: 0; display: flex; flex-direction: column; height: min(86vh, 760px); overflow: hidden; }
.media-detail-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.media-detail-body { flex: 1; display: flex; min-height: 0; }
.media-detail-preview {
  flex: 1; min-width: 0; display: flex; align-items: center; justify-content: center; padding: 20px;
  background-color: var(--surface2);
  background-image: linear-gradient(45deg, rgba(128,128,128,.12) 25%, transparent 25%, transparent 75%, rgba(128,128,128,.12) 75%),
                    linear-gradient(45deg, rgba(128,128,128,.12) 25%, transparent 25%, transparent 75%, rgba(128,128,128,.12) 75%);
  background-size: 20px 20px; background-position: 0 0, 10px 10px;
}
.media-detail-preview img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 2px 12px rgba(0,0,0,.18); }
.media-detail-side { width: 340px; flex-shrink: 0; border-left: 1px solid var(--border); overflow-y: auto; padding: 16px 18px; font-size: 12px; }
.media-meta { color: var(--muted); line-height: 1.7; padding-bottom: 12px; margin-bottom: 14px; border-bottom: 1px solid var(--border); }
.media-meta b { color: var(--text); font-weight: 600; }
.media-field { margin-bottom: 12px; }
.media-field label { display: block; font-size: 11px; color: var(--muted); margin-bottom: 4px; }
.media-field .hint { font-size: 11px; color: var(--muted); margin-top: 3px; }
.media-saved { font-size: 11px; color: var(--success, #16a34a); margin-left: 6px; opacity: 0; transition: opacity .2s; }
.media-saved.show { opacity: 1; }
.media-used { margin: 0; padding: 0; list-style: none; }
.media-used li { padding: 4px 0; border-bottom: 1px solid var(--border); color: var(--text); }
.media-used li span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .04em; margin-right: 6px; }
@media (max-width: 760px) {
  .media-detail-body { flex-direction: column; }
  .media-detail-preview { flex: 0 0 38%; }
  .media-detail-side { width: auto; border-left: none; border-top: 1px solid var(--border); }
  .media-upload-row { grid-template-columns: 1fr 80px; }
  .media-upload-row .status { grid-column: 1 / -1; }
}

/* Media library tags */
.media-body { display: flex; gap: 16px; align-items: flex-start; }
.media-main { flex: 1; min-width: 0; }
.media-tags {
  width: 200px; flex-shrink: 0; position: sticky; top: 12px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--surface); padding: 8px 0; font-size: 12px;
}
.media-tags-head { padding: 4px 12px 6px; font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.media-tag-row {
  display: flex; align-items: center; gap: 6px; width: 100%; padding: 6px 12px; background: none; border: none;
  border-left: 3px solid transparent; color: var(--text); font: inherit; text-align: left; cursor: pointer;
}
.media-tag-row:hover { background: var(--surface2); }
.media-tag-row.active { background: var(--surface2); border-left-color: var(--accent); font-weight: 600; }
.media-tag-row .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.media-tag-row .ct { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }
.media-tag-row .acts { display: none; gap: 2px; }
.media-tag-row:hover .acts, .media-tag-row:focus-within .acts { display: inline-flex; }
.media-tag-row .acts span { padding: 0 3px; color: var(--muted); border-radius: 3px; }
.media-tag-row .acts span:hover { color: var(--text); background: var(--border); }
.media-tags-sep { height: 1px; background: var(--border); margin: 6px 0; }
.media-tag-new { padding: 6px 12px 2px; }
.media-tag-new input { width: 100%; }
.media-selbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text);
  padding: 8px 10px; border: 1px solid var(--accent); border-radius: 8px; background: var(--surface); margin-bottom: 12px;
}
.media-selbar .btn-sm:disabled { opacity: .45; cursor: default; }
.media-tile.selected { outline: 3px solid var(--accent); outline-offset: 1px; }
.media-tile-check {
  position: absolute; top: 5px; left: 5px; width: 20px; height: 20px; border-radius: 4px;
  border: 2px solid #fff; background: rgba(0,0,0,.35); color: #fff; font-size: 12px; line-height: 16px; text-align: center;
  box-shadow: 0 0 0 1px rgba(0,0,0,.3);
}
.media-tile.selected .media-tile-check { background: var(--accent); }
.media-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.media-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 4px 2px 9px; border-radius: 12px;
  background: var(--surface2); border: 1px solid var(--border); font-size: 11px; color: var(--text);
}
.media-chip button { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 0 3px; line-height: 1; }
.media-chip button:hover { color: var(--danger); }
.media-upload-tagnote { font-size: 12px; color: var(--muted); margin-top: 10px; }
@media (max-width: 860px) {
  .media-body { flex-direction: column; }
  .media-tags { width: 100%; position: static; display: flex; flex-wrap: wrap; gap: 4px; padding: 8px; }
  .media-tags-head, .media-tags-sep { display: none; }
  .media-tag-row { width: auto; border: 1px solid var(--border); border-radius: 14px; padding: 4px 10px; }
  .media-tag-row.active { border-color: var(--accent); }
  .media-tag-new { padding: 0; }
}
.media-toolbar .btn-sm.on { border-color: var(--accent); color: var(--accent); }
