/* Product demo pages — self-contained so /demo always looks like cards. */
.demo-page { max-width: 1100px; margin: 0 auto; padding: 28px 22px 64px; }

.demo-hero {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 28px;
}
.demo-hero .brandbar { margin-bottom: 0; flex: 1; }
.demo-hero__actions { margin-left: auto; display: flex; gap: 10px; flex-shrink: 0; }

.demo-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 28px;
}
.demo-step {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 18px;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.demo-step__num {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand-light); color: var(--brand-primary);
  font-weight: 800; font-size: 13px;
  display: grid; place-items: center; flex: 0 0 auto;
}
.demo-step__title { font-weight: 700; font-size: 14px; margin: 0 0 2px; }
.demo-step__copy { color: var(--muted); font-size: 13px; margin: 0; line-height: 1.45; }

.demo-section-label {
  font-size: 12px; font-weight: 800; letter-spacing: .08em;
  text-transform: uppercase; color: var(--muted); margin: 0 0 14px;
}

.demo-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

a.demo-tile {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 12px 28px rgba(15, 23, 42, .06);
  overflow: hidden;
  min-height: 280px;
  transition: transform .12s ease, box-shadow .18s ease, border-color .18s ease;
}
a.demo-tile:hover {
  transform: translateY(-3px);
  border-color: rgba(79, 70, 229, .45);
  box-shadow: 0 10px 30px rgba(79, 70, 229, .14);
}

.demo-tile__accent { height: 6px; width: 100%; flex: 0 0 auto; }
.demo-tile__accent--bio { background: linear-gradient(90deg, #16a34a, #4ade80); }
.demo-tile__accent--meth { background: linear-gradient(90deg, #4f46e5, #7c3aed); }
.demo-tile__accent--chem { background: linear-gradient(90deg, #ea580c, #f59e0b); }

.demo-tile__body {
  padding: 22px 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}

.demo-tile__icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  line-height: 1;
  flex: 0 0 auto;
}
.demo-tile__icon--bio { background: #dcfce7; }
.demo-tile__icon--meth { background: #eef2ff; }
.demo-tile__icon--chem { background: #ffedd5; }

.demo-tile__name { font-size: 18px; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.demo-tile__blurb { color: var(--muted); font-size: 13.5px; line-height: 1.5; margin: 0; flex: 1; }
.demo-tile__meta { color: var(--ink); font-size: 13px; font-weight: 600; margin: 0; }
.demo-tile__cta {
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; padding: 11px 16px; border-radius: 11px;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-secondary));
  color: #fff; font-weight: 700; font-size: 14px;
  box-shadow: 0 8px 18px rgba(79, 70, 229, .2);
}

@media (max-width: 860px) {
  .demo-grid, .demo-steps { grid-template-columns: 1fr; }
  .demo-hero { flex-wrap: wrap; }
  .demo-hero__actions { margin-left: 0; width: 100%; }
  .demo-hero__actions .btn { width: 100%; }
}

/* Question cards on /demo/banks */
.qbank-card.card {
  padding: 0 !important;
  overflow: hidden;
  margin-bottom: 18px;
}
.qbank-card__header {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 16px 22px;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
}
.qbank-card__number {
  font-size: 12px; font-weight: 800; letter-spacing: .04em;
  color: var(--brand-primary);
  background: var(--brand-light);
  padding: 5px 10px; border-radius: 8px;
}
.qbank-card__badges { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
.qbank-card__body { padding: 20px 22px 8px; }
.qbank-card__body .stem { font-size: 15.5px; line-height: 1.7; }
.qbank-card__footer {
  padding: 14px 22px 18px;
  display: flex;
  justify-content: flex-end;
}
.qbank-card__assess-btn { width: auto !important; padding: 9px 16px !important; font-size: 13.5px !important; }

/* Build assessment layout */
.assess-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 22px;
  align-items: start;
}
.assess-side { position: sticky; top: 18px; }
.picker-check {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 700; color: var(--brand-primary); cursor: pointer;
  margin-right: 6px;
}
.picker-check input[type=checkbox] {
  display: block !important;
  width: 18px; height: 18px; accent-color: var(--brand-primary); cursor: pointer;
}
.picker-card--selected { border-color: var(--brand-primary) !important; box-shadow: 0 0 0 3px rgba(79,70,229,.12); }
@media (max-width: 860px) {
  .assess-layout { grid-template-columns: 1fr; }
  .assess-side { position: static; }
}

/* ── teacher/student role toggle ─────────────────────────────────────────── */
.role-toggle {
  display: inline-flex; gap: 2px; padding: 3px; border-radius: 10px;
  background: #eef2ff; border: 1px solid var(--line);
}
.role-toggle__btn {
  border: 0; background: transparent; cursor: pointer; border-radius: 8px;
  padding: 7px 13px; font-family: var(--font); font-size: 13px; font-weight: 700;
  color: var(--muted); transition: background .15s, color .15s;
}
.role-toggle__btn.is-active { background: #fff; color: var(--brand-primary); box-shadow: 0 1px 3px rgba(15,23,42,.12); }

/* ── tag chip variant ────────────────────────────────────────────────────── */
.chip.tag { background: #fefce8; border-color: #ca8a04; color: #92400e; }
.tag-chip-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ── per-question tools drawer ───────────────────────────────────────────── */
.drawer--wide { width: min(720px, 96vw); }
.tool-stem {
  padding: 12px 14px; margin-bottom: 4px; border-radius: 10px;
  background: #f8fafc; border: 1px solid var(--line); font-size: 15px;
}
.tool-section { padding: 18px 0; border-top: 1px solid var(--line); }
.tool-section:first-of-type { border-top: 0; }
.tool-section__title { margin: 0 0 12px; font-size: 15px; font-weight: 800; color: var(--ink); }

/* ── rubric editor ───────────────────────────────────────────────────────── */
.rubric-row { display: grid; grid-template-columns: 1fr 80px 32px; gap: 8px; align-items: center; margin-bottom: 8px; }
.rubric-row .rubric-marks { text-align: center; }
.rubric-del {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer;
  height: 38px; font-size: 20px; line-height: 1; color: var(--muted);
}
.rubric-del:hover { color: var(--wrong, #dc2626); border-color: currentColor; }

/* ── editable (session-only) marks + feedback ────────────────────────────── */
.eval-edit .field-label { display: block; }
.eval-edit .field-input, .eval-edit .ans-input { width: 100%; }

/* ── worked-solution preview ─────────────────────────────────────────────── */
.sol-preview {
  margin-top: 12px; padding: 14px 16px; border-radius: 10px;
  background: #f8fafc; border: 1px solid var(--line); line-height: 1.7;
}

/* ── delete / danger button ──────────────────────────────────────────────── */
.danger-btn { color: #b91c1c; border-color: rgba(185, 28, 28, .35); }
.danger-btn:hover { background: #fef2f2; border-color: #b91c1c; }

/* ── inline "solve this question" panel on the bank browse view ───────────── */
.answer-panel { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.answer-panel .ans-submit { width: auto; }
/* ── centered modal (Scan-QR-to-upload-working) ──────────────────────────── */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .5);
  opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 70;
}
.modal-scrim.open { opacity: 1; pointer-events: auto; }
.modal {
  position: fixed; top: 50%; left: 50%; z-index: 71; width: min(420px, 92vw);
  background: var(--card); border-radius: 16px; box-shadow: 0 30px 80px rgba(15, 23, 42, .35);
  opacity: 0; pointer-events: none; transform: translate(-50%, -48%) scale(.98);
  transition: opacity .2s, transform .2s;
}
.modal.open { opacity: 1; pointer-events: auto; transform: translate(-50%, -50%) scale(1); }
.modal-head { display: flex; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-head .title { font-weight: 700; font-size: 16px; }
.modal-head .x {
  margin-left: auto; border: 0; background: transparent; font-size: 24px;
  cursor: pointer; color: var(--muted); line-height: 1;
}
.modal-body { padding: 20px 24px; }
.qr-modal-inner { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.qr-modal-inner .qr-card { width: 240px; }
