/* ===========================================================
   Source Analyser design system
   Palette: deep blue #2977B5, mid blue #3A8FD4, light blue #5AAEE0,
   pale blue #E8F2FA, soft blue border #C0D8F0
   =========================================================== */

:root {
  --blue-deep: #2977B5;
  --blue-mid: #3A8FD4;
  --blue-light: #5AAEE0;
  --blue-pale: #E8F2FA;
  --blue-border: #C0D8F0;

  --ink: #1F2A37;
  --ink-muted: #5B6B7C;
  --ink-faint: #8898A8;
  --white: #FFFFFF;

  --green-bg: #E4F5EA;
  --green-text: #1F7A4D;
  --purple-bg: #EFE7FA;
  --purple-text: #6A3FB5;
  --amber-bg: #FCEFD8;
  --amber-text: #9C6A12;
  --amber-border: #F0D9A8;
  --red-text: #C24545;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-card: 0 1px 2px rgba(41, 119, 181, 0.06), 0 1px 8px rgba(41, 119, 181, 0.06);
  --shadow-modal: 0 12px 40px rgba(20, 50, 80, 0.25);
  --container-w: 1180px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: #F4F8FC;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0; font-weight: 700; color: var(--ink); }
p { margin: 0 0 0.6em; }
a { color: var(--blue-deep); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; }

.container {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- header ---------- */
.site-header {
  background: var(--blue-deep);
  color: var(--white);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 64px;
  flex-wrap: wrap;
  padding-top: 10px;
  padding-bottom: 10px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 700;
  font-size: 18px;
  letter-spacing: 0.2px;
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand__mark {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  background: rgba(255,255,255,0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.brand__sub {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.75);
  margin-left: 2px;
}
.header-nav {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}
.header-nav a {
  color: rgba(255,255,255,0.85);
  font-size: 14px;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
}
.header-nav a:hover { background: rgba(255,255,255,0.12); text-decoration: none; }
.header-nav a.is-active { background: rgba(255,255,255,0.18); color: var(--white); }

.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 14px;
}
.viewer-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: rgba(255,255,255,0.8);
}
.viewer-switch select {
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--white);
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
}
.viewer-switch select option { color: var(--ink); }

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--blue-mid);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  font-weight: 700;
  flex-shrink: 0;
}
.avatar--lg { width: 48px; height: 48px; font-size: 16px; }

/* ---------- page header band (title + meta under header) ---------- */
.page-band {
  background: var(--white);
  border-bottom: 1px solid var(--blue-border);
  padding: 18px 0;
}
.page-band .container {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.page-band h1 { font-size: 20px; }
.page-band__meta { color: var(--ink-muted); font-size: 13px; }

/* ---------- tabs ---------- */
.tabs {
  background: var(--white);
  border-bottom: 1px solid var(--blue-border);
}
.tabs .container {
  display: flex;
  gap: 4px;
  overflow-x: auto;
}
.tab {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 13px 4px;
  margin-right: 26px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-muted);
  border-bottom: 2.5px solid transparent;
  cursor: pointer;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
  white-space: nowrap;
}
.tab:hover { color: var(--blue-deep); }
.tab.is-active {
  color: var(--blue-deep);
  border-bottom-color: var(--blue-deep);
}
.tab-panel { display: none; }
.tab-panel.is-active { display: block; }

/* ---------- main layout ---------- */
.main {
  padding: 26px 0 60px;
}
.section-gap { margin-bottom: 22px; }

/* ---------- stat cards ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stat-card {
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-card);
}
.stat-card__icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  background: var(--blue-pale);
  color: var(--blue-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.stat-card__value { font-size: 24px; font-weight: 700; line-height: 1.1; }
.stat-card__label { font-size: 12.5px; color: var(--ink-muted); }

/* ---------- panels ---------- */
.panel {
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card);
}
.panel__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--blue-border);
}
.panel__title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14.5px;
  font-weight: 700;
}
.panel__title .icon { color: var(--blue-deep); }
.panel__body { padding: 16px 18px; }
.panel__foot {
  padding: 12px 18px;
  border-top: 1px solid var(--blue-border);
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

/* ---------- engagement list ---------- */
.engagement-row {
  display: grid;
  grid-template-columns: 110px 1fr 38px;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.engagement-row .name { font-size: 13.5px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.engagement-row .pct { font-size: 13px; font-weight: 700; text-align: right; color: var(--ink); }
.progress-track {
  height: 8px;
  background: var(--blue-pale);
  border-radius: 99px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--blue-light);
}
.progress-fill.is-top { background: var(--blue-mid); }
.progress-fill.is-low { background: var(--blue-light); opacity: 0.85; }

/* ---------- activity list ---------- */
.activity-row {
  display: flex;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--blue-border);
}
.activity-row:last-child { border-bottom: none; }
.activity-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--blue-light);
  margin-top: 6px;
  flex-shrink: 0;
}
.activity-main { flex: 1; min-width: 0; }
.activity-main .who { font-size: 13.5px; font-weight: 700; }
.activity-main .what { font-size: 12.5px; color: var(--ink-muted); }
.activity-row .badge { flex-shrink: 0; align-self: center; }
.activity-row button.link-btn { align-self: center; }

/* ---------- badges ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
}
.badge--single { background: var(--blue-pale); color: var(--blue-deep); }
.badge--compare { background: var(--green-bg); color: var(--green-text); }
.badge--howfar { background: var(--purple-bg); color: var(--purple-text); }
.badge--pending { background: var(--amber-bg); color: var(--amber-text); }
.badge--reviewed { background: var(--green-bg); color: var(--green-text); }
.badge--muted { background: #EEF2F6; color: var(--ink-muted); }

/* ---------- support / alert cards ---------- */
.support-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.support-card {
  background: var(--amber-bg);
  border: 1px solid var(--amber-border);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.support-card .name { font-weight: 700; font-size: 14px; }
.support-card .meta { font-size: 12px; color: var(--ink-muted); margin-top: 2px; }
.support-card .pct-tag {
  background: var(--white);
  border: 1px solid var(--amber-border);
  color: var(--amber-text);
  font-size: 12px;
  font-weight: 700;
  padding: 3px 9px;
  border-radius: 99px;
  white-space: nowrap;
}
.empty-note {
  color: var(--ink-muted);
  font-size: 13.5px;
  padding: 6px 2px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 9px 15px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--blue-border);
  background: var(--white);
  color: var(--ink);
  cursor: pointer;
  line-height: 1;
  white-space: nowrap;
}
.btn:hover { background: var(--blue-pale); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn--primary {
  background: var(--blue-deep);
  border-color: var(--blue-deep);
  color: var(--white);
}
.btn--primary:hover { background: #235f93; }
.btn--ghost { border-color: transparent; background: transparent; }
.btn--ghost:hover { background: var(--blue-pale); }
.btn--sm { padding: 6px 11px; font-size: 12.5px; }
.btn--danger { color: var(--red-text); }
.btn-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

/* ---------- question type group ---------- */
.qtype-group {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.qtype-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--blue-border);
  background: var(--white);
  color: var(--ink-muted);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
}
.qtype-btn:hover { background: var(--blue-pale); }
.qtype-btn.is-active {
  background: var(--blue-pale);
  border-color: var(--blue-deep);
  color: var(--blue-deep);
}
.qtype-btn .icon { flex-shrink: 0; }

/* ---------- forms ---------- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-field { display: flex; flex-direction: column; gap: 6px; }
.form-field--full { grid-column: 1 / -1; }
.form-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}
.form-label__tag {
  font-size: 10px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  padding: 1px 6px;
  border-radius: 99px;
  background: #EEF2F6;
  color: var(--ink-faint);
}
.form-label__req { color: var(--red-text); font-weight: 700; }
.input, .select, .textarea {
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  width: 100%;
}
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--blue-deep);
  box-shadow: 0 0 0 3px rgba(41,119,181,0.12);
}
.textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
.field-error {
  font-size: 12px;
  color: var(--red-text);
  display: none;
  font-weight: 600;
}
.form-field.has-error .input,
.form-field.has-error .textarea,
.form-field.has-error .select { border-color: var(--red-text); }
.form-field.has-error .field-error { display: block; }

/* ---------- answer panel ---------- */
.answer-card {
  background: var(--blue-pale);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.answer-card__head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}
.answer-card__head .label {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 14px;
}
.answer-meta-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 10px;
  flex-wrap: wrap;
  gap: 10px;
}
.word-count { font-size: 12.5px; color: var(--ink-muted); }

.writing-guide {
  display: none;
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  margin-bottom: 12px;
  font-size: 13.5px;
}
.writing-guide.is-open { display: block; }
.writing-guide ul { margin: 6px 0 0; padding-left: 20px; }
.writing-guide li { margin-bottom: 4px; }

.feedback-box {
  margin-top: 14px;
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  font-size: 13.5px;
}
.feedback-box h4 { font-size: 13px; margin-bottom: 6px; }
.feedback-box ul { margin: 0 0 10px; padding-left: 18px; }
.feedback-box li { margin-bottom: 4px; }
.feedback-box .tag-good { color: var(--green-text); font-weight: 700; }
.feedback-box .tag-tip { color: var(--amber-text); font-weight: 700; }

/* ---------- source library ---------- */
.source-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
}
.source-card {
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-md);
  padding: 15px 17px;
  box-shadow: var(--shadow-card);
}
.source-card__head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}
.source-card__title { font-size: 14.5px; font-weight: 700; margin-bottom: 3px; }
.source-card__context { font-size: 12.5px; color: var(--ink-muted); margin-bottom: 8px; }
.source-card__text {
  font-size: 12.5px;
  color: var(--ink-muted);
  background: var(--blue-pale);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  max-height: 70px;
  overflow: hidden;
  margin-bottom: 10px;
}
.source-card__foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--ink-faint);
}
.source-card__actions { display: flex; gap: 6px; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
}
table.data-table th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  font-weight: 700;
  padding: 10px 12px;
  border-bottom: 1px solid var(--blue-border);
  white-space: nowrap;
}
table.data-table td {
  padding: 11px 12px;
  border-bottom: 1px solid #EDF3FA;
  vertical-align: top;
}
table.data-table tbody tr:hover { background: var(--blue-pale); }
.cell-strong { font-weight: 700; }
.cell-muted { color: var(--ink-muted); font-size: 12.5px; }
.link-btn {
  background: none;
  border: none;
  color: var(--blue-deep);
  font-weight: 600;
  font-size: 12.5px;
  cursor: pointer;
  padding: 0;
}
.link-btn:hover { text-decoration: underline; }

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 14px;
  align-items: center;
}
.filter-bar .select, .filter-bar .input { width: auto; min-width: 150px; }
.filter-bar .input--search { min-width: 200px; }

/* ---------- students grid ---------- */
.student-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}
.student-card {
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-md);
  padding: 15px 16px;
  box-shadow: var(--shadow-card);
}
.student-card__top { display: flex; gap: 12px; align-items: center; margin-bottom: 10px; }
.student-card__name { font-weight: 700; font-size: 14.5px; }
.student-card__year { font-size: 12px; color: var(--ink-muted); }
.student-card__stats { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-muted); margin-top: 10px; }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(20, 40, 60, 0.45);
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 100;
}
.modal-overlay.is-open { display: flex; }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal);
  width: 100%;
  max-width: 640px;
  margin: auto;
}
.modal--wide { max-width: 760px; }
.modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid var(--blue-border);
}
.modal__header h3 { font-size: 16px; }
.modal__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-muted);
  padding: 4px;
}
.modal__body { padding: 20px; max-height: 70vh; overflow-y: auto; }
.modal__footer {
  padding: 14px 20px;
  border-top: 1px solid var(--blue-border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
.modal-source-block {
  background: var(--blue-pale);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13.5px;
  margin-bottom: 12px;
}
.modal-source-block .src-title { font-weight: 700; margin-bottom: 2px; }
.modal-source-block .src-context { color: var(--ink-muted); font-size: 12.5px; margin-bottom: 8px; }

/* ---------- footer ---------- */
.site-footer {
  background: var(--blue-deep);
  color: rgba(255,255,255,0.85);
  font-size: 12.5px;
  padding: 14px 0;
}
.site-footer .container {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}
.site-footer a { color: var(--white); }

/* ---------- landing page ---------- */
.hero {
  background: linear-gradient(180deg, var(--blue-deep) 0%, #2670a8 100%);
  color: var(--white);
  padding: 64px 0 76px;
}
.hero .container { max-width: 880px; text-align: center; }
.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.14);
  padding: 6px 14px;
  border-radius: 99px;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 18px;
}
.hero h1 { font-size: 36px; line-height: 1.25; margin-bottom: 14px; }
.hero p.lead { font-size: 16.5px; color: rgba(255,255,255,0.88); max-width: 620px; margin: 0 auto 28px; }
.hero .btn-row { justify-content: center; }
.hero .btn--primary { background: var(--white); color: var(--blue-deep); border-color: var(--white); font-size: 14.5px; padding: 11px 20px; }
.hero .btn--primary:hover { background: var(--blue-pale); }
.hero .btn--outline-light { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.5); font-size: 14.5px; padding: 11px 20px; }
.hero .btn--outline-light:hover { background: rgba(255,255,255,0.12); }

.section { padding: 56px 0; }
.section h2 { font-size: 24px; text-align: center; margin-bottom: 8px; }
.section .section-lead { text-align: center; color: var(--ink-muted); max-width: 600px; margin: 0 auto 36px; }

.feature-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}
.feature-card {
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-md);
  padding: 22px 20px;
  box-shadow: var(--shadow-card);
}
.feature-card__icon {
  width: 42px; height: 42px;
  border-radius: var(--radius-sm);
  background: var(--blue-pale);
  color: var(--blue-deep);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 14px;
}
.feature-card h3 { font-size: 15.5px; margin-bottom: 6px; }
.feature-card p { font-size: 13.5px; color: var(--ink-muted); margin: 0; }

.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  counter-reset: step;
}
.step {
  background: var(--blue-pale);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-md);
  padding: 20px;
  position: relative;
}
.step__num {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--blue-deep);
  color: var(--white);
  display: flex; align-items: center; justify-content: center;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 12px;
}
.step h3 { font-size: 14.5px; margin-bottom: 6px; }
.step p { font-size: 13px; color: var(--ink-muted); margin: 0; }

.cta-band {
  background: var(--blue-pale);
  border-top: 1px solid var(--blue-border);
  border-bottom: 1px solid var(--blue-border);
  padding: 44px 0;
  text-align: center;
}
.cta-band h2 { font-size: 22px; margin-bottom: 10px; }
.cta-band p { color: var(--ink-muted); margin-bottom: 22px; }

.pitch-note {
  max-width: 720px;
  margin: 0 auto;
  background: var(--white);
  border: 1px solid var(--blue-border);
  border-radius: var(--radius-md);
  padding: 18px 22px;
  font-size: 13.5px;
  color: var(--ink-muted);
}
.pitch-note strong { color: var(--ink); }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  background: var(--ink);
  color: var(--white);
  padding: 11px 18px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  box-shadow: var(--shadow-modal);
  opacity: 0;
  transition: opacity 0.2s, transform 0.2s;
  pointer-events: none;
  z-index: 200;
}
.toast.is-shown { opacity: 1; transform: translateX(-50%) translateY(0); }

.icon { display: inline-flex; }
.icon svg { display: block; }

.skeleton-msg { color: var(--ink-muted); font-size: 13.5px; padding: 30px 0; text-align: center; }

/* ---------- responsive ---------- */
@media (max-width: 920px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .two-col { grid-template-columns: 1fr; }
  .support-grid { grid-template-columns: 1fr; }
  .source-grid { grid-template-columns: 1fr; }
  .feature-grid { grid-template-columns: 1fr; }
  .steps { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 28px; }
}
@media (max-width: 600px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
  .header-nav { order: 3; width: 100%; }
  .header-right { margin-left: 0; }
  .engagement-row { grid-template-columns: 96px 1fr 34px; }
  .engagement-row .name { white-space: normal; font-size: 12.5px; line-height: 1.25; }
}

/* ============================================================
   Additions for the shared/online rebuild (auth, images,
   questions, source types, student practice modes)
   ============================================================ */

/* ---------- header user chip ---------- */
.user-chip { display: flex; align-items: center; gap: 10px; }
.user-chip__meta { line-height: 1.15; text-align: right; }
.user-chip__name { font-size: 13px; font-weight: 700; color: var(--white); }
.user-chip__role { font-size: 11px; color: rgba(255,255,255,0.8); }
.site-header .user-chip .btn { color: var(--white); border-color: rgba(255,255,255,0.5); }
.site-header .user-chip .btn:hover { background: rgba(255,255,255,0.14); }
.btn--block { width: 100%; justify-content: center; }

/* ---------- login page ---------- */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(160deg, var(--blue-pale), #ffffff 60%); padding: 20px;
}
.login-card {
  width: 100%; max-width: 380px; background: var(--white);
  border: 1px solid var(--blue-border); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-modal); padding: 30px 28px;
}
.login-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: var(--blue-deep); }
.login-brand .brand__mark { width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center; background: var(--blue-pale); border-radius: 8px; color: var(--blue-deep); }
.login-sub { color: var(--ink-muted); font-size: 13px; margin: 6px 0 20px; }
.login-error { color: var(--red-text); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }

/* ---------- images ---------- */
.source-card__thumb {
  width: 100%; max-height: 160px; object-fit: cover; border-radius: var(--radius-sm);
  border: 1px solid var(--blue-border); margin-bottom: 10px;
}
.modal-source-img {
  display: block; max-width: 100%; max-height: 340px; border-radius: var(--radius-sm);
  border: 1px solid var(--blue-border); margin: 8px 0;
}
.image-field { display: flex; flex-direction: column; gap: 10px; }
.file-input { font-size: 13px; }
.image-preview img { max-width: 220px; max-height: 180px; border-radius: var(--radius-sm); border: 1px solid var(--blue-border); display: block; margin-bottom: 8px; }

/* ---------- check list (question -> sources) ---------- */
.check-list {
  border: 1px solid var(--blue-border); border-radius: var(--radius-sm);
  max-height: 220px; overflow-y: auto; padding: 6px;
}
.check-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: var(--radius-sm); font-size: 13.5px; cursor: pointer; }
.check-item:hover { background: var(--blue-pale); }
.check-item input { width: 16px; height: 16px; }

/* ---------- source types editor ---------- */
.type-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.type-row .input { flex: 1; }

/* ---------- student practice mode switch ---------- */
.mode-switch { display: inline-flex; border: 1px solid var(--blue-border); border-radius: var(--radius-md); overflow: hidden; background: var(--white); }
.mode-btn { border: none; background: transparent; padding: 9px 18px; font-size: 13.5px; font-weight: 600; color: var(--ink-muted); cursor: pointer; }
.mode-btn.is-active { background: var(--blue-deep); color: var(--white); }
