/* ==========================================================================
   Teachers Pet - Global Stylesheet (Vanilla CSS)
   Light Mode Default / Dark Mode Toggle
   ========================================================================== */

/* ==========================================================================
   DESIGN TOKENS & THEME VARIABLES
   ========================================================================== */

:root {
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;

  /* Light Mode (Default) — Classroom projectors & whiteboards */
  --bg-app: #f8fafc;
  --bg-card: #ffffff;
  --bg-surface: #f1f5f9;
  --miss-k-window-bg: #ffffff;
  --miss-k-window-surface: #f1f5f9;
  --bg-input: #ffffff;
  --bg-hover: rgba(99, 102, 241, 0.04);
  --border-main: #e2e8f0;
  --border-glass: #e2e8f0;
  --border-focus: #6366f1;

  --text-main: #0f172a;
  --text-secondary: #334155;
  --text-muted: #64748b;
  --text-inverse: #f8fafc;

  --color-primary: #4f46e5;
  --color-primary-hover: #4338ca;
  --color-primary-light: rgba(79, 70, 229, 0.08);
  --color-success: #10b981;
  --color-success-light: rgba(16, 185, 129, 0.08);
  --color-error: #ef4444;
  --color-error-light: rgba(239, 68, 68, 0.08);
  --color-warning: #f59e0b;
  --color-warning-light: rgba(245, 158, 11, 0.08);
  --color-info: #3b82f6;
  --color-info-light: rgba(59, 130, 246, 0.08);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.07), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -4px rgba(0, 0, 0, 0.05);
  --shadow-glow: 0 0 20px rgba(79, 70, 229, 0.08);

  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-circle: 9999px;

  --transition-smooth: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-fast: all 0.15s ease;
}

/* ==========================================================================
   DARK MODE THEME
   ========================================================================== */

[data-theme="dark"] {
  --bg-app: #0f172a;
  --bg-card: rgba(30, 41, 59, 0.7);
  --bg-surface: rgba(15, 23, 42, 0.4);
  --miss-k-window-bg: #0f172a;
  --miss-k-window-surface: #1e293b;
  --bg-input: rgba(15, 23, 42, 0.4);
  --bg-hover: rgba(255, 255, 255, 0.05);
  --border-main: rgba(255, 255, 255, 0.08);
  --border-glass: rgba(255, 255, 255, 0.08);

  --text-main: #f8fafc;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;
  --text-inverse: #0f172a;

  --color-primary: #6366f1;
  --color-primary-hover: #4f46e5;
  --color-primary-light: rgba(99, 102, 241, 0.12);
  --color-success-light: rgba(16, 185, 129, 0.12);
  --color-error-light: rgba(239, 68, 68, 0.12);
  --color-warning-light: rgba(245, 158, 11, 0.12);
  --color-info-light: rgba(59, 130, 246, 0.12);

  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.2), 0 2px 4px -2px rgba(0, 0, 0, 0.15);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.3), 0 4px 6px -4px rgba(0, 0, 0, 0.2);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);
}

/* Dark mode specific overrides */
[data-theme="dark"] body {
  background-image:
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(245, 158, 11, 0.03) 0%, transparent 45%);
}

[data-theme="dark"] .app-header {
  background-color: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(12px);
}

[data-theme="dark"] .card,
[data-theme="dark"] .auth-card,
[data-theme="dark"] .onboarding-card {
  backdrop-filter: blur(16px);
}

[data-theme="dark"] .header-logo h1,
[data-theme="dark"] .header-logo .header-logo-title {
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] .landing-hero h1 {
  color: #f8fafc;
}

[data-theme="dark"] .onboarding-header h2 {
  background: linear-gradient(135deg, #fff 0%, #cbd5e1 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #0f172a;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* ==========================================================================
   RESET AND BASE STYLES
   ========================================================================== */

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

body {
  font-family: var(--font-sans);
  font-size: 16px;
  background-color: var(--bg-app);
  color: var(--text-main);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  background-image:
    radial-gradient(circle at 10% 20%, rgba(79, 70, 229, 0.03) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(245, 158, 11, 0.02) 0%, transparent 45%);
}

/* Custom Scrollbars */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-app);
}
::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.2);
  border-radius: var(--radius-circle);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.3);
}

/* ==========================================================================
   NAVIGATION HEADER
   ========================================================================== */

.app-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.875rem 1.5rem;
  background-color: var(--bg-card);
  border-bottom: 1px solid var(--border-main);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.logo-icon {
  font-size: 1.6rem;
  animation: float 3s ease-in-out infinite;
  font-family: 'Apple Color Emoji', 'Segoe UI Emoji', 'Noto Color Emoji', 'Android Emoji', sans-serif;
}

.header-logo h1,
.header-logo .header-logo-title {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.user-profile-menu {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding-left: 0.75rem;
  border-left: 1px solid var(--border-main);
}

.username-badge {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-surface);
  padding: 0.3rem 0.65rem;
  border-radius: var(--radius-circle);
  border: 1px solid var(--border-main);
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */

.nav-btn, .btn-primary, .btn-outline, .btn-submit, .btn-save-settings, .btn-editor-action {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.nav-btn {
  background: transparent;
  color: var(--text-muted);
}
.nav-btn:hover, .nav-btn.active {
  color: var(--text-main);
  background: var(--bg-hover);
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}
.btn-primary:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--border-main);
  color: var(--text-main);
}
.btn-outline:hover {
  background: var(--bg-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.btn-back {
  background: transparent;
  border: 1px solid var(--border-main);
  color: var(--text-muted);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-back:hover {
  color: var(--text-main);
  border-color: var(--text-muted);
  background: var(--bg-hover);
}

/* Theme Toggle Button */
.theme-toggle-btn {
  background: transparent;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-circle);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition-smooth);
  color: var(--text-muted);
  padding: 0;
}
.theme-toggle-btn:hover {
  background: var(--bg-hover);
  color: var(--color-warning);
  border-color: var(--color-warning);
}
.theme-toggle-btn svg {
  width: 18px;
  height: 18px;
}

/* ==========================================================================
   FORMS
   ========================================================================== */

.form-group {
  margin-bottom: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}
.form-group-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

input[type="text"], input[type="password"], input[type="email"], input[type="date"],
input[type="number"], select, textarea {
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  padding: 0.625rem 0.875rem;
  background: var(--bg-input);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  color: var(--text-main);
  outline: none;
  transition: var(--transition-smooth);
  line-height: 1.5;
}

input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus,
input[type="date"]:focus, input[type="number"]:focus, select:focus, textarea:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
  background: var(--bg-card);
}

.file-help, .field-help-text {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ==========================================================================
   BANNERS & ALERTS
   ========================================================================== */

.error-banner, .status-banner {
  padding: 0.625rem 0.875rem;
  border-radius: var(--radius-md);
  font-size: 0.8125rem;
  font-weight: 500;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  animation: slideIn 0.2s ease-out;
}
.error-banner {
  background: var(--color-error-light);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: var(--color-error);
}
.status-banner {
  background: var(--color-success-light);
  border: 1px solid rgba(16, 185, 129, 0.2);
  color: var(--color-success);
}

[data-theme="dark"] .error-banner {
  color: #fda4af;
}
[data-theme="dark"] .status-banner {
  color: #a7f3d0;
}

/* ==========================================================================
   TOAST NOTIFICATION SYSTEM
   ========================================================================== */

.toast-container {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  pointer-events: none;
  max-width: 420px;
  width: 100%;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
  transform: translateX(100%);
  opacity: 0;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
}

.toast.toast-entering {
  transform: translateX(0);
  opacity: 1;
}

.toast.toast-exiting {
  transform: translateX(120%);
  opacity: 0;
}

.toast-icon {
  width: 20px;
  height: 20px;
  border-radius: var(--radius-circle);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}
.toast-icon svg {
  width: 14px;
  height: 14px;
}

.toast-message {
  flex: 1;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  line-height: 1.4;
}

.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 2px;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
  flex-shrink: 0;
}
.toast-close:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}
.toast-close svg {
  width: 14px;
  height: 14px;
}

.toast-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  transition: width linear;
}

.toast-success .toast-icon { color: var(--color-success); }
.toast-success .toast-progress { background: var(--color-success); }

.toast-error .toast-icon { color: var(--color-error); }
.toast-error .toast-progress { background: var(--color-error); }

.toast-info .toast-icon { color: var(--color-info); }
.toast-info .toast-progress { background: var(--color-info); }

.toast-warning .toast-icon { color: var(--color-warning); }
.toast-warning .toast-progress { background: var(--color-warning); }

/* ==========================================================================
   CONFIRM DIALOG (replaces native confirm())
   ========================================================================== */

.confirm-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 10001;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.15s ease;
  padding: 1rem;
}

[data-theme="dark"] .confirm-overlay {
  background: rgba(0, 0, 0, 0.6);
}

.confirm-dialog {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 400px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  animation: slideUpFade 0.2s ease-out;
}

.confirm-dialog h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.confirm-dialog p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.25rem;
}

.confirm-actions {
  display: flex;
  gap: 0.75rem;
  justify-content: flex-end;
}

.confirm-btn-cancel {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-main);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}
.confirm-btn-cancel:hover {
  background: var(--bg-hover);
}

.confirm-btn-confirm {
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  border: none;
  background: var(--color-primary);
  color: white;
  cursor: pointer;
  transition: var(--transition-fast);
}
.confirm-btn-confirm:hover {
  background: var(--color-primary-hover);
}

.confirm-btn-danger {
  background: var(--color-error);
}
.confirm-btn-danger:hover {
  background: #dc2626;
}

/* ==========================================================================
   LOADING SKELETONS
   ========================================================================== */

.skeleton {
  background: var(--bg-surface);
  border-radius: var(--radius-md);
  position: relative;
  overflow: hidden;
}

.skeleton::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  animation: shimmer 1.5s infinite;
}

[data-theme="dark"] .skeleton::after {
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.05) 50%,
    transparent 100%
  );
}

.skeleton-card {
  height: 160px;
  border: 1px solid var(--border-main);
  padding: 1.25rem;
}

.skeleton-line {
  height: 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 0.5rem;
}
.skeleton-line.short { width: 60%; }
.skeleton-line.medium { width: 80%; }
.skeleton-line.full { width: 100%; }

.skeleton-circle {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-circle);
}

@keyframes shimmer {
  0% { transform: translateX(-100%); }
  100% { transform: translateX(100%); }
}

/* ==========================================================================
   PAGE TRANSITIONS
   ========================================================================== */

.view-section {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.view-section.view-active {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   VIEW 1: LANDING & AUTHENTICATION
   ========================================================================== */

#view-landing {
  position: relative;
  overflow-x: hidden;
  overflow-y: visible;
  background: radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.05) 0%, transparent 50%),
              radial-gradient(circle at 20% 80%, rgba(6, 182, 212, 0.03) 0%, transparent 50%);
}

[data-theme="dark"] #view-landing {
  background: radial-gradient(circle at 80% 20%, rgba(99, 102, 241, 0.15) 0%, transparent 50%),
              radial-gradient(circle at 20% 80%, rgba(6, 182, 212, 0.08) 0%, transparent 50%);
}

.landing-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem 4rem;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
  gap: 5rem;
  align-items: center;
  position: relative;
  z-index: 2;
}

.landing-hero {
  display: flex;
  flex-direction: column;
  gap: 1.75rem;
}

.badge-tag {
  align-self: flex-start;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  background: rgba(99, 102, 241, 0.1);
  color: var(--color-primary);
  padding: 0.4rem 1rem;
  border-radius: 20px;
  font-weight: 700;
  border: 1px solid rgba(99, 102, 241, 0.2);
  backdrop-filter: blur(8px);
}

[data-theme="dark"] .badge-tag {
  background: rgba(129, 140, 248, 0.1);
  color: #818cf8;
  border-color: rgba(129, 140, 248, 0.2);
}

.landing-hero h1 {
  font-size: clamp(2.5rem, 5vw, 3.8rem);
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--text-main);
}

.gradient-text {
  background: linear-gradient(135deg, var(--color-primary) 0%, #d8b4fe 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 4px 12px rgba(168, 85, 247, 0.2));
}

.hero-subtitle {
  font-size: 1.25rem;
  color: var(--text-muted);
  max-width: 580px;
  line-height: 1.7;
  font-weight: 400;
}

/* Landing Stats Strip */
.landing-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  align-items: center;
  gap: 2rem;
  margin-top: 2rem;
  padding: 1.5rem 2.5rem;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: transform 0.3s ease;
}

.landing-stats:hover {
  transform: translateY(-2px);
}

[data-theme="dark"] .landing-stats {
  background: rgba(30, 41, 59, 0.4);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.landing-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
}

.landing-stat-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--color-primary);
  letter-spacing: 0px;
  line-height: 1.2;
}

[data-theme="dark"] .landing-stat-number {
  color: #a5b4fc;
  text-shadow: 0 0 10px rgba(129, 140, 248, 0.3);
}

.landing-stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  font-weight: 600;
  white-space: nowrap;
}

.landing-stat-divider {
  width: 1px;
  height: 2.25rem;
  background: var(--border-main);
  flex-shrink: 0;
}

[data-theme="dark"] .landing-stat-divider {
  background: rgba(255, 255, 255, 0.1);
}

.landing-hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.landing-hero-ctas .nav-btn {
  padding: 0.65rem 1.25rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  text-decoration: none;
}

.landing-hero-secondary-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.landing-testimonials {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem 3rem;
}

.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.25rem;
}

.testimonial-card {
  margin: 0;
  padding: 1.35rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.testimonial-card p {
  margin: 0 0 1rem;
  color: var(--text-main);
  font-size: 0.92rem;
  line-height: 1.65;
  font-style: italic;
}

.testimonial-card footer {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.landing-spread {
  max-width: 1200px;
  margin: 0 auto 2rem;
  padding: 0 2rem;
}

.landing-spread-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
  padding: 2rem 2.25rem;
  border-radius: var(--radius-lg);
  border: 1px solid rgba(99, 102, 241, 0.22);
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(6, 182, 212, 0.06));
}

.landing-spread-copy h2 {
  margin: 0.5rem 0 0.65rem;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  color: var(--text-main);
}

.landing-spread-copy p {
  margin: 0;
  max-width: 34rem;
  color: var(--text-muted);
  line-height: 1.6;
  font-size: 0.92rem;
}

.landing-share-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.share-action-btn {
  padding: 0.55rem 1rem !important;
  font-size: 0.82rem !important;
  font-weight: 600 !important;
  border-radius: var(--radius-md) !important;
  text-decoration: none;
  white-space: nowrap;
}

.landing-final-cta {
  padding: 4rem 2rem;
  text-align: center;
  background: linear-gradient(135deg, rgba(99,102,241,0.12) 0%, rgba(168,85,247,0.08) 100%);
  border-top: 1px solid rgba(99,102,241,0.2);
  border-bottom: 1px solid rgba(99,102,241,0.2);
}

.landing-final-cta h2 {
  font-size: clamp(1.6rem, 4vw, 2.4rem);
  font-weight: 900;
  color: var(--text-main);
  margin: 0 0 1rem;
  line-height: 1.2;
}

.landing-final-cta p {
  font-size: 1rem;
  color: var(--text-muted);
  max-width: 520px;
  margin: 0 auto 2rem;
  line-height: 1.6;
}

.landing-final-cta-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}

.landing-final-cta-actions .nav-btn {
  padding: 0.8rem 2rem;
  font-size: 1rem;
  border-radius: var(--radius-md);
}

@media (min-width: 1280px) {
  .landing-container {
    max-width: 1320px;
    gap: 4rem;
    padding-top: 4.5rem;
  }

  .landing-hero h1 {
    font-size: 3.6rem;
  }
}

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

  .landing-spread-inner {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 1024px) {
  .landing-hero-ctas {
    justify-content: center;
  }
}

/* Landing Value Propositions */
.landing-value-props {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  width: 100%;
  max-width: 1100px;
  margin: 0 auto 2rem;
  padding: 0 1.5rem;
  box-sizing: border-box;
}

.landing-value-prop {
  padding: 1.25rem 1.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.landing-value-prop:hover {
  border-color: rgba(79, 70, 229, 0.35);
  box-shadow: 0 6px 20px rgba(79, 70, 229, 0.08);
}

.landing-value-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: 0.65rem;
  font-size: 1.1rem;
}

.landing-value-prop h3 {
  margin: 0 0 0.45rem;
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
}

.landing-value-prop p {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--text-muted);
}

/* Landing Tools Workflow Grid */
.landing-tools-subtitle {
  text-align: center;
  max-width: 640px;
  margin: -1rem auto 2rem;
  padding: 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
  line-height: 1.55;
}

.landing-workflow-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem 1rem;
  box-sizing: border-box;
}

.landing-workflow-lane {
  padding: 1.15rem;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
}

.landing-lane-badge {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-primary);
  margin-bottom: 0.35rem;
}

.landing-workflow-lane h3 {
  margin: 0 0 0.85rem;
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text-main);
}

.landing-lane-tools {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.landing-workflow-lane .landing-tool-card {
  width: auto;
  flex-shrink: unset;
  padding: 0.85rem 1rem;
}

.landing-workflow-lane .landing-tool-card h4 {
  margin: 0 0 0.25rem;
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-main);
}

.landing-workflow-lane .landing-tool-card p {
  margin: 0;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
}

/* Landing Tools Scrolling Carousel */
.landing-tools-section {
  width: 100%;
  padding: 2.5rem 0 1.5rem;
  overflow: hidden;
}

.landing-tools-heading {
  text-align: center;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 1.75rem;
  color: var(--text-main);
}

.landing-tools-track-wrapper {
  width: 100%;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
  mask-image: linear-gradient(to right, transparent 0%, black 5%, black 95%, transparent 100%);
}

.landing-tools-track {
  display: flex;
  gap: 1rem;
  width: max-content;
  animation: scrollTools 60s linear infinite;
}

.landing-tools-track:hover {
  animation-play-state: paused;
}

@keyframes scrollTools {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

.landing-tool-card {
  flex-shrink: 0;
  width: 200px;
  padding: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: default;
}

.landing-tool-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary);
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.12), 0 0 0 1px rgba(79, 70, 229, 0.1);
}

.landing-tool-icon {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 0.75rem;
  color: var(--color-primary);
  opacity: 0.85;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.landing-tool-card:hover .landing-tool-icon {
  opacity: 1;
  transform: scale(1.1);
}

.landing-tool-card h3 {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.landing-tool-card p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Landing Trust Badges */
.landing-trust {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 1.25rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

.landing-trust-item {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.landing-trust-item svg {
  color: var(--color-primary);
  flex-shrink: 0;
}

/* Auth Card */
.auth-card-wrapper {
  perspective: 1000px;
  width: 100%;
  max-width: 440px;
  margin-left: auto;
}

.auth-card {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.3s ease;
}

.auth-card:hover {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.1);
}

[data-theme="dark"] .auth-card {
  background: rgba(30, 41, 59, 0.4);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.3), inset 0 0 0 1px rgba(255,255,255,0.05);
}

[data-theme="dark"] .auth-card:hover {
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.4), inset 0 0 0 1px rgba(255,255,255,0.08);
}

.auth-toggle {
  display: flex;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--border-glass);
}

.auth-tab {
  flex: 1;
  background: none;
  border: none;
  font-family: var(--font-sans);
  color: var(--text-muted);
  font-size: 0.9375rem;
  font-weight: 600;
  padding: 0.625rem;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.auth-tab.active {
  color: var(--color-primary);
  border-bottom: 2px solid var(--color-primary);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.auth-oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  width: 100%;
  padding: 0.6rem 1rem;
  border-radius: 4px;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.auth-oauth-google {
  background: #fff;
  border: 1px solid #dadce0;
  color: #3c4043;
}

.auth-oauth-google:hover {
  background: #f8f9fa;
  border-color: #c6c6c6;
}

[data-theme="dark"] .auth-oauth-google {
  background: #131314;
  border-color: rgba(255, 255, 255, 0.12);
  color: #e8eaed;
}

[data-theme="dark"] .auth-oauth-google:hover {
  background: #1f1f1f;
}

.btn-submit {
  background: var(--color-primary);
  color: white;
  padding: 0.625rem;
  font-size: 0.9375rem;
  margin-top: 0.75rem;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}
.btn-submit:hover {
  background: var(--color-primary-hover);
  transform: translateY(-1px);
}

/* ==========================================================================
   VIEW 2: DASHBOARD
   ========================================================================== */

.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 2rem;
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 1.75rem;
  box-shadow: var(--shadow-sm);
}

.settings-card h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 0.375rem;
}

.settings-desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  line-height: 1.5;
}

/* Logo Upload */
.logo-upload-zone {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.875rem;
  background: var(--bg-surface);
  border: 1.5px dashed var(--border-main);
  border-radius: var(--radius-md);
  margin-top: 0.25rem;
}

.logo-upload-zone img {
  width: 60px;
  height: 60px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--bg-surface);
  padding: 4px;
  border: 1px solid var(--border-main);
}

.upload-btn-wrapper {
  position: relative;
  overflow: hidden;
  display: inline-block;
}

.btn-upload {
  font-family: var(--font-sans);
  background: var(--bg-hover);
  border: 1px solid var(--border-main);
  color: var(--text-main);
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-smooth);
}
.btn-upload:hover {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.upload-btn-wrapper input[type=file] {
  font-size: 100px;
  position: absolute;
  left: 0;
  top: 0;
  opacity: 0;
  cursor: pointer;
}

/* Palette Color Picker Grid */
.colors-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.color-picker-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 0.625rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
}

.color-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.color-input-wrapper {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border-main);
  position: relative;
}

.color-input-wrapper input[type="color"] {
  position: absolute;
  top: -5px;
  left: -5px;
  width: 38px;
  height: 38px;
  border: none;
  cursor: pointer;
  background: none;
}

.btn-save-settings {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  color: var(--text-main);
  padding: 0.625rem;
  margin-top: 1.25rem;
}
.btn-save-settings:hover {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

/* Certificates List */
.dashboard-main {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.dashboard-header-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-main);
  padding-bottom: 0.875rem;
}

.dashboard-header-row h2 {
  font-size: 1.375rem;
  font-weight: 800;
}

/* Certificate Grid */
.certs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  min-height: 200px;
}

.cert-card {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1.125rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  justify-content: space-between;
  transition: var(--transition-smooth);
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}
.cert-card:hover {
  transform: translateY(-3px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.cert-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding-right: 1.85rem;
}

/* Favourite Star Button */
.cert-card-fav-btn {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 10;
  transition: all 0.2s ease;
  color: var(--text-muted);
  padding: 0;
}
.cert-card-fav-btn:hover {
  transform: scale(1.1);
  background: var(--color-warning-light);
}
.cert-card-fav-btn.is-active {
  color: #fbbf24;
  border-color: rgba(251, 191, 36, 0.3);
  background: var(--color-warning-light);
}

.cert-card-title {
  font-size: 0.9375rem;
  font-weight: 700;
  line-height: 1.3;
}

.cert-card-size-badge {
  font-size: 0.625rem;
  background: var(--bg-surface);
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  border: 1px solid var(--border-main);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cert-card-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.cert-card-recipient {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-primary);
}

.cert-card-date {
  font-size: 0.75rem;
  color: var(--text-muted);
}

.cert-card-footer {
  display: flex;
  gap: 0.5rem;
  border-top: 1px solid var(--border-main);
  padding-top: 0.625rem;
  margin-top: 0.25rem;
}

.btn-card-action {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: var(--transition-smooth);
  flex: 1;
  text-align: center;
}

.btn-card-edit {
  background: var(--color-primary);
  color: white;
}
.btn-card-edit:hover {
  background: var(--color-primary-hover);
}

.btn-card-delete {
  background: var(--color-error-light);
  color: var(--color-error);
}
.btn-card-delete:hover {
  background: rgba(239, 68, 68, 0.15);
}

/* ==========================================================================
   EMPTY STATE & LOADING STATE
   ========================================================================== */

.loading-state, .empty-state {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.875rem;
  color: var(--text-muted);
  padding: 4rem 2rem;
  border: 1.5px dashed var(--border-main);
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  text-align: center;
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  margin-bottom: 0.25rem;
}
.empty-state-icon svg {
  width: 32px;
  height: 32px;
}

.empty-state h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-main);
}

.empty-state p {
  font-size: 0.875rem;
  max-width: 360px;
  line-height: 1.5;
}

.empty-state-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 0.5rem;
}

.loading-spinner {
  width: 24px;
  height: 24px;
  border: 3px solid var(--border-main);
  border-top-color: var(--color-primary);
  border-radius: var(--radius-circle);
  animation: spin 1s linear infinite;
}

/* ==========================================================================
   APP FOOTER
   ========================================================================== */

.app-footer {
  text-align: center;
  padding: 1.25rem 1.5rem 1.5rem;
  border-top: 1px solid var(--border-main);
  color: var(--text-muted);
  font-size: 0.8125rem;
  background: var(--bg-surface);
  margin-top: auto;
}

.landing-site-footer {
  display: none;
  text-align: center;
  padding: 2rem 1.5rem 2.5rem;
  border-top: 1px solid var(--border-main);
  background: var(--bg-surface);
  margin-top: 2rem;
}

body.view-landing-active .landing-site-footer {
  display: block;
}

body.view-landing-active .app-footer {
  display: none;
}

.app-footer-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin-bottom: 0.75rem;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-secondary);
}

.app-footer-trust span {
  white-space: nowrap;
}

.app-footer-copy {
  margin: 0;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text-muted);
}

.app-footer-copy a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  opacity: 0.85;
}

.app-footer-copy a:hover {
  opacity: 1;
  color: var(--color-primary);
}

/* ==========================================================================
   ANIMATIONS
   ========================================================================== */

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-5px); }
  100% { transform: translateY(0px); }
}

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

@keyframes slideIn {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes slideUpFade {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

/* ==========================================================================
   CONTROL TABS (shared across views)
   ========================================================================== */

.control-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-main);
  margin-bottom: 1.25rem;
  gap: 0;
}

.ctrl-tab {
  padding: 0.625rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.ctrl-tab:hover {
  color: var(--text-main);
}
.ctrl-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* ==========================================================================
   RESPONSIVENESS
   ========================================================================== */

@media (max-width: 1024px) {
  .landing-container {
    grid-template-columns: 1fr;
    gap: 2.5rem;
    padding-top: 3rem;
  }

  .landing-hero {
    order: 1;
    text-align: center;
    align-items: center;
  }

  .auth-card-wrapper {
    order: 2;
    margin-left: auto;
    margin-right: auto;
  }

  .landing-hero .badge-tag {
    align-self: center;
  }

  .landing-stats {
    justify-content: center;
  }

  .hero-subtitle {
    margin-left: auto;
    margin-right: auto;
  }
  .dashboard-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

/* ==========================================================================
   ONBOARDING & MULTI-LOGO STYLES
   ========================================================================== */

.onboarding-container {
  max-width: 720px;
  margin: 3rem auto;
  padding: 0 1.5rem;
}

.onboarding-card {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 2.5rem 2rem;
  box-shadow: var(--shadow-lg);
}

.onboarding-header {
  text-align: center;
  margin-bottom: 2rem;
}

.onboarding-header h2 {
  font-size: 1.75rem;
  font-weight: 800;
  margin-bottom: 0.375rem;
  color: var(--text-main);
}

.onboarding-header p {
  color: var(--text-muted);
  font-size: 0.9375rem;
}

/* Class Range Selection Cards */
.class-range-picker {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.range-option {
  cursor: pointer;
}

.range-option input[type="radio"] {
  display: none;
}

.range-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 1rem 0.875rem;
  text-align: center;
  transition: var(--transition-smooth);
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.range-card:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

.range-option input[type="radio"]:checked + .range-card {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.08);
}

.range-icon {
  font-size: 1.5rem;
  margin-bottom: 0.375rem;
}

.range-card h4 {
  font-size: 0.8125rem;
  font-weight: 700;
  margin-bottom: 0.125rem;
  color: var(--text-main);
}

.range-card p {
  font-size: 0.6875rem;
  color: var(--text-muted);
  line-height: 1.3;
}

/* Multi-Logo Uploader */
.logo-uploader-box {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
}

.logo-list-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 0.625rem;
}

.logo-item-card {
  position: relative;
  width: 90px;
  height: 90px;
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  padding: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-smooth);
}

.logo-item-card img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius-sm);
}

.logo-item-card .btn-delete-logo {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 20px;
  height: 20px;
  border-radius: var(--radius-circle);
  background: var(--color-error);
  color: white;
  border: none;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  opacity: 0;
  transition: var(--transition-smooth);
}

.logo-item-card:hover .btn-delete-logo {
  opacity: 1;
}

.logo-upload-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  border: 1.5px dashed var(--border-main);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: var(--transition-smooth);
  color: var(--text-muted);
  font-size: 0.8125rem;
  font-weight: 600;
}

.logo-upload-dropzone:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
}

@media (min-width: 480px) {
  .onboarding-container .colors-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ==========================================================================
   TOOLS HUB & HUB CARDS
   ========================================================================== */

.hub-container {
  max-width: 1280px;
  margin: 2rem auto;
  padding: 0 1.5rem;
}

@media (min-width: 1400px) {
  .hub-container {
    max-width: 1420px;
    padding: 0 2rem;
  }

  .hub-zones {
    gap: 1.5rem;
  }
}

.hub-header {
  text-align: center;
  margin-bottom: 2rem;
}

.hub-quick-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem auto 0;
  max-width: 900px;
}

.hub-quick-stat {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-secondary);
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
}

.hub-week-digest {
  margin: 0.75rem auto 0;
  max-width: 640px;
  font-size: 0.82rem;
  line-height: 1.4;
  color: #86efac;
  font-weight: 600;
}

.studio-research-badge {
  display: inline-block;
  margin-left: 0.35rem;
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: #0ea5e9;
  background: rgba(14, 165, 233, 0.12);
  border: 1px solid rgba(14, 165, 233, 0.25);
  vertical-align: middle;
}

.comment-nesa-check {
  font-size: 0.75rem;
  line-height: 1.4;
  border-radius: var(--radius-md);
  padding: 0.5rem 0.65rem;
  margin-top: 0.25rem;
}

.comment-nesa-check--ok {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.25);
  color: #6ee7b7;
}

.comment-nesa-check--warn {
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.3);
  color: #fcd34d;
}

.comment-nesa-check ul {
  margin: 0.35rem 0 0;
  padding-left: 1.1rem;
}

.comment-nesa-check code {
  font-size: 0.72rem;
  background: rgba(0, 0, 0, 0.2);
  padding: 0.05rem 0.25rem;
  border-radius: 3px;
}

.hub-header-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}

.hub-header-btn {
  font-size: 0.78rem;
  padding: 0.35rem 0.85rem;
  background: transparent;
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}

.hub-header-btn:hover {
  color: var(--text-main);
  border-color: var(--color-primary);
}

.hub-header-btn-admin {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.3);
  color: #e53e3e;
  font-weight: 600;
}

.recent-assets-empty {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.recent-asset-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-weight: 700;
}

.hub-header h2 {
  font-size: 2rem;
  font-weight: 800;
  margin-bottom: 0.375rem;
  color: var(--text-main);
}

.hub-header p {
  color: var(--text-muted);
  font-size: 1rem;
}

.dashboard-layout {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.hub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  width: 100%;
}

.hub-card:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.hub-card {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 1.125rem;
  display: flex;
  gap: 0.75rem;
  cursor: pointer;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.3s, box-shadow 0.3s;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.hub-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md), var(--shadow-glow);
}

.hub-card-icon {
  font-size: 1.6rem;
  background: var(--bg-surface);
  padding: 0.5rem;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  height: fit-content;
}

.hub-card-content {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  flex: 1;
}

.hub-card-content h3 {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
}

.hub-card-content p {
  color: var(--text-muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.hub-card-action {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

/* Hub card accent colors */
.hub-card[data-tool="certificates"] .hub-card-icon { background: rgba(79, 70, 229, 0.08); }
.hub-card[data-tool="certificates"] .hub-card-action { color: #6366f1; }

.hub-card[data-tool="lessons"] .hub-card-icon { background: rgba(16, 185, 129, 0.08); }
.hub-card[data-tool="lessons"] .hub-card-action { color: #10b981; }

.hub-card[data-tool="worksheets"] .hub-card-icon { background: rgba(245, 158, 11, 0.08); }
.hub-card[data-tool="worksheets"] .hub-card-action { color: #f59e0b; }

.hub-card[data-tool="comments"] .hub-card-icon { background: rgba(52, 211, 153, 0.08); }
.hub-card[data-tool="comments"] .hub-card-action { color: #34d399; }




.hub-card[data-tool="quizzes"] .hub-card-icon { background: rgba(168, 85, 247, 0.08); }
.hub-card[data-tool="quizzes"] .hub-card-action { color: #a855f7; }

.hub-card[data-tool="compliance"] .hub-card-icon { background: rgba(236, 72, 153, 0.08); }
.hub-card[data-tool="compliance"] .hub-card-action { color: #ec4899; }

.hub-card.coming-soon {
  filter: grayscale(40%);
  opacity: 0.6;
  cursor: default;
}

/* Recent activity */
.recent-activity-card {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.recent-activity-card h3 {
  font-size: 1rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.recent-asset-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.625rem 0.875rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-md);
  transition: var(--transition-smooth);
  margin-bottom: 0.5rem;
}
.recent-asset-item:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
}

/* ==========================================================================
   HEADER & NAV RESPONSIVENESS
   ========================================================================== */

@media (max-width: 640px) {
  .app-header {
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
  }

  .header-nav {
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.375rem;
  }

  .user-profile-menu {
    border-left: none;
    padding-left: 0;
  }

  .username-badge {
    display: none;
  }

  .nav-btn, .btn-primary, .btn-outline {
    font-size: 0.8125rem;
    padding: 0.375rem 0.625rem;
  }
}

/* Landing Mobile */
@media (max-width: 640px) {
  .landing-hero h1 {
    font-size: 2.25rem;
    line-height: 1.2;
    letter-spacing: -1px;
  }

  .hero-subtitle {
    font-size: 0.9375rem;
  }

  .landing-container {
    padding: 2rem 1rem;
  }

  .auth-card {
    padding: 1.5rem;
  }

  .landing-stats {
    flex-wrap: wrap;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    justify-content: center;
  }

  .landing-stat-divider {
    display: none;
  }

  .landing-stat {
    min-width: 70px;
  }

  .landing-stat-number {
    font-size: 1.25rem;
  }

  .landing-tools-heading {
    font-size: 1.35rem;
    padding: 0 1rem;
  }

  .landing-tool-card {
    width: 170px;
    padding: 1rem;
  }

  .landing-trust {
    gap: 0.35rem;
    font-size: 0.6875rem;
    padding: 1rem;
  }
}

/* Onboarding Mobile */
@media (max-width: 580px) {
  .class-range-picker {
    grid-template-columns: 1fr;
    gap: 0.625rem;
  }

  .onboarding-card {
    padding: 1.5rem 1.25rem;
  }

  .onboarding-container {
    margin: 1.5rem auto;
  }
}

/* Dashboard Mobile */
@media (max-width: 1024px) {
  .dashboard-container {
    display: flex;
    flex-direction: column;
  }

  .dashboard-main {
    order: 1;
  }

  .dashboard-sidebar {
    order: 2;
    margin-top: 1rem;
  }
}

/* Toast Mobile */
@media (max-width: 480px) {
  .toast-container {
    left: 1rem;
    right: 1rem;
    max-width: none;
  }
}

/* ==========================================================================
   VISUAL DIFFERENTIATION PREVIEW UTILITIES
   ========================================================================== */

/* 1. Enlarged Text */
.diff-enlarged #preview-worksheet-questions-container {
  font-size: 16px !important;
}
.diff-enlarged #preview-worksheet-questions-container strong {
  font-size: 16px !important;
}
.diff-enlarged #preview-worksheet-questions-container span,
.diff-enlarged #preview-worksheet-questions-container div {
  font-size: 14px !important;
}
.diff-enlarged #preview-worksheet-instructions-container {
  font-size: 15px !important;
}

/* 2. Thick Scaffold Borders */
.diff-scaffold-borders #preview-worksheet-questions-container div[style*="border: 1px"],
.diff-scaffold-borders #preview-worksheet-questions-container div[style*="border: 1.5px"] {
  border-width: 2.5px !important;
  border-style: dashed !important;
  border-color: var(--color-primary, #6366f1) !important;
  border-radius: 6px !important;
}
.diff-scaffold-borders #preview-worksheet-questions-container div[style*="border-bottom: 1px"] {
  border-bottom-width: 2.5px !important;
  border-bottom-style: dashed !important;
  border-bottom-color: var(--color-primary, #6366f1) !important;
}
.diff-scaffold-borders #preview-worksheet-questions-container div[style*="border: 1px solid #cbd5e1"] {
  border: 2.5px dashed var(--color-primary, #6366f1) !important;
  border-radius: 6px !important;
}
.diff-scaffold-borders #preview-worksheet-questions-container div[style*="border: 1.5px solid #64748b"] {
  border: 2px dashed var(--color-primary, #6366f1) !important;
}
.diff-scaffold-borders #preview-worksheet-questions-container div[style*="border-bottom: 1px solid #94a3b8"] {
  border-bottom: 2px dashed var(--color-primary, #6366f1) !important;
}

/* ==========================================================================
   GUI POLISH PASS v2 — Teacher-Friendly UX
   ========================================================================== */

/* --------------------------------------------------------------------------
   HEADER — accent stripe + logo refinement + date chip
   -------------------------------------------------------------------------- */

.app-header {
  position: sticky; /* already set, ensure ::before works */
}

/* Rainbow accent stripe on top of header */
.app-header::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary) 0%, #8b5cf6 50%, var(--color-warning) 100%);
  pointer-events: none;
}

/* Logo icon — give it a coloured pill background */
.logo-icon {
  background: var(--color-primary-light);
  border-radius: var(--radius-md);
  padding: 0.375rem;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(79, 70, 229, 0.15);
  transition: var(--transition-smooth);
  flex-shrink: 0;
}
.logo-icon:hover { background: rgba(79, 70, 229, 0.14); }

[data-theme="dark"] .logo-icon {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.25);
}

/* School name sub-label below "Teachers Pet" */
.header-school-name {
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
  line-height: 1;
  margin-top: 1px;
  letter-spacing: 0.01em;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Wrap logo text in a flex-col */
.header-logo-text {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.header-logo-text h1,
.header-logo-text .header-logo-title {
  line-height: 1.2;
}

/* Date chip — right of nav */
.header-date-chip {
  font-size: 0.75rem;
  color: var(--text-muted);
  padding: 0.2rem 0.65rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-circle);
  font-weight: 500;
  white-space: nowrap;
  display: none; /* shown via JS after auth */
}
@media (max-width: 640px) { .header-date-chip { display: none !important; } }

/* Active nav button — pill highlight */
.nav-btn.active {
  background: var(--color-primary-light) !important;
  color: var(--color-primary) !important;
  border-radius: var(--radius-circle);
}
[data-theme="dark"] .nav-btn.active {
  background: rgba(99, 102, 241, 0.15) !important;
}

/* --------------------------------------------------------------------------
   HUB CARDS — left accent border + richer colour per tool
   -------------------------------------------------------------------------- */

.hub-card {
  border-left: 4px solid transparent;
  padding-left: calc(1.125rem - 3px);
  min-height: 90px; /* give cards more breathing room */
}

/* Make icon boxes larger and more vibrant */
.hub-card-icon {
  width: 52px;
  height: 52px;
  min-width: 52px;
  font-size: 1.5rem;
  border-radius: var(--radius-md);
  flex-shrink: 0;
}

/* Slightly larger card description text for readability */
.hub-card-content p {
  font-size: 0.8rem;
  line-height: 1.5;
}

/* Per-tool left accent borders */
.hub-card[data-tool="certificates"] { border-left-color: #6366f1; }
.hub-card[data-tool="lessons"]      { border-left-color: #10b981; }
.hub-card[data-tool="worksheets"]   { border-left-color: #f59e0b; }
.hub-card[data-tool="comments"]     { border-left-color: #34d399; }

.hub-card[data-tool="students"]     { border-left-color: #f97316; }
.hub-card[data-tool="quizzes"]      { border-left-color: #a855f7; }
.hub-card[data-tool="compliance"]   { border-left-color: #ec4899; }
.hub-card[data-tool="community"]    { border-left-color: #06b6d4; }
.hub-card[data-tool="staff-room"]   { border-left-color: #14b8a6; }

/* Accent colours for tools missing from original */
.hub-card[data-tool="students"] .hub-card-icon   { background: rgba(249, 115, 22, 0.08); }
.hub-card[data-tool="students"] .hub-card-action { color: #f97316; }
.hub-card[data-tool="community"] .hub-card-icon   { background: rgba(6, 182, 212, 0.08); }
.hub-card[data-tool="community"] .hub-card-action { color: #06b6d4; }
.hub-card[data-tool="staff-room"] .hub-card-icon   { background: rgba(20, 184, 166, 0.08); }
.hub-card[data-tool="staff-room"] .hub-card-action { color: #14b8a6; }

/* Hover: colour the left border more vividly + coloured glow per tool */
.hub-card[data-tool="certificates"]:hover { box-shadow: var(--shadow-md), 0 0 20px rgba(99,102,241,0.12); }
.hub-card[data-tool="lessons"]:hover      { box-shadow: var(--shadow-md), 0 0 20px rgba(16,185,129,0.12); border-color: #10b981; }
.hub-card[data-tool="worksheets"]:hover   { box-shadow: var(--shadow-md), 0 0 20px rgba(245,158,11,0.12); border-color: #f59e0b; }
.hub-card[data-tool="comments"]:hover     { box-shadow: var(--shadow-md), 0 0 20px rgba(52,211,153,0.12); border-color: #34d399; }

.hub-card[data-tool="students"]:hover     { box-shadow: var(--shadow-md), 0 0 20px rgba(249,115,22,0.12); border-color: #f97316; }
.hub-card[data-tool="quizzes"]:hover      { box-shadow: var(--shadow-md), 0 0 20px rgba(168,85,247,0.12); border-color: #a855f7; }
.hub-card[data-tool="compliance"]:hover   { box-shadow: var(--shadow-md), 0 0 20px rgba(236,72,153,0.12); border-color: #ec4899; }
.hub-card[data-tool="community"]:hover    { box-shadow: var(--shadow-md), 0 0 20px rgba(6,182,212,0.12); border-color: #06b6d4; }
.hub-card[data-tool="staff-room"]:hover   { box-shadow: var(--shadow-md), 0 0 20px rgba(20,184,166,0.12); border-color: #14b8a6; }

/* --------------------------------------------------------------------------
   RECENTLY USED STRIP — quick-access chips above hub grid
   -------------------------------------------------------------------------- */

/* Onboarding optional branding section */
.onboarding-optional {
  margin: 1rem 0;
  padding: 0.75rem 1rem;
  background: var(--bg-main);
  border: 1px dashed var(--border-main);
  border-radius: var(--radius-lg);
}

.onboarding-optional summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-main);
}

.onboarding-optional summary:hover {
  color: var(--color-primary);
}

.onboarding-optional-hint {
  font-weight: 400;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* First-run starter checklist */
.starter-checklist {
  margin-bottom: 1.25rem;
  padding: 1rem 1.25rem;
  background: var(--bg-surface);
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-lg);
  animation: slideIn 0.25s ease-out;
}

.starter-checklist-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.875rem;
}

.starter-checklist-header h3 {
  margin: 0 0 0.15rem;
  font-size: 1.05rem;
  color: var(--text-main);
}

.starter-checklist-header p {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.starter-checklist-dismiss {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  border-radius: var(--radius-sm, 6px);
}

.starter-checklist-dismiss:hover {
  color: var(--text-main);
  background: var(--bg-hover, rgba(255, 255, 255, 0.06));
}

.starter-checklist-steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.625rem;
}

.starter-checklist-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  background: var(--bg-main);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.starter-checklist-step:hover {
  border-color: var(--color-primary);
  transform: translateY(-1px);
}

.starter-checklist-step.is-next {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 1px var(--color-primary);
}

.starter-checklist-step.is-done {
  opacity: 0.65;
}

.starter-checklist-marker {
  flex: 0 0 auto;
  width: 1.75rem;
  height: 1.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--color-primary);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}

.starter-checklist-step.is-done .starter-checklist-marker {
  background: var(--color-success, #16a34a);
}

.starter-checklist-copy {
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  min-width: 0;
}

.starter-checklist-title {
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-main);
}

.starter-checklist-desc {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.starter-checklist-go {
  margin-left: auto;
  flex: 0 0 auto;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--color-primary);
}

.recently-used-strip {
  display: none; /* shown by JS when data exists */
  align-items: center;
  gap: 0.625rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
  padding: 0.75rem 1rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  animation: slideIn 0.25s ease-out;
}

.recently-used-strip.visible {
  display: flex;
}

.recently-used-label {
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  flex-shrink: 0;
}

.recently-used-sep {
  width: 1px;
  height: 18px;
  background: var(--border-main);
  flex-shrink: 0;
}

.recently-used-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.7rem;
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-circle);
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
  font-family: var(--font-sans);
  white-space: nowrap;
}
.recently-used-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  background: var(--color-primary-light);
  transform: translateY(-1px);
}

/* --------------------------------------------------------------------------
   FORM IMPROVEMENTS — bolder labels, touch-friendly, custom select
   -------------------------------------------------------------------------- */

/* Bolder, darker labels — teachers need to see what they're filling in */
label {
  color: var(--text-secondary);
  font-weight: 700;
}
[data-theme="dark"] label {
  color: var(--text-secondary);
}

/* Custom select arrow — removes native browser UI inconsistencies */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 14px;
  padding-right: 2.5rem;
}
[data-theme="dark"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

/* Touch-friendly minimum height for all form fields */
input[type="text"], input[type="password"], input[type="email"],
input[type="date"], input[type="number"], select {
  min-height: 44px;
}

/* Stronger focus ring — easier to see on classroom projectors */
input[type="text"]:focus, input[type="password"]:focus, input[type="email"]:focus,
input[type="date"]:focus, input[type="number"]:focus, select:focus, textarea:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.15);
}

/* --------------------------------------------------------------------------
   STANDARDISED TOOL HEADER COMPONENT
   -------------------------------------------------------------------------- */

.tool-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-main);
  flex-wrap: wrap;
  gap: 1rem;
}

.tool-header-left {
  display: flex;
  align-items: center;
  gap: 0.875rem;
}

.tool-header-icon {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  flex-shrink: 0;
  border: 1px solid rgba(79, 70, 229, 0.12);
}
[data-theme="dark"] .tool-header-icon {
  background: rgba(99, 102, 241, 0.15);
  border-color: rgba(99, 102, 241, 0.2);
}

.tool-header-text h2 {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0;
  line-height: 1.2;
}

.tool-header-text p {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin: 0.2rem 0 0;
}

/* --------------------------------------------------------------------------
   BREADCRUMB — replaces back buttons with a consistent strip
   -------------------------------------------------------------------------- */

.breadcrumb-strip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  padding: 0.25rem 0;
}

.breadcrumb-home {
  color: var(--color-primary);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  padding: 0;
  transition: var(--transition-fast);
}
.breadcrumb-home:hover {
  text-decoration: underline;
  opacity: 0.8;
}

.breadcrumb-sep {
  color: var(--border-main);
  user-select: none;
  font-size: 1rem;
  line-height: 1;
}

.breadcrumb-current {
  color: var(--text-secondary);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   RICHER EMPTY STATES
   -------------------------------------------------------------------------- */

.empty-state {
  min-height: 260px;
  gap: 1rem;
}

.empty-state-emoji {
  font-size: 3rem;
  line-height: 1;
  display: block;
}

.empty-state h3 {
  font-size: 1.0625rem;
}

.empty-state p {
  font-size: 0.875rem;
  color: var(--text-muted);
  max-width: 320px;
}

/* --------------------------------------------------------------------------
   BACK BUTTON — consistent size and style
   -------------------------------------------------------------------------- */

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.8125rem;
}
.btn-back::before {
  content: '\2190'; /* ← arrow */
  font-size: 1em;
}

/* --------------------------------------------------------------------------
   MOBILE HUB GRID — responsive improvements
   -------------------------------------------------------------------------- */

@media (max-width: 479px) {
  .hub-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .hub-card {
    min-height: auto;
    padding: 0.875rem 0.875rem 0.875rem calc(0.875rem - 3px);
  }

  .hub-card-icon {
    width: 44px;
    height: 44px;
    min-width: 44px;
    font-size: 1.25rem;
  }

  .hub-header h2 {
    font-size: 1.5rem;
  }

  .hub-container {
    padding: 0 1rem;
    margin: 1.25rem auto;
  }
}

@media (min-width: 480px) and (max-width: 767px) {
  .hub-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
}

@media (min-width: 768px) and (max-width: 1023px) {
  .hub-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* --------------------------------------------------------------------------
   DASHBOARD HEADER — subtler, more welcoming
   -------------------------------------------------------------------------- */

.hub-header h2 {
  font-size: 1.875rem;
  letter-spacing: -0.5px;
}

.hub-header p {
  font-size: 0.9375rem;
}

/* --------------------------------------------------------------------------
   MICRO-INTERACTIONS — card action link animation on hover
   -------------------------------------------------------------------------- */

.hub-card-action {
  transition: gap 0.15s ease;
}
.hub-card:hover .hub-card-action {
  gap: 0.5rem; /* arrow slides right on hover */
}

/* Smooth entrance for hub cards with stagger */
.hub-card {
  animation: cardEntrance 0.4s ease-out both;
}
.hub-card:nth-child(1)  { animation-delay: 0.04s; }
.hub-card:nth-child(2)  { animation-delay: 0.08s; }
.hub-card:nth-child(3)  { animation-delay: 0.12s; }
.hub-card:nth-child(4)  { animation-delay: 0.16s; }
.hub-card:nth-child(5)  { animation-delay: 0.20s; }
.hub-card:nth-child(6)  { animation-delay: 0.24s; }
.hub-card:nth-child(7)  { animation-delay: 0.28s; }
.hub-card:nth-child(8)  { animation-delay: 0.32s; }
.hub-card:nth-child(9)  { animation-delay: 0.36s; }
.hub-card:nth-child(10) { animation-delay: 0.40s; }

@keyframes cardEntrance {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Don't re-animate on drag-reorder */
.hub-card.dragging {
  animation: none;
}

/* --------------------------------------------------------------------------
   DARK MODE — new component overrides
   -------------------------------------------------------------------------- */

[data-theme="dark"] .recently-used-strip {
  background: rgba(30, 41, 59, 0.5);
}

[data-theme="dark"] .recently-used-btn {
  background: rgba(30, 41, 59, 0.7);
}

[data-theme="dark"] .header-date-chip {
  background: rgba(30, 41, 59, 0.7);
}

[data-theme="dark"] .tool-header {
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

/* --------------------------------------------------------------------------
   UTILITY — trust badge strip tweaks (dashboard footer)
   -------------------------------------------------------------------------- */

.trust-badge-strip {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border-main);
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.625rem 0.875rem;
  font-size: 0.72rem;
  color: var(--text-muted);
}

.trust-badge-strip a {
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.trust-badge-strip a:hover {
  color: var(--color-primary);
}

/* ==========================================================================
   ASSESSMENT CALENDAR STYLES
   ========================================================================== */

.ac-view-btn {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid transparent;
  transition: var(--transition-fast);
}

.ac-view-btn:hover {
  background: var(--bg-hover) !important;
  color: var(--text-main) !important;
}

.ac-view-btn.active {
  background: var(--color-primary) !important;
  color: white !important;
  border-color: var(--color-primary) !important;
}

/* Day grid cells */
.ac-day-cell {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.ac-day-cell:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border-color: rgba(99, 102, 241, 0.4) !important;
}

/* Event Items / Chips */
.ac-event-item {
  transition: transform 0.15s ease, filter 0.15s ease;
}

.ac-event-item:hover {
  transform: translateY(-1px);
  filter: brightness(1.1);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.ac-event-item:active {
  cursor: grabbing;
}

/* Mini Calendar Navigation & Grid */
.ac-mini-day {
  transition: var(--transition-fast);
}

.ac-mini-day:hover {
  background: var(--bg-hover) !important;
  color: var(--text-main) !important;
}

/* Agenda list animations */
.ac-agenda-item {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.ac-agenda-item:hover {
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: rgba(255, 255, 255, 0.04) !important;
}

/* Glass panel adjustments */
.glass-panel {
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* ==========================================================================
   PRINT / EXPORT STYLE OVERRIDES
   ========================================================================== */
@media print {
  body {
    background: white !important;
    color: black !important;
    font-size: 10pt;
  }
  .app-header, .btn-back, #ac-back-hub-btn, #ac-add-btn, .export-dropdown-wrapper,
  #ac-form-container, #ac-state-banner, #view-calendar > div > div:first-child,
  section#view-calendar > div > div > div:first-child {
    display: none !important;
  }
  section#view-calendar > div {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
  div[style*="grid-template-columns"] {
    display: block !important;
  }
  /* Left sidebar is hidden during print */
  div[style*="grid-template-columns"] > div:first-child {
    display: none !important;
  }
  /* Main content container fills page */
  div[style*="grid-template-columns"] > div:last-child {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }
  .term-header {
    background: #e2e8f0 !important;
    color: black !important;
    border-left: 4px solid #4f46e5 !important;
    page-break-after: avoid;
  }
  table {
    page-break-inside: avoid;
  }
}

/* ==========================================================================
   STUDENT QUIZ VISUAL OVERHAUL STYLES
   ========================================================================== */

/* Immersive full viewport background */
body.student-quiz-body-bg {
  background: radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.08) 0%, transparent 40%),
              radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.06) 0%, transparent 40%),
              radial-gradient(circle at 50% 50%, rgba(168, 85, 247, 0.04) 0%, transparent 50%),
              var(--bg-app) !important;
  color: var(--text-main) !important;
  transition: background 0.5s ease;
}

body.student-quiz-body-bg .app-header {
  border-bottom-color: var(--border-glass) !important;
  background: var(--bg-card) !important;
  backdrop-filter: blur(8px);
}

/* Premium Glassmorphic Student Card */
.student-quiz-theme #student-quiz-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border-glass) !important;
  box-shadow: var(--shadow-lg) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
  padding: 3rem 2.5rem !important;
  border-radius: var(--radius-lg) !important;
  transition: all 0.3s ease;
  color: var(--text-main) !important;
}

/* Lobby classmate tag chips */
.lobby-classmate-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  margin: 2rem 0;
  max-height: 240px;
  overflow-y: auto;
  padding: 0.75rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
}

.lobby-classmate-chip {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 9999px;
  padding: 0.45rem 1rem 0.45rem 0.45rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--text-main);
  box-shadow: var(--shadow-sm);
  animation: chipSlideIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.lobby-classmate-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 800;
  text-transform: uppercase;
  color: white;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  box-shadow: inset 0 2px 4px rgba(255, 255, 255, 0.2);
}

@keyframes chipSlideIn {
  from { opacity: 0; transform: translateY(15px) scale(0.9); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Premium Multiple-Choice Answer Card */
.quiz-option-card {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-glass) !important;
  border-radius: var(--radius-md) !important;
  padding: 1.25rem 1.5rem !important;
  cursor: pointer !important;
  display: flex !important;
  align-items: center !important;
  gap: 1.25rem !important;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1) !important;
  transform: translate3d(0,0,0) !important;
  color: var(--text-main) !important;
}

.quiz-option-card:hover {
  background: var(--bg-hover) !important;
  border-color: var(--color-primary) !important;
  transform: translateY(-2px) !important;
  box-shadow: var(--shadow-glow) !important;
}

.quiz-option-letter {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-glass);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-muted);
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.quiz-option-card:hover .quiz-option-letter {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.quiz-option-card.selected {
  background: var(--color-primary-light) !important;
  border-color: var(--color-primary) !important;
  box-shadow: var(--shadow-glow) !important;
}

.quiz-option-card.selected .quiz-option-letter {
  border-color: var(--color-primary) !important;
  background: var(--color-primary) !important;
  color: white !important;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
}

/* Ordering Item Modernization */
.quiz-order-item {
  background: var(--bg-surface) !important;
  border: 1px solid var(--border-glass) !important;
  border-radius: var(--radius-md) !important;
  padding: 1rem 1.25rem !important;
  box-shadow: var(--shadow-sm) !important;
  transition: all 0.2s ease !important;
  color: var(--text-main) !important;
}

.quiz-order-item:hover {
  border-color: var(--color-primary) !important;
  background: var(--bg-hover) !important;
  transform: translateX(2px);
}

.quiz-order-badge {
  width: 28px;
  height: 28px;
  background: var(--color-primary-light) !important;
  border: 1.5px solid var(--color-primary) !important;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--color-primary) !important;
}

/* Confetti Falling Animations */
.confetti-container {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 99999;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  opacity: 0;
  animation: confettiFall 3.5s linear infinite;
}

@keyframes confettiFall {
  0% { transform: translateY(-50px) rotate(0deg); opacity: 1; }
  100% { transform: translateY(105vh) rotate(360deg); opacity: 0; }
}

.finished-trophy {
  font-size: 5rem;
  display: inline-block;
  animation: trophyPulse 2s infinite ease-in-out;
}

@keyframes trophyPulse {
  0%, 100% { transform: scale(1) rotate(0); }
  50% { transform: scale(1.1) rotate(4deg); }
}

/* Calendar Overhaul styles */
[data-theme="light"] {
  --cal-term-bg: #e0e7ff;
  --cal-term-color: #3730a3;
  --cal-holiday-bg: #ffedd5;
  --cal-holiday-color: #9a3412;
  --cal-pupil-bg: #fce7f3;
  --cal-pupil-color: #9d174d;
}

[data-theme="dark"] {
  --cal-term-bg: rgba(99, 102, 241, 0.15);
  --cal-term-color: #818cf8;
  --cal-holiday-bg: rgba(245, 158, 11, 0.15);
  --cal-holiday-color: #fbbf24;
  --cal-pupil-bg: rgba(236, 72, 153, 0.15);
  --cal-pupil-color: #f472b6;
}

/* Event types colors variables */
.ac-event-item.type-formative, .ac-event-badge.type-formative { --event-color: #2563eb; }
.ac-event-item.type-summative, .ac-event-badge.type-summative { --event-color: #dc2626; }
.ac-event-item.type-diagnostic, .ac-event-badge.type-diagnostic { --event-color: #ea580c; }
.ac-event-item.type-peer, .ac-event-badge.type-peer { --event-color: #16a34a; }
.ac-event-item.type-event, .ac-event-badge.type-event { --event-color: #7c3aed; }
.ac-event-item.type-homework, .ac-event-badge.type-homework { --event-color: #db2777; }
.ac-event-item.type-excursion, .ac-event-badge.type-excursion { --event-color: #0d9488; }
.ac-event-item.type-meeting, .ac-event-badge.type-meeting { --event-color: #4b5563; }

/* Solid, legible calendar chips */
.ac-event-item {
  background: var(--event-color) !important;
  color: #ffffff !important;
  border: none !important;
  font-weight: 600;
  text-shadow: 0 1px 1px rgba(0,0,0,0.15);
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
}

[data-theme="light"] .ac-event-item {
  background: var(--event-color) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

[data-theme="dark"] .ac-event-item {
  background: var(--event-color) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

.ac-event-item.completed {
  background: #10b981 !important;
  color: #ffffff !important;
  border-color: transparent !important;
  text-decoration: line-through !important;
  opacity: 0.75 !important;
}

/* Event badges (e.g. for Day View) - solid background */
.ac-event-badge {
  font-size: 0.72rem;
  padding: 2px 8px;
  border-radius: 12px;
  text-transform: capitalize;
  font-weight: 600;
  display: inline-block;
  background: var(--event-color) !important;
  color: #ffffff !important;
  border: none !important;
  text-shadow: 0 1px 1px rgba(0,0,0,0.1);
}

[data-theme="light"] .ac-event-badge {
  background: var(--event-color) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

[data-theme="dark"] .ac-event-badge {
  background: var(--event-color) !important;
  color: #ffffff !important;
  border-color: transparent !important;
}

/* Calendar layer badges styling for high legibility */
.ac-term-badge {
  font-size: 0.55rem;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 4px;
  margin-bottom: 2px;
  text-align: center;
  background: rgba(99, 102, 241, 0.15) !important;
  color: #818cf8 !important;
  border: 1px solid rgba(99, 102, 241, 0.35) !important;
}

[data-theme="light"] .ac-term-badge {
  background: rgba(79, 70, 229, 0.1) !important;
  color: #4f46e5 !important;
  border-color: rgba(79, 70, 229, 0.25) !important;
}

.ac-holiday-badge {
  font-size: 0.55rem;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 4px;
  margin-bottom: 2px;
  text-align: center;
  background: #d97706 !important; /* solid amber/dark orange */
  color: #ffffff !important;
  border: none !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-break-badge {
  font-size: 0.55rem;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 4px;
  margin-bottom: 2px;
  text-align: center;
  background: #b45309 !important; /* solid brown-orange */
  color: #ffffff !important;
  border: none !important;
  font-style: normal;
}

.ac-pupilfree-badge {
  font-size: 0.55rem;
  font-weight: 700;
  padding: 2px 4px;
  border-radius: 4px;
  margin-bottom: 2px;
  text-align: center;
  background: #db2777 !important; /* solid pink */
  color: #ffffff !important;
  border: none !important;
}

/* Agenda items dynamic left border */
.ac-agenda-item.type-formative { border-left-color: #2563eb !important; }
.ac-agenda-item.type-summative { border-left-color: #dc2626 !important; }
.ac-agenda-item.type-diagnostic { border-left-color: #ea580c !important; }
.ac-agenda-item.type-peer { border-left-color: #16a34a !important; }
.ac-agenda-item.type-event { border-left-color: #7c3aed !important; }
.ac-agenda-item.type-homework { border-left-color: #db2777 !important; }
.ac-agenda-item.type-excursion { border-left-color: #0d9488 !important; }
.ac-agenda-item.type-meeting { border-left-color: #4b5563 !important; }
.ac-agenda-item.completed { border-left-color: #10b981 !important; }

/* ==========================================================================
   MARKING ASSISTANT (AI PAPER GRADER) STYLES
   ========================================================================== */

#grader-review-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  height: calc(100vh - 190px);
  min-height: 500px;
}

#grader-dropzone {
  border: 2px dashed var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 3rem 1.5rem;
  text-align: center;
  background: rgba(255,255,255,0.02);
  cursor: pointer;
  transition: var(--transition-smooth);
}

#grader-dropzone:hover {
  border-color: var(--color-primary);
  background: rgba(79, 70, 229, 0.04);
}

.criteria-row-wrapper {
  transition: var(--transition-smooth);
}

.criteria-row-wrapper:hover {
  background: rgba(255, 255, 255, 0.03) !important;
  border-color: var(--color-primary) !important;
}

#grader-overall-grade-pill {
  box-shadow: 0 0 15px rgba(79, 70, 229, 0.3);
  animation: pulseGraded 2.5s infinite;
}

#grader-paper-preview-container img {
  box-shadow: var(--shadow-lg);
  border-radius: 4px;
}

@keyframes pulseGraded {
  0% { transform: scale(1); box-shadow: 0 0 15px rgba(79, 70, 229, 0.3); }
  50% { transform: scale(1.05); box-shadow: 0 0 25px rgba(79, 70, 229, 0.5); }
  100% { transform: scale(1); box-shadow: 0 0 15px rgba(79, 70, 229, 0.3); }
}

@media (max-width: 900px) {
  #grader-review-grid {
    grid-template-columns: 1fr;
    height: auto;
  }
}

/* ==========================================================================
   DOE WORKSHEET GENERATOR WIZARD STYLES
   ========================================================================== */

/* Step indicator dots */
.ws-step-dot .ws-step-circle {
  transition: background 0.25s, color 0.25s, border-color 0.25s, box-shadow 0.25s;
}

.ws-step-dot.ws-step-active .ws-step-circle {
  background: var(--color-primary) !important;
  color: white !important;
  border: none !important;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.35);
}

.ws-step-dot.ws-step-active span:last-child {
  color: var(--color-primary) !important;
}

.ws-step-dot.ws-step-done .ws-step-circle {
  background: var(--color-success) !important;
  color: white !important;
  border: none !important;
}

.ws-step-dot.ws-step-done span:last-child {
  color: var(--color-success) !important;
}

/* Step panels scrollbar */
.ws-step-panel::-webkit-scrollbar { width: 4px; }

/* Chip tags */
.ws-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--color-primary-light);
  border: 1px solid rgba(99, 102, 241, 0.2);
  border-radius: var(--radius-circle);
  padding: 3px 10px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-primary);
}

.ws-chip-outcome { background: rgba(99, 102, 241, 0.07); }

.ws-chip-remove,
.ws-chip-lookup {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1;
  padding: 0 2px;
  color: inherit;
  opacity: 0.65;
  transition: opacity 0.15s;
}
.ws-chip-remove:hover { opacity: 1; color: var(--color-error); }
.ws-chip-lookup:hover { opacity: 1; }
.ws-chip-verified  { color: var(--color-success); opacity: 1; cursor: default; font-size: 0.8rem; }

.ws-chip-add-row {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.ws-chip-input {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  padding: 4px 8px;
  background: var(--bg-input);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-circle);
  color: var(--text-main);
  outline: none;
  transition: border-color 0.15s;
}
.ws-chip-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.08);
}

.ws-btn-secondary {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--border-main);
  border-radius: var(--radius-circle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}
.ws-btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--color-primary);
  color: var(--color-primary);
}
.ws-btn-sm { padding: 3px 8px; font-size: 0.7rem; }

/* Drag-over highlight */
.ws-drag-over {
  border-color: var(--color-primary) !important;
  background: var(--color-primary-light) !important;
}

/* Mini spinner for wizard loading states */
.ws-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid var(--border-main);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: ws-spin 0.7s linear infinite;
  flex-shrink: 0;
}

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

/* =================================================================
   MISS K — AI Curriculum Marking Styles
   ================================================================= */

.mk-criterion-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  transition: border-color 0.2s;
}
.mk-criterion-card:hover { border-color: rgba(168, 85, 247, 0.35); }

.mk-criterion-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
}
.mk-criterion-name {
  font-size: 0.9rem;
  font-weight: 800;
  color: var(--text-main);
}
.mk-grade-chip {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 900;
  flex-shrink: 0;
}
.mk-code-chips { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.mk-nesa-chip, .mk-acara-chip {
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.15rem 0.45rem;
  border-radius: 20px;
  letter-spacing: 0.04em;
}
.mk-nesa-chip {
  background: rgba(99, 102, 241, 0.12);
  color: #a5b4fc;
  border: 1px solid rgba(99, 102, 241, 0.25);
}
.mk-acara-chip {
  background: rgba(20, 184, 166, 0.1);
  color: #5eead4;
  border: 1px solid rgba(20, 184, 166, 0.2);
}
.mk-block {
  padding: 0.5rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  line-height: 1.55;
}
.mk-block-label {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.25rem;
  color: var(--text-muted);
}
.mk-block-text { color: var(--text-main); }
.mk-evidence-block  { background: rgba(59,130,246,0.06);  border-left: 3px solid rgba(59,130,246,0.4); }
.mk-alignment-block { background: rgba(99,102,241,0.07);  border-left: 3px solid rgba(99,102,241,0.4); }
.mk-reasoning-block { background: rgba(168,85,247,0.07);  border-left: 3px solid rgba(168,85,247,0.4); }
.mk-feedback-block  { background: rgba(16,185,129,0.07);  border-left: 3px solid rgba(16,185,129,0.35); }
.mk-teacher-note-block { background: rgba(14,165,233,0.07); border-left: 3px solid rgba(14,165,233,0.35); }

.mk-grade-override {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  border-top: 1px solid var(--border-glass);
  padding-top: 0.5rem;
  margin-top: 0.1rem;
}
.mk-grade-select {
  font-size: 0.72rem;
  padding: 0.2rem 0.4rem;
  background: var(--bg-input);
  border: 1px solid var(--border-glass);
  border-radius: 4px;
  color: var(--text-main);
  flex: 1;
}
.mk-overall-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  padding: 1.25rem 1rem;
  background: rgba(255,255,255,0.015);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  text-align: center;
}
.mk-overall-grade-big {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 900;
  margin-bottom: 0.25rem;
}
.mk-overall-feedback-text {
  font-size: 0.83rem;
  color: var(--text-muted);
  line-height: 1.55;
  text-align: center;
  max-width: 480px;
  margin-top: 0.35rem;
  font-style: italic;
}
.mk-improvements-list {
  background: rgba(168,85,247,0.04);
  border: 1px solid rgba(168,85,247,0.2);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
}
.mk-improvement-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.82rem;
  color: var(--text-main);
  line-height: 1.5;
  padding: 0.2rem 0;
}
.mk-step-panel { animation: mkFadeIn 0.2s ease; }
@keyframes mkFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Miss K hub card accent */
.hub-card[data-tool="miss-k"] { border-left-color: #a855f7; }
.hub-card[data-tool="miss-k"] .hub-card-icon { background: rgba(168, 85, 247, 0.1); }
.hub-card[data-tool="miss-k"] .hub-card-action { color: #a855f7; }
.hub-card[data-tool="miss-k"]:hover { box-shadow: var(--shadow-md), 0 0 20px rgba(168,85,247,0.15); border-color: #a855f7; }

/* ==========================================================================
   HUB ZONES LAYOUT
   ========================================================================== */

.hub-zones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}
.hub-workflow-hint {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  padding: 0.65rem 1rem;
  margin-bottom: 0.25rem;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-glass);
  background: rgba(99, 102, 241, 0.04);
}
.hub-workflow-step {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
}
.hub-workflow-arrow {
  color: var(--text-muted);
  font-size: 0.85rem;
  opacity: 0.6;
}
.hub-zone {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.15rem 1.15rem 1.25rem;
  box-shadow: var(--shadow-sm);
}
.hub-zone[data-zone="classroom"] { border-top: 3px solid #6366f1; }
.hub-zone[data-zone="plan"] { border-top: 3px solid #10b981; }
.hub-zone[data-zone="assess"] { border-top: 3px solid #f59e0b; }
.hub-zone[data-zone="connect"] { border-top: 3px solid #06b6d4; }
.hub-zone-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.2rem;
  margin-bottom: 1rem;
  padding-bottom: 0;
  border-bottom: none;
}
.hub-zone-step {
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-primary);
}
.hub-zone-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.2;
}
.hub-zone-desc {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.4;
  max-width: 36rem;
}
.hub-zone-icon,
.hub-zone-label {
  display: none;
}
.hub-card-badge {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  background: linear-gradient(135deg, #a855f7, #ec4899);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 20px;
  letter-spacing: 0.05em;
}
.hub-zone .hub-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 0.75rem;
}

.hub-zone[data-zone="connect"] .hub-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 1100px) {
  .hub-zone[data-zone="connect"] .hub-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  }
}
.hub-zone .hub-card {
  padding: 0.95rem;
  gap: 0.65rem;
}
.hub-zone .hub-card-content h3 {
  font-size: 0.95rem;
}
.hub-zone .hub-card-content p {
  font-size: 0.78rem;
  line-height: 1.35;
}
@media (max-width: 960px) {
  .hub-zones {
    grid-template-columns: 1fr;
  }
}
@media (max-width: 600px) {
  .hub-zone .hub-grid {
    grid-template-columns: 1fr;
  }
  .hub-zones {
    gap: 1rem;
  }
  .hub-workflow-hint {
    justify-content: flex-start;
  }
}

/* ==========================================================================
   STUDENT PROFILE MODAL (Capabilities + Progressions tabs)
   ========================================================================== */

.student-profile-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  animation: fadeIn 0.15s ease;
}
[data-theme="dark"] .student-profile-overlay {
  background: rgba(0,0,0,0.65);
}
.student-profile-modal {
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 640px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  animation: slideUpFade 0.2s ease-out;
  overflow: hidden;
}
.student-profile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0.875rem;
  border-bottom: 1px solid var(--border-main);
  flex-shrink: 0;
}
.student-profile-header h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}
.student-profile-close {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  padding: 0.25rem;
  border-radius: var(--radius-sm);
  transition: var(--transition-fast);
}
.student-profile-close:hover { color: var(--text-main); background: var(--bg-hover); }

.student-profile-tabs {
  display: flex;
  gap: 0;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-main);
  flex-shrink: 0;
}
.sp-tab {
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.7rem 1rem;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  margin-bottom: -1px;
}
.sp-tab:hover { color: var(--text-main); }
.sp-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.student-profile-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.25rem 1.5rem 1.5rem;
}

/* Traffic-light chip buttons */
.cap-chip-row {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}
.cap-chip {
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-circle);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: var(--transition-fast);
  opacity: 0.45;
  letter-spacing: 0.02em;
}
.cap-chip.active { opacity: 1; }
.cap-chip-not-evident { background: rgba(239,68,68,0.12); color: #ef4444; border-color: rgba(239,68,68,0.35); }
.cap-chip-developing   { background: rgba(245,158,11,0.12); color: #f59e0b; border-color: rgba(245,158,11,0.35); }
.cap-chip-achieved     { background: rgba(16,185,129,0.12); color: #10b981; border-color: rgba(16,185,129,0.35); }
.cap-chip:hover { opacity: 0.85; }

.cap-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.7rem 0;
  border-bottom: 1px solid var(--border-main);
}
.cap-row:last-child { border-bottom: none; }
.cap-row-name {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-main);
  flex-shrink: 0;
  min-width: 180px;
}

/* Progression pill strips */
.prog-domain {
  margin-bottom: 1.25rem;
}
.prog-domain-label {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}
.prog-pill-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.prog-pill {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 700;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: var(--radius-circle);
  border: 1.5px solid var(--border-main);
  background: var(--bg-surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
}
.prog-pill:hover { border-color: var(--color-primary); color: var(--color-primary); }
.prog-pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(79,70,229,0.3);
}


/* ==========================================================================
   MOBILE APP — Bottom Tab Navigation
   Only active on ≤768px. Desktop sees the hub grid. No changes to desktop.
   ========================================================================== */

/* #mobile-app is hidden on desktop */
.mobile-app { display: none; }

@media (max-width: 768px) {

  /* ── Hide desktop elements ── */
  .app-header    { display: none !important; }
  .app-footer    { display: none !important; }
  .hub-container { display: none !important; }

  /* ── #mobile-app: fixed overlay covering the full screen ── */
  .mobile-app {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--bg-main);
    overflow: hidden;
  }

  /* ── Top bar ── */
  .mobile-top-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1rem;
    padding-top: env(safe-area-inset-top, 0px);
    height: calc(48px + env(safe-area-inset-top, 0px));
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-glass);
    flex-shrink: 0;
  }

  .mobile-top-logo {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.01em;
  }

  .mobile-top-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }

  .mobile-top-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.4rem;
    border-radius: var(--radius-sm);
    -webkit-tap-highlight-color: transparent;
    min-width: 36px;
    min-height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .mobile-top-btn-exit {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    padding: 0.25rem 0.6rem;
  }

  /* ── Section header (greeting + category title) ── */
  .mobile-section-header {
    padding: 0.6rem 1rem 0.5rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-glass);
    flex-shrink: 0;
  }

  .mobile-section-greeting {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 0.1rem;
  }

  .mobile-section-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.02em;
  }

  .mobile-week-digest {
    margin: 0.25rem 0 0;
    font-size: 0.72rem;
    line-height: 1.35;
    color: #86efac;
    font-weight: 600;
  }

  .mobile-recent-tools {
    padding: 0.55rem 1rem 0.65rem;
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-glass);
    flex-shrink: 0;
  }

  .mobile-recent-label {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    margin-bottom: 0.45rem;
  }

  .mobile-recent-chips {
    display: flex;
    gap: 0.45rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 0.1rem;
  }

  .mobile-recent-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    flex-shrink: 0;
    border: 1px solid var(--border-glass);
    background: rgba(99, 102, 241, 0.08);
    color: var(--text-main);
    border-radius: 999px;
    padding: 0.35rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    touch-action: manipulation;
  }

  .mobile-recent-chip-icon svg {
    width: 14px;
    height: 14px;
  }

  /* ── Tool list: fills remaining space, scrolls inside ── */
  .mobile-tab-content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: var(--bg-main);
  }

  /* ── Tool row ── */
  .mobile-tool-row {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.125rem;
    border-bottom: 1px solid var(--border-glass);
    cursor: pointer;
    background: transparent;
    width: 100%;
    text-align: left;
    -webkit-tap-highlight-color: transparent;
    border-left: none;
    border-right: none;
    border-top: none;
    transition: background 0.12s;
  }

  .mobile-tool-row:first-child {
    border-top: 1px solid var(--border-glass);
  }

  .mobile-tool-row:active {
    background: var(--bg-hover);
    transform: scale(0.995);
  }

  .mobile-tool-row-icon {
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
  }

  .mobile-tool-row-text {
    flex: 1;
    min-width: 0;
  }

  .mobile-tool-row-name {
    display: block;
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.15rem;
  }

  .mobile-tool-row-desc {
    display: block;
    font-size: 0.72rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-tool-row-chevron {
    color: var(--text-muted);
    flex-shrink: 0;
    font-size: 1.1rem;
    opacity: 0.5;
  }

  /* ── Bottom tab navigation ── */
  .mobile-bottom-nav {
    display: flex;
    background: var(--bg-surface);
    border-top: 1px solid var(--border-glass);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    flex-shrink: 0;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
  }

  .mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem 0.125rem;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.15s, transform 0.1s ease, opacity 0.1s ease;
    min-width: 0;
    touch-action: manipulation;
  }

  .mobile-tab:active {
    transform: scale(0.96);
    opacity: 0.85;
  }

  .mobile-tab.active {
    color: var(--color-primary);
  }

  .mobile-tab.mobile-tab--pulse {
    transform: scale(0.92);
    transition: transform 0.15s ease;
  }

  .mobile-tab-icon {
    font-size: 1.35rem;
    line-height: 1;
  }

  .mobile-tab-label {
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    white-space: nowrap;
  }

  /* ── Active tab indicator ── */
  .mobile-tab.active .mobile-tab-icon {
    filter: drop-shadow(0 0 6px rgba(99, 102, 241, 0.5));
  }

  .mobile-tab-miss-k {
    flex: 1.2;
    position: relative;
  }

  .mobile-tab-miss-k-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.65rem;
    height: 2.65rem;
    margin-top: -0.45rem;
    border-radius: 50%;
    background: linear-gradient(135deg, #818cf8, #6366f1);
    color: #fff;
    font-size: 1rem;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .mobile-tab-miss-k.active {
    color: var(--color-primary);
  }

  .mobile-tab-miss-k.active .mobile-tab-miss-k-badge {
    transform: scale(1.06);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.28), 0 8px 20px rgba(79, 70, 229, 0.4);
  }

  .mobile-tab-miss-k .mobile-tab-label {
    font-size: 0.62rem;
  }

  .mobile-tab-login-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.85rem;
    height: 2.65rem;
    margin-top: -0.45rem;
    padding: 0 0.5rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #818cf8, #6366f1);
    color: #fff;
    font-size: 0.58rem;
    font-weight: 800;
    line-height: 1.05;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    box-shadow: 0 6px 16px rgba(79, 70, 229, 0.35);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
  }

  .public-mobile-tab-login.active .mobile-tab-login-badge {
    transform: scale(1.06);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.28), 0 8px 20px rgba(79, 70, 229, 0.4);
  }

  .public-mobile-tab-login.active {
    color: var(--color-primary);
  }

  /* ── Global mobile: lock scroll on dashboard only (avoid fixed html/body — breaks iOS taps) ── */
  html, body {
    margin: 0;
    width: 100%;
  }

  body:not(.view-not-dashboard) {
    overflow: hidden;
    height: 100dvh;
    overscroll-behavior: none;
  }

  html.view-not-dashboard,
  body.view-not-dashboard,
  html:has(body.view-not-dashboard),
  html:has(body.view-landing-active) {
    overflow: auto;
    height: auto;
    min-height: 100dvh;
  }

  /* No opacity/transform transitions on mobile — they interfere with tap hit-testing */
  .view-section {
    transition: none !important;
  }

  .mobile-tab,
  .mobile-tool-row,
  .public-mobile-tab,
  .mobile-top-btn,
  button,
  a,
  [role="button"] {
    touch-action: manipulation;
  }

  /* ── Other view sections on mobile: scrollable, no fixed html ── */
  .view-section:not(#view-dashboard) {
    padding-bottom: 1rem;
  }

  /* ── Hide desktop nav buttons we don't need on mobile ── */
  #nav-username,
  .header-school-name,
  .header-date-chip {
    display: none !important;
  }

  /* ── Tables horizontal scroll ── */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ── Modals full-width ── */
  .modal-box, .overlay-box, .dialog-box {
    width: calc(100vw - 2rem) !important;
    max-width: 100% !important;
    max-height: 90dvh !important;
    overflow-y: auto;
  }

  /* ── Toast at bottom ── */
  .toast-container {
    bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 0.5rem) !important;
    left: 1rem !important;
    right: 1rem !important;
    top: auto !important;
    width: auto !important;
  }

} /* end @media (max-width: 768px) */




@media (max-width: 768px) {

  /* ── Hide desktop hub on mobile ── */
  .hub-container {
    display: none !important;
  }

  /* ── Dashboard section: lock to viewport ── */
  #view-dashboard.view-active {
    height: 100dvh;
    overflow: hidden;
    display: block;
  }

  /* Legacy hub tiles (hidden — mobile-app is the hub now) */
  .mobile-hub {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-main);
    padding: 0;
  }

  /* ── Greeting section — compact, no giant padding ── */
  .mobile-hub-greeting {
    text-align: center;
    padding: 1.25rem 1rem 1rem;
    background: linear-gradient(160deg, rgba(79, 70, 229, 0.1) 0%, transparent 60%);
    border-bottom: 1px solid var(--border-glass);
    flex-shrink: 0;
  }

  .mobile-hub-logo {
    font-size: 2rem;
    line-height: 1;
    margin-bottom: 0.35rem;
    filter: drop-shadow(0 0 10px rgba(99,102,241,0.4));
  }

  .mobile-hub-welcome {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-muted);
    margin: 0 0 0.1rem;
  }

  .mobile-hub-name {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0 0 0.2rem;
    letter-spacing: -0.02em;
  }

  .mobile-hub-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 0;
  }

  /* ── Category tile list — flex fills space, no forced min-height ── */
  .mobile-hub-categories {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 0.875rem 0.875rem env(safe-area-inset-bottom, 12px);
    overflow-y: auto;
    flex: 1;
  }

  .mobile-category-tile {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 1rem 1.25rem;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-lg);
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
    box-shadow: var(--shadow-sm);
    -webkit-tap-highlight-color: transparent;
    min-height: 72px;
  }

  .mobile-category-tile:active {
    transform: scale(0.98);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 2px rgba(99,102,241,0.15);
  }

  .mobile-tile-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  }

  .mobile-tile-content {
    flex: 1;
    min-width: 0;
  }

  .mobile-tile-label {
    display: block;
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.2rem;
  }

  .mobile-tile-desc {
    display: block;
    font-size: 0.78rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-tile-arrow {
    font-size: 1.4rem;
    color: var(--text-muted);
    flex-shrink: 0;
    font-weight: 300;
  }

  /* ── Mobile sub-menu: hidden by default, swapped in via .submenu-active ── */
  .mobile-submenu {
    display: none;
    flex-direction: column;
    height: 100%;
    background: var(--bg-main);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* When a category is tapped, swap hub out and submenu in */
  #view-dashboard.submenu-active .mobile-hub {
    display: none !important;
  }

  #view-dashboard.submenu-active .mobile-submenu {
    display: flex;
    animation: mobileSubmenuIn 0.25s cubic-bezier(0.4, 0, 0.2, 1) both;
  }

  @keyframes mobileSubmenuIn {
    from { opacity: 0.4; transform: translateX(24px); }
    to   { opacity: 1;   transform: translateX(0); }
  }

  .mobile-submenu-header {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 1rem 1.25rem;
    border-bottom: 1px solid var(--border-glass);
    background: linear-gradient(160deg, rgba(79, 70, 229, 0.08) 0%, transparent 60%);
    flex-shrink: 0;
  }

  .mobile-submenu-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: transparent;
    border: none;
    color: var(--color-primary);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    padding: 0.35rem 0;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-submenu-title-wrap {
    display: flex;
    align-items: center;
    gap: 0.75rem;
  }

  .mobile-submenu-icon {
    font-size: 1.6rem;
    line-height: 1;
  }

  .mobile-submenu-title {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
    margin: 0;
    letter-spacing: -0.02em;
  }

  .mobile-submenu-tools {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    gap: 0.6rem;
  }

  /* ── Individual tool item in sub-menu ── */
  .mobile-tool-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    width: 100%;
    padding: 0.875rem 1.125rem;
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-md);
    cursor: pointer;
    text-align: left;
    transition: all 0.18s ease;
    box-shadow: var(--shadow-sm);
    -webkit-tap-highlight-color: transparent;
    min-height: 62px;
  }

  .mobile-tool-item:active {
    transform: scale(0.98);
    border-color: var(--color-primary);
    background: var(--color-primary-light);
  }

  .mobile-tool-item-icon {
    font-size: 1.35rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-surface);
    border-radius: 10px;
    flex-shrink: 0;
  }

  .mobile-tool-item-text {
    flex: 1;
    min-width: 0;
  }

  .mobile-tool-item-name {
    display: block;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.15rem;
  }

  .mobile-tool-item-desc {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .mobile-tool-item-arrow {
    font-size: 1rem;
    color: var(--text-muted);
    flex-shrink: 0;
  }

  /* ── Mobile header compact layout ── */
  .app-header {
    padding: 0 1rem !important;
    height: 52px;
    min-height: 52px;
    flex-shrink: 0;
  }

  .header-logo h1,
  .header-logo .header-logo-title {
    font-size: 1rem !important;
  }

  .header-school-name {
    display: none !important;
  }

  .header-date-chip {
    display: none !important;
  }

  #nav-username {
    display: none !important;
  }

  /* ── Collapsible nav items ── */
  .header-nav {
    gap: 0.4rem !important;
  }

  #nav-dashboard-btn,
  #nav-profile-btn {
    font-size: 0.75rem !important;
    padding: 0.35rem 0.65rem !important;
  }

  #nav-logout-btn {
    font-size: 0.75rem !important;
    padding: 0.35rem 0.65rem !important;
  }

  /* ── Global touch targets ── */
  button, .btn-primary, .btn-outline, .nav-btn, .hub-card {
    min-height: 44px;
  }

  /* ── Sidebars stack below main content on mobile ── */
  .dashboard-container,
  .dashboard-sidebar + .dashboard-main {
    flex-direction: column !important;
  }

  .dashboard-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  /* ── Scrollable tables ── */
  table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* ── Back to hub buttons more prominent ── */
  .btn-back {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    min-height: 44px;
  }

  /* ── Section padding on mobile ── */
  .view-section > div:first-child {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
  }

  /* ── Hub zone grid: 1 column on mobile ── */
  .hub-zone .hub-grid,
  .hub-grid {
    grid-template-columns: 1fr !important;
  }

  /* ── Recently used strip: horizontal scroll ── */
  .recently-used-strip {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    flex-wrap: nowrap !important;
  }

  /* ── Editor panels: stack vertically ── */
  .editor-container,
  .lesson-editor-layout,
  .worksheet-editor-layout {
    flex-direction: column !important;
    height: auto !important;
  }

  .editor-controls,
  .lesson-controls,
  .worksheet-controls {
    width: 100% !important;
    max-height: 50vh;
    overflow-y: auto;
    border-right: none !important;
    border-bottom: 1px solid var(--border-glass);
  }

  .editor-preview-pane {
    width: 100% !important;
    height: 60vw;
    min-height: 300px;
    overflow: auto;
  }

  /* ── Quiz hub: single column ── */
  .quiz-grid,
  .quiz-cards-grid {
    grid-template-columns: 1fr !important;
  }

  /* ── Report comments: stack ── */
  .report-comments-layout {
    flex-direction: column !important;
  }

  /* ── PD Log / Work Samples: full width cards ── */
  .pd-cards-grid,
  .ws-cards-grid {
    grid-template-columns: 1fr !important;
  }

  /* ── Modal overlays: full screen on mobile ── */
  .modal-box,
  .overlay-box,
  .dialog-box {
    width: calc(100vw - 2rem) !important;
    max-width: 100% !important;
    max-height: 90vh !important;
    overflow-y: auto;
  }

  /* ── Landing page: mobile friendly ── */
  .landing-container {
    padding: 1rem !important;
  }

  .landing-hero h1 {
    font-size: 2rem !important;
  }

  .landing-tool-cards-track {
    gap: 0.75rem !important;
  }

  /* ── Onboarding: full width ── */
  .onboarding-card {
    padding: 1.5rem 1rem !important;
  }

  .form-group-row {
    flex-direction: column !important;
    gap: 0 !important;
  }

  /* ── Hide desktop footer on mobile entirely ── */
  .app-footer {
    display: none !important;
  }

  body.view-landing-active .landing-site-footer {
    display: none !important;
  }

  body.view-landing-active #app-root::after {
    display: none;
  }

  /* ── Tiny app-style bottom strip (replaces footer) ── */
  #app-root::after {
    content: '© 2026 kl8.in · kl8techgroup';
    display: block;
    text-align: center;
    font-size: 0.65rem;
    color: var(--text-muted);
    opacity: 0.5;
    padding: 0.5rem 1rem env(safe-area-inset-bottom, 6px);
    pointer-events: none;
  }

  /* ── Category tiles: slightly more compact on small phones ── */
  .mobile-category-tile {
    padding: 0.75rem 1rem;
    min-height: 62px;
  }

  /* ── Toast: keep above safe area ── */
  .toast-container {
    bottom: env(safe-area-inset-bottom, 16px) !important;
    left: 1rem !important;
    right: 1rem !important;
    top: auto !important;
    width: auto !important;
  }

  /* ── Print: hide mobile UI ── */
  @media print {
    .mobile-hub,
    .mobile-submenu {
      display: none !important;
    }
  }

} /* end @media (max-width: 768px) */

@keyframes mobileTabIn {
  from { opacity: 0; transform: translateX(12px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* ==========================================================================
   PWA INSTALL PROMPT BANNER
   ========================================================================== */

.pwa-install-banner {
  display: none;
  position: fixed;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.4);
  z-index: 9999;
  align-items: center;
  gap: 1rem;
  animation: slideUpFade 0.4s ease;
}

.pwa-install-banner.visible {
  display: flex;
}

.pwa-install-text {
  flex: 1;
}

.pwa-install-text strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 0.15rem;
}

.pwa-install-text span {
  font-size: 0.78rem;
  opacity: 0.85;
}

.pwa-install-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  border-radius: var(--radius-md);
  padding: 0.5rem 0.875rem;
  font-size: 0.82rem;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.pwa-install-btn:hover {
  background: rgba(255,255,255,0.3);
}

.pwa-install-dismiss {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.65);
  font-size: 1rem;
  cursor: pointer;
  padding: 0.25rem;
  flex-shrink: 0;
  line-height: 1;
}

/* ==========================================================================
   PUBLIC LANDING NAVIGATION & SECTIONS
   ========================================================================== */

/* Public Header styling */
.public-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border-glass);
  position: sticky;
  top: 0;
  z-index: 950;
  max-width: 100%;
  margin: 0 auto;
  width: 100%;
  box-sizing: border-box;
}

.public-nav {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.public-nav-link {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition-fast);
  cursor: pointer;
}

.public-nav-link:hover, 
.public-nav-link.active {
  color: var(--color-primary);
}

/* Sections styling */
.landing-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2rem;
  box-sizing: border-box;
}

.bg-gradient-alt {
  background: linear-gradient(180deg, transparent 0%, var(--bg-surface) 100%);
  max-width: 100%;
  width: 100%;
  padding-left: 2rem;
  padding-right: 2rem;
}

.landing-section-header {
  text-align: center;
  max-width: 700px;
  margin: 0 auto 3rem;
}

.landing-section-header h2 {
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.75px;
  margin-top: 0.5rem;
  margin-bottom: 1rem;
  color: var(--text-main);
}

.landing-section-header p {
  font-size: 1rem;
  color: var(--text-muted);
  line-height: 1.6;
}

/* Features Grid */
.landing-features-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.landing-feature-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.landing-feature-card:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary);
  box-shadow: var(--shadow-md), 0 0 20px rgba(99, 102, 241, 0.08);
}

.feature-icon-wrap {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  margin-bottom: 1.25rem;
}

.landing-feature-card h3 {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  color: var(--text-main);
}

.landing-feature-card p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.25rem;
  flex-grow: 1;
}

.feature-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.feature-bullets li {
  font-size: 0.78rem;
  color: var(--text-secondary);
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.feature-bullets li::before {
  content: "✓";
  color: var(--color-success);
  font-weight: 800;
}

/* Compliance Infographic */
.compliance-showcase-container {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 3rem;
  align-items: start;
}

.compliance-infographic {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.compliance-pillar {
  display: flex;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  box-shadow: var(--shadow-sm);
}

.pillar-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--color-primary);
  opacity: 0.85;
  line-height: 1.2;
}

.pillar-content h4 {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 0.25rem;
}

.pillar-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.45;
  margin: 0;
}

.compliance-badge-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-left: 4px solid var(--color-primary);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md), 0 0 24px rgba(99, 102, 241, 0.04);
  position: sticky;
  top: 100px;
}

.compliance-badge-card h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 0.6rem;
  color: var(--text-main);
}

.compliance-badge-card p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 1.5rem;
}

.compliance-certifications {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cert-item {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}

.cert-icon {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--color-primary-light);
  color: var(--color-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.65rem;
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 2px;
}

.cert-item span:not(.cert-icon) {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  line-height: 1.35;
}

/* FAQ Accordion */
.faq-container {
  max-width: 800px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.faq-item {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-fast);
}

.faq-trigger {
  width: 100%;
  background: transparent;
  border: none;
  padding: 1.15rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-sans);
  color: var(--text-main);
  font-size: 0.95rem;
  font-weight: 700;
  transition: var(--transition-fast);
  outline: none;
}

.faq-trigger:hover {
  background: var(--bg-hover);
}

.faq-icon {
  font-size: 1.15rem;
  color: var(--text-muted);
  transition: transform 0.2s ease;
}

.faq-content {
  max-height: 0;
  overflow: hidden;
  padding: 0 1.25rem;
  transition: max-height 0.3s ease-out, padding 0.3s ease;
}

.faq-content p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
  margin: 0 0 1.15rem;
}

/* FAQ Active State */
.faq-item.active {
  border-color: var(--color-primary);
}

.faq-item.active .faq-trigger {
  background: var(--color-primary-light);
  color: var(--color-primary);
}

.faq-item.active .faq-icon {
  transform: rotate(45deg);
  color: var(--color-primary);
}

.faq-item.active .faq-content {
  max-height: 250px;
  padding: 0.5rem 1.25rem 0.5rem;
}

/* Public pages transitions */
.public-page {
  display: none;
  animation: publicPageFadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}
.public-page.active-page {
  display: block;
}

.header-logo-link {
  text-decoration: none;
  color: inherit;
}

.about-hero-panel {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem 2rem;
}

.about-hero-inner {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 720px;
}

/* Demoted from h1 for SEO — keeps the original h1 look */
.about-hero-title {
  font-size: 2em;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.5px;
  color: var(--text-main);
  margin: 0;
}

/* Demoted from h1 for SEO — keeps h1-sized print output */
#dtd-print-title {
  font-size: 2em;
  font-weight: 700;
  margin: 0.4em 0;
}

.about-tool-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.about-tool-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  box-shadow: var(--shadow-sm);
}

.about-tool-card strong {
  color: var(--text-main);
  font-size: 0.95rem;
}

.about-tool-card span {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

@media (max-width: 900px) {
  .about-tool-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 600px) {
  .about-tool-grid {
    grid-template-columns: 1fr;
  }
}

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

/* Time Saved Calculator CSS */
.calculator-section-wrap {
  max-width: 1200px;
  margin: 2.5rem auto;
  padding: 0 2rem;
  box-sizing: border-box;
}
.calculator-card {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md), 0 10px 30px rgba(99, 102, 241, 0.05);
  overflow: hidden;
  padding: 2.5rem;
}
.calculator-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}
.calculator-inputs h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
  color: var(--text-main);
}
.calculator-intro {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 2rem;
}
.calculator-control {
  margin-bottom: 1.5rem;
}
.control-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
}
.control-badge {
  background: var(--color-primary-light);
  color: var(--color-primary);
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 700;
}
.calc-slider {
  width: 100%;
  -webkit-appearance: none;
  background: var(--bg-surface);
  height: 6px;
  border-radius: 3px;
  outline: none;
}
.calc-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--color-primary);
  cursor: pointer;
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.4);
  transition: transform 0.1s ease;
}
.calc-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
}

.calculator-results {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 2rem;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  box-sizing: border-box;
}
.results-subtitle {
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 1.5px;
  color: var(--text-muted);
  text-transform: uppercase;
}
.results-value-container {
  margin: 0.75rem 0;
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}
.results-number {
  font-size: 3rem;
  font-weight: 900;
  color: var(--color-primary);
  line-height: 1;
}
.results-unit {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.calculator-gauge-track {
  width: 100%;
  height: 8px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 4px;
  overflow: hidden;
  margin: 1rem 0 1.5rem;
}
.calculator-gauge-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), #8b5cf6);
  border-radius: 4px;
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.results-analogy {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin: 0 0 1.5rem;
}
.calc-cta-btn {
  width: 100%;
  padding: 0.8rem;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 14px rgba(99, 102, 241, 0.3);
}

/* How It Works Timeline */
.how-it-works-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-top: 2rem;
}
.how-step {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 2rem;
  position: relative;
  transition: var(--transition-smooth);
}
.how-step:hover {
  transform: translateY(-4px);
  border-color: var(--color-primary);
}
.step-badge {
  position: absolute;
  top: -15px;
  left: 20px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--color-primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: 0 2px 8px rgba(99, 102, 241, 0.4);
}
.how-step h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0.5rem 0 0.5rem;
}
.how-step p {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Features Explorer Widget */
.feature-explorer-container {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2.5rem;
  align-items: start;
  margin-top: 2rem;
}
.feature-explorer-tabs {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.feature-explorer-tab {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
  text-align: left;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  transition: var(--transition-fast);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 0.875rem;
}
.feature-explorer-tab:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}
.feature-explorer-tab.active {
  border-color: var(--color-primary);
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.tab-icon {
  font-size: 1.15rem;
}
.feature-explorer-preview {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  min-height: 380px;
  display: flex;
  box-sizing: border-box;
}
.preview-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  animation: previewFadeIn 0.3s ease-out;
}
@keyframes previewFadeIn {
  from { opacity: 0; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1); }
}
.preview-header-badge {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  font-size: 0.7rem;
  font-weight: 800;
  padding: 0.25rem 0.6rem;
  border-radius: 4px;
  display: inline-block;
  align-self: flex-start;
  margin-bottom: 1rem;
  letter-spacing: 0.5px;
}
.feature-explorer-preview h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 0 0 0.75rem;
}
.feature-explorer-preview p {
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin: 0 0 1.5rem;
}
.preview-bullets {
  list-style: none;
  padding: 0;
  margin: 0 0 2rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.preview-bullets li {
  font-size: 0.85rem;
  color: var(--text-secondary);
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
}
.preview-bullets li::before {
  content: "✓";
  color: var(--color-success);
  font-weight: 800;
}

/* Compliance Flowchart Styles */
.compliance-flow-section {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  margin-bottom: 2.5rem;
}
.compliance-flow-section h3 {
  font-size: 1.25rem;
  font-weight: 800;
  text-align: center;
  color: var(--text-main);
  margin: 0 0 0.5rem;
}
.flowchart-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 3rem;
  position: relative;
  gap: 1rem;
}
.flow-node {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 1.5rem;
  width: 25%;
  text-align: center;
  position: relative;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
}
.node-local {
  border-left: 4px solid var(--color-success);
}
.node-server {
  border-left: 4px solid var(--color-primary);
}
.node-ai {
  border-left: 4px solid #a855f7;
}
.node-icon {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
}
.flow-node h4 {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.5rem;
}
.flow-node p {
  font-size: 0.72rem;
  color: var(--text-muted);
  line-height: 1.4;
  margin: 0 0 1rem;
}
.node-badge {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border-glass);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.flow-arrow {
  flex-grow: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  text-align: center;
}
.arrow-line {
  width: 100%;
  height: 2px;
  background: dashed var(--border-glass);
  position: relative;
}
.arrow-pulse {
  width: 8px;
  height: 8px;
  background: var(--color-primary);
  border-radius: 50%;
  position: absolute;
  top: -3px;
  left: 0;
  animation: flowPulse 2s infinite linear;
}
@keyframes flowPulse {
  0% { left: 0%; opacity: 0; }
  10% { opacity: 1; }
  90% { opacity: 1; }
  100% { left: 100%; opacity: 0; }
}
.arrow-text {
  font-size: 0.65rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-top: 0.5rem;
}

/* NSW 12 IPPs Matrix CSS */
.ipp-matrix-section {
  margin-top: 4rem;
}
.ipp-matrix-section h3 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  text-align: center;
  margin: 0 0 0.5rem;
}
.ipp-section-subtitle {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 2.5rem;
}
.ipp-accordion {
  max-width: 900px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}
.ipp-item {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  overflow: hidden;
  transition: var(--transition-fast);
}
.ipp-trigger {
  width: 100%;
  background: transparent;
  border: none;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  text-align: left;
  outline: none;
}
.ipp-trigger:hover {
  background: var(--bg-hover);
}
.ipp-title {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-main);
}
.ipp-status-badge {
  background: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  font-size: 0.65rem;
  font-weight: 800;
  padding: 0.15rem 0.5rem;
  border-radius: 12px;
}
.ipp-content {
  max-height: 0;
  overflow: hidden;
  padding: 0 1.25rem;
  transition: max-height 0.3s ease-out, padding 0.3s ease;
}
.ipp-content p {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0 0 1rem;
}
.ipp-item.active {
  border-color: var(--color-primary);
}
.ipp-item.active .ipp-trigger {
  background: var(--color-primary-light);
}
.ipp-item.active .ipp-title {
  color: var(--color-primary);
}
.ipp-item.active .ipp-content {
  max-height: 120px;
  padding: 0.5rem 1.25rem 0.5rem;
}

/* FAQ Search & Filtering */
.faq-search-wrapper {
  max-width: 800px;
  margin: 0 auto 2.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.faq-search-bar-container {
  display: flex;
  align-items: center;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.75rem 1.25rem;
}
.faq-search-icon {
  font-size: 1.1rem;
  color: var(--text-muted);
  margin-right: 0.75rem;
}
#faq-search {
  background: transparent;
  border: none;
  outline: none;
  width: 100%;
  color: var(--text-main);
  font-size: 0.95rem;
}
#faq-search::placeholder {
  color: var(--text-muted);
}
.faq-filter-tabs {
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  flex-wrap: wrap;
}
.faq-filter-btn {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 20px;
  padding: 0.4rem 1.15rem;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition-fast);
}
.faq-filter-btn:hover {
  background: var(--bg-hover);
  color: var(--text-main);
}
.faq-filter-btn.active {
  background: var(--color-primary);
  color: white;
  border-color: var(--color-primary);
}

/* Shared Footer styling */
.public-footer {
  background: var(--bg-card);
  border-top: 1px solid var(--border-glass);
  padding: 4rem 2rem 2rem;
  margin-top: 5rem;
  box-sizing: border-box;
}
.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr repeat(2, 0.7fr);
  gap: 3rem;
}
.footer-brand-col {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.footer-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.footer-logo .logo-icon {
  font-size: 1.5rem;
}
.footer-logo .logo-text {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-main);
}
.footer-about {
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}
.footer-trust-chips {
  display: flex;
  gap: 0.5rem;
}
.trust-badge-pill {
  background: var(--bg-surface);
  border: 1px solid var(--border-glass);
  padding: 0.25rem 0.6rem;
  border-radius: 12px;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-secondary);
}
.footer-links-col h4 {
  font-size: 0.85rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-main);
  margin: 0 0 1.25rem;
}
.footer-links-col ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}
.footer-links-col a {
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  transition: var(--transition-fast);
  cursor: pointer;
}
.footer-links-col a:hover {
  color: var(--color-primary);
}

.profile-rating-prompt {
  position: fixed;
  left: 1.25rem;
  bottom: 1.25rem;
  z-index: 900;
  width: min(320px, calc(100vw - 2rem));
  padding: 1rem 1.1rem 1.1rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.profile-rating-prompt.is-visible {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.profile-rating-dismiss {
  position: absolute;
  top: 0.35rem;
  right: 0.45rem;
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.15rem 0.35rem;
}
.profile-rating-dismiss:hover {
  color: var(--text-main);
}
.profile-rating-title {
  margin: 0 0 0.65rem;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  padding-right: 1.25rem;
}
.profile-rating-note {
  margin: 0 0 0.85rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--text-muted);
}
.profile-rating-stars {
  display: flex;
  gap: 0.35rem;
}
.profile-rating-star {
  border: 1px solid var(--border-glass);
  background: var(--bg-input);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  width: 2.25rem;
  height: 2.25rem;
  font-size: 1.1rem;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.profile-rating-star:hover,
.profile-rating-star.is-selected {
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.45);
  background: rgba(245, 158, 11, 0.08);
}
.profile-rating-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}
.profile-rating-actions .nav-btn {
  min-height: auto;
  padding: 0.35rem 0.75rem;
  font-size: 0.75rem;
  flex: 1 1 auto;
  text-align: center;
  text-decoration: none;
}
.profile-rating-later {
  border: none;
  background: none;
  color: var(--text-muted);
  font-size: 0.75rem;
  cursor: pointer;
  padding: 0;
}
.profile-rating-later:hover {
  color: var(--text-main);
}

.miss-k-chat-root {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 950;
  pointer-events: none;
}
.miss-k-chat-root:not([hidden]) {
  pointer-events: none;
}
.miss-k-chat-fab {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  border: none;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border-radius: 999px;
  padding: 0.55rem 1rem 0.55rem 0.55rem;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(79, 70, 229, 0.35);
  pointer-events: auto;
}
/* Hide the launcher bubble while the chat panel is already open */
body.miss-k-chat-open .miss-k-chat-fab {
  display: none;
}

.miss-k-chat-fab-avatar,
.miss-k-chat-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: linear-gradient(135deg, #818cf8, #6366f1);
  color: #fff;
  font-weight: 800;
  font-size: 0.85rem;
  flex-shrink: 0;
}
.miss-k-chat-avatar--sm {
  width: 1.75rem;
  height: 1.75rem;
  font-size: 0.72rem;
}
.miss-k-chat-panel {
  position: absolute;
  right: 0;
  bottom: calc(100% + 0.75rem);
  width: min(400px, calc(100vw - 1.5rem));
  height: min(560px, calc(100vh - 6rem));
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: 1rem;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.25);
  overflow: hidden;
  opacity: 0;
  transform: translateY(12px) scale(0.96);
  transition: opacity 0.22s ease, transform 0.22s ease;
  pointer-events: none;
}
.miss-k-chat-panel.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}
.miss-k-chat-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid var(--border-glass);
  background: linear-gradient(180deg, rgba(99, 102, 241, 0.12), rgba(99, 102, 241, 0.04));
}
.miss-k-chat-header-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}
.miss-k-chat-header strong {
  display: block;
  color: var(--text-main);
  font-size: 0.95rem;
  line-height: 1.2;
}
.miss-k-chat-status {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 0.1rem;
}
.miss-k-chat-status-dot {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.25);
}
.miss-k-chat-privacy-badge {
  display: inline-flex;
  align-items: center;
  margin-top: 0.2rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: #86efac;
  background: rgba(34, 197, 94, 0.12);
  border: 1px solid rgba(34, 197, 94, 0.25);
}
.miss-k-chat-header-actions {
  display: flex;
  gap: 0.35rem;
  flex-shrink: 0;
}
.miss-k-chat-icon-btn {
  border: 1px solid var(--border-glass);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  cursor: pointer;
}
.miss-k-chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  background:
    radial-gradient(circle at 10% 10%, rgba(99, 102, 241, 0.06), transparent 40%),
    var(--bg-main, var(--bg-card));
}
.miss-k-chat-row {
  display: flex;
  align-items: flex-end;
  gap: 0.5rem;
  max-width: 100%;
}
.miss-k-chat-row--user {
  justify-content: flex-end;
}
.miss-k-chat-row--assistant {
  justify-content: flex-start;
}
.miss-k-chat-row-body {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  max-width: calc(100% - 2.5rem);
}
.miss-k-chat-row--user .miss-k-chat-row-body {
  align-items: flex-end;
}
.miss-k-chat-row--assistant .miss-k-chat-row-body {
  align-items: flex-start;
}
.miss-k-chat-bubble {
  padding: 0.65rem 0.85rem;
  border-radius: 1rem;
  font-size: 0.84rem;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.miss-k-chat-row--user .miss-k-chat-bubble {
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  border-bottom-right-radius: 0.25rem;
}
.miss-k-chat-row--assistant .miss-k-chat-bubble {
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  color: var(--text-main);
  border-bottom-left-radius: 0.25rem;
}
.miss-k-chat-time {
  font-size: 0.65rem;
  color: var(--text-muted);
}
.miss-k-chat-images {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}
.miss-k-chat-images img {
  max-width: 140px;
  max-height: 120px;
  border-radius: 0.65rem;
  object-fit: cover;
  border: 1px solid var(--border-glass);
}
.miss-k-chat-typing-bubble {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.65rem 0.85rem !important;
  min-width: 3.5rem;
}
.miss-k-chat-typing-bubble span {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 50%;
  background: var(--text-muted);
  animation: miss-k-typing 1.2s infinite ease-in-out;
}
.miss-k-chat-typing-bubble span:nth-child(2) { animation-delay: 0.15s; }
.miss-k-chat-typing-bubble span:nth-child(3) { animation-delay: 0.3s; }
@keyframes miss-k-typing {
  0%, 80%, 100% { opacity: 0.35; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-2px); }
}
.miss-k-chat-attachments {
  display: flex;
  gap: 0.5rem;
  padding: 0.5rem 0.85rem 0;
  flex-wrap: wrap;
}
.miss-k-chat-attach-chip {
  position: relative;
  width: 56px;
  height: 56px;
}
.miss-k-chat-attach-chip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 0.5rem;
  border: 1px solid var(--border-glass);
}
.miss-k-chat-attach-chip button {
  position: absolute;
  top: -0.35rem;
  right: -0.35rem;
  width: 1.1rem;
  height: 1.1rem;
  border: none;
  border-radius: 50%;
  background: #ef4444;
  color: #fff;
  font-size: 0.7rem;
  cursor: pointer;
  line-height: 1;
}
.miss-k-chat-composer {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
  padding: 0.65rem 0.75rem;
  border-top: 1px solid var(--border-glass);
  background: var(--bg-card);
}
.miss-k-chat-composer.is-sending {
  opacity: 0.65;
}
.miss-k-chat-attach-btn {
  border: 1px solid var(--border-glass);
  background: var(--bg-input);
  border-radius: 50%;
  width: 2.25rem;
  height: 2.25rem;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 1rem;
  line-height: 1;
}
.miss-k-chat-input {
  flex: 1;
  resize: none;
  min-height: 2.25rem;
  max-height: 7.5rem;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border-glass);
  border-radius: 1.25rem;
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.84rem;
  font-family: inherit;
  line-height: 1.4;
}
.miss-k-chat-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: none;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #4f46e5);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.miss-k-chat-send:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.miss-k-chat-footnote {
  margin: 0;
  padding: 0.4rem 0.85rem calc(0.6rem + env(safe-area-inset-bottom, 0px));
  font-size: 0.65rem;
  color: var(--text-muted);
  line-height: 1.35;
  text-align: center;
  background: var(--bg-card);
}
.miss-k-inline-link {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-size: inherit;
  color: #818cf8;
  text-decoration: underline;
  cursor: pointer;
}
.miss-k-save-decision {
  margin-top: 0.35rem;
  border: 1px solid var(--border-glass);
  background: rgba(99, 102, 241, 0.1);
  color: #a5b4fc;
  border-radius: 999px;
  padding: 0.2rem 0.55rem;
  font-size: 0.65rem;
  font-weight: 600;
  cursor: pointer;
}
.miss-k-chat-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.45rem 0.85rem;
  background: var(--bg-card);
  border-top: 1px solid var(--border-glass);
}
/* display:flex above beats the UA [hidden] rule — restore it */
.miss-k-chat-actions[hidden] {
  display: none;
}
.miss-k-chat-actions-label {
  flex-basis: 100%;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.miss-k-action-btn {
  flex: 1 1 auto;
  min-width: 0;
  border: 1px solid rgba(99, 102, 241, 0.35);
  background: rgba(99, 102, 241, 0.12);
  color: #c7d2fe;
  border-radius: 999px;
  padding: 0.35rem 0.65rem;
  font-size: 0.68rem;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
}
.miss-k-action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

@media (max-width: 768px) {
  .miss-k-chat-root,
  .miss-k-chat-root:not([hidden]) {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    z-index: 250;
    pointer-events: none !important;
    display: none;
  }

  .miss-k-chat-root.is-panel-open {
    display: block;
    pointer-events: auto !important;
  }

  .miss-k-chat-fab {
    display: none !important;
  }

  .miss-k-chat-panel {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    max-height: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
    opacity: 0;
    transform: none;
    pointer-events: none;
    background: var(--miss-k-window-bg);
  }

  .miss-k-chat-panel.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .miss-k-chat-header {
    padding-top: calc(0.85rem + env(safe-area-inset-top, 0px));
    background: var(--miss-k-window-surface);
    border-bottom: 1px solid var(--border-glass);
  }

  .miss-k-chat-messages {
    flex: 1;
    min-height: 0;
    background: var(--miss-k-window-bg);
  }

  .miss-k-chat-row--assistant .miss-k-chat-bubble {
    background: var(--miss-k-window-surface);
    border-color: var(--border-glass);
  }

  .miss-k-chat-composer,
  .miss-k-chat-footnote {
    background: var(--miss-k-window-surface);
  }

  .miss-k-chat-attach-chip img,
  .miss-k-chat-icon-btn {
    background: var(--miss-k-window-bg);
  }

  body.miss-k-chat-open #mobile-app .mobile-top-bar,
  body.miss-k-chat-open #mobile-app .mobile-section-header,
  body.miss-k-chat-open #mobile-app .mobile-recent-tools,
  body.miss-k-chat-open #mobile-app .mobile-tab-content {
    visibility: hidden;
    height: 0;
    overflow: hidden;
    pointer-events: none !important;
  }

  body.miss-k-chat-open #mobile-app.is-tool-shell {
    height: calc(56px + env(safe-area-inset-bottom, 0px));
  }

  body.miss-k-chat-open #mobile-app .mobile-bottom-nav {
    pointer-events: auto;
  }

  /* Logged-in tool views: hub shrinks to bottom nav strip; tool fills screen above */
  #mobile-app.is-tool-shell {
    background: transparent;
    pointer-events: none;
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    height: calc(56px + env(safe-area-inset-bottom, 0px));
    inset: auto 0 0 0;
  }

  #mobile-app.is-tool-shell .mobile-top-bar,
  #mobile-app.is-tool-shell .mobile-section-header,
  #mobile-app.is-tool-shell .mobile-recent-tools,
  #mobile-app.is-tool-shell .mobile-tab-content {
    display: none !important;
  }

  #mobile-app.is-tool-shell .mobile-bottom-nav {
    pointer-events: auto;
    position: relative;
    z-index: 1;
  }

  /* Back bar when a tool is open */
  .mobile-tool-chrome {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 245;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.85rem;
    padding-top: calc(0.45rem + env(safe-area-inset-top, 0px));
    min-height: calc(44px + env(safe-area-inset-top, 0px));
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-glass);
    box-shadow: 0 1px 0 rgba(15, 23, 42, 0.06);
  }

  body.mobile-tool-open .mobile-tool-chrome {
    display: flex;
  }

  /* The mobile tool chrome already has "← Hub" — hide the in-page duplicate */
  body.mobile-tool-open .btn-back {
    display: none;
  }

  .mobile-tool-back-btn {
    flex-shrink: 0;
    border: 1px solid var(--border-glass);
    background: var(--bg-card);
    color: var(--color-primary);
    font-size: 0.82rem;
    font-weight: 700;
    border-radius: var(--radius-sm);
    padding: 0.35rem 0.65rem;
    min-height: 36px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  .mobile-tool-back-btn:active {
    transform: scale(0.97);
    opacity: 0.9;
  }

  .mobile-tool-chrome-title {
    flex: 1;
    min-width: 0;
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-main);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  body.user-authenticated .view-section.view-active:not(#view-dashboard):not(#view-landing):not(#view-onboarding) {
    position: fixed;
    top: calc(44px + env(safe-area-inset-top, 0px));
    left: 0;
    right: 0;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    z-index: 220;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    background: var(--bg-main);
  }

  body.user-authenticated .public-mobile-bottom-nav {
    display: none !important;
  }

  .mobile-bottom-nav {
    position: relative;
    z-index: 260;
  }
}

/* Hidden by default; the mobile media query opts it in on the logged-out landing page */
.public-mobile-bottom-nav {
  display: none;
}

.footer-text-muted {
  font-size: 0.82rem;
  color: var(--text-muted);
  margin: 0;
}
.footer-bottom {
  max-width: 1200px;
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-glass);
  text-align: center;
}
.footer-bottom p {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin: 0;
}

/* Media Queries for New Public Sections */
@media (max-width: 768px) {
  .public-header {
    padding: 0.75rem 1rem;
    position: sticky;
    top: 0;
    z-index: 900;
  }

  .public-hamburger-btn {
    display: none !important;
  }

  .public-nav {
    display: none !important;
  }

  .public-mobile-bottom-nav {
    display: none;
  }

  body.view-landing-active:not(.user-authenticated) .public-mobile-bottom-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
  }

  body.view-landing-active #view-landing {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
    box-sizing: border-box;
  }

  body.view-landing-active .public-content-container {
    flex: 1 1 auto;
    width: 100%;
    box-sizing: border-box;
  }

  body.view-landing-active .landing-site-footer {
    display: none !important;
  }

  #view-landing {
    overflow: visible !important;
  }

  .landing-container {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
    padding: 1.25rem 1rem 1.5rem !important;
    min-height: auto !important;
    text-align: center !important;
  }

  .landing-hero {
    order: 1 !important;
    align-items: center !important;
  }

  .auth-card-wrapper {
    order: 2 !important;
  }

  #google-signin-btn,
  #google-signin-btn-container {
    width: 100% !important;
    max-width: 100%;
  }
  
  .landing-hero h1 {
    font-size: 2.25rem !important;
  }
  
  .hero-subtitle {
    margin: 0 auto !important;
  }
  
  .landing-stats {
    justify-content: center !important;
    flex-wrap: wrap !important;
    gap: 1rem !important;
  }
  
  .auth-card-wrapper {
    width: 100%;
    max-width: 420px;
    margin: 0 auto !important;
  }
  
  .auth-card {
    padding: 1.5rem !important;
    position: relative;
  }

  /* Mobile home: marketing content first — auth opens as a sheet */
  body.view-landing-active:not(.mobile-auth-open) #public-page-home .auth-card-wrapper {
    display: none !important;
  }

  .mobile-auth-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 1150;
    background: rgba(8, 10, 20, 0.62);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
  }

  body.view-landing-active.mobile-auth-open .mobile-auth-backdrop {
    display: block;
  }

  body.view-landing-active.mobile-auth-open {
    overflow: hidden;
  }

  body.view-landing-active.mobile-auth-open .auth-card-wrapper {
    display: block !important;
    position: fixed;
    left: 0.75rem;
    right: 0.75rem;
    bottom: calc(56px + env(safe-area-inset-bottom, 0px) + 0.5rem);
    z-index: 1160;
    max-height: min(82dvh, 720px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 !important;
    max-width: none !important;
    width: auto !important;
    filter: drop-shadow(0 12px 40px rgba(0, 0, 0, 0.35));
    animation: mobileAuthSheetIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  }

  body.view-landing-active.mobile-auth-open .auth-card-wrapper .auth-card {
    border: 1px solid var(--border-glass);
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.28);
  }

  @keyframes mobileAuthSheetIn {
    from {
      opacity: 0;
      transform: translateY(1.25rem);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .mobile-auth-close-btn {
    display: none;
    position: absolute;
    top: 0.65rem;
    right: 0.65rem;
    z-index: 2;
    width: 2.25rem;
    height: 2.25rem;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-glass);
    border-radius: var(--radius-sm);
    background: var(--bg-surface);
    color: var(--text-muted);
    cursor: pointer;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
  }

  body.view-landing-active.mobile-auth-open .mobile-auth-close-btn {
    display: flex;
  }

  body.view-landing-active:not(.mobile-auth-open) .landing-container {
    padding-bottom: 0.5rem !important;
  }

  #public-page-home .landing-value-props,
  #public-page-home .landing-tools-section,
  #public-page-home .landing-trust,
  #public-page-home .landing-testimonials,
  #public-page-home .landing-section,
  #public-page-home .landing-final-cta {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .landing-section {
    padding: 3.5rem 1rem;
  }
  .landing-section-header h2 {
    font-size: 1.85rem;
  }
  .compliance-showcase-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .compliance-badge-card {
    position: static;
    padding: 1.5rem;
  }
  
  .calculator-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .calculator-card {
    padding: 1.5rem;
  }
  .how-it-works-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .feature-explorer-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
  .feature-explorer-preview {
    padding: 1.5rem;
  }
  .flowchart-container {
    flex-direction: column;
    gap: 1.5rem;
    margin-top: 2rem;
  }
  .flow-node {
    width: 100%;
    border-left: none;
    border-top: 4px solid var(--color-primary);
  }
  .node-local { border-top-color: var(--color-success); }
  .node-server { border-top-color: var(--color-primary); }
  .node-ai { border-top-color: #a855f7; }
  
  .flow-arrow {
    transform: rotate(90deg);
    margin: 0.5rem 0;
    width: 30px;
  }
  .arrow-text {
    transform: rotate(-90deg);
    display: none; /* Hide connector text on mobile to avoid overlapping */
  }
  .ipp-accordion {
    grid-template-columns: 1fr;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .public-footer {
    padding: 2.5rem 1rem 1.5rem;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   ADMIN PANEL STYLES
═══════════════════════════════════════════════════════════════════ */
.admin-tab {
  padding: 0.5rem 1.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
}
.admin-tab.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
}

.admin-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.admin-section-header h3 { margin: 0; font-size: 1rem; font-weight: 700; }
.admin-badge {
  display: inline-block;
  background: var(--color-primary);
  color: #fff;
  border-radius: 999px;
  padding: 0.1rem 0.55rem;
  font-size: 0.75rem;
  font-weight: 700;
  margin-left: 0.4rem;
}

.admin-search {
  padding: 0.4rem 0.75rem;
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  background: var(--bg-input);
  color: var(--text-main);
  font-size: 0.85rem;
  min-width: 200px;
}

.admin-table-wrap { overflow-x: auto; }
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}
.admin-table th {
  padding: 0.6rem 0.75rem;
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border-bottom: 2px solid var(--border-glass);
}
.admin-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-glass);
  vertical-align: middle;
}
.admin-table tbody tr:hover { background: var(--bg-card); }

.admin-pill {
  display: inline-block;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-right: 0.2rem;
  line-height: 1.6;
}
.admin-pill--admin { background: rgba(239,68,68,0.12); color: #c53030; }
.admin-pill--2fa   { background: rgba(72,187,120,0.15); color: #276749; }
.admin-pill--warn  { background: rgba(237,137,54,0.12); color: #9c4221; }
.pill-green        { background: rgba(72,187,120,0.15); color: #276749; }
.pill-grey         { background: rgba(160,174,192,0.15); color: var(--text-muted); }
.pill-blue         { background: rgba(66,153,225,0.15); color: #2b6cb0; }

.admin-muted { color: var(--text-muted); font-size: 0.8rem; }
.admin-empty { color: var(--text-muted); text-align: center; padding: 1.5rem; }
.admin-loading { color: var(--text-muted); text-align: center; padding: 2rem; }
.admin-error { color: #e53e3e; text-align: center; padding: 1.5rem; }

/* ═══════════════════════════════════════════════════════════════════
   TWO-FACTOR AUTH UI
═══════════════════════════════════════════════════════════════════ */
.twofa-status {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.875rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-glass);
}
.twofa-enabled { background: rgba(72,187,120,0.08); border-color: rgba(72,187,120,0.3); }
.twofa-disabled { background: rgba(160,174,192,0.08); }
.twofa-icon {
  font-size: 1.25rem;
  flex-shrink: 0;
  margin-top: 0.1rem;
}
.btn-danger-outline {
  background: none;
  border: 1px solid var(--color-error, #e53e3e);
  color: var(--color-error, #e53e3e);
  border-radius: var(--radius-md);
  padding: 0.45rem 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}
.btn-danger-outline:hover {
  background: rgba(239,68,68,0.08);
}

/* Worksheet Designer studio wizard */
.ws-studio-intro {
  text-align: center;
  margin: 0 0 1.5rem;
  padding: 1.25rem 1rem 0;
}
.ws-studio-intro h2 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 0 0 0.5rem;
}
.ws-studio-intro p {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.5;
}
.ws-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin-bottom: 0.5rem;
}
.ws-type-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.35rem;
  text-align: left;
  padding: 1.25rem 1.35rem;
  background: var(--bg-card);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-lg);
  cursor: pointer;
  transition: border-color 0.2s, transform 0.15s, box-shadow 0.2s;
}
.ws-type-card:hover {
  border-color: rgba(99, 102, 241, 0.45);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
}
.ws-type-icon {
  font-size: 1.75rem;
  line-height: 1;
}
.ws-type-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-main);
}
.ws-type-desc {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Online Quiz Hub — syllabus template filters */
.qh-tpl-badge {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 0.12rem 0.35rem;
  border-radius: 999px;
  line-height: 1.2;
}
.qh-tpl-badge-stage { background: rgba(168, 85, 247, 0.15); color: #c084fc; }
.qh-tpl-badge-subject { background: rgba(59, 130, 246, 0.12); color: #93c5fd; }
.qh-tpl-badge-acara { background: rgba(16, 185, 129, 0.12); color: #6ee7b7; }
.qh-tpl-badge-nesa { background: rgba(245, 158, 11, 0.12); color: #fcd34d; }
.qh-template-card:hover { border-color: rgba(168, 85, 247, 0.35); }
.ql-stat-pill {
  font-size: 0.72rem;
  background: rgba(168, 85, 247, 0.12);
  color: #c084fc;
  padding: 0.25rem 0.65rem;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}
.ql-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0.85rem;
}
.ql-card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-glass);
  border-radius: var(--radius-md);
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  min-height: 210px;
  transition: border-color 0.2s, transform 0.15s;
}
.ql-card:hover {
  border-color: rgba(168, 85, 247, 0.35);
  transform: translateY(-1px);
}
.ql-card-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}
.ql-card-title {
  margin: 0;
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.3;
}
.ql-card-count {
  font-size: 0.65rem;
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  font-weight: 700;
  white-space: nowrap;
}
.ql-card-desc {
  margin: 0;
  font-size: 0.76rem;
  color: var(--text-muted);
  line-height: 1.4;
  flex: 1;
}
.ql-card-actions {
  display: flex;
  gap: 0.45rem;
  justify-content: flex-end;
  flex-wrap: wrap;
  margin-top: auto;
}
.ql-card-actions .nav-btn,
.ql-card-actions .btn-primary {
  padding: 0.3rem 0.55rem;
  font-size: 0.72rem;
  height: auto;
  line-height: 1.2;
}
.ql-empty {
  grid-column: 1 / -1;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 2.5rem 1rem;
  background: var(--bg-card);
  border: 1px dashed var(--border-glass);
  border-radius: var(--radius-lg);
}
@media (max-width: 900px) {
  .ql-template-filters { grid-template-columns: 1fr 1fr !important; }
  .ql-template-filters #ql-clear-filters-btn { grid-column: 1 / -1; }
}

/* ==========================================================================
   MODERN UI REFRESH — Home page & Dashboard
   Appended layer: later in the cascade, so equal-specificity rules here
   override the legacy styles above. Scoped to landing + hub components.
   ========================================================================== */

:root {
  --gradient-brand: linear-gradient(135deg, #6366f1 0%, #8b5cf6 55%, #d946ef 100%);
  --gradient-brand-soft: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(217, 70, 239, 0.06));
  --ring-primary: 0 0 0 3px rgba(99, 102, 241, 0.22);
}

/* --- Buttons: gradient primary, pill focus ring ------------------------- */

.btn-primary {
  background: linear-gradient(135deg, #6366f1 0%, #7c3aed 100%);
  box-shadow: 0 2px 10px rgba(99, 102, 241, 0.28);
}
.btn-primary:hover {
  background: linear-gradient(135deg, #4f46e5 0%, #6d28d9 100%);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}
.nav-btn:focus-visible,
.btn-primary:focus-visible,
.btn-outline:focus-visible,
.btn-submit:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* --- Public header & nav ------------------------------------------------- */

.public-header {
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
}
[data-theme="dark"] .public-header {
  background: rgba(15, 23, 42, 0.72);
}
.public-nav { gap: 0.35rem; }
.public-nav-link {
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  transition: color 0.15s ease, background-color 0.15s ease;
}
.public-nav-link:hover {
  color: var(--text-main);
  background: var(--bg-hover);
}
.public-nav-link.active {
  color: var(--color-primary);
  background: var(--color-primary-light);
}
#public-login-cta {
  margin-left: 0.5rem;
  padding: 0.45rem 1.1rem;
  font-size: 0.82rem;
  font-weight: 600;
  border-radius: 999px;
  min-height: auto;
}
#public-register-cta {
  padding: 0.5rem 1.25rem;
  font-size: 0.82rem;
  font-weight: 700;
  border-radius: 999px;
  border: none;
  color: #fff;
  min-height: auto;
}

/* --- Hero ----------------------------------------------------------------- */

.landing-hero h1 {
  font-size: clamp(2.75rem, 5.5vw, 4.3rem);
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.gradient-text {
  background: linear-gradient(90deg, #6366f1, #a855f7, #d946ef, #8b5cf6, #6366f1);
  background-size: 300% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: brandGradientPan 9s ease-in-out infinite;
}
@keyframes brandGradientPan {
  0%   { background-position: 0% 50%; }
  50%  { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-subtitle {
  font-size: 1.15rem;
  line-height: 1.75;
}

.landing-hero-ctas { gap: 0.85rem; }
.landing-hero-ctas .nav-btn {
  padding: 0.85rem 1.75rem;
  font-size: 0.95rem;
  border-radius: 999px;
}
.landing-hero-ctas .btn-outline {
  border: 1px solid var(--border-main);
  background: var(--bg-card);
}

/* Soft entrance for hero + auth card */
@keyframes heroFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.landing-hero > * { animation: heroFadeUp 0.55s cubic-bezier(0.16, 1, 0.3, 1) backwards; }
.landing-hero > *:nth-child(1) { animation-delay: 0.05s; }
.landing-hero > *:nth-child(2) { animation-delay: 0.12s; }
.landing-hero > *:nth-child(3) { animation-delay: 0.19s; }
.landing-hero > *:nth-child(4) { animation-delay: 0.26s; }
.landing-hero > *:nth-child(5) { animation-delay: 0.33s; }
.auth-card { animation: heroFadeUp 0.6s 0.25s cubic-bezier(0.16, 1, 0.3, 1) backwards; }

/* Stats strip — cleaner glass card, gradient figures */
.landing-stats {
  justify-content: space-between;
  gap: 1.25rem 2rem;
  padding: 1.4rem 2rem;
  border-radius: 22px;
}
.landing-stat-number {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: none;
}
[data-theme="dark"] .landing-stat-number { text-shadow: none; }

/* --- Value propositions --------------------------------------------------- */

.landing-value-props { gap: 1.15rem; }
.landing-value-prop {
  padding: 1.5rem 1.45rem;
  border-radius: 18px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.landing-value-prop:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.35);
  box-shadow: 0 12px 28px rgba(79, 70, 229, 0.1);
}
.landing-value-icon {
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 12px;
  background: var(--gradient-brand-soft);
  border: 1px solid rgba(99, 102, 241, 0.18);
  font-size: 1.15rem;
  margin-bottom: 0.85rem;
}

/* --- Workflow lanes (landing) — colour-coded like the dashboard ---------- */

.landing-workflow-lane {
  background: var(--bg-card);
  border-radius: 18px;
  padding: 1.35rem 1.25rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.landing-workflow-lane:hover { box-shadow: var(--shadow-md); }
.landing-workflow-lane::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.landing-workflow-lane:nth-child(1)::before { background: linear-gradient(90deg, #6366f1, rgba(99, 102, 241, 0.15)); }
.landing-workflow-lane:nth-child(2)::before { background: linear-gradient(90deg, #10b981, rgba(16, 185, 129, 0.15)); }
.landing-workflow-lane:nth-child(3)::before { background: linear-gradient(90deg, #f59e0b, rgba(245, 158, 11, 0.15)); }
.landing-workflow-lane:nth-child(4)::before { background: linear-gradient(90deg, #06b6d4, rgba(6, 182, 212, 0.15)); }

.landing-lane-badge {
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  margin-bottom: 0.55rem;
}
.landing-workflow-lane:nth-child(1) .landing-lane-badge { color: #6366f1; background: rgba(99, 102, 241, 0.1); }
.landing-workflow-lane:nth-child(2) .landing-lane-badge { color: #10b981; background: rgba(16, 185, 129, 0.1); }
.landing-workflow-lane:nth-child(3) .landing-lane-badge { color: #d97706; background: rgba(245, 158, 11, 0.12); }
.landing-workflow-lane:nth-child(4) .landing-lane-badge { color: #0891b2; background: rgba(6, 182, 212, 0.1); }

.landing-tool-card { border-radius: 14px; }
.landing-tools-heading { font-size: clamp(1.6rem, 3vw, 2.1rem); letter-spacing: -0.02em; }

/* --- Trust strip → pill badges -------------------------------------------- */

.landing-trust { gap: 0.6rem; padding: 1.5rem; }
.landing-trust-dot { display: none; }
.landing-trust-item {
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  box-shadow: var(--shadow-sm);
  color: var(--text-secondary);
}

/* --- Testimonials ---------------------------------------------------------- */

.testimonial-card {
  position: relative;
  border-radius: 18px;
  padding: 1.6rem 1.5rem 1.4rem;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.testimonial-card:hover {
  transform: translateY(-3px);
  border-color: rgba(99, 102, 241, 0.3);
  box-shadow: var(--shadow-md);
}
.testimonial-card > p::before {
  content: '\201C';
  display: block;
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 2.6rem;
  line-height: 0.6;
  margin-bottom: 0.55rem;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.testimonial-card footer {
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-main);
}

/* --- How it works ----------------------------------------------------------- */

.how-step {
  border-radius: 18px;
  padding: 2.1rem 1.75rem 1.7rem;
}
.step-badge {
  width: 36px;
  height: 36px;
  top: -18px;
  background: var(--gradient-brand);
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.35);
}

/* --- Final CTA → rounded gradient panel ------------------------------------ */

.landing-final-cta {
  max-width: 1080px;
  margin: 2.5rem auto 4rem;
  padding: 4rem 2rem;
  border-radius: 28px;
  border: 1px solid rgba(99, 102, 241, 0.25);
  background:
    radial-gradient(ellipse at 50% -20%, rgba(139, 92, 246, 0.18) 0%, transparent 60%),
    linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(217, 70, 239, 0.07) 100%);
  position: relative;
  overflow: hidden;
}
.landing-final-cta-actions .nav-btn { border-radius: 999px; }

/* --- Auth card --------------------------------------------------------------- */

.auth-card { border-radius: 24px; }
.auth-toggle {
  background: var(--bg-surface);
  border: 1px solid var(--border-main);
  border-bottom: 1px solid var(--border-main);
  border-radius: 12px;
  padding: 4px;
  gap: 2px;
}
.auth-tab {
  border-radius: 9px;
  padding: 0.5rem 0.4rem;
  font-size: 0.875rem;
}
.auth-tab.active {
  border-bottom: none;
  background: var(--bg-card);
  color: var(--color-primary);
  box-shadow: var(--shadow-sm);
}
.auth-oauth-btn { border-radius: 10px; }
.btn-submit { border-radius: 10px; }

/* ==========================================================================
   DASHBOARD (Desktop hub)
   ========================================================================== */

/* Header: left-aligned greeting with actions pinned top-right */
.hub-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  text-align: left;
  gap: 0.2rem 1rem;
  margin-bottom: 1.5rem;
}
.hub-header h2 {
  grid-column: 1;
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}
.hub-header p {
  grid-column: 1;
  font-size: 0.95rem;
}
#hub-teacher-name {
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hub-quick-stats {
  grid-column: 1;
  justify-content: flex-start;
  margin: 0.75rem 0 0;
  max-width: none;
}
.hub-week-digest {
  grid-column: 1;
  margin: 0.6rem 0 0;
  text-align: left;
}
.hub-header-actions {
  grid-column: 2;
  grid-row: 1 / span 2;
  justify-content: flex-end;
  margin-top: 0.35rem;
}
@media (max-width: 720px) {
  .hub-header { grid-template-columns: 1fr; }
  .hub-header-actions {
    grid-column: 1;
    grid-row: auto;
    justify-content: flex-start;
    margin-top: 0.75rem;
  }
}

.hub-quick-stat {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.75rem;
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  box-shadow: var(--shadow-sm);
}
.hub-quick-stat::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #6366f1;
  flex-shrink: 0;
}
.hub-quick-stat:nth-child(2)::before { background: #10b981; }
.hub-quick-stat:nth-child(3)::before { background: #f59e0b; }
.hub-quick-stat:nth-child(4)::before { background: #06b6d4; }
.hub-quick-stat:nth-child(5)::before { background: #ec4899; }

.hub-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  font-size: 0.8rem;
  font-weight: 600;
  background: var(--bg-card);
  border: 1px solid var(--border-main);
  box-shadow: var(--shadow-sm);
}
.hub-header-btn:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  box-shadow: var(--shadow-md);
}

/* Workflow hint → clean centred segmented pill */
.hub-workflow-hint {
  width: fit-content;
  max-width: 100%;
  margin: 0 auto 0.25rem;
  padding: 0.45rem 0.9rem;
  border: 1px solid var(--border-main);
  border-radius: 999px;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.hub-workflow-step { border: none; }
.hub-workflow-step:nth-child(1) { color: #6366f1; background: rgba(99, 102, 241, 0.1); }
.hub-workflow-step:nth-child(3) { color: #10b981; background: rgba(16, 185, 129, 0.1); }
.hub-workflow-step:nth-child(5) { color: #d97706; background: rgba(245, 158, 11, 0.12); }
.hub-workflow-step:nth-child(7) { color: #0891b2; background: rgba(6, 182, 212, 0.1); }

/* Zones: gradient accent bar + tinted step chip */
.hub-zone {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 1.35rem 1.25rem 1.35rem;
  transition: box-shadow 0.25s ease;
}
.hub-zone:hover { box-shadow: var(--shadow-md); }
.hub-zone[data-zone="classroom"],
.hub-zone[data-zone="plan"],
.hub-zone[data-zone="assess"],
.hub-zone[data-zone="connect"] {
  border-top: 1px solid var(--border-glass);
}
.hub-zone::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.hub-zone[data-zone="classroom"]::before { background: linear-gradient(90deg, #6366f1, rgba(99, 102, 241, 0.1)); }
.hub-zone[data-zone="plan"]::before      { background: linear-gradient(90deg, #10b981, rgba(16, 185, 129, 0.1)); }
.hub-zone[data-zone="assess"]::before    { background: linear-gradient(90deg, #f59e0b, rgba(245, 158, 11, 0.1)); }
.hub-zone[data-zone="connect"]::before   { background: linear-gradient(90deg, #06b6d4, rgba(6, 182, 212, 0.1)); }

.hub-zone-step {
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  margin-bottom: 0.2rem;
}
.hub-zone[data-zone="classroom"] .hub-zone-step { color: #6366f1; background: rgba(99, 102, 241, 0.1); }
.hub-zone[data-zone="plan"] .hub-zone-step      { color: #10b981; background: rgba(16, 185, 129, 0.1); }
.hub-zone[data-zone="assess"] .hub-zone-step    { color: #d97706; background: rgba(245, 158, 11, 0.12); }
.hub-zone[data-zone="connect"] .hub-zone-step   { color: #0891b2; background: rgba(6, 182, 212, 0.1); }

/* Tool cards: roomier icon tile, sliding arrow affordance */
.hub-card {
  border-radius: 16px;
  align-items: flex-start;
}
.hub-card-icon {
  width: 46px;
  height: 46px;
  min-width: 46px;
  flex: 0 0 46px;
  border-radius: 13px;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.hub-card:hover .hub-card-icon { transform: scale(1.08); }
.hub-card-content { gap: 0.25rem; }
.hub-card-content h3 { font-size: 0.98rem; }
.hub-card-action {
  margin-top: 0.35rem;
  transition: transform 0.2s ease;
}
.hub-card:hover .hub-card-action { transform: translateX(3px); }

/* Starter checklist: gradient welcome panel */
.starter-checklist {
  border-radius: 20px;
  border: 1px solid rgba(99, 102, 241, 0.3);
  background:
    radial-gradient(ellipse at 0% 0%, rgba(99, 102, 241, 0.1) 0%, transparent 55%),
    var(--bg-card);
  padding: 1.25rem 1.4rem;
}
.starter-checklist-step { border-radius: 14px; }

/* Recently used strip */
.recently-used-strip {
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}
.recently-used-btn { padding: 0.35rem 0.85rem; }

/* Recent work card */
.recent-activity-card {
  border-radius: 20px;
  padding: 1.4rem 1.5rem;
}
.recent-asset-item {
  border-radius: 12px;
  transition: border-color 0.2s ease, background-color 0.2s ease, transform 0.2s ease;
}
.recent-asset-item:hover { transform: translateX(3px); }

/* Dark mode: brighten accent chip text for contrast on slate */
[data-theme="dark"] .hub-workflow-step:nth-child(1),
[data-theme="dark"] .hub-zone[data-zone="classroom"] .hub-zone-step,
[data-theme="dark"] .landing-workflow-lane:nth-child(1) .landing-lane-badge { color: #818cf8; }
[data-theme="dark"] .hub-workflow-step:nth-child(3),
[data-theme="dark"] .hub-zone[data-zone="plan"] .hub-zone-step,
[data-theme="dark"] .landing-workflow-lane:nth-child(2) .landing-lane-badge { color: #34d399; }
[data-theme="dark"] .hub-workflow-step:nth-child(5),
[data-theme="dark"] .hub-zone[data-zone="assess"] .hub-zone-step,
[data-theme="dark"] .landing-workflow-lane:nth-child(3) .landing-lane-badge { color: #fbbf24; }
[data-theme="dark"] .hub-workflow-step:nth-child(7),
[data-theme="dark"] .hub-zone[data-zone="connect"] .hub-zone-step,
[data-theme="dark"] .landing-workflow-lane:nth-child(4) .landing-lane-badge { color: #22d3ee; }

/* --- Reduced motion -------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .gradient-text { animation: none; }
  .landing-hero > *,
  .auth-card { animation: none; }
  .hub-card:hover,
  .hub-card:hover .hub-card-icon,
  .hub-card:hover .hub-card-action,
  .landing-value-prop:hover,
  .testimonial-card:hover,
  .recent-asset-item:hover { transform: none; }
}

/* --- Small screens --------------------------------------------------------- */

@media (max-width: 640px) {
  .landing-hero-ctas .nav-btn {
    width: 100%;
    justify-content: center;
  }
  .landing-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem 0.75rem;
  }
  .landing-stat-divider { display: none; }
  .landing-final-cta {
    margin: 1.5rem 1rem 3rem;
    padding: 3rem 1.25rem;
    border-radius: 22px;
  }
}

/* ==========================================================================
   REDESIGN V2 — bold landing page restyle
   Display typography, floating navbar, aurora hero, gradient-border auth
   card, bento value grid, dark tools showcase band, gradient CTA panel.
   ========================================================================== */

/* Display typeface for marketing + hub headlines */
.landing-hero h1,
.landing-section-header h2,
.landing-tools-heading,
.landing-final-cta h2,
.landing-spread-copy h2,
.hub-header h2 {
  font-family: 'Space Grotesk', var(--font-sans);
  letter-spacing: -0.035em;
}

/* Floating island navbar (desktop only — mobile uses the bottom nav) */
@media (min-width: 769px) {
  .public-header {
    position: sticky;
    top: 0.9rem;
    z-index: 950;
    max-width: 1200px;
    width: calc(100% - 2.5rem);
    margin: 0.9rem auto 0;
    padding: 0.55rem 0.75rem 0.55rem 1.35rem;
    border: 1px solid var(--border-main);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.72);
    box-shadow: 0 10px 36px rgba(2, 6, 23, 0.1);
  }
  [data-theme="dark"] .public-header {
    background: rgba(15, 23, 42, 0.72);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 36px rgba(0, 0, 0, 0.45);
  }
}

/* Aurora backdrop behind the whole landing view */
#view-landing {
  background:
    radial-gradient(60rem 32rem at 85% -8%, rgba(124, 58, 237, 0.13), transparent 62%),
    radial-gradient(48rem 30rem at -8% 22%, rgba(6, 182, 212, 0.1), transparent 62%),
    radial-gradient(55rem 36rem at 50% 108%, rgba(217, 70, 239, 0.07), transparent 62%);
}
[data-theme="dark"] #view-landing {
  background:
    radial-gradient(60rem 32rem at 85% -8%, rgba(124, 58, 237, 0.22), transparent 62%),
    radial-gradient(48rem 30rem at -8% 22%, rgba(6, 182, 212, 0.13), transparent 62%),
    radial-gradient(55rem 36rem at 50% 108%, rgba(217, 70, 239, 0.12), transparent 62%);
}

/* Hero: bigger type, gradient-border eyebrow badge */
.landing-container { padding-top: 4.25rem; }
.landing-hero h1 {
  font-size: clamp(2.9rem, 6vw, 4.6rem);
  line-height: 1.02;
}
.landing-hero .badge-tag {
  border: 1px solid transparent;
  background:
    linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
    var(--gradient-brand) border-box;
  color: var(--color-primary);
}
[data-theme="dark"] .landing-hero .badge-tag { color: #a5b4fc; }
.landing-stat-number { font-size: 2.1rem; }

/* Hide the mobile sheet close button outside the mobile auth sheet
   (it had no desktop rule, so it rendered inside the card) */
.mobile-auth-close-btn { display: none; }

/* Stats: clean 2x2 grid inside the hero column */
.landing-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.5rem 1rem;
}
.landing-stat-divider { display: none; }

/* Auth card: gradient border ring + ambient glow */
.auth-card { position: relative; }
.auth-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: var(--gradient-brand);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask-composite: exclude;
  opacity: 0.55;
  pointer-events: none;
}
.auth-card {
  box-shadow:
    0 24px 70px rgba(99, 102, 241, 0.18),
    0 6px 22px rgba(2, 6, 23, 0.08);
}
[data-theme="dark"] .auth-card {
  box-shadow:
    0 24px 70px rgba(124, 58, 237, 0.25),
    0 6px 22px rgba(0, 0, 0, 0.4);
}

/* Value props → bento grid on desktop */
@media (min-width: 900px) {
  .landing-value-props { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .landing-value-prop:nth-child(1),
  .landing-value-prop:nth-child(4) { grid-column: span 2; }
  .landing-value-prop:nth-child(1) h3,
  .landing-value-prop:nth-child(4) h3 { font-size: 1.2rem; }
  .landing-value-prop:nth-child(1) p,
  .landing-value-prop:nth-child(4) p { max-width: 38rem; }
}
.landing-value-prop {
  padding: 1.85rem 1.75rem;
  border-radius: 22px;
}
.landing-value-prop:nth-child(1) {
  background: linear-gradient(135deg, rgba(99, 102, 241, 0.09), transparent 55%), var(--bg-card);
}
.landing-value-prop:nth-child(4) {
  background: linear-gradient(315deg, rgba(217, 70, 239, 0.08), transparent 55%), var(--bg-card);
}
.landing-value-prop h3 { font-size: 1.05rem; }

/* Tools workflow → dark showcase band (both themes) */
.landing-tools-section {
  max-width: 1240px;
  margin: 3rem auto 3.5rem;
  padding: 3.5rem 1.5rem 3rem;
  border-radius: 32px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background:
    radial-gradient(52rem 28rem at 82% -12%, rgba(124, 58, 237, 0.3), transparent 62%),
    radial-gradient(42rem 26rem at 4% 112%, rgba(6, 182, 212, 0.18), transparent 62%),
    #0b1120;
  overflow: hidden;
}
.landing-tools-section .landing-tools-heading { color: #f8fafc; }
.landing-tools-section .landing-tools-subtitle { color: #94a3b8; }
.landing-tools-section .landing-workflow-lane {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.09);
}
.landing-tools-section .landing-workflow-lane:hover {
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.35);
}
.landing-tools-section .landing-workflow-lane h3 { color: #f1f5f9; }
.landing-tools-section .landing-tool-card {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}
.landing-tools-section .landing-tool-card:hover {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(139, 92, 246, 0.55);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
}
.landing-tools-section .landing-workflow-lane .landing-tool-card h4 { color: #e2e8f0; }
.landing-tools-section .landing-workflow-lane .landing-tool-card p { color: #94a3b8; }
.landing-tools-section .landing-workflow-lane:nth-child(1) .landing-lane-badge { color: #a5b4fc; background: rgba(129, 140, 248, 0.16); }
.landing-tools-section .landing-workflow-lane:nth-child(2) .landing-lane-badge { color: #6ee7b7; background: rgba(52, 211, 153, 0.14); }
.landing-tools-section .landing-workflow-lane:nth-child(3) .landing-lane-badge { color: #fcd34d; background: rgba(251, 191, 36, 0.14); }
.landing-tools-section .landing-workflow-lane:nth-child(4) .landing-lane-badge { color: #67e8f9; background: rgba(34, 211, 238, 0.14); }
@media (max-width: 768px) {
  .landing-tools-section {
    margin: 1.75rem 0.75rem 2.25rem;
    padding: 2.25rem 0.85rem 2rem;
    border-radius: 22px;
  }
}

/* How it works: bigger badges, softer cards */
.how-step {
  border-radius: 22px;
  padding: 2.4rem 1.9rem 1.9rem;
}
.step-badge {
  width: 42px;
  height: 42px;
  top: -21px;
  font-size: 1rem;
}

/* Final CTA → deep gradient panel with white actions */
.landing-final-cta {
  border: none;
  color: #fff;
  background:
    radial-gradient(42rem 24rem at 50% -35%, rgba(217, 70, 239, 0.4), transparent 62%),
    linear-gradient(135deg, #312e81 0%, #5b21b6 55%, #86198f 100%);
  box-shadow: 0 24px 70px rgba(91, 33, 182, 0.3);
}
.landing-final-cta h2 { color: #fff; }
.landing-final-cta p { color: rgba(255, 255, 255, 0.78); }
.landing-final-cta .badge-tag {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
}
.landing-final-cta .btn-primary {
  background: #fff;
  color: #1e1b4b;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}
.landing-final-cta .btn-primary:hover {
  background: #eef2ff;
  transform: translateY(-1px);
}
.landing-final-cta .btn-outline {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff;
}
.landing-final-cta .btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
  color: #fff;
}

/* Scroll-reveal (progressive enhancement, motion-safe) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .landing-value-prop,
    .landing-workflow-lane,
    .testimonial-card,
    .how-step {
      animation: heroFadeUp 0.6s ease both;
      animation-timeline: view();
      animation-range: entry 5% entry 35%;
    }
  }
}

