/* ==========================================================================
   2027 공인중개사 기출마스터 - Mobile-First PWA Design System
   ========================================================================== */

:root {
  --bg-page: #EEF2F7;
  --bg-app: #F8FAFC;
  --bg-card: #FFFFFF;
  --bg-subtle: #F1F5F9;
  --border: #E2E8F0;
  --border-strong: #CBD5E1;

  --text-primary: #0F172A;
  --text-secondary: #475569;
  --text-muted: #64748B;

  --primary: #1E3A8A;
  --primary-bright: #2563EB;
  --primary-soft: rgba(37, 99, 235, 0.1);

  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.12);
  --danger: #DC2626;
  --danger-soft: rgba(220, 38, 38, 0.12);
  --warning: #D97706;
  --warning-soft: rgba(217, 119, 6, 0.14);

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 6px 20px rgba(15, 23, 42, 0.08);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;

  --top-bar-h: 58px;
  --bottom-nav-h: 66px;
  --base-font: 15px;
}

html[data-font="1"] {
  --base-font: 13px;
}

html[data-font="2"] {
  --base-font: 14px;
}

html[data-font="3"] {
  --base-font: 15.5px;
}

html[data-font="4"] {
  --base-font: 17.5px;
}

html[data-font="5"] {
  --base-font: 20px;
}

/* Font Size 5-Step Picker */
.font-step-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 8px;
}

.font-step-btn {
  padding: 9px 4px;
  border-radius: 11px;
  border: 1.5px solid var(--border);
  background: var(--bg-app);
  color: var(--text-secondary);
  font-size: 0.76rem;
  font-weight: 700;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transition: all 0.15s ease;
}

.font-step-btn.active {
  border-color: var(--primary-bright);
  background: var(--primary-soft);
  color: var(--primary-bright);
}

.font-range {
  width: 100%;
  accent-color: var(--primary-bright);
  margin: 10px 0 4px;
  cursor: pointer;
}

.font-preview-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin: 12px 0 14px;
  line-height: 1.65;
  word-break: keep-all;
}

/* ==================== Admin Mode & Attendance Calendar ==================== */
.pin-screen {
  min-height: 75dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px 16px;
}

.pin-box {
  width: 100%;
  max-width: 340px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 20px;
  box-shadow: var(--shadow-md);
}

.pin-input {
  width: 100%;
  text-align: center;
  font-size: 1.6rem;
  font-weight: 900;
  letter-spacing: 0.45em;
  padding: 12px;
  border-radius: 14px;
  border: 2px solid var(--border-strong);
  background: var(--bg-app);
  margin: 14px 0 12px;
}

.pin-input:focus {
  outline: none;
  border-color: var(--primary-bright);
}

.admin-status-banner {
  border-radius: var(--radius-lg);
  padding: 18px;
  color: #FFFFFF;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
}

.admin-status-banner.done {
  background: linear-gradient(135deg, #047857, #10B981);
}

.admin-status-banner.progress {
  background: linear-gradient(135deg, #1E3A8A, #2563EB);
}

.admin-status-banner.absent {
  background: linear-gradient(135deg, #991B1B, #DC2626);
}

.cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  text-align: center;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
}

.cal-cell {
  min-height: 48px;
  border-radius: 11px;
  border: 1px solid var(--border);
  background: var(--bg-app);
  padding: 4px 2px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.76rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.cal-cell.empty {
  border: none;
  background: transparent;
  pointer-events: none;
}

.cal-cell.studied {
  background: var(--primary-soft);
  border-color: var(--primary-bright);
  color: var(--primary-bright);
}

.cal-cell.goal-met {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}

.cal-cell.today {
  box-shadow: 0 0 0 2px var(--primary-bright);
}

.cal-cell.selected {
  transform: scale(0.96);
  box-shadow: 0 0 0 2.5px var(--warning);
}

.cal-count {
  font-size: 0.66rem;
  font-weight: 800;
  line-height: 1;
}

.pwa-install-banner {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 9px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

html[data-theme="dark"] {
  --bg-page: #020617;
  --bg-app: #0B1120;
  --bg-card: #111827;
  --bg-subtle: #1E293B;
  --border: #1F2937;
  --border-strong: #334155;

  --text-primary: #F8FAFC;
  --text-secondary: #CBD5E1;
  --text-muted: #94A3B8;

  --primary: #3B82F6;
  --primary-bright: #60A5FA;
  --primary-soft: rgba(59, 130, 246, 0.18);

  --success: #34D399;
  --success-soft: rgba(16, 185, 129, 0.18);
  --danger: #F87171;
  --danger-soft: rgba(239, 68, 68, 0.18);
  --warning: #FBBF24;
  --warning-soft: rgba(245, 158, 11, 0.18);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
  font-size: var(--base-font);
  line-height: 1.55;
  color: var(--text-primary);
  background: var(--bg-page);
  min-height: 100%;
  overscroll-behavior-y: none;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

.hidden {
  display: none !important;
}

/* ==================== App Shell ==================== */
.app-shell {
  width: 100%;
  max-width: 500px;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--bg-app);
  position: relative;
  display: flex;
  flex-direction: column;
  box-shadow: 0 0 40px rgba(15, 23, 42, 0.1);
}

.top-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  height: calc(var(--top-bar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) 14px 0;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.top-bar-left, .top-bar-right {
  display: flex;
  align-items: center;
  gap: 6px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.brand-badge {
  font-size: 0.72rem;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--primary);
  color: #FFFFFF;
  letter-spacing: -0.02em;
}

#header-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 210px;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  transition: background 0.15s ease, color 0.15s ease;
}

.icon-btn:active {
  background: var(--bg-subtle);
  transform: scale(0.95);
}

.font-btn-label {
  font-weight: 800;
  font-size: 0.95rem;
  border: 1.5px solid currentColor;
  border-radius: 6px;
  padding: 0 5px;
  line-height: 1.3;
}

.main-content {
  flex: 1;
  padding: 16px 16px calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 22px);
}

/* ==================== Bottom Navigation ==================== */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 500px;
  height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  z-index: 35;
}

.nav-item {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--text-muted);
  font-size: 0.72rem;
  font-weight: 600;
  transition: color 0.15s ease;
}

.nav-item.active {
  color: var(--primary-bright);
  font-weight: 800;
}

.nav-item:active {
  transform: scale(0.94);
}

.nav-badge {
  position: absolute;
  top: 7px;
  right: calc(50% - 22px);
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--danger);
  color: #FFFFFF;
  font-size: 0.66rem;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ==================== Common Cards & Components ==================== */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 14px;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 10px;
}

.section-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 16px;
  border-radius: 13px;
  font-weight: 700;
  font-size: 0.92rem;
  transition: transform 0.12s ease, opacity 0.15s ease, background 0.15s ease;
}

.btn:active {
  transform: scale(0.97);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #1E3A8A, #2563EB);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
  background: var(--bg-subtle);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-danger {
  background: var(--danger);
  color: #FFFFFF;
}

.btn-success {
  background: var(--success);
  color: #FFFFFF;
}

.btn-outline {
  background: transparent;
  color: var(--primary-bright);
  border: 1.5px solid var(--primary-bright);
}

.btn-block {
  width: 100%;
}

.btn-sm {
  padding: 8px 12px;
  font-size: 0.82rem;
  border-radius: 10px;
}

.pill-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.pill-row::-webkit-scrollbar {
  display: none;
}

.pill {
  flex: 0 0 auto;
  padding: 7px 13px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border);
  transition: all 0.15s ease;
}

.pill.active {
  background: var(--primary-bright);
  color: #FFFFFF;
  border-color: var(--primary-bright);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 8px;
  font-size: 0.74rem;
  font-weight: 700;
}

.progress-track {
  width: 100%;
  height: 9px;
  border-radius: 999px;
  background: var(--bg-subtle);
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #2563EB, #60A5FA);
  transition: width 0.35s ease;
}

/* ==================== Dashboard Hero (D-Day) ==================== */
.hero-card {
  background: linear-gradient(135deg, #0F2557 0%, #1E3A8A 55%, #2563EB 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 20px;
  margin-bottom: 14px;
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 26px rgba(30, 58, 138, 0.28);
}

.hero-card::after {
  content: '';
  position: absolute;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  right: -35px;
  top: -45px;
  pointer-events: none;
}

.hero-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.hero-exam-label {
  font-size: 0.78rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.82);
}

.hero-dday {
  font-size: 2.15rem;
  font-weight: 900;
  letter-spacing: -0.04em;
  line-height: 1.1;
  margin: 4px 0 4px;
}

.hero-date {
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.85);
}

.streak-chip {
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(6px);
  padding: 6px 11px;
  border-radius: 12px;
  text-align: right;
  font-size: 0.76rem;
  font-weight: 700;
  white-space: nowrap;
}

.streak-chip strong {
  display: block;
  font-size: 1rem;
  color: #FDE68A;
}

.hero-goal {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.hero-goal-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.8rem;
  margin-bottom: 7px;
  color: rgba(255, 255, 255, 0.92);
}

.hero-goal .progress-track {
  background: rgba(255, 255, 255, 0.2);
}

.hero-goal .progress-fill {
  background: linear-gradient(90deg, #FBBF24, #FDE68A);
}

/* Quick Action Grid */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 14px;
}

.quick-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.12s ease, border-color 0.15s ease;
}

.quick-card:active {
  transform: scale(0.97);
}

.quick-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  font-weight: 800;
}

.quick-title {
  font-weight: 800;
  font-size: 0.93rem;
  color: var(--text-primary);
}

.quick-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
}

/* KPI Strip */
.kpi-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}

.kpi-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 10px;
  text-align: center;
}

.kpi-val {
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.kpi-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Subject Stat Row */
.subject-stat-item {
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}

.subject-stat-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.subject-stat-item:first-child {
  padding-top: 0;
}

.subject-stat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 7px;
}

.subject-name-wrap {
  display: flex;
  align-items: center;
  gap: 7px;
  font-weight: 700;
  font-size: 0.9rem;
}

.round-chip {
  font-size: 0.68rem;
  font-weight: 800;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.subject-score-badge {
  font-size: 0.82rem;
  font-weight: 800;
}

/* ==================== Quiz Solver ==================== */
.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.quiz-counter {
  font-size: 0.84rem;
  font-weight: 800;
  color: var(--text-secondary);
}

.question-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px 16px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-sm);
}

.question-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.question-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.question-text {
  margin: 0;
  font-size: 1.03rem;
  font-weight: 700;
  line-height: 1.65;
  color: var(--text-primary);
  word-break: keep-all;
  white-space: pre-line;
}

.bookmark-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

.bookmark-btn.active {
  background: var(--warning-soft);
  color: var(--warning);
}

/* Choice List */
.choice-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 14px;
}

.choice-row {
  display: flex;
  align-items: stretch;
  gap: 6px;
}

.choice-btn {
  flex: 1;
  display: flex;
  align-items: flex-start;
  gap: 11px;
  text-align: left;
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  color: var(--text-primary);
  line-height: 1.55;
  word-break: keep-all;
  transition: border-color 0.15s ease, background 0.15s ease, opacity 0.15s ease;
}

.choice-btn:active {
  transform: scale(0.99);
}

.choice-num {
  flex: 0 0 25px;
  height: 25px;
  border-radius: 50%;
  border: 1.5px solid var(--border-strong);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 800;
  margin-top: 1px;
  color: var(--text-secondary);
}

.choice-btn.selected {
  border-color: var(--primary-bright);
  background: var(--primary-soft);
}

.choice-btn.selected .choice-num {
  background: var(--primary-bright);
  border-color: var(--primary-bright);
  color: #FFFFFF;
}

.choice-btn.correct {
  border-color: var(--success);
  background: var(--success-soft);
}

.choice-btn.correct .choice-num {
  background: var(--success);
  border-color: var(--success);
  color: #FFFFFF;
}

.choice-btn.wrong {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.choice-btn.wrong .choice-num {
  background: var(--danger);
  border-color: var(--danger);
  color: #FFFFFF;
}

.choice-btn.eliminated {
  opacity: 0.45;
}

.choice-btn.eliminated .choice-text {
  text-decoration: line-through;
}

.eliminate-btn {
  width: 34px;
  flex: 0 0 34px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.eliminate-btn.active {
  background: var(--bg-subtle);
  color: var(--danger);
  border-color: var(--danger);
}

/* Explanation Panel */
.explanation-box {
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-left: 4px solid var(--primary-bright);
  border-radius: var(--radius-md);
  padding: 15px;
  margin-bottom: 14px;
  animation: fadeUp 0.2s ease;
}

.explanation-box.is-correct {
  border-left-color: var(--success);
}

.explanation-box.is-wrong {
  border-left-color: var(--danger);
}

.result-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 800;
  font-size: 0.96rem;
}

.result-banner.correct {
  color: var(--success);
}

.result-banner.wrong {
  color: var(--danger);
}

.explanation-text {
  margin: 0 0 10px;
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.65;
  word-break: keep-all;
}

.tip-box {
  background: var(--warning-soft);
  color: var(--text-primary);
  border-radius: 11px;
  padding: 10px 12px;
  font-size: 0.84rem;
  font-weight: 600;
  line-height: 1.5;
}

.tip-label {
  color: var(--warning);
  font-weight: 800;
  margin-right: 6px;
}

.note-box {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
}

.note-input {
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--bg-app);
  resize: vertical;
  font-size: 0.86rem;
}

.quiz-footer-nav {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 10px;
  margin-top: 8px;
}

/* ==================== OX Mode ==================== */
.ox-stage-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px 18px;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: var(--shadow-md);
  margin-bottom: 16px;
}

.ox-statement {
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.7;
  word-break: keep-all;
  margin: 10px 0 0;
}

.ox-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}

.ox-btn {
  height: 76px;
  border-radius: 18px;
  font-size: 1.85rem;
  font-weight: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: transform 0.12s ease, opacity 0.15s ease;
}

.ox-btn small {
  font-size: 0.74rem;
  font-weight: 700;
  margin-top: 4px;
  opacity: 0.85;
}

.ox-btn:active {
  transform: scale(0.96);
}

.ox-btn-o {
  background: var(--success-soft);
  color: var(--success);
  border: 2px solid var(--success);
}

.ox-btn-x {
  background: var(--danger-soft);
  color: var(--danger);
  border: 2px solid var(--danger);
}

.ox-btn.picked-correct {
  background: var(--success);
  color: #FFFFFF;
}

.ox-btn.picked-wrong {
  background: var(--danger);
  color: #FFFFFF;
}

/* ==================== Mock Exam & OMR ==================== */
.mock-sticky-bar {
  position: sticky;
  top: calc(var(--top-bar-h) + env(safe-area-inset-top, 0px));
  z-index: 20;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  box-shadow: var(--shadow-sm);
}

.timer-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-variant-numeric: tabular-nums;
  font-weight: 900;
  font-size: 1rem;
  color: var(--primary-bright);
}

.timer-badge.urgent {
  color: var(--danger);
  animation: pulse 1s infinite;
}

.omr-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin: 14px 0;
}

.omr-cell {
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 8px 4px;
  text-align: center;
  background: var(--bg-app);
  font-size: 0.78rem;
  font-weight: 700;
}

.omr-cell.answered {
  border-color: var(--primary-bright);
  background: var(--primary-soft);
  color: var(--primary-bright);
}

.omr-cell.current {
  box-shadow: 0 0 0 2px var(--primary-bright);
}

.omr-cell strong {
  display: block;
  font-size: 0.88rem;
}

.pass-banner {
  border-radius: var(--radius-lg);
  padding: 22px 18px;
  text-align: center;
  color: #FFFFFF;
  margin-bottom: 16px;
}

.pass-banner.pass {
  background: linear-gradient(135deg, #047857, #10B981);
}

.pass-banner.fail {
  background: linear-gradient(135deg, #B91C1C, #EF4444);
}

.pass-banner h2 {
  margin: 4px 0 6px;
  font-size: 1.55rem;
  font-weight: 900;
}

/* ==================== Review List ==================== */
.review-item {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 10px;
}

.review-q-preview {
  margin: 8px 0 10px;
  font-size: 0.92rem;
  font-weight: 700;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.review-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.empty-state {
  text-align: center;
  padding: 42px 20px;
  color: var(--text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
}

/* ==================== Modal & Toast ==================== */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-sheet {
  width: 100%;
  max-width: 500px;
  max-height: 86dvh;
  overflow-y: auto;
  background: var(--bg-card);
  border-radius: 24px 24px 0 0;
  padding: 18px 18px calc(22px + env(safe-area-inset-bottom, 0px));
  animation: slideUp 0.22s ease;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.modal-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 800;
}

.form-group {
  margin-bottom: 14px;
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border-radius: 11px;
  border: 1px solid var(--border-strong);
  background: var(--bg-app);
  color: var(--text-primary);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px) + 14px);
  transform: translateX(-50%);
  z-index: 80;
  background: #0F172A;
  color: #FFFFFF;
  padding: 10px 16px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  white-space: nowrap;
  max-width: 90vw;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

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

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

/* ==================== Multi-Student Admin Coaching ==================== */
.overview-hero {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 60%, #1E3A8A 100%);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.25);
}

.overview-kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.overview-kpi {
  background: rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  padding: 10px 8px;
  text-align: center;
}

.overview-kpi strong {
  display: block;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1.2;
}

.overview-kpi span {
  font-size: 0.72rem;
  opacity: 0.85;
}

.student-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--border-strong);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--shadow-sm);
}

.student-card.status-done {
  border-left-color: var(--success);
}

.student-card.status-progress {
  border-left-color: var(--primary-bright);
}

.student-card.status-absent {
  border-left-color: var(--danger);
}

.student-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 8px;
}

.student-card-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.student-switcher {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding-bottom: 4px;
  margin-bottom: 12px;
  scrollbar-width: none;
}

.student-switcher::-webkit-scrollbar {
  display: none;
}

.student-pill {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}

.student-pill.active {
  background: #0F172A;
  color: #FFFFFF;
  border-color: #0F172A;
}

html[data-theme="dark"] .student-pill.active {
  background: var(--primary-bright);
  border-color: var(--primary-bright);
  color: #0B1120;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}

.status-dot.done { background: var(--success); }
.status-dot.progress { background: var(--primary-bright); }
.status-dot.absent { background: var(--danger); }
.status-dot.ended { background: #64748B; }

.student-card.status-ended {
  border-left-color: #64748B;
  opacity: 0.78;
  background: var(--bg-subtle);
}

.student-card-actions-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 10px;
}

.admin-status-banner.ended {
  background: linear-gradient(135deg, #334155, #475569);
  color: #FFFFFF;
}

/* ==================== Student App Consulting Ended Lock ==================== */
.access-ended-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: linear-gradient(160deg, #0F172A 0%, #1E293B 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 18px;
}

.access-ended-card {
  width: 100%;
  max-width: 400px;
  background: var(--bg-card);
  color: var(--text-primary);
  border-radius: 22px;
  padding: 28px 22px;
  text-align: center;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.45);
}

.access-ended-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 14px;
  border-radius: 20px;
  background: var(--danger-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}

.access-ended-title {
  margin: 0 0 8px;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.access-ended-badge {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.78rem;
  font-weight: 700;
  margin-bottom: 14px;
}

.access-ended-desc {
  margin: 0 0 20px;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.65;
  white-space: pre-line;
  word-break: keep-all;
}

.roster-item {
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 12px;
  background: var(--bg-subtle);
  margin-bottom: 10px;
}

.roster-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
