/* ============================================================
   MGS Computer Science Portal — "Blackboard & Chalk" Theme
   ============================================================ */

:root {
  /* Core palette */
  --bg-deep: #121a24;
  --bg-base: #1a2332;
  --bg-raised: #222e3e;
  --bg-surface: #2a3a4e;

  /* Warm card surfaces */
  --card-bg: #faf8f5;
  --card-border: #e8e2d9;
  --card-hover: #f5f1eb;

  /* Accent colours */
  --accent: #e07a5f;
  --accent-hover: #c9664b;
  --accent-glow: rgba(224, 122, 95, 0.2);
  --teal: #3d8b7a;
  --teal-hover: #327264;
  --teal-soft: rgba(61, 139, 122, 0.15);
  --gold: #d4a574;
  --gold-soft: rgba(212, 165, 116, 0.15);

  /* Semantic */
  --success: #3d8b7a;
  --success-bg: #e6f5f0;
  --success-text: #1a5c4c;
  --warning: #d4a574;
  --warning-bg: #fef5e7;
  --warning-text: #8a6530;
  --error: #c9524a;
  --error-bg: #fdecea;
  --error-text: #8a2e28;
  --info: #5b8ec9;
  --info-bg: #e8f0fa;
  --info-text: #2c5a8a;

  /* Text */
  --text-light: #f0ece6;
  --text-muted-light: #9ca8b8;
  --text-dark: #2c3440;
  --text-muted-dark: #7a8494;

  /* Typography */
  --font-display: 'Fraunces', 'Georgia', serif;
  --font-body: 'Outfit', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(18, 26, 36, 0.08), 0 1px 2px rgba(18, 26, 36, 0.04);
  --shadow-md: 0 4px 12px rgba(18, 26, 36, 0.08), 0 2px 4px rgba(18, 26, 36, 0.04);
  --shadow-lg: 0 12px 32px rgba(18, 26, 36, 0.12), 0 4px 8px rgba(18, 26, 36, 0.06);
  --shadow-accent: 0 4px 16px rgba(224, 122, 95, 0.25);

  /* Radii */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Transitions */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ===== Reset & Base ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.65;
  color: var(--text-dark);
  background: #f2efe9;
  padding-top: 4rem;
  -webkit-font-smoothing: antialiased;
}

/* Subtle grain texture overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.03;
  z-index: 9999;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
}

/* ===== Layout ===== */
.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 2rem 1.25rem;
}

/* ===== Navbar ===== */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  height: 3.5rem;
  background: var(--bg-deep);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.nav-brand {
  color: var(--text-light);
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  opacity: 0.9;
  transition: opacity 0.2s var(--ease-out);
}
.nav-brand:hover { opacity: 1; }

.nav-centre {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.nav-user {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted-light);
  letter-spacing: 0.02em;
}

/* ===== Typography ===== */
h1 {
  font-family: var(--font-display);
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 1rem;
}

h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: -0.02em;
  margin: 2rem 0 0.75rem;
}

h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  margin: 1rem 0 0.5rem;
}

.muted {
  color: var(--text-muted-dark);
  font-size: 0.8rem;
}

.meta {
  color: var(--text-muted-dark);
  font-size: 0.85rem;
  font-family: var(--font-mono);
  letter-spacing: 0.01em;
  margin-bottom: 1rem;
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  padding: 0.5rem 1.125rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
  color: var(--text-dark);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out), background-color 0.15s var(--ease-out);
  box-shadow: var(--shadow-sm);
}
.btn:hover {
  background: var(--card-hover);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.btn:active {
  transform: translateY(0);
  box-shadow: var(--shadow-sm);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
  box-shadow: var(--shadow-sm), 0 2px 8px rgba(224, 122, 95, 0.2);
}
.btn-primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  box-shadow: var(--shadow-md), var(--shadow-accent);
}

.btn-danger {
  background: var(--error);
  color: #fff;
  border-color: var(--error);
}
.btn-danger:hover {
  background: #b3443d;
  border-color: #b3443d;
}

.btn-sm {
  padding: 0.3rem 0.75rem;
  font-size: 0.78rem;
}
.btn-fixed {
  display: inline-block;
  min-width: 5.5em;
  text-align: center;
}

.btn-nav {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-light);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  font-size: 0.78rem;
  font-weight: 500;
}
.btn-nav:hover {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: none;
  transform: none;
}

/* ===== Forms ===== */
.form, .login-form { max-width: 420px; }

label {
  display: block;
  font-weight: 600;
  font-size: 0.85rem;
  margin: 1rem 0 0.35rem;
  color: var(--text-dark);
}

input[type="text"], input[type="password"], input[type="number"], input[type="date"],
select, textarea {
  width: 100%;
  padding: 0.55rem 0.875rem;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-family: var(--font-body);
  background: #fff;
  color: var(--text-dark);
  transition: border-color 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.full-width { width: 100%; }
.form-actions { margin-top: 1.75rem; }
.form-group { margin-bottom: 1rem; }
.hint { font-size: 0.78rem; color: var(--text-muted-dark); margin-top: 0.25rem; }

/* ===== Login ===== */
.login-container {
  max-width: 380px;
  margin: 4rem auto;
  text-align: center;
}

.login-container h1 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.login-form { text-align: left; }
.login-form .btn { width: 100%; margin-top: 1.25rem; padding: 0.65rem; }

.login-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 1.5rem;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--card-border);
}

.tab {
  flex: 1;
  padding: 0.6rem;
  text-align: center;
  text-decoration: none;
  color: var(--text-muted-dark);
  font-weight: 500;
  font-size: 0.88rem;
  background: var(--card-bg);
  transition: color 0.2s var(--ease-out), background-color 0.2s var(--ease-out);
}
.tab:hover { background: var(--card-hover); }
.tab.active {
  color: #fff;
  background: var(--bg-base);
  font-weight: 600;
}

/* ===== Alerts ===== */
.alert {
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 0.85rem;
  font-weight: 500;
}

.alert-error {
  background: var(--error-bg);
  color: var(--error-text);
  border: 1px solid rgba(201, 82, 74, 0.2);
}

/* ===== Cards ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s var(--ease-out);
  position: relative;
  overflow: hidden;
}
.card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, var(--accent), var(--teal));
  border-radius: var(--radius-lg) 0 0 var(--radius-lg);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
}

.card h2 {
  margin: 0 0 0.25rem;
  font-size: 1.1rem;
  padding-left: 0.5rem;
}
.card h2 a {
  color: inherit;
  text-decoration: none;
  transition: color 0.15s var(--ease-out);
}
.card h2 a:hover { color: var(--accent); }

.stats {
  display: flex;
  gap: 0.625rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 0.5rem;
  font-size: 0.8rem;
  padding-left: 0.5rem;
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.15rem 0.55rem;
  border-radius: 50px;
  font-size: 0.7rem;
  font-weight: 600;
  font-family: var(--font-mono);
  letter-spacing: 0.02em;
  background: #e8e5df;
  color: var(--text-dark);
}

.badge-success { background: var(--success-bg); color: var(--success-text); }
.badge-warning { background: var(--warning-bg); color: var(--warning-text); }
.badge-error   { background: var(--error-bg);   color: var(--error-text); }
.badge-info    { background: var(--info-bg);    color: var(--info-text); }
.badge-default { background: #ece9e3; color: var(--text-muted-dark); }

/* ===== Tables ===== */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0.5rem 0;
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--card-border);
}

.table th, .table td {
  padding: 0.6rem 0.875rem;
  text-align: left;
  font-size: 0.85rem;
}
.table th {
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted-dark);
  background: rgba(0, 0, 0, 0.02);
  border-bottom: 2px solid var(--card-border);
}
.table td {
  border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: rgba(0, 0, 0, 0.015); }

/* ===== Worksheet ===== */
.question-block {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow-sm);
}

.worksheet-context {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-base);
  color: var(--text-light);
  border-radius: var(--radius-md);
  border-left: 4px solid var(--gold);
}
.worksheet-context h2 {
  margin-top: 0;
  font-size: 1.1rem;
  color: var(--text-light);
  border: none;
  padding: 0;
}
.worksheet-context p { margin: 0.5rem 0; font-size: 0.9rem; }
.worksheet-context blockquote {
  border-left: 3px solid var(--gold);
  padding: 0.5rem 1rem;
  margin: 0.75rem 0;
  background: rgba(255, 255, 255, 0.06);
  border-radius: var(--radius-sm);
  font-style: italic;
}

.question-context {
  margin-bottom: 0.75rem;
  font-size: 0.88rem;
  color: var(--text-muted-dark);
  padding: 0.625rem 0.875rem;
  background: rgba(0, 0, 0, 0.02);
  border-radius: var(--radius-sm);
}
.question-context blockquote {
  border-left: 3px solid var(--teal);
  padding: 0.5rem 1rem;
  margin: 0.5rem 0;
  background: var(--teal-soft);
  border-radius: var(--radius-sm);
  font-style: italic;
}

.question-text { margin-bottom: 0.75rem; line-height: 1.6; }
.question-text strong { color: var(--accent); font-weight: 700; }

.marks {
  color: var(--teal);
  font-weight: 700;
  font-size: 0.8rem;
  font-family: var(--font-mono);
}

.sub-part {
  margin: 0.875rem 0;
  padding-left: 1.25rem;
  border-left: 2px solid rgba(0, 0, 0, 0.06);
}

.answer-input {
  margin-top: 0.35rem;
  resize: vertical;
  font-family: var(--font-body);
}

.table-input { width: 100%; min-width: 80px; }

.worksheet-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0.5rem 0;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.worksheet-table th, .worksheet-table td {
  padding: 0.5rem 0.625rem;
  font-size: 0.88rem;
}
.worksheet-table th {
  background: rgba(0, 0, 0, 0.03);
  font-weight: 600;
  border-bottom: 2px solid var(--card-border);
}
.worksheet-table td { border-bottom: 1px solid rgba(0, 0, 0, 0.04); }
.worksheet-table tr:last-child td { border-bottom: none; }

.labelled-field { margin: 0.625rem 0; }
.labelled-field label { display: inline; font-weight: 600; }
.labelled-field input { display: block; margin-top: 0.3rem; }

/* ===== Timer ===== */
.timer-bar {
  background: var(--warning-bg);
  color: var(--warning-text);
  padding: 0.55rem 1rem;
  border-radius: var(--radius-md);
  font-weight: 700;
  font-family: var(--font-mono);
  margin-bottom: 1rem;
  text-align: center;
  border: 1px solid rgba(212, 165, 116, 0.3);
}

/* ===== Save Status ===== */
.save-status {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--text-muted-dark);
  text-align: right;
  margin-bottom: 0.5rem;
}

/* ===== Dashboard Nav ===== */
.dashboard-nav { margin-bottom: 1.25rem; }

/* ===== Assignment List ===== */
.section-group { margin-bottom: 1.75rem; }
.assignment-list { display: flex; flex-direction: column; gap: 0.5rem; }

.assignment-card {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1.125rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}
.assignment-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.assignment-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 0.9rem;
}
.assignment-info strong { font-weight: 600; }
.assignment-actions { flex-shrink: 0; }

/* ===== Section Details (Lesson browser) ===== */
.section-details {
  margin-bottom: 0.5rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.section-details summary {
  cursor: pointer;
  padding: 0.75rem 1rem;
  font-weight: 600;
  color: var(--text-dark);
  font-size: 0.9rem;
  transition: background-color 0.15s var(--ease-out);
  list-style: none;
}
.section-details summary::before {
  content: '▸ ';
  color: var(--teal);
  font-size: 0.8em;
}
.section-details[open] summary::before { content: '▾ '; }
.section-details summary:hover { background: rgba(0, 0, 0, 0.02); }

.section-details ul {
  list-style: none;
  padding: 0 1rem 0.75rem 1.75rem;
}
.section-details li {
  padding: 0.3rem 0;
  font-size: 0.88rem;
}
.section-details a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.section-details a:hover { text-decoration: underline; }

/* ===== Marking ===== */
.marking-grid { display: flex; flex-direction: column; gap: 1rem; }

.marking-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  padding: 1.125rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.marking-left { display: flex; flex-direction: column; gap: 0.5rem; }
.marking-right { display: flex; flex-direction: column; gap: 0.5rem; }

.student-answer {
  margin-top: 0.5rem;
  padding: 0.625rem 0.75rem;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  font-size: 0.88rem;
  border-left: 3px solid var(--info);
}

.model-text {
  font-size: 0.82rem;
  padding: 0.625rem 0.75rem;
  background: var(--success-bg);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--success);
}

.mark-input {
  width: 3em;
  max-width: 48px;
  text-align: center;
  display: inline-block;
  font-family: var(--font-mono);
  font-weight: 600;
  padding: 0.25em;
}

.auto-feedback {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--text-muted-dark);
}

.actions {
  margin: 1.25rem 0;
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* ===== Results ===== */
.feedback-box {
  background: var(--success-bg);
  border: 1px solid rgba(61, 139, 122, 0.2);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  margin: 1rem 0;
  border-left: 4px solid var(--success);
}

.results-list { display: flex; flex-direction: column; gap: 1rem; }

.result-row-full {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.125rem 1.375rem;
  box-shadow: var(--shadow-sm);
}

.result-question-text {
  margin-bottom: 0.625rem;
  color: var(--text-dark);
  line-height: 1.5;
}

.result-sub-label {
  font-size: 0.85rem;
  color: var(--text-muted-dark);
  margin-top: 0.25rem;
  font-style: italic;
}

.result-answer-label {
  font-size: 0.7rem;
  color: var(--text-muted-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.result-answer-text {
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.025);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  font-size: 0.88rem;
  border-left: 3px solid var(--card-border);
}

.result-mark-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.result-student-answer { margin-bottom: 0.5rem; }

.result-field {
  padding: 0.625rem 0;
  border-top: 1px solid rgba(0, 0, 0, 0.04);
}
.result-field:first-child { border-top: none; }

.result-not-attempted {
  color: var(--text-muted-dark);
  font-style: italic;
  padding: 0.25rem 0;
  font-size: 0.88rem;
}

.result-row {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  align-items: start;
}

.result-answer { white-space: pre-wrap; }

/* ===== Credentials (Print) ===== */
.credentials-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin: 1.5rem 0;
}

.credential-slip {
  border: 2px dashed var(--card-border);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  text-align: center;
  background: var(--card-bg);
}

.credential-row { margin-top: 0.5rem; }

.credential-label {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted-dark);
}

.credential-value {
  font-family: var(--font-mono);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--text-dark);
  letter-spacing: 0.04em;
}

/* ===== Videos ===== */
.video-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin: 0.75rem 0;
}

.video-card {
  display: flex;
  gap: 1rem;
  padding: 0.875rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s var(--ease-out);
}
.video-card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}
.video-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.video-thumb {
  width: 160px;
  height: 90px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.video-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.video-title { font-weight: 600; color: var(--text-dark); font-size: 0.95rem; }
.video-author { font-size: 0.8rem; color: var(--text-muted-dark); }
.video-desc { font-size: 0.82rem; color: var(--text-muted-dark); margin-top: 0.25rem; }

/* ===== Slides ===== */
.slides-container { display: flex; flex-direction: column; gap: 1.25rem; }

.slide-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-lg);
  padding: 1.75rem 2rem;
  position: relative;
  box-shadow: var(--shadow-sm);
}

.slide-number {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--text-muted-dark);
  font-weight: 600;
  background: rgba(0, 0, 0, 0.04);
  padding: 0.1rem 0.5rem;
  border-radius: 50px;
}

.slide-content h1 { font-size: 1.4rem; margin-bottom: 0.5rem; }
.slide-content h2 {
  font-size: 1.15rem;
  margin-bottom: 0.5rem;
  border-bottom: 2px solid var(--card-border);
  padding-bottom: 0.4rem;
}
.slide-content ul, .slide-content ol { padding-left: 1.5rem; margin: 0.5rem 0; }
.slide-content li { margin: 0.3rem 0; font-size: 0.92rem; }
.slide-content table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 0.75rem 0;
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.slide-content th, .slide-content td {
  padding: 0.5rem;
  font-size: 0.88rem;
}
.slide-content th {
  background: rgba(0, 0, 0, 0.03);
  font-weight: 600;
  border-bottom: 2px solid var(--card-border);
}
.slide-content td { border-bottom: 1px solid rgba(0, 0, 0, 0.04); }
.slide-content tr:last-child td { border-bottom: none; }
.slide-content blockquote {
  border-left: 4px solid var(--accent);
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  background: var(--accent-glow);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}
.slide-content code {
  background: var(--bg-base);
  color: var(--gold);
  padding: 0.15rem 0.4rem;
  border-radius: 3px;
  font-size: 0.85em;
  font-family: var(--font-mono);
}

.callout {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  margin: 1rem 0;
  background: var(--teal-soft);
  border-left: 4px solid var(--teal);
}

/* ===== Print ===== */
@media print {
  .no-print { display: none !important; }
  .navbar { display: none; }
  body { padding-top: 0; background: #fff; }
  .credential-slip { break-inside: avoid; border: 1px solid #000; }
  body::before { display: none; }
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .marking-row { grid-template-columns: 1fr; }
  .marking-left, .marking-right { min-width: 0; }
  .result-row { grid-template-columns: 1fr; }
  .card-grid { grid-template-columns: 1fr; }
  .credentials-grid { grid-template-columns: 1fr; }
  .nav-centre { display: none; }
  h1 { font-size: 1.4rem; }
}

/* ===== Scrollbar ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: rgba(0, 0, 0, 0.03); }
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 50px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(0, 0, 0, 0.25); }

/* ===== Selection ===== */
::selection {
  background: var(--accent-glow);
  color: var(--text-dark);
}

/* ===== Links ===== */
a { color: var(--accent); }
a:hover { color: var(--accent-hover); }

/* ===== Utilities ===== */
.inline-form { display: inline; }
h4, .topic-header {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text-muted-dark);
  margin: 1.25rem 0 0.35rem;
  padding-left: 0.25rem;
}

/* ===== Inline Editing ===== */
.editable-title {
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: var(--radius-sm);
  border: 1px dashed transparent;
}
.editable-title:hover {
  border-color: var(--card-border);
  background: rgba(0, 0, 0, 0.02);
}
.inline-edit-input {
  font-size: inherit;
  font-family: inherit;
  padding: 0.15rem 0.35rem;
  border: 1px solid var(--accent);
  border-radius: var(--radius-sm);
  width: 100%;
}

/* ===== Toggle Switch ===== */
.section-toggle-group { margin-bottom: 1.5rem; }
.section-toggle-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.section-toggle-header h2 { margin: 0; }
.lesson-toggle-list {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-top: 0.5rem;
}
.lesson-toggle-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 1rem;
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius-sm);
}
.lesson-toggle-title { font-size: 0.9rem; }

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  margin: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: #ccc;
  border-radius: 22px;
  transition: background-color 0.2s var(--ease-out);
}
.toggle-slider::before {
  content: '';
  position: absolute;
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s var(--ease-out);
}
.toggle-switch input:checked + .toggle-slider { background: var(--success); }
.toggle-switch input:checked + .toggle-slider::before { transform: translateX(18px); }
.toggle-switch input:focus-visible + .toggle-slider { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ===== Row Status Backgrounds ===== */
.row-submitted td { background: var(--success-bg); }
.row-draft td { background: var(--warning-bg); }

/* ===== Draft View ===== */
.draft-answer {
  padding: 0.5rem 0.75rem;
  background: rgba(0, 0, 0, 0.025);
  border-radius: var(--radius-sm);
  white-space: pre-wrap;
  font-size: 0.88rem;
  border-left: 3px solid var(--teal);
  margin-top: 0.25rem;
}
.draft-empty {
  color: var(--text-muted-dark);
  font-style: italic;
  border-left-color: var(--card-border);
}
.draft-filled { color: var(--teal); font-weight: 500; }
.draft-label { font-weight: 600; font-size: 0.88rem; margin-bottom: 0.15rem; }

/* ===== Student Code (name map) ===== */
.student-code { font-family: var(--font-mono); letter-spacing: 0.02em; }

/* ===== Single credential slip ===== */
.credential-single { max-width: 320px; margin: 1.5rem 0; }
