/* ==========================================================================
   LINGONEWS NEWSPAPER EDITORIAL DESIGN SYSTEM
   ========================================================================== */

:root {
  /* Font Families */
  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-editorial: 'Merriweather', Georgia, serif;

  /* Color Palette - Alternatif 1: Notion Editorial (Clean, Crisp & Energetic) */
  --bg-primary: #F7F7F5; /* Notion Clean Studio Stone / Crisp Canvas */
  --bg-secondary: #FFFFFF; /* Pure Crisp White Card */
  --bg-tertiary: #EFEFED; /* Notion Neutral Grey */
  
  --glass-bg: rgba(255, 255, 255, 0.98);
  --glass-border: #E6E6E3; /* Crisp Notion Border (Clean, No brown/beige tint) */
  --glass-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);
  
  --text-primary: #2F3437; /* Notion Iconic Ink Black / Deep Charcoal */
  --text-secondary: #5A6065; /* Crisp Slate Grey */
  --text-muted: #9A9FA5; /* Cool Clean Muted Grey */

  --accent-primary: #D9532F; /* Notion Editorial Terracotta / Burnt Vermilion */
  --accent-primary-hover: #C24320;
  --accent-primary-glow: rgba(217, 83, 47, 0.08);
  --accent-success: #2E7D32; /* Crisp Forest Emerald */
  --accent-warning: #E69138; /* Warm Honey Amber */
  --accent-info: #2B6CB0; /* Notion Classic Blue */
  --accent-lavender: #7E57C2; /* Soft Lavender */

  --gradient-brand: linear-gradient(135deg, #D9532F 0%, #EA6B45 100%);
  --gradient-glass-glow: linear-gradient(135deg, rgba(217, 83, 47, 0.06) 0%, rgba(217, 83, 47, 0.01) 100%);

  --border-radius-sm: 8px;
  --border-radius-md: 12px;
  --border-radius-lg: 16px;
  --border-radius-full: 9999px;

  --transition-fast: 0.15s ease;
  --transition-normal: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark Theme Support (Option 4: Midnight Luxury mode) */
.dark-theme, body.dark-theme {
  --bg-primary: #121519;
  --bg-secondary: #1a1e24;
  --bg-tertiary: #232830;
  
  --glass-bg: rgba(26, 30, 36, 0.95);
  --glass-border: rgba(255, 255, 255, 0.09);
  --glass-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);

  --text-primary: #F4F4F6;
  --text-secondary: #A0A5B0;
  --text-muted: #656A76;

  --accent-primary: #E06C43;
  --accent-primary-glow: rgba(224, 108, 67, 0.15);
  --gradient-brand: linear-gradient(135deg, #C85A32 0%, #E06C43 100%);
}

/* Reset and Global Styles */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  font-family: var(--font-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
  line-height: 1.6;
  transition: background-color var(--transition-normal), color var(--transition-normal);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}

/* Classic Newspaper clean dividers */
.newspaper-divider {
  border-top: 1px solid var(--glass-border);
  border-bottom: none;
  height: 1px;
  margin: 16px 0;
}

/* App Container Layout */
#app-container {
  display: flex;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
  box-sizing: border-box;
}

/* ==========================================================================
   SIDEBAR STYLING
   ========================================================================== */
#sidebar {
  width: 260px;
  background-color: var(--bg-primary);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 100;
  transition: transform var(--transition-normal);
  overflow-y: auto;
  overflow-x: hidden;
}

#sidebar.hidden {
  transform: translateX(-100%);
}

.sidebar-brand {
  padding: 24px 20px;
  display: flex;
  align-items: center;
  gap: 10px;
  border-bottom: 1px solid var(--glass-border);
}

.brand-logo {
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-sm);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 16px;
  box-shadow: 0 2px 10px rgba(217, 83, 47, 0.2);
}

.sidebar-brand h2 {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-transform: none;
}

.sidebar-menu {
  padding: 16px 10px 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.menu-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.menu-item i {
  font-size: 15px;
  width: 18px;
  text-align: center;
}

.menu-item:hover {
  color: var(--text-primary);
  background-color: var(--bg-tertiary);
}

.menu-item.active {
  background-color: #E8E7E3; /* Notion pill selection */
  color: var(--text-primary);
  border-left: none;
  font-weight: 600;
}

/* ==========================================================================
   SIDEBAR QUICK DICTIONARY (ZERO-RISK SANDBOX)
   ========================================================================== */
.sidebar-quick-dict {
  margin: 6px 12px;
  padding: 12px;
  background-color: var(--card-bg, #FFFFFF);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  display: flex;
  flex-direction: column;
  gap: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

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

.sidebar-dict-title {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-primary);
}

.dict-sandbox-badge {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: var(--border-radius-full);
  background: rgba(16, 185, 129, 0.12);
  color: #059669;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  cursor: help;
}

.sidebar-dict-input-wrap {
  display: flex;
  align-items: center;
  background: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  padding: 2px 4px 2px 8px;
  transition: border-color var(--transition-fast);
}

.sidebar-dict-input-wrap:focus-within {
  border-color: var(--accent-primary);
}

#sidebar-dict-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 12px;
  color: var(--text-primary);
  outline: none;
  padding: 6px 2px;
  width: 100%;
}

#sidebar-dict-input::placeholder {
  color: var(--text-muted);
  font-size: 11px;
}

#sidebar-dict-submit-btn {
  background: var(--accent-primary);
  color: #fff;
  border: none;
  width: 26px;
  height: 26px;
  border-radius: var(--border-radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 11px;
  transition: transform var(--transition-fast), background var(--transition-fast);
  flex-shrink: 0;
}

#sidebar-dict-submit-btn:hover {
  transform: translateX(1px);
  filter: brightness(1.1);
}

.sidebar-dict-result {
  margin-top: 4px;
  padding: 10px;
  background: var(--bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  font-size: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  animation: fadeIn 0.2s ease;
}

.dict-result-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 6px;
}

.dict-result-query {
  font-weight: 700;
  font-size: 13px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.dict-result-phonetic {
  font-size: 11px;
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-weight: normal;
}

.dict-result-controls {
  display: flex;
  align-items: center;
  gap: 4px;
}

.dict-icon-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 12px;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color var(--transition-fast);
}

.dict-icon-btn:hover {
  color: var(--text-primary);
}

.dict-result-trans {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-primary);
  line-height: 1.4;
  padding: 4px 6px;
  background: rgba(217, 83, 47, 0.08);
  border-radius: 4px;
}

.dict-result-def {
  color: var(--text-secondary);
  font-size: 11px;
  line-height: 1.45;
}

.dict-result-ex {
  font-size: 11px;
  font-style: italic;
  color: var(--text-muted);
  line-height: 1.4;
  border-left: 2px solid var(--glass-border);
  padding-left: 6px;
  margin-top: 2px;
}

.dict-sandbox-note {
  font-size: 10px;
  color: #059669;
  display: flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  padding-top: 4px;
  border-top: 1px dashed var(--glass-border);
  line-height: 1.3;
}

.sidebar-footer {
  padding: 16px;
  border-top: 1px solid var(--glass-border);
}

.user-badge-container {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-tertiary);
  padding: 10px;
  border-radius: var(--border-radius-sm);
}

.user-avatar {
  width: 32px;
  height: 32px;
  border-radius: var(--border-radius-sm);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-weight: bold;
  color: white;
}

.user-info h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.level-badge {
  display: inline-block;
  padding: 1px 6px;
  font-size: 10px;
  font-weight: bold;
  border-radius: var(--border-radius-sm);
  background: var(--accent-primary);
  color: white;
  margin-top: 2px;
}

/* ==========================================================================
   MAIN CONTENT AREA
   ========================================================================== */
#main-content {
  flex-grow: 1;
  padding-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

#main-header {
  height: 60px;
  padding: 0 30px;
  border-bottom: 1px solid var(--glass-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background-color: var(--bg-primary);
  position: sticky;
  top: 0;
  z-index: 90;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

#main-header.hidden, #sidebar.hidden + #main-content {
  padding-left: 0;
}

#sidebar.hidden + #main-content {
  padding-left: 0;
}

#mobile-menu-toggle {
  display: none;
}

.header-stats {
  display: flex;
  align-items: center;
  gap: 16px;
  min-width: 0;
}

.stat-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  background-color: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  padding: 6px 12px;
  border-radius: var(--border-radius-sm);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* Interactive Buttons */
.btn-icon {
  background: none;
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  width: 36px;
  height: 36px;
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-fast);
}

.btn-icon:hover {
  background-color: var(--bg-tertiary);
  color: var(--text-primary);
}

/* Main Content Mount Point */
#content-mount {
  flex-grow: 1;
  padding: 30px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

/* ==========================================================================
   UI COMPONENTS & CONTAINERS
   ========================================================================== */

/* Editorial Paper Panel */
.glass-panel {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  padding: 24px;
  margin-bottom: 20px;
  position: relative;
  box-shadow: var(--glass-shadow);
  transition: border-color var(--transition-normal);
}

/* Common Buttons */
.btn-primary {
  background: var(--gradient-brand);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(153, 27, 27, 0.25);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-normal);
}

.btn-primary:hover:not(:disabled) {
  opacity: 0.95;
  transform: translateY(-1px);
}

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

.btn-secondary {
  background: var(--bg-tertiary);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  padding: 12px 24px;
  border-radius: var(--border-radius-sm);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: all var(--transition-normal);
}

.btn-secondary:hover {
  background: var(--bg-secondary);
}

/* Forms */
.form-group {
  margin-bottom: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.input-text {
  width: 100%;
  padding: 12px 16px;
  background-color: var(--bg-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition-fast);
}

.input-text:focus {
  border-color: var(--accent-primary);
}

/* Level Badges Grid */
.badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(70px, 1fr));
  gap: 8px;
}

.badge-choice {
  padding: 10px;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  text-align: center;
  font-family: var(--font-heading);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-fast);
  background-color: var(--bg-primary);
}

.badge-choice:hover {
  border-color: var(--accent-primary);
}

.badge-choice.selected {
  background: var(--gradient-brand);
  color: white;
  border-color: transparent;
}

/* Interest Grid */
.interests-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 10px;
}

.interest-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  cursor: pointer;
  background-color: var(--bg-primary);
  transition: all var(--transition-fast);
  font-weight: 500;
  font-size: 13px;
}

.interest-item:hover {
  border-color: var(--accent-primary);
}

.interest-item.selected {
  background-color: var(--accent-primary-glow);
  border-color: var(--accent-primary);
  color: var(--accent-primary);
}

/* Onboarding Card styling */
.onboarding-card {
  max-width: 550px;
  margin: 30px auto;
  border-top: 4px solid var(--accent-primary);
}

.onboarding-card h1 {
  font-family: var(--font-heading);
  font-size: 28px;
  margin-bottom: 8px;
}

.onboarding-steps {
  margin-top: 24px;
}

/* AI Placement Test Dedicated Styles */
.test-layout {
  max-width: 900px;
  margin: 24px auto;
  display: grid;
  grid-template-columns: 1.3fr 0.85fr;
  gap: 20px;
  align-items: start;
}

.test-chat-card {
  display: flex;
  flex-direction: column;
  height: 500px;
  margin-bottom: 0 !important;
}

.test-chat-box {
  flex-grow: 1;
  overflow-y: auto;
  padding: 16px;
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--glass-border);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.test-info-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.test-nav-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.test-nav-btn {
  padding: 8px 18px !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  border-radius: var(--border-radius-sm) !important;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  width: auto !important;
}

/* ==========================================================================
   DASHBOARD / STATS - NOTION EDITORIAL DESIGN
   ========================================================================== */
.welcome-banner {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 24px 28px;
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
}

.welcome-banner h1 {
  font-size: 28px;
  font-family: var(--font-heading);
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.notion-hero-layout {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.notion-hero-teacher-box {
  display: flex;
  align-items: center;
  gap: 16px;
  background: var(--bg-tertiary);
  padding: 12px 20px;
  border-radius: var(--border-radius-md);
  border: 1px solid var(--glass-border);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04);
}

.notion-hero-teacher-avatar {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  object-fit: cover;
  border: 3px solid #FFFFFF;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
  transition: transform var(--transition-fast);
}

.notion-hero-teacher-avatar:hover {
  transform: scale(1.04);
}

/* Notion 3-Card Row */
.notion-cards-grid {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr 0.9fr;
  gap: 20px;
}

.notion-card {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 22px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--glass-shadow);
  transition: transform var(--transition-fast), border-color var(--transition-fast);
}

.notion-card:hover {
  border-color: #D6D6D2;
}

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

.notion-card-title {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Notion Golden Sunburst Streak Badge */
.notion-sunburst-badge {
  width: 86px;
  height: 86px;
  margin: 4px auto 14px;
  background: linear-gradient(135deg, #FDE68A 0%, #F59E0B 100%);
  border-radius: 50%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(245, 158, 11, 0.28);
  position: relative;
  border: 3px solid #FEF3C7;
  color: #78350F;
  text-align: center;
  animation: gentlePulse 3s infinite ease-in-out;
}

@keyframes gentlePulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.03); }
}

.notion-sunburst-badge .streak-number {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.1;
}

.notion-sunburst-badge .streak-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.9;
}

/* Weekday Indicators Row */
.notion-week-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--glass-border);
}

.notion-day-pill {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex: 1;
  font-size: 11px;
}

.notion-day-name {
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.notion-day-circle {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-tertiary);
  transition: all 0.2s ease;
}

.notion-day-circle.active {
  background: var(--accent-primary);
  color: #FFFFFF;
  box-shadow: 0 2px 6px rgba(217, 83, 47, 0.35);
}

/* Dashboard milestone progress bar */
.milestone-progress-container {
  margin-top: 12px;
  padding: 16px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
}

.milestone-header {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 13px;
  margin-bottom: 8px;
}

/* ==========================================================================
   TEACHER SPOTLIGHT & EDITORIAL STYLES
   ========================================================================== */
.dashboard-journal-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  align-items: start;
}

.dashboard-journal-main {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.dashboard-journal-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Teacher Spotlight Card */
.emma-spotlight-card {
  background: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-lg);
  padding: 24px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--glass-shadow);
  position: relative;
  overflow: hidden;
  transition: border-color var(--transition-normal);
}

.emma-spotlight-card:hover {
  border-color: #D6D6D2;
}

.emma-badge-tag {
  align-self: flex-start;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px 10px;
  border-radius: var(--border-radius-full);
  background: rgba(126, 87, 194, 0.12);
  color: var(--accent-lavender);
  margin-bottom: 12px;
}

.emma-doodle-container {
  display: flex;
  justify-content: center;
  align-items: center;
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-md);
  padding: 14px;
  border: 1px solid var(--glass-border);
  margin-bottom: 16px;
}

.emma-doodle-img {
  width: 100%;
  max-width: 180px;
  height: auto;
  object-fit: contain;
  transition: transform var(--transition-normal);
}

.emma-spotlight-card:hover .emma-doodle-img {
  transform: scale(1.02);
}

.emma-tip-bubble {
  background: var(--bg-tertiary);
  border-radius: var(--border-radius-md);
  padding: 18px 20px;
  border: 1px solid var(--glass-border);
  margin-bottom: 16px;
  position: relative;
}

.emma-tip-bubble::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 56px;
  width: 14px;
  height: 14px;
  background: var(--bg-tertiary);
  border-left: 1px solid var(--glass-border);
  border-top: 1px solid var(--glass-border);
  transform: rotate(45deg);
}

.emma-tip-title {
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.emma-tip-text {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.55;
  margin: 0;
}

.emma-actions {
  display: flex;
  gap: 10px;
}

.emma-actions .btn-primary {
  flex: 1;
  justify-content: center;
  font-size: 13px;
  padding: 10px 16px;
}

.emma-actions .btn-secondary {
  padding: 10px 14px;
  font-size: 13px;
}

/* CEFR Pill Badges */
.cefr-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--border-radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cefr-pill.b1, .cefr-pill.b2 {
  background: rgba(217, 83, 47, 0.1);
  color: var(--accent-primary);
  border: 1px solid rgba(217, 83, 47, 0.25);
}

.cefr-pill.a1, .cefr-pill.a2 {
  background: rgba(46, 125, 50, 0.1);
  color: var(--accent-success);
  border: 1px solid rgba(46, 125, 50, 0.25);
}

.cefr-pill.c1, .cefr-pill.c2 {
  background: rgba(126, 87, 194, 0.1);
  color: var(--accent-lavender);
  border: 1px solid rgba(126, 87, 194, 0.25);
}

@media (max-width: 992px) {
  .notion-cards-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-journal-layout {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   DAILY NEWS COMPONENT STYLES
   ========================================================================== */
.news-hero-banner {
  margin-bottom: 24px;
  padding: 0;
  overflow: hidden;
  display: flex;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--glass-border);
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.news-hero-content {
  flex: 1.35;
  min-width: 0;
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-sizing: border-box;
}

.news-hero-image {
  flex: 1;
  min-width: 0;
  max-height: 220px;
  overflow: hidden;
  display: flex;
}

.category-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  overflow-x: auto;
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  background: none;
  border: none;
  color: var(--text-secondary);
  padding: 8px 16px;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: all var(--transition-fast);
}

.tab-btn:hover, .tab-btn.active {
  color: var(--accent-primary);
}

.tab-btn.active {
  border-bottom: 2px solid var(--accent-primary);
}

.news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.news-card {
  background-color: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.news-card:hover {
  border-color: var(--text-primary);
}

.news-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 500;
}

.news-card h3 {
  font-size: 16px;
  line-height: 1.35;
  font-family: var(--font-heading);
}

.news-card p {
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.5;
}

/* ==========================================================================
   ARTICLE READER VIEW (EDITORIAL STYLE)
   ========================================================================== */
.reader-layout {
  display: grid;
  grid-template-columns: 1.6fr 0.9fr;
  gap: 24px;
}

/* Reader Topic Doodle Badge (Top Right Spot Illustration) */
.reader-topic-doodle-container {
  position: absolute;
  top: 18px;
  right: 68px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  z-index: 8;
  pointer-events: auto;
  cursor: default;
  transition: transform var(--transition-fast);
}

.reader-topic-doodle-container:hover {
  transform: translateY(-2px) rotate(1.5deg);
}

.reader-topic-doodle-box {
  width: 72px;
  height: 72px;
  background-color: var(--bg-tertiary);
  border: 1px dashed var(--glass-border);
  border-radius: var(--border-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  padding: 4px;
  transition: all var(--transition-fast);
}

.reader-topic-doodle-container:hover .reader-topic-doodle-box {
  border-color: var(--accent-primary);
  background-color: #FFFFFF;
  box-shadow: 0 4px 14px rgba(217, 83, 47, 0.12);
}

.reader-topic-doodle-box svg {
  width: 100%;
  height: 100%;
  display: block;
}

.reader-topic-doodle-label {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  font-family: var(--font-sans);
  background: var(--bg-primary);
  padding: 1px 7px;
  border-radius: 99px;
  border: 1px solid var(--glass-border);
  white-space: nowrap;
}

#reader-title {
  padding-right: 155px;
}

@media (max-width: 640px) {
  .reader-topic-doodle-container {
    right: 52px;
    transform: scale(0.85);
    transform-origin: top right;
  }
  #reader-title {
    padding-right: 120px;
  }
}

.article-content {
  font-family: var(--font-editorial);
  font-size: 16px;
  line-height: 1.8;
  color: var(--text-primary);
  background-color: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  padding: 24px;
  box-shadow: none;
}

/* Custom editorial layout settings */
.article-word-count-badge {
  font-size: 12px;
  color: var(--text-secondary);
  background-color: var(--bg-tertiary);
  padding: 2px 8px;
  border-radius: var(--border-radius-sm);
  font-weight: 600;
  text-transform: uppercase;
  margin-left: 8px;
}

/* Clickable word highlighting in simplified text */
.interactive-word {
  cursor: pointer;
  border-bottom: 1px dotted var(--text-muted);
  display: inline-block;
  padding: 0 1px;
  transition: all var(--transition-fast);
}

.interactive-word:hover {
  background-color: var(--accent-primary-glow);
  color: var(--accent-primary);
  border-bottom-color: var(--accent-primary);
}

/* Spaced Repetition: Highlights words that are currently in their "Vocabulary Deck" */
.saved-word-highlight {
  border-bottom: 2px dashed var(--accent-warning) !important;
  background-color: rgba(217, 119, 6, 0.06);
  color: var(--accent-warning);
  font-weight: 500;
}

.saved-word-highlight:hover {
  background-color: rgba(217, 119, 6, 0.12);
  color: var(--accent-warning);
}

/* Article In-Reader Level Switcher Toolbar */
.article-level-switcher-bar {
  margin-top: 24px;
  padding: 16px 20px;
  background-color: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.level-switcher-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.level-switcher-header span {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 8px;
}

.level-chips-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.level-chip-btn {
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  border-radius: var(--border-radius-full);
  border: 1px solid var(--glass-border);
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
}

.level-chip-btn span.chip-badge {
  font-weight: 700;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--border-radius-full);
  background: rgba(0, 0, 0, 0.06);
}

.level-chip-btn:hover {
  border-color: var(--accent-primary);
  color: var(--accent-primary);
  background-color: #FFFFFF;
}

.level-chip-btn.active {
  background: var(--gradient-brand);
  color: #FFFFFF;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(217, 83, 47, 0.25);
}

.level-chip-btn.active span.chip-badge {
  background: rgba(255, 255, 255, 0.25);
  color: #FFFFFF;
}

/* Vocabulary sidebar panel items */
.vocab-panel-item {
  background-color: var(--bg-tertiary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  padding: 12px 16px;
  margin-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.vocab-word-info strong {
  font-family: var(--font-heading);
  font-size: 15px;
  color: var(--accent-primary);
}

/* ==========================================================================
   AI TEACHER CHAT (CLEAN CHAT UI)
   ========================================================================== */
.chat-layout {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 20px;
  height: calc(100vh - 140px);
}

.chat-history {
  flex-grow: 1;
  overflow-y: auto;
  padding: 16px;
  background-color: var(--bg-secondary);
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--glass-border);
  margin-bottom: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: var(--border-radius-sm);
  font-size: 14px;
  line-height: 1.5;
}

.chat-message.teacher {
  background-color: var(--bg-tertiary);
  align-self: flex-start;
  border-left: 3px solid var(--accent-primary);
}

.chat-message.user {
  background-color: var(--bg-primary);
  border: 1px solid var(--glass-border);
  align-self: flex-end;
  color: var(--text-primary);
}

/* ==========================================================================
   3D FLASHCARD STUDY
   ========================================================================== */
.flashcard {
  width: 340px;
  height: 220px;
  cursor: pointer;
  perspective: 1000px;
}

.flashcard-face {
  border-radius: var(--border-radius-sm);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
}

.flashcard-front {
  background: var(--bg-secondary);
}

.flashcard-front h2 {
  font-family: var(--font-heading);
  font-size: 28px;
  color: var(--accent-primary);
}

.flashcard-back {
  background: var(--bg-tertiary);
}

.flashcard-back h3 {
  font-family: var(--font-heading);
  font-size: 20px;
  color: var(--accent-success);
}

.vocab-list-table th {
  font-family: var(--font-heading);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 12px;
  letter-spacing: 0.05em;
}

/* ==========================================================================
   CONGRATULATIONS / MILESTONE MODAL
   ========================================================================== */
.milestone-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.75);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
}

.milestone-modal.open {
  display: flex;
}

.milestone-modal-content {
  background-color: var(--bg-secondary);
  border: 2px solid var(--accent-primary);
  border-radius: var(--border-radius-lg);
  padding: 40px;
  max-width: 500px;
  width: 90%;
  text-align: center;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 20px;
  animation: modalPop 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 40px rgba(225, 29, 72, 0.4);
}

.milestone-badge-large {
  font-size: 60px;
  color: var(--accent-warning);
  animation: trophyBounce 1s infinite alternate;
}

@keyframes trophyBounce {
  from { transform: translateY(0); }
  to { transform: translateY(-10px); }
}

@keyframes modalPop {
  from { transform: scale(0.8); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ==========================================================================
   MOBILE & TABLET RESPONSIVE SYSTEM
   ========================================================================== */

/* 1. Mobile Bottom Navigation Bar */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  background: rgba(247, 245, 238, 0.96);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--glass-border);
  z-index: 999;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.05);
}

body.dark-theme .mobile-bottom-nav {
  background: rgba(20, 22, 28, 0.96);
}

.mobile-bottom-nav.hidden {
  display: none !important;
}

.mobile-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--text-muted);
  gap: 3px;
  padding: 4px 0;
  transition: all var(--transition-fast);
  border-radius: var(--border-radius-sm);
  -webkit-tap-highlight-color: transparent;
}

.mobile-nav-item i {
  font-size: 18px;
  transition: transform var(--transition-fast);
}

.mobile-nav-item span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.mobile-nav-item.active {
  color: var(--accent-primary);
}

.mobile-nav-item.active i {
  transform: translateY(-2px);
}

/* 2. Tablet Responsiveness (769px to 1024px - iPads & Tablets) */
@media (max-width: 1024px) {
  #sidebar {
    transform: translateX(-100%);
    z-index: 1050;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.15);
  }
  
  #sidebar.open {
    transform: translateX(0);
  }

  #main-content {
    padding-left: 0 !important;
  }

  #mobile-menu-toggle {
    display: flex;
  }

  /* Tablet-Optimized Dashboard Grid: 2 columns */
  .notion-cards-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px;
  }

  .notion-cards-grid > .notion-card:first-child {
    grid-column: span 2; /* Current Reading takes full width at top of grid */
  }

  .dashboard-journal-layout {
    grid-template-columns: 1fr 1fr !important;
    gap: 16px;
  }

  .news-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)) !important;
    gap: 16px;
  }

  .test-layout, .reader-layout, .chat-layout, .dashboard-split {
    grid-template-columns: 1fr;
    height: auto;
  }

  #content-mount {
    padding: 20px;
  }
}

/* 3. Mobile Phone Responsiveness (<= 768px - iPhones & Android Phones) */
@media (max-width: 768px) {
  .mobile-bottom-nav:not(.hidden) {
    display: flex;
  }

  /* Safe padding so bottom nav doesn't cover content */
  #content-mount {
    padding: 16px 14px calc(80px + env(safe-area-inset-bottom, 0px)) !important;
  }

  #main-header {
    padding: 10px 14px;
  }

  .header-stats {
    gap: 4px;
  }

  .stat-badge {
    padding: 4px 6px;
    font-size: 11px;
    gap: 4px;
  }

  .stat-unit {
    display: none;
  }

  /* Mobile News Hero Banner */
  .news-hero-banner {
    flex-direction: column !important;
    margin-bottom: 16px;
    width: 100% !important;
  }

  .news-hero-content {
    padding: 16px 14px !important;
    width: 100% !important;
  }

  .news-hero-content h2 {
    font-size: 19px !important;
    line-height: 1.3 !important;
  }

  .news-hero-image {
    max-height: 140px !important;
    width: 100% !important;
  }

  /* Phone 1-column layouts */
  .notion-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .notion-cards-grid > .notion-card:first-child {
    grid-column: span 1;
  }

  .dashboard-journal-layout {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  .news-grid {
    grid-template-columns: 1fr !important;
    gap: 14px;
  }

  /* Coach Spotlight on mobile */
  .emma-spotlight-card {
    padding: 16px;
  }

  .emma-actions {
    flex-direction: column;
  }

  .emma-actions button {
    width: 100%;
  }

  /* Native Mobile Bottom Sheet for Dictionary Modal */
  .word-modal {
    align-items: flex-end !important;
    padding: 0;
  }

  .word-modal-content {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 24px 24px 0 0 !important;
    padding: 20px 20px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    border-bottom: none !important;
    box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.15) !important;
    animation: slideUpSheet 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
  }

  .word-modal-content::before {
    content: '';
    display: block;
    width: 38px;
    height: 4px;
    background: var(--text-muted);
    opacity: 0.35;
    border-radius: 4px;
    margin: -6px auto 14px;
  }

  /* Reader View on Mobile */
  .reader-header {
    padding-right: 0 !important;
  }

  .reader-story-title {
    font-size: 20px !important;
    line-height: 1.35 !important;
  }

  .reader-story-body {
    font-size: 16px !important;
    line-height: 1.75 !important;
  }

  /* Chat layout full mobile view */
  .chat-container {
    height: calc(100vh - 180px) !important;
  }
}

@keyframes slideUpSheet {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

/* Color Helper Utility Classes */
.text-accent { color: var(--accent-primary) !important; }
.text-emerald { color: var(--accent-success) !important; }
.text-orange { color: var(--accent-warning) !important; }
.text-muted { color: var(--text-muted) !important; }

/* Custom Milestone Reward Card Styles */
.news-card.milestone-card {
  border-left: 4px solid var(--text-muted);
  transition: all var(--transition-normal);
}
.news-card.milestone-card.unlocked {
  border-left-color: var(--accent-warning);
  cursor: pointer;
}
.news-card.milestone-card.unlocked:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(217, 119, 6, 0.15);
}
.news-card.milestone-card.locked {
  opacity: 0.6;
  cursor: not-allowed;
  background-color: var(--bg-tertiary);
}

/* Modal Dialogs (Dictionary & Teacher Selector) */
.word-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 2000;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(5px);
}

.word-modal.open {
  display: flex;
}

.word-modal-content {
  background-color: var(--bg-secondary);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-sm);
  padding: 30px 24px 24px;
  width: 90%;
  max-width: 450px;
  position: relative;
  box-shadow: var(--glass-shadow);
  animation: modalPop 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.close-modal-btn {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 24px;
  color: var(--text-secondary);
  cursor: pointer;
  line-height: 1;
  transition: color var(--transition-fast);
}

.close-modal-btn:hover {
  color: var(--accent-primary);
}

/* New word highlighter */
.new-word-highlight-active .new-word-token {
  background-color: rgba(253, 224, 71, 0.35) !important; /* Soft yellow highlighter marker style */
  color: #121212 !important; /* Deep contrast ink text */
  border-bottom: 1px dashed #d97706 !important;
}

/* Sentence span hover style */
.sentence-span:hover {
  background-color: rgba(56, 189, 248, 0.08);
  cursor: pointer;
}
.light-theme .sentence-span:hover {
  background-color: rgba(0, 86, 137, 0.06);
}
.tts-gender-btn.active {
  font-weight: 600;
}

/* Custom selection highlight for sentence span */
.sentence-span::selection,
.sentence-span *::selection {
  background-color: transparent !important;
  color: inherit !important;
}

/* Text color change when selecting sentence */
.sentence-span.sentence-selected {
  color: var(--accent-warning) !important;
}

.sentence-span.sentence-selected .interactive-word {
  color: var(--accent-warning);
  border-bottom-color: var(--accent-warning);
}

.sentence-span.sentence-selected .interactive-word:hover {
  background-color: var(--accent-primary-glow);
  color: var(--accent-primary) !important;
  border-bottom-color: var(--accent-primary) !important;
}

.sentence-span.sentence-selected .sentence-translate-trigger {
  display: inline-flex !important;
  align-items: center;
  gap: 4px;
}

.sentence-translate-trigger:hover {
  filter: brightness(1.1);
  transform: scale(1.05);
}

/* Mic Button States & Animations */
.mic-btn.active {
  background: var(--accent-danger) !important;
  color: #fff !important;
  border-color: var(--accent-danger) !important;
  animation: pulse-mic 1.5s infinite;
}

@keyframes pulse-mic {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(239, 68, 68, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0);
  }
}

/* Floating Debug Simulation Widget styling */
.debug-widget {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9999;
  font-family: var(--font-sans);
}

.debug-widget-toggle {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--accent-primary);
  color: #fff;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
  font-size: 20px;
  transition: all var(--transition-normal);
}

.debug-widget-toggle:hover {
  transform: rotate(45deg) scale(1.05);
  box-shadow: 0 0 15px var(--accent-primary-glow);
}

.debug-widget-panel {
  display: none;
  width: 320px;
  background: rgba(15, 23, 42, 0.95);
  border: 1px solid var(--glass-border);
  border-radius: var(--border-radius-md);
  box-shadow: var(--shadow-lg);
  padding: 16px;
  color: #f8fafc;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 10px;
  backdrop-filter: blur(12px);
  text-align: left;
}

.debug-widget-panel.open {
  display: flex;
}

.debug-header {
  font-size: 14px;
  font-weight: 700;
  color: var(--accent-warning);
  border-bottom: 1px solid var(--glass-border);
  padding-bottom: 8px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.debug-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.debug-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.debug-btn-group {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.debug-btn {
  padding: 4px 8px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.05);
  color: #e2e8f0;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.debug-btn:hover {
  background: var(--accent-primary-glow);
  border-color: var(--accent-primary);
  color: #fff;
}

.debug-btn.active {
  background: var(--accent-primary);
  border-color: var(--accent-primary);
  color: #fff;
}

.debug-status-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  background: rgba(0, 0, 0, 0.2);
  padding: 8px;
  border-radius: 6px;
  font-size: 11px;
}

.debug-status-item {
  display: flex;
  flex-direction: column;
}

.debug-status-val {
  font-weight: 600;
  color: #fff;
}

/* ==========================================================================
   PRO UPGRADE & MONETIZATION STYLES
   ========================================================================== */
.pro-crown-badge {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.2), rgba(217, 83, 47, 0.2));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  color: #f59e0b;
  border: 1px solid rgba(245, 158, 11, 0.4);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.2);
  animation: crownPulse 2s infinite ease-in-out;
}

@keyframes crownPulse {
  0%, 100% { transform: scale(1); box-shadow: 0 4px 16px rgba(245, 158, 11, 0.2); }
  50% { transform: scale(1.05); box-shadow: 0 6px 22px rgba(245, 158, 11, 0.45); }
}

.sidebar-menu .menu-item#sidebar-pro-btn {
  transition: all var(--transition-fast);
}

.sidebar-menu .menu-item#sidebar-pro-btn:hover {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.25), rgba(217, 83, 47, 0.25)) !important;
  border-color: #f59e0b !important;
  transform: translateX(4px);
}

