/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; }

:root {
  --color-primary: #1a56db;
  --color-primary-dark: #1e429f;
  --color-bg: #f8fafc;
  --color-surface: #ffffff;
  --color-border: #e2e8f0;
  --color-text: #1e293b;
  --color-muted: #64748b;
  --color-user-bubble: #1a56db;
  --color-bot-bubble: #f1f5f9;
  --color-error: #dc2626;
  --color-success: #16a34a;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.1);
}

html { font-size: 16px; }
body {
  margin: 0;
  font-family: system-ui, -apple-system, 'Segoe UI', sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ===== Header ===== */
.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: .75rem 0;
}
.site-header .container { display: flex; align-items: center; }
.site-title { font-weight: 600; font-size: 1.1rem; color: var(--color-primary); }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  padding: 1rem 0;
  margin-top: 3rem;
  color: var(--color-muted);
  font-size: .875rem;
}
.site-footer a { color: var(--color-muted); }

/* ===== Main content ===== */
.main-content { padding: 2rem 1rem; }

/* ===== Card ===== */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}
.card-title { font-size: 1.25rem; font-weight: 600; margin: 0 0 1rem; }
.card-subtitle { color: var(--color-muted); margin-bottom: 1.5rem; font-size: .925rem; }

/* ===== Forms ===== */
.form-group { margin-bottom: 1.25rem; }
label { display: block; font-weight: 500; margin-bottom: .35rem; font-size: .925rem; }
.form-control {
  width: 100%;
  padding: .55rem .75rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color .15s;
  background: var(--color-surface);
  color: var(--color-text);
}
.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.15);
}
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { cursor: pointer; }

.form-hint { font-size: .8rem; color: var(--color-muted); margin-top: .25rem; }

.check-group { display: flex; flex-direction: column; gap: .5rem; }
.check-item { display: flex; align-items: center; gap: .5rem; cursor: pointer; }
.check-item input[type=checkbox], .check-item input[type=radio] { cursor: pointer; }

.likert-row {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
}
.likert-option {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  font-size: .8rem;
  color: var(--color-muted);
  cursor: pointer;
}
.likert-option input[type=radio] { cursor: pointer; }

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .6rem 1.25rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s, opacity .15s;
  text-decoration: none;
}
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover:not(:disabled) { background: var(--color-primary-dark); }
.btn-outline {
  background: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
}
.btn-outline:hover:not(:disabled) { background: rgba(26,86,219,.06); }
.btn-danger { background: var(--color-error); color: #fff; }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-sm { padding: .35rem .8rem; font-size: .875rem; }
.btn-block { width: 100%; justify-content: center; }

/* ===== Alerts ===== */
.alert {
  padding: .85rem 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: .925rem;
}
.alert-error { background: #fee2e2; border: 1px solid #fca5a5; color: #991b1b; }
.alert-success { background: #dcfce7; border: 1px solid #86efac; color: #166534; }
.alert-info { background: #dbeafe; border: 1px solid #93c5fd; color: #1e40af; }
.alert-warning { background: #fef9c3; border: 1px solid #fde047; color: #854d0e; }

/* ===== Step indicator ===== */
.step-bar {
  display: flex;
  gap: .5rem;
  margin-bottom: 2rem;
  align-items: center;
}
.step { display: flex; align-items: center; gap: .5rem; font-size: .85rem; color: var(--color-muted); }
.step.active { color: var(--color-primary); font-weight: 600; }
.step.done { color: var(--color-success); }
.step-dot {
  width: 24px; height: 24px;
  border-radius: 50%;
  border: 2px solid currentColor;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem; font-weight: 700;
  flex-shrink: 0;
}
.step.active .step-dot { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.step.done .step-dot { background: var(--color-success); color: #fff; border-color: var(--color-success); }
.step-connector { height: 2px; background: var(--color-border); flex: 1; min-width: 12px; }

/* ===== Case display ===== */
.case-body {
  background: #fafafa;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  font-size: .95rem;
  line-height: 1.7;
  max-height: 55vh;
  overflow-y: auto;
  margin-bottom: 1.25rem;
}

/* ===== Chat interface ===== */
.chat-layout {
  display: flex;
  flex-direction: column;
  height: calc(100vh - 190px);
  min-height: 400px;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius) var(--radius) 0 0;
}

.message {
  max-width: 78%;
  padding: .65rem 1rem;
  border-radius: 18px;
  font-size: .95rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}
/* ===== Case markdown rendering ===== */
.case-markdown-body * { margin: 0; margin-block: 0; padding: 0; }
.case-markdown-body p { margin-bottom: .6rem; }
.case-markdown-body h1, .case-markdown-body h2,
.case-markdown-body h3, .case-markdown-body h4,
.case-markdown-body ul, .case-markdown-body ol { margin-bottom: .35rem; }
.case-markdown-body *:last-child { margin-bottom: 0; }
.case-markdown-body h1 { font-weight: 700; font-size: 1.2rem; }
.case-markdown-body h2 { font-weight: 700; font-size: 1.05rem; }
.case-markdown-body h3, .case-markdown-body h4 { font-weight: 700; font-size: 1rem; }
.case-markdown-body ul, .case-markdown-body ol { padding-left: 1.25rem; }
.case-markdown-body strong { font-weight: 700; }
.case-markdown-body hr { border: none; border-top: 1px solid var(--color-border); margin: .4rem 0; }

.message.assistant { white-space: normal; }
.message.assistant p { margin: 0 0 .5rem; }
.message.assistant p:last-child { margin-bottom: 0; }
.message.assistant ul, .message.assistant ol { margin: .25rem 0 .5rem 1.25rem; padding: 0; }
.message.assistant li { margin-bottom: .2rem; }
.message.assistant strong { font-weight: 600; }
.message.assistant code { background: rgba(0,0,0,.07); border-radius: 3px; padding: .1em .35em; font-size: .88em; }
.message.assistant pre { background: rgba(0,0,0,.07); border-radius: 6px; padding: .6rem .8rem; overflow-x: auto; margin: .4rem 0; }
.message.assistant pre code { background: none; padding: 0; }
.message.user {
  background: var(--color-user-bubble);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}
.message.assistant {
  background: var(--color-bot-bubble);
  color: var(--color-text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}
.message.error { background: #fee2e2; color: #991b1b; align-self: flex-start; }
.message-time {
  font-size: .7rem;
  color: var(--color-muted);
  margin-top: .15rem;
  text-align: right;
}
.message.assistant + .message-time { text-align: left; }

.chat-input-area {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
  padding: .75rem;
}
.chat-input-row {
  display: flex;
  gap: .5rem;
  align-items: flex-end;
}
#messageInput {
  flex: 1;
  resize: none;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: .5rem .75rem;
  font-family: inherit;
  font-size: .95rem;
  min-height: 44px;
  max-height: 180px;
  overflow-y: auto;
}
#messageInput:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(26,86,219,.12);
}
.typing-indicator {
  display: none;
  color: var(--color-muted);
  font-size: .85rem;
  padding: .25rem .5rem;
  font-style: italic;
}

.submit-section {
  margin-top: .75rem;
  padding-top: .75rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: flex-end;
}

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 100;
  align-items: center;
  justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal-box {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 2rem;
  max-width: 480px;
  width: 90%;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}
.modal-title { font-size: 1.15rem; font-weight: 600; margin: 0 0 .75rem; }
.modal-body { color: var(--color-muted); margin-bottom: 1.25rem; font-size: .95rem; }
.modal-actions { display: flex; gap: .75rem; justify-content: flex-end; }

/* ===== Tables (admin) ===== */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { padding: .6rem .8rem; text-align: left; border-bottom: 1px solid var(--color-border); }
th { font-weight: 600; background: #f1f5f9; }
tr:last-child td { border-bottom: none; }
.badge {
  display: inline-block;
  padding: .15rem .5rem;
  border-radius: 9999px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-treatment { background: #dbeafe; color: #1e40af; }
.badge-control { background: #f3e8ff; color: #6b21a8; }
.badge-test { background: #fef9c3; color: #854d0e; }
.badge-submitted { background: #dcfce7; color: #166534; }
.badge-progress { background: #e0f2fe; color: #0369a1; }
.badge-consented { background: #f1f5f9; color: #475569; }

/* ===== Admin layout ===== */
.admin-body { background: #f1f5f9; }
.admin-header {
  background: #1e293b;
  padding: .75rem 0;
}
.admin-header .site-title { color: #e2e8f0; }
.admin-header .container { display: flex; align-items: center; justify-content: space-between; }
.admin-nav { display: flex; gap: 1.25rem; }
.admin-nav a { color: #94a3b8; text-decoration: none; font-size: .9rem; }
.admin-nav a:hover { color: #e2e8f0; }

/* ===== Consent ===== */
.consent-box {
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  margin-bottom: 1.25rem;
  font-size: .9rem;
  max-height: 320px;
  overflow-y: auto;
  line-height: 1.65;
}
.consent-checkbox { display: flex; align-items: flex-start; gap: .6rem; margin-bottom: 1.25rem; }
.consent-checkbox input { margin-top: .2rem; cursor: pointer; flex-shrink: 0; }

/* ===== Misc utilities ===== */
.text-muted { color: var(--color-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.gap-1 { gap: .5rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.w-full { width: 100%; }
.success-icon { font-size: 3rem; color: var(--color-success); margin-bottom: 1rem; }
hr { border: none; border-top: 1px solid var(--color-border); margin: 1.5rem 0; }
.mono { font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace; font-size: .9em; }
.text-left { text-align: left !important; }

/* ===== Icon button ===== */
.icon-btn {
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  padding: .2rem .55rem;
  border-radius: 4px;
  font-size: .8rem;
  color: var(--color-muted);
  transition: background .15s, color .15s;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.6;
}
.icon-btn:hover { background: var(--color-border); color: var(--color-text); }

/* ===== Chat layout (updated) ===== */
.chat-outer {
  display: flex;
  gap: 1rem;
  height: calc(100vh - 190px);
  min-height: 400px;
}
.chat-outer .chat-layout {
  flex: 1;
  min-width: 0;
  height: 100%;
}
.chat-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .75rem;
}
.chat-instruction-card {
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: var(--radius);
  padding: .85rem 1rem;
  font-size: .88rem;
  line-height: 1.6;
  align-self: stretch;
  flex-shrink: 0;
}
.chat-instruction-card > strong { display: block; margin-bottom: .25rem; color: #1e40af; font-size: .9rem; }
.chat-instruction-card p { margin: 0; color: #1e40af; }
.phase-progress-bar { display: flex; align-items: center; gap: .65rem; padding: .4rem 1rem; background: #eff6ff; border-bottom: 1px solid #bfdbfe; flex-shrink: 0; }
.phase-progress-label { font-size: .75rem; color: #1e40af; white-space: nowrap; }
.phase-segments { display: flex; gap: 3px; flex: 1; }
.phase-segment { flex: 1; height: 6px; border-radius: 3px; background: #bfdbfe; }
.phase-segment.filled { background: #1e40af; }

/* ===== Impression page two-column layout ===== */
.impression-outer {
  position: relative;
}
.impression-form-side {
  margin-right: 396px;
}
.impression-case-side {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 380px;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
}
.impression-case-side .case-overlay-body {
  flex: 1;
  overflow-y: auto;
}

/* ===== Case slide-over overlay ===== */
.case-overlay {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(420px, 92vw);
  background: var(--color-surface);
  border-left: 1px solid var(--color-border);
  box-shadow: -4px 0 28px rgba(0,0,0,.14);
  z-index: 50;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .25s ease;
}
.case-overlay.open { transform: translateX(0); }

.case-overlay-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.18);
  z-index: 49;
  display: none;
}
.case-overlay-backdrop.open { display: block; }

.case-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  background: #f8fafc;
}
.case-overlay-body {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

/* ===== Pinned case panel (in-flow) ===== */
.case-pinned-panel {
  display: none;
  width: 380px;
  flex-shrink: 0;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  height: 100%;
}
.case-pinned-panel.visible { display: flex; }

/* ===== Submission panel (slides up from bottom) ===== */
.submission-panel {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--color-surface);
  border-top: 2px solid var(--color-primary);
  box-shadow: 0 -4px 24px rgba(0,0,0,.12);
  z-index: 40;
  transform: translateY(100%);
  transition: transform .3s ease;
  max-height: 50vh;
  display: flex;
  flex-direction: column;
}
.submission-panel.open { transform: translateY(0); }

.submission-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .7rem 1.25rem;
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  background: #f0f7ff;
  user-select: none;
}
.submission-panel.minimized .submission-panel-header {
  cursor: pointer;
  border-bottom: none;
}
.submission-panel-body {
  padding: 1rem 1.25rem;
  overflow-y: auto;
  flex: 1;
}

/* ===== Completion certificate ===== */
.completion-cert {
  background: var(--color-surface);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.completion-cert-header {
  background: var(--color-primary);
  color: #fff;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.completion-cert-badge {
  font-size: 1.5rem;
  width: 46px;
  height: 46px;
  background: rgba(255,255,255,.2);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.completion-cert-title { font-size: 1.1rem; font-weight: 700; }
.completion-cert-subtitle { font-size: .85rem; opacity: .85; margin-top: .1rem; }
.completion-cert-rows {
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.completion-cert-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  padding: .7rem 0;
  border-bottom: 1px solid var(--color-border);
}
.completion-cert-row:last-child { border-bottom: none; padding-bottom: 0; }
.completion-cert-label {
  font-size: .85rem;
  color: var(--color-muted);
  font-weight: 500;
  min-width: 130px;
  flex-shrink: 0;
}
.completion-cert-value { font-weight: 500; text-align: right; word-break: break-all; }
.completion-cert-footer {
  background: #f8fafc;
  padding: .9rem 1.5rem;
  font-size: .82rem;
  color: var(--color-muted);
  border-top: 1px solid var(--color-border);
  line-height: 1.65;
}

/* ===== Likert Scale ===== */
.likert-item {
  padding: 1.25rem 0;
}
.likert-item--bordered {
  border-bottom: 1px solid var(--color-border);
}
.likert-question {
  margin: 0 0 .85rem;
  font-weight: 500;
  line-height: 1.5;
}
.likert-scale {
  display: flex;
  gap: .25rem;
  align-items: flex-start;
}
.likert-label {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  cursor: pointer;
  flex: 1;
  min-width: 0;
}
.likert-label input[type=radio] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.likert-circle {
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .9rem;
  font-weight: 600;
  color: var(--color-muted);
  transition: border-color .15s, background .15s, color .15s;
}
.likert-label:hover .likert-circle {
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.likert-circle.selected {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.likert-anchor {
  font-size: .68rem;
  color: var(--color-muted);
  text-align: center;
  line-height: 1.3;
}

/* ===== Public / Marketing Layout ===== */

.pub-body { background: var(--color-bg); }

/* Public header */
.pub-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 30;
}
.pub-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}
.pub-header-left {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
.pub-logo {
  display: flex;
  align-items: center;
  gap: .5rem;
  text-decoration: none;
}
.pub-logo-name {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text);
  letter-spacing: -.01em;
}
.coach-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  flex-shrink: 0;
  letter-spacing: 0;
}
.coach-mark--sm { width: 22px; height: 22px; font-size: .8rem; border-radius: 5px; }

.pub-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}
.pub-nav-link {
  color: var(--color-muted);
  text-decoration: none;
  font-size: .925rem;
  transition: color .15s;
}
.pub-nav-link:hover { color: var(--color-text); }

/* Public footer */
.pub-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding: 2rem 0;
  margin-top: 0;
}
.pub-footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
  text-align: center;
}
.pub-footer-brand {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-weight: 700;
  font-size: .95rem;
}
.pub-footer-links {
  display: flex;
  gap: 1.5rem;
  flex-wrap: wrap;
  justify-content: center;
}
.pub-footer-links a {
  color: var(--color-muted);
  text-decoration: none;
  font-size: .875rem;
}
.pub-footer-links a:hover { color: var(--color-text); }
.pub-footer-copy {
  font-size: .8rem;
  color: var(--color-muted);
  margin: 0;
}

/* ===== Hero Section ===== */
.hero {
  padding: 5rem 0 4rem;
}
.hero-inner {
  display: flex;
  align-items: center;
  gap: 4rem;
}
.hero-copy {
  flex: 1;
  min-width: 0;
}
.hero-eyebrow {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin: 0 0 .75rem;
}
.hero-headline {
  font-size: clamp(2rem, 4vw, 2.9rem);
  font-weight: 800;
  line-height: 1.15;
  margin: 0 0 1.25rem;
  letter-spacing: -.02em;
  color: var(--color-text);
}
.hero-sub {
  font-size: 1.075rem;
  color: var(--color-muted);
  line-height: 1.7;
  max-width: 520px;
  margin: 0 0 2rem;
}
.hero-cta-row {
  display: flex;
  gap: .75rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.btn-lg { padding: .75rem 1.75rem; font-size: 1.025rem; }
.hero-student-link {
  font-size: .875rem;
  color: var(--color-muted);
  margin: 0;
}
.hero-student-link a { color: var(--color-primary); text-decoration: none; }
.hero-student-link a:hover { text-decoration: underline; }

/* Hero device mockup */
.hero-visual {
  flex: 0 0 420px;
  max-width: 420px;
}
.hero-device {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  box-shadow: 0 8px 40px rgba(0,0,0,.1);
  overflow: hidden;
}
.hero-device-bar {
  height: 36px;
  background: #f1f5f9;
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  gap: 6px;
}
.hero-device-bar::before {
  content: '';
  width: 8px; height: 8px; border-radius: 50%; background: #fca5a5; display: block;
  box-shadow: 14px 0 0 #fcd34d, 28px 0 0 #86efac;
}
.hero-device-content {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .75rem;
}
.hd-bubble {
  padding: .65rem .9rem;
  border-radius: 14px;
  font-size: .85rem;
  line-height: 1.55;
}
.hd-bubble--student {
  background: var(--color-user-bubble);
  color: #fff;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
  max-width: 88%;
}
.hd-bubble--ai {
  background: var(--color-bot-bubble);
  color: var(--color-text);
  align-self: flex-start;
  border-bottom-left-radius: 4px;
  max-width: 88%;
}

/* ===== Marketing Sections ===== */
.marketing-section {
  padding: 4.5rem 0;
}
.marketing-section.bg-alt {
  background: #f1f5f9;
}
.section-header {
  text-align: center;
  margin-bottom: 3rem;
}
.section-title {
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 800;
  margin: 0 0 .75rem;
  letter-spacing: -.01em;
}
.section-sub {
  color: var(--color-muted);
  font-size: 1rem;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.65;
}
.section-cta {
  text-align: center;
  margin-top: 2.5rem;
}
.content-narrow {
  max-width: 720px;
  margin: 0 auto;
}
.content-narrow h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1rem;
}
.content-narrow p {
  color: var(--color-muted);
  line-height: 1.75;
  margin-bottom: 1rem;
}

/* ===== Problem / Solution two-col ===== */
.two-col-problem {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}
.problem-col {
  padding: 2rem;
  border-radius: 12px;
}
.problem-col--left {
  background: #fff8f8;
  border: 1px solid #fca5a5;
}
.problem-col--right {
  background: #f0fdf4;
  border: 1px solid #86efac;
}
.problem-icon {
  font-size: 2rem;
  margin-bottom: .75rem;
}
.problem-heading {
  font-size: 1.15rem;
  font-weight: 700;
  margin: 0 0 .75rem;
}
.problem-col p {
  color: var(--color-muted);
  line-height: 1.7;
  margin: 0;
  font-size: .95rem;
}

/* ===== COACH Cards ===== */
.coach-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.25rem;
}
.coach-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  padding: 1.5rem;
  transition: box-shadow .2s, transform .2s;
}
.coach-card:hover {
  box-shadow: 0 4px 20px rgba(0,0,0,.1);
  transform: translateY(-2px);
}
.coach-card-letter {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 800;
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1rem;
}
.coach-card-title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 .5rem;
}
.coach-card-body {
  color: var(--color-muted);
  font-size: .875rem;
  line-height: 1.65;
  margin: 0;
}

/* ===== How It Works Steps ===== */
.steps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 2rem;
  position: relative;
}
.step-item {
  display: flex;
  flex-direction: column;
  gap: .5rem;
}
.step-number {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.step-title {
  font-size: 1rem;
  font-weight: 700;
  margin: .25rem 0 0;
}
.step-body {
  color: var(--color-muted);
  font-size: .9rem;
  line-height: 1.65;
  margin: 0;
}

/* ===== Research note ===== */
.research-note {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 12px;
  padding: 2rem;
  max-width: 820px;
  margin: 0 auto;
}
.research-note-icon { font-size: 2rem; flex-shrink: 0; }
.research-note-body h3 { font-size: 1.05rem; font-weight: 700; margin: 0 0 .5rem; }
.research-note-body p { color: #1e40af; line-height: 1.7; margin: 0 0 .5rem; font-size: .925rem; }
.research-note-body p:last-child { margin: 0; }

/* ===== CTA Band ===== */
.cta-band {
  background: var(--color-primary);
  padding: 4rem 0;
}
.cta-band-inner {
  text-align: center;
}
.cta-band-heading {
  font-size: clamp(1.4rem, 2.5vw, 2rem);
  font-weight: 800;
  color: #fff;
  margin: 0 0 .75rem;
  letter-spacing: -.01em;
}
.cta-band-sub {
  color: rgba(255,255,255,.8);
  font-size: 1rem;
  margin: 0 0 2rem;
  line-height: 1.6;
}
.btn-white {
  background: #fff;
  color: var(--color-primary);
  font-weight: 700;
}
.btn-white:hover { background: #f0f7ff; }

/* ===== Auth cards (login / register) ===== */
.auth-card-wrap {
  min-height: calc(100vh - 120px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}
.auth-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 16px;
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
}
.auth-card--wide { max-width: 520px; }
.auth-card-logo {
  text-align: center;
  margin-bottom: 1.25rem;
}
.auth-card-title {
  font-size: 1.5rem;
  font-weight: 800;
  text-align: center;
  margin: 0 0 .35rem;
  letter-spacing: -.01em;
}
.auth-card-sub {
  color: var(--color-muted);
  text-align: center;
  margin: 0 0 1.75rem;
  font-size: .925rem;
}
.auth-switch {
  color: var(--color-muted);
  font-size: .875rem;
  text-align: center;
  margin: 0;
}
.auth-switch a { color: var(--color-primary); text-decoration: none; }
.auth-switch a:hover { text-decoration: underline; }

/* ===== Page hero (inner pages like Framework) ===== */
.page-hero {
  background: #f8fafc;
  border-bottom: 1px solid var(--color-border);
  padding: 3.5rem 0 2.5rem;
  text-align: center;
}
.page-hero-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  margin: 0 0 .75rem;
  letter-spacing: -.02em;
}
.page-hero-sub {
  color: var(--color-muted);
  font-size: 1.05rem;
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ===== Framework practice sections ===== */
.fw-practice {
  padding: 4rem 0;
}
.fw-practice.bg-alt { background: #f1f5f9; }
.fw-practice-inner {
  display: flex;
  gap: 2.5rem;
  align-items: flex-start;
}
.fw-practice-letter {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--color-primary);
  color: #fff;
  font-weight: 900;
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.fw-practice-body { flex: 1; }
.fw-practice-title {
  font-size: 1.4rem;
  font-weight: 800;
  margin: 0 0 .25rem;
  letter-spacing: -.01em;
}
.fw-practice-stage {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin: 0 0 1rem;
}
.fw-practice-body p {
  color: var(--color-muted);
  line-height: 1.75;
  margin: 0 0 .9rem;
  font-size: .95rem;
}
.fw-practice-body p:last-child { margin-bottom: 0; }
.fw-why-it-matters {
  background: #eff6ff;
  border-left: 3px solid var(--color-primary);
  padding: .75rem 1rem;
  border-radius: 0 6px 6px 0;
  font-size: .9rem;
  color: #1e40af;
  line-height: 1.6;
  margin-top: 1rem;
}

/* ===== Framework summary table ===== */
.fw-table-wrap { max-width: 900px; margin: 0 auto; }
.fw-table { font-size: .875rem; }
.fw-table th { background: #f1f5f9; white-space: nowrap; }
.fw-table td:first-child { white-space: nowrap; }

/* ===== Faculty Portal ===== */
.faculty-portal-body { background: #f1f5f9; }

.faculty-header {
  background: #1e293b;
  padding: .75rem 0;
}
.faculty-header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.faculty-portal-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.faculty-nav-link {
  color: #94a3b8;
  text-decoration: none;
  font-size: .9rem;
  transition: color .15s;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  padding: 0;
}
.faculty-nav-link:hover { color: #e2e8f0; }

/* Faculty profile dropdown */
.faculty-nav-user { position: relative; }
.faculty-nav-user-btn {
  display: flex; align-items: center; gap: .45rem;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: .9rem; padding: .3rem .6rem .3rem 1rem;
  border-left: 1px solid #334155; border-radius: 0 6px 6px 0;
  color: #94a3b8; transition: background .15s, color .15s;
}
.faculty-nav-user-btn:hover { background: #334155; color: #e2e8f0; }
.faculty-nav-initials {
  width: 26px; height: 26px; border-radius: 50%;
  background: #3b82f6; color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: .68rem; font-weight: 700; flex-shrink: 0; letter-spacing: .02em;
}
.faculty-nav-username { max-width: 140px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.faculty-nav-chevron { font-size: .72rem; transition: transform .18s; }
.faculty-nav-user-btn[aria-expanded="true"] .faculty-nav-chevron { transform: rotate(180deg); }

.faculty-nav-dropdown {
  display: none; position: absolute; right: 0; top: calc(100% + .5rem);
  min-width: 190px; background: #1e293b;
  border: 1px solid #334155; border-radius: 8px;
  box-shadow: 0 6px 20px rgba(0,0,0,.4); z-index: 300; overflow: hidden;
}
.faculty-nav-dropdown.open { display: block; }
.faculty-nav-dropdown-item {
  display: block; width: 100%; padding: .6rem 1rem;
  color: #94a3b8; text-decoration: none; font-size: .875rem;
  background: none; border: none; cursor: pointer;
  font-family: inherit; text-align: left;
  transition: background .12s, color .12s;
}
.faculty-nav-dropdown-item:hover { background: #334155; color: #e2e8f0; }
.faculty-nav-dropdown-divider { border-top: 1px solid #334155; margin: .25rem 0; }

.faculty-main { padding: 2rem 1.5rem 4rem; }
.faculty-page-header { margin-bottom: 1.5rem; }
.faculty-page-title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0;
}

/* Faculty stats grid */
.faculty-stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: .5rem;
}
.stat-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
}
.stat-label {
  font-size: .825rem;
  color: var(--color-muted);
  font-weight: 500;
}

/* Generate codes form */
.form-row-3 {
  display: grid;
  grid-template-columns: 2fr 1.5fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

/* New codes display */
.new-codes-grid {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.code-chip {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #93c5fd;
  border-radius: 6px;
  padding: .25rem .65rem;
  font-size: .9rem;
  letter-spacing: .05em;
}

/* ===== Admin faculty review cards ===== */
.faculty-review-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.faculty-review-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .6rem;
  box-shadow: var(--shadow);
}
.frc-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: .5rem;
}
.frc-name { font-weight: 700; font-size: 1.05rem; }
.frc-institution { font-size: .875rem; color: var(--color-muted); }
.frc-email { font-size: .875rem; color: var(--color-primary); text-decoration: none; }
.frc-email:hover { text-decoration: underline; }
.frc-profile-link {
  font-size: .875rem;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}
.frc-profile-link:hover { text-decoration: underline; }
.frc-date { font-size: .8rem; }
.frc-actions {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .25rem;
}
.deny-details summary::-webkit-details-marker { display: none; }
.deny-form {
  margin-top: .65rem;
  padding: .85rem;
  background: #fff8f8;
  border: 1px solid #fca5a5;
  border-radius: var(--radius);
  width: 100%;
}

/* ===== Pending page ===== */
.pending-card { text-align: left; }
.pending-icon { font-size: 2.5rem; text-align: center; margin-bottom: 1rem; }
.pending-lead {
  font-size: 1.05rem;
  color: var(--color-muted);
  text-align: center;
  margin: 0 0 1.75rem;
}
.pending-steps {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}
.pending-step {
  display: flex;
  align-items: flex-start;
  gap: .85rem;
  padding: 1rem;
  background: #f8fafc;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}
.pending-step-icon { font-size: 1.35rem; flex-shrink: 0; line-height: 1; }
.pending-step-body strong { display: block; margin-bottom: .25rem; font-size: .95rem; }
.pending-step-body p { margin: 0; color: var(--color-muted); font-size: .875rem; line-height: 1.6; }
.pending-step-body a { color: var(--color-primary); }

/* ===== Section cards (dashboard overview) ===== */
.sections-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.section-card {
  display: block;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-decoration: none;
  color: var(--color-text);
  transition: box-shadow .15s, border-color .15s;
}
.section-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,.09);
  border-color: var(--color-primary);
}
.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .35rem;
}
.section-card-name { font-weight: 700; font-size: 1rem; }
.section-card-arrow { color: var(--color-primary); font-size: 1.1rem; }
.section-card-assignment {
  font-size: .825rem;
  color: var(--color-muted);
  margin-bottom: .75rem;
}
.section-card-stats {
  display: flex;
  gap: 1.25rem;
  font-size: .85rem;
  color: var(--color-muted);
  margin-bottom: .65rem;
}
.section-card-bar-wrap {
  height: 5px;
  background: var(--color-border);
  border-radius: 3px;
  overflow: hidden;
}
.section-card-bar {
  height: 100%;
  background: var(--color-primary);
  border-radius: 3px;
  transition: width .3s;
}

/* ===== Section detail view ===== */
.faculty-section-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: .5rem;
}
.faculty-section-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
}
.gen-codes-summary {
  cursor: pointer;
  font-weight: 600;
  font-size: .95rem;
  padding: .5rem 0;
  color: var(--color-primary);
  list-style: none;
}
.gen-codes-summary::-webkit-details-marker { display: none; }
.gen-codes-summary::before { content: '▸ '; }
details[open] .gen-codes-summary::before { content: '▾ '; }
.gen-codes-body { padding-top: 1rem; }

/* ===== Two-column form row ===== */
.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .hero-inner { flex-direction: column; gap: 2.5rem; }
  .hero-visual { flex: none; max-width: 100%; width: 100%; }
  .two-col-problem { grid-template-columns: 1fr; }
  .fw-practice-inner { flex-direction: column; }
  .faculty-stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row-3 { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .hero { padding: 3rem 0 2rem; }
  .pub-nav .pub-nav-link { display: none; }
  .coach-cards { grid-template-columns: 1fr; }
  .steps-grid { grid-template-columns: 1fr; }
  .faculty-stats-grid { grid-template-columns: 1fr; }
}

/* ===== Print styles ===== */
@media print {
  .site-header, .site-footer, .no-print, .btn { display: none !important; }
  body { background: #fff; }
  .main-content { padding: 0; }
  .container { max-width: 100%; }
  .completion-cert { border: 2px solid #000; box-shadow: none; }
  .completion-cert-header {
    background: #1a56db !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* ===== Logo image ===== */
.site-logo-img {
  height: 68px;
  width: auto;
  display: block;
  object-fit: contain;
}
.site-logo-img--sm {
  height: 32px;
}
.site-logo-img--header {
  height: 48px;
  filter: brightness(0) invert(1);   /* white logo on dark headers */
}
.admin-logo-link {
  display: flex;
  align-items: center;
  text-decoration: none;
}

/* ===== Workstream D: Python Data Module workbench tabs & REPL ===== */

/* Workbench tab bar */
.workbench-header { padding: 0 !important; }
.workbench-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid rgba(255,255,255,.2);
  padding: .5rem .75rem 0;
}
.workbench-tab-btn {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: rgba(255,255,255,.7);
  cursor: pointer;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .02em;
  padding: .35rem .75rem .4rem;
  transition: color .15s, border-color .15s;
}
.workbench-tab-btn:hover { color: #fff; }
.workbench-tab-btn.active {
  border-bottom-color: #fff;
  color: #fff;
}

/* Workbench panel content area */
.workbench-body { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.workbench-panel-content {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  font-size: .875rem;
}
.workbench-instructions { line-height: 1.65; }

/* Dataset schema table */
.ds-schema {
  border-collapse: collapse;
  font-size: .8rem;
  width: 100%;
  margin: .75rem 0;
}
.ds-schema th, .ds-schema td {
  border: 1px solid #e2e8f0;
  padding: .3rem .5rem;
  text-align: left;
}
.ds-schema th { background: #f1f5f9; font-weight: 600; }
.ds-schema code { font-size: .75rem; }
.ds-desc  { font-weight: 600; margin-bottom: .25rem; }
.ds-rows  { color: #64748b; margin-bottom: .25rem; }
.ds-summary { color: #64748b; font-size: .8rem; }

/* Pyodide loading state */
.pyodide-loading-state {
  padding: 1.5rem 1rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .75rem;
}
.pyodide-progress-bar-track {
  width: 100%;
  height: 6px;
  background: #e2e8f0;
  border-radius: 9999px;
  overflow: hidden;
}
.pyodide-progress-bar-fill {
  height: 100%;
  background: #1a56db;
  border-radius: 9999px;
  transition: width .4s ease;
}

/* REPL layout */
.repl-wrap {
  display: flex;
  flex-direction: column;
  height: 100%;
  gap: 0;
}
.repl-output-area {
  flex: 1;
  overflow-y: auto;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .8rem;
  padding: .5rem;
  background: #0f172a;
  color: #e2e8f0;
  border-radius: 6px 6px 0 0;
  min-height: 120px;
}
.repl-input-row {
  display: flex;
  align-items: flex-start;
  gap: .5rem;
  padding: .5rem;
  border-top: 1px solid #334155;
  background: #1e293b;
  border-radius: 0 0 6px 6px;
}
.repl-prompt {
  color: #94a3b8;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .8rem;
  padding-top: .35rem;
  user-select: none;
  flex-shrink: 0;
}
.repl-input {
  flex: 1;
  background: transparent;
  border: none;
  color: #e2e8f0;
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: .8rem;
  resize: none;
  outline: none;
  line-height: 1.5;
  min-height: 1.5rem;
}
.repl-actions {
  padding: .5rem;
  border-top: 1px solid #e2e8f0;
}

/* Cell display */
.repl-cell { margin-bottom: .5rem; }
.repl-cell-input {
  color: #93c5fd;
  white-space: pre-wrap;
  word-break: break-word;
  margin-bottom: .2rem;
}
.repl-cell-output {
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
}
.repl-error { color: #f87171; }
.repl-plot {
  max-width: 100%;
  border-radius: 4px;
  margin-top: .4rem;
  display: block;
}
.repl-banner {
  background: #1e3a5f;
  border-left: 3px solid #3b82f6;
  color: #93c5fd;
  font-size: .78rem;
  padding: .4rem .75rem;
  margin-bottom: .75rem;
  border-radius: 0 4px 4px 0;
}

/* Fix panel height inside pinned layout for python-data */
.case-pinned .case-pinned-panel .workbench-body {
  height: calc(100% - 2.5rem);
}
.case-pinned .case-pinned-panel #panel-console {
  padding: .5rem;
  display: flex;
  flex-direction: column;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Workstream E — MC Assessment Stage
   ═══════════════════════════════════════════════════════════════════════════ */

/* Locked chat notice */
.mc-chat-locked-notice {
  padding: .65rem 1rem;
  background: var(--color-info-bg, #eff6ff);
  border-top: 1px solid var(--color-info-border, #bfdbfe);
  color: var(--color-info-text, #1e40af);
  font-size: .875rem;
  text-align: center;
}

/* MC panel fills the right side exactly like workbench */
.mc-question-panel {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

.mc-question-list {
  flex: 1;
  overflow-y: auto;
  padding: .75rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

/* Individual question card */
.mc-question {
  background: var(--card-bg, #fff);
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 8px;
  padding: 1rem 1.125rem;
}

.mc-tier-label {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted, #6b7280);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-bottom: .35rem;
}

.mc-console-badge {
  display: inline-block;
  font-size: .7rem;
  font-weight: 600;
  background: #f0fdf4;
  color: #166534;
  border: 1px solid #bbf7d0;
  border-radius: 4px;
  padding: .1rem .4rem;
  margin-bottom: .5rem;
}

.mc-stem {
  font-size: .9rem;
  line-height: 1.55;
  margin-bottom: .75rem;
}
.mc-stem p { margin: 0 0 .4em; }
.mc-stem code {
  background: var(--code-bg, #f3f4f6);
  border-radius: 3px;
  padding: .1em .35em;
  font-size: .85em;
}

/* Option rows */
.mc-option-list {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.mc-option {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .55rem .75rem;
  border: 1px solid var(--border-color, #e5e7eb);
  border-radius: 6px;
  cursor: pointer;
  transition: background .1s, border-color .1s;
  line-height: 1.45;
}

.mc-option:hover {
  background: var(--surface-hover, #f9fafb);
  border-color: var(--color-primary, #1a56db);
}

.mc-option.mc-option-selected {
  background: #eff6ff;
  border-color: #1a56db;
}

.mc-option input[type="radio"] {
  margin-top: .2rem;
  flex-shrink: 0;
  accent-color: #1a56db;
}

.mc-option-text {
  font-size: .875rem;
}
.mc-option-text p  { margin: 0; }
.mc-option-text code {
  background: var(--code-bg, #f3f4f6);
  border-radius: 3px;
  padding: .1em .35em;
  font-size: .85em;
}

/* Submit area */
.mc-submit-area {
  flex-shrink: 0;
  padding: .875rem 1rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
  background: var(--card-bg, #fff);
}

.btn-block { width: 100%; }

.mc-status-msg {
  font-size: .875rem;
  margin-bottom: .5rem;
  padding: .4rem .65rem;
  border-radius: 5px;
}
.mc-status-ok    { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; }
.mc-status-error { background: #fef2f2; color: #991b1b; border: 1px solid #fecaca; }

/* ═══════════════════════════════════════════════════════════════════════════
   C# Workbench shell — Workstream J
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Shell: file-explorer (left) + main (right) ────────────────────────── */
#csWorkbenchPanel.case-pinned-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cs-shell {
  display: flex;
  flex: 1 1 auto;
  overflow: hidden;
  height: 100%;
}

/* ── File Explorer ─────────────────────────────────────────────────────── */
.cs-explorer {
  width: 180px;
  min-width: 120px;
  max-width: 260px;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border-color, #e5e7eb);
  background: #f8fafc;
  overflow: hidden;
  flex-shrink: 0;
}

.cs-explorer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .4rem .65rem;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  background: #f1f5f9;
}

.cs-explorer-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .08em;
  color: #64748b;
  text-transform: uppercase;
}

.cs-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.05rem;
  line-height: 1;
  color: #475569;
  padding: .1rem .3rem;
  border-radius: 3px;
}
.cs-icon-btn:hover { background: #e2e8f0; }

.cs-file-tree {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: .25rem 0;
}

.cs-file-row {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .65rem;
  cursor: pointer;
  font-size: .82rem;
  color: #334155;
  position: relative;
  user-select: none;
}
.cs-file-row:hover { background: #e2e8f0; }
.cs-file-row.active { background: #dbeafe; color: #1e40af; }

.cs-file-icon { font-size: .85rem; flex-shrink: 0; }

.cs-file-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-file-del-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .7rem;
  color: #94a3b8;
  padding: 0 .2rem;
  line-height: 1;
  flex-shrink: 0;
}
.cs-file-del-btn:hover { color: #ef4444; }
.cs-file-row:hover .cs-file-del-btn { display: block; }

.cs-file-readonly {
  font-size: .7rem;
  flex-shrink: 0;
  color: #94a3b8;
  margin-left: auto;
}

.cs-rename-input {
  flex: 1 1 auto;
  font-size: .82rem;
  border: 1px solid #3b82f6;
  border-radius: 3px;
  padding: 1px 4px;
  outline: none;
}

.cs-loading-hint, .cs-empty-hint {
  font-size: .8rem;
  color: #94a3b8;
  padding: .5rem .75rem;
  margin: 0;
}

/* ── Main: tabs + Monaco + bottom panel ────────────────────────────────── */
.cs-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
}

/* ── Tabs bar ───────────────────────────────────────────────────────────── */
.cs-tabs-bar {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  background: #f1f5f9;
  flex-shrink: 0;
  overflow: hidden;
}

.cs-tab-list {
  display: flex;
  flex: 1 1 auto;
  overflow-x: auto;
  scrollbar-width: none;
}
.cs-tab-list::-webkit-scrollbar { display: none; }

.cs-tab {
  display: flex;
  align-items: center;
  gap: .25rem;
  padding: .35rem .7rem;
  font-size: .8rem;
  color: #475569;
  border-right: 1px solid var(--border-color, #e5e7eb);
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 60px;
  max-width: 140px;
}
.cs-tab:hover { background: #e2e8f0; }
.cs-tab.active { background: #fff; color: #1e40af; border-bottom: 2px solid #3b82f6; }

.cs-tab-name {
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1 1 auto;
}
.cs-tab-dot { color: #3b82f6; font-size: .65rem; flex-shrink: 0; }
.cs-tab-close {
  background: none; border: none; cursor: pointer; font-size: .65rem;
  color: #94a3b8; padding: 0; line-height: 1; flex-shrink: 0;
}
.cs-tab-close:hover { color: #ef4444; }

/* ── Toolbar (Run / Stop / Test buttons) ───────────────────────────────── */
.cs-toolbar {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .5rem;
  flex-shrink: 0;
  border-left: 1px solid var(--border-color, #e5e7eb);
}

.cs-toolbar-btn {
  font-size: .78rem;
  padding: .25rem .55rem;
  border-radius: 4px;
  border: 1px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  font-weight: 500;
  line-height: 1.4;
}
.cs-run-btn  { background: #22c55e; color: #fff; border-color: #16a34a; }
.cs-run-btn:hover:not(:disabled) { background: #16a34a; }
.cs-stop-btn { background: #ef4444; color: #fff; border-color: #dc2626; }
.cs-stop-btn:hover { background: #dc2626; }
.cs-test-btn { background: #6366f1; color: #fff; border-color: #4f46e5; }
.cs-test-btn:hover:not(:disabled) { background: #4f46e5; }
.cs-toolbar-btn:disabled { opacity: .5; cursor: not-allowed; }

/* ── Monaco editor container ────────────────────────────────────────────── */
.cs-editor-container {
  flex: 1 1 auto;
  overflow: hidden;
  position: relative;
  min-height: 0;
  background: #fff;
}

.cs-editor-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #94a3b8;
  font-size: .875rem;
}

.cs-runner-banner {
  position: absolute;
  top: 0; left: 0; right: 0;
  z-index: 10;
  background: #fef9c3;
  color: #854d0e;
  border-bottom: 1px solid #fde68a;
  font-size: .78rem;
  padding: .35rem .75rem;
}

/* ── Resizer ────────────────────────────────────────────────────────────── */
.cs-resizer {
  height: 5px;
  cursor: row-resize;
  background: var(--border-color, #e5e7eb);
  flex-shrink: 0;
  transition: background .15s;
}
.cs-resizer:hover { background: #3b82f6; }

/* ── Bottom panel ───────────────────────────────────────────────────────── */
.cs-bottom-panel {
  display: flex;
  flex-direction: column;
  height: 200px;
  min-height: 80px;
  border-top: none;
  background: #fff;
  overflow: hidden;
  flex-shrink: 0;
}

.cs-bottom-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  background: #f8fafc;
  flex-shrink: 0;
}

.cs-bottom-tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: .35rem .75rem;
  font-size: .78rem;
  cursor: pointer;
  color: #64748b;
  white-space: nowrap;
}
.cs-bottom-tab-btn:hover { color: #1e293b; background: #e2e8f0; }
.cs-bottom-tab-btn.active {
  color: #1e40af;
  border-bottom-color: #3b82f6;
  background: #fff;
}

.cs-badge {
  display: inline-block;
  background: #ef4444;
  color: #fff;
  font-size: .65rem;
  min-width: 1.1em;
  padding: 0 .2em;
  border-radius: 9px;
  text-align: center;
  margin-left: .2rem;
  vertical-align: middle;
}

.cs-bottom-content {
  flex: 1 1 auto;
  overflow-y: auto;
  overflow-x: hidden;
  display: none;
  flex-direction: column;
}
.cs-bottom-content.active { display: flex; }
.cs-bottom-content:not([hidden]) { display: flex; }

/* ── Console ────────────────────────────────────────────────────────────── */
#cs-panel-console {
  display: flex;
  flex-direction: column;
}

.cs-console-output {
  flex: 1 1 auto;
  overflow-y: auto;
  font-family: 'Cascadia Code', 'Fira Code', 'Consolas', monospace;
  font-size: .78rem;
  line-height: 1.5;
  padding: .4rem .6rem;
  white-space: pre-wrap;
  word-break: break-all;
  background: #0f172a;
  color: #e2e8f0;
}

.cs-console-stdout { color: #e2e8f0; }
.cs-console-stderr { color: #f87171; }

.cs-console-input-row {
  display: flex;
  align-items: center;
  gap: .3rem;
  padding: .3rem .5rem;
  border-top: 1px solid #1e293b;
  background: #0f172a;
  flex-shrink: 0;
}

.cs-console-prompt {
  color: #94a3b8;
  font-family: monospace;
  font-size: .85rem;
  flex-shrink: 0;
}

#csStdinInput {
  flex: 1 1 auto;
  background: transparent;
  border: none;
  outline: none;
  color: #e2e8f0;
  font-family: 'Cascadia Code', monospace;
  font-size: .78rem;
  caret-color: #60a5fa;
}
#csStdinInput::placeholder { color: #475569; }

.cs-stdin-send {
  background: none;
  border: 1px solid #334155;
  color: #94a3b8;
  border-radius: 3px;
  padding: .1rem .35rem;
  font-size: .75rem;
  cursor: pointer;
  flex-shrink: 0;
}
.cs-stdin-send:hover { border-color: #60a5fa; color: #60a5fa; }

/* ── Test Results ───────────────────────────────────────────────────────── */
.cs-test-summary {
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  background: #f8fafc;
  font-size: .82rem;
  flex-shrink: 0;
}

.cs-test-count { font-weight: 600; }
.cs-test-count.pass { color: #166534; }
.cs-test-count.fail { color: #991b1b; }
.cs-test-loading { color: #6366f1; }
.cs-test-error   { color: #991b1b; }

.cs-test-list { flex: 1 1 auto; overflow-y: auto; }

.cs-test-row {
  display: flex;
  align-items: flex-start;
  gap: .45rem;
  padding: .4rem .75rem;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  font-size: .8rem;
}
.cs-test-row.pass { background: #f0fdf4; }
.cs-test-row.fail { background: #fef2f2; }

.cs-test-icon {
  font-size: .85rem;
  flex-shrink: 0;
  margin-top: .05rem;
}
.cs-test-row.pass .cs-test-icon { color: #16a34a; }
.cs-test-row.fail .cs-test-icon { color: #dc2626; }

.cs-test-info {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  overflow: hidden;
}

.cs-test-name {
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cs-test-msg {
  color: #6b7280;
  font-size: .76rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.cs-test-dur {
  font-size: .72rem;
  color: #94a3b8;
  flex-shrink: 0;
  white-space: nowrap;
  align-self: center;
}

.cs-test-footer {
  padding: .5rem .75rem;
  border-top: 1px solid var(--border-color, #e5e7eb);
  background: #f8fafc;
  flex-shrink: 0;
}

/* ── Problems ───────────────────────────────────────────────────────────── */
.cs-problems-list { overflow-y: auto; }

.cs-problem-row {
  display: flex;
  align-items: baseline;
  gap: .45rem;
  padding: .35rem .75rem;
  border-bottom: 1px solid var(--border-color, #e5e7eb);
  font-size: .79rem;
  cursor: pointer;
}
.cs-problem-row:hover { background: #f1f5f9; }

.cs-problem-icon { flex-shrink: 0; }
.cs-problem-msg  { flex: 1 1 auto; color: #334155; word-break: break-word; }
.cs-problem-loc  { font-size: .72rem; color: #94a3b8; white-space: nowrap; flex-shrink: 0; }
