/**
 * MachPower Precision Industrial Design System (Theme-v3)
 * Mobile-First B2B Engineered Design System
 * Compatible with Tailwind Play CDN & Standalone Vanilla CSS Fallback
 */

:root {
  color-scheme: light;

  /* Primary: Industrial Deep Navy Blue */
  --primary-rgb: 0 61 155;
  --primary: #003d9b;
  --on-primary-rgb: 255 255 255;
  --on-primary: #ffffff;
  --primary-container-rgb: 0 82 204;
  --primary-container: #0052cc;
  --on-primary-container-rgb: 196 210 255;
  --on-primary-container: #c4d2ff;
  --inverse-primary-rgb: 178 197 255;
  --inverse-primary: #b2c5ff;
  --primary-fixed-rgb: 218 226 255;
  --primary-fixed: #dae2ff;
  --primary-fixed-dim-rgb: 178 197 255;
  --primary-fixed-dim: #b2c5ff;
  --on-primary-fixed-rgb: 0 24 72;
  --on-primary-fixed: #001848;
  --on-primary-fixed-variant-rgb: 0 64 162;
  --on-primary-fixed-variant: #0040a2;

  /* Secondary: Safety Amber */
  --secondary-rgb: 133 83 0;
  --secondary: #855300;
  --on-secondary-rgb: 255 255 255;
  --on-secondary: #ffffff;
  --secondary-container-rgb: 254 166 25;
  --secondary-container: #fea619;
  --on-secondary-container-rgb: 104 64 0;
  --on-secondary-container: #684000;
  --secondary-fixed-rgb: 255 221 184;
  --secondary-fixed: #ffddb8;
  --secondary-fixed-dim-rgb: 255 185 95;
  --secondary-fixed-dim: #ffb95f;
  --on-secondary-fixed-rgb: 42 23 0;
  --on-secondary-fixed: #2a1700;
  --on-secondary-fixed-variant-rgb: 101 62 0;
  --on-secondary-fixed-variant: #653e00;

  /* Tertiary: Ledger Emerald (GST/Stock) */
  --tertiary-rgb: 0 78 51;
  --tertiary: #004e33;
  --on-tertiary-rgb: 255 255 255;
  --on-tertiary: #ffffff;
  --tertiary-container-rgb: 0 104 70;
  --tertiary-container: #006846;
  --on-tertiary-container-rgb: 93 235 175;
  --on-tertiary-container: #5debaf;
  --tertiary-fixed-rgb: 111 251 190;
  --tertiary-fixed: #6ffbbe;
  --tertiary-fixed-dim-rgb: 78 222 163;
  --tertiary-fixed-dim: #4edea3;
  --on-tertiary-fixed-rgb: 0 33 19;
  --on-tertiary-fixed: #002113;
  --on-tertiary-fixed-variant-rgb: 0 82 54;
  --on-tertiary-fixed-variant: #005236;

  /* Surface & Canvas (Light Mode) */
  --surface-rgb: 250 248 255;
  --surface: #faf8ff;
  --surface-dim-rgb: 210 217 244;
  --surface-dim: #d2d9f4;
  --surface-bright-rgb: 250 248 255;
  --surface-bright: #faf8ff;
  --surface-container-lowest-rgb: 255 255 255;
  --surface-container-lowest: #ffffff;
  --surface-container-low-rgb: 242 243 255;
  --surface-container-low: #f2f3ff;
  --surface-container-rgb: 234 237 255;
  --surface-container: #eaedff;
  --surface-container-high-rgb: 226 231 255;
  --surface-container-high: #e2e7ff;
  --surface-container-highest-rgb: 218 226 253;
  --surface-container-highest: #dae2fd;
  --surface-variant-rgb: 218 226 253;
  --surface-variant: #dae2fd;
  --surface-tint-rgb: 12 86 208;

  /* Text / On-Surface */
  --on-surface-rgb: 19 27 46;
  --on-surface: #131b2e;
  --on-surface-variant-rgb: 67 70 84;
  --on-surface-variant: #434654;
  --inverse-surface-rgb: 40 48 68;
  --inverse-surface: #283044;
  --inverse-on-surface-rgb: 238 240 255;
  --inverse-on-surface: #eef0ff;

  /* Borders */
  --outline-rgb: 115 118 133;
  --outline: #737685;
  --outline-variant-rgb: 195 198 214;
  --outline-variant: #c3c6d6;

  /* Error / Alerts */
  --error-rgb: 186 26 26;
  --error: #ba1a1a;
  --on-error-rgb: 255 255 255;
  --on-error: #ffffff;
  --error-container-rgb: 255 218 214;
  --error-container: #ffdad6;
  --on-error-container-rgb: 147 0 10;
  --on-error-container: #93000a;

  /* Typography Families */
  --font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;

  /* Spacing */
  --space-2xs: 0.125rem;
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 0.75rem;
  --space-lg: 1rem;
  --space-xl: 1.5rem;
  --space-2xl: 2rem;
  --margin: 1rem;
  --margin-desktop: 2rem;

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

  /* Shadows */
  --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 12px -2px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 25px -5px rgba(15, 23, 42, 0.2);
  --shadow-bottom-nav: 0 -2px 12px rgba(0, 0, 0, 0.06);
}

/* ==========================================================================
   Glacier Glassmorphism & Industrial Dark Mode (WCAG AAA Contrast Standard)
   Canvas: #0b0f19 | Headings: #f8fafc (18.7:1) | Telemetry: #94a3b8 (8.2:1)
   ========================================================================== */
html.dark {
  color-scheme: dark;

  /* Canvas / Background: #0b0f19 Deep Obsidian */
  --surface-rgb: 11 15 25;
  --surface: #0b0f19;
  --surface-dim-rgb: 7 10 16;
  --surface-dim: #070a10;
  --surface-bright-rgb: 22 31 50;
  --surface-bright: #161f32;

  /* Card / Panel Surfaces: #0d121c to #111827 / #1a253c */
  --surface-container-lowest-rgb: 13 18 28;
  --surface-container-lowest: #0d121c;
  --surface-container-low-rgb: 17 24 39;
  --surface-container-low: #111827;
  --surface-container-rgb: 26 37 60;
  --surface-container: #1a253c;
  --surface-container-high-rgb: 33 47 74;
  --surface-container-high: #212f4a;
  --surface-container-highest-rgb: 40 58 88;
  --surface-container-highest: #283a58;
  --surface-variant-rgb: 30 41 59;
  --surface-variant: #1e293b;
  --surface-tint-rgb: 56 189 248;

  /* Text Hierarchy & Ultra-High Contrast Ratios (WCAG AAA) */
  --on-surface-rgb: 248 250 252;
  --on-surface: #f8fafc; /* Headings/High-contrast body (18.7:1 contrast on #0b0f19) */
  --on-surface-variant-rgb: 148 163 184;
  --on-surface-variant: #94a3b8; /* Telemetry/Secondary text (8.2:1 contrast on #0b0f19) */
  --inverse-surface-rgb: 248 250 252;
  --inverse-surface: #f8fafc;
  --inverse-on-surface-rgb: 11 15 25;
  --inverse-on-surface: #0b0f19;

  /* Borders & Radii: 1px solid rgba(125, 211, 252, 0.14) */
  --outline-rgb: 71 85 105;
  --outline: #475569;
  --outline-variant-rgb: 30 41 59;
  --outline-variant: #1e293b;

  /* Primary: Electric Glacier Cyan #7dd3fc / #38bdf8 */
  --primary-rgb: 56 189 248;
  --primary: #38bdf8;
  --on-primary-rgb: 11 15 25;
  --on-primary: #0b0f19;
  --primary-container-rgb: 2 132 199;
  --primary-container: #0284c7;
  --on-primary-container-rgb: 224 242 254;
  --on-primary-container: #e0f2fe;
  --primary-fixed-rgb: 186 230 253;
  --primary-fixed: #bae6fd;
  --primary-fixed-dim-rgb: 125 211 252;
  --primary-fixed-dim: #7dd3fc;
  --on-primary-fixed-rgb: 8 47 73;
  --on-primary-fixed: #082f49;
  --on-primary-fixed-variant-rgb: 3 105 161;
  --on-primary-fixed-variant: #0369a1;
  --inverse-primary-rgb: 2 132 199;
  --inverse-primary: #0284c7;

  /* Secondary: Safety Amber #f59e0b / #fbbf24 */
  --secondary-rgb: 251 191 36;
  --secondary: #fbbf24;
  --on-secondary-rgb: 15 23 42;
  --on-secondary: #0f172a;
  --secondary-container-rgb: 180 83 9;
  --secondary-container: #b45309;
  --on-secondary-container-rgb: 254 243 199;
  --on-secondary-container: #fef3c7;
  --secondary-fixed-rgb: 254 243 199;
  --secondary-fixed: #fef3c7;
  --secondary-fixed-dim-rgb: 253 230 138;
  --secondary-fixed-dim: #fde68a;
  --on-secondary-fixed-rgb: 69 26 3;
  --on-secondary-fixed: #451a03;
  --on-secondary-fixed-variant-rgb: 180 83 9;
  --on-secondary-fixed-variant: #b45309;

  /* Tertiary: Telemetry Green #34d399 / #10b981 (Verified GST, Stock Active) */
  --tertiary-rgb: 52 211 153;
  --tertiary: #34d399;
  --on-tertiary-rgb: 6 78 59;
  --on-tertiary: #064e3b;
  --tertiary-container-rgb: 5 150 105;
  --tertiary-container: #059669;
  --on-tertiary-container-rgb: 209 250 229;
  --on-tertiary-container: #d1fae5;
  --tertiary-fixed-rgb: 167 243 208;
  --tertiary-fixed: #a7f3d0;
  --tertiary-fixed-dim-rgb: 110 231 183;
  --tertiary-fixed-dim: #6ee7b7;
  --on-tertiary-fixed-rgb: 6 78 59;
  --on-tertiary-fixed: #064e3b;
  --on-tertiary-fixed-variant-rgb: 4 120 87;
  --on-tertiary-fixed-variant: #047857;

  /* Error: Critical / Low Stock Red #ef4444 */
  --error-rgb: 239 68 68;
  --error: #ef4444;
  --on-error-rgb: 255 255 255;
  --on-error: #ffffff;
  --error-container-rgb: 127 29 29;
  --error-container: #7f1d1d;
  --on-error-container-rgb: 254 202 202;
  --on-error-container: #fecaca;

  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px -2px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 20px 30px -5px rgba(0, 0, 0, 0.7);
  --shadow-bottom-nav: 0 -4px 16px rgba(0, 0, 0, 0.6);
}

/* ==========================================================================
   Site-Wide Dark Mode High-Contrast Overrides (Instant Universal Readability)
   ========================================================================== */
html.dark body {
  background-color: #0b0f19 !important;
  color: #f8fafc !important;
}

/* Ensure all cards, surfaces, and panels match Glacier Obsidian theme */
html.dark .bg-surface {
  background-color: #0b0f19 !important;
}
html.dark .bg-surface-dim {
  background-color: #070a10 !important;
}
html.dark .bg-surface-bright {
  background-color: #161f32 !important;
}
html.dark .bg-surface-container-lowest,
html.dark .bg-white {
  background-color: #0d121c !important;
}
html.dark .bg-surface-container-low {
  background-color: #111827 !important;
}
html.dark .bg-surface-container {
  background-color: #1a253c !important;
}
html.dark .bg-surface-container-high {
  background-color: #212f4a !important;
}
html.dark .bg-surface-container-highest {
  background-color: #283a58 !important;
}
html.dark .bg-surface-variant {
  background-color: #1e293b !important;
}

/* High-Contrast Text Rules: 0 black-on-black or dark-on-dark text */
html.dark .text-on-surface,
html.dark .text-slate-900,
html.dark .text-gray-900,
html.dark .text-neutral-900,
html.dark .text-black {
  color: #f8fafc !important;
}

html.dark .text-on-surface-variant,
html.dark .text-slate-600,
html.dark .text-gray-600,
html.dark .text-slate-500,
html.dark .text-gray-500 {
  color: #94a3b8 !important;
}

/* Glacier Border Accents */
html.dark .border-outline-variant,
html.dark .border-slate-200,
html.dark .border-gray-200,
html.dark .border-slate-300,
html.dark .border-gray-300 {
  border-color: rgba(125, 211, 252, 0.14) !important;
}
html.dark .border-outline {
  border-color: #475569 !important;
}

/* Forms, Inputs, Textareas, Selects & Option Elements */
html.dark input:not([type="submit"]):not([type="button"]):not([type="checkbox"]):not([type="radio"]),
html.dark select,
html.dark textarea {
  color-scheme: dark;
  background-color: rgba(17, 24, 39, 0.85) !important;
  color: #f8fafc !important;
  border-color: rgba(125, 211, 252, 0.22) !important;
}
html.dark input::placeholder,
html.dark textarea::placeholder {
  color: #64748b !important;
}
html.dark select option {
  background-color: #0d121c !important;
  color: #f8fafc !important;
}
html.dark input:focus,
html.dark select:focus,
html.dark textarea:focus {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.25) !important;
  outline: none !important;
}

/* Data Tables, Thead, Th, Tr, Td */
html.dark table {
  color: #f8fafc !important;
}
html.dark thead,
html.dark th {
  background-color: rgba(26, 37, 60, 0.85) !important;
  color: #94a3b8 !important;
  border-color: rgba(125, 211, 252, 0.14) !important;
}
html.dark tr {
  border-color: rgba(30, 41, 59, 0.7) !important;
}
html.dark td {
  color: #f8fafc !important;
  border-color: rgba(30, 41, 59, 0.7) !important;
}
html.dark tbody tr:hover {
  background-color: rgba(33, 47, 74, 0.45) !important;
}

/* Master Header & Mobile Bottom Bar Navigation */
html.dark header.fixed {
  background-color: rgba(11, 15, 25, 0.92) !important;
  border-bottom-color: rgba(125, 211, 252, 0.14) !important;
}
html.dark nav.fixed.bottom-0 {
  background-color: rgba(11, 15, 25, 0.94) !important;
  border-top-color: rgba(125, 211, 252, 0.14) !important;
}

/* Universal Drawers (Navigation & Cart) */
html.dark #nav-drawer-content,
html.dark #cart-drawer-content {
  background-color: #0d121c !important;
  border-color: rgba(125, 211, 252, 0.14) !important;
  color: #f8fafc !important;
}
html.dark #cart-drawer-content .bg-surface-container-high,
html.dark #nav-drawer-content .bg-surface-container-high {
  background-color: rgba(26, 37, 60, 0.9) !important;
}

/* Unified Toolbar in Dark Mode */
html.dark #unified-toolbar {
  background-color: rgba(17, 24, 39, 0.85) !important;
  border-color: rgba(125, 211, 252, 0.16) !important;
  box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.5) !important;
}

/* Modals & Dialogs */
html.dark .mpt-modal-card {
  background-color: #0d121c !important;
  border: 1px solid rgba(125, 211, 252, 0.18) !important;
  color: #f8fafc !important;
  box-shadow: 0 25px 60px -12px rgba(0, 0, 0, 0.75) !important;
}

/* Trust Strips & Footers */
html.dark section.bg-surface-container-high\/60 {
  background-color: rgba(13, 18, 28, 0.8) !important;
  border-top-color: rgba(125, 211, 252, 0.12) !important;
}
html.dark footer {
  background-color: #070a10 !important;
  border-top-color: rgba(30, 41, 59, 0.8) !important;
  color: #94a3b8 !important;
}
html.dark footer a {
  color: #94a3b8;
}
html.dark footer a:hover {
  color: #38bdf8 !important;
}

/* Base Body Styles */
html, body {
  width: 100%;
  max-width: 100vw;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: var(--font-family);
  background-color: var(--surface);
  color: var(--on-surface);
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}

.pb-safe {
  padding-bottom: max(env(safe-area-inset-bottom, 0px), 12px);
}

.pt-safe {
  padding-top: max(env(safe-area-inset-top, 0px), 0px);
}

/* Material Symbols Adjustments */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined' !important;
  font-weight: normal;
  font-style: normal;
  font-size: 24px;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  display: inline-block;
  white-space: nowrap;
  word-wrap: normal;
  direction: ltr;
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
  vertical-align: middle;
}

/* Scrollbar Utility */
::-webkit-scrollbar,
.no-scrollbar::-webkit-scrollbar,
.scrollbar-none::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

.no-scrollbar,
.scrollbar-none {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

/* Tap Feedback */
.tab-tap-feedback:active {
  transform: scale(0.94);
  transition: transform 0.1s ease;
}

/* Slide-Over Navigation Drawer */
#nav-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.25s ease;
}

#nav-drawer.active {
  pointer-events: auto;
  visibility: visible;
}

#nav-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 15, 25, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

#nav-drawer.active #nav-drawer-backdrop {
  opacity: 1;
}

#nav-drawer-content {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 85%;
  max-width: 360px;
  background-color: var(--surface);
  box-shadow: 10px 0 35px rgba(0, 0, 0, 0.25);
  transform: translateX(-100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

#nav-drawer.active #nav-drawer-content {
  transform: translateX(0);
}

/* Slide-Over & Mobile Bottom Sheet Shopping Cart Drawer */
#cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 1000;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.25s ease;
}

#cart-drawer.active {
  pointer-events: auto;
  visibility: visible;
}

#cart-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 15, 25, 0.68);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

#cart-drawer.active #cart-drawer-backdrop {
  opacity: 1;
}

#cart-drawer-content {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 90%;
  max-width: 440px;
  background-color: var(--surface);
  box-shadow: -10px 0 35px rgba(0, 0, 0, 0.25);
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
}

#cart-drawer.active #cart-drawer-content {
  transform: translateX(0);
}

/* Mobile Bottom Sheet Transformation (< 640px) */
@media (max-width: 639px) {
  #cart-drawer-content {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    max-width: 100%;
    max-height: 88vh;
    border-radius: 24px 24px 0 0;
    border-left: none;
    border-top: 1px solid var(--outline-variant);
    transform: translateY(100%);
    box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.35);
  }

  #cart-drawer.active #cart-drawer-content {
    transform: translateY(0);
  }

  #nav-drawer-content {
    width: 82%;
    max-width: 320px;
  }
}

/* Scroll Lock when any drawer/modal is active */
body.drawer-open {
  overflow: hidden !important;
  touch-action: none !important;
}

/* Toast Container */
#toast-container {
  position: fixed;
  top: 76px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  width: 90%;
  max-width: 380px;
}

.toast-pill {
  background-color: var(--inverse-surface);
  color: var(--inverse-on-surface);
  padding: 10px 16px;
  border-radius: 9999px;
  font-size: 13px;
  font-weight: 600;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  animation: toastSlideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  pointer-events: auto;
}

@keyframes toastSlideDown {
  from { opacity: 0; transform: translateY(-16px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Modals */
.mpt-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.mpt-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(11, 15, 25, 0.7);
  backdrop-filter: blur(6px);
}

.mpt-modal-card {
  position: relative;
  background: var(--surface);
  border-radius: 16px;
  max-width: 480px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
  z-index: 1;
}

/* Minimum 44px tap targets */
button, a.btn, input[type="button"], input[type="submit"] {
  min-height: 40px;
}

/* Compatibility & Industrial Utilities */
.v2-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

.v2-card {
  background: var(--surface-container-lowest);
  border: 1px solid var(--outline-variant);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.2s, box-shadow 0.2s;
}

html.dark .v2-card {
  background: rgba(17, 24, 39, 0.75);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(125, 211, 252, 0.14);
}

.v2-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  font-weight: 600;
  min-height: 44px;
  padding: 10px 18px;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s;
  font-family: inherit;
  font-size: 14px;
}

.v2-btn-primary {
  background: var(--primary);
  color: var(--on-primary);
  border: 1px solid transparent;
}
.v2-btn-primary:hover {
  background: var(--primary-container);
  color: var(--on-primary);
}

.v2-btn-outline-sky {
  background: var(--surface-container-low);
  color: var(--on-surface);
  border: 1px solid var(--outline-variant);
}
.v2-btn-outline-sky:hover {
  background: var(--surface-container);
  border-color: var(--primary);
}

html.dark .v2-btn-outline-sky {
  background: rgba(125, 211, 252, 0.08);
  color: #7dd3fc;
  border: 1px solid rgba(125, 211, 252, 0.25);
}
html.dark .v2-btn-outline-sky:hover {
  background: rgba(125, 211, 252, 0.16);
  border-color: #38bdf8;
}

.v2-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--surface-container-high);
  color: var(--on-surface-variant);
  border: 1px solid var(--outline-variant);
}

.v2-badge-blue {
  background: var(--primary-fixed);
  color: var(--on-primary-fixed-variant);
  border-color: var(--primary-fixed-dim);
}

html.dark .v2-badge-blue {
  background: rgba(2, 132, 199, 0.2);
  color: #7dd3fc;
  border-color: rgba(56, 189, 248, 0.3);
}

.v2-heading-xl {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--on-surface);
}

.v2-heading-lg {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--on-surface);
}

/* Unified Desktop Content Width (1280px Standard) */
.v3-main {
  width: 100%;
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-top: 4.5rem;
  padding-left: 1rem;
  padding-right: 1rem;
}
@media (min-width: 640px) {
  .v3-main {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}
@media (min-width: 1024px) {
  .v3-main {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Top Drawer Box Notification Drawer (Desktop ~350px, Glacier Glassmorphic, All Pages Common) */
#notification-drawer {
  position: fixed;
  inset: 0;
  z-index: 1200;
  pointer-events: none;
  visibility: hidden;
  transition: visibility 0.25s ease;
}

#notification-drawer.active {
  pointer-events: auto;
  visibility: visible;
}

#notification-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(11, 15, 25, 0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  cursor: pointer;
  transition: opacity 0.25s ease;
  z-index: 1200;
}

#notification-drawer.active #notification-drawer-backdrop {
  opacity: 1;
}

#notification-drawer-content {
  position: fixed;
  top: 4.75rem;
  right: 1.5rem;
  width: 350px;
  max-width: calc(100vw - 2rem);
  max-height: min(490px, calc(100vh - 6rem));
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(195, 198, 214, 0.65);
  border-radius: 16px;
  box-shadow: 0 20px 48px -10px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(0, 61, 155, 0.08);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(-14px) scale(0.96);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.22s ease;
  z-index: 1201;
  pointer-events: auto;
  color: var(--on-surface);
}

html.dark #notification-drawer-content {
  background: rgba(17, 24, 39, 0.95);
  border: 1px solid rgba(125, 211, 252, 0.18);
  box-shadow: 0 20px 48px -10px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(125, 211, 252, 0.12);
  color: #f8fafc;
}

#notification-drawer.active #notification-drawer-content {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Align under header bell button inside 1280px unified layout */
@media (min-width: 1280px) {
  #notification-drawer-content {
    right: calc((100vw - 1280px) / 2 + 1.5rem);
  }
}

/* Auto-Hide Interval Countdown Indicator */
#notification-interval-track {
  width: 100%;
  height: 3px;
  background: rgba(148, 163, 184, 0.18);
  position: relative;
  overflow: hidden;
}

#notification-interval-bar {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, #0284c7, #7dd3fc);
  transform-origin: left center;
  transition: width 0.08s linear, background 0.2s ease;
}

#notification-interval-bar.paused {
  background: linear-gradient(90deg, #f59e0b, #fbbf24);
}

/* Sleek Scrollable Notification Items List */
#notification-items-list {
  scrollbar-width: thin;
  scrollbar-color: rgba(125, 211, 252, 0.25) transparent;
}

#notification-items-list::-webkit-scrollbar {
  width: 5px;
}

#notification-items-list::-webkit-scrollbar-track {
  background: transparent;
}

#notification-items-list::-webkit-scrollbar-thumb {
  background: rgba(125, 211, 252, 0.25);
  border-radius: 9999px;
}

#notification-items-list::-webkit-scrollbar-thumb:hover {
  background: rgba(125, 211, 252, 0.45);
}

@media (max-width: 639px) {
  #notification-drawer-content {
    top: 4.25rem;
    left: 0.75rem;
    right: 0.75rem;
    width: auto;
    max-width: 380px;
    margin: 0 auto;
    max-height: calc(100vh - 5.5rem);
    border-radius: 16px;
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
    transform: translateY(-10px) scale(0.96);
  }

  #notification-drawer.active #notification-drawer-content {
    transform: translateY(0) scale(1);
  }
}

/* Unified Floating Action Button (FAB) & Multi-Action Speed Dial */
.unified-fab-wrapper {
  position: fixed;
  bottom: 5rem; /* Sits cleanly above mobile bottom bar */
  right: 1rem;
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.75rem;
}

@media (min-width: 768px) {
  .unified-fab-wrapper {
    bottom: 2rem;
    right: 2rem;
  }
}

.fab-main-btn {
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 9999px;
  background: var(--primary);
  color: var(--on-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 25px -5px rgba(0, 61, 155, 0.4), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.fab-main-btn:hover {
  transform: scale(1.06);
  background: var(--primary-container);
}

.fab-main-btn:active {
  transform: scale(0.95);
}

.fab-speed-dial {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.6rem;
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px) scale(0.95);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.unified-fab-wrapper.active .fab-speed-dial {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.unified-fab-wrapper.active .fab-icon-main {
  transform: rotate(135deg);
}

.fab-icon-main {
  transition: transform 0.25s ease;
}

.fab-action-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.fab-action-item:hover {
  transform: translateX(-4px);
}

.fab-action-label {
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--inverse-surface);
  color: var(--inverse-on-surface);
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.fab-action-btn {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 9999px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  border: 1px solid var(--outline-variant);
  cursor: pointer;
}

