/* ==========================================================================
   StudyMate AI - Global Design System & Core Styles (css/style.css)
   Clean, modern, minimal, student-friendly educational SaaS design.
   ========================================================================== */

:root {
  /* Color Palette */
  --primary: #4f46e5;          /* Deep indigo */
  --primary-hover: #4338ca;
  --primary-light: #eef2ff;
  --primary-subtle: #e0e7ff;
  --primary-border: #c7d2fe;

  --secondary: #0f172a;        /* Slate dark */
  --secondary-hover: #1e293b;
  --secondary-light: #f1f5f9;

  --accent: #0ea5e9;           /* Sky blue */
  --accent-light: #e0f2fe;

  --success: #10b981;          /* Emerald */
  --success-hover: #059669;
  --success-light: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #065f46;

  --danger: #ef4444;           /* Rose/Red */
  --danger-hover: #dc2626;
  --danger-light: #fef2f2;
  --danger-border: #fecaca;
  --danger-text: #991b1b;

  --warning: #f59e0b;          /* Amber */
  --warning-light: #fffbeb;
  --warning-border: #fde68a;
  --warning-text: #92400e;

  /* Neutrals & Surfaces */
  --bg-body: #f8fafc;
  --bg-surface: #ffffff;
  --bg-card: #ffffff;
  --bg-muted: #f1f5f9;
  --bg-input: #ffffff;
  --bg-hover: #f8fafc;

  /* Typography Colors */
  --text-main: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-inverse: #ffffff;
  --text-link: #4f46e5;

  /* Borders & Dividers */
  --border-subtle: #f1f5f9;
  --border-color: #e2e8f0;
  --border-strong: #cbd5e1;
  --border-focus: #4f46e5;

  /* Radii */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 4px 6px -1px rgba(15, 23, 42, 0.07), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(15, 23, 42, 0.08), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
  --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.08), 0 8px 10px -6px rgba(15, 23, 42, 0.03);

  /* Spacing Scale */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;

  /* Font Family & Hierarchy */
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --text-xs: 0.75rem;     /* 12px */
  --text-sm: 0.875rem;    /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg: 1.125rem;    /* 18px */
  --text-xl: 1.25rem;     /* 20px */
  --text-2xl: 1.5rem;     /* 24px */
  --text-3xl: 1.875rem;   /* 30px */
  --text-4xl: 2.25rem;    /* 36px */

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* ==========================================================================
   CSS Reset
   ========================================================================== */

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

html {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
  background-color: var(--bg-body);
  color: var(--text-main);
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  touch-action: pan-y;
  -webkit-text-size-adjust: 100%;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  background-color: var(--bg-body);
}

img, svg, picture {
  display: block;
  max-width: 100%;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* ==========================================================================
   Layout Containers
   ========================================================================== */

.app-wrapper {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.container-sm {
  width: 100%;
  max-width: 720px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.container-xs {
  width: 100%;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

.main-content {
  flex: 1;
  padding-top: var(--space-6);
  padding-bottom: var(--space-12);
}

/* ==========================================================================
   Application Header & Navigation Bar
   ========================================================================== */

.app-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-color);
  transition: all var(--transition-fast);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: var(--space-4);
}

.brand-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--text-main);
  transition: opacity var(--transition-fast);
  flex-shrink: 0;
}

.brand-link:hover {
  opacity: 0.9;
}

.brand-logo-icon {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.15rem;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.35);
  flex-shrink: 0;
}

.brand-name {
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.brand-name span.ai-tag {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 2px 6px;
  border-radius: var(--radius-xs);
  border: 1px solid var(--primary-border);
}

/* Desktop Main Navigation Bar */
.main-nav {
  display: none;
}

@media (min-width: 840px) {
  .main-nav {
    display: flex;
    align-items: center;
    gap: var(--space-1);
    background-color: var(--bg-muted);
    padding: 4px;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
  }
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav-link:hover {
  color: var(--primary);
  background-color: rgba(255, 255, 255, 0.7);
}

.nav-link.active {
  color: var(--primary);
  background-color: #ffffff;
  box-shadow: var(--shadow-xs);
  border: 1px solid var(--border-color);
}

.nav-link .nav-icon {
  font-size: 1rem;
  line-height: 1;
}

/* Header Actions Right */
.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

.profile-button {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px;
  border-radius: var(--radius-full);
  background-color: var(--bg-surface);
  border: 1.5px solid var(--border-color);
  color: var(--text-main);
  font-weight: 600;
  font-size: var(--text-sm);
  transition: all var(--transition-fast);
}

.profile-button:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

.profile-avatar-sm {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #4f46e5 0%, #0ea5e9 100%);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
}

.nav-back-button {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
}

.nav-back-button:hover {
  color: var(--primary);
  background-color: var(--primary-light);
}

/* Mobile Responsive Header Actions Overrides (< 840px) */
@media (max-width: 840px) {
  .header-actions .btn {
    display: none !important;
  }
  .header-actions .nav-back-button {
    display: inline-flex !important;
    padding: 6px 8px;
    font-size: 0.8rem;
  }
  .nav-toggle-btn {
    display: none !important;
  }
  .profile-button {
    padding: 0 !important;
    border: none !important;
    background: transparent !important;
  }
  .profile-button span {
    display: none !important;
  }
  .profile-avatar-sm {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.82rem !important;
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
  }
}

/* Mobile Navigation Hamburger Toggle */
.nav-toggle-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background-color: var(--bg-muted);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

.nav-toggle-btn:hover {
  background-color: var(--border-color);
}

@media (min-width: 840px) {
  .nav-toggle-btn {
    display: none;
  }
}

/* Mobile Slide-down Navigation Drawer */
.mobile-nav-drawer {
  display: none;
  background-color: #ffffff;
  border-bottom: 1px solid var(--border-color);
  padding: var(--space-4);
  box-shadow: var(--shadow-lg);
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 45;
  animation: slideDown 0.2s ease-out forwards;
}

.mobile-nav-drawer.open {
  display: block;
}

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

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 16px;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--text-main);
  background-color: var(--bg-muted);
  transition: all var(--transition-fast);
}

.mobile-nav-link:hover,
.mobile-nav-link.active {
  background-color: var(--primary-light);
  color: var(--primary);
  border-left: 4px solid var(--primary);
}

.mobile-nav-link .nav-icon {
  font-size: 1.2rem;
}

/* ==========================================================================
   Typography System
   ========================================================================== */

h1, h2, h3, h4, h5, h6 {
  color: var(--text-main);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }

p {
  color: var(--text-secondary);
  line-height: 1.6;
}

.page-header {
  margin-bottom: var(--space-6);
}

.page-title {
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: var(--space-1);
}

.page-subtitle {
  color: var(--text-secondary);
  font-size: var(--text-sm);
}

/* ==========================================================================
   Cards & Surfaces
   ========================================================================== */

.card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

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

.card-sm {
  padding: var(--space-4);
  border-radius: var(--radius-md);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 10px 18px;
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  text-align: center;
  white-space: nowrap;
  user-select: none;
  touch-action: manipulation;
  min-height: 42px;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-primary {
  background-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.2);
}

.btn-primary:hover:not(:disabled) {
  background-color: var(--primary-hover);
  box-shadow: 0 4px 10px rgba(79, 70, 229, 0.3);
}

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

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

.btn-outline {
  background-color: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary-border);
}

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

.btn-danger-outline {
  background-color: transparent;
  color: var(--danger);
  border: 1px solid var(--danger-border);
}

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

.btn-lg {
  padding: 12px 24px;
  font-size: var(--text-base);
  min-height: 48px;
  border-radius: var(--radius-md);
}

.btn-block {
  width: 100%;
}

/* ==========================================================================
   Form Controls & Inputs
   ========================================================================== */

.form-group {
  margin-bottom: var(--space-5);
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: var(--space-2);
}

.form-label-hint {
  font-size: var(--text-xs);
  color: var(--text-muted);
  font-weight: 400;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  background-color: var(--bg-input);
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-md);
  color: var(--text-main);
  font-size: var(--text-base);
  line-height: 1.5;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

.form-textarea {
  resize: vertical;
  min-height: 180px;
  font-family: inherit;
}

.form-input::placeholder,
.form-textarea::placeholder {
  color: var(--text-muted);
}

.form-error-msg {
  font-size: var(--text-xs);
  color: var(--danger);
  margin-top: var(--space-1);
  display: none;
}

.form-error-msg.visible {
  display: block;
}

/* ==========================================================================
   Badges & Tags
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  padding: 4px 10px;
  font-size: var(--text-xs);
  font-weight: 600;
  border-radius: var(--radius-full);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.badge-physics {
  background-color: #ede9fe;
  color: #6d28d9;
  border: 1px solid #ddd6fe;
}

.badge-math {
  background-color: #e0f2fe;
  color: #0369a1;
  border: 1px solid #bae6fd;
}

.badge-english {
  background-color: #fef3c7;
  color: #b45309;
  border: 1px solid #fde68a;
}

.badge-biology {
  background-color: #dcfce7;
  color: #15803d;
  border: 1px solid #bbf7d0;
}

.badge-default {
  background-color: var(--bg-muted);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

/* ==========================================================================
   Toast Notifications
   ========================================================================== */

.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  z-index: 1000;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: 12px 18px;
  border-radius: var(--radius-md);
  background-color: var(--secondary);
  color: #ffffff;
  font-size: var(--text-sm);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: all var(--transition-normal);
  max-width: 360px;
}

.toast.toast-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.toast-success {
  background-color: #064e3b;
  border-left: 4px solid var(--success);
}

.toast-error {
  background-color: #7f1d1d;
  border-left: 4px solid var(--danger);
}

.toast-info {
  background-color: #1e293b;
  border-left: 4px solid var(--primary);
}

.toast-icon {
  font-weight: 700;
  font-size: 1rem;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.app-footer {
  margin-top: auto;
  border-top: 1px solid var(--border-color);
  padding-top: var(--space-6);
  padding-bottom: var(--space-6);
  background-color: var(--bg-surface);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--text-muted);
}

@media (min-width: 640px) {
  .footer-inner {
    flex-direction: row;
  }
}

.footer-links {
  display: flex;
  gap: var(--space-4);
}

.footer-links a:hover {
  color: var(--primary);
}

/* ==========================================================================
   User Guidance & Step Wizard Components
   ========================================================================== */

.step-wizard {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
  padding: var(--space-3) var(--space-4);
  background-color: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full);
  max-width: 620px;
  margin-left: auto;
  margin-right: auto;
  box-shadow: var(--shadow-xs);
  overflow-x: auto;
  scrollbar-width: none;
}

.step-wizard::-webkit-scrollbar {
  display: none;
}

.wizard-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
}

.wizard-step.active {
  color: var(--primary);
}

.wizard-step.completed {
  color: var(--success-text);
}

.wizard-badge {
  width: 22px;
  height: 22px;
  border-radius: var(--radius-full);
  background-color: var(--bg-muted);
  border: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  color: inherit;
}

.wizard-step.active .wizard-badge {
  background-color: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 0 0 3px var(--primary-light);
}

.wizard-step.completed .wizard-badge {
  background-color: var(--success);
  border-color: var(--success);
  color: #ffffff;
}

.wizard-divider {
  width: 20px;
  height: 2px;
  background-color: var(--border-color);
  flex-shrink: 0;
}

.wizard-step.completed + .wizard-divider {
  background-color: var(--success);
}

/* User Instruction Banner */
.action-guide-box {
  background-color: var(--primary-light);
  border: 1.5px solid var(--primary-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  margin-bottom: var(--space-6);
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.guide-icon {
  font-size: 1.35rem;
  line-height: 1;
  flex-shrink: 0;
  margin-top: 2px;
}

.guide-text h4 {
  font-size: var(--text-sm);
  font-weight: 700;
  color: #312e81;
  margin-bottom: 2px;
}

.guide-text p {
  font-size: var(--text-xs);
  color: #4338ca;
  line-height: 1.5;
  margin: 0;
}

/* Eye-catching Primary Action Button Pulse */
.btn-highlight {
  position: relative;
  font-weight: 700;
}

.btn-highlight::after {
  content: '';
  position: absolute;
  top: -2px;
  left: -2px;
  right: -2px;
  bottom: -2px;
  border-radius: inherit;
  border: 2px solid var(--primary);
  opacity: 0.4;
  animation: buttonPulse 2.4s infinite ease-out;
  pointer-events: none;
}

@keyframes buttonPulse {
  0% { transform: scale(1); opacity: 0.6; }
  50% { transform: scale(1.04); opacity: 0; }
  100% { transform: scale(1); opacity: 0; }
}

/* Bilingual Subtitles / Easy-to-read Helper labels */
.bn-hint {
  display: block;
  font-size: 0.8em;
  opacity: 0.85;
  font-weight: normal;
}

/* ==========================================================================
   Bottom Navigation Bar (Mobile / Tablet)
   ========================================================================== */

.bottom-nav-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 60;
  background-color: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--border-color);
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
}

@media (max-width: 840px) {
  .bottom-nav-bar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    height: 60px;
    padding: 4px 6px calc(4px + env(safe-area-inset-bottom, 0px));
  }

  body {
    padding-bottom: 86px;
  }
}

.bottom-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 6px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  font-size: 0.68rem;
  font-weight: 600;
  text-decoration: none;
  transition: all var(--transition-fast);
  position: relative;
  min-width: 52px;
  user-select: none;
}

.bottom-nav-item:hover {
  color: var(--primary);
}

.bottom-nav-item:active {
  transform: scale(0.92);
}

/* Icon Container */
.bottom-nav-icon-wrap {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: transform var(--transition-fast);
}

.bottom-nav-svg {
  width: 22px;
  height: 22px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  transition: all var(--transition-fast);
}

/* Central Highlighted Create Action Button */
.bottom-nav-item.action-create {
  margin-top: -20px;
}

.bottom-nav-item.action-create .bottom-nav-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary) 0%, #6366f1 100%);
  color: #ffffff;
  box-shadow: 0 4px 16px rgba(79, 70, 229, 0.45);
  border: 3.5px solid #ffffff;
}

.bottom-nav-item.action-create .bottom-nav-svg {
  width: 24px;
  height: 24px;
  stroke: #ffffff;
  stroke-width: 2.6;
}

.bottom-nav-item.action-create .bottom-nav-label {
  color: var(--primary);
  font-weight: 700;
  font-size: 0.65rem;
}

/* Active State */
.bottom-nav-item.active {
  color: var(--primary);
}

.bottom-nav-item.active .bottom-nav-svg {
  stroke: var(--primary);
  stroke-width: 2.3;
}

.bottom-nav-item.active .bottom-nav-label {
  font-weight: 700;
  color: var(--primary);
}

.bottom-nav-item.active::after {
  content: '';
  position: absolute;
  top: 0;
  width: 16px;
  height: 3px;
  background-color: var(--primary);
  border-radius: var(--radius-full);
}

.bottom-nav-item.action-create.active::after {
  display: none;
}

/* ==========================================================================
   Accessibility & Mobile Focus Helpers
   ========================================================================== */

:focus-visible {
  outline: 2px solid var(--border-focus);
  outline-offset: 2px;
}

@media (max-width: 640px) {
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  .card { padding: var(--space-4); }

  .header-inner {
    height: 54px;
  }

  .brand-logo-icon {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }

  .brand-name {
    font-size: 1.05rem;
  }

  .step-wizard {
    padding: 3px 6px;
    margin-bottom: 8px;
    gap: 4px;
    max-width: 100%;
  }

  .wizard-step {
    font-size: 0.65rem;
    gap: 3px;
  }

  .wizard-badge {
    width: 18px;
    height: 18px;
    font-size: 0.65rem;
  }

  .wizard-divider {
    width: 10px;
  }

  .action-guide-box {
    padding: 6px 10px;
    margin-bottom: 8px;
    gap: 8px;
    border-radius: var(--radius-md);
  }

  .guide-icon {
    font-size: 1.1rem;
  }

  .guide-text h4 {
    font-size: 0.78rem;
  }

  .guide-text p {
    font-size: 0.68rem;
    line-height: 1.35;
  }

  .main-content {
    padding: 10px 0 16px;
  }

  .container {
    padding-left: 10px;
    padding-right: 10px;
  }

  .toast-container {
    left: 12px;
    right: 12px;
    bottom: 74px;
  }
  .toast {
    max-width: 100%;
    font-size: 0.78rem;
    padding: 8px 12px;
  }
}

