.boot {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  color: var(--muted);
  font-size: 14px;
  font-weight: 500;
}

/* AUTHENTICATION SPLIT LAYOUT */
.auth-view {
  display: grid;
  grid-template-columns: 1.08fr 1fr;
  min-height: 100dvh;
  background: var(--bg);
}

.auth-story {
  background: radial-gradient(circle at 15% 15%, #1e1b4b 0%, #0f172a 60%, #090d16 100%);
  color: #f8fafc;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 40px;
  position: relative;
  overflow: hidden;
}

.auth-hero-body {
  max-width: 540px;
}

.hero-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: #5eead4;
  background: rgba(20, 184, 166, 0.14);
  border: 1px solid rgba(94, 234, 212, 0.28);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}

.auth-story h1 {
  color: #ffffff;
  font-size: 38px;
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.03em;
  margin: 0 0 16px;
}

.auth-hero-lead {
  font-size: 15px;
  line-height: 1.7;
  color: #cbd5e1;
  margin: 0 0 32px;
}

.learning-path {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.path-card {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 16px 18px;
  border-radius: var(--radius-md);
  background: rgba(30, 41, 59, 0.65);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.path-num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: rgba(99, 102, 241, 0.22);
  border: 1px solid rgba(129, 140, 248, 0.4);
  color: #a5b4fc;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}

.path-card strong {
  display: block;
  font-size: 14px;
  font-weight: 700;
  color: #f8fafc;
  margin-bottom: 3px;
}

.path-card small {
  display: block;
  font-size: 13px;
  line-height: 1.5;
  color: #94a3b8;
}

.auth-footer-meta {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: #94a3b8;
  padding-top: 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.15);
}

.auth-footer-meta strong {
  color: #e2e8f0;
}

.auth-side {
  display: grid;
  place-items: center;
  padding: 40px 32px;
}

.auth-card {
  max-width: 430px;
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 34px;
  box-shadow: var(--shadow-lg);
}

.auth-card-header h2 {
  font-size: 26px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 8px;
  color: var(--ink);
}

.auth-card-header p:not(.eyebrow) {
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.55;
  margin: 0;
}

.auth-switch {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-subtle);
  border: 1px solid var(--line);
  padding: 4px;
  border-radius: var(--radius-sm);
  gap: 4px;
  margin: 22px 0;
}

.auth-switch button {
  background: transparent;
  border: 0;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  border-radius: 6px;
}

.auth-switch button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.auth-card input,
.settings-card input,
.settings-card select,
.settings-card textarea,
dialog input,
dialog textarea,
dialog select {
  display: block;
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--ink);
  padding: 11px 13px;
  margin-bottom: 16px;
  line-height: 1.45;
  font-size: 14px;
}

.auth-card input:focus,
.settings-card input:focus,
.settings-card select:focus,
.settings-card textarea:focus,
dialog input:focus,
dialog textarea:focus,
dialog select:focus {
  background: var(--surface);
  border-color: var(--primary);
}

.settings-card select,
dialog select {
  height: 44px;
  padding: 0 12px;
}

.settings-card textarea,
dialog textarea {
  resize: vertical;
}

#password-hint {
  margin-top: -10px;
  margin-bottom: 12px;
}

.demo-access-box {
  margin-top: 20px;
}

.demo-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.demo-divider::before,
.demo-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.demo-button {
  width: 100%;
  height: 42px;
  justify-content: space-between;
  padding: 0 16px;
  background: var(--teal-soft);
  border-color: #99f6e4;
  color: #0f766e;
  font-size: 13px;
}

.demo-button:not(:disabled):hover {
  background: #ccfbf1;
  border-color: #5eead4;
  color: #115e59;
}

.auth-note {
  margin: 18px 0 0;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

/* SIDEBAR NAVIGATION */
.sidebar {
  width: 264px;
  height: 100dvh;
  position: fixed;
  inset: 0 auto 0 0;
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  color: var(--sidebar-text);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  z-index: 30;
}

.sidebar-brand {
  padding: 4px 10px 22px;
  border-bottom: 1px solid #1e293b;
  margin-bottom: 18px;
}

.sidebar-caption,
.sidebar-course-heading {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--sidebar-muted);
}

.sidebar-caption {
  margin: 0 12px 10px;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  width: 100%;
  border: 0;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
  background: transparent;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.nav-item.active {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.24) 0%, rgba(20, 184, 166, 0.16) 100%);
  color: #ffffff;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(129, 140, 248, 0.35);
}

.nav-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.9;
}

.sidebar-course-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #1e293b;
  margin: 20px 10px 10px;
  padding-top: 18px;
}

.sidebar-course-heading button {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid #334155;
  background: #1e293b;
  color: #e2e8f0;
  font-size: 16px;
  line-height: 1;
  display: grid;
  place-items: center;
}

.sidebar-course-heading button:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.sidebar-courses {
  overflow-y: auto;
  min-height: 60px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.sidebar-courses button {
  background: transparent;
  border: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  padding: 9px 12px;
  color: var(--sidebar-text);
  text-align: left;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-sm);
}

.sidebar-courses button:hover {
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
}

.sidebar-courses button.active {
  color: #ffffff;
  background: #1e293b;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #6366f1;
}

.sidebar-course-label {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-course-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #6366f1;
  flex-shrink: 0;
}

.sidebar-course-dot[data-subject="physics"] { background: #0ea5e9; }
.sidebar-course-dot[data-subject="chemistry"] { background: #f59e0b; }
.sidebar-course-dot[data-subject="biology"] { background: #10b981; }
.sidebar-course-dot[data-subject="english"] { background: #f43f5e; }

.sidebar-course-badge {
  font-size: 11px;
  font-weight: 600;
  color: #94a3b8;
  background: rgba(255, 255, 255, 0.07);
  padding: 1px 7px;
  border-radius: 999px;
  flex-shrink: 0;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid #1e293b;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-logout:hover {
  background: rgba(239, 68, 68, 0.14);
  color: #fca5a5;
}

/* WORKSPACE & TOPBAR */
.workspace {
  margin-left: 264px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.topbar {
  height: 68px;
  padding: 0 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.breadcrumb-icon {
  color: var(--primary);
  font-size: 16px;
}

.breadcrumb {
  color: var(--ink-secondary);
  font-size: 14px;
  font-weight: 600;
}

.profile-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 14px 5px 6px;
  color: var(--ink);
}

.profile-chip:hover {
  border-color: #a5b4fc;
  background: var(--primary-soft);
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, #4f46e5 0%, #0d9488 100%);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.profile-chip-meta {
  display: flex;
  flex-direction: column;
  text-align: left;
  line-height: 1.2;
}

.profile-chip-meta strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.profile-chip-meta small {
  font-size: 11px;
  color: var(--muted);
}

main {
  max-width: 1440px;
  width: 100%;
  margin: 0 auto;
  padding: 32px 40px 0;
  flex: 1;
}

.page-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.heading-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

/* KPI STATS GRID */
.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: var(--shadow-sm);
}

.stat-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 20px;
  flex-shrink: 0;
}

.stat-indigo { background: var(--primary-soft); color: var(--primary); }
.stat-teal { background: var(--teal-soft); color: var(--teal); }
.stat-amber { background: var(--amber-soft); color: var(--amber); }
.stat-emerald { background: var(--emerald-soft); color: var(--emerald); font-weight: 800; }

.stat-card strong {
  display: block;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.stat-card span {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  margin-top: 3px;
}

/* SECTION HEADING & COURSE FILTER BAR */
.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin: 8px 0 18px;
}

.section-heading h2,
.settings-card h2 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 20px;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--ink);
}

.course-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.subject-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-pill {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink-secondary);
  border-radius: 999px;
  padding: 6px 13px;
  font-size: 12.5px;
  font-weight: 600;
}

.filter-pill:hover {
  border-color: #a5b4fc;
  color: var(--primary);
}

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

.course-search {
  height: 36px;
  width: 220px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 14px;
  background: var(--surface);
  font-size: 13px;
  color: var(--ink);
}

/* COURSE CARDS GRID */
.course-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 18px;
}

.course-card {
  border: 1px solid var(--line);
  border-top: 4px solid var(--primary);
  border-radius: var(--radius-md);
  background: var(--surface);
  padding: 22px;
  text-align: left;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 230px;
  position: relative;
  color: var(--ink);
  box-shadow: var(--shadow-sm);
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease;
}

.course-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.course-card[data-subject="physics"] { border-top-color: #0ea5e9; }
.course-card[data-subject="chemistry"] { border-top-color: #f59e0b; }
.course-card[data-subject="biology"] { border-top-color: #10b981; }
.course-card[data-subject="english"] { border-top-color: #f43f5e; }

.course-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.course-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
}

.course-card[data-subject="physics"] .course-icon { background: #e0f2fe; color: #0284c7; }
.course-card[data-subject="chemistry"] .course-icon { background: #fef3c7; color: #d97706; }
.course-card[data-subject="biology"] .course-icon { background: #d1fae5; color: #059669; }
.course-card[data-subject="english"] .course-icon { background: #ffe4e6; color: #e11d48; }

.course-level-badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-subtle);
  color: var(--ink-secondary);
  border: 1px solid var(--line);
}

.course-card h3 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 18px;
  margin: 0 0 4px;
  color: var(--ink);
  cursor: pointer;
}

.course-card .course-level {
  font-size: 12.5px;
  color: var(--muted);
  display: block;
  margin-bottom: 14px;
}

.course-progress-wrap {
  margin: 8px 0 14px;
}

.course-progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 5px;
  font-weight: 500;
}

.course-progress {
  width: 100%;
  height: 6px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  overflow: hidden;
  background: var(--surface-subtle);
}

.course-progress::-webkit-progress-bar {
  background: var(--surface-subtle);
  border-radius: 999px;
}

.course-progress::-webkit-progress-value {
  background: linear-gradient(90deg, #4f46e5, #14b8a6);
  border-radius: 999px;
}

.course-card .course-count {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--ink-secondary);
  display: block;
  margin-bottom: 14px;
}

.course-card-actions {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.course-action-btn {
  border: 1px solid var(--line);
  background: var(--bg);
  color: var(--ink-secondary);
  border-radius: 7px;
  padding: 7px 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
}

.course-action-btn:hover {
  background: var(--primary-soft);
  border-color: #a5b4fc;
  color: var(--primary);
}

.course-action-btn.primary-action {
  background: var(--primary-soft);
  border-color: #c7d2fe;
  color: var(--primary);
}

.course-action-btn.primary-action:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

.recent-section {
  margin-top: 36px;
}

.field-note {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}

.empty-state {
  padding: 36px 28px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface);
  text-align: center;
  color: var(--muted);
  grid-column: 1 / -1;
  line-height: 1.6;
  font-size: 13.5px;
}

.empty-state h3 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 18px;
  color: var(--ink);
  margin: 0 0 6px;
}

.empty-state p {
  margin: 0;
}

/* COURSE VIEW & HEADER BANNER */
.course-top-nav {
  margin-bottom: 14px;
}

.back-link {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-secondary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 14px;
  box-shadow: var(--shadow-sm);
}

.back-link:hover {
  border-color: #a5b4fc;
  color: var(--primary);
}

.course-banner-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 24px 28px 0;
  margin-bottom: 24px;
  box-shadow: var(--shadow-sm);
}

.course-badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.subject-pill {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1px solid #c7d2fe;
  padding: 4px 10px;
  border-radius: 999px;
}

.course-stat-pill {
  display: inline-block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
  background: var(--surface-subtle);
  padding: 4px 10px;
  border-radius: 999px;
}

.course-heading {
  margin-bottom: 18px;
}

.course-tabs {
  display: flex;
  gap: 24px;
  border-top: 1px solid var(--line);
}

.course-tabs button {
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  padding: 14px 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.course-tabs button:hover {
  color: var(--ink);
}

.course-tabs button[aria-selected="true"] {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

/* AI TUTOR CHAT WORKSPACE */
.tutor-layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  height: 660px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.conversation-list {
  padding: 18px 14px;
  background: #f8fafc;
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.new-chat-btn {
  margin-bottom: 18px;
  height: 40px;
  font-size: 13px;
  flex-shrink: 0;
}

.conversation-list .eyebrow {
  font-size: 10.5px;
  padding-left: 6px;
  margin-bottom: 8px;
}

#chat-list {
  overflow-y: auto;
  min-height: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.chat-list-item {
  display: block;
  width: 100%;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: left;
  color: var(--ink-secondary);
}

.chat-list-item:hover {
  background: var(--surface);
  border-color: var(--line);
}

.chat-list-item strong {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.chat-list-item small {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--muted);
}

.chat-list-item.active {
  background: var(--primary-soft);
  border-color: #c7d2fe;
  color: var(--primary);
}

.chat-list-item.active strong {
  color: var(--primary);
}

.chat-workspace {
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.chat-toolbar {
  border-bottom: 1px solid var(--line);
  padding: 14px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 60px;
  background: var(--surface);
  flex-shrink: 0;
}

.chat-toolbar-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.chat-status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #10b981;
  flex-shrink: 0;
}

.chat-toolbar-title > strong {
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chat-toolbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.messages {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 24px 28px;
  scroll-behavior: smooth;
  background: #fbfcfe;
}

.chat-welcome {
  text-align: center;
  margin: 28px auto 16px;
  max-width: 520px;
  padding: 28px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.tutor-symbol {
  margin: 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: linear-gradient(135deg, #4f46e5 0%, #0d9488 100%);
  display: grid;
  place-items: center;
  color: #ffffff;
  font-size: 24px;
  font-weight: 700;
}

.chat-welcome h2 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 22px;
  margin: 16px 0 8px;
  color: var(--ink);
}

.chat-welcome p {
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.65;
  margin: 0;
}

.prompt-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 20px;
}

.prompt-chips button {
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  padding: 8px 15px;
  font-size: 12.5px;
  font-weight: 600;
}

.prompt-chips button:hover {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
}

/* CHAT MESSAGES */
.message {
  margin: 0 0 18px;
  max-width: 84%;
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.message.user {
  margin-left: auto;
  background: var(--primary-soft);
  border: 1px solid #c7d2fe;
  border-bottom-right-radius: 4px;
}

.message.assistant {
  margin-right: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom-left-radius: 4px;
  box-shadow: var(--shadow-sm);
}

.message-label {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--primary);
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.message.assistant .message-label {
  color: var(--teal);
}

.message p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  line-height: 1.7;
  font-size: 14px;
  margin: 0;
  color: var(--ink);
}

.thinking {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--primary);
  background: var(--primary-soft);
  border: 1px solid #c7d2fe;
  border-radius: 999px;
  padding: 10px 18px;
  margin: 8px 0;
}

.chat-form {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: 14px 22px 12px;
  background: var(--surface);
  flex-shrink: 0;
}

.chat-input-box {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: 8px 10px;
  gap: 10px;
  align-items: flex-end;
}

.chat-input-box:focus-within {
  background: var(--surface);
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.chat-form textarea {
  width: 100%;
  border: 0;
  resize: vertical;
  min-height: 42px;
  max-height: 160px;
  background: transparent;
  font-size: 14px;
  color: var(--ink);
  padding: 6px;
  line-height: 1.5;
}

.chat-form textarea:focus {
  outline: none;
}

.send-btn {
  width: auto;
  height: 38px;
  padding: 0 16px;
  flex-shrink: 0;
  font-size: 13px;
}

.chat-form .field-note {
  font-size: 11.5px;
  text-align: center;
  margin: 8px 0 0;
}

.chat-error {
  background: #fef2f2;
  border-top: 1px solid #fecaca;
  color: #b91c1c;
  padding: 12px 22px;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
}

.chat-error p {
  line-height: 1.5;
  margin: 0;
}

/* BOARD EMPTY OVERLAY */
.board-empty {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  text-align: center;
  padding: 32px;
  background: radial-gradient(circle at center, #ffffff 0%, #f8fafc 100%);
}

.empty-board-icon {
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: var(--primary-soft);
  color: var(--primary);
  display: grid;
  place-items: center;
  font-size: 28px;
}

.board-empty h3 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 20px;
  margin: 16px 0 8px;
  color: var(--ink);
}

.board-empty p {
  font-size: 13.5px;
  color: var(--muted);
  max-width: 380px;
  line-height: 1.65;
  margin: 0;
}

/* PROFILE VIEW & SETTINGS */
.profile-summary-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 22px 26px;
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  gap: 18px;
  box-shadow: var(--shadow-sm);
}

.profile-avatar-lg {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4f46e5 0%, #0d9488 100%);
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.profile-summary-info {
  flex: 1;
  min-width: 0;
}

.profile-summary-info h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 0 0 3px;
  color: var(--ink);
}

.profile-summary-info p {
  font-size: 13.5px;
  color: var(--muted);
  margin: 0;
}

.profile-layout {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 24px;
  align-items: start;
}

.settings-card {
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
}

.settings-lead {
  margin: 6px 0 20px;
}

.settings-card input[readonly] {
  background: var(--surface-subtle);
  color: var(--muted);
  cursor: default;
}

.settings-card .primary-button {
  width: auto;
  min-width: 190px;
  margin-top: 16px;
}

.dialog-heading {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  justify-content: space-between;
  margin-bottom: 12px;
}

.form-error {
  padding: 12px 14px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 13px;
  border-radius: var(--radius-sm);
  line-height: 1.5;
  margin-bottom: 14px;
}

#lessons-view .history {
  padding-top: 6px;
}

.video-preview-link {
  margin-left: 8px;
}

/* RESPONSIVE BREAKPOINTS */
@media (max-width: 1180px) {
  .sidebar {
    width: 230px;
  }
  .workspace {
    margin-left: 230px;
  }
  main {
    padding: 28px 28px 0;
  }
  .topbar {
    padding: 0 28px;
  }
  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .profile-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  .auth-view {
    grid-template-columns: 1fr;
  }
  .auth-story {
    padding: 32px 28px;
  }
  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 16px 20px;
  }
  .sidebar-course-heading,
  .sidebar-courses {
    display: none;
  }
  .sidebar-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar-bottom {
    flex-direction: row;
    margin-top: 10px;
  }
  .workspace {
    margin-left: 0;
  }
  .tutor-layout {
    grid-template-columns: 1fr;
    height: auto;
  }
  .messages {
    height: 420px;
  }
}

@media (max-width: 560px) {
  .stats {
    grid-template-columns: 1fr;
  }
  .page-heading {
    flex-direction: column;
  }
  .course-search {
    width: 100%;
  }
}
