/* =====================================================================
   ITINERA TOKENS — Luxury Zinc/Obsidian & Warm Alabaster Palette
   - Dark Theme: Comfortable deep obsidian & zinc (#0a0a0a / #121212 / #18181b)
   - Light Theme: Warm stone & alabaster (#fafaf9 / #ffffff / #e7e5e4)
   - Zero harsh blues. Warm amber, emerald, and bronze accents.
   ===================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Inter:wght@300;400;500;600;700;800;900&family=IBM+Plex+Mono:wght@400;500;600&display=swap');

:root {
  /* radius scale */
  --radius: 0.5rem;
  --radius-sm: calc(var(--radius) * 0.7);   /* ~6px  inputs, chips */
  --radius-md: var(--radius);               /* 8px   buttons */
  --radius-lg: calc(var(--radius) * 1.4);   /* ~11px cards */
  --radius-xl: calc(var(--radius) * 2);     /* ~16px hero cards */
  --radius-full: 9999px;                    /* pills, toggles, avatars */

  /* Light Theme (Warm Stone / Alabaster — Zero Blue Tints) */
  --background:            60 5% 98%;     /* #fafaf9 warm stone */
  --foreground:            24 10% 10%;    /* #1c1917 deep warm charcoal */
  --card:                  0 0% 100%;     /* #ffffff pure white */
  --card-foreground:       24 10% 10%;    /* #1c1917 */
  --popover:               0 0% 100%;
  --popover-foreground:    24 10% 10%;
  --primary:               24 10% 12%;    /* #1f1d1b primary dark charcoal */
  --primary-foreground:    60 5% 98%;     /* #fafaf9 warm stone text */
  --secondary:             60 4% 94%;     /* #f5f5f4 soft warm neutral */
  --secondary-foreground:  24 10% 12%;
  --muted:                 60 4% 92%;     /* #ebe9e7 muted warm */
  --muted-foreground:      24 5% 45%;     /* #78716c warm taupe */
  --accent:                38 92% 50%;    /* #f59e0b warm amber gold */
  --accent-foreground:     24 10% 12%;
  --destructive:           0 84.2% 60.2%;
  --destructive-foreground: 0 0% 98%;
  --border:                24 6% 90%;     /* #e7e5e4 soft stone border */
  --input:                 24 6% 90%;
  --ring:                  24 10% 12%;

  /* typography */
  --font-display: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body:    'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono:    'IBM Plex Mono', monospace;

  /* shadow scale */
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 8px 20px -8px rgba(0,0,0,0.08);
  --shadow-lg: 0 40px 80px -30px rgba(0,0,0,0.15);

  /* status tokens */
  --ok-fg: hsl(150 65% 28%);
  --ok-bg: hsl(150 55% 38% / 0.12);
  --ok-line: hsl(150 50% 38%);
  --ok-drain: hsl(150 50% 40% / 0.7);
  --warn-fg: hsl(38 90% 32%);
  --warn-bg: hsl(38 90% 50% / 0.12);
  --danger-fg: hsl(0 66% 28%);
  --danger-bg: hsl(var(--destructive) / 0.12);
  --neutral-fg: hsl(24 5% 45%);
  --neutral-bg: hsl(var(--muted));
  --track-fill: hsl(var(--muted));

  /* motif */
  --motif-perf: calc(var(--radius) * 1.5);

  /* spacing scale — 4px base */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --space-8: 64px;
  --space-9: 96px;

  /* motion */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --dur-fast: 140ms;
  --dur-base: 220ms;
  --dur-slow: 340ms;

  /* type scale */
  --text-h1: 29px; --text-h1-lh: 1.15;
  --text-h2: 23.5px; --text-h2-lh: 1.2;
  --text-h3: 18.5px; --text-h3-lh: 1.25;
  --text-body: 13.5px; --text-body-lh: 1.6;
  --text-small: 12px; --text-small-lh: 1.5;
  --text-eyebrow: 9px; --text-eyebrow-lh: 1.4;

  /* container widths */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1180px;
  --container-padding: clamp(20px, 5vw, 84px);

  /* luxury brand accents */
  --brand-gold:   38 92% 50%;    /* Warm Gold */
  --brand-amber:  32 95% 44%;    /* Warm Amber */
  --brand-stone:  24 10% 12%;    /* Charcoal Stone */
  --brand-green:  160 84% 39%;   /* Emerald */

  /* glass tokens */
  --glass-blur-sm:  8px;
  --glass-blur-md:  12px;
  --glass-blur-xl:  24px;
  --glass-blur-3xl: 48px;
  --glass-saturate: 180%;
  --glass-border: 0 0% 0% / 0.08;
  --glass-border-dark: 0 0% 100% / 0.1;
  --glass-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.08);
  --glass-shadow-dark: 0 24px 60px -20px rgba(0, 0, 0, 0.5);

  /* Legacy & Canonical Token Aliases */
  --bg:                     hsl(var(--background));
  --text:                   hsl(var(--foreground));
  --text-muted:             hsl(var(--muted-foreground));
  --text-faint:             hsl(var(--muted-foreground) / 0.7);
  --surface:                hsl(var(--card));
  --surface-2:              hsl(var(--secondary));
  --surface-3:              hsl(var(--muted));
  --bg-raised:              hsl(var(--card));
  --border-faint:           hsl(var(--border) / 0.6);
  --border-strong:          hsl(var(--border));
  --media-bg:               hsl(var(--muted));
  --scrim:                  rgba(0, 0, 0, 0.4);
  --overlay-tab:            hsl(var(--card) / 0.85);
  --overlay-header:         hsl(var(--background) / 0.85);
  --overlay-menu:           hsl(var(--card) / 0.95);

  /* Component Semantic Color Tokens (Light Mode) */
  --ticker-bg:              hsl(var(--secondary) / 0.8);
  --ticker-border:          hsl(var(--border) / 0.9);
  --ticker-text:            hsl(var(--foreground) / 0.8);

  --footer-bg:              hsl(var(--secondary) / 0.7);
  --footer-border:          hsl(var(--border) / 0.9);
  --footer-text:            hsl(var(--foreground));
  --footer-subtext:         hsl(var(--muted-foreground));
  --header-h:               72px;
  --topbar-h:               72px;
  --tabbar-h:               60px;
  --container:              var(--container-xl);
  --white:                  #ffffff;
  --black:                  #000000;
  --r-sm:                   var(--radius-sm);
  --r-md:                   var(--radius-md);
  --r-lg:                   var(--radius-lg);
  --r-xl:                   var(--radius-xl);
  --r-full:                 var(--radius-full);
  --radius-card:            var(--radius-lg);
  --dur:                    var(--dur-base);
  --dur-normal:             var(--dur-base);
  --ease:                   var(--ease-out);
  --shadow-xl:              var(--shadow-lg);
  --glow:                   0 0 20px rgba(245, 158, 11, 0.25);
  --glow-strong:            0 0 30px rgba(245, 158, 11, 0.45);
  --focus-glow:             0 0 0 3px rgba(245, 158, 11, 0.35);
  --glass:                  rgba(255, 255, 255, 0.65);

  /* Spacing scale aliases */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 20px;
  --sp-6: 24px;
  --sp-8: 32px;
  --sp-10: 40px;
  --sp-12: 48px;
  --sp-16: 64px;
  --sp-20: 80px;
  --sp-24: 96px;

  /* Font-size aliases */
  --fs-2xs: 10px;
  --fs-xs: 11px;
  --fs-sm: 12px;
  --fs-md: 14px;
  --fs-lg: 16px;
  --fs-xl: 18px;
  --fs-2xl: 22px;
  --fs-3xl: 26px;
  --fs-4xl: 32px;
  --fs-5xl: 42px;
  --fs-6xl: 56px;

  --lh-tight: 1.15;
  --lh-normal: 1.5;

  /* Z-indices */
  --z-nav: 100;
  --z-overlay: 200;
  --z-modal: 500;
  --z-toast: 1000;

  /* Error aliases */
  --error-fill:             hsl(var(--destructive) / 0.15);
  --error-line:             hsl(var(--destructive));
  --error-border:           hsl(var(--destructive) / 0.4);

  /* Brand color aliases */
  --brand-blue:             217 91% 60%;
  --brand-sky:              199 89% 48%;
  --brand-ink:              24 10% 12%;
  --brand-paper:            60 5% 98%;
  --brand-teal:             173 80% 40%;
  --brand-sun:              38 92% 50%;
  --chart-3:                38 92% 50%;

  color-scheme: light;
}

.dark,
html.dark,
:root[data-theme="dark"] {
  /* Dark Theme (Comfortable Deep Obsidian & Zinc) */
  --background:             0 0% 4%;       /* #0a0a0a pure comfortable obsidian */
  --foreground:             0 0% 96%;      /* #f4f4f5 bright clear text */
  --card:                   240 5% 7%;     /* #121212 elevated card surface */
  --card-foreground:        0 0% 96%;
  --popover:                240 5% 7%;
  --popover-foreground:     0 0% 96%;
  --primary:                0 0% 98%;      /* #fafafa crisp primary elements */
  --primary-foreground:     0 0% 9%;       /* #171717 dark on primary */
  --secondary:              240 4% 12%;    /* #1e1e24 subtle dark secondary */
  --secondary-foreground:   0 0% 96%;
  --muted:                  240 4% 12%;
  --muted-foreground:       240 5% 65%;    /* #a1a1aa clear muted text */
  --accent:                 38 92% 50%;    /* #f59e0b warm gold accent */
  --accent-foreground:      0 0% 96%;
  --destructive:            0 62.8% 30.6%;
  --destructive-foreground: 0 0% 98%;
  --border:                 240 4% 16%;    /* #27272a soft border */
  --input:                  240 4% 16%;
  --ring:                   0 0% 96%;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.3);
  --shadow-md: 0 8px 20px -8px rgba(0,0,0,0.5);
  --shadow-lg: 0 40px 80px -30px rgba(0,0,0,0.7);

  /* status tokens — dark mode */
  --ok-fg: hsl(150 70% 66%);
  --ok-bg: hsl(150 60% 40% / 0.18);
  --ok-line: hsl(150 65% 58%);
  --ok-drain: hsl(150 60% 45% / 0.7);
  --warn-fg: hsl(38 90% 66%);
  --warn-bg: hsl(38 90% 55% / 0.16);
  --danger-fg: hsl(0 85% 72%);
  --danger-bg: hsl(var(--destructive) / 0.22);
  --neutral-fg: hsl(240 5% 74%);
  --neutral-bg: hsl(240 4% 14%);
  --track-fill: hsl(240 4% 20%);

  /* Component Semantic Color Tokens (Dark Mode) */
  --ticker-bg:              #08080a;
  --ticker-border:          rgba(255, 255, 255, 0.1);
  --ticker-text:            rgba(255, 255, 255, 0.7);

  --footer-bg:              #070709;
  --footer-border:          rgba(255, 255, 255, 0.1);
  --footer-text:            #ffffff;
  --footer-subtext:         rgba(255, 255, 255, 0.6);

  --scrim:      rgba(0, 0, 0, 0.75);
  --glass:      rgba(255, 255, 255, 0.05);

  --motif-perf: calc(var(--radius) * 1.5);

  color-scheme: dark;
}

/* ---- container pattern ---- */
.container {
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--container-padding);
}

/* ---- Background Sculptural Motifs ("منحوتات") ---- */
.bg-sculpture-relief {
  background-image: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 0.03) 0%, transparent 70%), url('../img/sculptures/sculpture-relief-classical.svg');
  background-repeat: no-repeat;
  background-position: top 10% right 5%;
  background-size: auto, 520px;
}

.bg-architectural-motif {
  background-image: url('../img/sculptures/sculpture-architectural-fluting.svg');
  background-repeat: repeat-y;
  background-position: top left;
  background-size: 240px;
}

/* =====================================================================
   GLOBAL CHROME: Topbar-Right, Icon-Btn, Theme Toggle, User Menu & Notifications
   Universal across Public, Auth, App, Admin, and Agency pages
   ===================================================================== */

/* --- Accessibility Skip Link --- */
.skip-link {
  position: fixed;
  top: 1rem;
  left: 1.5rem;
  z-index: 99999;
  padding: 0.6rem 1.2rem;
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  border: 1px solid hsl(var(--accent));
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  transform: translateY(-250%);
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}

.skip-link:focus,
.skip-link:focus-visible {
  transform: translateY(0);
  pointer-events: auto;
  outline: 2px solid hsl(var(--accent));
  outline-offset: 2px;
}

/* =====================================================================
   UNIVERSAL GLASSMORPHISM NAVBAR (Public & Auth Pages)
   State-of-the-art multi-layer frosted translucency & specular rim reflection
   ===================================================================== */
#global-navbar {
  z-index: 2147483647 !important;
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  box-sizing: border-box;
}

#mobile-nav-drawer {
  z-index: 2147483647 !important;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  box-sizing: border-box;
}

.app-nav-header,
.auth-nav-header {
  width: 100%;
  padding: 1.25rem 2rem 0.6rem;
  display: flex;
  justify-content: center;
  z-index: 100;
  position: sticky;
  top: 0;
  box-sizing: border-box;
}

.app-nav-container,
.auth-nav-container {
  width: 100%;
  max-width: 1180px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  
  /* Light Mode Frosted Alabaster Glassmorphism (Zero Blue Tints) */
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.92) 0%, rgba(248, 248, 246, 0.82) 100%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 9999px;
  padding: 0.45rem 1rem 0.45rem 1.2rem;
  
  box-shadow: 
    inset 0 1px 1px 0 rgba(255, 255, 255, 1),
    0 10px 30px -5px rgba(0, 0, 0, 0.05),
    0 4px 12px rgba(0, 0, 0, 0.02);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  box-sizing: border-box;
}

/* Dark Mode Obsidian Charcoal Glass (Zero Blue Navy Tints) */
html.dark .app-nav-container,
html.dark .auth-nav-container,
:root[data-theme="dark"] .app-nav-container,
:root[data-theme="dark"] .auth-nav-container,
html.dark[data-theme-luxury] .app-nav-container,
html.dark[data-theme-luxury] .auth-nav-container {
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.01) 100%), rgba(18, 18, 20, 0.92) !important;
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  box-shadow: 
    inset 0 1px 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 1px 0 rgba(0, 0, 0, 0.5),
    0 16px 40px -8px rgba(0, 0, 0, 0.65),
    0 4px 16px rgba(0, 0, 0, 0.35);
}

.app-brand,
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  text-decoration: none;
  color: hsl(var(--foreground));
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease;
  flex-shrink: 0;
}

.app-brand:hover,
.auth-brand:hover {
  transform: translateY(-1px) scale(1.02);
}

.app-brand .brand-mark,
.auth-brand .brand-mark,
.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: #000000;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 900;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.2s ease;
}

html.dark .app-brand .brand-mark,
html.dark .auth-brand .brand-mark {
  background: #ffffff;
  color: #000000;
}

.app-brand .brand-name,
.auth-brand .brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.02em;
  color: hsl(var(--foreground));
}

html.dark .app-brand .brand-name,
html.dark .auth-brand .brand-name,
:root[data-theme="dark"] .app-brand .brand-name,
:root[data-theme="dark"] .auth-brand .brand-name,
[data-theme-luxury] .app-brand .brand-name,
[data-theme-luxury] .auth-brand .brand-name {
  color: #ffffff !important;
}

.app-nav-links,
.auth-nav-links {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  margin: 0 auto;
}

.app-nav-link,
.auth-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.42rem 0.9rem;
  border-radius: 9999px;
  color: hsl(var(--muted-foreground));
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 500;
  border: 1px solid transparent;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

/* Glassmorphism Link Default (Light Mode) */
.app-nav-link,
.auth-nav-link {
  color: #1e293b;
}

/* Glassmorphism Link Hover & Active (Light Mode) */
.app-nav-link:hover,
.auth-nav-link:hover {
  color: #0f172a;
  background: rgba(0, 0, 0, 0.06);
  border-color: rgba(0, 0, 0, 0.1);
  transform: translateY(-0.5px);
}

.app-nav-link.active,
.auth-nav-link.active {
  color: #d97706;
  background: rgba(245, 158, 11, 0.15);
  border-color: rgba(245, 158, 11, 0.3);
  font-weight: 600;
}

/* Glassmorphism Link Hover & Active (Dark Mode) */
html.dark .app-nav-link,
html.dark .auth-nav-link,
:root[data-theme="dark"] .app-nav-link,
:root[data-theme="dark"] .auth-nav-link {
  color: rgba(255, 255, 255, 0.85) !important;
}

html.dark .app-nav-link:hover,
html.dark .auth-nav-link:hover,
:root[data-theme="dark"] .app-nav-link:hover,
:root[data-theme="dark"] .auth-nav-link:hover {
  color: #ffffff !important;
  background: rgba(255, 255, 255, 0.1) !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  transform: translateY(-0.5px);
}

html.dark .app-nav-link.active,
html.dark .auth-nav-link.active,
:root[data-theme="dark"] .app-nav-link.active,
:root[data-theme="dark"] .auth-nav-link.active {
  color: #fbbf24 !important;
  background: rgba(245, 158, 11, 0.18) !important;
  border-color: rgba(245, 158, 11, 0.35) !important;
  font-weight: 600;
}

/* =====================================================================
   GLOBAL NAVBAR CONTRAST ENFORCEMENT (LIGHT vs DARK MODE)
   ===================================================================== */

/* Light Mode: All navbar text MUST be dark slate (#0f172a / #1e293b) */
html:not(.dark) #global-navbar .app-nav-container a,
html:not(.dark) #global-navbar .app-nav-container button,
html:not(.dark) #global-navbar .app-nav-container span:not(.bg-amber-400):not(.bg-amber-500):not(.bg-amber-400\/20) {
  color: #0f172a !important;
}

html:not(.dark) #global-navbar .app-nav-container .brand-name {
  color: #0f172a !important;
}

html:not(.dark) #global-navbar .app-nav-container a.text-amber-600,
html:not(.dark) #global-navbar .app-nav-container button.text-amber-600,
html:not(.dark) #global-navbar .app-nav-container span.text-amber-600,
html:not(.dark) #global-navbar .app-nav-container span.text-amber-700 {
  color: #d97706 !important;
}

html:not(.dark) #global-navbar .app-nav-container #cmd-trigger-btn,
html:not(.dark) #global-navbar .app-nav-container #theme-toggle {
  background-color: rgba(0, 0, 0, 0.06) !important;
  border-color: rgba(0, 0, 0, 0.12) !important;
  color: #0f172a !important;
}

html:not(.dark) #global-navbar .app-nav-container #cmd-trigger-btn kbd {
  color: #475569 !important;
  background-color: rgba(0, 0, 0, 0.08) !important;
}

html:not(.dark) #global-navbar .app-nav-container a.bg-amber-400,
html:not(.dark) #global-navbar .app-nav-container a.bg-amber-500 {
  color: #020617 !important;
  background-color: #fbbf24 !important;
}

/* Dark Mode: Navbar text is crisp white (#ffffff / rgba(255,255,255,0.85)) */
html.dark #global-navbar .app-nav-container a,
html.dark #global-navbar .app-nav-container button,
html.dark #global-navbar .app-nav-container span:not(.bg-amber-400):not(.bg-amber-500):not(.bg-amber-400\/20) {
  color: rgba(255, 255, 255, 0.85) !important;
}

html.dark #global-navbar .app-nav-container .brand-name {
  color: #ffffff !important;
}

html.dark #global-navbar .app-nav-container #cmd-trigger-btn,
html.dark #global-navbar .app-nav-container #theme-toggle {
  background-color: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  color: rgba(255, 255, 255, 0.85) !important;
}

.app-nav-link i,
.auth-nav-link i {
  font-size: 0.85rem;
  opacity: 0.8;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.app-nav-link:hover i,
.app-nav-link.active i,
.auth-nav-link:hover i,
.auth-nav-link.active i {
  opacity: 1;
  transform: scale(1.08);
}

/* Glassmorphism Action Buttons */
.icon-btn,
.cmd-trigger-btn {
  background: rgba(255, 255, 255, 0.5) !important;
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.7) !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.8), 0 2px 8px rgba(0, 0, 0, 0.04);
}

html.dark .icon-btn,
html.dark .cmd-trigger-btn {
  background: rgba(255, 255, 255, 0.06) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.12), 0 4px 12px rgba(0, 0, 0, 0.35);
}

.guest-actions {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.15rem;
  border-radius: 9999px;
  background: linear-gradient(135deg, #1c1917 0%, #292524 100%);
  color: #ffffff !important;
  font-size: 0.825rem;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.25);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

html.dark .guest-actions {
  background: linear-gradient(135deg, #fafaf9 0%, #e7e5e4 100%);
  color: #0a0a0a !important;
  border: 1px solid rgba(255, 255, 255, 0.4);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.4), inset 0 1px 1px rgba(255, 255, 255, 0.8);
}

.guest-actions:hover {
  opacity: 0.95;
  transform: translateY(-1px) scale(1.02);
}

/* ─── Global image safety ─── */
.card-media img,
.detail-hero img,
.hero-img,
.media-img,
[class*="card"] img,
[class*="media"] img {
  object-fit: cover !important;
  object-position: center !important;
}

/* ─── Hamburger button (hidden on desktop) ─── */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 4px;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  border-radius: 8px;
  transition: background 0.18s ease;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.nav-hamburger:hover {
  background: rgba(0, 0, 0, 0.06);
}

html.dark .nav-hamburger:hover {
  background: rgba(255, 255, 255, 0.1);
}

.nav-hamburger span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 9999px;
  background: hsl(var(--foreground));
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  transform-origin: center;
}

.nav-hamburger.is-open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.nav-hamburger.is-open span:nth-child(2) {
  opacity: 0;
  transform: scaleX(0);
}
.nav-hamburger.is-open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* ─── Mobile slide-over overlay ─── */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.mobile-nav-overlay.is-open {
  pointer-events: auto;
  opacity: 1;
}

.mobile-nav-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.35);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.mobile-nav-overlay__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(320px, 82vw);
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.95) 0%, rgba(250, 250, 249, 0.90) 100%);
  -webkit-backdrop-filter: blur(24px) saturate(200%);
  backdrop-filter: blur(24px) saturate(200%);
  border-left: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

html.dark .mobile-nav-overlay__panel {
  background: linear-gradient(165deg, rgba(20, 18, 15, 0.96) 0%, rgba(10, 10, 12, 0.92) 100%);
  border-left: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: -20px 0 60px rgba(0, 0, 0, 0.6);
}

.mobile-nav-overlay.is-open .mobile-nav-overlay__panel {
  transform: translateX(0);
}

.mobile-nav-overlay__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem 0.75rem;
  border-bottom: 1px solid hsl(var(--border));
  flex-shrink: 0;
}

.mobile-nav-overlay__brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  font-size: 1rem;
  color: hsl(var(--foreground));
  text-decoration: none;
  letter-spacing: -0.02em;
}

.mobile-nav-overlay__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 8px;
  border: 1px solid hsl(var(--border));
  background: hsl(var(--card));
  color: hsl(var(--muted-foreground));
  cursor: pointer;
  font-size: 1.1rem;
  transition: all 0.15s ease;
}

.mobile-nav-overlay__close:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.mobile-nav-overlay__links {
  display: flex;
  flex-direction: column;
  padding: 1rem 0.75rem;
  gap: 0.25rem;
  flex: 1;
}

.mobile-nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 10px;
  font-size: 0.92rem;
  font-weight: 500;
  color: hsl(var(--foreground));
  text-decoration: none;
  transition: all 0.15s ease;
}

.mobile-nav-link i {
  font-size: 0.9rem;
  opacity: 0.7;
  width: 18px;
  text-align: center;
}

.mobile-nav-link:hover {
  background: hsl(var(--muted));
}

.mobile-nav-link.active {
  background: hsl(var(--accent) / 0.12);
  color: hsl(var(--accent));
  font-weight: 600;
}

.mobile-nav-link.active i {
  opacity: 1;
}

.mobile-nav-link--cta {
  margin-top: 0.5rem;
  background: hsl(var(--foreground));
  color: hsl(var(--background));
  justify-content: center;
  font-weight: 700;
}

.mobile-nav-link--cta:hover {
  background: hsl(var(--foreground) / 0.85);
  color: hsl(var(--background));
}

.mobile-nav-divider {
  height: 1px;
  background: hsl(var(--border));
  margin: 0.5rem 0.75rem;
}

@media (max-width: 960px) {
  .app-nav-links,
  .auth-nav-links {
    display: none;
  }
  .app-nav-header,
  .auth-nav-header {
    padding: 0.75rem 1rem 0;
  }
  .app-nav-container,
  .auth-nav-container {
    padding: 0.4rem 0.85rem;
  }
  .nav-hamburger {
    display: flex;
  }
}

.topbar-right {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3, 0.75rem);
  margin-left: auto;
}

/* --- Universal Icon Button --- */
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  font-family: inherit;
  color: hsl(var(--foreground) / 0.8);
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-md, 8px);
  cursor: pointer;
  transition: all 0.18s ease;
  position: relative;
  flex-shrink: 0;
}

.icon-btn:hover {
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
  background: hsl(var(--accent) / 0.15);
}

.icon-btn:focus-visible {
  outline: 2px solid hsl(var(--accent));
  outline-offset: 2px;
}

.icon-btn svg {
  width: 17px;
  height: 17px;
  stroke-width: 2;
  transition: transform 0.2s ease;
}

.icon-btn:hover svg {
  transform: scale(1.08);
}

/* --- Theme Toggle Sun / Moon Visibility --- */
.icon-btn .icon-sun,
#theme-toggle .icon-sun,
.theme-toggle .icon-sun {
  display: block;
  color: #f59e0b;
}

.icon-btn .icon-moon,
#theme-toggle .icon-moon,
.theme-toggle .icon-moon {
  display: none;
  color: #f4f4f5;
}

html.dark .icon-btn .icon-sun,
html.dark #theme-toggle .icon-sun,
html.dark .theme-toggle .icon-sun,
:root[data-theme="dark"] .icon-btn .icon-sun,
:root[data-theme="dark"] #theme-toggle .icon-sun,
:root[data-theme="dark"] .theme-toggle .icon-sun {
  display: none !important;
}

html.dark .icon-btn .icon-moon,
html.dark #theme-toggle .icon-moon,
html.dark .theme-toggle .icon-moon,
:root[data-theme="dark"] .icon-btn .icon-moon,
:root[data-theme="dark"] #theme-toggle .icon-moon,
:root[data-theme="dark"] .theme-toggle .icon-moon {
  display: block !important;
}

/* --- Notification Wrap & Badge --- */
.notif-wrap {
  position: relative;
  display: inline-flex;
}

.notif-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  border-radius: 9999px;
  background: hsl(var(--destructive, 0 84% 60%));
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Ensure user-name and chip-name/chip-role in navbar are hidden as requested */
.user-name,
.chip-name,
.chip-role {
  display: none !important;
}

/* --- User Chip --- */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.2rem 0.55rem 0.2rem 0.2rem;
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: rgba(255, 255, 255, 0.08);
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: #ffffff;
  transition: all 0.15s ease;
  user-select: none;
  white-space: nowrap;
}

.chip:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.3);
}

.chip-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: hsl(var(--accent));
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  font-weight: 700;
  flex-shrink: 0;
  overflow: hidden;
}

.chip-name {
  color: hsl(var(--foreground));
  font-weight: 600;
}

.chip-role {
  color: hsl(var(--muted-foreground));
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: hsl(var(--muted));
  text-transform: capitalize;
}

/* --- User Dropdown Menu --- */
.user-menu {
  position: relative;
  display: inline-flex;
}

.user-menu-trigger {
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
}

.user-menu-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 210px;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg, 12px);
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.3);
  padding: 0.45rem;
  z-index: 1000;
  animation: userMenuFadeIn 0.15s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.user-menu-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  padding: 0.6rem 0.8rem;
  border-radius: var(--radius-md, 8px);
  border: none;
  background: none;
  color: hsl(var(--foreground));
  font-size: 0.85rem;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.12s, color 0.12s;
  text-align: left;
  box-sizing: border-box;
}

.user-menu-item svg {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  flex-shrink: 0;
}

.user-menu-item:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.user-menu-item.is-danger {
  color: hsl(var(--destructive, 0 84% 60%));
}

.user-menu-item.is-danger:hover {
  background: hsl(var(--destructive, 0 84% 60%) / 0.1);
  color: hsl(var(--destructive, 0 84% 60%));
}

.user-menu-divider {
  height: 1px;
  background: hsl(var(--border));
  margin: 0.35rem 0;
}

/* ══════════════════════════════════════════════════════════════
   GLOBAL COMMAND PALETTE & NOTIFICATION MODAL TOKENS
   ══════════════════════════════════════════════════════════════ */
.cmd-trigger-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-md, 8px);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.5);
  color: hsl(var(--muted-foreground));
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  user-select: none;
}

.cmd-trigger-btn:hover {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
}

.cmd-trigger-kbd {
  font-family: inherit;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  background: hsl(var(--background));
  border: 1px solid hsl(var(--border));
  color: hsl(var(--muted-foreground));
}

.cmd-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 9999999 !important;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(3rem, 12vh, 8rem);
  padding-left: 1rem;
  padding-right: 1rem;
  animation: cmdFadeIn 0.15s ease-out;
}

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

.cmd-dialog {
  width: 100%;
  max-width: 600px;
  max-height: 80vh;
  display: flex;
  flex-direction: column;
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg, 14px);
  box-shadow: 0 25px 60px -15px rgba(0, 0, 0, 0.6);
  overflow: hidden;
  animation: cmdSlideDown 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.cmd-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid hsl(var(--border));
  background: hsl(var(--card));
}

.cmd-header svg {
  width: 18px;
  height: 18px;
  color: hsl(var(--muted-foreground));
  flex-shrink: 0;
}

.cmd-input {
  flex: 1;
  border: none;
  background: transparent;
  color: hsl(var(--foreground));
  font-size: 0.95rem;
  font-family: inherit;
  outline: none;
}

.cmd-input::placeholder {
  color: hsl(var(--muted-foreground));
}

.cmd-esc-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  border: 1px solid hsl(var(--border));
}

.cmd-body {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem;
  max-height: 380px;
}

.cmd-group-title {
  padding: 0.5rem 0.65rem 0.25rem;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: hsl(var(--muted-foreground));
}

.cmd-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.75rem;
  border-radius: var(--radius-md, 8px);
  color: hsl(var(--foreground));
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.1s, color 0.1s;
  text-decoration: none;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
}

.cmd-item:hover, .cmd-item.is-selected {
  background: hsl(var(--muted));
  color: hsl(var(--foreground));
}

.cmd-item-left {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
}

.cmd-item-icon {
  width: 16px;
  height: 16px;
  opacity: 0.7;
  flex-shrink: 0;
}

.cmd-item-title {
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cmd-item-sub {
  font-size: 0.75rem;
  color: hsl(var(--muted-foreground));
  margin-left: 0.35rem;
}

.cmd-item-badge {
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 9999px;
  background: hsl(var(--muted));
  color: hsl(var(--muted-foreground));
  font-weight: 500;
  flex-shrink: 0;
}

.cmd-item-badge.badge-accent {
  background: hsl(var(--primary) / 0.15);
  color: hsl(var(--primary));
}

.cmd-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem 1rem;
  border-top: 1px solid hsl(var(--border));
  background: hsl(var(--muted) / 0.3);
  font-size: 0.72rem;
  color: hsl(var(--muted-foreground));
}

.cmd-footer-keys {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
/* =============================================================
   Responsive Navbar (global header) — nav controls overrun fix
   ============================================================= */
@media (max-width: 640px) {
  #global-navbar .app-nav-container,
  #global-navbar .auth-nav-container {
    padding-inline: 0.75rem;
    gap: 0.5rem;
  }
  #global-navbar .app-brand { gap: 0.5rem; }
  #global-navbar .brand-name { display: none; }
  #global-navbar #nav-controls-container { gap: 0.25rem; }
}
@media (max-width: 400px) {
  #nav-guest-cta { gap: 0.375rem; }
  #nav-guest-cta a { padding-inline: 0.75rem; }
}


/* =====================================================================
   LIGHT-MODE RECIPE — shared `.lm-*` classes (LM-01 Phase 0)
   Theme-agnostic; drive off tokens so they work in BOTH modes.
   Pages swap dark-first utility classes for these during phases 1-7.
   ===================================================================== */

.lm-card {
  background: hsl(var(--card));
  border: 1px solid hsl(var(--border));
  border-radius: var(--radius-lg);
  color: hsl(var(--card-foreground));
  box-shadow: var(--shadow-sm);
}

.lm-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: hsl(var(--primary));
  color: hsl(var(--primary-foreground));
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: opacity 0.2s var(--ease-out), transform 0.2s var(--ease-out), border-color 0.2s, background-color 0.2s, color 0.2s;
  white-space: nowrap;
}
.lm-btn:hover { opacity: 0.9; transform: translateY(-1px); }
.lm-btn:active { opacity: 1; transform: translateY(0); }
.lm-btn:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }

.lm-btn--ghost {
  background: transparent;
  color: hsl(var(--muted-foreground));
  border-color: hsl(var(--border));
}
.lm-btn--ghost:hover { color: hsl(var(--foreground)); border-color: hsl(var(--ring)); }

.lm-btn--accent {
  background: hsl(var(--accent));
  color: hsl(var(--accent-foreground));
}

.lm-input {
  width: 100%;
  padding: 0.625rem 0.875rem;
  border: 1px solid hsl(var(--input));
  border-radius: var(--radius-md);
  background: hsl(var(--card));
  color: hsl(var(--foreground));
  font-size: 0.875rem;
  font-family: var(--font-body, inherit);
  transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s, color 0.2s;
}
.lm-input::placeholder { color: hsl(var(--muted-foreground)); }
.lm-input:focus {
  outline: none;
  border-color: hsl(var(--ring));
  box-shadow: 0 0 0 3px hsl(var(--ring) / 0.15);
}

.lm-muted { color: hsl(var(--muted-foreground)); font-size: 0.875rem; }

.lm-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-full);
  border: 1px solid hsl(var(--border));
  background: hsl(var(--secondary));
  color: hsl(var(--secondary-foreground));
  font-size: 0.8125rem;
  font-weight: 500;
  white-space: nowrap;
}
.lm-chip--gold {
  border-color: hsl(var(--accent) / 0.4);
  color: hsl(var(--accent-foreground));
}
