
/* ── Student hub (home view) ──────────────────────────── */
.sd-live-alert {
  display: flex;
  align-items: center;
  gap: .5rem;
  background: #7c3aed;
  color: #fff;
  padding: .6rem 1.5rem;
  font-size: .875rem;
  font-weight: 600;
}
.sd-live-alert a { color: #e9d5ff; }

.sd-hub {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2.5rem 1.5rem 3rem;
  min-height: calc(100vh - 60px);
}
.sd-hub-greeting {
  font-size: 1.1rem;
  color: var(--text-muted, #64748b);
  margin: 0 0 2rem;
}
.sd-hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 1.25rem;
  width: 100%;
  max-width: 960px;
}

.sd-hub-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: 2rem 1rem;
  border-radius: 18px;
  color: #fff;
  text-decoration: none;
  text-align: center;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  transition: transform .15s, box-shadow .15s;
  min-height: 160px;
}
.sd-hub-card:hover { transform: translateY(-4px); box-shadow: 0 10px 30px rgba(0,0,0,.22); }
.sd-hub-card:active { transform: scale(.97); }

.sd-hub-card--journeys  { background: linear-gradient(145deg, #1a6b6b 0%, #0d4f4f 100%); }
.sd-hub-card--live      { background: linear-gradient(145deg, #7c3aed 0%, #5b21b6 100%); }
.sd-hub-card--live-active { background: linear-gradient(145deg, #9333ea 0%, #6d28d9 100%); animation: pulse-glow 2s infinite; }
.sd-hub-card--homework  { background: linear-gradient(145deg, #b45309 0%, #92400e 100%); }
.sd-hub-card--progress  { background: linear-gradient(145deg, #1e40af 0%, #1e3a8a 100%); }
.sd-hub-card--alevel    { background: linear-gradient(145deg, #0e7490 0%, #0c5e73 100%); }
.sd-hub-card--easy      { background: linear-gradient(145deg, #166534 0%, #14532d 100%); }
.sd-hub-card--medium    { background: linear-gradient(145deg, #a16207 0%, #78350f 100%); }
.sd-hub-card--hard      { background: linear-gradient(145deg, #9d2a20 0%, #7c1d15 100%); }

.sd-hub-card-icon  { font-size: 2.2rem; line-height: 1; }
.sd-hub-card-title { font-size: 1rem; font-weight: 700; letter-spacing: .01em; }
.sd-hub-card-count { font-size: .8rem; opacity: .85; }

.sd-hub-progress-bar {
  width: 80%;
  height: 6px;
  background: rgba(255,255,255,.25);
  border-radius: 3px;
  margin-top: .4rem;
  overflow: hidden;
}
.sd-hub-progress-fill {
  height: 100%;
  background: rgba(255,255,255,.8);
  border-radius: 3px;
  transition: width .4s;
}

@keyframes pulse-glow {
  0%,100% { box-shadow: 0 4px 16px rgba(124,58,237,.4); }
  50%      { box-shadow: 0 4px 28px rgba(124,58,237,.75); }
}

/* Back button */
.sd-back-btn {
  color: var(--text-muted, #64748b);
  text-decoration: none;
  font-size: .875rem;
  font-weight: 600;
  margin-right: .75rem;
}
.sd-back-btn:hover { color: var(--accent, #1a6b6b); }

/* Responsive hub grid */
@media (max-width: 600px) {
  .sd-hub-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 380px) {
  .sd-hub-grid { grid-template-columns: 1fr; }
}

/* student.css — student login and dashboard */

/* ── Student Dashboard shell ─────────────────────────────── */
.sd-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg-page);
}

/* ── Top bar ─────────────────────────────────────────────── */
.sd-header {
  background: #062020;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .85rem 1.5rem;
  gap: 1rem;
  flex-wrap: wrap;
}
.sd-logo {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .01em;
}
.sd-header-right {
  display: flex;
  align-items: center;
  gap: .85rem;
  flex-wrap: wrap;
  font-size: .85rem;
}
.sd-class-badge {
  background: rgba(13,107,107,.6);
  border: 1px solid rgba(13,107,107,.9);
  border-radius: 20px;
  padding: .2rem .75rem;
  font-size: .78rem;
  font-weight: 600;
  color: #a0e4e4;
}
.sd-user { color: #c0e4e4; }
.sd-logout { color: #7a9090; text-decoration: none; font-size: .82rem; }
.sd-logout:hover { color: #e07070; }

/* ── Tab bar ─────────────────────────────────────────────── */
/* ── Nav cards ───────────────────────────────────────────── */
.sd-cards-nav {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.1rem;
  padding: 2rem 1.75rem 1.5rem;
  max-width: 960px;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
  background: var(--bg-page);
}
.sd-cards-nav.hidden { display: none; }
@media (max-width: 860px) {
  .sd-cards-nav { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .sd-cards-nav { grid-template-columns: 1fr; gap: .75rem; padding: 1rem; }
}

/* ── Big coloured nav cards ─────────────────────────── */
.sd-nav-card {
  border: none;
  border-radius: 20px;
  padding: 1.6rem 1.4rem 1.4rem;
  cursor: pointer;
  text-align: left;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem;
  min-height: 160px;
  transition: transform .15s, box-shadow .15s;
  font-family: inherit;
  box-shadow: 0 4px 18px rgba(0,0,0,.13);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.sd-nav-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0);
  transition: background .15s;
  border-radius: inherit;
}
.sd-nav-card:hover { transform: translateY(-3px); box-shadow: 0 10px 28px rgba(0,0,0,.2); }
.sd-nav-card:hover::before { background: rgba(255,255,255,.07); }
.sd-nav-card:active { transform: scale(.98); }

.sd-nav-card--journeys { background: linear-gradient(135deg, #1a6b6b 0%, #0d4f4f 100%); }
.sd-nav-card--live     { background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%); }
.sd-nav-card--homework { background: linear-gradient(135deg, #b45309 0%, #92400e 100%); }
.sd-nav-card--progress { background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%); }
/* A-level */
.sd-nav-card--alevel   { background: linear-gradient(135deg, #0e7490 0%, #0c5e73 100%); }
/* Coding Club difficulty tiers */
.sd-nav-card--easy     { background: linear-gradient(135deg, #166534 0%, #14532d 100%); }
.sd-nav-card--medium   { background: linear-gradient(135deg, #a16207 0%, #78350f 100%); }
.sd-nav-card--hard     { background: linear-gradient(135deg, #9d2a20 0%, #7c1d15 100%); }

.sd-nav-card-body {
  display: flex;
  flex-direction: column;
  gap: .35rem;
  flex: 1;
  min-width: 0;
}
.sd-nav-title {
  font-size: 1.1rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}
.sd-nav-sub {
  font-size: .78rem;
  color: rgba(255,255,255,.75);
  line-height: 1.4;
}
.sd-nav-badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  margin-top: .4rem;
  background: rgba(255,255,255,.18);
  color: #fff;
  font-size: .75rem;
  font-weight: 700;
  padding: .2rem .6rem;
  border-radius: 999px;
  width: fit-content;
}
.sd-nav-badge--live { background: rgba(255,255,255,.25); }
.sd-nav-arrow {
  font-size: 1.3rem;
  color: rgba(255,255,255,.7);
  flex-shrink: 0;
  align-self: center;
  transition: transform .15s, color .15s;
}
.sd-nav-card:hover .sd-nav-arrow { transform: translateX(3px); color: #fff; }



/* ── Sub-page content wrapper ────────────────────────────── */
.sd-page-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1.5rem 3rem;
  width: 100%;
  box-sizing: border-box;
}

/* ── Section blocks ──────────────────────────────────────── */
.sd-section-block {
  margin-bottom: 2rem;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-soft);
  background: var(--bg-surface);
  box-shadow: var(--shadow-card);
}

/* ── Section banners ─────────────────────────────────────── */
.sd-section-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  color: #fff;
  gap: .75rem;
}
.sd-banner-left {
  display: flex;
  align-items: center;
  gap: .65rem;
}
.sd-banner-icon { font-size: 1.4rem; flex-shrink: 0; filter: grayscale(1); }
.sd-banner-title { font-weight: 700; font-size: 1rem; }
.sd-banner-sub   { font-size: .8rem; opacity: .85; margin-top: .1rem; }
.sd-banner-count {
  font-size: .8rem;
  font-weight: 700;
  background: rgba(255,255,255,.2);
  padding: .2rem .65rem;
  border-radius: 999px;
  white-space: nowrap;
}
.sd-banner-live-badge {
  display: flex;
  align-items: center;
  gap: .35rem;
}

/* Banner colour variants */
.sd-banner--journeys { background: linear-gradient(135deg, #1a6b6b 0%, #0d4f4f 100%); }
.sd-banner--live     { background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%); }
.sd-banner--homework { background: linear-gradient(135deg, #b45309 0%, #92400e 100%); }
.sd-banner--progress { background: linear-gradient(135deg, #1e40af 0%, #1e3a8a 100%); }
.sd-banner--alevel   { background: linear-gradient(135deg, #0e7490 0%, #0c5e73 100%); }
.sd-banner--easy     { background: linear-gradient(135deg, #166534 0%, #14532d 100%); }
.sd-banner--medium   { background: linear-gradient(135deg, #a16207 0%, #78350f 100%); }
.sd-banner--hard     { background: linear-gradient(135deg, #9d2a20 0%, #7c1d15 100%); }

/* Task list inside a section block */
.sd-section-block .task-list { padding: .75rem 1rem 1rem; }

/* ── Content ─────────────────────────────────────────────── */
.sd-content { flex: 1; padding: 1.8rem 1.5rem 3rem; max-width: 860px; margin: 0 auto; width: 100%; }

.sd-panel { display: none; }
.sd-panel.active { display: block; }

.sd-section { margin-bottom: 2rem; }
.sd-section-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 .9rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.sd-section-icon { font-size: 1.2rem; }

.sd-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: .95rem;
}

/* ── Task cards ──────────────────────────────────────────── */
.task-list { display: flex; flex-direction: column; gap: .8rem; }

.task-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.task-card--compact { padding: .75rem 1rem; }

.task-card-body { flex: 1; min-width: 0; }
.task-title { font-weight: 600; font-size: .95rem; color: var(--text-main); margin-bottom: .2rem; }
.task-desc  { font-size: .84rem; color: var(--text-muted); margin-bottom: .25rem; }
.task-due   { font-size: .8rem; color: #f59e0b; font-weight: 600; }
.task-meta  { font-size: .8rem; color: var(--text-muted); margin-top: .15rem; }

.task-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: .5rem;
  flex-shrink: 0;
}
.task-actions { display: flex; gap: .4rem; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

/* ── Status pills ────────────────────────────────────────── */
.status-pill {
  display: inline-block;
  padding: .2rem .7rem;
  border-radius: 12px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .02em;
  white-space: nowrap;
}
.status-not_started { background: #f1f5f9; color: #64748b; }
.status-in_progress { background: #fef3c7; color: #92400e; }
.status-completed   { background: #dcfce7; color: #166534; }

/* ── Progress summary ────────────────────────────────────── */
.progress-summary {
  background: var(--bg-surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius);
  padding: 1.3rem 1.5rem;
  box-shadow: var(--shadow-card);
  margin-bottom: .5rem;
}
.progress-stats {
  display: flex;
  gap: 2rem;
  margin-bottom: 1rem;
}
.prog-stat { text-align: center; }
.prog-stat-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1;
}
.prog-stat--done .prog-stat-num { color: #16a34a; }
.prog-stat-lbl { font-size: .75rem; color: var(--text-muted); margin-top: .2rem; text-transform: uppercase; letter-spacing: .05em; }

.progress-bar-wrap { display: flex; align-items: center; gap: 1rem; }
.progress-bar-track {
  flex: 1;
  height: 12px;
  background: var(--border-soft);
  border-radius: 8px;
  overflow: hidden;
}
.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #0D6B6B, #3ea8a8);
  border-radius: 8px;
  transition: width .6s ease;
}
.progress-pct { font-size: .82rem; font-weight: 700; color: var(--brand-blue); white-space: nowrap; }

/* ── Live session card ───────────────────────────────────── */
.live-dot {
  display: inline-block;
  width: 8px; height: 8px;
  background: #22c55e;
  border-radius: 50%;
  animation: pulse-dot 1.5s infinite;
  vertical-align: middle;
}
@keyframes pulse-dot {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .6; transform: scale(1.3); }
}

.live-session-card {
  background: var(--bg-surface);
  border: 2px solid #22c55e;
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  max-width: 360px;
}
.live-session-code {
  font-family: monospace;
  font-size: 2.4rem;
  font-weight: 800;
  letter-spacing: .18em;
  color: var(--brand-blue);
  margin-bottom: .6rem;
}
.live-session-card p { font-size: .88rem; color: var(--text-muted); margin-bottom: 1rem; }

/* ── Student login page ──────────────────────────────────── */
.login-icon { font-size: 2.5rem; text-align: center; margin-bottom: -.2rem; filter: grayscale(1); }

/* ── Buttons (reuse existing .btn classes, add size variants) */
.btn.btn-sm {
  padding: .3rem .75rem;
  font-size: .82rem;
  border-radius: 6px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 600px) {
  .sd-content { padding: 1.2rem 1rem 2rem; }
  .task-card { flex-direction: column; }
  .task-card-right { align-items: flex-start; flex-direction: row; flex-wrap: wrap; }
  .progress-stats { gap: 1.2rem; }
}

/* ── Journey step tracker ─────────────────────────────── */
.journey-card-full {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.task-card-top {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  width: 100%;
}
.task-card-top .task-card-body { flex: 1; }

.journey-progress-bar-wrap {
  margin-top: 0.6rem;
  height: 6px;
  background: var(--border, #e2e8f0);
  border-radius: 99px;
  overflow: hidden;
}
.journey-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #0D6B6B, #3D9B9B);
  border-radius: 99px;
  transition: width 0.4s ease;
  min-width: 4px;
}
.journey-progress-label {
  font-size: 0.75rem;
  color: var(--text-muted, #64748b);
  margin-top: 0.25rem;
}

.journey-steps-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 0.3rem 0.75rem;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border, #e2e8f0);
}
.journey-step-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.78rem;
  color: var(--text-muted, #64748b);
  padding: 0.2rem 0;
}
.journey-step-row.step-done {
  color: #0D6B6B;
  font-weight: 600;
}
.step-check {
  font-size: 0.85rem;
  width: 1rem;
  text-align: center;
  flex-shrink: 0;
}
.step-nav-label { line-height: 1.3; }

/* ── Step score badge ─────────────────────────────────────── */
.step-score-badge {
  margin-left: auto;
  font-size: .72rem;
  font-weight: 600;
  color: #059669;
  background: #d1fae5;
  padding: 1px 6px;
  border-radius: 6px;
  white-space: nowrap;
}
[data-theme="dark"] .step-score-badge {
  background: #065f46;
  color: #6ee7b7;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .step-score-badge {
    background: #065f46;
    color: #6ee7b7;
  }
}

/* ── Task score line ──────────────────────────────────────── */
.task-score {
  font-size: .82rem;
  color: #059669;
  font-weight: 600;
  margin-top: .25rem;
}

/* ── Session ended note ───────────────────────────────────── */
.session-ended-note {
  color: var(--text-muted, #6b7280);
  font-size: .82rem;
}

/* ── Back button ─────────────────────────────────────────── */
.sd-back-btn {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: none;
  border: none;
  font-size: .88rem;
  font-weight: 600;
  color: var(--brand-blue);
  cursor: pointer;
  padding: 0;
  margin-bottom: 1.4rem;
  font-family: inherit;
}
.sd-back-btn:hover { text-decoration: underline; }
.sd-back-btn.hidden { display: none; }

/* ── Content area when in a section ─────────────────────── */
#sd-main-content { padding-top: 1.5rem; }

/* Homework feedback pill on student dashboard */
.hw-feedback-pill {
  margin-top: .4rem;
  background: #eff6ff;
  border: 1px solid #93c5fd;
  color: #1e40af;
  border-radius: 6px;
  padding: .4rem .7rem;
  font-size: .82rem;
  white-space: pre-wrap;
}

/* ── Progress panel: year7_journey subtask breakdown ────────────── */
.prog-task-card { align-items: flex-start !important; }
.prog-right {
  display: flex; flex-direction: column; align-items: flex-end;
  gap: .35rem; flex-shrink: 0; padding-left: .75rem;
}
.prog-step-count {
  font-size: .75rem; color: var(--text-muted, #64748b);
  white-space: nowrap;
}
.prog-steps {
  margin-top: .6rem; display: flex; flex-direction: column; gap: .25rem;
}
.prog-step {
  display: flex; align-items: center; gap: .45rem;
  font-size: .8rem; color: var(--text-muted, #64748b);
}
.prog-step--done { color: var(--text-body, #1e293b); }
.prog-step-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
  background: #cbd5e1;
}
.prog-step--done .prog-step-dot { background: #10b981; }
.prog-step-name { flex: 1; }
.prog-step-score {
  font-size: .75rem; font-weight: 600;
  background: #f0fdf4; color: #166534;
  border: 1px solid #bbf7d0; border-radius: 4px;
  padding: 1px 6px; white-space: nowrap;
}

/* ── Progress hub card chips ──────────────────────────────── */
.sd-hub-prog-chips {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: .1rem 0 .3rem;
}
.sd-prog-chip {
  font-size: .7rem;
  font-weight: 700;
  padding: .15rem .5rem;
  border-radius: 10px;
  letter-spacing: .01em;
}
.sd-prog-chip--done { background: rgba(34,197,94,.25); color: #86efac; }
.sd-prog-chip--wip  { background: rgba(251,191,36,.2);  color: #fde68a; }
.sd-hub-card-pct {
  font-size: .75rem;
  opacity: .8;
  margin-top: .2rem;
}

/* ── Progress view: grouped sections ─────────────────────── */
.prog-group { margin-bottom: 1.5rem; }
.prog-group-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--text-muted, #64748b);
  padding: .4rem 0;
  border-bottom: 1.5px solid var(--border-soft, #e2e8f0);
  margin-bottom: .6rem;
}
.prog-group-count {
  font-size: .75rem;
  font-weight: 600;
  color: #16a34a;
  text-transform: none;
  letter-spacing: 0;
}

/* ── Step-dot indicators ──────────────────────────────────── */
.prog-step-dots {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: .4rem 0 .2rem;
}
.prog-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--border-soft, #e2e8f0);
  border: 1.5px solid #cbd5e1;
  flex-shrink: 0;
}
.prog-dot--done    { background: #22c55e; border-color: #16a34a; }
.prog-dot--current { background: #facc15; border-color: #d97706; }
.prog-step-label   { font-size: .75rem; color: var(--text-muted, #64748b); margin-top: .1rem; }

/* ── Teacher: color-coded completed step cells ───────────── */
.prog-step-green { background: #d1fae5 !important; color: #065f46 !important; }
[data-theme="dark"] .prog-step-green { background: #064e3b !important; color: #6ee7b7 !important; }

/* ── Teacher: class completion badge in journey title ────── */
.prog-class-pct {
  float: right;
  font-size: .72rem;
  font-weight: 600;
  color: #0369a1;
  background: #e0f2fe;
  padding: .1rem .5rem;
  border-radius: 8px;
  margin-left: 1rem;
}
[data-theme="dark"] .prog-class-pct { color: #7dd3fc; background: #0c4a6e; }

/* ── Teacher: summary footer row ─────────────────────────── */
.prog-summary-row td { background: #f8fafc !important; border-top: 2px solid #cbd5e1 !important; }
[data-theme="dark"] .prog-summary-row td { background: #1e293b !important; border-top-color: #334155 !important; }
.prog-summary-lbl  { font-style: italic; color: var(--text-muted, #64748b) !important; }
.prog-summary-cell { text-align: center; font-weight: 700; font-size: .8rem; color: #334155; }
[data-theme="dark"] .prog-summary-cell { color: #cbd5e1; }
.prog-summary-pct  { display: block; font-size: .68rem; font-weight: 500; color: #64748b; margin-top: 1px; }

/* ── Due-date urgency ─────────────────────────────────────── */
.task-due--overdue {
  color: #dc2626 !important;
  font-weight: 700;
}
[data-theme="dark"] .task-due--overdue { color: #f87171 !important; }

/* ── Journey search / filter ──────────────────────────────── */
.sd-filter-wrap {
  margin: 0 0 1rem;
  display: flex;
  align-items: center;
  gap: .5rem;
}
.sd-filter-input {
  flex: 1;
  max-width: 340px;
  padding: .45rem .75rem;
  border: 1.5px solid var(--border, #e2e8f0);
  border-radius: 8px;
  font-size: .9rem;
  background: var(--surface, #fff);
  color: inherit;
  outline: none;
  transition: border-color .15s;
}
.sd-filter-input:focus { border-color: #6366f1; }
[data-theme="dark"] .sd-filter-input { background: #1e293b; border-color: #334155; }
.sd-filter-clear {
  font-size: .8rem; color: #64748b; cursor: pointer;
  padding: .3rem .5rem; border-radius: 6px;
  display: none;
}
.sd-filter-clear.visible { display: inline-block; }
.sd-filter-clear:hover { color: #dc2626; }

/* ── Mobile responsive ────────────────────────────────────── */
@media (max-width: 600px) {
  .sd-hub-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: .6rem !important;
  }
  .sd-hub-card { padding: .85rem .7rem !important; }
  .sd-hub-card-icon { font-size: 1.6rem !important; }
  .sd-hub-card-label { font-size: .78rem !important; }
  .sd-hub-card-count { font-size: .75rem !important; }

  .task-card { padding: .85rem !important; }
  .task-card .task-actions { flex-wrap: wrap; gap: .4rem; }

  .prog-step-dots { gap: 3px !important; }
  .prog-dot { width: 10px !important; height: 10px !important; }

  .sd-section-banner { padding: .75rem !important; }
  .sd-banner-title { font-size: 1rem !important; }
}
@media (max-width: 420px) {
  .sd-hub-grid { grid-template-columns: 1fr !important; }
}

/* ── Student code history ─────────────────────────────────── */
.code-hist-section { margin-bottom: 1.5rem; }
.code-hist-hd {
  font-size: .8rem; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; color: #64748b;
  margin: 0 0 .5rem; padding: .25rem 0;
  border-bottom: 1px solid var(--border, #e2e8f0);
}
.code-hist-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e8f0);
  border-radius: 10px;
  margin-bottom: .55rem;
  overflow: hidden;
}
[data-theme="dark"] .code-hist-card { background: #1e293b; border-color: #334155; }
.code-hist-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: .65rem .9rem;
  cursor: pointer;
  user-select: none;
}
.code-hist-header:hover { background: var(--hover, #f8fafc); }
[data-theme="dark"] .code-hist-header:hover { background: #273549; }
.code-hist-title { font-weight: 600; font-size: .9rem; }
.code-hist-meta  { font-size: .78rem; color: #64748b; display: flex; gap: .75rem; align-items: center; }
.code-hist-score { font-weight: 700; color: #6366f1; }
.code-hist-arrow { font-size: .75rem; color: #94a3b8; transition: transform .2s; }
.code-hist-card.open .code-hist-arrow { transform: rotate(90deg); }
.code-hist-body {
  display: none;
  padding: 0 .9rem .9rem;
}
.code-hist-card.open .code-hist-body { display: block; }
.code-hist-pre {
  background: #0f172a; color: #e2e8f0;
  border-radius: 8px; padding: .75rem 1rem;
  font-size: .8rem; font-family: monospace;
  overflow-x: auto; white-space: pre;
  margin: 0;
  max-height: 280px; overflow-y: auto;
}

/* ── Class announcement banner ────────────────────────────── */
.sd-announcement {
  background: linear-gradient(135deg, #eef2ff 0%, #e0e7ff 100%);
  border: 1.5px solid #a5b4fc;
  border-radius: 12px;
  padding: .85rem 1.1rem;
  margin-bottom: 1.2rem;
  display: flex; gap: .75rem; align-items: flex-start;
}
[data-theme="dark"] .sd-announcement {
  background: linear-gradient(135deg, #1e1b4b 0%, #1e293b 100%);
  border-color: #4338ca;
}
.sd-announcement-icon { font-size: 1.3rem; flex-shrink: 0; filter: grayscale(1); }
.sd-announcement-body { flex: 1; }
.sd-announcement-label {
  font-size: .72rem; font-weight: 700; letter-spacing: .06em;
  text-transform: uppercase; color: #6366f1; margin-bottom: .2rem;
}
.sd-announcement-text { font-size: .9rem; }

/* ── Code history extra aliases ────────────────────────────── */
.code-hist-topic { font-weight: 600; font-size: .9rem; flex: 1; }
.code-hist-count { font-size: .78rem; color: #64748b; }
.code-hist-chevron { font-size: .75rem; color: #94a3b8; transition: transform .2s; margin-left: .5rem; }
.code-hist-card.open .code-hist-chevron { transform: rotate(90deg); }
.code-hist-step-title {
  display: flex; align-items: center; gap: .5rem;
  font-weight: 600; font-size: .85rem;
  margin: .9rem 0 .35rem;
}
.code-hist-date { font-size: .75rem; color: #94a3b8; margin-left: auto; }
