/* ═══════════════════════════════════════════════════════════════
   LINEAR DESIGN SYSTEM - Dark Cinematic Theme
   Replaces DaisyUI + old "Trailhead" theme.
   All DaisyUI class names are preserved for template compatibility.
   ═══════════════════════════════════════════════════════════════ */

/* ────────────────────────────────────
   1. DESIGN TOKENS (CSS Custom Properties)
   RGB channels for Tailwind opacity modifier support
   ──────────────────────────────────── */
:root {
  /* Surface hierarchy - near-black to charcoal */
  --color-base-100: 10 10 12;      /* #0A0A0C - primary surface */
  --color-base-200: 5 5 6;         /* #050506 - page background */
  --color-base-300: 24 24 30;      /* #18181E - elevated surface / borders */
  --color-base-content: 237 237 242; /* #EDEDF2 - primary text */

  /* Brand - Indigo accent */
  --color-primary: 99 102 241;     /* #6366F1 - indigo-500 */
  --color-primary-content: 255 255 255;
  --color-secondary: 139 92 246;   /* #8B5CF6 - violet-500 */
  --color-secondary-content: 255 255 255;
  --color-accent: 6 182 212;       /* #06B6D4 - cyan-500 */
  --color-accent-content: 255 255 255;

  /* Neutral */
  --color-neutral: 15 15 18;       /* #0F0F12 */
  --color-neutral-content: 163 163 178; /* #A3A3B2 */

  /* Semantic */
  --color-success: 34 197 94;      /* #22C55E - green-500 */
  --color-success-content: 255 255 255;
  --color-warning: 234 179 8;      /* #EAB308 - yellow-500 */
  --color-warning-content: 0 0 0;
  --color-error: 239 68 68;        /* #EF4444 - red-500 */
  --color-error-content: 255 255 255;
  --color-info: 59 130 246;        /* #3B82F6 - blue-500 */
  --color-info-content: 255 255 255;

  /* Shadows - cool-toned for dark theme */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3), 0 1px 3px rgba(0, 0, 0, 0.15);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 8px 10px -6px rgba(0, 0, 0, 0.3);
  --shadow-xl: 0 20px 40px -10px rgba(0, 0, 0, 0.6), 0 12px 20px -4px rgba(0, 0, 0, 0.3);
  --shadow-glow: 0 0 20px rgba(99, 102, 241, 0.15);

  /* Easing */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Radii */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
  --radius-full: 9999px;

  /* Glass */
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.06);
  --glass-hover: rgba(255, 255, 255, 0.05);

  /* Ambient */
  --ambient-primary: rgba(99, 102, 241, 0.08);
  --ambient-secondary: rgba(139, 92, 246, 0.06);
  --ambient-accent: rgba(6, 182, 212, 0.06);
}

/* ========== LIGHT MODE (Flat Design) ========== */
html.light {
  /* --- Color tokens (Flat Design palette) --- */
  --color-base-100: 255 255 255;        /* #FFFFFF - canvas */
  --color-base-200: 248 249 250;        /* #F8F9FA - subtle bg */
  --color-base-300: 241 243 245;        /* #F1F3F5 - borders/dividers */
  --color-base-content: 33 37 41;       /* #212529 - body text */
  --color-primary: 99 102 241;          /* #6366F1 - indigo-500 (keep accent consistent) */
  --color-primary-content: 255 255 255; /* white on primary */
  --color-secondary: 168 85 247;        /* #A855F7 - purple-500 */
  --color-secondary-content: 255 255 255;
  --color-accent: 20 184 166;           /* #14B8A6 - teal-500 */
  --color-accent-content: 255 255 255;
  --color-neutral: 107 114 128;         /* #6B7280 - gray-500 */
  --color-neutral-content: 255 255 255;
  --color-success: 34 197 94;           /* #22C55E */
  --color-success-content: 255 255 255;
  --color-warning: 245 158 11;          /* #F59E0B */
  --color-warning-content: 255 255 255;
  --color-error: 239 68 68;             /* #EF4444 */
  --color-error-content: 255 255 255;
  --color-info: 59 130 246;             /* #3B82F6 */
  --color-info-content: 255 255 255;

  /* --- Surfaces & effects (flat = no shadows, no glass) --- */
  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --shadow-xl: none;
  --glass-bg: transparent;
  --glass-border: rgba(0, 0, 0, 0.06);
  --glass-shadow: none;

  /* --- Ambient effects off --- */
  --ambient-opacity: 0;
  --grid-opacity: 0;
  --spotlight-opacity: 0;

  color-scheme: light;
}

/* Light mode component overrides */
html.light body {
  background: rgb(var(--color-base-200));
  color: rgb(var(--color-base-content));
}

html.light .card,
html.light .card-trail {
  background: rgb(var(--color-base-100));
  border: 1px solid rgb(var(--color-base-300));
  box-shadow: none;
  border-radius: var(--radius-xl);
}
html.light .card:hover,
html.light .card-trail:hover {
  box-shadow: none;
  transform: scale(1.02);
  transition: transform 0.2s ease;
}

html.light .btn {
  box-shadow: none;
}
html.light .btn-primary {
  background: rgb(var(--color-primary));
  color: white;
  border: none;
}
html.light .btn-primary:hover {
  filter: brightness(1.1);
}
html.light .btn-ghost {
  color: rgb(var(--color-base-content));
  background: transparent;
}
html.light .btn-ghost:hover {
  background: rgb(var(--color-base-300));
}

html.light .input,
html.light .select,
html.light .textarea {
  background: rgb(var(--color-base-100));
  border-color: rgb(var(--color-base-300));
  color: rgb(var(--color-base-content));
}
html.light .input:focus,
html.light .select:focus,
html.light .textarea:focus {
  border-color: rgb(var(--color-primary));
  box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.15);
}

html.light .navbar {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgb(var(--color-base-300));
  box-shadow: none;
}

html.light .badge {
  box-shadow: none;
}

html.light .modal-box {
  background: rgb(var(--color-base-100));
  border: 1px solid rgb(var(--color-base-300));
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
}

html.light .drawer-side {
  background: rgb(var(--color-base-100));
  border-right: 1px solid rgb(var(--color-base-300));
}

html.light .table th {
  background: rgb(var(--color-base-200));
  color: rgb(var(--color-base-content) / 0.6);
}

html.light .divider::before,
html.light .divider::after {
  background: rgb(var(--color-base-300));
}

html.light .alert {
  border: 1px solid currentColor;
  box-shadow: none;
}

/* Hide ambient effects in light mode */
html.light .ambient-blob,
html.light .grid-overlay,
html.light .spotlight {
  display: none;
}

/* Light mode gradients - flat pastel versions */
html.light .gradient-warm {
  background: linear-gradient(135deg, #6366F1, #8B5CF6);
}
html.light .gradient-cool {
  background: linear-gradient(135deg, #06B6D4, #3B82F6);
}
html.light .gradient-cta {
  background: rgb(var(--color-base-100));
}

/* Light mode gradient text - higher contrast */
html.light .text-gradient-trail {
  background: linear-gradient(135deg, #4F46E5 0%, #0891B2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Light heading font */
html.light h1, html.light h2, html.light h3,
html.light h4, html.light h5, html.light h6,
html.light .card-title {
  font-family: "Outfit", system-ui, sans-serif;
}

/* Light menu active states */
html.light .menu li > a:hover,
html.light .menu li > a.active {
  background: rgb(var(--color-base-200));
  color: rgb(var(--color-primary));
}

/* Light dropdown */
html.light .dropdown-content {
  background: rgb(var(--color-base-100));
  border: 1px solid rgb(var(--color-base-300));
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Light tabs */
html.light .tab {
  color: rgb(var(--color-base-content) / 0.5);
  border-bottom-color: transparent;
}
html.light .tab-active, html.light .tab:hover {
  color: rgb(var(--color-primary));
}

/* Light mode readability guardrails.
   Keep low-emphasis text on white surfaces above WCAG AA contrast. */
html.light .text-base-content\/30,
html.light .text-base-content\/35,
html.light .text-base-content\/40 {
  color: rgb(var(--color-base-content) / 0.64);
}

html.light .text-base-content\/45,
html.light .text-base-content\/50,
html.light .text-base-content\/55 {
  color: rgb(var(--color-base-content) / 0.68);
}

html.light .label-text-alt {
  color: rgb(var(--color-base-content) / 0.68);
}

/* Light toggle/checkbox */
html.light .toggle:checked {
  background: rgb(var(--color-primary));
  border-color: rgb(var(--color-primary));
}

/* Light collapse */
html.light .collapse {
  background: rgb(var(--color-base-100));
  border: 1px solid rgb(var(--color-base-300));
}

/* Light steps */
html.light .step-primary + .step-primary::before,
html.light .step-primary::after {
  background: rgb(var(--color-primary));
  color: white;
}

/* Film grain off in light mode */
html.light .grain { display: none; }


/* ────────────────────────────────────
   2. BASE STYLES
   Unlayered so they interact correctly with Tailwind's unlayered output.
   ──────────────────────────────────── */
*, *::before, *::after {
    box-sizing: border-box;
  }

  html {
    scroll-behavior: smooth;
    color-scheme: dark;
  }

  body {
    background-color: rgb(var(--color-base-200));
    color: rgb(var(--color-base-content));
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  h1, h2, h3, h4, h5, h6 {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    color: rgb(var(--color-base-content));
  }
  h1 { letter-spacing: -0.03em; }
  h2 { letter-spacing: -0.02em; }
  h3 { letter-spacing: -0.015em; }

  a { color: inherit; }
  a:not(.btn):hover { color: rgb(var(--color-primary)); }

  ::selection {
    background: rgb(var(--color-primary) / 0.3);
    color: rgb(var(--color-base-content));
  }

  /* Scrollbar - dark themed */
  ::-webkit-scrollbar { width: 8px; height: 8px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb {
    background: rgb(var(--color-base-300));
    border-radius: var(--radius-full);
  }
  ::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, 0.15); }


/* ────────────────────────────────────
   3. COMPONENT STYLES
   All DaisyUI replacement classes.
   Unlayered so they interact correctly with Tailwind's unlayered output.
   ──────────────────────────────────── */

  /* ===== BUTTONS ===== */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.25rem;
    border-radius: var(--radius-lg);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s var(--ease-out-expo);
    user-select: none;
    white-space: nowrap;
    text-decoration: none;
    background: rgb(var(--color-base-300));
    color: rgb(var(--color-base-content));
  }
  .btn:hover {
    background: rgba(255, 255, 255, 0.1);
  }
  .btn:active {
    transform: scale(0.98);
  }
  .btn:focus-visible {
    outline: 2px solid rgb(var(--color-primary));
    outline-offset: 2px;
  }
  .btn:disabled, .btn[disabled] {
    opacity: 0.4;
    pointer-events: none;
  }

  .btn-primary {
    background: rgb(var(--color-primary));
    color: rgb(var(--color-primary-content));
    border-color: transparent;
    box-shadow: 0 0 20px rgba(99, 102, 241, 0.2);
  }
  .btn-primary:hover {
    background: rgb(79 82 221);
    box-shadow: 0 0 30px rgba(99, 102, 241, 0.35);
  }

  .btn-secondary {
    background: rgb(var(--color-secondary));
    color: rgb(var(--color-secondary-content));
  }
  .btn-secondary:hover {
    background: rgb(119 72 226);
  }

  .btn-success {
    background: rgb(var(--color-success));
    color: rgb(var(--color-success-content));
  }
  .btn-success:hover { background: rgb(22 163 74); }

  .btn-warning {
    background: rgb(var(--color-warning));
    color: rgb(var(--color-warning-content));
  }
  .btn-warning:hover { background: rgb(202 138 4); }

  .btn-error {
    background: rgb(var(--color-error));
    color: rgb(var(--color-error-content));
  }
  .btn-error:hover { background: rgb(220 38 38); }

  .btn-info {
    background: rgb(var(--color-info));
    color: rgb(var(--color-info-content));
  }
  .btn-info:hover { background: rgb(37 99 235); }

  .btn-ghost {
    background: transparent;
    border-color: transparent;
    color: rgb(var(--color-base-content) / 0.7);
  }
  .btn-ghost:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgb(var(--color-base-content));
  }

  .btn-outline {
    background: transparent;
    border: 1px solid rgb(var(--color-base-300));
    color: rgb(var(--color-base-content) / 0.8);
  }
  .btn-outline:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgb(var(--color-primary) / 0.5);
    color: rgb(var(--color-base-content));
  }

  .btn-block { width: 100%; }
  .btn-circle {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
    border-radius: var(--radius-full);
  }
  .btn-square {
    width: 2.5rem;
    height: 2.5rem;
    padding: 0;
  }
  .btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    line-height: 1rem;
    gap: 0.25rem;
  }
  .btn-sm {
    padding: 0.375rem 0.875rem;
    font-size: 0.8125rem;
    line-height: 1.125rem;
    gap: 0.375rem;
  }
  .btn-lg {
    padding: 0.875rem 1.75rem;
    font-size: 1rem;
    line-height: 1.5rem;
    gap: 0.625rem;
  }
  .btn-circle.btn-xs,
  .btn-circle.btn-sm,
  .btn-circle.btn-lg {
    padding: 0;
  }
  .btn-lg.btn-circle {
    width: 3.5rem;
    height: 3.5rem;
  }


  /* ===== CARDS ===== */
  .card {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: none;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.06),
      0 2px 20px rgba(0, 0, 0, 0.4),
      0 0 40px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .card:hover {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.1),
      0 8px 40px rgba(0, 0, 0, 0.5),
      0 0 80px rgba(var(--color-primary), 0.1);
  }
  .card-body {
    padding: 1.5rem;
  }
  .card-title {
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    font-weight: 700;
    font-size: 1.125rem;
    color: rgb(var(--color-base-content));
    display: flex;
    align-items: center;
    gap: 0.5rem;
  }
  .card-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
  }
  .card-compact .card-body {
    padding: 1rem;
  }

  /* Custom card variants - modern-dark style */
  .card-trail {
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.02));
    border: none;
    border-radius: var(--radius-xl);
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.06),
      0 2px 20px rgba(0, 0, 0, 0.4),
      0 0 40px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  }
  .card-trail:hover {
    box-shadow:
      0 0 0 1px rgba(255, 255, 255, 0.1),
      0 8px 40px rgba(0, 0, 0, 0.5),
      0 0 80px rgba(var(--color-primary), 0.1);
  }
  /* card-accent-top kept as no-op for template compatibility */
  .card-accent-top {
    /* Removed - modern-dark cards use gradient + ring shadow instead */
  }


  /* ===== FORM CONTROLS ===== */
  .form-control {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
  }

  /* Ensure Tailwind .hidden can override .form-control display:flex.
     Without this, .form-control wins due to CSS cascade order
     (linear.css loads after tailwind.css, same specificity). */
  .form-control.hidden {
    display: none;
  }

  .label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.375rem 0;
  }
  .label-text {
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(var(--color-base-content) / 0.7);
  }
  .label-text-alt {
    font-size: 0.75rem;
    color: rgb(var(--color-base-content) / 0.5);
  }

  .input {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: rgb(var(--color-base-content));
    background: rgb(var(--color-neutral));
    border: 1px solid rgb(var(--color-base-300));
    border-radius: var(--radius-lg);
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }
  .input::placeholder {
    color: rgb(var(--color-base-content) / 0.35);
  }
  .input:focus {
    outline: none;
    border-color: rgb(var(--color-primary));
    box-shadow: 0 0 0 3px rgb(var(--color-primary) / 0.12);
  }
  .input-bordered {
    border-color: rgb(var(--color-base-300));
  }
  .input-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
  }
  .input-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
  }

  .select {
    display: block;
    width: 100%;
    padding: 0.625rem 2.5rem 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    color: rgb(var(--color-base-content));
    background: rgb(var(--color-neutral));
    border: 1px solid rgb(var(--color-base-300));
    border-radius: var(--radius-lg);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M4.646 5.646a.5.5 0 0 1 .708 0L8 8.293l2.646-2.647a.5.5 0 0 1 .708.708l-3 3a.5.5 0 0 1-.708 0l-3-3a.5.5 0 0 1 0-.708z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
  }
  .select:focus {
    outline: none;
    border-color: rgb(var(--color-primary));
    box-shadow: 0 0 0 3px rgb(var(--color-primary) / 0.12);
  }
  .select-bordered {
    border-color: rgb(var(--color-base-300));
  }
  .select-sm {
    padding: 0.375rem 2rem 0.375rem 0.625rem;
    font-size: 0.8125rem;
  }
  .select-xs {
    padding: 0.25rem 1.75rem 0.25rem 0.5rem;
    font-size: 0.75rem;
  }

  .schema-select-root {
    position: relative;
    isolation: isolate;
    z-index: 1;
  }

  .schema-native-select-shim {
    position: absolute;
    inset: 0;
    z-index: 0;
    display: block !important;
    width: 100%;
    height: 100%;
    opacity: 0;
    pointer-events: none;
  }

  .schema-select-root--open {
    z-index: 2147483000;
  }

  .schema-select-listbox {
    z-index: 2147483001;
    background: rgb(var(--color-neutral));
  }

  .textarea {
    display: block;
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: rgb(var(--color-base-content));
    background: rgb(var(--color-neutral));
    border: 1px solid rgb(var(--color-base-300));
    border-radius: var(--radius-lg);
    resize: vertical;
    min-height: 5rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
  }
  .textarea::placeholder {
    color: rgb(var(--color-base-content) / 0.35);
  }
  .textarea:focus {
    outline: none;
    border-color: rgb(var(--color-primary));
    box-shadow: 0 0 0 3px rgb(var(--color-primary) / 0.12);
  }
  .textarea-bordered {
    border-color: rgb(var(--color-base-300));
  }
  .textarea-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
    min-height: 3rem;
  }

  .toggle {
    appearance: none;
    width: 2.75rem;
    height: 1.5rem;
    border-radius: var(--radius-full);
    background: rgb(var(--color-base-300));
    position: relative;
    cursor: pointer;
    transition: background 0.2s ease;
    border: none;
    flex-shrink: 0;
  }
  .toggle::before {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: var(--radius-full);
    background: rgb(var(--color-base-content) / 0.6);
    transition: transform 0.2s var(--ease-out-expo), background 0.2s ease;
  }
  .toggle:checked {
    background: rgb(var(--color-primary));
  }
  .toggle:checked::before {
    transform: translateX(1.25rem);
    background: white;
  }
  .toggle-primary:checked {
    background: rgb(var(--color-primary));
  }
  .toggle-sm {
    width: 2rem;
    height: 1.125rem;
  }
  .toggle-sm::before {
    width: 0.875rem;
    height: 0.875rem;
  }
  .toggle-sm:checked::before {
    transform: translateX(0.875rem);
  }

  .checkbox {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid rgb(var(--color-base-content) / 0.35);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    flex-shrink: 0;
    background: transparent;
  }
  .checkbox:checked {
    background: rgb(var(--color-primary));
    border-color: rgb(var(--color-primary));
  }
  .checkbox:checked::after {
    content: '';
    position: absolute;
    left: 3.5px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
  }
  .checkbox-primary:checked { background: rgb(var(--color-primary)); border-color: rgb(var(--color-primary)); }
  .checkbox-secondary:checked { background: rgb(var(--color-secondary)); border-color: rgb(var(--color-secondary)); }
  .checkbox-warning:checked { background: rgb(var(--color-warning)); border-color: rgb(var(--color-warning)); }
  .checkbox-sm { width: 1rem; height: 1rem; }
  .checkbox-sm:checked::after { left: 2.5px; top: 0px; width: 4px; height: 7px; }
  .checkbox-xs { width: 0.75rem; height: 0.75rem; }
  .checkbox-xs:checked::after { left: 1.5px; top: -0.5px; width: 3px; height: 6px; border-width: 0 1.5px 1.5px 0; }

  .range {
    appearance: none;
    width: 100%;
    height: 0.5rem;
    background: rgb(var(--color-base-300));
    border-radius: var(--radius-full);
    outline: none;
    cursor: pointer;
  }
  .range::-webkit-slider-thumb {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border-radius: var(--radius-full);
    background: rgb(var(--color-primary));
    cursor: pointer;
    border: 2px solid rgb(var(--color-base-100));
  }


  /* ===== BADGES ===== */
  .badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
    border-radius: var(--radius-full);
    border: 1px solid transparent;
    background: rgb(var(--color-base-300));
    color: rgb(var(--color-base-content) / 0.8);
    white-space: nowrap;
  }
  .badge-primary { background: rgb(var(--color-primary) / 0.15); color: rgb(var(--color-primary)); border-color: rgb(var(--color-primary) / 0.2); }
  .badge-secondary { background: rgb(var(--color-secondary) / 0.15); color: rgb(var(--color-secondary)); border-color: rgb(var(--color-secondary) / 0.2); }
  .badge-success { background: rgb(var(--color-success) / 0.15); color: rgb(var(--color-success)); border-color: rgb(var(--color-success) / 0.2); }
  .badge-warning { background: rgb(var(--color-warning) / 0.15); color: rgb(var(--color-warning)); border-color: rgb(var(--color-warning) / 0.2); }
  .badge-error { background: rgb(var(--color-error) / 0.15); color: rgb(var(--color-error)); border-color: rgb(var(--color-error) / 0.2); }
  .badge-info { background: rgb(var(--color-info) / 0.15); color: rgb(var(--color-info)); border-color: rgb(var(--color-info) / 0.2); }
  .badge-ghost { background: transparent; color: rgb(var(--color-base-content) / 0.6); }
  .badge-outline {
    background: transparent;
    border: 1px solid rgb(var(--color-base-300));
    color: rgb(var(--color-base-content) / 0.7);
  }
  .badge-xs { padding: 0.125rem 0.375rem; font-size: 0.625rem; }
  .badge-sm { padding: 0.1875rem 0.5rem; font-size: 0.6875rem; }
  .badge-lg { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }


  /* ===== ALERTS ===== */
  .alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--glass-border);
    background: rgb(var(--color-base-100));
    color: rgb(var(--color-base-content));
    font-size: 0.875rem;
  }
  .alert.hidden { display: none; }
  .alert-success {
    background: rgb(var(--color-success) / 0.1);
    border-color: rgb(var(--color-success) / 0.2);
    color: rgb(var(--color-success));
  }
  .alert-warning {
    background: rgb(var(--color-warning) / 0.1);
    border-color: rgb(var(--color-warning) / 0.2);
    color: rgb(var(--color-warning));
  }
  .alert-error {
    background: rgb(var(--color-error) / 0.1);
    border-color: rgb(var(--color-error) / 0.2);
    color: rgb(var(--color-error));
  }
  .alert-info {
    background: rgb(var(--color-info) / 0.1);
    border-color: rgb(var(--color-info) / 0.2);
    color: rgb(var(--color-info));
  }


  /* ===== MODALS ===== */
  .modal {
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    z-index: 999;
    background: transparent;
    padding: 1rem;
    border: none;
    max-width: none;
    max-height: none;
    width: 100%;
    height: 100%;
    /* Hidden by default - <dialog> uses display:none natively */
    pointer-events: none;
    visibility: hidden;
    opacity: 0;
  }
  dialog.modal:not([open]) {
    display: none;
  }
  dialog.modal {
    background: transparent;
  }
  .modal::backdrop {
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
  }
  .modal[open],
  .modal:target,
  .modal-toggle:checked + .modal {
    display: flex;
    pointer-events: auto;
    visibility: visible;
    opacity: 1;
  }
  .modal-box {
    background: rgb(var(--color-base-100));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-2xl);
    padding: 1.5rem;
    max-width: 32rem;
    width: 100%;
    max-height: calc(100vh - 4rem);
    overflow-y: auto;
    box-shadow: var(--shadow-xl);
    position: relative;
  }
  /* Override overflow for modals containing dropdowns/autocompletes.
     The default overflow-y:auto clips absolutely-positioned children. */
  #group-locations-modal .modal-box {
    overflow-y: visible;
  }
  .modal-action {
    display: flex;
    justify-content: flex-end;
    gap: 0.5rem;
    margin-top: 1.5rem;
  }
  .modal-backdrop {
    position: fixed;
    inset: 0;
    background: transparent;
    cursor: pointer;
    z-index: -1;
  }
  .modal-backdrop button {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    border: none;
    cursor: pointer;
  }
  .modal-toggle {
    display: none;
  }


  /* ===== NAVBAR ===== */
  .navbar {
    display: flex;
    align-items: center;
    min-height: 4rem;
    width: 100%;
  }
  .navbar-start {
    display: flex;
    align-items: center;
    flex: 1;
  }
  .navbar-center {
    display: none;
    align-items: center;
    justify-content: center;
  }
  .navbar-end {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
  }
  @media (min-width: 1024px) {
    .navbar-center {
      display: flex;
    }
  }


  /* ===== MENU ===== */
  .menu {
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
    padding: 0.5rem;
    list-style: none;
  }
  .menu li { list-style: none; }
  .menu li > a,
  .menu li > button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem;
    font-size: 1rem;
    border-radius: var(--radius-lg);
    color: rgb(var(--color-base-content) / 0.7);
    transition: all 0.15s ease;
    text-decoration: none;
    cursor: pointer;
    width: 100%;
    background: transparent;
    border: none;
  }
  .menu li > a:hover,
  .menu li > button:hover {
    background: rgba(255, 255, 255, 0.06);
    color: rgb(var(--color-base-content));
  }
  .menu li > a.active,
  .menu li > a[aria-current="page"] {
    background: rgb(var(--color-primary) / 0.1);
    color: rgb(var(--color-primary));
  }
  .menu-sm li > a,
  .menu-sm li > button {
    padding: 0.375rem 0.625rem;
    font-size: 0.8125rem;
  }
  .menu-md li > a,
  .menu-md li > button {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
  }
  .menu-horizontal {
    flex-direction: row;
  }
  .menu-title {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgb(var(--color-base-content) / 0.4);
  }


  /* ===== DROPDOWN ===== */
  .dropdown {
    position: relative;
    display: inline-flex;
  }
  .dropdown-content {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 12rem;
    background: rgb(var(--color-base-100));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    opacity: 0;
    visibility: hidden;
    transform: translateY(4px);
    transition: all 0.15s var(--ease-out-expo);
  }
  .dropdown-end .dropdown-content {
    left: auto;
    right: 0;
  }
  .dropdown:focus-within > .dropdown-content,
  .dropdown:hover > .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
  /* Touch devices: use tabindex focus pattern */
  .dropdown > [tabindex]:focus ~ .dropdown-content,
  .dropdown > [tabindex]:focus + .dropdown-content {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }


  /* ===== DRAWER ===== */
  .drawer {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
    overflow: hidden;
  }
  .drawer-toggle {
    display: none;
  }
  .drawer-content {
    grid-column: 1;
    grid-row: 1;
  }
  .drawer-side {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    grid-template-columns: auto 1fr;
    overflow: hidden;
    pointer-events: none;
    visibility: hidden;
    transition: visibility 0.2s;
  }
  .drawer-toggle:checked ~ .drawer-side {
    pointer-events: auto;
    visibility: visible;
  }
  .drawer-side.is-open {
    pointer-events: auto;
    visibility: visible;
  }
  .drawer-side > .drawer-overlay {
    grid-column: 1 / -1;
    grid-row: 1;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity 0.3s;
    cursor: pointer;
  }
  .drawer-toggle:checked ~ .drawer-side > .drawer-overlay {
    opacity: 1;
  }
  .drawer-side.is-open > .drawer-overlay {
    opacity: 1;
  }
  .drawer-side > *:not(.drawer-overlay) {
    grid-column: 1;
    grid-row: 1;
    z-index: 1;
    background: rgb(var(--color-base-100));
    border-right: 1px solid var(--glass-border);
    transform: translateX(-100%);
    transition: transform 0.3s var(--ease-out-expo);
    overflow-y: auto;
  }
  .drawer-toggle:checked ~ .drawer-side > *:not(.drawer-overlay) {
    transform: translateX(0);
  }
  .drawer-side.is-open > *:not(.drawer-overlay) {
    transform: translateX(0);
  }
  /* Responsive: always open on large screens */
  @media (min-width: 1024px) {
    .drawer-open {
      grid-template-columns: auto 1fr;
    }
    .drawer-open > .drawer-side {
      position: static;
      grid-column: 1;
      grid-row: 1;
      pointer-events: auto;
      visibility: visible;
      display: block;
      overflow-y: auto;
      transition: none;
    }
    .drawer-open > .drawer-side > .drawer-overlay {
      display: none;
    }
    .drawer-open > .drawer-side > *:not(.drawer-overlay) {
      transform: none;
      border-right: 1px solid var(--glass-border);
      transition: none;
    }
    .drawer-open > .drawer-content {
      grid-column: 2;
      grid-row: 1;
      min-height: 100vh;
    }
    /* Tailwind responsive variant: lg:drawer-open (literal class name) */
    .lg\:drawer-open {
      grid-template-columns: auto 1fr;
    }
    .lg\:drawer-open > .drawer-side {
      position: static;
      grid-column: 1;
      grid-row: 1;
      pointer-events: auto;
      visibility: visible;
      display: block;
      overflow-y: auto;
      transition: none;
    }
    .lg\:drawer-open > .drawer-side > .drawer-overlay {
      display: none;
    }
    .lg\:drawer-open > .drawer-side > *:not(.drawer-overlay) {
      transform: none;
      border-right: 1px solid var(--glass-border);
      transition: none;
    }
    .lg\:drawer-open > .drawer-content {
      grid-column: 2;
      grid-row: 1;
      min-height: 100vh;
    }
  }


  /* ===== TABLES ===== */
  .table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.875rem;
  }
  .table th {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: rgb(var(--color-base-content) / 0.5);
    border-bottom: 1px solid var(--glass-border);
    background: rgb(var(--color-base-200));
  }
  .table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    color: rgb(var(--color-base-content) / 0.85);
  }
  .table tr:hover td {
    background: rgba(255, 255, 255, 0.02);
  }
  .table-sm th, .table-sm td { padding: 0.5rem 0.75rem; font-size: 0.8125rem; }
  .table-sm th { font-size: 0.6875rem; }
  .table-zebra tbody tr:nth-child(even) td {
    background: rgba(255, 255, 255, 0.02);
  }


  /* ===== COLLAPSE / ACCORDION ===== */
  .collapse {
    position: relative;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: rgb(var(--color-base-100));
    border: 1px solid var(--glass-border);
  }
  .collapse input[type="checkbox"],
  .collapse input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
    z-index: 1;
    top: 0;
    left: 0;
  }
  .collapse-title {
    display: flex;
    align-items: center;
    padding: 1rem 1.25rem;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: background 0.15s ease;
    min-height: 0;
    position: relative;
  }
  .collapse-title:hover { background: rgba(255, 255, 255, 0.03); }
  .collapse-content {
    padding: 0 1.25rem;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s var(--ease-out-expo), padding 0.3s ease;
  }
  .collapse input[type="checkbox"]:checked ~ .collapse-content,
  .collapse input[type="radio"]:checked ~ .collapse-content {
    max-height: 100vh;
    padding: 0 1.25rem 1rem;
  }
  .collapse-arrow .collapse-title::after {
    content: '';
    position: absolute;
    right: 1.25rem;
    width: 0.5rem;
    height: 0.5rem;
    border-right: 2px solid rgb(var(--color-base-content) / 0.4);
    border-bottom: 2px solid rgb(var(--color-base-content) / 0.4);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
  }
  .collapse-arrow input[type="checkbox"]:checked ~ .collapse-title::after,
  .collapse-arrow input[type="radio"]:checked ~ .collapse-title::after {
    transform: rotate(-135deg);
  }


  /* ===== STEPS ===== */
  .steps {
    display: flex;
    overflow-x: auto;
    counter-reset: step;
  }
  .steps-horizontal { flex-direction: row; }
  .step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    flex: 1;
    position: relative;
    padding: 0.5rem 0;
    font-size: 0.875rem;
    counter-increment: step;
    color: rgb(var(--color-base-content) / 0.5);
  }
  .step::before {
    content: counter(step);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: var(--radius-full);
    background: rgb(var(--color-base-300));
    color: rgb(var(--color-base-content) / 0.5);
    font-weight: 700;
    font-size: 0.75rem;
    position: relative;
    z-index: 1;
  }
  .step:not(:first-child)::after {
    content: '';
    position: absolute;
    top: calc(0.5rem + 1rem);
    right: 50%;
    left: calc(-50% + 1rem);
    height: 2px;
    background: rgb(var(--color-base-300));
    z-index: 0;
  }
  .step-primary::before {
    background: rgb(var(--color-primary));
    color: white;
  }
  .step-primary:not(:first-child)::after,
  .step-primary + .step:not(:first-child)::after {
    background: rgb(var(--color-primary));
  }
  .step-indicator { font-size: 0.75rem; }
  .step-content { text-align: center; }


  /* ===== TABS ===== */
  .tabs {
    display: flex;
    align-items: center;
    gap: 0;
    overflow-x: auto;
  }
  .tab {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: rgb(var(--color-base-content) / 0.5);
    cursor: pointer;
    transition: all 0.15s ease;
    border: none;
    background: transparent;
    white-space: nowrap;
    text-decoration: none;
    border-radius: var(--radius-md);
  }
  .tab:hover {
    color: rgb(var(--color-base-content) / 0.8);
    background: rgba(255, 255, 255, 0.04);
  }
  .tab-active, .tab[aria-selected="true"] {
    color: rgb(var(--color-primary));
    background: rgb(var(--color-primary) / 0.1);
    font-weight: 600;
  }
  .tab-sm { padding: 0.375rem 0.75rem; font-size: 0.8125rem; }
  .tabs-boxed {
    background: rgb(var(--color-base-300) / 0.5);
    border-radius: var(--radius-lg);
    padding: 0.25rem;
    gap: 0.125rem;
  }


  /* ===== LOADING / PROGRESS ===== */
  .loading {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    vertical-align: middle;
    pointer-events: none;
  }
  .loading-spinner {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid rgb(var(--color-base-300));
    border-top-color: rgb(var(--color-primary));
    border-radius: var(--radius-full);
    animation: spin 0.6s linear infinite;
  }
  .loading-ring {
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid rgb(var(--color-base-300));
    border-top-color: rgb(var(--color-primary));
    border-radius: var(--radius-full);
    animation: spin 0.6s linear infinite;
  }
  .loading-xs, .loading-xs .loading-spinner, .loading-xs .loading-ring { width: 1rem; height: 1rem; }
  .loading-sm, .loading-sm .loading-spinner, .loading-sm .loading-ring { width: 1.25rem; height: 1.25rem; }
  .loading-lg, .loading-lg .loading-spinner, .loading-lg .loading-ring { width: 2.5rem; height: 2.5rem; }

  .progress {
    appearance: none;
    width: 100%;
    height: 0.5rem;
    border-radius: var(--radius-full);
    background: rgb(var(--color-base-300));
    overflow: hidden;
  }
  .progress::-webkit-progress-bar {
    background: rgb(var(--color-base-300));
    border-radius: var(--radius-full);
  }
  .progress::-webkit-progress-value {
    background: rgb(var(--color-primary));
    border-radius: var(--radius-full);
    transition: width 0.3s var(--ease-out-expo);
  }
  .progress::-moz-progress-bar {
    background: rgb(var(--color-primary));
    border-radius: var(--radius-full);
  }

  .radial-progress {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 5rem;
    height: 5rem;
    border-radius: var(--radius-full);
    background:
      radial-gradient(farthest-side, rgb(var(--color-primary)) 98%, transparent) top/var(--thickness, 5px) var(--thickness, 5px) no-repeat,
      conic-gradient(rgb(var(--color-primary)) calc(var(--value, 0) * 1%), rgb(var(--color-base-300)) 0);
    mask: radial-gradient(farthest-side, transparent calc(100% - var(--thickness, 5px) - 1px), black calc(100% - var(--thickness, 5px)));
    -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--thickness, 5px) - 1px), black calc(100% - var(--thickness, 5px)));
  }
  .radial-progress::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: var(--radius-full);
  }
  .radial-progress-profile { --size: 5rem; --thickness: 5px; color: rgb(var(--color-primary)); }


  /* ===== DIVIDER ===== */
  .divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
    font-size: 0.75rem;
    color: rgb(var(--color-base-content) / 0.4);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 500;
  }
  .divider::before,
  .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--glass-border);
  }


  /* ===== AVATAR / PLACEHOLDER ===== */
  .avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }
  .avatar > div {
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
  }
  .avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
  }


  /* ===== STATS ===== */
  .stats {
    display: grid;
    grid-auto-flow: column;
    background: rgb(var(--color-base-100));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    overflow: hidden;
  }
  .stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem 1.5rem;
    border-right: 1px solid var(--glass-border);
  }
  .stat:last-child { border-right: none; }
  .stat-title {
    font-size: 0.75rem;
    color: rgb(var(--color-base-content) / 0.5);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
  .stat-value {
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
    color: rgb(var(--color-base-content));
  }


  /* ===== LINKS ===== */
  .link {
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    color: rgb(var(--color-primary));
  }
  .link:hover {
    opacity: 0.8;
  }
  .link-primary { color: rgb(var(--color-primary)); }
  .link-secondary { color: rgb(var(--color-secondary)); }
  .link-hover {
    text-decoration: none;
  }
  .link-hover:hover {
    text-decoration: underline;
  }
  .link-active {
    color: rgb(var(--color-primary));
    font-weight: 600;
  }


  /* ===== RATING / MASK ===== */
  .rating {
    display: inline-flex;
    gap: 0.125rem;
  }
  .rating input {
    appearance: none;
    cursor: pointer;
  }
  .rating-hidden {
    width: 0.5rem;
    padding: 0;
    background-color: transparent;
  }
  .rating-md input:not(.rating-hidden) { width: 1.5rem; height: 1.5rem; }
  .rating-lg input:not(.rating-hidden) { width: 2rem; height: 2rem; }
  .mask { mask-size: contain; mask-repeat: no-repeat; mask-position: center; -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; }
  .mask-star-2 {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2l3.09 6.26L22 9.27l-5 4.87 1.18 6.88L12 17.77l-6.18 3.25L7 14.14 2 9.27l6.91-1.01L12 2z'/%3E%3C/svg%3E");
    background-color: rgb(var(--color-base-300));
  }
  .rating input:checked ~ input .mask-star-2,
  .rating input.mask-star-2:checked {
    background-color: rgb(var(--color-warning));
  }
  /* Stars up to and including :checked */
  .rating input.mask-star-2 { background-color: rgb(var(--color-base-300)); }
  .rating input.mask-star-2:checked,
  .rating input.mask-star-2:checked ~ input.mask-star-2 {
    /* We rely on sibling order; DaisyUI uses nth logic.
       In practice, each star input tracks the value natively. */
  }


  /* ===== TOOLTIP ===== */
  .tooltip {
    position: relative;
    display: inline-flex;
  }
  .tooltip::before {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-4px);
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
    font-weight: 500;
    white-space: nowrap;
    border-radius: var(--radius-md);
    background: rgb(var(--color-base-content));
    color: rgb(var(--color-base-200));
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
    z-index: 50;
  }
  .tooltip:hover::before {
    opacity: 1;
  }


  /* ===== INDICATOR ===== */
  .indicator {
    position: relative;
    display: inline-flex;
  }
  .indicator > .badge {
    position: absolute;
    top: 0;
    right: 0;
    transform: translate(50%, -50%);
    z-index: 1;
  }


  /* ===== HERO ===== */
  .hero {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50vh;
    padding: 2rem;
  }


  /* ===== SWAP ===== */
  .swap {
    position: relative;
    display: inline-flex;
    cursor: pointer;
    user-select: none;
  }


  /* ===== KBD ===== */
  .kbd {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.125rem 0.375rem;
    font-size: 0.75rem;
    font-family: 'Inter', monospace;
    border: 1px solid rgb(var(--color-base-300));
    border-radius: var(--radius-sm);
    background: rgb(var(--color-base-200));
    color: rgb(var(--color-base-content) / 0.7);
    min-width: 1.25rem;
    text-align: center;
    box-shadow: 0 1px 0 rgb(var(--color-base-300));
  }


  /* ===== JOIN ===== */
  .join {
    display: inline-flex;
    align-items: stretch;
  }
  .join > *:not(:first-child) {
    margin-left: -1px;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
  }
  .join > *:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }


  /* ===== PROSE ===== */
  .prose {
    max-width: 65ch;
    color: rgb(var(--color-base-content) / 0.85);
    line-height: 1.75;
  }
  .prose h1, .prose h2, .prose h3, .prose h4 {
    color: rgb(var(--color-base-content));
    margin-top: 1.5em;
    margin-bottom: 0.5em;
  }
  .prose h1 { font-size: 2em; }
  .prose h2 { font-size: 1.5em; }
  .prose h3 { font-size: 1.25em; }
  .prose p { margin: 1em 0; }
  .prose a { color: rgb(var(--color-primary)); text-decoration: underline; text-underline-offset: 2px; }
  .prose strong { color: rgb(var(--color-base-content)); font-weight: 600; }
  .prose ul, .prose ol { padding-left: 1.5em; margin: 1em 0; }
  .prose li { margin: 0.25em 0; }
  .prose blockquote {
    border-left: 3px solid rgb(var(--color-primary) / 0.3);
    padding-left: 1rem;
    color: rgb(var(--color-base-content) / 0.7);
    font-style: italic;
  }
  .prose code {
    background: rgb(var(--color-base-300));
    padding: 0.125em 0.375em;
    border-radius: var(--radius-sm);
    font-size: 0.875em;
  }
  .prose pre {
    background: rgb(var(--color-neutral));
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-lg);
    padding: 1rem;
    overflow-x: auto;
  }
  .prose pre code { background: transparent; padding: 0; }
  .prose-sm { font-size: 0.875rem; line-height: 1.6; }

/* end component styles */


/* ────────────────────────────────────
   4. CUSTOM UTILITIES (from old theme.css)
   ──────────────────────────────────── */

/* Gradient accents - dark theme versions */
.gradient-warm { background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%); }
.gradient-cool { background: linear-gradient(135deg, #06B6D4 0%, #3B82F6 100%); }
.gradient-sunset { background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 50%, #06B6D4 100%); }
.gradient-warm-reverse { background: linear-gradient(135deg, #8B5CF6, #6366F1); }
.gradient-cta {
  background: linear-gradient(135deg, rgb(var(--color-neutral)) 0%, #0F0F12 40%, #111127 100%);
}

.text-gradient-warm {
  background: linear-gradient(135deg, #6366F1 0%, #8B5CF6 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.text-gradient-trail {
  background: linear-gradient(135deg, #818CF8 0%, #06B6D4 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Blobs - dark-theme ambient glow */
.blob-warm { background: radial-gradient(circle, rgba(99, 102, 241, 0.06) 0%, transparent 70%); }
.blob-cool { background: radial-gradient(circle, rgba(6, 182, 212, 0.05) 0%, transparent 70%); }

/* Warm shadows - now cool-toned for dark theme */
/* shadow-trail variants - now redundant since card-trail has built-in shadows,
   but kept for template compat. They add slightly more depth. */
.shadow-trail-sm { box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 1px 8px rgba(0,0,0,0.3); }
.shadow-trail { box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 2px 20px rgba(0,0,0,0.4), 0 0 40px rgba(0,0,0,0.2); }
.shadow-trail-md { box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 4px 24px rgba(0,0,0,0.45), 0 0 48px rgba(0,0,0,0.2); }
.shadow-trail-lg { box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 8px 32px rgba(0,0,0,0.5), 0 0 60px rgba(0,0,0,0.25); }
.shadow-trail-xl { box-shadow: 0 0 0 1px rgba(255,255,255,0.06), 0 12px 40px rgba(0,0,0,0.55), 0 0 80px rgba(0,0,0,0.3); }

/* Card treatments */
.transition-warm { transition: all 0.3s var(--ease-out-expo); }

/* Topographic pattern - subtle on dark */
.topo-pattern {
  background-image: url("data:image/svg+xml,%3Csvg width='200' height='200' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M0 80c30-15 60-5 100 10s70 20 100 5' fill='none' stroke='%236366F1' stroke-width='0.6' opacity='0.06'/%3E%3Cpath d='M0 60c40-10 80 10 120 15s60-5 80-15' fill='none' stroke='%2306B6D4' stroke-width='0.5' opacity='0.04'/%3E%3Cpath d='M0 120c25 10 50 20 100 5s75-25 100-10' fill='none' stroke='%236366F1' stroke-width='0.6' opacity='0.05'/%3E%3Cpath d='M0 160c35-10 70 5 110 15s65 5 90-10' fill='none' stroke='%2306B6D4' stroke-width='0.5' opacity='0.03'/%3E%3Cpath d='M0 40c50 5 90-10 130 0s50 15 70 5' fill='none' stroke='%238B5CF6' stroke-width='0.4' opacity='0.03'/%3E%3C/svg%3E");
  background-size: 200px 200px;
}

/* Grain overlay - reduced for dark theme */
.grain::after {
  content: '';
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
  opacity: 0.25;
}

/* Wave divider */
.wave-divider {
  height: 48px;
  overflow: hidden;
}
.wave-divider svg {
  display: block;
  width: 100%;
  height: 100%;
}


/* ────────────────────────────────────
   5. AMBIENT EFFECTS
   ──────────────────────────────────── */

.ambient-blob {
  position: fixed;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
}
.ambient-blob--primary {
  background: var(--ambient-primary);
  top: -200px;
  right: -100px;
  animation: blob-drift 12s ease-in-out infinite alternate;
}
.ambient-blob--secondary {
  background: var(--ambient-secondary);
  bottom: -200px;
  left: -100px;
  animation: blob-drift 10s ease-in-out infinite alternate-reverse;
}

.grid-overlay {
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.015) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.015) 1px, transparent 1px);
  background-size: 64px 64px;
  pointer-events: none;
  z-index: 0;
}

.spotlight {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(
    600px circle at var(--mouse-x, 50%) var(--mouse-y, 50%),
    rgba(99, 102, 241, 0.04),
    transparent 60%
  );
}


/* ────────────────────────────────────
   6. HTMX LOADING STATES
   ──────────────────────────────────── */
.htmx-indicator { opacity: 0; transition: opacity 200ms ease-in; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { opacity: 1; }
.htmx-swapping { opacity: 0; transition: opacity 0.15s ease-out; }
.htmx-settling { opacity: 0; }
.htmx-settling > * { animation: fade-up 0.3s ease-out forwards; }


/* ────────────────────────────────────
   7. ANIMATIONS
   ──────────────────────────────────── */
@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes fade-up {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes slide-down {
  from { opacity: 0; transform: translateY(-12px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes scale-in {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}
@keyframes float-gentle {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}
@keyframes pulse-subtle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}
@keyframes draw-line {
  from { stroke-dashoffset: 1000; }
  to { stroke-dashoffset: 0; }
}
@keyframes bounce-soft {
  0% { transform: scale(0); opacity: 0; }
  60% { transform: scale(1.08); }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes blob-drift {
  0% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(30px, -20px) scale(1.05); }
  66% { transform: translate(-20px, 10px) scale(0.95); }
  100% { transform: translate(10px, -15px) scale(1.02); }
}
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

/* Page entrance */
main > div,
main > section { animation: fade-up 0.5s var(--ease-out-expo) both; }

/* Stagger children */
[data-stagger] > *:nth-child(1) { animation-delay: 0s; }
[data-stagger] > *:nth-child(2) { animation-delay: 0.06s; }
[data-stagger] > *:nth-child(3) { animation-delay: 0.12s; }
[data-stagger] > *:nth-child(4) { animation-delay: 0.18s; }
[data-stagger] > *:nth-child(5) { animation-delay: 0.24s; }
[data-stagger] > *:nth-child(6) { animation-delay: 0.30s; }

/* Scroll-triggered animations */
[data-animate] {
  opacity: 0; transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out-expo), transform 0.6s var(--ease-out-expo);
}
[data-animate].visible { opacity: 1; transform: translateY(0); }
[data-animate]:nth-child(2) { transition-delay: 0.08s; }
[data-animate]:nth-child(3) { transition-delay: 0.16s; }
[data-animate]:nth-child(4) { transition-delay: 0.24s; }

/* Badge pulse for proposed status */
.badge-pulse { animation: pulse-subtle 2s ease-in-out infinite; }

/* Alert entrance */
.alert { animation: slide-down 0.3s ease-out; }

/* Participant chips stagger */
.participant-chip { animation: fade-up 0.3s ease-out both; }
.participant-chip:nth-child(2) { animation-delay: 0.05s; }
.participant-chip:nth-child(3) { animation-delay: 0.1s; }
.participant-chip:nth-child(4) { animation-delay: 0.15s; }
.participant-chip:nth-child(5) { animation-delay: 0.2s; }
.participant-chip:nth-child(n+6) { animation-delay: 0.25s; }

/* Chip exit animation for location tags */
@keyframes chip-exit {
  from { transform: scale(1); opacity: 1; }
  to   { transform: scale(0.7); opacity: 0; }
}
.location-chip-removing {
  animation: chip-exit 0.15s ease-in forwards;
}

/* Navbar active link indicator */
.nav-link-active {
  position: relative;
}
.nav-link-active::after {
  content: '';
  position: absolute;
  bottom: -2px; left: 0; right: 0;
  height: 2px;
  background: linear-gradient(90deg, rgb(var(--color-primary)), rgb(var(--color-secondary)));
  border-radius: var(--radius-full);
}

/* Floating feedback button */
.feedback-float { animation: bounce-soft 0.4s ease-out 0.5s both; color: #fff; }
.feedback-float svg { stroke: #fff; }
.float-animation { animation: float-gentle 3s ease-in-out infinite; }

/* Focus states - consistent with form inputs */
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none;
  border-color: rgb(var(--color-primary));
  box-shadow: 0 0 0 3px rgb(var(--color-primary) / 0.12);
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}


/* ────────────────────────────────────
   8. 404/500 ANIMATIONS (from animations.css)
   ──────────────────────────────────── */
@keyframes caveman-jump {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  8% { transform: translateY(-10px) rotate(0deg); }
  20% { transform: translateY(-90px) rotate(-10deg); }
  35% { transform: translateY(-110px) rotate(15deg) scaleY(1.05); }
  48% { transform: translateY(-40px) rotate(25deg) scaleX(1.1); }
  52% { transform: translateY(0) rotate(0deg) scaleY(0.85) scaleX(1.15); }
  56% { transform: translateY(-12px) scaleY(1.05) scaleX(0.95); }
  62% { transform: translateY(0) scaleY(0.95) scaleX(1.05); }
  68% { transform: translateY(-4px); }
  72% { transform: translateY(0); }
}
@keyframes club-spin {
  0%, 100% { transform: rotate(-20deg); }
  20% { transform: rotate(-60deg); }
  35% { transform: rotate(40deg); }
  52% { transform: rotate(-10deg); }
  72% { transform: rotate(-20deg); }
}
@keyframes hair-bounce {
  0%, 100% { transform: scaleY(1) translateY(0); }
  20% { transform: scaleY(0.8) translateY(2px); }
  35% { transform: scaleY(1.3) translateY(-3px); }
  52% { transform: scaleY(0.7) translateY(4px); }
  62% { transform: scaleY(1.1) translateY(-1px); }
}
@keyframes big-splash-l {
  0%, 48% { transform: scale(0) translate(0, 0); opacity: 0; }
  53% { transform: scale(1.3) translate(-22px, -35px); opacity: 1; }
  65% { transform: scale(0.8) translate(-35px, -15px); opacity: 0.7; }
  80% { transform: scale(0.3) translate(-42px, 15px); opacity: 0; }
  100% { transform: scale(0) translate(-42px, 15px); opacity: 0; }
}
@keyframes big-splash-r {
  0%, 48% { transform: scale(0) translate(0, 0); opacity: 0; }
  53% { transform: scale(1.3) translate(22px, -35px); opacity: 1; }
  65% { transform: scale(0.8) translate(35px, -15px); opacity: 0.7; }
  80% { transform: scale(0.3) translate(42px, 15px); opacity: 0; }
  100% { transform: scale(0) translate(42px, 15px); opacity: 0; }
}
@keyframes big-splash-c {
  0%, 48% { transform: scale(0) translateY(0); opacity: 0; }
  52% { transform: scale(1.5) translateY(-45px); opacity: 1; }
  62% { transform: scale(1) translateY(-30px); opacity: 0.6; }
  78% { transform: scale(0.2) translateY(-5px); opacity: 0; }
  100% { transform: scale(0) translateY(0); opacity: 0; }
}
@keyframes big-splash-far-l {
  0%, 50% { transform: scale(0) translate(0, 0); opacity: 0; }
  56% { transform: scale(1) translate(-38px, -25px); opacity: 0.8; }
  72% { transform: scale(0.4) translate(-55px, 8px); opacity: 0; }
  100% { transform: scale(0) translate(-55px, 8px); opacity: 0; }
}
@keyframes big-splash-far-r {
  0%, 50% { transform: scale(0) translate(0, 0); opacity: 0; }
  56% { transform: scale(1) translate(38px, -25px); opacity: 0.8; }
  72% { transform: scale(0.4) translate(55px, 8px); opacity: 0; }
  100% { transform: scale(0) translate(55px, 8px); opacity: 0; }
}
@keyframes puddle-splash {
  0%, 48% { transform: scaleX(1) scaleY(1); opacity: 0.5; }
  52% { transform: scaleX(1.8) scaleY(0.6); opacity: 0.9; }
  60% { transform: scaleX(2.4) scaleY(0.8); opacity: 0.6; }
  75% { transform: scaleX(1.4) scaleY(1.1); opacity: 0.4; }
  100% { transform: scaleX(1) scaleY(1); opacity: 0.5; }
}
@keyframes bone-float {
  0% { transform: translate(0, 0) rotate(0deg); opacity: 0.25; }
  50% { transform: translate(3px, -4px) rotate(10deg); opacity: 0.35; }
  100% { transform: translate(0, 0) rotate(0deg); opacity: 0.25; }
}
@keyframes bird-fly {
  0% { transform: translate(-40px, 10px) scaleX(1); }
  49% { scaleX: 1; }
  50% { transform: translate(50px, -5px) scaleX(-1); }
  100% { transform: translate(-40px, 10px) scaleX(1); }
}
@keyframes stars {
  0%, 48%, 72%, 100% { opacity: 0; transform: scale(0) rotate(0deg); }
  54% { opacity: 1; transform: scale(1) rotate(0deg); }
  66% { opacity: 0.6; transform: scale(0.8) rotate(180deg); }
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.caveman { animation: caveman-jump 3s ease-in-out infinite; transform-origin: center bottom; }
.club-swing { animation: club-spin 3s ease-in-out infinite; transform-origin: 8px 52px; }
.wild-hair { animation: hair-bounce 3s ease-in-out infinite; transform-origin: center bottom; }
.splash-l { animation: big-splash-l 3s ease-out infinite; }
.splash-r { animation: big-splash-r 3s ease-out infinite; }
.splash-c { animation: big-splash-c 3s ease-out infinite; }
.splash-fl { animation: big-splash-far-l 3s ease-out infinite; }
.splash-fr { animation: big-splash-far-r 3s ease-out infinite; }
.puddle-fx { animation: puddle-splash 3s ease-in-out infinite; }
.bone-bob { animation: bone-float 4s ease-in-out infinite; }
.birdy { animation: bird-fly 7s ease-in-out infinite; }
.impact-stars { animation: stars 3s ease-out infinite; }
.fade-in-card { animation: fadeIn 0.5s ease-out; }


/* ────────────────────────────────────
   9. ACCESSIBILITY
   ──────────────────────────────────── */

/* Enforce HTML hidden attribute */
[hidden] { display: none !important; }

/* Screen reader only */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Reduced motion */
/* Search match highlight */
mark.search-match {
  background: transparent;
  color: rgb(var(--color-primary));
  font-weight: 600;
  font-style: normal;
  padding: 0;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  main > div, main > section { animation: none; }
  .htmx-swapping, .htmx-settling { transition: none; }
  .htmx-settling > * { animation: none; opacity: 1; }
  [data-animate] { opacity: 1; transform: none; transition: none; }
  .badge-pulse { animation: none; }
  .alert { animation: none; }
  .participant-chip { animation: none; }
  .feedback-float { animation: none; }
  .float-animation { animation: none; }
  .ambient-blob { animation: none; }
  .spotlight { display: none; }
  input:focus-visible, select:focus-visible, textarea:focus-visible { transition: none; }
}
