html, body, *, *::before, *::after {
  box-sizing: border-box;
  font-family: Calibri, 'Segoe UI', Candara, Segoe, Optima, Arial, sans-serif;
}
input, button, select, textarea {
  font-family: Calibri, 'Segoe UI', Candara, Segoe, Optima, Arial, sans-serif;
}

body {
  background: #f4f6fb;
  margin: 0;
  padding: 2rem;
  color: #1f2430;
  font-family: Calibri, 'Segoe UI', Candara, Segoe, Optima, Arial, sans-serif;
}

.container {
  max-width: 780px;
  margin: auto;
  background: #fff;
  padding: 2rem 2.5rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, .08);
}

.header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.burger-btn {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  color: #334155;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.burger-btn:hover {
  background: #f1f5f9;
  border-color: #94a3b8;
  color: #0b57d0;
  transform: translateY(-1px);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.burger-btn:active {
  transform: translateY(0);
}

h1 { margin: 0; font-size: 1.7rem; color: #0f172a; }

.progress-badge {
  background: #e8f0fe;
  color: #0b57d0;
  font-weight: 600;
  font-size: 0.95rem;
  padding: 4px 14px;
  border-radius: 20px;
  border: 1px solid #d2e3fc;
  user-select: none;
}

/* Start Card & User Registration */
.start-card {
  margin-top: 1.5rem;
  padding: 1.75rem 2rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.start-card h2 {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  color: #0f172a;
}

.start-desc {
  margin: 0 0 1.25rem;
  color: #64748b;
  font-size: 0.95rem;
  line-height: 1.5;
}

.start-deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #fef3c7;
  border: 1px solid #fde68a;
  color: #92400e;
  padding: 0.55rem 0.9rem;
  border-radius: 6px;
  font-size: 0.95rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.start-deadline-expired {
  background: #fef2f2;
  border: 1px solid #f87171;
  color: #991b1b;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  font-size: 0.95rem;
  line-height: 1.45;
  margin-bottom: 1.25rem;
}

.user-info-deadline {
  color: #b45309;
  font-weight: 600;
  margin-left: 0.4rem;
}

.disabled-btn {
  background: #94a3b8 !important;
  cursor: not-allowed !important;
  transform: none !important;
}

.form-group {
  margin-bottom: 1.2rem;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  color: #334155;
  margin-bottom: 0.4rem;
}

.form-group .req {
  color: #ef4444;
}

.form-group input {
  width: 100%;
  padding: 0.65rem 0.85rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 1rem;
  color: #0f172a;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-group input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.start-note {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #b91c1c;
  padding: 0.65rem 0.9rem;
  border-radius: 6px;
  font-size: 0.92rem;
  margin-top: 0.25rem;
  margin-bottom: 1.25rem;
  line-height: 1.4;
  font-weight: 500;
}

.note-icon {
  font-size: 1.15rem;
  line-height: 1;
  flex-shrink: 0;
  color: #dc2626;
}

.start-error {
  background: #fef2f2;
  border: 1px solid #fca5a5;
  color: #dc2626;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
  font-weight: 500;
}

.start-btn {
  padding: 0.7rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  color: #fff;
  background: #2563eb;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s;
}

.start-btn:hover {
  background: #1d4ed8;
}

.start-btn:active {
  transform: translateY(1px);
}

/* User Info Bar (Active session banner during quiz) */
.user-info-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: #475569;
}

.user-info-note {
  font-size: 0.86rem;
  color: #2563eb;
  font-weight: 500;
}

.user-info-bar strong {
  color: #0f172a;
}

/* ========================================================================= */
/* Question Cards (Show All Questions, 1 Active Moving Input Widget)        */
/* ========================================================================= */

.question {
  margin-bottom: 1.75rem;
  padding: 1.5rem;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .03);
  transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease;
  scroll-margin-top: 1.5rem;
}

.question.current {
  border-color: #3b82f6;
  box-shadow: 0 4px 16px rgba(59, 130, 246, .12);
  background: #ffffff;
}

.question.pending {
  border-color: #e2e8f0;
  background: #f8fafc;
  opacity: 0.85;
}

.question.pending .prompt {
  margin-bottom: 0;
}

.question.answered {
  border-color: #cbd5e1;
  background: #ffffff;
}

.active-input-widget {
  animation: fadeInWidget 0.2s ease-in-out;
}

@keyframes fadeInWidget {
  from {
    opacity: 0;
    transform: translateY(3px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.prompt {
  font-weight: 400;
  font-size: 1.15rem;
  margin-bottom: .85rem;
  color: #1e293b;
  line-height: 1.5;
  transition: margin-bottom .15s ease;
}

/* ========================================================================= */
/* Description / Instructions Card (Student View)                            */
/* ========================================================================= */

.quiz-description-card {
  margin-bottom: 1.75rem;
  padding: 1.25rem 1.5rem;
  border: 1px solid #cbd5e1;
  border-left: 5px solid #0b57d0;
  border-radius: 10px;
  background: #f8fafc;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .03);
  scroll-margin-top: 1.5rem;
}

.quiz-description-card .desc-badge {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #1e40af;
  background: #dbeafe;
  padding: 3px 10px;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}

.quiz-description-card .desc-content {
  font-size: 1.05rem;
  color: #334155;
  line-height: 1.6;
  white-space: pre-wrap;
}

/* ========================================================================= */
/* Toolbar (Google Sheets / Microsoft Word Style)                            */
/* ========================================================================= */

.toolbar {
  display: flex;
  align-items: center;
  gap: 3px;
  margin-bottom: .5rem;
  background: #f8f9fa;
  padding: 4px 6px;
  border-radius: 6px;
  border: 1px solid #dadce0;
  width: fit-content;
}

.toolbar button {
  border: 1.5px solid transparent;
  background: transparent;
  color: #444746;
  border-radius: 4px;
  padding: 4px 8px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  transition: all .1s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  line-height: 1;
}

.toolbar button:hover {
  background: #eaecef;
  color: #1f1f1f;
}

/* Distinct Google Docs / Word Active Button Highlighting */
.toolbar button.active {
  background: #c2e7ff !important;
  color: #001d35 !important;
  border-color: #0b57d0 !important;
  box-shadow: 0 1px 3px rgba(11, 87, 208, 0.25) !important;
}

.toolbar button.active b,
.toolbar button.active strong,
.toolbar button.active i,
.toolbar button.active em,
.toolbar button.active u {
  color: #001d35 !important;
  text-decoration-color: #001d35 !important;
}

.toolbar button svg {
  display: block;
}

/* ========================================================================= */
/* Formatted Text (Google Sheets / Word Style)                               */
/* ========================================================================= */

.answer {
  min-height: 48px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: .65rem .85rem;
  background: #fff;
  outline: none;
  font-size: 1.15rem;
  line-height: 1.6;
  color: #0f172a;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .04);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.answer:focus {
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

b, strong {
  font-weight: bold;
}

i, em {
  font-style: italic;
}

u {
  text-decoration: underline;
  text-underline-offset: 2.5px;
  text-decoration-thickness: 1.2px;
  color: inherit;
  background: transparent;
  padding: 0;
}

.correct {
  border-color: #22c55e !important;
  background: #f0fdf4 !important;
}
.wrong {
  border-color: #ef4444 !important;
  background: #fef2f2 !important;
}

.answer.locked {
  cursor: default;
  user-select: text;
}
.answer.locked:focus {
  box-shadow: none !important;
}

/* ========================================================================= */
/* Question Action Row (Check Answer Button)                                 */
/* ========================================================================= */

.question-actions {
  margin-top: .85rem;
  display: flex;
  align-items: center;
  gap: 12px;
}

.nav-btn {
  padding: .6rem 1.3rem;
  font-size: 1rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  transition: all .15s ease;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-btn.check-btn {
  background: #e8f0fe;
  color: #0b57d0;
  border: 1.5px solid #0b57d0;
}
.nav-btn.check-btn:hover:not(:disabled) {
  background: #d2e3fc;
}
.nav-btn.check-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* ========================================================================= */
/* Multi-Attempt Support (Attempt 1/2)                                      */
/* ========================================================================= */

.attempts-container {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.attempt-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.attempt-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.attempt-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.65rem;
  border-radius: 4px;
}

.attempt-tag.initial {
  background: #f1f5f9;
  color: #475569;
  border: 1px solid #cbd5e1;
}

.attempt-tag.active {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
}

.attempt-tag.wrong {
  background: #fee2e2;
  color: #b91c1c;
  border: 1px solid #fca5a5;
}

.attempt-tag.ok {
  background: #dcfce7;
  color: #15803d;
  border: 1px solid #86efac;
}

.answer[data-placeholder]:empty::before {
  content: attr(data-placeholder);
  color: #94a3b8;
  pointer-events: none;
  font-style: italic;
  font-weight: 400;
}

.answer.answer-empty-error {
  border-color: #ef4444 !important;
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.25) !important;
  animation: shakeError 0.35s ease-in-out;
}

.input-error-msg {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  background: #fef2f2;
  border: 1.5px solid #f87171;
  border-left: 4px solid #ef4444;
  color: #991b1b;
  padding: 0.65rem 0.95rem;
  border-radius: 6px;
  font-size: 0.93rem;
  font-weight: 600;
  line-height: 1.4;
  margin: 0.6rem 0 0.2rem;
  animation: modalFadeIn 0.15s ease-out;
}

.input-error-msg .error-icon {
  font-size: 1.2rem;
  line-height: 1;
  color: #dc2626;
  flex-shrink: 0;
}

@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

/* ========================================================================= */
/* Feedback & Comparison Box                                                 */
/* ========================================================================= */

.feedback {
  margin-top: .85rem;
  font-size: 1rem;
}
.feedback-msg {
  padding: .85rem 1.15rem;
  border-radius: 8px;
}
.feedback-msg.ok {
  background: #dcfce7;
  color: #15803d;
  font-weight: 600;
  border: 1px solid #bbf7d0;
}
.feedback-msg.no {
  background: #fef2f2;
  color: #991b1b;
  border: 1px solid #fecaca;
}
.feedback-header {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: .5rem;
}

/* Comparison Box */
.diff-box {
  margin-top: 0.65rem;
  background: #ffffff;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.diff-row {
  padding: 0.85rem 1.1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.diff-row:not(:last-child) {
  border-bottom: 1px solid #f1f5f9;
}

.diff-row.user-diff-row {
  /* Aligns flush with other diff-rows; no outer box or margin */
}

.diff-label {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.diff-label.user-label {
  color: #b91c1c;
}

.diff-label.user-label.correct-label {
  color: #15803d;
}

.diff-label.expected-label {
  color: #15803d;
}

.diff-content {
  font-size: 1.15rem;
  line-height: 1.6;
  color: #1e293b;
  word-break: break-word;
}

.user-answer-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 3.5px solid #dc2626;
  border-radius: 6px;
  padding: 0.55rem 0.85rem;
  font-size: 1.15rem;
  line-height: 1.6;
  color: #991b1b;
  word-break: break-word;
}

.user-answer-box.correct {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 3.5px solid #16a34a;
  color: #14532d;
}

.review-prompt {
  font-weight: 400;
  font-size: 1.1rem;
  color: #1e293b;
  margin-bottom: 0.35rem;
}

.accepted-list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.accepted-citation {
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-left: 3.5px solid #16a34a;
  border-radius: 6px;
  padding: 0.55rem 0.85rem;
  font-size: 1.15rem;
  line-height: 1.6;
  color: #14532d;
}

/* ========================================================================= */
/* Explanation Screenshot (Reasoning for Correct Answers)                    */
/* ========================================================================= */

.explanation-box {
  padding: 0.85rem 1.1rem 1.1rem;
  border-top: 1px solid #f1f5f9;
  width: 100%;
  box-sizing: border-box;
}

.explanation-header {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #000000;
  margin-bottom: 0.65rem;
  text-align: left;
}

.explanation-img-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0.25rem 0;
  text-align: center;
}

.explanation-img-wrap {
  display: inline-flex;
  justify-content: center;
  max-width: 100%;
}

.explanation-img {
  display: block;
  max-width: 100%;
  max-height: 480px;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  border: 1px solid #cbd5e1;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  cursor: zoom-in;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  background: #fff;
}

.explanation-img:hover {
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}

/* ========================================================================= */
/* Final Quiz Submission Container                                           */
/* ========================================================================= */

.quiz-submit-container {
  margin-top: 1.5rem;
  padding: 1.25rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 10px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.6rem;
  scroll-margin-top: 1.5rem;
}

.auto-submit-msg {
  font-size: 0.98rem;
  font-weight: 600;
  color: #16a34a;
  text-align: center;
}

.nav-btn.submit-btn {
  background: #16a34a;
  color: #fff;
  border: 1px solid #16a34a;
  padding: .75rem 2rem;
  font-size: 1.1rem;
}
.nav-btn.submit-btn:hover:not(:disabled) {
  background: #15803d;
}
.nav-btn.submit-btn:disabled {
  opacity: .6;
  cursor: not-allowed;
}

/* ========================================================================= */
/* Final Score / Results Container                                           */
/* ========================================================================= */

#score-box {
  margin-top: 1.5rem;
  padding: 1.5rem;
  border-radius: 12px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}
.score-header {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1e40af;
  text-align: center;
  margin-bottom: 1rem;
}
.results-summary {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}
.result-card {
  background: #fff;
  padding: 1.25rem;
  border-radius: 8px;
  border: 1px solid #e2e6ef;
}
.result-card.ok {
  border-left: 5px solid #16a34a;
}
.result-card.no {
  border-left: 5px solid #ef4444;
}

.retake-btn {
  display: block;
  margin: 1.5rem auto 0;
  background: #0b57d0;
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: .7rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
}
.retake-btn:hover {
  background: #0842a0;
}

/* ========================================================================= */
/* Submission Success Modal                                                  */
/* ========================================================================= */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  animation: modalFadeIn 0.2s ease-out;
}

.modal-card {
  background: #ffffff;
  border-radius: 14px;
  padding: 2.2rem 2rem;
  max-width: 440px;
  width: 90%;
  text-align: center;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.2), 0 10px 10px -5px rgba(0, 0, 0, 0.08);
  animation: modalScaleUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal-icon {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.8rem;
}

.modal-card h2 {
  margin: 0 0 0.5rem 0;
  font-size: 1.55rem;
  color: #0f172a;
}

.modal-desc {
  margin: 0 0 1.4rem 0;
  font-size: 0.96rem;
  color: #64748b;
  line-height: 1.45;
}

.modal-score-badge {
  background: #f0fdf4;
  border: 1.5px solid #86efac;
  border-radius: 10px;
  padding: 1rem 1.25rem;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: center;
}

.modal-score-label {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #166534;
}

.modal-score-val {
  font-size: 2.2rem;
  font-weight: 800;
  color: #15803d;
  line-height: 1.1;
}

.modal-btn {
  width: 100%;
  background: #2563eb;
  color: #ffffff;
  border: none;
  padding: 0.8rem 1.5rem;
  font-size: 1.05rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s;
}

.modal-btn:hover {
  background: #1d4ed8;
}

.modal-btn:active {
  transform: translateY(1px);
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalScaleUp {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* Deadline & Practice Mode Styles */
.start-deadline-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  color: #1e40af;
  padding: 0.55rem 0.95rem;
  border-radius: 8px;
  font-size: 0.92rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.start-deadline-badge strong {
  font-weight: 700;
  color: #1d4ed8;
}

.start-deadline-expired {
  margin-bottom: 1.25rem;
}

.practice-mode-banner {
  background: #fffbeb;
  border: 1.5px solid #fde68a;
  border-left: 5px solid #f59e0b;
  border-radius: 8px;
  padding: 0.9rem 1.1rem;
  text-align: left;
}

.practice-mode-title {
  font-weight: 700;
  font-size: 0.98rem;
  color: #92400e;
  margin-bottom: 0.35rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.practice-mode-desc {
  font-size: 0.88rem;
  color: #78350f;
  line-height: 1.45;
}

.start-btn.practice-mode-btn {
  background: #16a34a;
}

.start-btn.practice-mode-btn:hover {
  background: #15803d;
}

.badge-practice-pill {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
  padding: 0.15rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  margin-left: 0.35rem;
  vertical-align: middle;
}

.user-info-deadline {
  color: #64748b;
  font-size: 0.88rem;
  font-weight: 500;
}

.results-mode-badge {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  margin-top: 0.5rem;
  text-align: center;
}

.results-mode-badge.practice {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fcd34d;
}

.results-mode-badge.official {
  background: #ecfdf5;
  color: #065f46;
  border: 1px solid #a7f3d0;
}

/* Past Assignments Drawer */
.drawer-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(2px);
  z-index: 998;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.past-drawer {
  position: fixed;
  top: 0;
  left: 0;
  width: 390px;
  max-width: 88vw;
  height: 100vh;
  background: #ffffff;
  z-index: 999;
  display: flex;
  flex-direction: column;
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.18);
  transform: translateX(-100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

.past-drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 1.25rem 1.4rem;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  background: #f8fafc;
}

.drawer-header-title-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.drawer-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #0f172a;
}

.drawer-subtitle {
  font-size: 0.82rem;
  color: #64748b;
  font-weight: 500;
}

.drawer-close-btn {
  background: #f1f5f9;
  border: 1px solid #cbd5e1;
  color: #64748b;
  border-radius: 6px;
  width: 32px;
  height: 32px;
  font-size: 1.05rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.drawer-close-btn:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #b91c1c;
}

.drawer-content {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.drawer-section {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin-bottom: 0.65rem;
}

.drawer-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.2rem 0.2rem;
  border-bottom: 1.5px solid #e2e8f0;
  padding-bottom: 0.4rem;
}

.drawer-section-title {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #475569;
}

.drawer-section-badge {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  white-space: nowrap;
}

.drawer-section-badge.current-badge {
  background: #dbeafe;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

.drawer-section-badge.past-badge {
  background: #fef3c7;
  color: #92400e;
  border: 1px solid #fde68a;
}

.drawer-empty-inline {
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  padding: 1.25rem 1rem;
  text-align: center;
  color: #64748b;
}

.drawer-empty-inline-title {
  margin: 0 0 0.25rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
}

.drawer-empty-inline-desc {
  font-size: 0.8rem;
  color: #94a3b8;
  line-height: 1.4;
  display: block;
}

.drawer-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2.5rem 1rem;
  color: #64748b;
  font-size: 0.92rem;
  gap: 0.75rem;
}

.drawer-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #e2e8f0;
  border-top-color: #0b57d0;
  border-radius: 50%;
  animation: drawerSpin 0.75s linear infinite;
}

@keyframes drawerSpin {
  to { transform: rotate(360deg); }
}

.drawer-empty {
  text-align: center;
  padding: 2.5rem 1rem;
}

.drawer-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.drawer-empty-title {
  margin: 0 0 0.35rem;
  font-size: 1rem;
  font-weight: 700;
  color: #334155;
}

.drawer-empty-desc {
  font-size: 0.84rem;
  color: #64748b;
  line-height: 1.45;
  display: block;
}

.drawer-quiz-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.drawer-quiz-item {
  background: #ffffff;
  border: 1.5px solid #e2e8f0;
  border-radius: 10px;
  padding: 0.85rem 1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  text-align: left;
}

.drawer-quiz-item:hover {
  border-color: #3b82f6;
  background: #f8fafc;
  transform: translateY(-1px);
  box-shadow: 0 3px 10px rgba(59, 130, 246, 0.08);
}

.drawer-quiz-item.current-quiz {
  border-color: #10b981;
  background: #f0fdf4;
}

.drawer-quiz-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.drawer-quiz-title {
  font-size: 0.98rem;
  font-weight: 700;
  color: #0f172a;
}

.drawer-quiz-item.current-quiz .drawer-quiz-title {
  color: #065f46;
}

.drawer-current-badge {
  background: #d1fae5;
  color: #065f46;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 12px;
  white-space: nowrap;
}

.drawer-quiz-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 0.78rem;
}

.drawer-meta-pill {
  background: #eff6ff;
  color: #1e40af;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 600;
}

.drawer-deadline-pill {
  background: #fef3c7;
  color: #92400e;
  padding: 2px 7px;
  border-radius: 4px;
  font-weight: 500;
}

.drawer-quiz-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 0.15rem;
}

.drawer-practice-action {
  font-size: 0.82rem;
  font-weight: 600;
  color: #2563eb;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.drawer-quiz-item:hover .drawer-practice-action {
  color: #1d4ed8;
  text-decoration: underline;
}

.hidden { display: none !important; }