/* ═══════════════════════════════════════════════════════════
   style.css — MHE Smart Grading Demo (v2)
   Light mode · Inter font · MHE visual language
   No dark backgrounds · No emoji · No AI branding in UI
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Inter+Tight:wght@600&display=swap');

/* ─── DESIGN TOKENS ──────────────────────────────────────── */
:root {
  --bg:           #FFF8F0; /* Cream */
  --surface:      #ffffff;
  --surface-2:    #FCE4D4; /* Peach Light */
  --border:       #E6D5C3; /* Cream Border */
  --border-light: #f3f4f6;
  --text:         #333333; /* Text Dark */
  --text-muted:   #666666; /* Arrow Gray */
  --text-dim:     #999999; /* Arrow Light */
  --blue:         #E8732A; /* Orange (used for primary actions/highlights) */
  --blue-hover:   #D4691F; /* Orange Dark */
  --blue-light:   #FFF8F0; /* Cream */
  --blue-border:  #E6D5C3; /* Cream Border */
  --green:        #057a55; /* Retained strictly for score semantics */
  --green-bg:     #f0fdf4;
  --green-border: #bbf7d0;
  --amber:        #b45309; /* Retained strictly for score semantics */
  --amber-bg:     #fffbeb;
  --amber-border: #fde68a;
  --red:          #B5485D; /* Maroon (used for flags/errors) */
  --red-bg:       #fff5f5;
  --red-border:   #9E3C50; /* Maroon Dark */
  --font:         'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius:       8px;
  --radius-sm:    4px;
  --radius-lg:    12px;
  --shadow:       0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.08), 0 1px 4px rgba(0,0,0,0.04);
}

/* ─── RESET & BASE ────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 14px; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ─── LAYOUT ──────────────────────────────────────────────── */
.app-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-logo {
  width: 28px;
  height: 28px;
  background: var(--blue);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 13px;
  letter-spacing: -0.5px;
  flex-shrink: 0;
}

.header-title { font-weight: 600; font-size: 14px; color: var(--text); }
.header-sub   { font-size: 12px; color: var(--text-muted); margin-top: 1px; }

.view-toggle {
  display: flex;
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px;
  gap: 2px;
}

.view-btn {
  padding: 5px 14px;
  border: none;
  border-radius: 4px;
  background: transparent;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}

.view-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.10);
}

.view-btn:hover:not(.active) { color: var(--text); }

/* ─── MAIN CONTENT AREA ──────────────────────────────────── */

/* --- APP BODY (sidebar + content) ---------------------- */
.app-body {
  display: flex;
  min-height: calc(100vh - 52px);
  align-items: flex-start;
}

/* --- COURSE NAV SIDEBAR -------------------------------- */
.course-nav {
  width: 220px;
  min-width: 220px;
  flex-shrink: 0;
  background: var(--surface);
  border-right: 1px solid var(--border);
  position: sticky;
  top: 52px;
  height: calc(100vh - 52px);
  overflow-y: auto;
  padding-bottom: 24px;
}

.cn-header {
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}

.cn-label {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-dim);
  margin-bottom: 3px;
}

.cn-course {
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
}

.cn-unit { margin-bottom: 2px; }

.cn-unit-hdr {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 9px 14px;
  cursor: default;
  gap: 6px;
}

.cn-unit-title {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  line-height: 1.4;
}

.cn-chevron {
  font-size: 14px;
  color: var(--blue);
  flex-shrink: 0;
}

.cn-lock {
  font-size: 11px;
  opacity: 0.4;
  flex-shrink: 0;
}

.cn-items { padding: 0 0 6px; }

.cn-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 26px;
  font-size: 12px;
  color: var(--text-muted);
  cursor: default;
  line-height: 1.4;
  transition: background 0.1s;
}

.cn-icon {
  font-size: 10px;
  width: 12px;
  text-align: center;
  flex-shrink: 0;
}

.cn-item.done { color: var(--text-dim); }
.cn-item.done .cn-icon { color: var(--green); }

.cn-item.current {
  background: var(--blue-light);
  color: var(--blue);
  font-weight: 600;
  border-left: 3px solid var(--blue);
  padding-left: 23px;
}
.cn-item.current .cn-icon { color: var(--blue); }

.cn-item.upcoming { opacity: 0.5; }

.cn-unit.locked .cn-unit-hdr { opacity: 0.45; }

/* Content area fills remaining space */
.content-area {
  flex: 1;
  min-width: 0;
}

.main-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 28px 24px 60px;
}

/* ─── CARDS ─────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}

.card-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.3;
}

.card-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 3px;
}

.section-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

/* ─── BREADCRUMB ─────────────────────────────────────────── */
.breadcrumb {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.breadcrumb a { color: var(--text-muted); }
.breadcrumb a:hover { color: var(--blue); }
.breadcrumb span { color: var(--text-dim); }

/* ─── ASSIGNMENT SCREEN ──────────────────────────────────── */
.assignment-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}

.assignment-meta {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.assignment-meta span { display: flex; align-items: center; gap: 4px; }

.reading-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: var(--blue-light);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius);
  color: var(--blue);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  margin-bottom: 20px;
}

.reading-link:hover {
  background: #dbeafe;
  text-decoration: none;
}

.question-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: 16px 18px;
  margin-bottom: 24px;
  font-size: 14px;
  line-height: 1.65;
  color: var(--text);
}

/* Answer selector */
.answer-selector {
  margin-bottom: 16px;
}

.answer-selector-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 10px;
}

.answer-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.ans-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}

.ans-btn:hover { border-color: var(--blue); color: var(--blue); }

.ans-btn.active {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

/* Textarea */
.answer-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.answer-label-text {
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}

.word-count {
  font-size: 12px;
  color: var(--text-dim);
}

textarea {
  width: 100%;
  min-height: 140px;
  resize: vertical;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  background: var(--surface);
  transition: border-color 0.15s;
  outline: none;
}

textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26,86,219,0.08); }

.submit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
}

.attempt-info {
  font-size: 12px;
  color: var(--text-muted);
}

.btn-primary {
  padding: 9px 22px;
  background: var(--blue);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover { background: var(--blue-hover); }
.btn-primary:disabled { opacity: 0.55; cursor: not-allowed; }

/* Loading state */
.loading-state {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.spinner {
  width: 16px;
  height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── FEEDBACK SCREEN ────────────────────────────────────── */
.submission-header {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.score-block {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 24px;
  padding: 20px;
  background: var(--blue-light);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius);
}

.score-number {
  font-size: 36px;
  font-weight: 600;
  color: var(--blue);
  line-height: 1;
  font-family: 'Inter Tight', var(--font);
}

.score-max {
  font-size: 16px;
  color: var(--text-muted);
  font-weight: 500;
}

.score-criteria { flex: 1; display: flex; flex-direction: column; gap: 8px; }

.criterion-row { display: flex; flex-direction: column; gap: 4px; }

.criterion-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12px;
}

.criterion-name { color: var(--text-muted); }

.criterion-pts {
  font-weight: 600;
  font-size: 12px;
}

.bar-track {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.6s ease-out;
  width: 0;
}

.bar-fill.green  { background: var(--green); }
.bar-fill.amber  { background: var(--amber); }
.bar-fill.red    { background: var(--red); }

/* Feedback text */
.feedback-section { margin-top: 4px; }

.feedback-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-light);
}

.feedback-body {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
  white-space: pre-wrap;
}

.feedback-body em { font-style: italic; color: var(--amber); }

.study-ref {
  margin-top: 20px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.5;
}

.study-ref strong { color: var(--text); }

.retry-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--text-muted);
}

.btn-outline {
  padding: 7px 16px;
  background: var(--surface);
  color: var(--blue);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-outline:hover { background: var(--blue-light); }

/* ─── INSTRUCTOR VIEW ────────────────────────────────────── */
.queue-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 8px;
}

.queue-stats {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.stat-item { display: flex; align-items: center; gap: 5px; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

thead th {
  text-align: left;
  padding: 10px 14px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}

tbody tr {
  border-bottom: 1px solid var(--border-light);
  cursor: pointer;
  transition: background 0.1s;
}

tbody tr:hover { background: var(--blue-light); }
tbody tr:last-child { border-bottom: none; }

td {
  padding: 12px 14px;
  vertical-align: middle;
}

.td-name { font-weight: 500; color: var(--text); }

.td-score {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.td-status { font-size: 12px; }

.status-approve { color: var(--text-muted); }
.status-review  { color: var(--amber); }
.status-flag    { color: var(--red); }

.quality-line { font-size: 11px; margin-top: 2px; }
.quality-ok   { color: var(--text-dim); }
.quality-flag  { color: var(--amber); }

.class-insight {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  color: var(--text-muted);
}

/* Individual submission */
.student-answer-block {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 20px;
  white-space: pre-wrap;
}

.scoring-basis { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }

.crit-block {
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.crit-block:last-child { border-bottom: none; padding-bottom: 0; }

.crit-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.crit-name { font-weight: 500; font-size: 13px; }
.crit-score { font-weight: 600; font-size: 13px; }
.crit-score.full   { color: var(--green); }
.crit-score.partial{ color: var(--amber); }
.crit-score.low    { color: var(--red); }

.crit-detail { font-size: 12px; color: var(--text-muted); line-height: 1.6; }
.crit-detail dt { font-weight: 500; color: var(--text); margin-top: 6px; }
.crit-detail dd { margin-left: 0; }

.source-line {
  margin-top: 10px;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 12px;
  color: var(--text-muted);
}

.quality-check-line {
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 16px;
  padding: 8px 0;
  border-top: 1px solid var(--border-light);
  border-bottom: 1px solid var(--border-light);
}

.quality-check-line.flagged { color: var(--amber); }

.override-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.override-row input {
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.override-row input:focus { border-color: var(--blue); }
.override-row input[type="number"] { width: 80px; flex-shrink: 0; }
.override-row input[type="text"]  { flex: 1; }

.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: space-between;
}

.action-group { display: flex; gap: 8px; }

.btn-text {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 13px;
  font-family: var(--font);
  cursor: pointer;
  padding: 6px 2px;
  transition: color 0.15s;
}

.btn-text:hover { color: var(--text); }

.btn-approve {
  padding: 7px 18px;
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  transition: all 0.15s;
}

.btn-approve:hover { background: #dcfce7; }
.btn-approve.approved {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
  cursor: default;
}

.reveal-link {
  font-size: 12px;
  color: var(--text-dim);
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font);
  padding: 0;
  transition: color 0.15s;
  display: block;
  margin-top: 16px;
  text-align: right;
}

.reveal-link:hover { color: var(--text-muted); }

/* ─── REVEAL PANEL ───────────────────────────────────────── */
.reveal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}

.reveal-overlay.open { pointer-events: all; }

.reveal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17,24,39,0.25);
  opacity: 0;
  transition: opacity 0.25s;
}

.reveal-overlay.open .reveal-backdrop { opacity: 1; }

.reveal-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 420px;
  max-width: 95vw;
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: -4px 0 24px rgba(0,0,0,0.10);
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.reveal-overlay.open .reveal-panel { transform: translateX(0); }

.reveal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  flex-shrink: 0;
}

.reveal-title { font-size: 14px; font-weight: 600; color: var(--text); }
.reveal-subtitle { font-size: 11px; color: var(--text-dim); margin-top: 2px; }

.reveal-close {
  width: 28px;
  height: 28px;
  border: none;
  background: var(--border-light);
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 16px;
  transition: background 0.15s;
}

.reveal-close:hover { background: var(--border); }

.reveal-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  flex-shrink: 0;
  overflow-x: auto;
}

.reveal-tab {
  padding: 11px 16px;
  border: none;
  background: transparent;
  font-size: 12px;
  font-weight: 500;
  font-family: var(--font);
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  white-space: nowrap;
}

.reveal-tab:hover { color: var(--text); }
.reveal-tab.active { color: var(--blue); border-bottom-color: var(--blue); }

.reveal-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* Reveal content components */
.reveal-section { margin-bottom: 20px; }

.reveal-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border-light);
}

.constraint-box {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-muted);
  font-style: italic;
  margin-bottom: 16px;
}

.passage-item {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 12px;
  line-height: 1.6;
}

.passage-ref {
  font-weight: 500;
  color: var(--text);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.passage-criterion {
  font-size: 11px;
  padding: 2px 8px;
  background: var(--blue-light);
  color: var(--blue);
  border-radius: 10px;
  font-weight: 500;
}

.passage-text { color: var(--text-muted); }

/* Scoring decisions tab */
.decision-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 10px;
  overflow: hidden;
}

.decision-card-header {
  padding: 10px 14px;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  gap: 8px;
}

.decision-card-header:hover { background: var(--border-light); }

.decision-card-name { font-size: 13px; font-weight: 500; }
.decision-card-score { font-size: 13px; font-weight: 600; }
.decision-card-score.full   { color: var(--green); }
.decision-card-score.partial{ color: var(--amber); }
.decision-card-score.low    { color: var(--red); }

.decision-card-body {
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.65;
  display: none;
}

.decision-card-body.open { display: block; }

.decision-row { margin-bottom: 8px; }
.decision-row dt { font-weight: 500; color: var(--text); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; margin-bottom: 2px; }
.decision-row dd { color: var(--text-muted); font-size: 12px; }

.decision-quote { font-style: italic; color: var(--amber); }
.decision-finding { color: var(--text); }
.decision-why { color: var(--blue); margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border-light); }

/* Authority tab steps */
.authority-steps { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }

.step-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.step-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue-light);
  color: var(--blue);
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.step-text { font-size: 12px; line-height: 1.6; color: var(--text-muted); }
.step-text strong { color: var(--text); }

.trigger-list {
  font-size: 12px;
  color: var(--text-muted);
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.trigger-list li::before { content: '·  '; color: var(--text-dim); }

/* Quality report tab */
.eval-table {
  width: 100%;
  font-size: 12px;
  border-collapse: collapse;
  margin-bottom: 16px;
}

.eval-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--text-dim);
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
}

.eval-table td { padding: 7px 0; border-bottom: 1px solid var(--border-light); vertical-align: top; }
.eval-table td:last-child { text-align: right; }

.pass-badge  { color: var(--green); font-weight: 600; }
.fail-badge  { color: var(--red);   font-weight: 600; }
.warn-badge  { color: var(--amber); font-weight: 600; }

.hi-block {
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 12px;
}

.hi-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  padding: 3px 0;
}

.hi-label { color: var(--text-muted); }
.hi-value { font-weight: 500; color: var(--text); }

.hi-score-row {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  font-weight: 600;
}

.hi-low    { color: var(--green); }
.hi-medium { color: var(--amber); }
.hi-high   { color: var(--red); }

.eval-note {
  font-size: 11px;
  color: var(--text-dim);
  font-style: italic;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-top: 12px;
}

/* ─── PDF OVERLAY ────────────────────────────────────────── */
.pdf-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(17,24,39,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.pdf-panel {
  background: var(--surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pdf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.pdf-title  { font-size: 14px; font-weight: 600; }
.pdf-sub    { font-size: 12px; color: var(--text-muted); }

.pdf-body {
  overflow-y: auto;
  padding: 24px 28px;
  flex: 1;
}

/* Text version of reading (for when PDF isn't available) */
.reading-passage {
  margin-bottom: 24px;
}

.reading-passage-meta {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.reading-passage-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.reading-passage-text {
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
}

/* ─── UTILITY ────────────────────────────────────────────── */
.hidden { display: none !important; }

.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 500;
}

.badge-green { background: var(--green-bg); color: var(--green); border: 1px solid var(--green-border); }
.badge-amber { background: var(--amber-bg); color: var(--amber); border: 1px solid var(--amber-border); }
.badge-blue  { background: var(--blue-light); color: var(--blue); border: 1px solid var(--blue-border); }

.text-muted { color: var(--text-muted); }
.text-sm    { font-size: 12px; }
.mt-8       { margin-top: 8px; }
.mt-16      { margin-top: 16px; }
.mt-20      { margin-top: 20px; }

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media (max-width: 600px) {
  .header-inner { padding: 0 16px; }
  .main-content { padding: 20px 16px 48px; }
  .reveal-panel { width: 100%; }
  .score-block  { flex-direction: column; gap: 16px; }
}
