/* ==========================================================================
   WorkForce Direct — Elite Design System (UI & UX Overhaul)
   Palette: Deep Midnight Navy + Industrial Amber/Gold + Fresh Mint Emerald
   ========================================================================== */

:root {
  /* Brand Identity (Midnight Navy & Vibrant Amber) */
  --brand: #0B132B;
  --brand-light: #162447;
  --brand-lighter: #1F3160;
  --brand-surface: #070B18;
  
  --accent: #F59E0B;
  --accent-hover: #D97706;
  --accent-light: #FEF3C7;
  --accent-dark: #B45309;
  --accent-glow: rgba(245, 158, 11, 0.35);
  
  /* Neutral Canvas & Surfaces */
  --bg: #F8FAFC;
  --card: #FFFFFF;
  --card-subtle: #F1F5F9;
  --border: #E2E8F0;
  --border-focus: #162447;
  
  /* Text & Typography */
  --ink: #0F172A;
  --ink-soft: #475569;
  --ink-subtle: #94A3B8;
  
  /* Semantic Colors */
  --green: #10B981;
  --green-bg: #ECFDF5;
  --green-border: #A7F3D0;
  
  --amber: #F59E0B;
  --amber-bg: #FFFBEB;
  --amber-border: #FDE68A;
  
  --red: #EF4444;
  --red-bg: #FEF2F2;
  --red-border: #FECACA;
  
  --blue: #3B82F6;
  --blue-bg: #EFF6FF;
  --blue-border: #BFDBFE;

  /* Aliases for backwards-compatibility */
  --navy: var(--brand);
  --navy-2: var(--brand-light);
  --navy-3: var(--brand-lighter);
  --hivis: var(--accent);
  --hivis-dark: var(--accent-hover);

  /* Geometry & Shadows */
  --radius-xs: 5px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 22px;
  --radius-full: 9999px;
  
  --shadow-xs: 0 1px 2px rgba(11, 19, 43, 0.04);
  --shadow-sm: 0 2px 5px rgba(11, 19, 43, 0.05), 0 1px 2px rgba(11, 19, 43, 0.03);
  --shadow: 0 4px 14px -2px rgba(11, 19, 43, 0.08), 0 2px 4px -1px rgba(11, 19, 43, 0.03);
  --shadow-md: 0 10px 24px -4px rgba(11, 19, 43, 0.10), 0 4px 8px -2px rgba(11, 19, 43, 0.04);
  --shadow-lg: 0 20px 38px -8px rgba(11, 19, 43, 0.14), 0 8px 14px -4px rgba(11, 19, 43, 0.05);
  --shadow-focus: 0 0 0 3.5px rgba(22, 36, 71, 0.18);

  --transition-fast: 0.15s ease;
  --transition: 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Dark Theme Overrides ---------- */
body.theme-dark {
  --brand: #E2E8F0;
  --brand-light: #CBD5E1;
  --brand-lighter: #94A3B8;
  --brand-surface: #070B18;
  
  --accent: #FBBF24;
  --accent-hover: #F59E0B;
  --accent-light: rgba(251, 191, 36, 0.14);
  --accent-dark: #FDE68A;
  --accent-glow: rgba(251, 191, 36, 0.35);

  --bg: #090D16;
  --card: #0F172A;
  --card-subtle: #1E293B;
  --border: rgba(255, 255, 255, 0.09);
  --border-focus: #FBBF24;

  --ink: #F8FAFC;
  --ink-soft: #C2CDDA;
  --ink-subtle: #A0AEC0;

  --green: #34D399;
  --green-bg: rgba(16, 185, 129, 0.16);
  --green-border: rgba(52, 211, 153, 0.3);

  --amber: #FBBF24;
  --amber-bg: rgba(245, 158, 11, 0.16);
  --amber-border: rgba(251, 191, 36, 0.3);

  --red: #F87171;
  --red-bg: rgba(239, 68, 68, 0.16);
  --red-border: rgba(248, 113, 113, 0.3);

  --blue: #60A5FA;
  --blue-bg: rgba(59, 130, 246, 0.18);
  --blue-border: rgba(96, 165, 250, 0.3);

  --navy: #F8FAFC;
  --navy-2: #E2E8F0;
  --navy-3: #CBD5E1;
  --hivis: var(--accent);
  --hivis-dark: var(--accent-hover);

  --shadow: 0 4px 20px rgba(0, 0, 0, 0.45);
  --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 22px 45px rgba(0, 0, 0, 0.65);
  --shadow-focus: 0 0 0 3.5px rgba(251, 191, 36, 0.25);
}

/* ==========================================================================
   Base & Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
}

html {
  height: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
  -webkit-overflow-scrolling: touch;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14.5px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, .display {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin-top: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast);
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  padding: 10px 18px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  line-height: 1.3;
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.btn:active {
  transform: translateY(1px) scale(0.99);
}

.btn:focus-visible {
  outline: none;
  box-shadow: var(--shadow-focus);
}

.btn-primary {
  background: var(--accent);
  color: #0B132B;
  border-color: rgba(0, 0, 0, 0.04);
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.35);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.45);
  transform: translateY(-1px);
}

.btn-dark {
  background: #111E38;
  color: #FFFFFF;
  box-shadow: 0 2px 8px rgba(17, 30, 56, 0.28);
}

body.theme-dark .btn-dark {
  background: var(--accent);
  color: #0B132B;
}

.btn-dark:hover {
  background: #1B2F57;
  transform: translateY(-1px);
}

body.theme-dark .btn-dark:hover {
  background: var(--accent-hover);
}

.btn-light {
  background: #FFFFFF;
  color: #111E38;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.btn-light:hover {
  background: #F1F5F9;
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--ink);
}

.btn-outline:hover {
  border-color: var(--ink-soft);
  background: rgba(0, 0, 0, 0.025);
}

body.theme-dark .btn-outline:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-ghost {
  background: transparent;
  color: var(--ink-soft);
  padding: 8px 12px;
}

.btn-ghost:hover {
  color: var(--ink);
  background: rgba(0, 0, 0, 0.04);
}

body.theme-dark .btn-ghost:hover {
  background: rgba(255, 255, 255, 0.05);
}

.btn-danger {
  background: var(--red-bg);
  color: var(--red);
  border-color: var(--red-border);
}

.btn-danger:hover {
  background: rgba(239, 68, 68, 0.22);
}

.btn-sm {
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--radius-xs);
}

.btn-block {
  width: 100%;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

.theme-toggle {
  background: var(--card);
  border-color: var(--border);
  color: var(--ink);
  border-radius: var(--radius-full);
  padding: 8px 14px;
  font-size: 13px;
}

.theme-toggle:hover {
  border-color: var(--ink-soft);
  background: var(--card-subtle);
}

/* ==========================================================================
   Form Controls & Inputs
   ========================================================================== */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.field input, 
.field select, 
.field textarea,
.toolbar input, 
.toolbar select {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  color: var(--ink);
  font-size: 14.5px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.field input::placeholder,
.field textarea::placeholder,
.toolbar input::placeholder {
  color: var(--ink-subtle);
}

.field input:focus, 
.field select:focus, 
.field textarea:focus,
.toolbar input:focus, 
.toolbar select:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}

.field textarea {
  resize: vertical;
  min-height: 84px;
  line-height: 1.5;
}

.form-grid2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
}

.form-error {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  margin-bottom: 16px;
}

.form-note {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-border);
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  margin-bottom: 16px;
  line-height: 1.5;
}

.duration-control {
  display: flex;
  align-items: stretch;
  width: 100%;
  min-height: 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.duration-control:focus-within {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}

.duration-control input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 10px 14px;
  color: var(--ink);
}

.duration-control input:focus {
  outline: none;
}

.duration-control select {
  width: auto;
  min-width: 110px;
  border: none;
  border-left: 1.5px solid var(--border);
  background: var(--card-subtle);
  color: var(--ink);
  font-weight: 600;
  padding: 10px 12px;
}

.duration-control select:focus {
  outline: none;
}

.hours-range {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.time-entry {
  min-width: 0;
}

.time-entry > span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--ink-subtle);
  margin-bottom: 4px;
}

.time-entry input {
  width: 100%;
}

.hours-range > span {
  color: var(--ink-subtle);
  font-weight: 600;
  font-size: 13px;
  margin-top: 16px;
}

.postal-lookup-status {
  margin: -4px 0 16px;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
}

.skills-input {
  display: flex;
  gap: 8px;
  margin-bottom: 8px;
}

.skill-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card-subtle);
  border: 1px solid var(--border);
  padding: 4px 10px 4px 12px;
  border-radius: var(--radius-full);
  font-size: 12.5px;
  font-weight: 500;
  margin: 3px 6px 3px 0;
  color: var(--ink);
}

.skill-chip button {
  background: none;
  border: none;
  color: var(--ink-subtle);
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
}

.skill-chip button:hover {
  color: var(--red);
}

/* ==========================================================================
   Header & Topbar
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 19, 43, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding: 14px max(24px, calc((100vw - 1280px)/2));
  display: flex;
  align-items: center;
  justify-content: space-between;
}

body.theme-dark .topbar {
  background: rgba(9, 13, 22, 0.94);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #FFFFFF;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand .mark {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #0B132B;
  font-size: 19px;
  box-shadow: 0 2px 10px rgba(245, 158, 11, 0.4);
}

.brand-text {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.brand-badge {
  font-size: 10px;
  letter-spacing: 0.1em;
  font-weight: 800;
  color: var(--accent);
  background: rgba(245, 158, 11, 0.16);
  padding: 2px 6px;
  border-radius: 4px;
}

.topnav {
  display: flex;
  gap: 12px;
  align-items: center;
}

.topnav .nav-link {
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 500;
  font-size: 14px;
}

.topnav .nav-link:hover {
  color: var(--accent);
}

.topnav .btn-outline {
  border-color: rgba(255, 255, 255, 0.22);
  color: #FFFFFF;
}

.topnav .theme-toggle {
  background: var(--card);
  border-color: var(--border);
  color: var(--ink);
}

.topnav .btn-outline:hover {
  border-color: #FFFFFF;
  background: rgba(255, 255, 255, 0.08);
}

.topnav .theme-toggle:hover {
  border-color: var(--ink-soft);
  background: var(--card-subtle);
}

.mobile-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  font-weight: 700;
}

.mobile-menu-toggle:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: 48px;
  min-height: 600px;
  padding: 88px max(24px, calc((100vw - 1240px)/2));
  background: #0B132B url("https://images.unsplash.com/photo-1504307651254-35680f356dfd?auto=format&fit=crop&w=2200&q=88") center/cover no-repeat;
  color: #FFFFFF;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(135deg, rgba(8, 14, 30, 0.92) 0%, rgba(17, 30, 56, 0.82) 100%);
}

.hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #FFD27C;
  background: rgba(255, 210, 124, 0.12);
  padding: 4px 12px;
  border-radius: var(--radius-full);
  margin-bottom: 18px;
  border: 1px solid rgba(255, 210, 124, 0.25);
}

.hero h1 {
  font-size: clamp(38px, 5.2vw, 62px);
  color: #FFFFFF;
  line-height: 1.08;
  margin: 0 0 20px;
  letter-spacing: -0.03em;
}

.hero p.lead {
  font-size: 17.5px;
  color: rgba(255, 255, 255, 0.88);
  max-width: 52ch;
  line-height: 1.6;
  margin: 0 0 32px;
}

.hero-ctas {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-stats {
  display: flex;
  gap: 16px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.hero-stats .stat {
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  padding: 14px 20px;
  min-width: 140px;
}

.hero-stats .stat b {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: #FFFFFF;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.hero-stats .stat span {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* Glassmorphic Live Job Feed Card */
.hero-visual {
  display: block;
  background: rgba(17, 30, 56, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-lg), inset 0 1px 1px rgba(255, 255, 255, 0.1);
  color: #FFFFFF;
}

.hero-visual-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 14px;
  margin-bottom: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 700;
  color: #34D399;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #34D399;
  box-shadow: 0 0 10px #34D399;
  animation: pulse-dot 1.8s infinite;
}

@keyframes pulse-dot {
  0% { transform: scale(0.9); opacity: 0.7; }
  50% { transform: scale(1.3); opacity: 1; }
  100% { transform: scale(0.9); opacity: 0.7; }
}

.job-tick {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  margin-bottom: 8px;
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13.5px;
  transition: background var(--transition-fast);
}

.job-tick:hover {
  background: rgba(255, 255, 255, 0.09);
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
}

.tag-open {
  background: var(--accent);
  color: #0B132B;
}

/* ==========================================================================
   Sections & Content Layouts
   ========================================================================== */
.section {
  max-width: 1240px;
  margin: 0 auto;
  padding: 80px 24px;
}

.section-head {
  text-align: center;
  max-width: 720px;
  margin: 0 auto 52px;
}

.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 10px;
}

.section h2 {
  font-size: clamp(28px, 3.4vw, 40px);
  margin-bottom: 12px;
}

.section .sub {
  color: var(--ink-soft);
  font-size: 16px;
  margin: 0 auto;
  line-height: 1.6;
}

.grid3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.grid4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

/* Feature Cards */
.feature {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 32px 28px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.feature:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-lighter);
}

.feature .icon {
  width: 50px;
  height: 50px;
  border-radius: var(--radius-sm);
  background: var(--brand-light);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin-bottom: 20px;
  box-shadow: 0 4px 12px rgba(22, 36, 71, 0.2);
}

body.theme-dark .feature .icon {
  background: rgba(255, 255, 255, 0.08);
}

.feature h3 {
  font-size: 20px;
  margin-bottom: 8px;
}

.feature p {
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   Home Page: Popular Trades Grid
   ========================================================================== */
.trades-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.trade-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
  cursor: pointer;
}

.trade-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--accent);
}

.trade-icon-box {
  width: 46px;
  height: 46px;
  border-radius: var(--radius-sm);
  background: var(--card-subtle);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin-bottom: 16px;
}

.trade-card h3 {
  font-size: 18px;
  margin: 0 0 6px;
}

.trade-card p {
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0 0 16px;
  flex: 1;
}

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

.trade-wage-tag {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--green);
}

.trade-action-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ==========================================================================
   Home Page: Step-by-Step "How It Works"
   ========================================================================== */
.workflow-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  position: relative;
}

.workflow-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 24px;
  box-shadow: var(--shadow-sm);
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.workflow-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.workflow-step-num {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 38px;
  font-weight: 800;
  line-height: 1;
  color: rgba(245, 158, 11, 0.35);
  margin-bottom: 14px;
}

body.theme-dark .workflow-step-num {
  color: rgba(251, 191, 36, 0.4);
}

.workflow-card h3 {
  font-size: 19px;
  margin-bottom: 8px;
}

.workflow-card p {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}

/* ==========================================================================
   Home Page: Trust & Guarantees
   ========================================================================== */
.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.trust-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px 22px;
  box-shadow: var(--shadow-sm);
}

.trust-card .trust-icon {
  font-size: 30px;
  margin-bottom: 14px;
}

.trust-card h3 {
  font-size: 17px;
  margin-bottom: 6px;
}

.trust-card p {
  color: var(--ink-soft);
  font-size: 13.5px;
  line-height: 1.5;
  margin: 0;
}

/* Role Selector Cards */
.role-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.role-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 34px 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.role-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--brand-lighter);
}

.role-card h3 {
  font-size: 24px;
  margin-bottom: 8px;
}

.role-card p {
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
  margin: 0 0 24px;
  flex: 1;
}

/* ==========================================================================
   Home Page: Verified Social Proof / Reviews
   ========================================================================== */
.reviews-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.review-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}

.review-stars {
  color: var(--accent);
  font-size: 15px;
  margin-bottom: 14px;
}

.review-quote {
  color: var(--ink);
  font-size: 14.5px;
  line-height: 1.6;
  margin: 0 0 20px;
  flex: 1;
  font-style: italic;
}

.review-author {
  display: flex;
  align-items: center;
  gap: 12px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}

.review-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--card-subtle);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
}

.review-author h4 {
  font-size: 14px;
  margin: 0;
}

.review-author span {
  font-size: 12px;
  color: var(--ink-soft);
}

/* ==========================================================================
   Home Page: Interactive FAQ
   ========================================================================== */
.faq-grid {
  max-width: 840px;
  margin: 0 auto;
  display: grid;
  gap: 14px;
}

.faq-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  transition: border-color var(--transition-fast);
}

.faq-card:hover {
  border-color: var(--brand-lighter);
}

.faq-trigger {
  width: 100%;
  text-align: left;
  padding: 18px 22px;
  background: transparent;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.faq-icon {
  font-size: 18px;
  color: var(--accent);
  transition: transform var(--transition-fast);
}

.faq-card.open .faq-icon {
  transform: rotate(45deg);
}

.faq-content {
  padding: 0 22px 20px;
  color: var(--ink-soft);
  font-size: 14.5px;
  line-height: 1.6;
  display: none;
}

.faq-card.open .faq-content {
  display: block;
}

/* ==========================================================================
   Home Page: Call to Action Banner
   ========================================================================== */
.cta-banner {
  background: linear-gradient(135deg, #0B132B 0%, #162447 100%);
  border-radius: var(--radius-xl);
  padding: 64px 44px;
  color: #FFFFFF;
  text-align: center;
  box-shadow: var(--shadow-lg);
  border: 1px solid rgba(255, 255, 255, 0.1);
  position: relative;
  overflow: hidden;
}

.cta-banner::before {
  content: "";
  position: absolute;
  top: -80px;
  right: -80px;
  width: 260px;
  height: 260px;
  background: var(--accent);
  opacity: 0.12;
  border-radius: 50%;
  filter: blur(50px);
}

.cta-banner h2 {
  color: #FFFFFF;
  font-size: clamp(30px, 3.8vw, 46px);
  margin-bottom: 14px;
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.88);
  font-size: 17px;
  max-width: 54ch;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.cta-buttons {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
}

/* ==========================================================================
   Multi-Column Professional Footer
   ========================================================================== */
.site-footer-rich {
  background: #0B132B;
  color: rgba(255, 255, 255, 0.85);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 72px max(24px, calc((100vw - 1240px)/2)) 28px;
}

body.theme-dark .site-footer-rich {
  background: #070A12;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.2fr;
  gap: 48px;
  margin-bottom: 56px;
}

.footer-col h4 {
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0 0 18px;
}

.footer-col p {
  font-size: 14px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  margin: 0 0 18px;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 10px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
  transition: color var(--transition-fast);
}

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

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

/* Legacy single-line footer compatibility */
.site-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding: 24px max(24px, calc((100vw - 1200px)/2));
  border-top: 1px solid var(--border);
  background: var(--card);
  color: var(--ink-soft);
  font-size: 13px;
}

.social-links {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.social-links a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 600;
  font-size: 12.5px;
}

.site-footer-rich .social-links a {
  border-color: rgba(255, 255, 255, 0.28);
  color: #F8FAFC;
}

.site-footer-rich .social-links a:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.55);
  color: #FFFFFF;
}

.social-links a:hover {
  background: var(--card-subtle);
  border-color: var(--ink-soft);
}

.social-links img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

/* ==========================================================================
   App Shell (Dashboards)
   ========================================================================== */
.app-shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 260px;
  background: #0B132B;
  color: #FFFFFF;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  padding: 22px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

body.theme-dark .sidebar {
  background: #080D18;
}

.sidebar .brand {
  margin-bottom: 24px;
  padding: 0 8px;
}

.sidebar-bar {
  display: block;
}

body.website-dashboard .bottom-navigation {
  display: none !important;
}

@media (min-width: 601px) {
  body.website-homepage > .topbar:not(.menu-open) > .topnav .site-nav-links {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
    align-items: stretch;
    gap: 0;
    width: 100%;
    min-width: 0;
  }

  body.website-homepage > .topbar.has-user-session:not(.menu-open) > .topnav .site-nav-links {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  body.website-homepage > .topbar:not(.menu-open) > .topnav .site-nav-links > .nav-link,
  body.website-homepage > .topbar:not(.menu-open) > .topnav .site-nav-links #nav-guest-bar .btn {
    width: 100%;
    min-width: 0;
    justify-content: center;
    text-align: center;
  }
}

.website-dashboard-menu-toggle {
  display: none;
}

.website-app-download {
  position: fixed;
  z-index: 70;
  right: 16px;
  bottom: calc(78px + env(safe-area-inset-bottom, 0px));
  white-space: nowrap;
  box-shadow: var(--shadow-lg);
}

.side-menu-panel {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
}

.side-user {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: var(--radius-sm);
  margin-bottom: 22px;
}

.side-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent);
  color: #0B132B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 800;
  font-size: 14px;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.35);
}

.side-avatar.profile-avatar-photo,
.tracking-avatar.profile-avatar-photo,
.profile-avatar-small.profile-avatar-photo {
  overflow: hidden;
  padding: 0;
}

.profile-avatar-photo img {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  object-fit: cover;
}

.profile-photo-control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.profile-photo-picker {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}

.profile-photo-picker:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

.profile-photo-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.profile-photo-label,
.profile-photo-remove {
  color: var(--ink-soft);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  text-align: center;
}

.profile-photo-remove {
  padding: 2px 4px;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}

.profile-photo-label:hover,
.profile-photo-remove:hover {
  color: var(--accent);
}

.profile-photo-control-sidebar .profile-photo-label,
.profile-photo-control-sidebar .profile-photo-remove {
  color: #E2E8F0;
}

.profile-photo-control-home {
  flex-direction: row;
  gap: 5px;
}

.profile-photo-control-home .profile-photo-picker {
  flex-direction: row;
  gap: 5px;
}

.profile-photo-control-home .side-avatar {
  width: 32px;
  height: 32px;
  font-size: 12px;
}

.profile-photo-control-home .profile-photo-label,
.profile-photo-control-home .profile-photo-remove {
  color: #FFFFFF;
}

.user-name-with-photo {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.profile-avatar-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex: 0 0 30px;
  border-radius: 50%;
  background: var(--accent);
  color: #0B132B;
  font-size: 10px;
  font-weight: 800;
}

.profile-crop-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  background: rgba(5, 12, 27, 0.78);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.profile-crop-dialog {
  width: min(100%, 400px);
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-lg);
}

.profile-crop-dialog h2 {
  margin: 0 0 6px;
  color: var(--ink);
  font-size: 21px;
}

.profile-crop-help {
  margin: 0 0 16px;
  color: var(--ink-soft);
  font-size: 13px;
}

.profile-crop-frame {
  position: relative;
  width: min(100%, 300px);
  height: min(300px, 62vw);
  aspect-ratio: 1;
  margin: 0 auto 18px;
  overflow: hidden;
  border-radius: 50%;
  background: #080D18;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.profile-crop-frame:active {
  cursor: grabbing;
}

.profile-crop-image {
  position: absolute;
  top: 50%;
  left: 50%;
  max-width: none;
  max-height: none;
  transform: translate(-50%, -50%);
  pointer-events: none;
  user-select: none;
}

.profile-crop-guide {
  position: absolute;
  inset: 0;
  border: 2px solid rgba(255, 255, 255, 0.82);
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.26);
  pointer-events: none;
}

.profile-crop-zoom-label {
  display: flex;
  justify-content: space-between;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 700;
}

.profile-crop-zoom {
  min-width: 0;
  display: block;
  width: 100%;
  margin: 0;
  accent-color: var(--accent);
}

.profile-crop-zoom-controls {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
}

.profile-crop-zoom-controls .btn {
  width: 42px;
  min-width: 42px;
  min-height: 42px;
  padding: 6px;
  font-size: 20px;
}

.profile-crop-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-height: 700px) {
  .profile-crop-frame {
    width: min(58vh, 260px);
    height: min(58vh, 260px);
  }
}

.side-user-name {
  margin: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: #FFFFFF;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.side-role-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}

.side-role-badge.role-admin { background: rgba(167, 139, 250, 0.22); color: #C4B5FD; }
.side-role-badge.role-client { background: rgba(96, 165, 250, 0.22); color: #93C5FD; }
.side-role-badge.role-worker { background: rgba(52, 211, 153, 0.22); color: #6EE7B7; }

.side-navigation {
  flex: 1;
  min-height: 0;
}

.navlist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 4px;
}

.navlist button, 
.navlist a {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.72);
  text-decoration: none;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.navlist button:hover, 
.navlist a:hover {
  background: rgba(255, 255, 255, 0.07);
  color: #FFFFFF;
}

.navlist button.active, 
.navlist a.active {
  background: var(--accent);
  color: #0B132B;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(245, 158, 11, 0.35);
}

.navlist .ico {
  font-size: 16px;
  display: flex;
  align-items: center;
}

.logout-btn {
  width: 100%;
  color: rgba(255, 255, 255, 0.75);
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.16);
  padding: 10px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.logout-btn:hover {
  color: #FFFFFF;
  border-color: rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.06);
}

.main {
  flex: 1;
  min-width: 0;
  background: var(--bg);
}

.main-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--card);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 20px 36px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.header-copy {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.header-kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  color: var(--green);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.kicker-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
}

.main-header h1 {
  font-size: 26px;
  margin: 0;
}

.main-header p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 13.5px;
}

.main-body {
  padding: 28px 36px 64px;
  max-width: 1440px;
}

/* ==========================================================================
   KPI Cards & Panels
   ========================================================================== */
.cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.kpi {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.kpi b {
  display: block;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 32px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 4px;
}

.kpi span {
  font-size: 12px;
  color: var(--ink-soft);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.panel-head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.panel-head h3 {
  margin: 0;
  font-size: 20px;
}

.panel-head .sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.panel-body {
  padding: 24px;
}

.toolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar input, 
.toolbar select {
  padding: 8px 14px;
  min-height: 38px;
  font-size: 13.5px;
}

/* ==========================================================================
   Tables
   ========================================================================== */
.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
}

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.8px;
}

thead th {
  text-align: left;
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
  padding: 12px 16px;
  font-weight: 700;
  border-bottom: 1.5px solid var(--border);
  background: var(--card-subtle);
}

tbody td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:last-child td {
  border-bottom: none;
}

tbody tr {
  transition: background var(--transition-fast);
}

tbody tr:hover {
  background: rgba(0, 0, 0, 0.018);
}

body.theme-dark tbody tr:hover {
  background: rgba(255, 255, 255, 0.035);
}

.cell-name {
  font-weight: 600;
  color: var(--ink);
}

.cell-sub {
  font-size: 12px;
  color: var(--ink-soft);
}

/* ==========================================================================
   Badges, Chips, Tags
   ========================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-full);
  font-size: 11.5px;
  font-weight: 700;
  line-height: 1.2;
}

.badge-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.badge-verified {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.badge-pending {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}

.badge-rejected {
  background: var(--red-bg);
  color: var(--red);
  border: 1px solid var(--red-border);
}

.badge-open {
  background: var(--amber-bg);
  color: var(--amber);
  border: 1px solid var(--amber-border);
}

.badge-assigned {
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid var(--blue-border);
}

.badge-completed {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid var(--green-border);
}

.badge-closed {
  background: rgba(0, 0, 0, 0.06);
  color: var(--ink-soft);
  border: 1px solid var(--border);
}

body.theme-dark .badge-closed {
  background: rgba(255, 255, 255, 0.06);
}

.chip {
  display: inline-block;
  background: var(--card-subtle);
  border: 1px solid var(--border);
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  margin: 2px 4px 2px 0;
  color: var(--ink);
}

/* ==========================================================================
   Job Cards
   ========================================================================== */
.job-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

.job-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--brand-lighter);
}

.job-card h4 {
  margin: 0 0 6px;
  font-size: 19px;
}

.job-card .meta {
  font-size: 12.8px;
  color: var(--ink-soft);
  margin-bottom: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
}

.job-card p {
  margin: 0;
  font-size: 14px;
  color: var(--ink);
  max-width: 65ch;
  line-height: 1.55;
}

.job-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-end;
  flex-shrink: 0;
}

.job-alert-panel {
  background: var(--amber-bg);
  border-left: 5px solid var(--accent);
  box-shadow: 0 8px 24px rgba(245, 158, 11, 0.16);
  color: var(--ink);
}

.job-alert-panel .panel-head,
.job-alert-panel .panel-body {
  background: transparent;
}

/* ==========================================================================
   Modals & Overlays
   ========================================================================== */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(11, 19, 43, 0.72);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 20px;
  animation: fadeIn 0.2s ease-out;
}

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

.modal {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 460px;
  padding: 34px 32px 28px;
  box-shadow: var(--shadow-lg);
  max-height: 90vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  position: relative;
  animation: modalScale 0.24s cubic-bezier(0.16, 1, 0.3, 1);
}

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

.welcome-overlay {
  position: fixed;
  inset: 0;
  z-index: 99;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(5, 12, 27, 0.72);
  backdrop-filter: blur(9px);
  -webkit-backdrop-filter: blur(9px);
  animation: fadeIn 0.24s ease-out;
}

.welcome-card {
  position: relative;
  isolation: isolate;
  width: min(100%, 480px);
  overflow: hidden;
  padding: 34px 32px 28px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 26px;
  background:
    radial-gradient(ellipse at 100% 0%, rgba(245, 158, 11, 0.24), transparent 44%),
    linear-gradient(145deg, #162447, #0B132B 68%);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42), inset 0 1px rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  text-align: center;
  animation: modalScale 0.38s cubic-bezier(0.16, 1, 0.3, 1);
}

.welcome-mark {
  display: grid;
  place-items: center;
  width: 66px;
  height: 66px;
  margin: 0 auto 18px;
  border: 1px solid rgba(255, 210, 124, 0.36);
  border-radius: 21px;
  background: rgba(255, 210, 124, 0.12);
  box-shadow: 0 10px 32px rgba(245, 158, 11, 0.18);
  font-size: 34px;
}

.welcome-kicker {
  margin: 0 0 10px;
  color: #FFD27C;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.welcome-card h2 {
  margin: 0 0 12px;
  color: #FFFFFF;
  font-size: clamp(25px, 6vw, 32px);
  letter-spacing: -0.035em;
  line-height: 1.16;
}

.welcome-card h2 span {
  color: #FFD27C;
}

.welcome-card > p:not(.welcome-kicker) {
  max-width: 36ch;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.78);
  font-size: 14px;
  line-height: 1.65;
}

.welcome-close {
  position: absolute;
  top: 14px;
  right: 14px;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #FFFFFF;
  cursor: pointer;
}

.welcome-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 24px;
}

.welcome-login {
  margin-top: 16px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.welcome-close:hover,
.welcome-login:hover {
  color: #FFFFFF;
}

.modal.modalform {
  max-width: 600px;
}

.modal h2 {
  margin: 0 0 4px;
  font-size: 26px;
}

.modal .sub {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 22px;
}

.closeX {
  position: absolute;
  top: 18px;
  right: 18px;
  background: var(--card-subtle);
  border: 1px solid var(--border);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.closeX:hover {
  background: var(--border);
  color: var(--ink);
}

.authtabs {
  display: flex;
  gap: 6px;
  background: var(--card-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  margin-bottom: 22px;
}

.authtabs button {
  flex: 1;
  border: none;
  background: transparent;
  padding: 10px;
  border-radius: var(--radius-xs);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-weight: 600;
  font-size: 14px;
  color: var(--ink-soft);
  transition: background var(--transition-fast), color var(--transition-fast), box-shadow var(--transition-fast);
}

.authtabs button.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.rolepick {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}

.rolepick label {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 8px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink-soft);
  transition: border-color var(--transition-fast), background var(--transition-fast), color var(--transition-fast);
}

.rolepick input {
  display: none;
}

.rolepick label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-light);
  color: #0B132B;
}

/* Demo Logins Quick Select */
.demo-logins {
  margin-top: 14px;
  margin-bottom: 14px;
  padding: 12px 14px;
  background: var(--card-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

.demo-logins span {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

.demo-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.demo-pill {
  padding: 4px 10px;
  font-size: 12px;
  background: var(--card);
}

/* ==========================================================================
   Toasts & Empty States
   ========================================================================== */
.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #0B132B;
  color: #FFFFFF;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-size: 14px;
  font-weight: 600;
  z-index: 200;
  box-shadow: var(--shadow-lg), 0 0 0 1px rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn 0.28s cubic-bezier(0.16, 1, 0.3, 1);
}

body.theme-dark .toast {
  background: #111E38;
  color: #FFFFFF;
}

.toast.toast-out {
  animation: toastOut 0.25s forwards;
}

.toast-icon {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--accent);
  color: #0B132B;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

@keyframes toastIn {
  from { opacity: 0; transform: translate(-50%, 16px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}

@keyframes toastOut {
  from { opacity: 1; transform: translate(-50%, 0); }
  to { opacity: 0; transform: translate(-50%, 14px); }
}

.empty {
  text-align: center;
  padding: 56px 20px;
  color: var(--ink-soft);
}

.empty .big {
  font-size: 40px;
  margin-bottom: 12px;
}

.empty b {
  font-size: 16px;
  color: var(--ink);
}

.empty p {
  margin: 6px 0 16px;
  font-size: 14px;
}

/* ==========================================================================
   Wallet & Settlements
   ========================================================================== */
.period-tabs {
  display: inline-flex;
  gap: 4px;
  margin: 16px 0;
  padding: 4px;
  background: var(--card-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.period-tabs button {
  min-height: 36px;
  padding: 7px 14px;
  border: none;
  border-radius: var(--radius-xs);
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

.period-tabs button.active {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow-xs);
}

.wallet-period-summary {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.wallet-amount {
  color: var(--green);
  font-weight: 700;
  white-space: nowrap;
}

.settlement-note {
  margin-bottom: 18px;
  padding: 14px 16px;
  border-left: 4px solid var(--accent);
  background: var(--amber-bg);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
  font-size: 13.5px;
}

.settlement-row + .settlement-row {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.settlement-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin: 16px 0;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.settlement-metrics span {
  color: var(--ink-soft);
  font-size: 12px;
}

.settlement-metrics b {
  color: var(--ink);
  font-size: 15px;
}

.settlement-action {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.social-settings {
  padding: 18px;
  background: var(--card-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: 10px;
}

/* ==========================================================================
   Responsive Adaptations
   ========================================================================== */
@media (max-width: 1080px) {
  .trades-grid, .workflow-grid, .trust-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px;
  }
}

@media (max-width: 960px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 64px 20px;
    gap: 36px;
  }
  .grid3, .role-cards, .reviews-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 840px) {
  .app-shell {
    flex-direction: column;
  }
  .sidebar {
    position: sticky;
    top: 0;
    z-index: 40;
    width: 100%;
    height: auto;
    display: block;
    padding: 10px 16px;
    overflow: visible;
  }
  .sidebar-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
  }
  .sidebar .mobile-menu-toggle {
    display: inline-flex;
  }
  .website-dashboard-menu-toggle {
    display: inline-flex;
    min-width: 64px;
    min-height: 48px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 12px;
    border: 0;
    border-radius: 10px;
    background: #111d2b;
    color: rgba(255, 255, 255, 0.85);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
    font: inherit;
    font-size: 10px;
    line-height: 1.15;
  }
  body.theme-dark .website-worker-menu-toggle {
    background: #080d18;
  }
  .sidebar .brand {
    margin: 0;
    padding: 0;
  }
  .side-user {
    margin: 0 0 12px;
  }
  .side-menu-panel {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: calc(100vh - 64px);
    max-height: calc(100dvh - 64px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 12px 16px 16px;
    background: #0B132B;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.22);
  }
  body.theme-dark .side-menu-panel {
    background: #080D18;
  }
  .sidebar.menu-open .side-menu-panel {
    display: flex;
  }
  .navlist button, .navlist a {
    white-space: nowrap;
  }
  .logout-btn {
    width: 100%;
    margin-top: 12px;
  }
  .main-header {
    padding: 16px 20px;
  }
  .main-body {
    padding: 20px;
  }
  .job-card {
    flex-direction: column;
  }
  .job-actions {
    align-items: stretch;
    width: 100%;
  }
  .form-grid2 {
    grid-template-columns: 1fr;
  }
  .settlement-metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .topbar {
    position: sticky;
    flex-wrap: wrap;
    gap: 10px;
    padding: 10px 16px;
  }
  .topbar > .mobile-menu-toggle {
    display: inline-flex;
  }
  .topnav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
    padding: 12px 16px 16px;
    background: #0B132B;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 16px 28px rgba(0, 0, 0, 0.22);
  }
  body.theme-dark .topnav {
    background: #080D18;
  }
  .topbar.menu-open .topnav {
    display: flex;
  }
  .topnav .nav-link {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 8px 10px;
  }
  .topnav .btn {
    min-height: 42px;
    padding: 8px 11px;
    font-size: 13px;
  }
  .topnav #nav-guest-bar,
  .topnav #nav-user-bar {
    gap: 8px;
  }
  .topnav #nav-guest-bar .btn,
  .topnav #nav-user-bar .btn {
    flex: 1;
  }
}

@media (max-width: 680px) {
  .trades-grid, .workflow-grid, .trust-grid, .grid3, .role-cards, .reviews-grid, .footer-grid {
    grid-template-columns: 1fr;
  }
  .welcome-card {
    padding: 30px 22px 22px;
  }
  .welcome-actions {
    align-items: stretch;
    flex-direction: column;
  }
  .welcome-actions .btn {
    width: 100%;
  }
  .cta-banner {
    padding: 44px 20px;
  }
  .hero h1 {
    font-size: 36px;
  }
  .hero p.lead {
    font-size: 15.5px;
  }
  .cards-row {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .main-header {
    padding: 14px 16px;
    align-items: flex-start;
  }
  .main-header h1 {
    font-size: 22px;
  }
  .header-actions {
    flex-wrap: wrap;
  }
  .main-body {
    padding: 16px 14px 40px;
  }
  .panel, .table-wrap {
    max-width: 100%;
  }
  .mobile-menu-toggle {
    display: inline-flex;
  }
}

/* ==========================================================================
   Animations & Interactive Enhancements
   ========================================================================== */

/* Top Scroll Progress Bar (Horizontal Crawl Tracker) */
.scroll-progress-bar {
  position: fixed;
  top: 0;
  left: 0;
  height: 3.5px;
  width: 0%;
  background: linear-gradient(90deg, #F59E0B 0%, #10B981 50%, #38BDF8 100%);
  z-index: 10000;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.7);
  transition: width 0.08s ease-out;
  pointer-events: none;
}

/* Floating Smooth Scroll-to-Top Button */
.scroll-top-btn {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
  opacity: 0;
  transform: translateY(18px) scale(0.85);
  pointer-events: none;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), 
              background-color 0.2s ease, 
              border-color 0.2s ease, 
              box-shadow 0.2s ease;
}

.scroll-top-btn.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.scroll-top-btn:hover {
  background: var(--accent);
  color: #0B132B;
  border-color: var(--accent);
  box-shadow: 0 12px 28px rgba(245, 158, 11, 0.45);
  transform: translateY(-3px) scale(1.08);
}

.scroll-top-btn:active {
  transform: translateY(-1px) scale(0.96);
}

/* Scroll Reveal Fade & Slide-In Animation */
.scroll-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.45s ease var(--reveal-delay, 0ms), 
              transform 0.45s cubic-bezier(0.16, 1, 0.3, 1) var(--reveal-delay, 0ms);
}

.scroll-reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* ==========================================================================
   Crawling Ticker / Marquee Animation
   ========================================================================== */
.crawl-ticker-wrapper {
  display: flex;
  align-items: center;
  background: #080D1A;
  color: #F8FAFC;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  height: 46px;
  overflow: hidden;
  position: relative;
  z-index: 25;
}

.crawl-badge {
  flex-shrink: 0;
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  color: #0B132B;
  font-weight: 800;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0 18px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 2;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.4);
}

.crawl-badge::after {
  content: "";
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #0B132B;
  animation: crawl-pulse 1.4s ease-in-out infinite;
}

@keyframes crawl-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(0.75); }
}

.crawl-track-container {
  flex: 1;
  overflow: hidden;
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  mask-image: linear-gradient(90deg, transparent 0%, #000 24px, #000 calc(100% - 24px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 24px, #000 calc(100% - 24px), transparent 100%);
}

.crawl-track {
  display: flex;
  align-items: center;
  gap: 28px;
  white-space: nowrap;
  width: max-content;
  animation: crawl-loop 34s linear infinite;
  will-change: transform;
}

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

.crawl-item {
  font-size: 13.5px;
  color: rgba(255, 255, 255, 0.88);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: default;
}

.crawl-item b {
  color: #FFFFFF;
  font-weight: 700;
}

.crawl-sep {
  color: var(--accent);
  font-size: 11px;
  opacity: 0.8;
}

/* Dashboard Crawl Bar */
.dash-crawl-bar {
  background: var(--card-subtle);
  border-bottom: 1px solid var(--border);
  padding: 8px 0;
  overflow: hidden;
  position: relative;
  font-size: 12.5px;
  color: var(--ink-soft);
  mask-image: linear-gradient(90deg, transparent 0%, #000 20px, #000 calc(100% - 20px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 20px, #000 calc(100% - 20px), transparent 100%);
}

.dash-crawl-track {
  display: flex;
  align-items: center;
  gap: 24px;
  white-space: nowrap;
  width: max-content;
  animation: crawl-loop 42s linear infinite;
  will-change: transform;
}

.dash-crawl-track:hover {
  animation-play-state: paused;
}

.dash-crawl-track span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .crawl-track, .dash-crawl-track {
    animation: none !important;
  }
  .scroll-reveal {
    opacity: 1;
    transform: none;
  }
}

/* ==========================================================================
   Worker Live Tracking & Google Maps Navigation Styles
   ========================================================================== */
.tracking-card {
  background: var(--card);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.tracking-card:hover {
  border-color: rgba(26, 115, 232, 0.4);
  box-shadow: var(--shadow-md);
}

.tracking-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.tracking-party {
  display: flex;
  align-items: center;
  gap: 14px;
}

.tracking-avatar {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #0B132B;
  font-weight: 800;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
  flex-shrink: 0;
}

.tracking-status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
}

.tracking-status-pill.status-enroute {
  background: rgba(16, 185, 129, 0.12);
  color: var(--green);
  border: 1px solid rgba(16, 185, 129, 0.35);
}

.tracking-status-pill.status-arrived {
  background: rgba(26, 115, 232, 0.12);
  color: #1A73E8;
  border: 1px solid rgba(26, 115, 232, 0.35);
}

.tracking-status-pill.status-working {
  background: rgba(245, 158, 11, 0.12);
  color: var(--accent);
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.tracking-status-pill.status-completed {
  background: rgba(59, 130, 246, 0.12);
  color: #3B82F6;
  border: 1px solid rgba(59, 130, 246, 0.35);
}

.pulse-radar-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--green);
  position: relative;
  display: inline-block;
}

.pulse-radar-dot::after {
  content: "";
  position: absolute;
  top: -4px;
  left: -4px;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  border: 2px solid var(--green);
  opacity: 0.8;
  animation: radar-wave 1.6s ease-out infinite;
}

@keyframes radar-wave {
  0% { transform: scale(0.6); opacity: 1; }
  100% { transform: scale(2.2); opacity: 0; }
}

.tracking-metrics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 14px;
}

.tracking-metric-box {
  background: var(--card-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.tracking-metric-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--ink-soft);
}

.tracking-metric-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', sans-serif;
  letter-spacing: -0.01em;
}

.tracking-route-radar {
  background: var(--card-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 18px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.route-radar-stops {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.route-stop {
  display: flex;
  align-items: center;
  gap: 10px;
}

.route-stop-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}

.route-bar-track {
  width: 100%;
  height: 9px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 5px;
  overflow: hidden;
  position: relative;
}

[data-theme="dark"] .route-bar-track {
  background: rgba(255, 255, 255, 0.1);
}

.route-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, #10B981, #F59E0B, #1A73E8);
  border-radius: 5px;
  transition: width 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.tracking-map-container {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1.5px solid var(--border);
  box-shadow: var(--shadow-sm);
  background: var(--card-subtle);
}

.tracking-map-frame {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

.map-overlay-badge {
  position: absolute;
  top: 14px;
  left: 14px;
  background: rgba(11, 19, 43, 0.88);
  color: #FFFFFF;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.28);
  max-width: 90%;
  z-index: 5;
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.btn-gmaps-nav {
  background: #1A73E8 !important;
  color: #FFFFFF !important;
  border: 1px solid #1765CC !important;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 14px rgba(26, 115, 232, 0.35);
  transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.btn-gmaps-nav:hover {
  background: #1557B0 !important;
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(26, 115, 232, 0.45);
}

.btn-gmaps-nav:active {
  transform: translateY(0);
}

.tracking-actions-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.tracking-timeline-box {
  background: var(--card-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 20px;
}

.tracking-timeline-list {
  list-style: none;
  margin: 12px 0 0;
  padding: 0 0 0 16px;
  border-left: 2px solid var(--border);
  display: grid;
  gap: 12px;
}

.tracking-timeline-item {
  position: relative;
  font-size: 13px;
  color: var(--ink);
}

.tracking-timeline-item::before {
  content: "";
  position: absolute;
  left: -21px;
  top: 5px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  border: 2px solid var(--card);
}

/* ==========================================================================
   Phone OTP & Google Authentication Styles
   ========================================================================== */
.btn-google-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: var(--card);
  color: var(--ink);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-xs);
  transition: background var(--transition-fast), border-color var(--transition-fast), box-shadow var(--transition-fast), transform var(--transition-fast);
}

.btn-google-auth:hover {
  background: var(--card-subtle);
  border-color: #4285F4;
  box-shadow: 0 4px 14px rgba(66, 133, 244, 0.18);
  transform: translateY(-1px);
}

.auth-divider {
  display: flex;
  align-items: center;
  margin: 18px 0;
  text-align: center;
  color: var(--ink-soft);
}

.auth-divider::before,
.auth-divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.auth-divider span {
  padding: 0 12px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.auth-method-switcher {
  display: flex;
  background: var(--card-subtle);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 16px;
  gap: 4px;
}

.auth-method-btn {
  flex: 1;
  padding: 8px 10px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 600;
  border-radius: var(--radius-xs);
  cursor: pointer;
  transition: all var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.auth-method-btn.active {
  background: var(--card);
  color: var(--ink);
  font-weight: 700;
  box-shadow: var(--shadow-xs);
}

.phone-input-wrap {
  display: flex;
  align-items: center;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  overflow: hidden;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.phone-input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.phone-prefix {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 12px;
  background: var(--card-subtle);
  border-right: 1px solid var(--border);
  font-weight: 700;
  font-size: 14px;
  color: var(--ink);
  white-space: nowrap;
  user-select: none;
}

.phone-input-wrap input {
  flex: 1;
  border: none !important;
  background: transparent !important;
  padding: 10px 14px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--ink);
  outline: none !important;
  box-shadow: none !important;
}

.otp-box-display {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 16px 0;
}

.otp-code-input {
  width: 100%;
  font-family: 'Plus Jakarta Sans', monospace;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 16px;
  text-align: center;
  padding: 12px;
  border: 2px solid var(--accent);
  background: var(--card-subtle);
  border-radius: var(--radius-sm);
  color: var(--ink);
  outline: none;
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.15);
}

.otp-info-banner {
  background: rgba(16, 185, 129, 0.1);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: 13px;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.otp-demo-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--green);
}

.otp-timer-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12.5px;
  color: var(--ink-soft);
  margin-top: 6px;
}

/* Google OAuth Account Picker Dialog */
.google-picker-card {
  max-width: 440px;
  border-radius: 14px;
  padding: 28px 24px 22px;
}

.google-brand-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.google-account-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 16px 0;
}

.google-account-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--card);
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: left;
  width: 100%;
}

.google-account-item:hover {
  border-color: #4285F4;
  background: var(--card-subtle);
  transform: translateX(3px);
}

.google-account-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4285F4, #34A853);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 16px;
  flex-shrink: 0;
}

/* Ensure overlays are always displayed on top and properly stacked */
#auth-overlay {
  z-index: 10000 !important;
}

#google-overlay, .google-overlay {
  z-index: 20000 !important;
}

/* UI/UX Pro Max pass: consistent surfaces, contrast, hierarchy, and touch targets. */
:root {
  color-scheme: light;
  --brand: #142235;
  --brand-light: #20354d;
  --brand-lighter: #304b68;
  --brand-surface: #101a28;
  --accent: #f3a927;
  --accent-hover: #dc8d12;
  --accent-light: #fff4d8;
  --accent-dark: #8b5704;
  --accent-glow: rgba(243, 169, 39, 0.2);
  --bg: #f3f5f8;
  --card: #ffffff;
  --card-subtle: #f7f8fa;
  --border: #e2e7ee;
  --border-focus: #d5921c;
  --ink: #172333;
  --ink-soft: #526174;
  --ink-subtle: #78879a;
  --green: #14835d;
  --green-bg: #eaf7f1;
  --green-border: #b7e5d0;
  --amber: #a96808;
  --amber-bg: #fff6e5;
  --amber-border: #f2d89e;
  --red: #c33c3c;
  --red-bg: #fff0ef;
  --red-border: #efc3c0;
  --blue: #2863a8;
  --blue-bg: #edf4fc;
  --blue-border: #c6d9f0;
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 20px;
  --radius-xl: 26px;
  --shadow-xs: 0 1px 2px rgba(20, 34, 53, 0.04);
  --shadow-sm: 0 2px 8px rgba(20, 34, 53, 0.045);
  --shadow: 0 8px 22px rgba(20, 34, 53, 0.07);
  --shadow-md: 0 14px 32px rgba(20, 34, 53, 0.11);
  --shadow-lg: 0 24px 54px rgba(20, 34, 53, 0.15);
  --shadow-focus: 0 0 0 3px rgba(213, 146, 28, 0.24);
}

body.theme-dark {
  color-scheme: dark;
  --brand: #edf2f7;
  --brand-light: #d8e1eb;
  --brand-lighter: #aebdce;
  --brand-surface: #080e17;
  --accent: #ffc45b;
  --accent-hover: #f1ad32;
  --accent-light: rgba(255, 196, 91, 0.14);
  --accent-dark: #ffda8b;
  --accent-glow: rgba(255, 196, 91, 0.2);
  --bg: #0c121c;
  --card: #131d2b;
  --card-subtle: #1b2838;
  --border: #293749;
  --border-focus: #ffc45b;
  --ink: #f1f5f9;
  --ink-soft: #bdc8d6;
  --ink-subtle: #91a0b2;
  --green: #51d2a0;
  --green-bg: rgba(20, 131, 93, 0.19);
  --green-border: rgba(81, 210, 160, 0.34);
  --amber: #ffd17a;
  --amber-bg: rgba(169, 104, 8, 0.2);
  --amber-border: rgba(255, 196, 91, 0.34);
  --red: #ff8580;
  --red-bg: rgba(195, 60, 60, 0.18);
  --red-border: rgba(255, 133, 128, 0.34);
  --blue: #85baff;
  --blue-bg: rgba(40, 99, 168, 0.22);
  --blue-border: rgba(133, 186, 255, 0.34);
  --navy: #f1f5f9;
  --navy-2: #d8e1eb;
  --navy-3: #aebdce;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 14px 34px rgba(0, 0, 0, 0.26);
  --shadow-lg: 0 24px 54px rgba(0, 0, 0, 0.34);
  --shadow-focus: 0 0 0 3px rgba(255, 196, 91, 0.24);
}

html {
  scroll-padding-top: 104px;
}

body {
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: -0.005em;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}

.btn {
  min-height: 42px;
  border-radius: 11px;
  font-weight: 650;
  letter-spacing: -0.01em;
}

.btn-primary {
  background: var(--accent);
  color: #202a35;
  border-color: transparent;
  box-shadow: 0 3px 9px rgba(188, 120, 17, 0.16);
}

.btn-primary:hover {
  background: var(--accent-hover);
  box-shadow: 0 6px 16px rgba(188, 120, 17, 0.22);
}

.btn-outline {
  border-width: 1px;
}

.topbar {
  min-height: 76px;
  gap: 20px;
  padding-top: 12px;
  padding-bottom: 12px;
  background: rgba(13, 23, 36, 0.97);
}

.brand {
  flex-shrink: 0;
  gap: 10px;
  font-size: 18px;
}

.brand .mark {
  box-shadow: none;
}

.topnav {
  gap: 6px;
}

.topnav .nav-link {
  border-radius: 9px;
  white-space: nowrap;
}

.topnav .nav-link:hover {
  background: rgba(255, 255, 255, 0.07);
}

.hero {
  min-height: 620px;
  gap: clamp(32px, 5vw, 72px);
  background-position: center 45%;
}

.hero::before {
  background: linear-gradient(110deg, rgba(9, 18, 31, 0.94) 0%, rgba(13, 27, 45, 0.84) 56%, rgba(13, 27, 45, 0.68) 100%);
}

.hero h1 {
  max-width: 13ch;
  font-size: clamp(40px, 5vw, 66px);
  letter-spacing: -0.045em;
  line-height: 1.04;
}

.hero p.lead {
  max-width: 48ch;
}

.hero-visual {
  border-radius: 22px;
  background: rgba(18, 31, 49, 0.9);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
}

.job-tick {
  min-height: 52px;
  border-radius: 12px;
}

.section {
  padding-top: clamp(56px, 7vw, 88px);
  padding-bottom: clamp(56px, 7vw, 88px);
}

.section-head {
  margin-bottom: 42px;
}

.app-shell {
  min-height: 100dvh;
  background: var(--bg);
}

.sidebar {
  width: 272px;
  padding: 24px 18px;
  background: #111d2b;
  border-right-color: rgba(255, 255, 255, 0.06);
}

body.theme-dark .sidebar {
  background: #0a111b;
}

.sidebar .brand {
  margin-bottom: 28px;
}

.side-user {
  padding: 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.navlist {
  gap: 6px;
}

.navlist button,
.navlist a {
  min-height: 46px;
  padding: 11px 13px;
  border-radius: 11px;
  font-weight: 550;
  gap: 11px;
}

.navlist .ico {
  width: 22px;
  justify-content: center;
  font-size: 15px;
}

.navlist button.active,
.navlist a.active {
  color: #202a35;
  background: var(--accent);
  box-shadow: none;
}

.logout-btn {
  min-height: 44px;
  border-radius: 11px;
}

.main-header {
  min-height: 118px;
  padding: 22px clamp(20px, 3vw, 44px);
  background: color-mix(in srgb, var(--card) 94%, transparent);
  box-shadow: 0 4px 16px rgba(20, 34, 53, 0.025);
}

body.theme-dark .main-header {
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.12);
}

.header-kicker {
  font-size: 10.5px;
  letter-spacing: 0.1em;
}

.main-header h1 {
  font-size: clamp(23px, 2vw, 29px);
  letter-spacing: -0.035em;
}

.main-header p {
  font-size: 14px;
}

.main-body {
  width: 100%;
  max-width: 1520px;
  margin: 0 auto;
  padding: 30px clamp(20px, 3vw, 44px) 72px;
}

.dash-crawl-bar {
  background: var(--card);
  padding: 9px 0;
  font-size: 12px;
}

.dash-crawl-track {
  animation-duration: 58s;
}

.cards-row {
  gap: 18px;
  margin-bottom: 26px;
}

.kpi {
  min-height: 112px;
  padding: 22px 23px;
  border-radius: 16px;
  box-shadow: none;
}

.kpi:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.kpi b {
  font-size: clamp(27px, 3vw, 34px);
  letter-spacing: -0.04em;
}

.kpi span {
  font-size: 11px;
  letter-spacing: 0.075em;
}

.panel {
  border-radius: 17px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-xs);
}

.panel-head {
  min-height: 70px;
  padding: 18px 24px;
}

.panel-head h3 {
  font-size: 19px;
  letter-spacing: -0.025em;
}

.panel-body {
  padding: 24px;
}

.job-card,
.tracking-card {
  border-radius: 16px;
  box-shadow: none;
}

.job-card {
  padding: 22px 24px;
}

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

.tracking-metric-box {
  min-height: 112px;
  justify-content: center;
  border-radius: 13px;
  padding: 17px 19px;
}

.tracking-map-container {
  border-radius: 16px;
}

.badge {
  min-height: 24px;
}

.field input,
.field select,
.field textarea,
.toolbar input,
.toolbar select {
  min-height: 44px;
  border-radius: 10px;
}

.field textarea {
  min-height: 108px;
}

.field input:focus,
.field select:focus,
.field textarea:focus,
.toolbar input:focus,
.toolbar select:focus {
  border-color: var(--border-focus);
  box-shadow: var(--shadow-focus);
}

.table-wrap {
  border: 1px solid var(--border);
  border-radius: 12px;
}

table {
  min-width: 640px;
}

thead th {
  padding-top: 14px;
  padding-bottom: 14px;
  font-size: 10.5px;
  letter-spacing: 0.08em;
}

tbody td {
  padding-top: 15px;
  padding-bottom: 15px;
}

.welcome-card {
  border-radius: 22px;
  box-shadow: var(--shadow-md);
}

.auth-page-card {
  border-radius: 22px;
  box-shadow: var(--shadow-md);
}

.site-nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav-links > .nav-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  text-align: center;
}

.site-nav-links #nav-guest-bar {
  display: contents !important;
}

.site-nav-links #nav-guest-bar.is-hidden {
  display: none !important;
}

body > .topbar > .topnav .site-nav-links .nav-link[href="#how-it-works"] {
  white-space: nowrap !important;
}

@media (min-width: 1101px) {
  body > .topbar {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    grid-template-areas:
      "brand navigation theme";
  }

  body > .topbar > .brand {
    grid-area: brand;
  }

  body > .topbar > .theme-toggle {
    grid-area: theme;
    margin: 0;
  }

  body > .topbar > .topnav {
    grid-area: navigation;
    justify-content: center;
    width: 100%;
    min-width: 0;
  }

  body > .topbar > .topnav .site-nav-links {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    align-items: stretch;
    gap: 0;
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  body > .topbar > .topnav .site-nav-links .nav-link,
  body > .topbar > .topnav .site-nav-links #nav-guest-bar .btn {
    min-width: 0;
    min-height: 42px;
    justify-content: center;
    padding-right: 4px;
    padding-left: 4px;
    text-align: center;
    letter-spacing: normal;
    white-space: normal;
    line-height: 1.2;
  }

  body > .topbar > .topnav .site-nav-links .nav-link {
    font-size: 14px;
  }

  body > .topbar > .topnav .site-nav-links #nav-guest-bar .btn {
    width: 100%;
    font-size: 12px;
  }
}

@media (min-width: 1101px) {
  body > .topbar.has-user-session {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    grid-template-areas: "brand navigation theme";
  }

  body > .topbar.has-user-session > .topnav {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-width: 0;
    padding: 0;
  }

  body > .topbar.has-user-session > .topnav .site-nav-links {
    display: flex;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    border: 0;
  }

  body > .topbar.has-user-session > .topnav .site-nav-links .nav-link {
    flex: 1 1 0;
    min-width: 0;
    padding-right: 3px;
    padding-left: 3px;
    font-size: 14px;
    text-align: center;
    white-space: nowrap;
    line-height: 1.15;
  }

  body > .topbar.has-user-session > .topnav #nav-user-bar {
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 6px;
    padding: 0;
  }

  body > .topbar.has-user-session > .topnav #nav-user-bar .btn {
    flex: 0 0 auto;
    padding-right: 10px;
    padding-left: 10px;
    white-space: nowrap;
  }
}

@media (max-width: 1100px) {
  .topbar {
    position: sticky;
    flex-wrap: nowrap;
    padding-left: 18px;
    padding-right: 18px;
  }

  .topbar > .mobile-menu-toggle {
    display: inline-flex;
    flex-shrink: 0;
  }

  .topnav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    align-items: stretch;
    flex-direction: column;
    gap: 6px;
    padding: 12px 18px 18px;
    background: #0d1724;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 18px 28px rgba(0, 0, 0, 0.2);
  }

  .topbar.menu-open .topnav {
    display: flex;
  }

  .topnav .nav-link {
    min-height: 44px;
    padding: 10px 12px;
  }

  .topnav #nav-guest-bar,
  .topnav #nav-user-bar {
    gap: 8px;
  }

  .topnav #nav-guest-bar .btn,
  .topnav #nav-user-bar .btn {
    flex: 1;
  }
}

@media (max-width: 840px) {
  .sidebar {
    padding: 10px 16px;
  }

  .sidebar .brand {
    margin-bottom: 0;
  }

  .side-menu-panel {
    background: #111d2b;
  }

  body.theme-dark .side-menu-panel {
    background: #0a111b;
  }

  .main-header {
    min-height: 100px;
    padding: 16px 20px;
  }

  .main-body {
    padding: 22px 20px 56px;
  }
}

@media (max-width: 600px) {
  .topbar {
    min-height: 66px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .brand {
    font-size: 16px;
  }

  .brand .mark {
    width: 34px;
    height: 34px;
  }

  .hero {
    min-height: auto;
    padding: 60px 20px 52px;
  }

  .hero h1 {
    max-width: 12ch;
    font-size: clamp(36px, 11vw, 48px);
  }

  .hero-title-line {
    overflow-wrap: anywhere;
  }

  .role-cards {
    grid-template-columns: minmax(0, 1fr);
  }

  .role-card {
    min-width: 0;
  }

  .hero-visual {
    padding: 18px;
  }

  .hero-stats {
    gap: 10px;
    margin-top: 30px;
  }

  .hero-stats .stat {
    flex: 1 1 130px;
    min-width: 0;
    padding: 12px 14px;
  }

  .hero-stats .stat b {
    font-size: 27px;
  }

  .main-header {
    align-items: flex-start;
    gap: 12px;
    padding: 15px 16px;
  }

  .header-actions {
    gap: 6px;
  }

  .header-actions .btn {
    min-height: 38px;
    padding: 7px 10px;
    font-size: 12px;
  }

  .main-body {
    padding: 18px 14px 44px;
  }

  .cards-row {
    gap: 10px;
  }

  .kpi {
    min-height: 96px;
    padding: 16px;
  }

  .panel-head {
    padding: 16px 17px;
  }

  .panel-body {
    padding: 17px;
  }

  .tracking-card {
    padding: 17px;
  }
}

.home-menu-backdrop,
.home-bottom-navigation {
  display: none;
}

@media (max-width: 840px) {
  body > .topbar {
    z-index: 82;
    flex-wrap: nowrap;
    gap: 8px;
    padding-left: 12px;
    padding-right: 12px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body > .topbar > .theme-toggle {
    margin-left: auto;
  }

  body > .topbar > .topnav {
    display: none !important;
    position: fixed;
    z-index: 82;
    inset: 0 auto 0 0;
    width: min(320px, 86vw);
    max-width: min(320px, 86vw);
    height: 100vh;
    height: 100dvh;
    box-sizing: border-box;
    flex: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    padding: max(20px, env(safe-area-inset-top, 0px)) 16px
      max(78px, calc(16px + env(safe-area-inset-bottom, 0px)));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #111d2b;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 18px 0 44px rgba(0, 0, 0, 0.3);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 220ms ease, visibility 220ms ease;
  }

  body.theme-dark > .topbar > .topnav {
    background: #080d18;
  }

  body > .topbar.menu-open > .topnav {
    display: flex !important;
    transform: translateX(0);
    visibility: visible;
  }

  body > .topbar > .topnav .site-nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    overflow: visible;
    border: 0;
  }

  body > .topbar > .topnav .site-nav-links .language-control {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
  }

  body > .topbar > .topnav .site-nav-links .language-select {
    flex: 1;
    width: 100%;
  }

  body > .topbar > .topnav .site-nav-links .nav-link {
    justify-content: flex-start;
    min-height: 44px;
    padding: 10px 12px;
    border: 0;
    border-radius: 9px;
    font-size: 14px;
    text-align: left;
  }

  body > .topbar > .topnav #nav-guest-bar,
  body > .topbar > .topnav #nav-user-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-top: 8px;
  }

  body > .topbar > .topnav #nav-guest-bar .btn,
  body > .topbar > .topnav #nav-user-bar .btn {
    width: 100%;
  }

  .home-menu-backdrop {
    position: fixed;
    z-index: 81;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(3, 8, 17, 0.62);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 200ms ease, visibility 200ms ease;
  }

  body > .topbar.menu-open + .home-menu-backdrop {
    display: block;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .home-bottom-navigation {
    position: fixed;
    z-index: 60;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
    background: #111d2b;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
  }

  body.theme-dark .home-bottom-navigation {
    background: #080d18;
  }

  .home-bottom-menu,
  .home-bottom-link {
    display: flex;
    min-width: 0;
    min-height: 54px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 2px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: rgba(255, 255, 255, 0.76);
    font: 600 9px/1.15 'Inter', sans-serif;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-tap-highlight-color: transparent;
  }

  .home-bottom-menu > span:first-child,
  .home-bottom-link > span:first-child {
    font-size: 18px;
    line-height: 1;
  }

  .home-bottom-account {
    display: block;
    min-width: 0;
  }

  .home-bottom-account .home-bottom-link {
    width: 100%;
  }

  .home-bottom-menu:focus-visible,
  .home-bottom-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
  }

  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }
}



@media (prefers-reduced-motion: reduce) {
  .home-menu-backdrop,
  body > .topbar > .topnav {
    transition: none;
  }
}

.language-control {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  color: var(--ink);
}

.language-select {
  width: auto;
  min-width: 100px;
  min-height: 38px;
  padding: 6px 26px 6px 9px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
}

.language-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

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

@media (max-width: 840px) {
  .header-actions .language-control {
    flex: 0 0 auto;
  }
}

/* The public website keeps its homepage navigation visible; dashboard menus stay collapsible. */
@media (max-width: 1100px) {
  body > .topbar {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  body > .topbar > .mobile-menu-toggle {
    display: none !important;
  }

  body > .topbar > .theme-toggle {
    min-height: 36px;
    margin-left: auto;
    padding: 6px 10px;
    font-size: 11.5px;
  }

  body > .topbar > .topnav {
    display: flex !important;
    position: static;
    flex: 1 1 100%;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    padding: 2px 0 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  body > .topbar > .topnav .site-nav-links {
    display: grid;
    grid-template-columns: repeat(8, minmax(0, 1fr));
    align-items: stretch;
    gap: 2px;
    width: 100%;
    min-width: 0;
    overflow: hidden;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  }

  body > .topbar > .topnav .site-nav-links::-webkit-scrollbar {
    display: none;
  }

  body > .topbar > .topnav .site-nav-links .nav-link {
    min-width: 0;
    justify-content: center;
    min-height: 42px;
    padding: 6px 2px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-size: 12px;
    letter-spacing: normal;
    line-height: 1.2;
    text-align: center;
    white-space: normal;
  }

  body > .topbar > .topnav .site-nav-links .nav-link {
    font-size: clamp(9px, calc(1.25vw + 5px), 14px);
  }

  body > .topbar > .topnav .site-nav-links .nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
  }

  body > .topbar > .topnav .site-nav-links #nav-guest-bar .btn {
    width: 100%;
    min-width: 0;
    min-height: 42px;
    padding: 6px 4px;
    border-radius: 8px;
    font-size: 12px;
    letter-spacing: normal;
    line-height: 1.2;
    white-space: normal;
  }

  body > .topbar > .topnav #nav-guest-bar,
  body > .topbar > .topnav #nav-user-bar {
    width: 100%;
    justify-content: center;
    gap: 8px;
    padding-top: 2px;
  }

  body > .topbar > .topnav #nav-guest-bar .btn,
  body > .topbar > .topnav #nav-user-bar .btn {
    min-height: 40px;
    flex: 1 1 0;
  }
}

@media (min-width: 960px) and (max-width: 1100px) {
  body > .topbar {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    grid-template-areas: "brand navigation theme";
    flex-wrap: nowrap;
    row-gap: 0;
  }

  body > .topbar > .brand {
    grid-area: brand;
  }

  body > .topbar > .theme-toggle {
    grid-area: theme;
    margin: 0;
  }

  body > .topbar > .topnav {
    grid-area: navigation;
    position: static;
    width: auto;
    min-width: 0;
    flex: initial;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  body > .topbar > .topnav .site-nav-links {
    justify-content: center;
    gap: 0;
    width: 100%;
    overflow: hidden;
    border: 0;
  }

  body > .topbar > .topnav .site-nav-links .nav-link {
    padding-right: 5px;
    padding-left: 5px;
    font-size: 12px;
  }

  body > .topbar > .topnav .site-nav-links #nav-guest-bar .btn {
    padding-right: 7px;
    padding-left: 7px;
    font-size: 12px;
  }

  body > .topbar.has-user-session {
    grid-template-columns: max-content minmax(0, 1fr) max-content;
    grid-template-areas: "brand navigation theme";
  }

  body > .topbar.has-user-session > .topnav {
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 0;
    width: auto;
    min-width: 0;
    padding: 0;
  }

  body > .topbar.has-user-session > .topnav .site-nav-links {
    display: flex;
    flex: 1 1 auto;
    justify-content: center;
    min-width: 0;
    overflow: hidden;
    border: 0;
  }

  body > .topbar.has-user-session > .topnav .site-nav-links .nav-link {
    flex: 1 1 0;
    min-width: 0;
    padding-right: 2px;
    padding-left: 2px;
    font-size: 13px;
    text-align: center;
    white-space: nowrap;
    line-height: 1.1;
  }

  body > .topbar.has-user-session > .topnav #nav-user-bar {
    width: auto;
    flex: 0 0 auto;
    justify-content: flex-end;
    flex-wrap: nowrap;
    gap: 4px;
    padding: 0;
  }

  body > .topbar.has-user-session > .topnav #nav-user-bar .btn {
    flex: 0 0 auto;
    min-height: 36px;
    padding-right: 5px;
    padding-left: 5px;
    font-size: 10px;
    white-space: nowrap;
  }
}

body > .topbar.has-user-session > .topnav #nav-user-bar .btn {
  flex: 0 0 auto;
}

body > .topbar.has-user-session > .topnav #nav-user-bar {
  flex-wrap: nowrap;
}

body > .topbar.has-user-session > .topnav #nav-user-bar .profile-photo-label,
body > .topbar.has-user-session > .topnav #nav-user-bar .profile-photo-remove,
body > .topbar.has-user-session > .topnav #nav-user-bar button[title="Switch account"] {
  display: none !important;
}

@media (max-width: 600px) {
  body > .topbar > .topnav {
    gap: 3px;
  }

  body > .topbar > .topnav .site-nav-links {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: clamp(0px, 0.5vw, 3px);
    width: fit-content;
    max-width: 100%;
    overflow: hidden;
    border-bottom: 0;
  }

  body > .topbar > .topnav .site-nav-links .nav-link {
    flex: 0 0 auto;
    min-height: 38px;
    padding: 4px 2px;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-size: clamp(8px, 2.5vw, 12px);
    line-height: 1.15;
    white-space: nowrap !important;
  }

  body > .topbar > .topnav .site-nav-links #nav-guest-bar .btn {
    flex: 0 0 auto;
    width: auto;
    min-height: 38px;
    padding: 4px 1px;
    border-radius: 7px;
    font-size: clamp(8px, 2.5vw, 12px);
    line-height: 1.15;
    white-space: nowrap;
  }

  body > .topbar > .topnav .site-nav-links #nav-guest-bar .btn-primary {
    color: #202a35;
  }

  body > .topbar > .topnav #nav-user-bar {
    gap: 6px;
  }

  body > .topbar > .topnav #nav-user-bar .profile-photo-label,
  body > .topbar > .topnav #nav-user-bar .profile-photo-remove {
    display: none;
  }

  body > .topbar > .topnav #nav-user-bar .profile-photo-control {
    flex-direction: row;
  }

  body > .topbar > .topnav #nav-user-bar .profile-photo-picker {
    padding: 0;
  }

  body > .topbar > .topnav #nav-user-bar .profile-avatar-photo,
  body > .topbar > .topnav #nav-user-bar .side-avatar {
    width: 36px;
    height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dash-crawl-track {
    animation: none;
  }
}

@media (max-width: 840px) {
  .app-shell {
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    overflow-x: clip;
  }

  .app-shell > .main {
    min-width: 0;
    width: 100%;
  }

  .sidebar {
    z-index: 80;
  }

  .bottom-navigation {
    position: fixed;
    z-index: 60;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: minmax(48px, 0.85fr) repeat(4, minmax(0, 1fr));
    align-items: stretch;
    gap: 3px;
    padding: 5px 6px calc(5px + env(safe-area-inset-bottom, 0px));
    background: #111d2b;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.18);
  }

  body.theme-dark .bottom-navigation {
    background: #080d18;
  }

  .bottom-navigation-menu-only {
    right: auto;
    background: transparent;
    border-top: 0;
    box-shadow: none;
  }

  body.theme-dark .bottom-navigation-menu-only {
    background: transparent;
  }

  .sidebar .mobile-menu-toggle {
    z-index: 83;
    display: inline-flex;
  }

  .sidebar.menu-open .bottom-navigation {
    display: none;
  }

  .bottom-menu-toggle,
  .bottom-navlist a {
    display: flex;
    min-width: 0;
    min-height: 54px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 2px;
    border: 0;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.72);
    background: transparent;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.15;
    text-align: center;
    text-decoration: none;
    white-space: normal;
    overflow-wrap: anywhere;
    -webkit-tap-highlight-color: transparent;
  }

  .bottom-menu-toggle {
    width: 100%;
  }

  .bottom-navigation-menu-only .bottom-menu-toggle {
    min-width: 64px;
    padding: 8px 12px;
    background: #111d2b;
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.35);
  }

  body.theme-dark .bottom-navigation-menu-only .bottom-menu-toggle {
    background: #080d18;
  }

  .bottom-navlist {
    display: grid;
    grid-column: 2 / -1;
    grid-row: 1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 3px;
    list-style: none;
    margin: 0;
    padding: 0;
  }

  .bottom-navlist .ico,
  .bottom-nav-icon {
    font-size: 18px;
    line-height: 1;
  }

  .bottom-navlist a.active {
    color: var(--accent);
    background: rgba(245, 158, 11, 0.12);
  }

  .bottom-menu-toggle:focus-visible,
  .bottom-navlist a:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: -2px;
  }

  .mobile-menu-backdrop {
    position: fixed;
    z-index: 81;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 0;
    border: 0;
    background: rgba(3, 8, 17, 0.62);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 200ms ease, visibility 200ms ease;
  }

  .side-menu-panel {
    position: fixed;
    z-index: 82;
    top: 0;
    bottom: 0;
    left: 0;
    right: auto;
    display: flex;
    width: min(320px, 86vw);
    max-height: 100vh;
    max-height: 100dvh;
    padding: max(16px, env(safe-area-inset-top, 0px)) 16px
      max(78px, calc(16px + env(safe-area-inset-bottom, 0px)));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #111d2b;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 18px 0 44px rgba(0, 0, 0, 0.3);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 220ms ease, visibility 220ms ease;
  }

  body.theme-dark .side-menu-panel {
    background: #080d18;
  }

  .sidebar.menu-open .mobile-menu-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .sidebar.menu-open .side-menu-panel {
    transform: translateX(0);
    visibility: visible;
  }

  .side-menu-panel .side-user {
    margin-top: 12px;
  }

  .side-menu-panel .side-navigation {
    flex: 1 0 auto;
  }

  .main-body {
    padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px));
  }
}

@media (prefers-reduced-motion: reduce) {
  .mobile-menu-backdrop,
  .side-menu-panel {
    transition: none;
  }
}

@media (max-width: 840px) {
  body > .topbar {
    z-index: 82;
    flex-wrap: nowrap;
    gap: 8px;
    padding-left: 12px;
    padding-right: 12px;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  body > .topbar > .theme-toggle {
    margin-left: auto;
  }

  body > .topbar > .topnav {
    display: none !important;
    position: fixed;
    z-index: 82;
    inset: 0 auto 0 0;
    width: min(320px, 86vw);
    max-width: min(320px, 86vw);
    height: 100vh;
    height: 100dvh;
    box-sizing: border-box;
    flex: none;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    gap: 12px;
    padding: max(20px, env(safe-area-inset-top, 0px)) 16px
      max(78px, calc(16px + env(safe-area-inset-bottom, 0px)));
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    background: #111d2b;
    border: 0;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 18px 0 44px rgba(0, 0, 0, 0.3);
    transform: translateX(-105%);
    visibility: hidden;
    transition: transform 220ms ease, visibility 220ms ease;
  }

  body.theme-dark > .topbar > .topnav {
    background: #080d18;
  }

  body > .topbar.menu-open > .topnav {
    display: flex !important;
    transform: translateX(0);
    visibility: visible;
  }

  body > .topbar > .topnav .site-nav-links {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    width: 100%;
    overflow: visible;
    border: 0;
  }

  body > .topbar > .topnav .site-nav-links .language-control {
    width: 100%;
    min-height: 44px;
    justify-content: flex-start;
  }

  body > .topbar > .topnav .site-nav-links .language-select {
    flex: 1;
    width: 100%;
  }

  body > .topbar > .topnav .site-nav-links .nav-link {
    justify-content: flex-start;
    min-height: 44px;
    padding: 10px 12px;
    border: 0;
    border-radius: 9px;
    font-size: 14px;
    text-align: left;
    white-space: normal !important;
  }

  body > .topbar > .topnav #nav-guest-bar,
  body > .topbar > .topnav #nav-user-bar {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding-top: 8px;
  }

  body > .topbar > .topnav #nav-guest-bar .btn,
  body > .topbar > .topnav #nav-user-bar .btn {
    width: 100%;
  }

  body {
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 600px) {
  .tracking-card,
  .tracking-card > * {
    min-width: 0;
    max-width: 100%;
  }

  .tracking-metrics-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .route-radar-stops {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }

  .route-stop,
  .route-stop[style] {
    min-width: 0;
    flex-direction: row !important;
    text-align: left !important;
  }

  .route-stop > div:last-child {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .tracking-map-controls {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
  }

  .tracking-map-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
    overflow: visible;
  }

  .tracking-map-tabs button {
    min-width: 0;
    padding: 6px 4px;
    white-space: normal;
    overflow-wrap: anywhere;
    font-size: 11px;
    line-height: 1.25;
  }

  .tracking-map-controls > div:last-child,
  .tracking-map-controls > div:last-child .btn {
    width: 100%;
    min-width: 0;
  }
}

body > .topbar > .topbar-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

body > .topbar > .topbar-tools .language-control {
  position: relative;
  width: 38px;
  height: 38px;
  min-width: 38px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 9px;
  color: #fff;
  cursor: pointer;
  font-size: 20px;
}

body > .topbar > .topbar-tools .language-select {
  position: absolute;
  inset: 0;
  width: 100%;
  min-width: 0;
  min-height: 100%;
  padding: 0;
  opacity: 0;
  cursor: pointer;
}

body > .topbar > .topbar-tools .language-control:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

@media (min-width: 960px) {
  body > .topbar {
    grid-template-areas: "brand navigation tools";
  }

  body > .topbar.has-user-session {
    grid-template-areas: "brand navigation tools";
  }

  body > .topbar > .topbar-tools {
    grid-area: tools;
  }
}

@media (max-width: 959px) {
  body > .topbar > .topbar-tools {
    margin-left: auto;
  }

  body > .topbar > .topbar-tools .theme-toggle {
    margin-left: 0;
  }
}

@media (max-width: 420px) {
  body > .topbar {
    gap: 6px;
    padding-right: 8px;
    padding-left: 8px;
  }

  body > .topbar > .brand {
    gap: 7px;
  }

  body > .topbar > .brand .brand-text {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    line-height: 1.05;
  }

  body > .topbar > .brand .brand-badge {
    padding: 1px 4px;
    font-size: 8px;
  }

  body > .topbar > .topbar-tools {
    gap: 4px;
  }

  body > .topbar > .topbar-tools .theme-toggle {
    padding: 6px 8px;
  }

}

.wfd-chat-launcher {
  position: fixed;
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  z-index: 10000;
  min-height: 50px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--accent);
  color: #0B132B;
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.3);
  cursor: pointer;
  font: 700 14px Inter, system-ui, sans-serif;
}

.wfd-chat-panel {
  position: fixed;
  right: max(18px, env(safe-area-inset-right, 0px));
  bottom: calc(82px + env(safe-area-inset-bottom, 0px));
  z-index: 10000;
  display: flex;
  flex-direction: column;
  width: min(390px, calc(100vw - 28px));
  height: min(570px, calc(100dvh - 112px - env(safe-area-inset-bottom, 0px)));
  min-height: 300px;
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 18px 56px rgba(0, 0, 0, 0.32);
  font-family: Inter, system-ui, sans-serif;
}

.wfd-chat-panel[hidden] {
  display: none;
}

.wfd-chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  background: #0B132B;
  color: #fff;
}

.wfd-chat-header > div {
  display: grid;
  gap: 3px;
}

.wfd-chat-header strong {
  font-size: 15px;
}

.wfd-chat-header span {
  color: #cbd5e1;
  font-size: 12px;
}

.wfd-chat-close {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 26px;
}

.wfd-chat-note {
  margin: 0;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.2);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.wfd-chat-messages {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 14px;
}

.wfd-chat-message {
  max-width: 88%;
  padding: 10px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  white-space: pre-wrap;
}

.wfd-chat-message-assistant {
  align-self: flex-start;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: var(--bg);
}

.wfd-chat-message-user {
  align-self: flex-end;
  background: #0B132B;
  color: #fff;
}

.wfd-chat-message-error {
  align-self: flex-start;
  background: #fee2e2;
  color: #991b1b;
}

.wfd-chat-form {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid rgba(148, 163, 184, 0.24);
}

.wfd-chat-form textarea {
  flex: 1;
  min-width: 0;
  max-height: 100px;
  resize: vertical;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  border-radius: 10px;
  background: var(--bg);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.wfd-chat-form button {
  min-height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #0B132B;
  cursor: pointer;
  font: 700 13px Inter, system-ui, sans-serif;
}

.wfd-chat-form button:disabled {
  cursor: wait;
  opacity: 0.6;
}

@media (max-width: 520px) {
  .wfd-chat-launcher {
    right: 12px;
    bottom: calc(84px + env(safe-area-inset-bottom, 0px));
  }

  .wfd-chat-panel {
    right: 8px;
    bottom: calc(142px + env(safe-area-inset-bottom, 0px));
    width: calc(100vw - 16px);
    height: min(540px, calc(100dvh - 170px - env(safe-area-inset-bottom, 0px)));
    min-height: 280px;
  }
}
