/* ==========================================================================
   DocManager Pro - Modern Academic Study & Revision Workspace Stylesheet
   Design Philosophy:
     - Typography: Outfit (Bold Modern Display), Plus Jakarta Sans (Readable Body), JetBrains Mono (Tech/Metrics)
     - Atmosphere: Deep Midnight Space Palette with High-Tech Frosted Accents, Ambient Glows, and Tactile Micro-Interactions
     - Revision OS: 3-Stage Mastery Stepper (R1 Amber · R2 Sapphire · R3 Emerald), Circular Progress HUD Rings, Interactive Bar Graphs
     - Interactive Features: Pomodoro Focus Timer, Audio Synthesizer Feedback, Confetti Bursts, Keyboard Shortcuts
   ========================================================================== */

:root {
  /* Typography Hierarchy (EduStream Design System) */
  --font-brand: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-body: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-metric: 'JetBrains Mono', monospace;
  --font-mono: 'JetBrains Mono', monospace;

  /* Nordic Minimalist Dark Palette (Default: Obsidian, Muted Sage & Deep Teal) */
  --bg-app: #0c0f14;
  --bg-surface: #121720;
  --bg-surface-subtle: #171e29;
  --bg-surface-hover: #1f2735;
  --bg-surface-active: #273142;

  --border-color: #222b3b;
  --border-subtle: #19202c;
  --border-focus: #10b981;

  --text-main: #f1f5f9;
  --text-muted: #94a3b8;
  --text-subtle: #64748b;

  /* Primary Accent: Sage Emerald (Organic, clean, calm focus) */
  --brand-blue: #10b981;
  --brand-blue-hover: #059669;
  --brand-blue-light: rgba(16, 185, 129, 0.12);
  --brand-blue-subtle: rgba(16, 185, 129, 0.14);

  /* Secondary Complement: Nordic Ice Teal */
  --brand-purple: #14b8a6;
  --brand-purple-light: rgba(20, 184, 166, 0.12);

  --brand-cyan: #06b6d4;
  --brand-cyan-light: rgba(6, 182, 212, 0.12);

  --success: #10b981;
  --success-light: rgba(16, 185, 129, 0.12);
  --success-text: #6ee7b7;

  /* Warm Ochre Amber (Subtle, muted tone for warnings/stages) */
  --amber: #f59e0b;
  --amber-light: rgba(245, 158, 11, 0.12);
  --amber-text: #fde68a;

  --danger: #f43f5e;
  --danger-light: rgba(244, 63, 94, 0.12);
  --danger-text: #fda4af;

  --sidebar-w: 265px;
  --header-h: 64px;

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 10px 25px -4px rgba(0, 0, 0, 0.5);
  --shadow-glow-blue: 0 0 20px rgba(16, 185, 129, 0.18);
  --shadow-glow-emerald: 0 0 20px rgba(16, 185, 129, 0.22);
}

/* Minimalist Clean Light Palette (Refined Bone White, Slate, Sage) */
body.light-theme,
html:not(.dark) body {
  --bg-app: #f8fafc;
  --bg-surface: #ffffff;
  --bg-surface-subtle: #f1f5f9;
  --bg-surface-hover: #e2e8f0;
  --bg-surface-active: #cbd5e1;

  --border-color: #cbd5e1;
  --border-subtle: #e2e8f0;
  --border-focus: #059669;

  --text-main: #090d16;
  --text-muted: #334155;
  --text-subtle: #475569;

  --brand-blue: #059669;
  --brand-blue-hover: #047857;
  --brand-blue-light: #ecfdf5;
  --brand-blue-subtle: rgba(5, 150, 105, 0.12);

  --brand-purple: #0d9488;
  --brand-purple-light: #f0fdfa;

  --brand-cyan: #0284c7;
  --brand-cyan-light: #f0f9ff;

  --success: #059669;
  --success-light: #ecfdf5;
  --success-text: #047857;

  --amber: #d97706;
  --amber-light: #fffbeb;
  --amber-text: #b45309;

  --danger: #e11d48;
  --danger-light: #fff1f2;
  --danger-text: #be123c;

  --shadow-subtle: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 10px 25px -4px rgba(0, 0, 0, 0.06);
  --shadow-glow-blue: 0 0 15px rgba(5, 150, 105, 0.12);
  --shadow-glow-emerald: 0 0 15px rgba(5, 150, 105, 0.15);
}

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

body {
  font-family: var(--font-body);
  background-color: var(--bg-app);
  color: var(--text-main);
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color 0.25s ease, color 0.25s ease;
}

code, pre, .font-mono {
  font-family: var(--font-mono);
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  outline: none;
  color: inherit;
  transition: transform 0.12s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

button:active {
  transform: scale(0.96);
}

input, select, textarea {
  font-family: inherit;
  outline: none;
  color: inherit;
}

/* Global Loading Overlay */
.loading-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(6, 9, 19, 0.85);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.3s ease;
}

.loading-spinner-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  padding: 30px 40px;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5), var(--shadow-glow-blue);
}

.loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--bg-surface-subtle);
  border-top-color: var(--brand-blue);
  border-radius: 50%;
  animation: loading-spin 1s linear infinite;
}

@keyframes loading-spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--text-main);
}
.icon-svg {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

.icon-svg-lg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; fill: none; }
.icon-svg-sm {
  width: 15px;
  height: 15px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none !important;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ==========================================================================
   HEADER BAR (Clean Minimal with Focus Timer, Shortcuts & Avatar)
   ========================================================================== */
header {
  height: var(--header-h);
  background-color: var(--bg-surface);
  border-bottom: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 40;
  flex-shrink: 0;
  gap: 16px;
  backdrop-filter: blur(12px);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.btn-hamburger {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background-color: var(--bg-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.btn-hamburger:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--text-muted);
}

.brand-title {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.025em;
  color: var(--text-main);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.brand-text-stack {
  display: flex;
  flex-direction: column;
  justify-content: center;
  line-height: 1.1;
}

.brand-name-row {
  display: flex;
  align-items: center;
  gap: 7px;
}

.brand-byline {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  opacity: 0.78;
  margin-top: 1px;
}

.brand-name {
  font-family: var(--font-brand);
  font-weight: 800;
  font-size: 20px;
  letter-spacing: -0.025em;
  color: var(--text-main);
}

.brand-indicator {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background-color: var(--brand-blue);
  box-shadow: 0 0 10px var(--brand-blue);
}

.brand-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  padding: 2px 7px;
  border-radius: 6px;
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--brand-blue);
}

/* Universal Search Box */
.header-search {
  flex: 1 1 auto;
  max-width: 440px;
  min-width: 140px;
  position: relative;
  display: flex;
  align-items: center;
}

.header-search .icon-svg {
  position: absolute;
  left: 15px;
  color: var(--text-subtle);
  pointer-events: none;
}

.search-input {
  width: 100%;
  padding: 9px 18px 9px 40px;
  font-size: 13px;
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 9999px;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.search-input:focus {
  background-color: var(--bg-surface);
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.search-kbd-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 6px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  position: absolute;
  right: 12px;
  pointer-events: none;
}

/* Header Right Actions */
.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 2px 4px;
  margin-left: 8px;
  flex-shrink: 0;
}

/* Responsive Header Styles (Zero Overflow on All Mobile & Tablet Screens) */
@media (max-width: 1024px) {
  header {
    padding: 0 14px;
    gap: 10px;
  }
  .header-actions {
    margin-left: 6px;
    gap: 8px;
  }
  .header-search {
    max-width: 260px;
  }
}

@media (max-width: 768px) {
  header {
    padding: 0 10px;
    gap: 8px;
    height: 56px;
  }
  .header-left {
    gap: 8px;
  }
  .btn-hamburger {
    width: 34px;
    height: 34px;
  }
  .brand-title {
    gap: 6px;
  }
  .brand-name {
    font-size: 15px;
  }
  .brand-byline {
    font-size: 8px;
    letter-spacing: 0.03em;
  }
  .brand-tag {
    display: none;
  }
  .brand-indicator {
    display: none;
  }
  .header-search {
    display: none; /* Replaced by full-width mobile search input below hero */
  }
  .header-actions {
    margin-left: auto;
    gap: 6px;
    padding: 0;
  }
  .btn-header-shortcuts,
  .btn-header-sound {
    display: none;
  }
  .header-focus-timer {
    padding: 4px 8px;
    gap: 5px;
  }
  .focus-timer-dot {
    width: 6px;
    height: 6px;
  }
  .focus-timer-digits {
    font-size: 11.5px;
  }
  .btn-focus-edit,
  .header-focus-timer button {
    display: none;
  }
  .btn-header-attach {
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
  }
  .btn-header-attach .btn-attach-text {
    display: none;
  }
  .btn-icon-square {
    width: 32px;
    height: 32px;
  }
  .header-avatar-btn {
    height: 32px;
    padding: 0 8px;
    font-size: 11px;
    gap: 4px;
  }
  .header-nav-profile-icon {
    width: 15px;
    height: 15px;
  }
  .header-nav-profile-text {
    font-size: 11px;
  }
}

/* Pomodoro Focus Timer in Header */
.header-focus-timer-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.header-focus-timer {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: 9999px;
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  transition: all 0.2s ease;
  user-select: none;
}

.header-focus-timer:hover {
  border-color: var(--brand-blue);
  background-color: var(--bg-surface);
}

.header-focus-timer.running {
  border-color: var(--amber);
  box-shadow: 0 0 12px rgba(245, 158, 11, 0.28);
  background-color: var(--bg-surface);
}

.focus-timer-dot {
  width: 8px;
  height: 8px;
  border-radius: 9999px;
  background-color: var(--text-subtle);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.header-focus-timer.running .focus-timer-dot {
  background-color: var(--amber);
  box-shadow: 0 0 8px var(--amber);
  animation: pulseDot 1.4s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.3); }
}

.focus-timer-display-container {
  display: flex;
  align-items: center;
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: background-color 0.15s ease;
}

.focus-timer-display-container:hover {
  background-color: var(--bg-surface-hover);
}

.focus-timer-digits {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-main);
  min-width: 44px;
}

.focus-timer-inline-input {
  width: 52px;
  padding: 1px 3px;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--brand-blue);
  border-radius: 4px;
  color: var(--text-main);
  outline: none;
}

.btn-focus-action {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  color: var(--text-muted);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  transition: all 0.15s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
}

.btn-focus-action:hover {
  color: var(--text-main);
  border-color: var(--brand-blue);
  background-color: var(--bg-surface-hover);
  transform: scale(1.05);
}

.btn-focus-edit {
  color: var(--brand-blue);
  font-size: 12px;
}

/* Interactive Timer Popover Card */
.timer-popover-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 310px;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(16px);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: popoverFadeIn 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes popoverFadeIn {
  from { opacity: 0; transform: translateY(-8px) scale(0.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.timer-popover-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 10px;
}

.timer-popover-title {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 7px;
}

.timer-popover-close-btn {
  width: 24px;
  height: 24px;
  border-radius: 5px;
  font-size: 11px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.timer-popover-close-btn:hover {
  background-color: var(--bg-surface-subtle);
  color: var(--text-main);
}

.timer-mode-segmented {
  display: flex;
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 9999px;
  padding: 3px;
  gap: 3px;
}

.timer-section-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
}

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

.timer-preset-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 6px 2px;
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  transition: all 0.15s ease;
  user-select: none;
}

.timer-preset-btn:hover {
  border-color: var(--brand-blue);
  background-color: var(--bg-surface-hover);
  transform: translateY(-1px);
}

.timer-preset-btn.active {
  background-color: var(--brand-blue);
  border-color: var(--brand-blue);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

.timer-preset-btn .preset-time {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 800;
  color: var(--text-main);
}

.timer-preset-btn.active .preset-time {
  color: #ffffff;
}

.timer-preset-btn .preset-label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-muted);
}

.timer-preset-btn.active .preset-label {
  color: rgba(255, 255, 255, 0.85);
}

.timer-custom-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.timer-stepper-box {
  display: flex;
  align-items: center;
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.btn-timer-step {
  width: 26px;
  height: 28px;
  border-radius: 5px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.12s ease;
}

.btn-timer-step:hover {
  background-color: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #ffffff;
}

.timer-step-input-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 0 4px;
}

.timer-step-num-input {
  width: 44px;
  font-family: var(--font-mono);
  font-size: 15px;
  font-weight: 800;
  text-align: center;
  background: transparent;
  border: none;
  color: var(--text-main);
  outline: none;
}

.timer-step-sublabel {
  font-size: 8.5px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  font-family: var(--font-mono);
}

.timer-time-colon {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 900;
  color: var(--text-muted);
}

.timer-quick-deltas {
  display: flex;
  gap: 5px;
  justify-content: center;
}

.btn-quick-delta {
  flex: 1;
  padding: 4px 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 700;
  border-radius: 6px;
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  transition: all 0.12s ease;
}

.btn-quick-delta:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
  border-color: var(--text-main);
}

.timer-popover-footer {
  display: flex;
  gap: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border-color);
}

.btn-icon-square {
  width: 42px;
  height: 42px;
  padding: 9px;
  margin: 0 2px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-color);
  background-color: var(--bg-surface-subtle);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.btn-icon-square:hover {
  background-color: var(--bg-surface-hover);
  color: var(--text-main);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.header-avatar-btn {
  height: 42px;
  padding: 0 14px;
  margin-left: 6px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  cursor: pointer;
}

.header-avatar-btn:hover {
  background-color: var(--bg-surface-hover);
  color: var(--brand-blue);
  border-color: var(--brand-blue);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.15);
}

.header-nav-profile-icon {
  width: 17px;
  height: 17px;
  stroke: currentColor;
  flex-shrink: 0;
}

.header-nav-profile-text {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Clean Standard Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 15px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 700;
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn-primary {
  background-color: var(--brand-blue);
  color: #ffffff;
  border: 1.5px solid var(--brand-blue);
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.btn-primary:hover {
  background-color: var(--brand-blue-hover);
  box-shadow: 0 4px 14px rgba(16, 185, 129, 0.38);
}

.btn-secondary {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 1.5px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-surface-subtle);
  border-color: var(--text-muted);
}

.btn-neutral {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border: 1.5px solid var(--border-color);
  box-shadow: var(--shadow-subtle);
}

.btn-neutral:hover {
  background-color: var(--bg-surface-subtle);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

/* ==========================================================================
   APP WORKSPACE LAYOUT
   ========================================================================== */
.app-container {
  display: flex;
  flex: 1 1 0%;
  min-height: 0;
  height: calc(100vh - var(--header-h));
  overflow: hidden;
  position: relative;
}

.backdrop-mobile {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 55;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

body.sidebar-open .backdrop-mobile {
  opacity: 1;
  pointer-events: auto;
}

/* ==========================================================================
   SIDEBAR NAVIGATION
   ========================================================================== */
aside {
  width: var(--sidebar-w);
  background-color: var(--bg-surface);
  border-right: 1.5px solid var(--border-color);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), margin-left 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 25;
  overflow: hidden;
  height: 100%;
}

body.sidebar-collapsed aside {
  margin-left: calc(-1 * var(--sidebar-w));
}

.sidebar-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1.5px solid var(--border-color);
  background-color: var(--bg-surface);
}

.btn-sidebar-close-mobile {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface-subtle);
  color: var(--text-main);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.btn-sidebar-close-mobile:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--text-muted);
}

@media (max-width: 768px) {
  aside {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    width: 290px;
    max-width: 85vw;
    height: 100vh;
    height: 100dvh;
    margin-left: 0 !important;
    transform: translateX(-100%);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    z-index: 60;
    overflow: hidden;
    contain: layout style;
    will-change: transform;
    touch-action: pan-y;
  }

  body.sidebar-open aside {
    transform: translateX(0) !important;
  }

  .sidebar-mobile-header {
    display: flex;
    flex-shrink: 0;
  }

  .sidebar-progress-box,
  .sidebar-header-row,
  .sidebar-footer {
    flex-shrink: 0;
  }
}

.sidebar-progress-box {
  padding: 16px;
  border-bottom: 1px solid var(--border-subtle);
  background-color: var(--bg-surface-subtle);
}

.progress-info-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.progress-label {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.progress-pct {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 800;
  color: var(--brand-blue);
}

.progress-track {
  width: 100%;
  height: 6px;
  background-color: var(--border-color);
  border-radius: 9999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  background-color: var(--brand-blue);
  border-radius: 9999px;
  transition: width 0.4s ease;
}

.sidebar-header-row {
  padding: 14px 16px 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.sidebar-heading {
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}

.sidebar-subjects-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 6px 12px;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

/* Custom Scrollbar for Sidebar Navigation */
.sidebar-subjects-list::-webkit-scrollbar {
  width: 5px;
}

.sidebar-subjects-list::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-subjects-list::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 9999px;
  transition: background-color 0.15s ease;
}

.sidebar-subjects-list::-webkit-scrollbar-thumb:hover {
  background-color: var(--text-muted);
}

.sidebar-item-row,
.sidebar-subfolder-row {
  display: flex;
  align-items: center;
  position: relative;
  margin-bottom: 2px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}

.sidebar-item-row:hover,
.sidebar-subfolder-row:hover {
  background-color: var(--bg-surface-subtle);
}

.sidebar-item-row.active,
.sidebar-subfolder-row.active {
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
}

.sidebar-item-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  color: var(--text-main);
  font-family: var(--font-body);
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.01em;
  text-align: left;
  border: 1px solid transparent;
  transition: all 0.15s ease;
  position: relative;
  min-width: 0;
}

.sidebar-item-btn:hover {
  color: var(--text-main);
}

.sidebar-item-btn.active {
  color: var(--brand-blue);
  font-weight: 700;
}

.sidebar-item-actions {
  display: flex;
  align-items: center;
  gap: 2px;
  padding-right: 6px;
  opacity: 0.2;
  transition: opacity 0.15s ease;
}

.sidebar-item-row:hover .sidebar-item-actions,
.sidebar-subfolder-row:hover .sidebar-item-actions {
  opacity: 1;
}

.btn-sidebar-action {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background: transparent;
  border: none;
  font-size: 11px;
  transition: all 0.12s ease;
  cursor: pointer;
}

.btn-sidebar-action:hover {
  background-color: var(--bg-surface-hover);
  color: var(--brand-blue);
  transform: scale(1.1);
}

.btn-sidebar-action.btn-sidebar-delete:hover {
  color: var(--danger);
  background-color: var(--danger-light);
}

.sidebar-subfolder-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 6px 26px;
  border-radius: 6px;
  color: var(--text-subtle);
  font-size: 12px;
  text-align: left;
  position: relative;
  transition: all 0.15s ease;
  min-width: 0;
}

.sidebar-subfolder-btn::before {
  content: '';
  position: absolute;
  left: 14px;
  top: 0;
  bottom: 50%;
  width: 1.5px;
  background-color: var(--border-color);
}

.sidebar-subfolder-btn:hover {
  color: var(--text-main);
}

.sidebar-subfolder-btn.active {
  color: var(--brand-blue);
  font-weight: 700;
}

.sidebar-subfolder-btn.active {
  color: var(--brand-blue);
  font-weight: 700;
}

.sidebar-footer {
  padding: 12px 14px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.btn-sidebar-settings {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 700;
  transition: all 0.15s ease;
}

.btn-sidebar-settings:hover {
  background-color: var(--bg-surface-subtle);
  color: var(--text-main);
}

/* ==========================================================================
   MAIN CONTENT AREA & DASHBOARD WORKSPACE
   ========================================================================== */
main {
  flex: 1;
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  background-color: var(--bg-app);
  padding: 24px 32px 80px 32px;
  gap: 22px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}

main::-webkit-scrollbar {
  width: 8px;
}

main::-webkit-scrollbar-track {
  background: var(--bg-app);
}

main::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 9999px;
  border: 2px solid var(--bg-app);
}

main::-webkit-scrollbar-thumb:hover {
  background: var(--border-hover);
}

@media (max-width: 960px) {
  main {
    padding: 16px 16px 40px 16px;
    gap: 18px;
  }
  .dashboard-hero {
    padding: 22px 24px;
  }
  .dashboard-hero-title {
    font-size: 24px;
  }
}

/* MOBILE DEDICATED SEARCH BAR */
.mobile-search-bar-wrap {
  display: none;
  position: relative;
  width: 100%;
  margin-bottom: -4px;
}

@media (max-width: 768px) {
  .mobile-search-bar-wrap {
    display: flex;
    align-items: center;
  }
  .mobile-search-bar-wrap .icon-svg {
    position: absolute;
    left: 12px;
    color: var(--text-subtle);
    pointer-events: none;
    width: 16px;
    height: 16px;
  }
  .mobile-search-input {
    width: 100%;
    padding: 9px 34px 9px 36px;
    font-size: 13px;
    background-color: var(--bg-surface);
    border: 1.5px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-subtle);
    color: var(--text-main);
  }
  .btn-clear-search {
    position: absolute;
    right: 10px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background-color: var(--bg-surface-subtle);
    border: 1px solid var(--border-color);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
  }
}

/* DASHBOARD HERO BANNER (CLEAN, SOLID, PROMINENT) */
.dashboard-hero {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 8px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
  position: relative;
  overflow: visible;
  width: 100%;
}

.dashboard-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  border-top-left-radius: var(--radius-lg);
  border-top-right-radius: var(--radius-lg);
  background: var(--brand-blue);
}

.dashboard-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 18px;
  width: 100%;
}

.hero-user-cluster {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1 1 300px;
  min-width: 0;
}

.hero-avatar-squircle {
  width: 58px;
  height: 58px;
  border-radius: 16px;
  background-color: var(--brand-blue);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(16, 185, 129, 0.35);
  flex-shrink: 0;
  user-select: none;
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.hero-avatar-squircle:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 24px rgba(59, 130, 246, 0.55);
}

.hero-user-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--brand-blue);
  margin-bottom: 2px;
  flex-wrap: wrap;
}

.hero-eyebrow-text {
  display: inline-block;
  white-space: nowrap;
}

.hero-eyebrow-divider {
  color: var(--text-subtle);
}

.hero-user-badge {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 4px;
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--brand-blue);
  white-space: nowrap;
}

.status-live-pulse {
  width: 7px;
  height: 7px;
  border-radius: 9999px;
  background-color: var(--brand-blue);
  box-shadow: 0 0 8px var(--brand-blue);
  flex-shrink: 0;
}

.hero-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
}

.dashboard-hero-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1.25;
  margin: 0;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.hero-user-name {
  color: var(--brand-blue);
  cursor: pointer;
  transition: opacity 0.15s ease, text-decoration 0.15s ease;
}

.hero-user-name:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.btn-edit-username-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 700;
  font-family: var(--font-sans);
  border-radius: 6px;
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}

.btn-edit-username-pill:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  background-color: var(--bg-surface-hover);
  transform: translateY(-1px);
}

.dashboard-hero-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-top: 2px;
  max-width: 660px;
  line-height: 1.45;
}

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

/* Mobile Hero Banner Specifics */
@media (max-width: 768px) {
  .dashboard-hero {
    padding: 16px 16px;
    border-radius: var(--radius-md);
    gap: 12px;
  }
  .dashboard-hero-top {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }
  .hero-user-cluster {
    align-items: flex-start;
    gap: 12px;
    width: 100%;
  }
  .hero-avatar-squircle {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    font-size: 16px;
  }
  .hero-eyebrow {
    font-size: 10px;
    letter-spacing: 0.3px;
    gap: 4px;
  }
  .dashboard-hero-title {
    font-size: 18px;
  }
  .btn-edit-username-pill {
    padding: 3px 8px;
    font-size: 10.5px;
  }
  .dashboard-hero-desc {
    font-size: 12px;
    line-height: 1.4;
  }
  .hero-actions-cluster {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 8px;
    width: 100%;
  }
  .hero-actions-cluster .btn {
    width: 100%;
    justify-content: center;
    padding: 8px 10px;
    font-size: 12px;
  }
}

.btn-icon-subtle {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  transition: all 0.15s ease;
  cursor: pointer;
}

.btn-icon-subtle:hover {
  color: var(--brand-blue);
  border-color: var(--brand-blue);
  background-color: var(--bg-surface-hover);
  transform: scale(1.08);
}

.scroll-to-top-btn {
  position: fixed;
  bottom: 24px;
  right: 28px;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  display: none;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 60;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-to-top-btn.visible {
  display: flex;
}

.scroll-to-top-btn:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(59, 130, 246, 0.35);
}

/* THE 4 CLICKABLE METRIC STAT CARDS (Vertical Squircle-Rectangular Curved Borders) */
.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

@media (max-width: 1080px) {
  .metrics-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 580px) {
  .metrics-grid {
    grid-template-columns: 1fr;
  }
}

.metric-card {
  background: linear-gradient(180deg, var(--bg-surface) 0%, var(--bg-surface-subtle) 100%);
  border: 1.5px solid var(--border-color);
  border-radius: 18px;
  min-height: 148px;
  padding: 20px 20px 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  box-shadow: var(--shadow-subtle);
  cursor: pointer;
  user-select: none;
  transition: all 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.metric-card:hover {
  transform: translateY(-4px);
  border-color: var(--brand-blue);
  background: var(--bg-surface-hover);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.22), 0 0 0 1px rgba(59, 130, 246, 0.25);
}

.metric-card:active {
  transform: translateY(-1px) scale(0.99);
}

.section-highlight-pulse {
  animation: sectionHighlightPulse 1.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes sectionHighlightPulse {
  0% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.5);
    border-radius: var(--radius-md);
  }
  25% {
    box-shadow: 0 0 0 10px rgba(59, 130, 246, 0.2);
    border-radius: var(--radius-md);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(59, 130, 246, 0);
    border-radius: var(--radius-md);
  }
}

.metric-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.metric-card-top svg {
  width: 18px;
  height: 18px;
  padding: 6px;
  box-sizing: content-box;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  color: var(--brand-blue);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.metric-card:hover .metric-card-top svg {
  background-color: var(--brand-blue-subtle);
  border-color: rgba(59, 130, 246, 0.35);
  color: var(--brand-cyan);
  transform: scale(1.08);
}

.metric-card-val {
  font-family: var(--font-metric);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--text-main);
  line-height: 1;
}

.metric-card-sub {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.35;
}

/* ==========================================================================
   PROGRESS ANALYTICS CARD (Matches Screenshot Image 2)
   ========================================================================== */
.analytics-panel-card {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px 26px;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.analytics-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.analytics-heading-left {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.analytics-title {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 9px;
}

.analytics-title .icon-svg {
  color: var(--brand-cyan);
}

.analytics-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.analytics-controls-cluster {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.toggle-pill-group {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 9999px;
  padding: 3px;
  gap: 3px;
}

.btn-toggle-pill {
  padding: 6px 14px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  border-radius: 9999px;
  color: var(--text-muted);
  transition: all 0.15s ease;
  user-select: none;
}

.btn-toggle-pill:hover {
  color: var(--text-main);
}

.btn-toggle-pill.active {
  background-color: var(--bg-surface);
  color: var(--text-main);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border-color);
}

body.light-theme .btn-toggle-pill.active {
  background-color: #ffffff;
  color: var(--brand-blue);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

/* Linear Spline Wave Chart View */
.linear-chart-wrapper {
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 20px 22px 14px 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  overflow: hidden;
}

.linear-chart-eyebrow {
  display: flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--brand-cyan);
}

.linear-spline-svg-box {
  width: 100%;
  height: 250px;
  position: relative;
}

.linear-spline-svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.chart-grid-line {
  stroke: var(--border-color);
  stroke-dasharray: 4 4;
  stroke-width: 1;
}

.chart-axis-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  fill: var(--text-muted);
}

.chart-spline-path {
  fill: none;
  stroke: var(--brand-cyan);
  stroke-width: 2.5;
  filter: drop-shadow(0 0 8px rgba(6, 182, 212, 0.45));
}

.chart-node-circle {
  fill: var(--bg-surface);
  stroke: var(--brand-cyan);
  stroke-width: 2.5;
  cursor: pointer;
  transition: all 0.2s ease;
}

.chart-node-circle:hover {
  r: 7;
  stroke: #ffffff;
  fill: var(--brand-cyan);
  filter: drop-shadow(0 0 10px rgba(6, 182, 212, 0.85));
}

/* Radial Rings Grid View */
.radial-rings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 14px;
}

.radial-subject-card {
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 18px 14px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.radial-subject-card:hover {
  transform: translateY(-3px);
  border-color: var(--brand-cyan);
  box-shadow: 0 0 16px rgba(6, 182, 212, 0.25);
  background-color: var(--bg-surface-hover);
}

.radial-gauge-container {
  width: 82px;
  height: 82px;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
}

.radial-gauge-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.radial-gauge-track {
  fill: none;
  stroke: var(--border-color);
  stroke-width: 5.5;
}

.radial-gauge-fill {
  fill: none;
  stroke: var(--brand-cyan);
  stroke-width: 5.5;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.radial-gauge-center {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
}

.radial-center-pct {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 800;
  color: var(--text-main);
}

.radial-subject-title {
  font-family: var(--font-display);
  font-size: 13.5px;
  font-weight: 800;
  color: var(--text-main);
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.radial-subject-assets {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--text-subtle);
}

/* DASHBOARD BAR GRAPH CHARTS CARD */
.charts-overview-card {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 20px 24px;
  box-shadow: var(--shadow-subtle);
}

/* DASHBOARD COLUMN HEADERS (UNIFORM ALIGNMENT & RESPONSIVE) */
.dash-column-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 14px;
  min-height: 68px;
}

.dash-column-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 28px;
}

.dash-column-controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  min-height: 32px;
}

.dash-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.dash-header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .dash-section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .dash-header-controls {
    width: 100%;
    justify-content: flex-start;
    gap: 6px;
  }
}

.dash-section-title {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.bar-chart-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.bar-chart-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px;
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.bar-chart-row:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--brand-blue);
  transform: translateX(3px);
}

.bar-chart-row.active {
  border-color: var(--brand-blue);
  background-color: var(--bg-surface-hover);
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.25);
}

.bar-chart-label {
  width: 170px;
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-chart-track {
  flex: 1;
  height: 10px;
  background-color: var(--border-color);
  border-radius: 9999px;
  overflow: hidden;
  position: relative;
}

.bar-chart-fill {
  height: 100%;
  border-radius: 9999px;
  background-color: var(--brand-blue);
  transition: width 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.bar-chart-val {
  width: 110px;
  text-align: right;
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 11.5px;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ==========================================================================
   UNIFIED FULL-WIDTH DASHBOARD SECTIONS (RESPONSIVE & BALANCED)
   ========================================================================== */
.dashboard-content-grid {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

/* REVISION QUEUE */
.revision-queue-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.queue-card {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  box-shadow: var(--shadow-subtle);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.queue-card:hover {
  border-color: var(--brand-blue);
  background-color: var(--bg-surface-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-blue);
}

.file-type-icon-box {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-blue);
  flex-shrink: 0;
}

.queue-left {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
  flex: 1;
}

.queue-title {
  font-family: var(--font-display);
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--text-main);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.queue-meta {
  font-size: 11.5px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 5-STAGE REVISION CHECKBOXES & PROGRESS BAR (R1 to R5) */
.rev-checkbox-group {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
  flex-shrink: 0;
}

.rev-checkbox-row {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 8px;
  padding: 3px 5px;
}

.rev-checkbox {
  width: 23px;
  height: 23px;
  border-radius: 5px;
  border: 1.5px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  padding: 0;
}

.rev-checkbox:hover {
  border-color: var(--brand-blue);
  color: var(--text-main);
  transform: translateY(-1px) scale(1.08);
}

.rev-checkbox.checked {
  background-color: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #ffffff;
  box-shadow: 0 0 8px rgba(59, 130, 246, 0.4);
}

.rev-checkbox.checked.rev-checkbox-mastered {
  background-color: var(--success);
  border-color: var(--success);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.55);
}

.rev-check-svg {
  width: 13px;
  height: 13px;
  stroke: #ffffff;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.rev-progress-mini-bar {
  width: 100%;
  height: 4px;
  background-color: var(--border-color);
  border-radius: 9999px;
  overflow: hidden;
}

.rev-progress-mini-fill {
  height: 100%;
  border-radius: 9999px;
  transition: width 0.35s ease, background-color 0.35s ease;
}

.rev-count-badge {
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.rev-count-badge.mastered {
  color: var(--success-text);
  font-weight: 800;
}

/* QUICK ATTACH BANNER ON DASHBOARD */
.dash-quick-attach-banner {
  background-color: var(--bg-surface);
  border: 1.5px dashed var(--border-color);
  border-radius: var(--radius-md);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-bottom: 12px;
}

.dash-quick-attach-banner:hover {
  border-color: var(--brand-blue);
  background-color: var(--bg-surface-hover);
  box-shadow: var(--shadow-glow-blue);
}

.quick-attach-icon-circle {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background-color: var(--brand-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.rev-stage-circles {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 9999px;
  padding: 3px 6px;
}

.rev-circle-btn {
  width: 24px;
  height: 24px;
  border-radius: 9999px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid var(--border-color);
  background-color: var(--bg-surface);
  color: var(--text-muted);
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.rev-circle-btn:hover {
  border-color: var(--text-main);
  color: var(--text-main);
  transform: scale(1.15);
}

.rev-circle-btn.stage-1-active {
  background-color: var(--amber);
  border-color: var(--amber);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
}

.rev-circle-btn.stage-2-active {
  background-color: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(59, 130, 246, 0.5);
}

.rev-circle-btn.stage-3-active {
  background-color: var(--success);
  border-color: var(--success);
  color: #ffffff;
  box-shadow: 0 0 10px rgba(16, 185, 129, 0.6);
}

.btn-quick-revise {
  padding: 5px 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface-subtle);
  color: var(--text-main);
  border: 1.5px solid var(--border-color);
  transition: all 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

.btn-quick-revise:hover {
  background-color: var(--brand-blue);
  color: #ffffff;
  border-color: var(--brand-blue);
  transform: scale(1.06);
  box-shadow: 0 2px 10px rgba(59, 130, 246, 0.4);
}

/* ==========================================================================
   SUBJECT MASTERY CARDS & SVG CIRCULAR PROGRESS RINGS
   ========================================================================== */
.subject-mastery-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 14px;
}

.subject-interactive-card {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-subtle);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.subject-interactive-card:hover {
  border-color: var(--brand-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow-blue);
}

.subject-card-main-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.subject-card-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.subject-card-title {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 8px;
}

.subject-card-stats {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-toggle-subtopics {
  align-self: flex-start;
  margin-top: 4px;
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-blue);
  padding: 3px 8px;
  border-radius: 6px;
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  transition: all 0.15s ease;
}

.btn-toggle-subtopics:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--brand-blue);
}

/* Circular Progress Ring */
.circular-progress-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.circular-progress-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.circle-bg {
  fill: none;
  stroke: var(--border-color);
}

.circle-fill {
  fill: none;
  stroke-linecap: round;
  transition: stroke-dashoffset 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.circle-pct-text {
  position: absolute;
  font-family: var(--font-mono);
  font-weight: 800;
  color: var(--text-main);
  text-align: center;
  pointer-events: none;
}

/* Expanded Subtopics Panel */
.subtopics-expanded-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px dashed var(--border-color);
}

.subtopic-item-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.subtopic-item-row:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--brand-blue);
  transform: translateX(3px);
}

.subtopic-item-left {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Subtle Filter Pills & Unified Segmented Controls */
.segmented-pill-group {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: 9999px;
  padding: 3px;
  gap: 3px;
  user-select: none;
}

.btn-segmented-pill {
  padding: 5px 12px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 9999px;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  transition: all 0.16s cubic-bezier(0.16, 1, 0.3, 1);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  cursor: pointer;
}

.btn-segmented-pill:hover {
  color: var(--text-main);
  background-color: var(--bg-surface-hover);
}

.btn-segmented-pill.active {
  background-color: var(--brand-blue);
  color: #ffffff;
  border-color: var(--brand-blue);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.35);
}

.pill-count-tag {
  font-family: var(--font-mono);
  font-size: 10px;
  font-weight: 800;
  padding: 1px 6px;
  border-radius: 9999px;
  background-color: rgba(255, 255, 255, 0.25);
  color: #ffffff;
}

.btn-segmented-pill:not(.active) .pill-count-tag {
  background-color: var(--bg-surface);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
}

.btn-action-pill {
  padding: 5px 12px;
  font-family: var(--font-display);
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 9999px;
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  color: var(--text-muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: all 0.16s ease;
  white-space: nowrap;
  cursor: pointer;
  height: 31px;
}

.btn-action-pill:hover {
  color: var(--text-main);
  border-color: var(--brand-blue);
  background-color: var(--bg-surface-hover);
}

.btn-action-pill.btn-action-primary {
  background-color: var(--brand-blue);
  color: #ffffff;
  border-color: var(--brand-blue);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.3);
}

.btn-action-pill.btn-action-primary:hover {
  background-color: #2563eb;
  transform: translateY(-1px);
}

/* DASHBOARD INSIGHTS CARD (Keeps Right Column Balanced) */
.dashboard-insights-card {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-subtle);
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

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

.dashboard-insights-title {
  font-family: var(--font-display);
  font-size: 12.5px;
  font-weight: 800;
  color: var(--text-main);
  display: flex;
  align-items: center;
  gap: 6px;
}

.dashboard-insights-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.insight-metric-box {
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.insight-metric-val {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 800;
  color: var(--text-main);
}

.insight-metric-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.btn-subtle {
  font-size: 11.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 6px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.btn-subtle:hover {
  color: var(--text-main);
  background-color: var(--bg-surface-hover);
  border-color: var(--text-main);
}

.btn-subtle.active {
  background-color: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #ffffff;
}

/* ==========================================================================
   FOLDER VIEW, DOCUMENT GRID & ACTIONS
   ========================================================================== */
.subject-banner {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 28px;
  margin-bottom: 20px;
  box-shadow: var(--shadow-subtle);
}

.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.breadcrumb-nav button {
  color: var(--text-muted);
  font-weight: 600;
}

.breadcrumb-nav button:hover {
  color: var(--brand-blue);
  text-decoration: underline;
}

.breadcrumb-sep {
  color: var(--text-subtle);
}

.subject-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.subject-title {
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: -0.035em;
  color: var(--text-main);
}

.subject-desc {
  font-size: 13.5px;
  color: var(--text-muted);
  margin-bottom: 14px;
}

.subfolder-chips-container {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.subfolder-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
  transition: all 0.15s ease;
}

.subfolder-chip:hover {
  border-color: var(--brand-blue);
  background-color: var(--bg-surface-hover);
  transform: translateY(-1px);
}

.checkbar-box {
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}

.checkbar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbar-stat {
  font-size: 13px;
  font-weight: 700;
  color: var(--text-main);
}

.checkbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-subtle-danger {
  color: var(--danger-text);
}

.btn-subtle-danger:hover {
  background-color: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

/* Document Grid & Spacing Improvements */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 20px; /* Increased gap for proper spacing */
}

.doc-card {
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 22px; /* More internal padding */
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  cursor: pointer;
  position: relative;
  box-shadow: var(--shadow-subtle);
}

.doc-card:hover {
  border-color: var(--brand-blue);
  transform: translateY(-4px);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.4), var(--shadow-glow-blue);
}

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

.doc-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 4px;
  line-height: 1.35;
}

.doc-meta {
  font-size: 11.5px;
  color: var(--text-muted);
}

.card-revision-section {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  background-color: var(--bg-surface-subtle);
  border-radius: var(--radius-md);
}

.card-rev-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
}

.doc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  border-top: 1px solid var(--border-subtle);
}

.doc-card-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.btn-card-action {
  width: 30px;
  height: 30px;
  border-radius: 6px;
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.btn-card-action:hover {
  background-color: var(--bg-surface-subtle);
  color: var(--text-main);
  border-color: var(--text-main);
}

.btn-card-action-danger:hover {
  background-color: var(--danger-light);
  color: var(--danger);
  border-color: var(--danger);
}

/* Empty States */
.empty-state {
  background-color: var(--bg-surface);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius-lg);
  padding: 44px 28px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.empty-icon-box {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  background-color: var(--bg-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-blue);
  margin-bottom: 4px;
}

.empty-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 800;
  color: var(--text-main);
}

.empty-desc {
  font-size: 13px;
  color: var(--text-muted);
  max-width: 420px;
  line-height: 1.5;
}

/* ==========================================================================
   DOCUMENT VIEWER SCREEN OVERLAY
   ========================================================================== */
#viewer-screen {
  position: fixed;
  inset: 0;
  background-color: var(--bg-app);
  z-index: 100;
  display: none;
  flex-direction: column;
}

#viewer-screen.active {
  display: flex;
}

.viewer-top-bar {
  height: var(--header-h);
  background-color: var(--bg-surface);
  border-bottom: 1.5px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  gap: 16px;
}

.viewer-content-box {
  flex: 1;
  overflow: auto;
  position: relative;
  background-color: var(--bg-surface-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
}

#viewer-iframe {
  width: 100%;
  height: 100%;
  border: none;
  background-color: #ffffff;
}

#viewer-code-container {
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 24px;
  background-color: #0d1117;
  color: #c9d1d9;
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  overflow: auto;
  white-space: pre-wrap;
}

#viewer-image-preview {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   MODALS, SHORTCUTS PALETTE & DIALOGS
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  z-index: 120;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-card {
  width: 100%;
  max-width: 520px;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-label {
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-main);
}

.form-control {
  width: 100%;
  padding: 9px 12px;
  font-size: 13px;
  background-color: var(--bg-surface-subtle);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  color: var(--text-main);
  transition: border-color 0.15s ease;
}

.form-control:focus {
  border-color: var(--brand-blue);
}

/* DROPZONE UPLOAD BOX (Fixes Image 1 Unstyled Dropzone) */
.dropzone-box {
  border: 2px dashed var(--border-color);
  background-color: var(--bg-surface-subtle);
  border-radius: var(--radius-md);
  padding: 24px 20px;
  text-align: center;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
}

.dropzone-box:hover,
.dropzone-box.drag-active {
  border-color: var(--brand-blue);
  background-color: var(--bg-surface-hover);
  box-shadow: 0 0 16px rgba(59, 130, 246, 0.2);
  transform: translateY(-1px);
}

.dropzone-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-blue);
  margin-bottom: 4px;
  transition: all 0.2s ease;
}

.dropzone-box:hover .dropzone-icon-wrap {
  background-color: var(--brand-blue);
  color: #ffffff;
  border-color: var(--brand-blue);
  transform: scale(1.08);
}

/* Modal section divider */
.modal-section-divider {
  display: flex;
  align-items: center;
  text-align: center;
  margin: 6px 0;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1px;
}

.modal-section-divider::before,
.modal-section-divider::after {
  content: '';
  flex: 1;
  border-bottom: 1px solid var(--border-color);
}

.modal-section-divider span {
  padding: 0 12px;
}

/* Shortcut Row Styles */
.shortcut-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
}

.shortcut-desc {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-main);
}

.shortcut-key {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: 6px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  color: var(--brand-blue);
}

/* Confirm Dialog Styles (Premium Layout) */
.confirm-modal-card {
  max-width: 440px;
  border-radius: var(--radius-xl);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface);
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.6);
  animation: modal-pop 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes modal-pop {
  from { opacity: 0; transform: scale(0.9) translateY(10px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

.confirm-modal-body {
  padding: 32px 32px 24px 32px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 16px;
}

.confirm-dialog-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background-color: var(--amber-light);
  color: var(--amber);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 4px;
}

.confirm-dialog-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
}

.confirm-dialog-msg {
  font-size: 14.5px;
  color: var(--text-muted);
  line-height: 1.6;
  max-width: 90%;
}

.confirm-modal-footer {
  padding: 16px 24px 24px 24px;
  border-top: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  justify-content: stretch;
}

.btn-confirm-cancel, .btn-confirm-action {
  height: 44px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.btn-confirm-cancel {
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  color: var(--text-main);
}

.btn-confirm-cancel:hover {
  background-color: var(--bg-surface-hover);
  border-color: var(--text-muted);
}

.btn-confirm-action {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.btn-confirm-action:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

/* ==========================================================================
   USER PROFILE DROPDOWN MENU IN HEADER
   ========================================================================== */
.header-avatar-wrapper {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.profile-dropdown-card {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: 280px;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.45);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: dropdownFade 0.2s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

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

.profile-dropdown-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

.profile-avatar-squircle-sm {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background-color: var(--brand-blue);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.4);
}

.profile-header-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.profile-menu-name {
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  color: var(--text-main);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-menu-email {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-menu-badge {
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.5px;
  color: var(--brand-blue);
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  padding: 1px 5px;
  border-radius: 4px;
  display: inline-block;
  margin-top: 3px;
  width: fit-content;
}

.profile-dropdown-divider {
  height: 1px;
  background-color: var(--border-color);
  margin: 4px 0;
}

.profile-dropdown-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.profile-dropdown-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 12.5px;
  font-weight: 600;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
}

.profile-dropdown-item:hover {
  background-color: var(--bg-surface-subtle);
  color: var(--text-main);
}

.profile-item-icon-box {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text-muted);
  transition: all 0.15s ease;
}

.profile-dropdown-item:hover .profile-item-icon-box {
  background-color: var(--brand-blue-subtle);
  border-color: rgba(59, 130, 246, 0.3);
  color: var(--brand-blue);
}

.profile-dropdown-logout {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  border-radius: var(--radius-md);
  color: var(--danger);
  font-size: 12.5px;
  font-weight: 700;
  text-align: left;
  transition: all 0.15s ease;
  width: 100%;
}

.profile-dropdown-logout .profile-item-icon-box {
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.2);
}

.profile-dropdown-logout:hover {
  background-color: var(--danger-light);
}

.profile-dropdown-logout:hover .profile-item-icon-box {
  background-color: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

/* ==========================================================================
   AUTHENTICATION MODAL & FORM CONTROLS (Rectangular Rounded Card & Minimal Note)
   ========================================================================== */
.auth-modal-card {
  max-width: 400px;
  width: 100%;
  padding: 22px 24px;
  border-radius: 14px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  box-sizing: border-box;
  overflow: visible;
}

.auth-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.login-subpanel {
  animation: dropdownFade 0.2s ease;
}

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

.auth-brand-badge {
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-brand-title {
  font-family: var(--font-brand);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-main);
}

.auth-brand-tag {
  font-family: var(--font-mono);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  background-color: var(--brand-blue-subtle);
  color: var(--brand-cyan);
  padding: 1.5px 6px;
  border-radius: 9999px;
  border: 1px solid rgba(59, 130, 246, 0.25);
}

.auth-close-btn {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
  background-color: var(--bg-surface-subtle);
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-close-btn:hover {
  color: var(--text-main);
  background-color: var(--bg-surface-hover);
}

.auth-title {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.02em;
  margin-bottom: 2px;
}

.auth-subtitle {
  font-size: 11.5px;
  color: var(--text-muted);
  line-height: 1.35;
}

/* Method Switcher inside Login */
.auth-method-switcher {
  display: flex;
  gap: 4px;
  background-color: var(--bg-surface-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 2.5px;
  margin-bottom: 12px;
}

.auth-method-pill-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 6px 8px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}

.auth-method-pill-btn:hover {
  color: var(--text-main);
}

.auth-method-pill-btn.active {
  background-color: var(--bg-surface);
  color: var(--text-main);
  border-color: var(--border-color);
  box-shadow: var(--shadow-subtle);
}

.login-subpanel {
  animation: dropdownFade 0.2s ease;
}

.auth-sync-status-tag {
  font-size: 10.5px;
  color: var(--brand-cyan);
  font-weight: 600;
}

.auth-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.auth-field-icon {
  position: absolute;
  left: 12px;
  color: var(--text-subtle);
  pointer-events: none;
}

.auth-form-input {
  width: 100%;
  padding: 8px 32px 8px 34px;
  font-size: 12.5px;
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  transition: all 0.15s ease;
}

.auth-form-input:focus {
  background-color: var(--bg-surface);
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.auth-eye-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px;
  line-height: 1;
}

.auth-forgot-link {
  font-size: 11px;
  font-weight: 700;
  color: var(--brand-blue);
  background: none;
  border: none;
  cursor: pointer;
}

.auth-forgot-link:hover {
  text-decoration: underline;
}

.auth-submit-btn {
  width: 100%;
  padding: 8px 14px;
  font-size: 12.5px;
  font-weight: 700;
  justify-content: center;
  gap: 6px;
  border-radius: var(--radius-md);
}

/* Minimal Sync Note Plain Text (No Background, No Box) */
.auth-sync-note-minimal {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 13px;
  font-size: 11.5px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}

.auth-sync-note-minimal strong {
  color: var(--text-main);
  font-weight: 700;
}

/* Bottom CTA Switch Box */
.auth-bottom-cta-box {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11.5px;
}

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

.btn-auth-switch-link {
  background: none;
  border: none;
  color: var(--brand-blue);
  font-weight: 700;
  font-size: 11.5px;
  cursor: pointer;
  padding: 2px 4px;
  transition: all 0.15s ease;
}

.btn-auth-switch-link:hover {
  text-decoration: underline;
  color: var(--brand-cyan);
}

.password-strength-bar {
  width: 100%;
  height: 4px;
  background-color: var(--border-color);
  border-radius: 9999px;
  margin-top: 6px;
  overflow: hidden;
}

.password-strength-fill {
  height: 100%;
  width: 0%;
  border-radius: 9999px;
  transition: width 0.3s ease, background-color 0.3s ease;
}

.password-strength-label {
  font-size: 10.5px;
  color: var(--text-muted);
  margin-top: 4px;
}

.auth-alert-box {
  padding: 10px 14px;
  border-radius: var(--radius-md);
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 14px;
  animation: dropdownFade 0.2s ease;
}

.auth-alert-box.success {
  background-color: var(--success-light);
  color: var(--success-text);
  border: 1px solid var(--success);
}

.auth-alert-box.error {
  background-color: var(--danger-light);
  color: var(--danger-text);
  border: 1px solid var(--danger);
}

/* Guest Sync Alert Banner on Dashboard */
.guest-sync-alert-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  margin-bottom: 18px;
  background: linear-gradient(135deg, var(--bg-surface) 0%, var(--bg-surface-subtle) 100%);
  border: 1.5px solid var(--border-color);
  border-left: 4px solid var(--brand-blue);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-subtle);
  animation: dropdownFade 0.25s ease;
}

.guest-banner-left {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  flex: 1;
}

.guest-banner-icon-badge {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background-color: var(--brand-blue-subtle);
  border: 1px solid rgba(59, 130, 246, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 2px;
}

.guest-banner-content {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.guest-banner-title-line {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.guest-banner-title {
  font-size: 13.5px;
  font-weight: 800;
  font-family: var(--font-display);
  color: var(--text-main);
}

.guest-badge-pill {
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-mono);
  background-color: var(--bg-surface-hover);
  color: var(--text-muted);
  border: 1px solid var(--border-color);
  padding: 1px 6px;
  border-radius: 9999px;
}

.guest-banner-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.guest-banner-desc strong {
  color: var(--text-main);
}

.guest-banner-action-group {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .guest-sync-alert-banner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 12px 14px;
  }
  .guest-banner-action-group {
    justify-content: flex-end;
  }
}

/* Print CSS */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .no-print, header, aside, .header-search, .header-actions, .breadcrumb-nav {
    display: none !important;
  }
  #viewer-screen {
    position: static !important;
    display: block !important;
  }
}

/* ==============================================================================
   ANIMATED SCHOLAR AVATARS & PROFILE CUSTOMIZER STYLING
   ============================================================================== */
.profile-customizer-card {
  border: 1.5px solid var(--border-color);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.profile-preview-squircle {
  background-color: var(--brand-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 900;
  box-shadow: 0 4px 14px rgba(59, 130, 246, 0.35);
  border: 1.5px solid rgba(255, 255, 255, 0.2);
  overflow: hidden;
  position: relative;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.profile-preview-squircle svg {
  width: 100%;
  height: 100%;
  display: block;
}

.avatar-selection-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 12px;
  margin-top: 4px;
}

.avatar-option-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 6px;
  border-radius: 14px;
  border: 2px solid var(--border-color);
  background-color: var(--bg-surface-subtle);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  user-select: none;
  position: relative;
}

.avatar-option-card:hover {
  border-color: var(--brand-blue);
  background-color: var(--bg-surface-hover);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
}

.avatar-option-card.selected {
  border-color: var(--brand-blue);
  background-color: var(--brand-blue-subtle);
  box-shadow: 0 0 0 2px var(--brand-blue), 0 8px 20px rgba(59, 130, 246, 0.25);
}

.avatar-option-card.selected::after {
  content: "✓";
  position: absolute;
  top: 4px;
  right: 5px;
  font-size: 9px;
  font-weight: 900;
  background: var(--brand-blue);
  color: #fff;
  width: 14px;
  height: 14px;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.avatar-option-icon-wrap {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  background: transparent;
  border: none;
}

.avatar-option-icon-wrap svg {
  width: 100%;
  height: 100%;
  display: block;
}

.avatar-option-name {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.avatar-option-card.selected .avatar-option-name {
  color: var(--brand-blue);
  font-weight: 800;
}

/* Base styling for Avatar Containers when holding SVG */
.header-avatar-btn.has-svg,
.hero-avatar-squircle.has-svg,
.profile-avatar-squircle-sm.has-svg,
.profile-preview-squircle.has-svg {
  padding: 0;
  overflow: visible;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.header-avatar-btn.has-svg svg,
.hero-avatar-squircle.has-svg svg,
.profile-avatar-squircle-sm.has-svg svg,
.profile-preview-squircle.has-svg svg {
  width: 100%;
  height: 100%;
  display: block;
  filter: drop-shadow(0 2px 8px rgba(59, 130, 246, 0.3));
}

/* ==============================================================================
   KEYFRAME ANIMATIONS FOR THE 10 ANIMATED AVATARS
   ============================================================================== */
@keyframes animFloatPulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-3px) scale(1.05); }
}

@keyframes animSpinOrbit {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes animPulseGlow {
  0%, 100% { opacity: 0.85; filter: drop-shadow(0 0 2px currentColor); }
  50% { opacity: 1; filter: drop-shadow(0 0 8px currentColor); }
}

@keyframes animWaveWiggle {
  0%, 100% { transform: rotate(0deg); }
  25% { transform: rotate(-8deg); }
  75% { transform: rotate(8deg); }
}

@keyframes animBeamGlow {
  0%, 100% { opacity: 0.3; transform: scaleY(0.9); }
  50% { opacity: 0.95; transform: scaleY(1.1); }
}

@keyframes animStarBlink {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: 0.9; }
  50% { transform: scale(1.25) rotate(45deg); opacity: 1; }
}

@keyframes animRadarSweep {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

@keyframes animCoreBreathing {
  0%, 100% { transform: scale(0.92); opacity: 0.7; }
  50% { transform: scale(1.1); opacity: 1; }
}

/* Interactive hover enhancement */
.avatar-option-card:hover svg .anim-target-pulse,
.header-avatar-btn:hover svg .anim-target-pulse,
.hero-avatar-squircle:hover svg .anim-target-pulse {
  animation-duration: 1s !important;
}

