/* ═══════════════════════════════════════════════════════════════════════════
   AI STUDY GURU — ULTRA-PREMIUM STUDY OS v4.5 (STUDENT EDITION)
   World-class AI Teacher Studio & Workspace
   Preserves 100% of DOM IDs, JavaScript hooks, and functional behavior.
   Elevates: Typography, Glassmorphism, Micro-interactions, Mobile UX,
   KaTeX Math, Step-by-Step Cards, Dark/Light Themes, and Controls.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── 0. Design Tokens & Foundations ──────────────────────────────────────── */
:root {
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Outfit', var(--font-sans);
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
}

body.tutor {
  /* Color Palette - Light Mode (Crisp Porcelain & Electric Indigo) */
  --a-canvas:          #F8FAFC;
  --a-canvas-subtle:   #F1F5F9;
  --a-card:            #FFFFFF;
  --a-card-soft:       #F8FAFC;
  --a-card-glass:      rgba(255, 255, 255, 0.88);
  --a-line:            #E2E8F0;
  --a-line-strong:     #CBD5E1;
  --a-ink:             #0F172A;
  --a-body:            #334155;
  --a-muted:           #64748B;
  --a-faint:           #94A3B8;

  /* Brand Accents */
  --a-brand:           #4F46E5;
  --a-brand-dark:      #4338CA;
  --a-brand-light:     #6366F1;
  --a-brand-soft:      #EEF2FF;
  --a-brand-grad:      linear-gradient(135deg, #4F46E5 0%, #6366F1 50%, #7C3AED 100%);
  --a-brand-glow:      0 8px 24px -4px rgba(79, 70, 229, 0.35);

  /* Status & Gamification Colors */
  --a-whatsapp:        #25D366;
  --a-whatsapp-dark:   #16A34A;
  --a-whatsapp-grad:   linear-gradient(135deg, #25D366 0%, #16A34A 100%);
  --a-gold:            #F59E0B;
  --a-gold-soft:       #FEF3C7;
  --a-emerald:         #10B981;
  --a-emerald-soft:    #D1FAE5;
  --a-coral:           #F43F5E;
  --a-coral-soft:      #FFE4E6;
  --a-sky:             #0EA5E9;
  --a-sky-soft:        #E0F2FE;

  /* Shadows */
  --a-shadow-xs:       0 1px 2px rgba(15, 23, 42, 0.04);
  --a-shadow-sm:       0 2px 8px -1px rgba(15, 23, 42, 0.06), 0 1px 3px rgba(15, 23, 42, 0.04);
  --a-shadow-md:       0 8px 24px -4px rgba(15, 23, 42, 0.08), 0 2px 6px -1px rgba(15, 23, 42, 0.04);
  --a-shadow-lg:       0 16px 40px -8px rgba(15, 23, 42, 0.12), 0 6px 16px -3px rgba(15, 23, 42, 0.06);
  --a-shadow-float:    0 24px 64px -12px rgba(15, 23, 42, 0.18), 0 8px 24px -4px rgba(15, 23, 42, 0.08);

  /* Geometry & Focus */
  --a-radius-xs:       6px;
  --a-radius-sm:       10px;
  --a-radius-md:       16px;
  --a-radius-lg:       22px;
  --a-radius-pill:     9999px;
  --a-focus-ring:      0 0 0 3px rgba(79, 70, 229, 0.22);

  font-family: var(--font-sans);
  color: var(--a-body);
  background-color: var(--a-canvas);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Base resets & typography */
body.tutor * {
  box-sizing: border-box;
}
body.tutor h1, body.tutor h2, body.tutor h3, body.tutor h4 {
  font-family: var(--font-display);
  color: var(--a-ink);
  letter-spacing: -0.025em;
  font-weight: 700;
}
body.tutor a {
  color: var(--a-brand);
  text-decoration: none;
  transition: color 0.2s ease;
}
body.tutor a:hover {
  color: var(--a-brand-dark);
}

/* Hidden elements safeguard */
[hidden], [aria-hidden="true"].hidden {
  display: none !important;
}

/* ── 1. Buttons & Inputs Design Language ─────────────────────────────────── */
body.tutor .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  padding: 12px 22px;
  border-radius: var(--a-radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  text-decoration: none;
  user-select: none;
}
body.tutor .btn:active {
  transform: scale(0.98);
}
body.tutor .btn-primary {
  background: var(--a-brand-grad);
  color: #FFFFFF !important;
  box-shadow: var(--a-shadow-sm), var(--a-brand-glow);
  border: none;
}
body.tutor .btn-primary:hover {
  box-shadow: var(--a-shadow-md), 0 10px 28px -4px rgba(79, 70, 229, 0.45);
  transform: translateY(-1px);
  filter: brightness(1.05);
}
body.tutor .btn-outline {
  background: var(--a-card);
  color: var(--a-ink) !important;
  border: 1.5px solid var(--a-line-strong);
  box-shadow: var(--a-shadow-xs);
}
body.tutor .btn-outline:hover {
  background: var(--a-card-soft);
  border-color: var(--a-brand);
  color: var(--a-brand) !important;
  transform: translateY(-1px);
}
body.tutor .btn-sm {
  padding: 7px 14px;
  font-size: 0.82rem;
  border-radius: var(--a-radius-sm);
}

/* Form Controls */
body.tutor input[type="text"],
body.tutor input[type="tel"],
body.tutor select,
body.tutor textarea {
  width: 100%;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--a-ink);
  background: var(--a-card);
  border: 1.5px solid var(--a-line);
  border-radius: var(--a-radius-sm);
  padding: 12px 14px;
  transition: all 0.2s ease;
  outline: none;
}
body.tutor input:focus,
body.tutor select:focus,
body.tutor textarea:focus {
  border-color: var(--a-brand);
  box-shadow: var(--a-focus-ring);
  background: #FFFFFF;
}

/* ── 2. Auth & Sign-in Screen (#auth) ────────────────────────────────────── */
body.tutor:not(.wt-in-workspace) .wt-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 20px 60px;
}
body.tutor .wt-status {
  max-width: 800px;
  margin: 0 auto 16px;
  padding: 10px 18px;
  border-radius: var(--a-radius-pill);
  background: rgba(79, 70, 229, 0.08);
  border: 1px solid rgba(79, 70, 229, 0.2);
  color: var(--a-brand-dark);
  font-weight: 600;
  font-size: 0.88rem;
  text-align: center;
}
body.tutor .wt-status.error {
  background: rgba(244, 63, 94, 0.08);
  border-color: rgba(244, 63, 94, 0.3);
  color: #BE123C;
}

body.tutor .wt-welcome {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 32px;
  align-items: stretch;
  margin-top: 10px;
}

/* Left Hero Presentation Card */
body.tutor .wt-welcome > div:first-child {
  position: relative;
  overflow: hidden;
  padding: 44px 40px;
  border-radius: var(--a-radius-lg);
  background: linear-gradient(145deg, #0F172A 0%, #1E1B4B 50%, #312E81 100%);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: var(--a-shadow-float);
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
body.tutor .wt-welcome > div:first-child::before {
  content: "";
  position: absolute;
  top: -20%;
  right: -20%;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(99, 102, 241, 0.35) 0%, transparent 70%);
  pointer-events: none;
}
body.tutor .wt-welcome > div:first-child::after {
  content: "";
  position: absolute;
  bottom: -15%;
  left: -15%;
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(37, 211, 102, 0.25) 0%, transparent 70%);
  pointer-events: none;
}

body.tutor .wt-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 6px 14px;
  border-radius: var(--a-radius-pill);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #E0E7FF;
  margin-bottom: 20px;
  backdrop-filter: blur(8px);
}

body.tutor .wt-welcome h1 {
  font-size: clamp(2rem, 3.2vw, 2.75rem);
  line-height: 1.15;
  color: #FFFFFF;
  font-weight: 800;
  margin-bottom: 16px;
  letter-spacing: -0.03em;
}
body.tutor .wt-welcome p.lead {
  font-size: 1.05rem;
  line-height: 1.55;
  color: #CBD5E1;
  margin-bottom: 26px;
}

/* Feature Pills in Hero */
body.tutor .wt-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}
body.tutor .wt-pills span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--a-radius-pill);
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #F1F5F9;
  backdrop-filter: blur(6px);
}

/* Trust Row Chips */
body.tutor .pg-trust-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 24px;
}
body.tutor .pg-trust-chip {
  padding: 12px 14px;
  border-radius: var(--a-radius-sm);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.82rem;
  font-weight: 700;
  color: #FFFFFF;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
body.tutor .pg-trust-chip small {
  font-size: 0.72rem;
  font-weight: 500;
  color: #94A3B8;
}

body.tutor .wt-small {
  font-size: 0.78rem;
  color: #94A3B8;
  line-height: 1.45;
  margin-top: 10px;
}

/* Right Column Auth Glass Panel */
body.tutor .wt-panel {
  background: var(--a-card);
  border: 1.5px solid var(--a-line);
  border-radius: var(--a-radius-lg);
  padding: 38px 34px;
  box-shadow: var(--a-shadow-lg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}
body.tutor #phone-form .wt-eyebrow {
  background: var(--a-brand-soft);
  border-color: rgba(79, 70, 229, 0.2);
  color: var(--a-brand);
}
body.tutor #phone-form h2 {
  font-size: 1.55rem;
  color: var(--a-ink);
  margin-bottom: 8px;
}
body.tutor #phone-form p {
  color: var(--a-muted);
  font-size: 0.92rem;
  line-height: 1.5;
  margin-bottom: 20px;
}
body.tutor #phone-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--a-ink);
  margin-bottom: 16px;
}
body.tutor #phone-form label small {
  font-weight: 400;
  color: var(--a-muted);
  font-size: 0.78rem;
}
body.tutor .wt-check {
  flex-direction: row !important;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.82rem !important;
  font-weight: 400 !important;
  color: var(--a-muted) !important;
}
body.tutor .wt-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--a-brand);
  margin-top: 2px;
  flex-shrink: 0;
}
body.tutor #phone-form button[type="submit"] {
  width: 100%;
  margin-top: 10px;
  padding: 14px;
  font-size: 1.02rem;
  background: var(--a-whatsapp-grad);
  box-shadow: 0 4px 18px -2px rgba(37, 211, 102, 0.4);
}
body.tutor #phone-form button[type="submit"]:hover {
  box-shadow: 0 8px 24px -2px rgba(37, 211, 102, 0.55);
}

/* Phone Verification Steps (#phone-steps) */
body.tutor #phone-steps h2 {
  font-size: 1.45rem;
  margin-bottom: 8px;
}
body.tutor #phone-steps ol {
  list-style: none;
  padding: 0;
  margin: 18px 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
body.tutor #phone-steps li {
  padding: 14px 16px;
  border-radius: var(--a-radius-sm);
  background: var(--a-canvas-subtle);
  border: 1px solid var(--a-line);
}
body.tutor #phone-steps li p {
  margin: 0 0 10px 0;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--a-ink);
}
body.tutor #phone-code {
  display: block;
  font-family: var(--font-mono);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  padding: 8px 14px;
  margin: 6px 0 12px;
  background: var(--a-card);
  border: 1.5px dashed var(--a-brand);
  border-radius: var(--a-radius-xs);
  color: var(--a-brand);
  text-align: center;
}
body.tutor .wt-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

/* ── 3. Profile Setup Modal/Panel (#profile-panel) ────────────────────────── */
body.tutor #profile-panel {
  max-width: 680px;
  margin: 30px auto;
  border-radius: var(--a-radius-lg);
  box-shadow: var(--a-shadow-float);
}
body.tutor .wt-quick-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
  align-items: center;
}
body.tutor .wt-chip-label {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--a-muted);
  text-transform: uppercase;
}
body.tutor .wt-quick-chip {
  padding: 6px 12px;
  border-radius: var(--a-radius-pill);
  background: var(--a-canvas-subtle);
  border: 1px solid var(--a-line);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--a-body);
  cursor: pointer;
  transition: all 0.18s ease;
}
body.tutor .wt-quick-chip:hover {
  background: var(--a-brand-soft);
  border-color: var(--a-brand);
  color: var(--a-brand);
  transform: translateY(-1px);
}

/* ── 4. Main Workspace Layout (#workspace) ───────────────────────────────── */
body.tutor.wt-in-workspace {
  margin: 0;
  padding: 0;
  overflow: hidden;
  height: 100vh;
  height: 100dvh;
  background: var(--a-canvas) !important;
}
body.tutor.wt-in-workspace .sg-header,
body.tutor.wt-in-workspace .sg-footer,
body.tutor.wt-in-workspace .wt-status {
  display: none !important;
}

body.tutor.wt-in-workspace .wt-main {
  max-width: 100% !important;
  margin: 0 !important;
  padding: 0 !important;
  height: 100%;
}

body.tutor.wt-in-workspace #workspace,
body.tutor.wt-in-workspace .wt-chatgpt-workspace {
  display: flex !important;
  flex-direction: row;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  background: var(--a-canvas) !important;
  position: relative;
}

/* ── 5. Sidebar (#wt-sidebar) ────────────────────────────────────────────── */
body.tutor.wt-in-workspace .wt-chatgpt-sidebar,
body.tutor.wt-in-workspace #wt-sidebar {
  width: 290px !important;
  min-width: 290px;
  height: 100%;
  background: #0B0F19 !important;
  color: #F8FAFC !important;
  display: flex !important;
  flex-direction: column;
  border-right: 1px solid rgba(255, 255, 255, 0.08) !important;
  z-index: 90;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), margin-left 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 4px 0 24px rgba(0, 0, 0, 0.15) !important;
}

/* Sidebar Header */
body.tutor.wt-in-workspace .wt-sb-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
body.tutor.wt-in-workspace .wt-sb-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
body.tutor.wt-in-workspace .wt-sb-logo {
  font-size: 1.35rem;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--a-brand-grad);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.35);
}
body.tutor.wt-in-workspace .wt-sb-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  color: #FFFFFF;
  letter-spacing: -0.02em;
}
body.tutor.wt-in-workspace .wt-sb-close-btn {
  background: transparent;
  border: none;
  color: #94A3B8;
  font-size: 1.15rem;
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: none;
}
body.tutor.wt-in-workspace .wt-sb-close-btn:hover {
  color: #FFFFFF;
  background: rgba(255, 255, 255, 0.1);
}

/* New Topic CTA Button */
body.tutor.wt-in-workspace .wt-new-chat-btn {
  margin: 14px 14px 10px;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--a-radius-md);
  color: #FFFFFF;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.92rem;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
}
body.tutor.wt-in-workspace .wt-new-chat-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateY(-1px);
}
body.tutor.wt-in-workspace .wt-plus-icon {
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: var(--a-brand-grad);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.95rem;
}
body.tutor.wt-in-workspace .wt-kbd {
  margin-left: auto;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  padding: 3px 6px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.1);
  color: #94A3B8;
}

/* Sidebar Scroll Area */
body.tutor.wt-in-workspace .wt-sb-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 8px 14px 18px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}
body.tutor.wt-in-workspace .wt-sb-section {
  margin-bottom: 20px;
}
body.tutor.wt-in-workspace .wt-sb-heading {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #64748B;
  margin: 14px 4px 10px;
}

/* Quick Tools Grid */
body.tutor.wt-in-workspace .wt-action-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
body.tutor.wt-in-workspace .wt-action-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--a-radius-sm);
  color: #F1F5F9;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
}
body.tutor.wt-in-workspace .wt-action-card:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-1px);
}
body.tutor.wt-in-workspace .wt-card-emoji {
  font-size: 1.15rem;
}

/* Categorized Study Tool Accordions */
body.tutor.wt-in-workspace .wt-sb-details {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--a-radius-sm);
  margin-bottom: 12px;
  overflow: hidden;
}
body.tutor.wt-in-workspace .wt-sb-details summary {
  padding: 10px 14px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #CBD5E1;
  cursor: pointer;
  user-select: none;
  transition: background 0.18s ease;
}
body.tutor.wt-in-workspace .wt-sb-details summary:hover {
  background: rgba(255, 255, 255, 0.06);
}
body.tutor.wt-in-workspace .wt-shortcuts {
  padding: 10px 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
body.tutor.wt-in-workspace .wt-tool-category {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
body.tutor.wt-in-workspace .wt-tool-cat-title {
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: #64748B;
  text-transform: uppercase;
}
body.tutor.wt-in-workspace .wt-tool-cat-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 6px;
}
body.tutor.wt-in-workspace .wt-tool-cat-grid button {
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--a-radius-xs);
  color: #E2E8F0;
  font-size: 0.78rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  transition: all 0.18s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.tutor.wt-in-workspace .wt-tool-cat-grid button:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.22);
}

/* Gamification Progress Card in Sidebar */
body.tutor.wt-in-workspace .wt-progress-card {
  padding: 14px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--a-radius-md);
}
body.tutor.wt-in-workspace .wt-progress-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
body.tutor.wt-in-workspace .wt-streak-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--a-radius-pill);
  background: rgba(245, 158, 11, 0.15);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #FBBF24;
  font-weight: 700;
  font-size: 0.9rem;
}
body.tutor.wt-in-workspace .wt-streak-fire {
  font-size: 1.15rem;
  animation: flamePulse 1.8s infinite ease-in-out;
}
@keyframes flamePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.15); }
}
body.tutor.wt-in-workspace .wt-daily-goal {
  display: flex;
  align-items: center;
  gap: 8px;
}
body.tutor.wt-in-workspace .wt-goal-ring {
  width: 34px;
  height: 34px;
}
body.tutor.wt-in-workspace .wt-goal-pct {
  font-size: 0.82rem;
  font-weight: 700;
  color: #94A3B8;
}

/* Sidebar Profile Bottom Dock */
body.tutor.wt-in-workspace .wt-sb-profile {
  padding: 14px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
body.tutor.wt-in-workspace .wt-sb-user-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
body.tutor.wt-in-workspace .wt-sb-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--a-radius-pill);
  background: var(--a-brand-grad);
  display: grid;
  place-items: center;
  font-size: 1rem;
  color: #FFFFFF;
  flex-shrink: 0;
}
body.tutor.wt-in-workspace .wt-sb-name {
  font-weight: 700;
  font-size: 0.88rem;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.tutor.wt-in-workspace .wt-sb-grade {
  font-size: 0.75rem;
  color: #94A3B8;
}

/* ── 6. Chat Area & Top Header ───────────────────────────────────────────── */
body.tutor.wt-in-workspace .wt-chat-area {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
  position: relative;
  background: var(--a-canvas) !important;
}

/* Ambient canvas background glow */
body.tutor.wt-in-workspace .wt-chat-area::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 900px;
  height: 400px;
  background: radial-gradient(ellipse at top, rgba(99, 102, 241, 0.12) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Top Sticky Header (.wt-chat-header) */
body.tutor.wt-in-workspace .wt-chat-header {
  height: 64px !important;
  min-height: 64px !important;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px !important;
  background: var(--a-card-glass) !important;
  border-bottom: 1px solid var(--a-line) !important;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 60;
  position: relative;
  flex-shrink: 0;
  margin: 0 !important;
  border-radius: 0 !important;
  box-shadow: var(--a-shadow-xs) !important;
}

body.tutor.wt-in-workspace .wt-chat-header-left,
body.tutor.wt-in-workspace .wt-chat-header-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

/* Hamburger Sidebar Toggle */
body.tutor.wt-in-workspace .wt-hamburger-btn {
  width: 40px;
  height: 40px;
  border-radius: var(--a-radius-sm);
  border: 1px solid var(--a-line);
  background: var(--a-card);
  color: var(--a-ink);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.18s ease;
}
body.tutor.wt-in-workspace .wt-hamburger-btn:hover {
  background: var(--a-card-soft);
  border-color: var(--a-brand);
  color: var(--a-brand);
}

/* Model Badge & Status */
body.tutor.wt-in-workspace .wt-model-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: var(--a-radius-pill);
  background: var(--a-card);
  border: 1px solid var(--a-line);
  font-weight: 700;
  font-size: 0.88rem;
  color: var(--a-ink);
}
body.tutor.wt-in-workspace .wt-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--a-emerald);
  box-shadow: 0 0 10px var(--a-emerald);
  animation: pulseDot 2s infinite;
}
@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(0.9); }
}

/* Student Profile & Grade Switcher Pill (#header-student-profile-badge) */
body.tutor.wt-in-workspace .wt-student-profile-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--a-radius-pill);
  background: var(--a-brand-soft);
  border: 1px solid rgba(79, 70, 229, 0.25);
  color: var(--a-brand-dark);
  font-weight: 700;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
body.tutor.wt-in-workspace .wt-student-profile-pill:hover {
  background: rgba(79, 70, 229, 0.15);
  border-color: var(--a-brand);
  transform: translateY(-1px);
}
body.tutor.wt-in-workspace .wt-prof-edit-icon {
  font-size: 0.8rem;
  opacity: 0.7;
}

/* Header Action Buttons (Timer, Study Hub, Theme) */
body.tutor.wt-in-workspace .wt-header-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 38px;
  padding: 0 14px;
  border-radius: var(--a-radius-pill);
  background: var(--a-card);
  border: 1px solid var(--a-line);
  color: var(--a-ink);
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.18s ease;
}
body.tutor.wt-in-workspace .wt-header-action-btn:hover {
  background: var(--a-card-soft);
  border-color: var(--a-brand);
  color: var(--a-brand);
}

/* Pomodoro Focus Timer Pill */
body.tutor.wt-in-workspace .wt-timer-trigger {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--a-coral);
  background: var(--a-coral-soft);
  border-color: rgba(244, 63, 94, 0.25);
}
body.tutor.wt-in-workspace .wt-timer-trigger:hover {
  background: rgba(244, 63, 94, 0.18);
  border-color: var(--a-coral);
  color: #BE123C;
}

/* Study Tools Dropdown (#study-hub-dropdown) */
body.tutor.wt-in-workspace .wt-study-hub-wrapper {
  position: relative;
}
body.tutor.wt-in-workspace .wt-study-hub-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 320px;
  background: var(--a-card);
  border: 1.5px solid var(--a-line);
  border-radius: var(--a-radius-md);
  box-shadow: var(--a-shadow-float);
  padding: 14px;
  z-index: 100;
}
body.tutor.wt-in-workspace .wt-hub-header {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--a-line);
  margin-bottom: 10px;
}
body.tutor.wt-in-workspace .wt-hub-title {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--a-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
body.tutor.wt-in-workspace .wt-hub-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
body.tutor.wt-in-workspace .wt-hub-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--a-radius-sm);
  background: var(--a-card);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.18s ease;
  text-align: left;
}
body.tutor.wt-in-workspace .wt-hub-item:hover {
  background: var(--a-canvas-subtle);
  border-color: var(--a-line);
  transform: translateX(2px);
}
body.tutor.wt-in-workspace .wt-hub-item-icon {
  font-size: 1.25rem;
}
body.tutor.wt-in-workspace .wt-hub-item-info strong {
  display: block;
  font-size: 0.88rem;
  color: var(--a-ink);
}
body.tutor.wt-in-workspace .wt-hub-item-info small {
  font-size: 0.75rem;
  color: var(--a-muted);
}

/* ── 7. Study Controls Bar (#study-controls) ─────────────────────────────── */
body.tutor.wt-in-workspace #study-controls {
  padding: 10px 20px;
  background: var(--a-card-glass);
  border-bottom: 1px solid var(--a-line);
  display: flex;
  flex-direction: column;
  gap: 8px;
  z-index: 40;
}

/* Teacher Modes Bar */
body.tutor.wt-in-workspace #teacher-modes-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
body.tutor.wt-in-workspace #teacher-modes-bar::-webkit-scrollbar {
  display: none;
}
body.tutor.wt-in-workspace .wt-mode-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--a-radius-pill);
  background: var(--a-card);
  border: 1px solid var(--a-line);
  color: var(--a-body);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}
body.tutor.wt-in-workspace .wt-mode-pill:hover {
  background: var(--a-card-soft);
  border-color: var(--a-brand);
  color: var(--a-brand);
}
body.tutor.wt-in-workspace .wt-mode-pill.active {
  background: var(--a-brand);
  border-color: var(--a-brand);
  color: #FFFFFF !important;
  box-shadow: 0 2px 10px rgba(79, 70, 229, 0.3);
}

/* Subjects Bar */
body.tutor.wt-in-workspace #subjects-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0;
}
body.tutor.wt-in-workspace #subjects-bar::-webkit-scrollbar {
  display: none;
}
body.tutor.wt-in-workspace .wt-subject-chip {
  padding: 5px 12px;
  border-radius: var(--a-radius-pill);
  background: var(--a-canvas-subtle);
  border: 1px solid var(--a-line);
  color: var(--a-muted);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.18s ease;
}
body.tutor.wt-in-workspace .wt-subject-chip:hover {
  background: var(--a-card);
  color: var(--a-ink);
  border-color: var(--a-line-strong);
}
body.tutor.wt-in-workspace .wt-subject-chip.active {
  background: var(--a-ink);
  border-color: var(--a-ink);
  color: #FFFFFF !important;
}

/* ── 8. Messages Stream (#messages) ──────────────────────────────────────── */
body.tutor.wt-in-workspace #messages,
body.tutor.wt-in-workspace .wt-chatgpt-messages {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 24px clamp(16px, 5vw, 64px) 140px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  max-width: 900px;
  margin: 0 auto;
  width: 100%;
}

/* Welcome Desk (Empty State Hero in Chat) */
body.tutor.wt-in-workspace .wt-chatgpt-welcome {
  text-align: center;
  padding: 30px 20px 10px;
  max-width: 680px;
  margin: 0 auto;
}
body.tutor.wt-in-workspace .wt-welcome-teacher-avatar {
  width: 68px;
  height: 68px;
  border-radius: 20px;
  background: var(--a-brand-grad);
  display: grid;
  place-items: center;
  font-size: 1.8rem;
  margin: 0 auto 16px;
  box-shadow: 0 8px 24px -2px rgba(79, 70, 229, 0.4);
}
body.tutor.wt-in-workspace .wt-chatgpt-welcome h2 {
  font-size: clamp(1.6rem, 2.8vw, 2.1rem);
  margin-bottom: 10px;
}
body.tutor.wt-in-workspace .wt-chatgpt-welcome p {
  color: var(--a-muted);
  font-size: 0.98rem;
  line-height: 1.5;
  margin-bottom: 24px;
}

/* Welcome Prompt Suggestion Cards Grid */
body.tutor.wt-in-workspace .wt-prompt-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  text-align: left;
}
body.tutor.wt-in-workspace .wt-prompt-card {
  padding: 16px 18px;
  border-radius: var(--a-radius-md);
  background: var(--a-card);
  border: 1.5px solid var(--a-line);
  box-shadow: var(--a-shadow-sm);
  cursor: pointer;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
body.tutor.wt-in-workspace .wt-prompt-card:hover {
  background: var(--a-card-soft);
  border-color: var(--a-brand);
  transform: translateY(-2px);
  box-shadow: var(--a-shadow-md), 0 0 0 1px var(--a-brand);
}
body.tutor.wt-in-workspace .wt-prompt-title {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--a-ink);
  display: flex;
  align-items: center;
  gap: 8px;
}
body.tutor.wt-in-workspace .wt-prompt-desc {
  font-size: 0.8rem;
  color: var(--a-muted);
  line-height: 1.4;
}

/* Message Item Base */
body.tutor.wt-in-workspace .wt-msg-row {
  display: flex;
  gap: 14px;
  width: 100%;
}
body.tutor.wt-in-workspace .wt-msg-row.user {
  justify-content: flex-end;
}
body.tutor.wt-in-workspace .wt-msg-row.assistant {
  justify-content: flex-start;
}

/* Teacher Avatar & Message Card */
body.tutor.wt-in-workspace .wt-msg-avatar {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--a-brand-grad);
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  color: #FFFFFF;
  flex-shrink: 0;
  margin-top: 4px;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}
body.tutor.wt-in-workspace .wt-msg-content {
  max-width: min(780px, 86%);
  border-radius: var(--a-radius-lg);
  padding: 20px 24px;
  font-size: 0.96rem;
  line-height: 1.65;
  color: var(--a-body);
  position: relative;
}

/* Teacher Message Styling (Elevated Clean White/Glass) */
body.tutor.wt-in-workspace .wt-msg-row.assistant .wt-msg-content {
  background: var(--a-card);
  border: 1px solid var(--a-line);
  box-shadow: var(--a-shadow-sm);
  color: var(--a-ink);
}

/* Student Message Styling (Vibrant Indigo Gradient Bubble) */
body.tutor.wt-in-workspace .wt-msg-row.user .wt-msg-content {
  background: var(--a-brand-grad);
  color: #FFFFFF !important;
  box-shadow: var(--a-shadow-sm), 0 4px 18px rgba(79, 70, 229, 0.3);
  border-bottom-right-radius: var(--a-radius-xs);
}
body.tutor.wt-in-workspace .wt-msg-row.user .wt-msg-content p {
  color: #FFFFFF !important;
}

/* Typography Inside AI Responses */
body.tutor.wt-in-workspace .wt-msg-content h2,
body.tutor.wt-in-workspace .wt-msg-content h3 {
  color: var(--a-ink);
  margin: 16px 0 8px;
  font-size: 1.15rem;
}
body.tutor.wt-in-workspace .wt-msg-content h2:first-child,
body.tutor.wt-in-workspace .wt-msg-content h3:first-child {
  margin-top: 0;
}
body.tutor.wt-in-workspace .wt-msg-content p {
  margin: 0 0 10px;
}
body.tutor.wt-in-workspace .wt-msg-content ul,
body.tutor.wt-in-workspace .wt-msg-content ol {
  margin: 0 0 14px;
  padding-left: 22px;
}
body.tutor.wt-in-workspace .wt-msg-content li {
  margin-bottom: 6px;
}

/* Callout Boxes Inside Teacher Answers */
body.tutor.wt-in-workspace .wt-callout,
body.tutor.wt-in-workspace .callout-box {
  padding: 14px 18px;
  border-radius: var(--a-radius-sm);
  margin: 14px 0;
  font-size: 0.92rem;
  border-left: 4px solid var(--a-brand);
  background: var(--a-brand-soft);
}
body.tutor.wt-in-workspace .wt-callout-concept {
  border-left-color: var(--a-sky);
  background: var(--a-sky-soft);
}
body.tutor.wt-in-workspace .wt-callout-mistake {
  border-left-color: var(--a-coral);
  background: var(--a-coral-soft);
}
body.tutor.wt-in-workspace .wt-callout-tip {
  border-left-color: var(--a-emerald);
  background: var(--a-emerald-soft);
}
body.tutor.wt-in-workspace .wt-callout-formula {
  border-left-color: var(--a-gold);
  background: var(--a-gold-soft);
}

/* KaTeX Formulas Styling */
body.tutor.wt-in-workspace .katex-display {
  padding: 12px;
  background: var(--a-canvas-subtle);
  border-radius: var(--a-radius-sm);
  border: 1px solid var(--a-line);
  overflow-x: auto;
  margin: 12px 0;
}

/* Message Utility Toolbar (Read aloud, Copy, WhatsApp) */
body.tutor.wt-in-workspace .wt-msg-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--a-line);
}
body.tutor.wt-in-workspace .wt-msg-action-btn {
  padding: 5px 10px;
  border-radius: var(--a-radius-xs);
  background: transparent;
  border: 1px solid var(--a-line);
  color: var(--a-muted);
  font-size: 0.78rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  cursor: pointer;
  transition: all 0.18s ease;
}
body.tutor.wt-in-workspace .wt-msg-action-btn:hover {
  background: var(--a-card-soft);
  color: var(--a-ink);
  border-color: var(--a-line-strong);
}

/* Thinking Indicator (#thinking) */
body.tutor.wt-in-workspace #thinking {
  padding: 14px 20px;
  border-radius: var(--a-radius-md);
  background: var(--a-card);
  border: 1px solid var(--a-line);
  box-shadow: var(--a-shadow-xs);
  color: var(--a-brand);
  font-weight: 600;
  font-size: 0.9rem;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 0 auto;
  animation: pulseThinking 2s infinite ease-in-out;
}
@keyframes pulseThinking {
  0%, 100% { opacity: 0.85; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.02); }
}

/* ── 9. Composer / Input Dock (#composer) ─────────────────────────────────── */
body.tutor.wt-in-workspace .wt-composer-wrapper {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 16px 20px 24px;
  background: linear-gradient(to top, var(--a-canvas) 70%, transparent);
  pointer-events: none;
  z-index: 50;
}

body.tutor.wt-in-workspace #composer,
body.tutor.wt-in-workspace .wt-chatgpt-composer {
  max-width: 820px;
  margin: 0 auto;
  pointer-events: auto;
  position: relative;
}

/* Compose Capsule */
body.tutor.wt-in-workspace .wt-compose-capsule {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 8px 10px 8px 12px;
  background: var(--a-card);
  border: 1.5px solid var(--a-line-strong);
  border-radius: 24px;
  box-shadow: var(--a-shadow-lg);
  transition: all 0.22s ease;
}
body.tutor.wt-in-workspace .wt-compose-capsule:focus-within {
  border-color: var(--a-brand);
  box-shadow: var(--a-focus-ring), var(--a-shadow-float);
}

/* Textarea in Composer */
body.tutor.wt-in-workspace .wt-compose-capsule textarea,
body.tutor.wt-in-workspace #message {
  flex: 1 1 auto;
  min-height: 24px;
  max-height: 180px;
  padding: 8px 6px;
  border: none !important;
  background: transparent !important;
  font-family: var(--font-sans);
  font-size: 0.96rem;
  line-height: 1.5;
  color: var(--a-ink);
  resize: none;
  outline: none !important;
  box-shadow: none !important;
}

/* Composer Action Buttons */
body.tutor.wt-in-workspace .wt-tool-btn,
body.tutor.wt-in-workspace .wt-composer-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--a-radius-pill);
  border: 1px solid var(--a-line);
  background: var(--a-card-soft);
  color: var(--a-body);
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: all 0.18s ease;
  flex-shrink: 0;
  padding: 0;
}
body.tutor.wt-in-workspace .wt-tool-btn:hover,
body.tutor.wt-in-workspace .wt-composer-btn:hover {
  background: var(--a-brand-soft);
  color: var(--a-brand);
  border-color: var(--a-brand);
}

/* Microphone Button State */
body.tutor.wt-in-workspace #mic-btn.recording {
  background: var(--a-coral) !important;
  color: #FFFFFF !important;
  border-color: var(--a-coral) !important;
  animation: micPulse 1s infinite alternate;
}
@keyframes micPulse {
  0% { box-shadow: 0 0 0 0 rgba(244, 63, 94, 0.6); }
  100% { box-shadow: 0 0 0 10px rgba(244, 63, 94, 0); }
}

/* Send Button */
body.tutor.wt-in-workspace .wt-send-btn,
body.tutor.wt-in-workspace button[type="submit"].wt-send-btn {
  width: 42px;
  height: 42px;
  border-radius: var(--a-radius-pill);
  background: var(--a-brand-grad);
  color: #FFFFFF !important;
  border: none;
  display: grid;
  place-items: center;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(79, 70, 229, 0.4);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 0;
}
body.tutor.wt-in-workspace .wt-send-btn:hover:not(:disabled) {
  transform: scale(1.05);
  box-shadow: 0 6px 18px rgba(79, 70, 229, 0.55);
}
body.tutor.wt-in-workspace .wt-send-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
}

/* Math Symbol Palette (#math-symbol-palette) */
body.tutor.wt-in-workspace #math-symbol-palette {
  margin-bottom: 8px;
  padding: 8px 12px;
  background: var(--a-card);
  border: 1px solid var(--a-line-strong);
  border-radius: var(--a-radius-md);
  box-shadow: var(--a-shadow-md);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}
body.tutor.wt-in-workspace #math-symbol-palette::-webkit-scrollbar {
  display: none;
}
body.tutor.wt-in-workspace .wt-symbol-btn {
  padding: 6px 10px;
  border-radius: var(--a-radius-xs);
  background: var(--a-canvas-subtle);
  border: 1px solid var(--a-line);
  font-family: var(--font-mono);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--a-ink);
  cursor: pointer;
  transition: all 0.15s ease;
}
body.tutor.wt-in-workspace .wt-symbol-btn:hover {
  background: var(--a-brand-soft);
  border-color: var(--a-brand);
  color: var(--a-brand);
}

/* ── 10. Modals (Timer, Flashcards, Formula, Grade Switcher) ─────────────── */
body.tutor .wt-modal-backdrop,
body.tutor .wt-modal,
body.tutor .wt-dialog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: grid;
  place-items: center;
  padding: 20px;
  z-index: 200;
}
body.tutor .wt-modal-content,
body.tutor .wt-modal-box,
body.tutor .wt-spin-box {
  background: var(--a-card);
  border: 1.5px solid var(--a-line);
  border-radius: var(--a-radius-lg);
  box-shadow: var(--a-shadow-float);
  width: min(600px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
  padding: 28px;
  position: relative;
  animation: modalPop 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modalPop {
  0% { opacity: 0; transform: scale(0.95) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

body.tutor .wt-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--a-line);
}
body.tutor .wt-modal-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--a-ink);
}
body.tutor .wt-modal-close {
  width: 34px;
  height: 34px;
  border-radius: var(--a-radius-sm);
  background: var(--a-canvas-subtle);
  border: none;
  font-size: 1.1rem;
  color: var(--a-muted);
  cursor: pointer;
  display: grid;
  place-items: center;
}
body.tutor .wt-modal-close:hover {
  background: var(--a-line);
  color: var(--a-ink);
}

/* Grade Switcher Modal Grids (#switcher-classes-grid, #switcher-boards-grid) */
body.tutor #switcher-classes-grid,
body.tutor #switcher-boards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
  margin: 14px 0 20px;
}
body.tutor .wt-switcher-btn {
  padding: 12px;
  border-radius: var(--a-radius-sm);
  background: var(--a-canvas-subtle);
  border: 1.5px solid var(--a-line);
  color: var(--a-ink);
  font-weight: 700;
  font-size: 0.88rem;
  cursor: pointer;
  text-align: center;
  transition: all 0.18s ease;
}
body.tutor .wt-switcher-btn:hover {
  background: var(--a-brand-soft);
  border-color: var(--a-brand);
  color: var(--a-brand);
  transform: translateY(-1px);
}
body.tutor .wt-switcher-btn.active {
  background: var(--a-brand-grad);
  border-color: transparent;
  color: #FFFFFF !important;
  box-shadow: var(--a-brand-glow);
}

/* 3D Flashcard Flipping (#active-flashcard) */
body.tutor #active-flashcard {
  perspective: 1000px;
  min-height: 220px;
  border-radius: var(--a-radius-md);
  background: linear-gradient(135deg, #1E1B4B 0%, #312E81 100%);
  color: #FFFFFF;
  padding: 30px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  box-shadow: var(--a-shadow-lg);
  cursor: pointer;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
body.tutor #active-flashcard:hover {
  transform: translateY(-2px);
}
body.tutor #fc-front-text,
body.tutor #fc-back-text {
  font-size: 1.25rem;
  line-height: 1.5;
  font-weight: 600;
}

/* ── 11. Dark Mode Theme (body.tutor.wt-dark) ────────────────────────────── */
body.tutor.wt-dark {
  --a-canvas:          #0B0F19;
  --a-canvas-subtle:   #111827;
  --a-card:            #131B2E;
  --a-card-soft:       #19233C;
  --a-card-glass:      rgba(19, 27, 46, 0.88);
  --a-line:            rgba(255, 255, 255, 0.08);
  --a-line-strong:     rgba(255, 255, 255, 0.16);
  --a-ink:             #F8FAFC;
  --a-body:            #E2E8F0;
  --a-muted:           #94A3B8;
  --a-faint:           #64748B;
  --a-brand-soft:      rgba(79, 70, 229, 0.18);
  --a-shadow-sm:       0 2px 8px -1px rgba(0, 0, 0, 0.4);
  --a-shadow-md:       0 8px 24px -4px rgba(0, 0, 0, 0.5);
  --a-shadow-lg:       0 16px 40px -8px rgba(0, 0, 0, 0.65);
  --a-shadow-float:    0 24px 64px -12px rgba(0, 0, 0, 0.8);
}
body.tutor.wt-dark .wt-msg-row.assistant .wt-msg-content {
  background: #131B2E !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
  color: #F8FAFC !important;
}
body.tutor.wt-dark .wt-prompt-card {
  background: #131B2E !important;
  border-color: rgba(255, 255, 255, 0.08) !important;
}
body.tutor.wt-dark .wt-compose-capsule {
  background: #131B2E !important;
  border-color: rgba(255, 255, 255, 0.14) !important;
}
body.tutor.wt-dark .wt-modal-content,
body.tutor.wt-dark .wt-modal-box {
  background: #131B2E !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}

/* ── 12. Responsive Design (Mobile & Tablet) ─────────────────────────────── */
@media (max-width: 900px) {
  body.tutor.wt-in-workspace #wt-sidebar,
  body.tutor.wt-in-workspace .wt-chatgpt-sidebar {
    position: fixed !important;
    top: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-102%);
    z-index: 150;
    width: min(320px, 86vw) !important;
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.6) !important;
  }
  body.tutor.wt-in-workspace #wt-sidebar.open,
  body.tutor.wt-in-workspace .wt-chatgpt-sidebar.open {
    transform: translateX(0) !important;
  }
  body.tutor.wt-in-workspace .wt-sb-close-btn {
    display: grid !important;
  }
  body.tutor.wt-in-workspace #sidebar-overlay.active {
    display: block !important;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 140;
  }

  body.tutor .wt-welcome {
    grid-template-columns: 1fr;
    gap: 20px;
  }
  body.tutor .wt-welcome > div:first-child {
    padding: 32px 24px;
  }
  body.tutor .pg-trust-row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body.tutor.wt-in-workspace .wt-chat-header {
    height: 58px !important;
    min-height: 58px !important;
    padding: 0 12px !important;
  }
  body.tutor.wt-in-workspace .wt-model-name {
    display: none;
  }
  body.tutor.wt-in-workspace .wt-student-profile-pill {
    padding: 4px 10px;
    font-size: 0.78rem;
  }
  body.tutor.wt-in-workspace .wt-hub-label,
  body.tutor.wt-in-workspace .wt-hub-chevron {
    display: none;
  }
  body.tutor.wt-in-workspace .wt-hub-btn {
    padding: 0 10px;
  }

  body.tutor.wt-in-workspace #messages,
  body.tutor.wt-in-workspace .wt-chatgpt-messages {
    padding: 16px 12px 130px;
  }
  body.tutor.wt-in-workspace .wt-msg-content {
    max-width: 92%;
    padding: 14px 16px;
    font-size: 0.92rem;
  }
  body.tutor.wt-in-workspace .wt-prompt-grid {
    grid-template-columns: 1fr;
  }
  body.tutor.wt-in-workspace .wt-composer-wrapper {
    padding: 10px 10px 16px;
  }
}
