:root[data-theme="dark"] {
  --bg: #0b1120;
  --bg-elev: #111827;
  --bg-card: #162033;
  --bg-hover: #1e2b45;
  --border: #263552;
  --text: #f1f5f9;
  --text-muted: #94a3b8;
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --primary-soft: rgba(59, 130, 246, 0.16);
  --success: #10b981;
  --success-soft: rgba(16, 185, 129, 0.16);
  --danger: #ef4444;
  --danger-soft: rgba(239, 68, 68, 0.16);
  --warning: #f59e0b;
  --warning-soft: rgba(245, 158, 11, 0.16);
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

:root[data-theme="light"] {
  --bg: #f1f5f9;
  --bg-elev: #ffffff;
  --bg-card: #ffffff;
  --bg-hover: #f8fafc;
  --border: #dbe3ee;
  --text: #0f172a;
  --text-muted: #475569;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --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.11);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.13);
  --shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.55;
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--text-muted);
}

/* ==================== AUTH SCREEN ==================== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  background: radial-gradient(circle at top, var(--primary-soft), transparent 60%);
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 2rem;
  box-shadow: var(--shadow);
}

.auth-brand {
  text-align: center;
  margin-bottom: 1.25rem;
}

.brand-badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  margin-bottom: 0.65rem;
}

.auth-brand h1 {
  font-size: 1.55rem;
  margin-bottom: 0.35rem;
}

.bank-pill {
  text-align: center;
  font-size: 0.85rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 600;
  margin-bottom: 1.25rem;
}

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--bg);
  padding: 0.25rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

.auth-tab {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.6rem;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: 0.15s;
}

.auth-tab.active {
  background: var(--primary);
  color: #fff;
}

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

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  margin-bottom: 0.38rem;
}

input[type="text"],
input[type="password"],
input[type="search"],
select {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.15s;
}

input:focus,
select:focus {
  border-color: var(--primary);
}

/* ==================== BUTTONS & ALERTS ==================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.6rem 1.05rem;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
}

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

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}
.btn-primary:hover:not(:disabled) {
  background: var(--primary-hover);
}

.btn-secondary {
  background: var(--bg-hover);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover:not(:disabled) {
  border-color: var(--primary);
}

.btn-danger {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.35);
}
.btn-danger:hover:not(:disabled) {
  background: var(--danger);
  color: #fff;
}

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

.btn-sm {
  padding: 0.4rem 0.75rem;
  font-size: 0.83rem;
  border-radius: 8px;
}

.btn-lg {
  padding: 0.8rem 1.35rem;
  font-size: 1rem;
}

.btn-block {
  width: 100%;
}

.alert {
  padding: 0.75rem 1rem;
  border-radius: 10px;
  font-size: 0.9rem;
  margin-bottom: 1rem;
}

.alert-error {
  background: var(--danger-soft);
  color: var(--danger);
  border: 1px solid rgba(239, 68, 68, 0.35);
}

/* ==================== TOPBAR & BREADCRUMBS ==================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-elev);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0.7rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  flex-wrap: wrap;
}

.brand-cluster {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
}

.brand-logo {
  font-size: 1.55rem;
}

.brand-title {
  font-weight: 800;
  font-size: 1.05rem;
  line-height: 1.15;
}

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

.breadcrumb-bar {
  background: var(--bg);
  border-top: 1px solid var(--border);
}

.breadcrumb-inner {
  max-width: 1260px;
  margin: 0 auto;
  padding: 0.45rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
}

.crumb-link {
  background: transparent;
  border: none;
  color: var(--primary);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
  border-radius: 6px;
}

.crumb-link:hover {
  background: var(--primary-soft);
}

.crumb-current {
  font-weight: 700;
  color: var(--text);
  padding: 0.15rem 0.35rem;
}

.crumb-sep {
  color: var(--text-muted);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.nav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 0.85rem;
  border-radius: 9px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: 0.15s;
}

.nav-btn:hover {
  background: var(--bg-hover);
  color: var(--text);
}

.nav-btn.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.badge-pill {
  background: var(--danger);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.08rem 0.45rem;
  border-radius: 999px;
}

.user-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-btn {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  width: 36px;
  height: 36px;
  border-radius: 9px;
  cursor: pointer;
  font-size: 1rem;
}

.user-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.32rem 0.75rem 0.32rem 0.38rem;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  font-size: 0.86rem;
}

.user-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
}

/* ==================== MAIN CONTAINER & CARDS ==================== */
.main-container {
  max-width: 1260px;
  margin: 0 auto;
  padding: 1.5rem 1.2rem 3.5rem;
}

.section-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.35rem;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 800;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 1.25rem;
  box-shadow: var(--shadow);
}

/* ==================== LEVEL 1: SUBJECTS PORTAL ==================== */
.subjects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
  gap: 1.15rem;
}

.subject-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.35rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease;
  box-shadow: var(--shadow);
}

.subject-card:hover {
  transform: translateY(-3px);
  border-color: var(--primary);
}

.subject-card.subject-ready {
  border-color: rgba(59, 130, 246, 0.5);
}

.subject-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.85rem;
}

.subject-icon-box {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  background: var(--primary-soft);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.55rem;
  flex-shrink: 0;
}

.status-pill {
  font-size: 0.74rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  white-space: nowrap;
}

.status-pill.pill-active {
  background: var(--success-soft);
  color: var(--success);
}

.status-pill.pill-empty {
  background: var(--bg);
  color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ==================== LEVEL 2: EXAM BLOCKS CARDS ==================== */
.exam-blocks-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 480px) {
  .subjects-grid,
  .exam-blocks-grid {
    grid-template-columns: 1fr;
  }
}

.exam-block-card {
  background: var(--bg-card);
  border: 2px solid var(--border);
  border-radius: 16px;
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1.1rem;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s;
}

.exam-block-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.included-topics-list {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  padding: 0.75rem 0.9rem;
  border-radius: 11px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-size: 0.86rem;
}

.included-topic-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

/* ==================== KPI & STUDY GRIDS ==================== */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.kpi-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.15rem;
}

.kpi-card.kpi-danger {
  border-color: rgba(239, 68, 68, 0.45);
}

.kpi-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.kpi-value {
  font-size: 1.85rem;
  font-weight: 800;
  margin: 0.25rem 0;
}

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

.progress-track {
  width: 100%;
  height: 8px;
  background: var(--bg);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 0.55rem;
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 999px;
  transition: width 0.3s ease;
}

.progress-fill.fill-success {
  background: var(--success);
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.9rem;
  margin-bottom: 1.75rem;
}

.quick-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.1rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.85rem;
  transition: transform 0.15s, border-color 0.15s;
}

.quick-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
}

.quick-card h3 {
  font-size: 1.02rem;
  margin-bottom: 0.25rem;
}

.quick-card p {
  font-size: 0.86rem;
  color: var(--text-muted);
}

.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 1.1rem;
  margin-bottom: 1.75rem;
}

.topic-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 15px;
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}

.topic-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.ud-tag {
  display: inline-block;
  padding: 0.2rem 0.55rem;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.78rem;
  margin-bottom: 0.35rem;
}

.topic-stats-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.stat-chip {
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
}

.stat-chip.chip-fail {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: transparent;
  font-weight: 600;
}

.topic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.resume-banner {
  background: var(--primary-soft);
  border: 1px solid var(--primary);
  border-radius: 14px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

/* ==================== QUIZ BUILDER ==================== */
.builder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 1.2rem;
}

.radio-cards {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.radio-card {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
}

.radio-card:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.count-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.count-pill {
  padding: 0.5rem 0.9rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 700;
  cursor: pointer;
}

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

/* ==================== QUIZ RUNNER ==================== */
.quiz-layout {
  display: grid;
  grid-template-columns: 1fr 290px;
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 920px) {
  .quiz-layout {
    grid-template-columns: 1fr;
  }
}

.quiz-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.question-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 0.9rem;
}

.meta-tag {
  font-size: 0.77rem;
  font-weight: 700;
  padding: 0.22rem 0.6rem;
  border-radius: 6px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.meta-tag.tag-warn {
  background: var(--warning-soft);
  color: var(--warning);
  border-color: transparent;
}

.question-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 1.25rem;
  line-height: 1.45;
}

.options-list {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.option-btn {
  width: 100%;
  text-align: left;
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.95rem 1.05rem;
  border-radius: 12px;
  border: 2px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.97rem;
  line-height: 1.45;
  cursor: pointer;
  transition: all 0.14s ease;
}

.option-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: var(--bg-hover);
}

.option-letter {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 7px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
}

.option-btn.selected {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.option-btn.selected .option-letter {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.option-btn.correct {
  border-color: var(--success) !important;
  background: var(--success-soft) !important;
}
.option-btn.correct .option-letter {
  background: var(--success) !important;
  border-color: var(--success) !important;
  color: #fff !important;
}

.option-btn.wrong {
  border-color: var(--danger) !important;
  background: var(--danger-soft) !important;
}
.option-btn.wrong .option-letter {
  background: var(--danger) !important;
  border-color: var(--danger) !important;
  color: #fff !important;
}

.explanation-box {
  margin-top: 1.2rem;
  padding: 1rem 1.15rem;
  border-radius: 12px;
  border-left: 4px solid var(--primary);
  background: var(--bg);
}

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

.quiz-footer {
  margin-top: 1.35rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.qnav-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.4rem;
  margin-top: 0.75rem;
}

.qnav-cell {
  height: 36px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-weight: 700;
  font-size: 0.82rem;
  cursor: pointer;
  position: relative;
}

.qnav-cell.current {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}

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

.qnav-cell.right {
  background: var(--success-soft);
  border-color: var(--success);
  color: var(--success);
}

.qnav-cell.wrong {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--danger);
}

.qnav-cell.flagged::after {
  content: "";
  position: absolute;
  top: 3px;
  right: 3px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--warning);
}

.shortcut-hint {
  margin-top: 0.9rem;
  font-size: 0.77rem;
  color: var(--text-muted);
}

/* ==================== RESULTS & FAILURE CARDS ==================== */
.score-hero {
  text-align: center;
  padding: 1.6rem 1rem;
  margin-bottom: 1.4rem;
}

.score-big {
  font-size: 3.1rem;
  font-weight: 900;
  line-height: 1.05;
}

.score-pass {
  color: var(--success);
}
.score-fail {
  color: var(--danger);
}

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

.failure-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 1.2rem;
}

.ans-compare {
  margin-top: 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.92rem;
}

.ans-wrong-line {
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  background: var(--danger-soft);
  color: var(--danger);
}

.ans-right-line {
  padding: 0.55rem 0.8rem;
  border-radius: 8px;
  background: var(--success-soft);
  color: var(--success);
  font-weight: 600;
}

/* ==================== NOTES READER ==================== */
.notes-body {
  line-height: 1.7;
  font-size: 0.98rem;
}
.notes-body h1 {
  font-size: 1.5rem;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border);
}
.notes-body h2 {
  font-size: 1.22rem;
  margin: 1.4rem 0 0.6rem;
  color: var(--primary);
}
.notes-body h3 {
  font-size: 1.05rem;
  margin: 1.1rem 0 0.45rem;
}
.notes-body ul, .notes-body ol {
  padding-left: 1.4rem;
  margin-bottom: 0.85rem;
}
.notes-body li {
  margin-bottom: 0.35rem;
}
.notes-body p {
  margin-bottom: 0.75rem;
}
.notes-body code {
  padding: 0.14rem 0.4rem;
  border-radius: 5px;
  background: var(--bg);
  border: 1px solid var(--border);
  font-family: Consolas, Monaco, monospace;
  font-size: 0.88em;
}

/* ==================== TABLES ==================== */
.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

th, td {
  text-align: left;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
}

th {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

/* ==================== TOASTS ==================== */
.toast-container {
  position: fixed;
  bottom: 1.25rem;
  right: 1.25rem;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.toast {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-left: 4px solid var(--primary);
  color: var(--text);
  padding: 0.75rem 1rem;
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 0.9rem;
  font-weight: 600;
  max-width: 340px;
}

.toast.toast-success {
  border-left-color: var(--success);
}
.toast.toast-error {
  border-left-color: var(--danger);
}


/* ==================== LINUX TERMINAL SIMULATOR & LIVE TUTOR ==================== */
.linux-lab-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 1fr);
  gap: 1.15rem;
  align-items: start;
}

@media (max-width: 980px) {
  .linux-lab-grid {
    grid-template-columns: 1fr;
  }
}

.linux-window {
  background: #0b1120;
  border: 1px solid #1e293b;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 18px 36px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
}

.linux-window-bar {
  background: #111827;
  border-bottom: 1px solid #1e293b;
  padding: 0.6rem 0.95rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.linux-dots {
  display: flex;
  align-items: center;
  gap: 0.42rem;
}

.linux-dots span {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  display: inline-block;
}
.dot-red { background: #ef4444; }
.dot-yellow { background: #f59e0b; }
.dot-green { background: #22c55e; }

.linux-window-title {
  font-family: Consolas, 'JetBrains Mono', Monaco, monospace;
  font-size: 0.82rem;
  color: #cbd5e1;
  font-weight: 600;
}

.linux-body-wrap {
  position: relative;
  padding: 0.95rem 1.05rem;
  min-height: 470px;
  max-height: 600px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-family: Consolas, 'JetBrains Mono', 'Courier New', monospace;
  font-size: 0.9rem;
  color: #e2e8f0;
}

.linux-term-output {
  flex: 1;
  overflow-y: auto;
  padding-right: 0.35rem;
  margin-bottom: 0.65rem;
}

.term-banner {
  color: #93c5fd;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 0.84rem;
  line-height: 1.48;
  margin-bottom: 0.85rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px dashed #1e293b;
}

.term-info-line {
  color: #fcd34d;
  font-size: 0.85rem;
  margin: 0.35rem 0;
  white-space: pre-wrap;
}

.term-block {
  margin-bottom: 0.6rem;
}

.term-cmdline {
  line-height: 1.45;
  word-break: break-all;
}

.term-user {
  color: #4ade80;
  font-weight: 700;
}

.term-user.term-root {
  color: #f87171;
}

.term-path {
  color: #60a5fa;
  font-weight: 700;
}

.term-sym {
  color: #cbd5e1;
  margin-left: 1px;
}

.term-cmd-typed {
  color: #f8fafc;
}

.term-stdout {
  color: #e2e8f0;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  margin: 0.2rem 0 0;
  line-height: 1.42;
}

.term-stderr {
  color: #fca5a5;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  margin: 0.2rem 0 0;
  line-height: 1.42;
}

.linux-input-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-top: 1px solid #1e293b;
  padding-top: 0.6rem;
}

.linux-prompt-label {
  white-space: nowrap;
  flex-shrink: 0;
}

.linux-cmd-input {
  flex: 1;
  background: transparent !important;
  border: none !important;
  outline: none !important;
  color: #f8fafc !important;
  font-family: Consolas, 'JetBrains Mono', 'Courier New', monospace !important;
  font-size: 0.92rem !important;
  padding: 0.2rem 0 !important;
}

.linux-cmd-input::placeholder {
  color: #64748b;
}

.linux-live-hint-bar {
  background: #0f172a;
  border-top: 1px solid #1e293b;
  padding: 0.55rem 0.95rem;
  font-size: 0.82rem;
  color: #cbd5e1;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.term-mini-chip {
  background: rgba(59, 130, 246, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.35);
  color: #93c5fd;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.78rem;
  padding: 0.18rem 0.55rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.14s;
}

[data-theme="light"] .linux-side-panel .term-mini-chip {
  color: #1d4ed8;
  background: rgba(37, 99, 235, 0.1);
}

.term-mini-chip:hover {
  background: rgba(59, 130, 246, 0.32);
}

/* Nano Overlay Editor */
.nano-modal-host {
  position: absolute;
  inset: 0;
  background: #0b1120;
  z-index: 15;
  display: flex;
  flex-direction: column;
}

.nano-editor {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0.65rem;
}

.nano-header {
  background: #e2e8f0;
  color: #0f172a;
  padding: 0.32rem 0.7rem;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  margin-bottom: 0.5rem;
}

.nano-textarea {
  flex: 1;
  width: 100%;
  resize: none;
  background: #020617 !important;
  color: #f8fafc !important;
  border: 1px solid #334155 !important;
  border-radius: 8px;
  padding: 0.75rem;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.88rem;
  line-height: 1.48;
}

.nano-footer {
  margin-top: 0.55rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

/* Side Assistant Panel */
.linux-side-panel {
  padding: 1rem;
}

.term-side-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.35rem;
  margin-bottom: 0.9rem;
  background: var(--bg);
  padding: 0.28rem;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.term-tab-btn {
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.48rem 0.35rem;
  border-radius: 7px;
  cursor: pointer;
}

.term-tab-btn.active {
  background: var(--primary);
  color: #fff;
}

.tutor-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
}

.tutor-breakdown-list {
  margin: 0.7rem 0 0;
  padding-left: 1.15rem;
  font-size: 0.84rem;
  line-height: 1.48;
}

.tutor-breakdown-list li {
  margin-bottom: 0.35rem;
}

.tutor-exam-box {
  margin-top: 0.85rem;
  padding: 0.65rem 0.8rem;
  border-radius: 9px;
  background: var(--primary-soft);
  border-left: 3px solid var(--primary);
  font-size: 0.83rem;
  line-height: 1.45;
}

.quick-cmd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.42rem;
}

.lab-steps-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.lab-step-item {
  padding: 0.7rem 0.8rem;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  font-size: 0.85rem;
  line-height: 1.42;
}

.lab-step-item.step-done {
  border-color: rgba(34, 197, 94, 0.55);
  background: var(--success-soft);
}

.lab-hint-box {
  margin: 0.55rem 0 0;
  padding: 0.5rem 0.65rem;
  border-radius: 7px;
  background: #0f172a;
  color: #93c5fd;
  font-family: Consolas, Monaco, monospace;
  font-size: 0.79rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.cheat-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  max-height: 460px;
  overflow-y: auto;
  padding-right: 0.25rem;
}
