/* ==========================================================================
   141 HQ — Mobile Native & Accessibility System Stylesheet
   Crafted for authentic native phone app feel, crisp typography, and accessibility
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Root Variables & Accessibility Scalers
   -------------------------------------------------------------------------- */
:root {
  --mobile-nav-height: 54px;
  --mobile-topbar-height: 48px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);

  /* A11y dynamic scaling */
  --a11y-font-scale: 1;
  --a11y-target-min: 42px;
  --a11y-touch-gap: 6px;
  --a11y-line-height: 1.45;
  --a11y-letter-spacing: normal;
}

/* --------------------------------------------------------------------------
   2. Accessibility Mode Modifiers
   -------------------------------------------------------------------------- */

/* Font Scaling Presets */
html.a11y-font-lg { --a11y-font-scale: 1.15; }
html.a11y-font-xl { --a11y-font-scale: 1.28; }
html.a11y-font-max { --a11y-font-scale: 1.42; }

html[class*="a11y-font-"] body {
  font-size: calc(0.85rem * var(--a11y-font-scale)) !important;
}
html[class*="a11y-font-"] .page-title,
html[class*="a11y-font-"] h1,
html[class*="a11y-font-"] h2,
html[class*="a11y-font-"] h3 {
  font-size: calc(1em * var(--a11y-font-scale)) !important;
}

/* High Contrast / Outdoor Sunlight Mode */
html.a11y-contrast-high {
  --bg-dark: #000000 !important;
  --bg-panel: #050505 !important;
  --bg-card: #0a0a0c !important;
  --bg-card-hover: #121216 !important;
  --border-light: rgba(255, 255, 255, 0.32) !important;
  --zinc-300: #ffffff !important;
  --zinc-400: #e4e4e7 !important;
  --zinc-500: #d4d4d8 !important;
  --brand-400: #5eead4 !important;
  --brand-500: #2dd4bf !important;
}

html.a11y-contrast-high body {
  background-color: #000000 !important;
  color: #ffffff !important;
}

html.a11y-contrast-high .glass-panel,
html.a11y-contrast-high .stat-card,
html.a11y-contrast-high .activity-card,
html.a11y-contrast-high .metric-card,
html.a11y-contrast-high .content-panel,
html.a11y-contrast-high .mobile-bottom-nav,
html.a11y-contrast-high .login-card {
  border: 1.5px solid #2dd4bf !important;
  box-shadow: 0 0 12px rgba(45, 212, 191, 0.25) !important;
}

/* Large Touch Targets */
html.a11y-large-touch {
  --a11y-target-min: 50px;
  --a11y-touch-gap: 10px;
}

html.a11y-large-touch button,
html.a11y-large-touch .btn-brand,
html.a11y-large-touch .btn-subtle,
html.a11y-large-touch .tab-btn,
html.a11y-large-touch .mobile-nav-item,
html.a11y-large-touch .form-input {
  min-height: var(--a11y-target-min) !important;
  padding-top: 10px !important;
  padding-bottom: 10px !important;
  font-size: 0.95rem !important;
}

/* Reduce Motion & Battery Saver */
html.a11y-reduce-motion *,
html.a11y-reduce-motion *::before,
html.a11y-reduce-motion *::after {
  animation-duration: 0.001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.001ms !important;
  scroll-behavior: auto !important;
}

html.a11y-reduce-motion .blob,
html.a11y-reduce-motion .ambient-backdrop {
  display: none !important;
}

html.a11y-reduce-motion .glass-panel,
html.a11y-reduce-motion .mobile-bottom-nav,
html.a11y-reduce-motion .mobile-sheet-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background-color: #121318 !important;
}

/* Dyslexic / Easy-Reading Font Mode */
html.a11y-dyslexic body,
html.a11y-dyslexic input,
html.a11y-dyslexic button,
html.a11y-dyslexic select {
  font-family: 'Atkinson Hyperlegible', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif !important;
  letter-spacing: 0.03em !important;
  line-height: 1.65 !important;
}

/* High-Visibility Focus Outline */
html.a11y-focus-visible *:focus-visible {
  outline: 2.5px solid #2dd4bf !important;
  outline-offset: 2px !important;
}

/* One-Handed Thumb Reach Mode */
@media (max-width: 860px) {
  html.a11y-one-handed .hq-main-wrapper,
  html.a11y-one-handed .login-viewport {
    padding-top: 22vh !important;
    transition: padding-top 0.22s ease;
  }
  html.a11y-one-handed::before {
    content: "Thumb Reach Zone Active (Tap to dismiss)";
    position: fixed;
    top: calc(var(--mobile-topbar-height) + var(--safe-top));
    left: 0;
    right: 0;
    height: 30px;
    background: rgba(20, 184, 166, 0.25);
    border-bottom: 1px dashed rgba(20, 184, 166, 0.5);
    color: var(--brand-400);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    font-weight: 600;
    z-index: 950;
    cursor: pointer;
  }
}

@media (min-width: 861px) {
  .mobile-topbar-brand {
    display: none !important;
  }
}

/* --------------------------------------------------------------------------
   3. Mobile Device Specific Typography & Layout Overrides (<= 860px)
   -------------------------------------------------------------------------- */
@media (max-width: 860px) {
  /* Fluid font scaling down for mobile phones */
  html {
    font-size: 13.5px !important;
  }

  body {
    font-size: 0.84rem !important;
    line-height: 1.4 !important;
    padding-bottom: calc(var(--mobile-nav-height) + var(--safe-bottom) + 12px) !important;
    -webkit-text-size-adjust: 100%;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    overscroll-behavior-y: contain;
  }

  /* Shrunk Headings for Mobile Screens */
  h1 {
    font-size: 1.25rem !important;
    font-weight: 700 !important;
    letter-spacing: -0.015em !important;
    line-height: 1.25 !important;
  }

  h2 {
    font-size: 1.05rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
  }

  h3, .panel-title {
    font-size: 0.85rem !important;
    font-weight: 700 !important;
    line-height: 1.25 !important;
  }

  h4 {
    font-size: 0.78rem !important;
  }

  p {
    font-size: 0.75rem !important;
    line-height: 1.35 !important;
  }

  /* Mobile UI: Left sidebar drawer hidden by default, accessible via Hamburger Menu */
  .hq-sidebar:not(.drawer-open):not(.open) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transform: translateX(-100%) !important;
  }

  .sidebar-backdrop:not(.active):not(.open) {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    opacity: 0 !important;
  }

  .hq-sidebar.drawer-open,
  .hq-sidebar.open {
    display: flex !important;
    visibility: visible !important;
    pointer-events: auto !important;
    transform: translateX(0) !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    max-width: 85vw !important;
    z-index: 100000 !important;
    background: var(--bg-surface, #0f172a) !important;
    box-shadow: 4px 0 28px rgba(0, 0, 0, 0.6) !important;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.25s !important;
  }

  .sidebar-backdrop.active,
  .sidebar-backdrop.open {
    display: block !important;
    visibility: visible !important;
    pointer-events: auto !important;
    opacity: 1 !important;
    position: fixed !important;
    inset: 0 !important;
    z-index: 99999 !important;
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(4px) !important;
    -webkit-backdrop-filter: blur(4px) !important;
  }

  /* Main wrapper full width and compact top padding */
  .hq-main-wrapper {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding-top: calc(var(--mobile-topbar-height) + var(--safe-top)) !important;
  }

  /* Content view container tight padding with clearance for bottom tab bar */
  body {
    padding-bottom: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 24px) !important;
  }

  .hq-content-view,
  .dashboard-container,
  .schedule-container,
  .intel-container,
  .notes-container,
  .expenses-main,
  .tasks-container,
  .economy-container,
  .chat-container,
  .query-container,
  .admin-container,
  .payment-page-container {
    padding: 10px 10px calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px) + 24px) 10px !important;
  }

  /* ------------------------------------------------------------------------
     Native Mobile Top Bar (Clean 48px Header)
     ------------------------------------------------------------------------ */
  .hq-topbar,
  .topbar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100% !important;
    height: calc(var(--mobile-topbar-height) + var(--safe-top)) !important;
    padding-top: var(--safe-top) !important;
    padding-left: 14px !important;
    padding-right: 14px !important;
    background: #0e0f14 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    z-index: 900 !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
  }

  .topbar-left {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    min-width: 0 !important;
    flex: 1 !important;
    overflow: hidden !important;
  }

  /* Hide topbar desktop hamburger on mobile while keeping in-drawer close buttons functional */
  .topbar .btn-hamburger,
  .hq-topbar .btn-hamburger,
  #hq-hamburger-btn {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
    width: 0 !important;
    height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    position: absolute !important;
    left: -9999px !important;
  }

  .mobile-topbar-brand {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    text-decoration: none !important;
    color: #ffffff !important;
    flex-shrink: 0 !important;
    min-width: 0 !important;
  }

  .mobile-topbar-logo {
    width: 26px !important;
    height: 26px !important;
    min-width: 26px !important;
    min-height: 26px !important;
    border-radius: 6px !important;
    background: transparent !important;
    padding: 0 !important;
    display: block !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
  }

  .mobile-topbar-title {
    font-size: 0.95rem !important;
    font-weight: 800 !important;
    letter-spacing: -0.01em !important;
    white-space: nowrap !important;
    color: #ffffff !important;
  }

  .mobile-topbar-title span {
    color: var(--brand-400) !important;
  }

  /* Hide long desktop page titles & search bar on topbar to prevent crowding */
  .hq-topbar .page-title,
  .topbar .page-title,
  .page-title,
  .topbar-title-wrap,
  .topbar-title,
  .global-search-box,
  .telemetry-pill,
  .topbar-search-wrap {
    display: none !important;
  }

  .topbar-right {
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
    flex-shrink: 0 !important;
    margin-left: auto !important;
  }

  /* Keep topbar right clean and uncluttered: QC pill, Notif, and Avatar only */
  .topbar-right .topbar-qc-pill {
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    height: 28px !important;
    padding: 0 8px !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    border-radius: 9999px !important;
    font-size: 0.75rem !important;
    font-weight: 600 !important;
    color: #ffffff !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .topbar-right .topbar-qc-pill img.qc-icon,
  .topbar-right .topbar-qc-pill .qc-icon {
    width: 14px !important;
    height: 14px !important;
    object-fit: contain !important;
    flex-shrink: 0 !important;
  }

  .topbar-right .topbar-qc-pill .qc-balance {
    font-weight: 700 !important;
    font-size: 0.75rem !important;
    color: #ffffff !important;
  }

  .topbar-right .topbar-qc-pill .qc-unit {
    color: var(--brand-400) !important;
    font-size: 0.7rem !important;
    font-weight: 600 !important;
  }

  .topbar-right .topbar-qc-pill .qc-add-icon {
    font-size: 0.72rem !important;
    color: #a1a1aa !important;
    margin-left: 1px !important;
  }

  .topbar-right .topbar-notif-wrap {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    position: relative !important;
    flex-shrink: 0 !important;
  }

  .topbar-right .topbar-notif-wrap .topbar-icon-btn,
  .topbar-right .topbar-notif-wrap .topbar-notif-btn,
  .topbar-right #topbar-notif-btn {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.12) !important;
    color: #d4d4d8 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 0 !important;
    cursor: pointer !important;
  }

  .topbar-right .topbar-notif-wrap .topbar-icon-btn svg,
  .topbar-right #topbar-notif-btn svg {
    width: 14px !important;
    height: 14px !important;
  }

  .topbar-right .topbar-notif-wrap .notif-badge {
    position: absolute !important;
    top: -2px !important;
    right: -2px !important;
    min-width: 14px !important;
    height: 14px !important;
    font-size: 0.58rem !important;
    font-weight: 700 !important;
    padding: 0 3px !important;
    border-radius: 9999px !important;
    background: #ef4444 !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: 1.5px solid #0e0f14 !important;
  }

  .topbar-right .topbar-user-wrap {
    display: inline-flex !important;
    align-items: center !important;
    position: relative !important;
    flex-shrink: 0 !important;
  }

  .topbar-right .topbar-user-wrap .topbar-profile-btn {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    margin: 0 !important;
    display: flex !important;
    align-items: center !important;
    cursor: pointer !important;
  }

  .topbar-right .topbar-user-wrap .topbar-avatar,
  .topbar-right .topbar-user-wrap img {
    width: 28px !important;
    height: 28px !important;
    min-width: 28px !important;
    min-height: 28px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.12) !important;
    border: 1.5px solid rgba(255, 255, 255, 0.2) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    line-height: 1 !important;
    object-fit: cover !important;
  }

  .topbar-right .topbar-user-wrap .topbar-user-meta,
  .topbar-right .topbar-user-wrap .topbar-user-name,
  .topbar-right .topbar-user-wrap .topbar-user-role,
  .topbar-right .topbar-user-wrap .user-meta,
  .topbar-right .topbar-user-wrap .user-name,
  .topbar-right .topbar-user-wrap .user-role,
  .topbar-right .topbar-user-wrap .user-chevron,
  .topbar-right .topbar-user-wrap svg {
    display: none !important;
  }

  /* Hide noisy clutter, giant buttons, and duplicate kebab/admin controls on mobile topbar */
  .topbar-right .hq-kebab-btn,
  .topbar-right #mobile-topbar-kebab-btn,
  .topbar-right .mobile-topbar-kebab-btn,
  .topbar-right #topbar-admin-badge,
  .topbar-right .topbar-admin-badge-btn,
  .topbar-right .mobile-topbar-a11y-btn,
  .topbar-right .btn-brand,
  .topbar-right .btn-primary,
  .topbar-right .btn-primary-schedule,
  .topbar-right .btn-subtle,
  .topbar-right .btn-action {
    display: none !important;
  }

  /* Discreet Circular Mobile Action Buttons */
  .mobile-action-btn {
    width: 28px !important;
    height: 28px !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, 0.06) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    color: #ffffff !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
  }

  .mobile-action-btn svg {
    width: 15px !important;
    height: 15px !important;
  }

  /* Avatar button compact on mobile */
  .topbar-profile-btn {
    padding: 2px !important;
    background: transparent !important;
    border: none !important;
    gap: 4px !important;
  }

  .topbar-avatar {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.7rem !important;
    font-weight: 700 !important;
  }

  .topbar-user-meta,
  .topbar-profile-btn > svg {
    display: none !important;
  }

  /* Profile dropdown compact on mobile */
  .profile-dropdown-menu {
    min-width: 210px !important;
    right: 4px !important;
    top: 42px !important;
    border-radius: 12px !important;
    padding: 8px !important;
  }

  .profile-dropdown-header {
    padding: 8px 10px !important;
  }

  .profile-dropdown-name {
    font-size: 0.8rem !important;
  }

  .profile-dropdown-email {
    font-size: 0.68rem !important;
  }

  .profile-dropdown-item {
    padding: 7px 10px !important;
    font-size: 0.75rem !important;
    border-radius: 6px !important;
  }

  /* ------------------------------------------------------------------------
     Overview Dashboard Elements on Mobile
     ------------------------------------------------------------------------ */
  .metrics-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
  }

  .metric-card {
    padding: 9px 10px !important;
    border-radius: 10px !important;
    background: rgba(22, 23, 28, 0.75) !important;
  }

  .metric-header {
    margin-bottom: 3px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .metric-title {
    font-size: 0.65rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.02em !important;
  }

  .metric-value {
    font-size: 1.15rem !important;
    font-weight: 800 !important;
    margin: 2px 0 !important;
    line-height: 1.2 !important;
  }

  .metric-sub {
    font-size: 0.62rem !important;
    line-height: 1.2 !important;
  }

  .badge {
    font-size: 0.6rem !important;
    padding: 2px 5px !important;
  }

  .dashboard-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .content-panel {
    padding: 10px 12px !important;
    border-radius: 12px !important;
    margin-bottom: 10px !important;
  }

  .panel-header {
    padding-bottom: 6px !important;
    margin-bottom: 8px !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }

  .panel-title {
    font-size: 0.8rem !important;
  }

  .panel-title svg {
    width: 15px !important;
    height: 15px !important;
  }

  /* ------------------------------------------------------------------------
     Expenses Screen Mobile Layout
     ------------------------------------------------------------------------ */
  .stat-ribbon {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
    margin-bottom: 10px !important;
  }

  .stat-card {
    padding: 8px 10px !important;
    border-radius: 10px !important;
  }

  .stat-card div:first-child {
    font-size: 0.64rem !important;
  }

  .stat-val {
    font-size: 1.1rem !important;
    font-weight: 800 !important;
    margin: 2px 0 !important;
  }

  .stat-sub {
    font-size: 0.62rem !important;
  }

  .expense-nav-tabs {
    display: flex !important;
    overflow-x: auto !important;
    gap: 4px !important;
    padding: 3px !important;
    border-radius: 8px !important;
    background: rgba(0, 0, 0, 0.4) !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .expense-nav-tabs::-webkit-scrollbar {
    display: none !important;
  }

  .expense-tab-btn {
    padding: 6px 10px !important;
    font-size: 0.72rem !important;
    white-space: nowrap !important;
    border-radius: 6px !important;
  }

  /* Quick add panel in expenses */
  .quick-add-panel {
    padding: 10px 12px !important;
    border-radius: 12px !important;
    margin-bottom: 10px !important;
  }

  .quick-add-panel form > div {
    grid-template-columns: 1fr !important;
    gap: 6px !important;
  }

  /* Receipt studio responsive fit */
  .receipt-studio-body {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .receipt-studio-preview {
    position: static !important;
    max-width: 100% !important;
    overflow-x: auto !important;
  }

  /* ------------------------------------------------------------------------
     Schedule Screen Mobile Layout
     ------------------------------------------------------------------------ */
  .schedule-workspace-hero {
    padding: 10px 12px !important;
    border-radius: 12px !important;
    margin-bottom: 10px !important;
  }

  .hero-content-wrap {
    gap: 10px !important;
  }

  .hero-left {
    gap: 10px !important;
  }

  .hero-avatar {
    width: 34px !important;
    height: 34px !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
  }

  .hero-meta-title {
    font-size: 0.88rem !important;
    gap: 6px !important;
    flex-wrap: wrap !important;
  }

  .workspace-badge {
    font-size: 0.6rem !important;
    padding: 1px 5px !important;
  }

  .hero-meta-subtitle {
    font-size: 0.68rem !important;
  }

  .hero-right-actions {
    width: 100% !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
  }

  .schedule-kanban-view {
    display: flex !important;
    overflow-x: auto !important;
    scroll-snap-type: x mandatory !important;
    gap: 10px !important;
    padding-bottom: 10px !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .kanban-column {
    min-width: 84vw !important;
    max-width: 86vw !important;
    scroll-snap-align: center !important;
    flex-shrink: 0 !important;
    padding: 10px !important;
    border-radius: 12px !important;
    min-height: 360px !important;
  }

  .kanban-column-title {
    font-size: 0.75rem !important;
  }

  .activity-card {
    padding: 8px 10px !important;
    border-radius: 8px !important;
  }

  .activity-title {
    font-size: 0.8rem !important;
    font-weight: 600 !important;
  }

  .activity-description {
    font-size: 0.72rem !important;
  }

  /* ------------------------------------------------------------------------
     Intel Tree Mobile Layout
     ------------------------------------------------------------------------ */
  .intel-workspace-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
  }

  .intel-trees-panel {
    max-height: none !important;
    position: static !important;
    padding: 10px 12px !important;
    border-radius: 12px !important;
  }

  .trees-panel-title {
    font-size: 0.82rem !important;
  }

  .tree-card-item {
    padding: 8px 10px !important;
    border-radius: 8px !important;
  }

  .tree-name {
    font-size: 0.8rem !important;
  }

  /* Mobile Modals */
  .modal-dialog,
  .modal-container,
  .modal-card,
  .receipt-modal-card {
    width: 94% !important;
    max-width: 400px !important;
    margin: auto !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
  }

  .modal-header h3,
  .modal-title {
    font-size: 0.95rem !important;
  }

  .modal-body {
    padding: 10px 0 !important;
  }

  .modal-footer {
    padding: 10px 0 4px 0 !important;
    gap: 8px !important;
  }

  .modal-footer button {
    padding: 7px 12px !important;
    font-size: 0.78rem !important;
  }
}

/* --------------------------------------------------------------------------
   4. Native Mobile Bottom Navigation Bar (Dock)
   -------------------------------------------------------------------------- */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 860px) {
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--mobile-nav-height) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #0e0f14;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    z-index: 980;
    align-items: stretch;
    justify-content: space-around;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.4);
    user-select: none;
    -webkit-user-select: none;
  }

  .mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--zinc-400);
    padding: 6px 2px;
    position: relative;
    transition: color 0.15s ease, background-color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    background: transparent;
    border: none;
    cursor: pointer;
    min-width: 0;
    min-height: 48px;
  }

  .mobile-nav-item:active {
    background: rgba(255, 255, 255, 0.05);
  }

  .mobile-nav-icon-wrap {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 24px;
  }

  .mobile-nav-icon-wrap svg {
    width: 20px;
    height: 20px;
    stroke-width: 2;
    transition: stroke 0.15s ease, fill 0.15s ease;
  }

  .mobile-nav-qc-icon {
    width: 20px;
    height: 20px;
    object-fit: contain;
    border-radius: 50%;
  }

  .mobile-nav-badge {
    position: absolute;
    top: -4px;
    right: -7px;
    min-width: 15px;
    height: 15px;
    padding: 0 4px;
    border-radius: 9999px;
    background: #ef4444;
    color: #ffffff;
    font-size: 0.58rem;
    font-weight: 700;
    line-height: 15px;
    text-align: center;
    display: none;
    box-shadow: 0 0 0 1.5px #0e0f14;
  }

  .mobile-nav-badge.active {
    display: inline-block;
  }

  .mobile-nav-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    border: 1px solid rgba(255, 255, 255, 0.22);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1;
    text-transform: uppercase;
  }

  .mobile-nav-label {
    font-size: 0.68rem;
    font-weight: 500;
    letter-spacing: -0.01em;
    line-height: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
    padding: 0 2px;
  }

  .mobile-nav-item.active {
    color: #ffffff;
  }

  .mobile-nav-item.active .mobile-nav-icon-wrap {
    color: var(--brand-400);
  }

  .mobile-nav-item.active .mobile-nav-icon-wrap svg {
    stroke: var(--brand-400);
  }

  .mobile-nav-item.active .mobile-nav-avatar {
    border-color: var(--brand-400);
    color: var(--brand-400);
    background: rgba(20, 184, 166, 0.15);
  }

  .mobile-nav-item.active .mobile-nav-label {
    color: #ffffff;
    font-weight: 600;
  }

  .mobile-nav-item.active::before {
    content: '';
    position: absolute;
    top: 0;
    width: 28px;
    height: 2px;
    border-radius: 2px;
    background: var(--brand-400);
  }
}

/* Floating a11y button hidden in favor of kebab sheet integration */
.mobile-a11y-fab {
  display: none !important;
}

/* --------------------------------------------------------------------------
   6. Native Mobile Bottom Sheets (Accessibility & Hub)
   -------------------------------------------------------------------------- */
.mobile-sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.mobile-sheet-backdrop.active {
  opacity: 1;
  visibility: visible;
}

.mobile-sheet-container {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 520px;
  margin: 0 auto;
  z-index: 1001;
  transform: translateY(100%);
  transition: transform 0.26s cubic-bezier(0.16, 1, 0.3, 1);
  padding-bottom: var(--safe-bottom);
}

.mobile-sheet-container.active {
  transform: translateY(0);
}

.mobile-sheet-card {
  background: #14151b;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top-left-radius: 20px;
  border-top-right-radius: 20px;
  box-shadow: 0 -10px 30px rgba(0, 0, 0, 0.7);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.mobile-sheet-drag-handle {
  width: 38px;
  height: 4px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.25);
  margin: 8px auto 2px auto;
  cursor: grab;
}

.mobile-sheet-header {
  padding: 10px 16px 12px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.mobile-sheet-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  color: #ffffff;
}

.mobile-sheet-title svg {
  color: var(--brand-400);
}

.mobile-sheet-close-btn {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--zinc-400);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mobile-sheet-close-btn:active {
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
}

.mobile-sheet-body {
  padding: 12px 16px 20px 16px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Accessibility Option Item in Sheet */
.a11y-card-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.a11y-item-info {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.a11y-item-title {
  font-size: 0.8rem;
  font-weight: 600;
  color: #ffffff;
  display: flex;
  align-items: center;
  gap: 6px;
}

.a11y-item-desc {
  font-size: 0.68rem;
  color: var(--zinc-400);
}

/* Segmented Control for Font Sizes */
.a11y-segmented-control {
  display: flex;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
  width: 100%;
  margin-top: 6px;
}

.a11y-segment-btn {
  flex: 1;
  background: transparent;
  border: none;
  border-radius: 6px;
  padding: 6px 2px;
  color: var(--zinc-400);
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
}

.a11y-segment-btn.active {
  background: var(--brand-600);
  color: #ffffff;
}

/* Native Switch */
.a11y-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
}

.a11y-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.a11y-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background-color: rgba(255, 255, 255, 0.15);
  transition: 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 30px;
}

.a11y-slider:before {
  position: absolute;
  content: "";
  height: 18px;
  width: 18px;
  left: 3px;
  bottom: 3px;
  background-color: #ffffff;
  transition: 0.22s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 50%;
}

.a11y-switch input:checked + .a11y-slider {
  background-color: var(--brand-500);
}

.a11y-switch input:checked + .a11y-slider:before {
  transform: translateX(18px);
}

/* --------------------------------------------------------------------------
   7. Native Mobile Kebab Options Sheet
   -------------------------------------------------------------------------- */
.mobile-kebab-section {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.mobile-kebab-section:last-child {
  margin-bottom: 4px;
}

.mobile-kebab-section-title {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--zinc-400);
  padding: 0 4px 2px 4px;
}

.mobile-kebab-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  text-decoration: none;
  color: #ffffff;
  transition: background-color 0.15s ease, border-color 0.15s ease;
  min-height: 48px;
  box-sizing: border-box;
}

.mobile-kebab-item:active {
  background: rgba(255, 255, 255, 0.08);
}

.mobile-kebab-item.active {
  border-color: rgba(20, 184, 166, 0.4);
  background: rgba(20, 184, 166, 0.08);
}

.mobile-kebab-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-400);
  flex-shrink: 0;
}

.mobile-kebab-item.active .mobile-kebab-icon {
  background: rgba(20, 184, 166, 0.2);
}

.mobile-kebab-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.mobile-kebab-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.mobile-kebab-name {
  font-size: 0.86rem;
  font-weight: 600;
  color: #ffffff;
}

.mobile-kebab-badge {
  font-size: 0.62rem;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(20, 184, 166, 0.18);
  color: var(--brand-400);
}

.mobile-kebab-desc {
  font-size: 0.72rem;
  color: var(--zinc-400);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mobile-kebab-arrow {
  color: var(--zinc-500);
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   8. Mobile Kebab Category Filter Pills & Topbar Actions
   -------------------------------------------------------------------------- */
.mobile-kebab-filter-pills {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 8px 2px;
  margin-bottom: 8px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.mobile-kebab-filter-pills::-webkit-scrollbar {
  display: none;
}

.mobile-kebab-filter-pill {
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #94a3b8;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.mobile-kebab-filter-pill:hover,
.mobile-kebab-filter-pill:active {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

.mobile-kebab-filter-pill.active {
  background: var(--brand-500);
  border-color: var(--brand-500);
  color: #ffffff;
}

/* Universal Topbar Kebab Menu Button (Desktop & Mobile) */
.mobile-topbar-kebab-btn,
.hq-kebab-btn {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 32px !important;
  height: 32px !important;
  border-radius: 8px !important;
  background: rgba(255, 255, 255, 0.05) !important;
  border: 1px solid rgba(255, 255, 255, 0.12) !important;
  color: #ffffff !important;
  cursor: pointer !important;
  padding: 0 !important;
  margin-right: 6px !important;
  -webkit-tap-highlight-color: transparent !important;
  transition: all 0.15s ease !important;
}

.mobile-topbar-kebab-btn:hover,
.hq-kebab-btn:hover {
  background: rgba(255, 255, 255, 0.12) !important;
  border-color: rgba(255, 255, 255, 0.25) !important;
}

.mobile-topbar-kebab-btn:active,
.hq-kebab-btn:active {
  background: rgba(255, 255, 255, 0.2) !important;
  border-color: var(--brand-500) !important;
}

/* Quick Direct Admin Badge in Topbar */
.topbar-admin-badge-btn {
  display: inline-flex !important;
  align-items: center !important;
  gap: 5px !important;
  padding: 5px 11px !important;
  border-radius: 7px !important;
  font-size: 0.75rem !important;
  font-weight: 600 !important;
  color: #f87171 !important;
  background: rgba(239, 68, 68, 0.12) !important;
  border: 1px solid rgba(239, 68, 68, 0.35) !important;
  text-decoration: none !important;
  cursor: pointer !important;
  margin-right: 8px !important;
  transition: all 0.15s ease !important;
}

.topbar-admin-badge-btn:hover {
  background: rgba(239, 68, 68, 0.24) !important;
  color: #fca5a5 !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
}

/* Profile Dropdown Admin Item */
.profile-dropdown-item.admin-item {
  color: #38bdf8 !important;
  font-weight: 600 !important;
}

.profile-dropdown-item.admin-item:hover {
  background: rgba(56, 189, 248, 0.1) !important;
  color: #7dd3fc !important;
}


