/**
 * ============================================================================
 * GIRI ORBIT - MOBILE RESPONSIVE & PRODUCTION CSS (mobile.css)
 * By Abhinav Giri - Version 1.0.0 Production
 * ============================================================================
 */

/* Touch targets for mobile */
button, [role=button], a, select, input { -webkit-tap-highlight-color: transparent; }

/* ============================================================
   LARGE TABLET / SMALL LAPTOP (max-width: 1024px)
   ============================================================ */
@media (max-width: 1024px) {
  .tier2-nav-menu { display: none; }
  .tier2-inner { padding: 0 12px; }
  .orbit-hub-grid, .hub-app-cards-grid { grid-template-columns: repeat(3, 1fr) !important; }
  .kinetic-slide-nav { width: 80px !important; }
  .thumb-desc-text { display: none !important; }
  .fluent-ribbon-bar { font-size: 11px; }
  .fluent-ribbon-group { padding: 0 6px; }
}

/* ============================================================
   TABLET & MOBILE BREAKPOINT (max-width: 768px)
   ============================================================ */
@media (max-width: 768px) {
  /* Header Bar */
  .tier2-suite-header {
    height: 48px;
    position: sticky;
    top: 0;
    z-index: 1000;
  }
  .tier2-inner {
    padding: 0 8px;
    gap: 6px;
    justify-content: space-between;
  }
  .tier2-left {
    gap: 6px;
    min-width: 0;
  }
  .suite-brand-sub { display: none !important; }
  .suite-brand-main { font-size: 14px !important; }
  .orbit-brand-mark, .orbit-group-symbol-img { width: 24px; height: 24px; }
  .tier2-nav-menu, .tier2-divider { display: none !important; }

  /* Product Switcher Pill Strip */
  .suite-switcher-pill-bar {
    gap: 4px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    max-width: calc(100vw - 110px);
    flex-wrap: nowrap !important;
  }
  .suite-switcher-pill-bar::-webkit-scrollbar { display: none; }
  .suite-nav-pill {
    padding: 4px 8px;
    font-size: 11px;
    white-space: nowrap;
    flex-shrink: 0;
  }
  .suite-nav-pill .pill-full-label { display: none !important; }
  .suite-nav-pill .pill-short-label { display: inline !important; }
  .tier1-sync-pill { padding: 4px 8px; font-size: 11px; }
  .tier1-sync-pill span:last-child { display: none; }
  .tier1-instagram-pill, .tier1-author-pill { display: none !important; }

  /* Hubs & Landing grids */
  .orbit-hub-grid, .hub-app-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 12px !important;
  }
  .hub-hero-section { padding: 20px 14px !important; }
  .hub-hero-headline { font-size: 20px !important; }
  .hub-hero-sub { font-size: 12.5px !important; }
  #recent-docs-cards-grid {
    grid-template-columns: 1fr !important;
    gap: 10px !important;
    padding: 0 12px 12px !important;
  }
  .tool-hub-top-bar, .drift-hub-top-bar, .axis-hub-top-bar,
  .kinetic-hub-top-bar, .pdf-hub-top-bar {
    padding: 0 10px !important;
    height: 44px !important;
  }
  .hub-templates-filter-bar {
    padding: 0 10px !important;
    gap: 6px !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    flex-wrap: nowrap !important;
  }
  .hub-templates-filter-bar::-webkit-scrollbar { display: none; }
  .hub-templates-grid, .pgo-templates-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
    padding: 10px 12px !important;
  }

  /* Universal Ribbon: touch scrollable */
  .fluent-ribbon-bar {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    display: flex;
    flex-direction: column;
    width: 100% !important;
  }
  .fluent-ribbon-bar::-webkit-scrollbar { display: none; }
  .fluent-ribbon-tabs {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    flex-wrap: nowrap !important;
    gap: 2px !important;
    padding: 0 4px !important;
    width: 100% !important;
  }
  .fluent-ribbon-tabs::-webkit-scrollbar { display: none; }
  .fluent-tab-btn {
    padding: 5px 8px !important;
    font-size: 11px !important;
    flex-shrink: 0 !important;
    white-space: nowrap !important;
  }
  .fluent-ribbon-panes {
    min-height: 52px !important;
    height: auto !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .fluent-ribbon-pane {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    flex-wrap: nowrap !important;
    gap: 4px !important;
    padding: 3px 6px !important;
  }
  .fluent-ribbon-pane::-webkit-scrollbar { display: none; }
  .fluent-ribbon-group {
    flex-shrink: 0 !important;
    padding: 0 4px !important;
  }
  .fluent-btn-large {
    padding: 3px 6px !important;
    font-size: 10.5px !important;
    min-height: 38px !important;
  }
  .fluent-btn-small {
    padding: 2px 6px !important;
    font-size: 10.5px !important;
    min-height: 26px !important;
  }

  /* ------------------------------------------------------------
     1. DRIFT (WORD PROCESSOR) ON MOBILE
     ------------------------------------------------------------ */
  .drift-app-shell {
    flex-direction: column !important;
    height: calc(100vh - 48px) !important;
    overflow: hidden !important;
  }
  .drift-split-body {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    position: relative !important;
  }

  /* Left Sidebar: Off-canvas drawer on mobile */
  .drift-left-sidebar {
    position: fixed !important;
    top: 48px !important;
    left: 0 !important;
    bottom: 0 !important;
    width: 280px !important;
    min-width: 0 !important;
    max-width: 82vw !important;
    z-index: 9999 !important;
    transform: translateX(-105%) !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1) !important;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.45) !important;
    background: #18181b !important;
    border-right: 1px solid #334155 !important;
    padding: 12px !important;
  }
  .drift-left-sidebar.mobile-open {
    transform: translateX(0) !important;
  }

  /* Ruler: Hidden on mobile */
  #drift-top-ruler {
    display: none !important;
  }

  /* Paper Viewport & Sheet */
  .drift-center-viewport {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 8px 8px 70px 8px !important;
    background: #e2e8f0 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }

  .paper-sheet-container, .drift-paper-surface {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    min-height: calc(100vh - 180px) !important;
    padding: 20px 14px 60px 14px !important;
    margin: 0 !important;
    border-radius: 8px !important;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.08) !important;
    font-size: 13.5px !important;
    line-height: 1.55 !important;
    box-sizing: border-box !important;
    word-break: break-word !important;
  }

  .drift-page-break {
    margin: 20px -14px !important;
    font-size: 9px !important;
  }

  /* ------------------------------------------------------------
     2. AXIS (SPREADSHEET) ON MOBILE
     ------------------------------------------------------------ */
  .axis-app-shell {
    flex-direction: column !important;
    height: calc(100vh - 48px) !important;
    overflow: hidden !important;
  }
  .axis-split-body {
    flex: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
  }
  .axis-left-sidebar { display: none !important; }
  .axis-dimension-bar {
    padding: 3px 8px !important;
    font-size: 10px !important;
    gap: 6px !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
  }
  .axis-formula-bar {
    padding: 3px 6px !important;
    gap: 4px !important;
  }
  .active-cell-pill, #axis-active-cell {
    width: 46px !important;
    min-width: 46px !important;
    font-size: 11px !important;
    padding: 3px 4px !important;
  }
  .axis-formula-input, #axis-formula-input {
    font-size: 12.5px !important;
    padding: 4px 6px !important;
  }
  .axis-grid-viewport {
    width: 100% !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
    overscroll-behavior: contain !important;
  }
  .axis-col-header {
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
    background: #f8fafc !important;
    min-width: 68px !important;
    height: 28px !important;
    font-size: 11px !important;
  }
  .axis-row-header {
    position: sticky !important;
    left: 0 !important;
    z-index: 10 !important;
    background: #f8fafc !important;
    min-width: 32px !important;
    font-size: 10px !important;
  }
  .axis-grid-table th:first-child {
    position: sticky !important;
    top: 0 !important;
    left: 0 !important;
    z-index: 25 !important;
    background: #f1f5f9 !important;
  }
  .axis-cell {
    min-height: 28px !important;
    height: 28px !important;
    min-width: 68px !important;
    font-size: 12px !important;
    padding: 0 5px !important;
  }
  .axis-sheet-tabs-bar {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 3px 6px !important;
    height: 36px !important;
  }
  .axis-status-bar {
    display: none !important;
  }

  /* ------------------------------------------------------------
     3. KINETIC (PRESENTATIONS) ON MOBILE
     ------------------------------------------------------------ */
  .kinetic-app-shell {
    flex-direction: column !important;
    height: calc(100vh - 48px) !important;
    overflow: hidden !important;
  }
  .kinetic-split-body {
    flex-direction: column !important;
    height: 100% !important;
    overflow: hidden !important;
  }
  .kinetic-slide-nav {
    width: 100% !important;
    height: 72px !important;
    min-height: 72px !important;
    flex-direction: row !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    padding: 6px 8px !important;
    border-right: none !important;
    border-bottom: 1px solid #334155 !important;
    gap: 8px !important;
    -webkit-overflow-scrolling: touch !important;
    background: #0f172a !important;
    order: 2;
  }
  .slide-thumb-card {
    width: 86px !important;
    min-width: 86px !important;
    height: 58px !important;
    flex-shrink: 0 !important;
  }
  .thumb-mini-canvas {
    width: 100% !important;
    height: 100% !important;
  }
  .kinetic-stage-viewport {
    order: 1;
    flex: 1 !important;
    padding: 8px !important;
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    background: #090d16 !important;
    touch-action: pan-y pinch-zoom;
  }
  .kinetic-slide-frame {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    aspect-ratio: 16 / 9 !important;
    height: auto !important;
    max-height: 50vh !important;
    padding: 12px 14px !important;
    border-radius: 8px !important;
    font-size: 10.5px !important;
    box-sizing: border-box !important;
  }
  .kinetic-slide-frame h1, .kinetic-slide-frame .slide-canvas-title {
    font-size: 15px !important;
    margin: 4px 0 !important;
  }
  .kinetic-slide-frame p, .kinetic-slide-frame .slide-canvas-desc {
    font-size: 10px !important;
    line-height: 1.35 !important;
  }
  .kinetic-slide-frame .slide-features-grid,
  .kinetic-slide-frame .diagram-grid {
    gap: 4px !important;
    margin-top: 4px !important;
  }
  .kinetic-speaker-notes-drawer {
    display: none !important;
  }
  .kinetic-mobile-slide-nav-pill {
    display: flex !important;
  }

  /* ------------------------------------------------------------
     4. PDF STUDIO (AEGIS) ON MOBILE
     ------------------------------------------------------------ */
  .pdf-studio-shell {
    flex-direction: column !important;
    height: calc(100vh - 48px) !important;
  }
  .pdf-sidebar {
    width: 100% !important;
    height: 70px !important;
    min-height: 70px !important;
    overflow-x: auto !important;
    flex-direction: row !important;
    border-right: none !important;
    border-bottom: 1px solid #cbd5e1 !important;
    padding: 4px 8px !important;
    order: 2;
  }
  .pdf-page-thumb {
    width: 48px !important;
    height: 60px !important;
    flex-shrink: 0 !important;
  }
  .pdf-content-wrapper {
    order: 1;
    flex: 1 !important;
    padding: 6px !important;
    overflow: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .pdf-page-container {
    width: 100% !important;
    max-width: 100% !important;
  }

  /* ------------------------------------------------------------
     UNIVERSAL MODALS (BOTTOM SHEET PATTERN ON MOBILE)
     ------------------------------------------------------------ */
  .office-modal-backdrop, .sync-modal-backdrop, .export-modal-backdrop,
  .thesaurus-modal-backdrop, .cmd-palette-backdrop {
    align-items: flex-end !important;
    padding: 0 !important;
  }
  .office-dialog-card, .sync-modal-card, .export-modal-card,
  .thesaurus-modal-card, .cmd-palette-card {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 18px 18px 0 0 !important;
    max-height: 88vh !important;
    overflow-y: auto !important;
    margin: 0 !important;
    box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.35) !important;
  }

  /* ------------------------------------------------------------
     MOBILE VIEWPORT CLEARANCE & FLOATING ACTION TOOLBARS
     ------------------------------------------------------------ */
  .drift-center-viewport { padding-bottom: 74px !important; }
  .axis-grid-viewport { padding-bottom: 74px !important; }
  .kinetic-stage-viewport { padding-bottom: 74px !important; }
  .pdf-content-wrapper, .pdf-canvas-viewport { padding-bottom: 74px !important; }

  .drift-mobile-toolbar,
  .axis-mobile-toolbar,
  .kinetic-mobile-toolbar,
  .pdf-mobile-toolbar {
    display: flex !important;
    position: fixed !important;
    bottom: 12px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    background: rgba(15, 23, 42, 0.94) !important;
    backdrop-filter: blur(14px) !important;
    -webkit-backdrop-filter: blur(14px) !important;
    border: 1px solid rgba(255, 255, 255, 0.16) !important;
    border-radius: 28px !important;
    padding: 4px 8px !important;
    gap: 6px !important;
    align-items: center !important;
    z-index: 9999 !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255, 255, 255, 0.05) !important;
    max-width: 95vw !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .drift-mobile-toolbar::-webkit-scrollbar,
  .axis-mobile-toolbar::-webkit-scrollbar,
  .kinetic-mobile-toolbar::-webkit-scrollbar,
  .pdf-mobile-toolbar::-webkit-scrollbar {
    display: none !important;
  }
  .mobile-tool-btn {
    background: transparent !important;
    border: none !important;
    color: #f1f5f9 !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    min-width: 32px !important;
    height: 32px !important;
    border-radius: 16px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    flex-shrink: 0 !important;
    padding: 0 6px !important;
    transition: background 0.15s ease, transform 0.1s ease !important;
  }
  .mobile-tool-btn:active {
    background: rgba(255, 255, 255, 0.18) !important;
    transform: scale(0.95) !important;
  }
  .mobile-tool-sep {
    width: 1px !important;
    height: 18px !important;
    background: rgba(255, 255, 255, 0.18) !important;
    flex-shrink: 0 !important;
  }
}

/* ============================================================
   LANDSCAPE PHONES
   ============================================================ */
@media (max-width: 768px) and (orientation: landscape) {
  .kinetic-slide-nav { height: 70px !important; }
  .hub-hero-section { padding: 12px 16px !important; }
  .kinetic-stage-viewport { max-height: calc(100vh - 52px - 70px - 40px) !important; }
}

/* ============================================================
   PRODUCTION: GLOBAL PERFORMANCE ENHANCEMENTS
   ============================================================ */
html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  .suite-nav-pill.active {
    forced-color-adjust: none;
    background: ButtonText;
    color: ButtonFace;
  }
}

@media print {
  .tier2-suite-header, .fluent-ribbon-bar, .kinetic-slide-nav,
  .axis-sheet-tabs-bar, .orbit-toast-wrap, #btn-global-sync,
  .suite-switcher-pill-bar, .mobile-toolbar-fab { display: none !important; }
  body { overflow: visible; }
  .orbit-workspace { height: auto; overflow: visible; }
  .drift-paper-surface { box-shadow: none; border: none; padding: 0; }
}

/* Safe-area insets (iPhone notch) */
@supports (padding-top: env(safe-area-inset-top)) {
  .tier2-suite-header {
    padding-top: env(safe-area-inset-top);
    height: calc(48px + env(safe-area-inset-top));
  }
  .orbit-toast-wrap { bottom: calc(12px + env(safe-area-inset-bottom)); }
}

/* ============================================================
   SLIDE THUMBNAIL STYLES (kinetic left panel)
   ============================================================ */
.slide-thumb-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  cursor: pointer;
  border-radius: 6px;
  overflow: hidden;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  user-select: none;
}
.slide-thumb-card:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(0,0,0,0.15); }
.slide-thumb-card.active { box-shadow: 0 0 0 2px #2563eb; }
.slide-thumb-card.dragging { opacity: 0.5; }
.slide-thumb-card.drag-over { box-shadow: 0 0 0 2px #22c55e; }

.thumb-number-badge {
  position: absolute; top: 3px; left: 3px; z-index: 2;
  background: rgba(0,0,0,0.45); color: #fff;
  font-size: 9px; font-weight: 700; line-height: 1;
  padding: 2px 4px; border-radius: 3px; pointer-events: none;
}
.thumb-mini-canvas {
  width: 120px; height: 80px; background: #fff;
  border-radius: 4px; overflow: hidden; position: relative;
  border: 1px solid #e2e8f0;
}
.thumb-top-stripe { height: 3px; width: 100%; position: absolute; top: 0; left: 0; }
.thumb-tag-label {
  position: absolute; top: 6px; left: 5px;
  font-size: 6px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 1px 3px; border-radius: 2px;
  border: 1px solid transparent; line-height: 1.2;
  white-space: nowrap; overflow: hidden; max-width: 80%;
}
.thumb-title-text {
  position: absolute; top: 16px; left: 5px; right: 5px;
  font-size: 8px; font-weight: 700; line-height: 1.3;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.thumb-desc-text {
  position: absolute; top: 32px; left: 5px; right: 5px;
  font-size: 6.5px; opacity: 0.7; line-height: 1.3;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.thumb-layout-zone {
  position: absolute; bottom: 8px; left: 5px; right: 5px;
  display: flex; align-items: center; justify-content: space-between;
}
.thumb-layout-icon { opacity: 0.6; flex-shrink: 0; }
.thumb-node-row { display: flex; gap: 2px; align-items: center; flex-wrap: wrap; max-width: 50px; }
.thumb-node-pip { width: 6px; height: 6px; border-radius: 50%; opacity: 0.7; }
.thumb-bottom-bar { position: absolute; bottom: 0; left: 0; right: 0; height: 3px; }
.thumb-context-menu-btn {
  display: none; position: absolute; top: 2px; right: 2px;
  width: 16px; height: 16px; background: rgba(0,0,0,0.3); color: #fff;
  font-size: 10px; border-radius: 3px; align-items: center; justify-content: center;
  cursor: pointer; z-index: 3;
}
.slide-thumb-card:hover .thumb-context-menu-btn { display: flex; }

/* Mobile FAB */
.mobile-menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  padding: 8px; border-radius: 6px; color: #94a3b8;
  flex-direction: column; gap: 4px; align-items: center; justify-content: center;
}
.mobile-menu-toggle span { display: block; width: 18px; height: 2px; background: currentColor; border-radius: 2px; }

.mobile-toolbar-fab {
  display: none;
  position: fixed;
  bottom: 16px; right: 16px; z-index: 900;
  background: #2563eb; color: white; border: none;
  border-radius: 50%; width: 52px; height: 52px; font-size: 22px;
  cursor: pointer; box-shadow: 0 4px 16px rgba(37,99,235,0.5);
  align-items: center; justify-content: center; transition: transform 0.15s;
}
.mobile-toolbar-fab:active { transform: scale(0.94); }

/* Hide floating mobile toolbars on desktop by default */
.drift-mobile-toolbar,
.axis-mobile-toolbar,
.kinetic-mobile-toolbar,
.pdf-mobile-toolbar {
  display: none;
}


/* ============================================================================
   MOBILE & TOUCHSCREEN ADVANCED ADAPTATIONS (Giri Orbit Sovereign Suite)
   ============================================================================ */

@media (max-width: 768px) {
  html, body {
    height: 100%;
    min-height: 100dvh;
    overscroll-behavior-y: none;
  }

  #orbit-workspace {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px));
  }

  /* Touch Target Minimum Dimensions */
  button, 
  .suite-nav-pill, 
  .fluent-tab-btn, 
  .lo-tool-btn, 
  .lo-menu-btn,
  .fluent-top-action-pill,
  .gdk-key {
    min-height: 38px;
    touch-action: manipulation;
  }

  /* Universal Multi-Cloud Dialog on Mobile */
  .universal-cloud-card {
    width: 96% !important;
    max-width: 96% !important;
    margin: 10px auto !important;
    max-height: 90vh !important;
  }

  .universal-cloud-card .lo-dialog-body {
    padding: 12px 14px !important;
  }

  /* Candidate Popup on Mobile */
  .giri-hindi-candidate-box {
    max-width: 92vw !important;
    left: 4vw !important;
    font-size: 14px !important;
  }

  /* Virtual Devanagari Keyboard on Mobile */
  .giri-devanagari-keyboard {
    max-height: 52vh !important;
    padding: 6px 4px calc(10px + env(safe-area-inset-bottom, 0px)) 4px !important;
  }

  .gdk-key {
    min-width: 28px !important;
    height: 38px !important;
    font-size: 14px !important;
    padding: 2px 4px !important;
  }

  .gdk-key.action.space {
    min-width: 140px !important;
  }

  .gdk-key.action.backspace,
  .gdk-key.action.enter {
    min-width: 60px !important;
    font-size: 11px !important;
  }

  /* Mobile Bottom Dock */
  .orbit-mobile-bottom-dock {
    display: flex !important;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(52px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: #0f172a;
    border-top: 1px solid #334155;
    z-index: 9998;
    align-items: center;
    justify-content: space-around;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.3);
  }

  .mobile-dock-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 600;
    padding: 4px 8px;
    gap: 2px;
    cursor: pointer;
    flex: 1;
    height: 100%;
    transition: color 0.12s ease;
  }

  .mobile-dock-btn.active,
  .mobile-dock-btn:active {
    color: #38bdf8;
  }

  .mobile-dock-btn span:first-child {
    font-size: 17px;
  }

  /* Scrollable Ribbon Tabs on Mobile */
  .fluent-ribbon-tabs {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .fluent-ribbon-tabs::-webkit-scrollbar {
    display: none;
  }

  .fluent-ribbon-panes {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
  }

  .fluent-ribbon-pane {
    flex-wrap: nowrap !important;
  }
}

@media (min-width: 769px) {
  .orbit-mobile-bottom-dock {
    display: none !important;
  }
}


/* ============================================================================
 * GIRI ORBIT — ANDROID & MOBILE PHONE ULTRA-SMOOTH OPTIMIZATIONS
 * Supports Android (Pixel, Samsung, OnePlus, Xiaomi) & iOS devices
 * Touch-action manipulation, 0ms tap delay, native bottom navigation rail,
 * responsive swipeable carousels, and safe-area insets
 * ============================================================================ */

@media (max-width: 768px) {
  /* Prevent horizontal overflow and enable smooth inertia scrolling */
  html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    overscroll-behavior-y: contain !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  /* Hardware accelerated smooth touch interactions */
  button, [role="button"], a, input, select, .m365-create-card, .m365-pill, .m365-rail-btn {
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
  }

  /* Full-viewport mobile root */
  .m365-hub-root {
    flex-direction: column !important;
    height: 100% !important;
    min-height: 100dvh !important;
    overflow-x: hidden !important;
    position: relative !important;
  }

  /* --------------------------------------------------------------------------
     1. LEFT RAIL TRANSFORMS INTO NATIVE MOBILE BOTTOM NAVIGATION BAR
     -------------------------------------------------------------------------- */
  .m365-left-rail {
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    top: auto !important;
    width: 100% !important;
    min-width: 100% !important;
    height: calc(56px + env(safe-area-inset-bottom, 0px)) !important;
    padding: 0 4px !important;
    padding-bottom: env(safe-area-inset-bottom, 0px) !important;
    flex-direction: row !important;
    justify-content: space-around !important;
    align-items: center !important;
    border-right: none !important;
    border-top: 1px solid rgba(148, 163, 184, 0.18) !important;
    background: rgba(13, 19, 33, 0.96) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    z-index: 9999 !important;
    box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.5) !important;
    box-sizing: border-box !important;
  }

  .m365-left-rail .m365-rail-top {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-around !important;
    width: 100% !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Hide excessive desktop icons in mobile bottom bar */
  .m365-left-rail .m365-rail-tools,
  .m365-left-rail .m365-rail-divider,
  #rail-btn-girionix,
  #rail-btn-content,
  #rail-btn-converter,
  #rail-btn-storage,
  #rail-btn-settings,
  #rail-btn-download {
    display: none !important;
  }

  .m365-left-rail .m365-rail-bottom {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Mobile bottom bar touch items (48px height) */
  .m365-left-rail .m365-rail-btn {
    width: auto !important;
    min-width: 52px !important;
    height: 48px !important;
    margin: 0 !important;
    padding: 4px 8px !important;
    border-radius: 8px !important;
    flex-direction: column !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 2px !important;
  }

  .m365-left-rail .m365-rail-icon-wrap {
    width: 22px !important;
    height: 22px !important;
  }

  .m365-left-rail .m365-rail-icon-wrap svg {
    width: 18px !important;
    height: 18px !important;
  }

  .m365-left-rail .m365-rail-label {
    display: block !important;
    font-size: 10px !important;
    font-weight: 600 !important;
    color: #94a3b8 !important;
    line-height: 1 !important;
    margin-top: 1px !important;
  }

  .m365-left-rail .m365-rail-btn.active .m365-rail-label {
    color: #38bdf8 !important;
  }

  .m365-left-rail .m365-rail-btn.active::before {
    display: none !important;
  }

  .m365-left-rail .m365-rail-btn.active {
    background: rgba(56, 189, 248, 0.12) !important;
  }

  /* --------------------------------------------------------------------------
     2. MAIN WORKSPACE CANVAS ON MOBILE
     -------------------------------------------------------------------------- */
  .m365-canvas {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px 14px 76px 14px !important; /* 76px bottom clearance so bottom bar never obstructs */
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
  }

  .m365-inner-wrapper {
    width: 100% !important;
    max-width: 100% !important;
    gap: 16px !important;
  }

  /* --------------------------------------------------------------------------
     3. TOP HEADER BAR ON MOBILE
     -------------------------------------------------------------------------- */
  .m365-top-header {
    flex-direction: row !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px !important;
    margin-bottom: 0 !important;
    padding: 0 2px !important;
  }

  .m365-suite-indicator {
    padding: 3px 8px !important;
    font-size: 11px !important;
  }

  .m365-top-header-right {
    gap: 6px !important;
  }

  .m365-cloud-status-pill {
    padding: 4px 8px !important;
    font-size: 11px !important;
  }

  .m365-account-pill {
    padding: 3px 8px 3px 4px !important;
  }

  .m365-account-badge {
    display: none !important;
  }

  .m365-account-name {
    font-size: 11.5px !important;
    max-width: 80px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* --------------------------------------------------------------------------
     4. HERO SECTION ON MOBILE
     -------------------------------------------------------------------------- */
  .m365-hero {
    gap: 10px !important;
    padding: 4px 0 8px 0 !important;
  }

  .m365-hero-title {
    font-size: 22px !important;
    line-height: 1.2 !important;
    text-align: center !important;
  }

  .m365-hero-subtitle-bar {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 6px !important;
    font-size: 11px !important;
    text-align: center !important;
  }

  .m365-hero-subtitle-bar .m365-badge {
    padding: 3px 8px !important;
  }

  .m365-hero-download-btn {
    padding: 5px 12px !important;
    font-size: 11.5px !important;
  }

  .giri-social-handles-bar {
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 6px !important;
    padding: 6px 8px !important;
    font-size: 11px !important;
  }

  .giri-social-pill {
    padding: 3px 8px !important;
    font-size: 10.5px !important;
    min-height: 30px !important;
  }

  /* --------------------------------------------------------------------------
     5. UNIVERSAL SEARCH BAR ON MOBILE
     -------------------------------------------------------------------------- */
  .m365-search-bar {
    width: 100% !important;
    max-width: 100% !important;
    height: 44px !important;
  }

  .search-kbd-hint {
    display: none !important;
  }

  #m365-search-box {
    font-size: 13px !important;
    padding: 0 34px 0 36px !important;
  }

  #m365-search-dropdown {
    width: 100% !important;
    max-height: 60vh !important;
    left: 0 !important;
    right: 0 !important;
  }

  /* --------------------------------------------------------------------------
     6. CREATE NEW SECTION: HORIZONTAL SWIPEABLE CAROUSEL ON MOBILE
     -------------------------------------------------------------------------- */
  .m365-cards-row {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x mandatory !important;
    gap: 10px !important;
    padding-bottom: 8px !important;
    scrollbar-width: none !important;
    width: 100% !important;
    box-sizing: border-box !important;
  }

  .m365-cards-row::-webkit-scrollbar {
    display: none !important;
  }

  .m365-create-card {
    flex: 0 0 120px !important;
    min-width: 120px !important;
    scroll-snap-align: start !important;
    padding: 10px 8px !important;
  }

  .m365-card-preview {
    height: 76px !important;
  }

  .m365-card-title {
    font-size: 12px !important;
  }

  .m365-card-sub {
    font-size: 10px !important;
  }

  /* --------------------------------------------------------------------------
     7. QUICK ACCESS & RECENT DOCUMENTS ON MOBILE
     -------------------------------------------------------------------------- */
  .m365-quick-access-header {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 10px !important;
  }

  .m365-pills-row {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 6px !important;
    scrollbar-width: none !important;
    width: 100% !important;
  }

  .m365-pills-row::-webkit-scrollbar {
    display: none !important;
  }

  .m365-pill {
    padding: 6px 12px !important;
    font-size: 11.5px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .m365-actions-group {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
    width: 100% !important;
  }

  .m365-upload-btn, .m365-pill-outline {
    flex: 1 !important;
    justify-content: center !important;
    font-size: 11.5px !important;
    padding: 6px 10px !important;
    min-height: 38px !important;
    white-space: nowrap !important;
  }

  /* Responsive Table Container */
  .m365-table-wrap {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
    border-radius: 10px !important;
  }

  .m365-table {
    min-width: 440px !important;
  }

  .m365-table th, .m365-table td {
    padding: 10px 8px !important;
    font-size: 12px !important;
  }

  /* --------------------------------------------------------------------------
     8. MODALS & DIALOGS ON MOBILE
     -------------------------------------------------------------------------- */
  .giri-modal-dialog {
    width: 95% !important;
    max-width: 100% !important;
    max-height: 88vh !important;
    margin: auto !important;
    border-radius: 16px !important;
  }

  .giri-modal-body {
    padding: 14px 14px !important;
  }

  .giri-modal-header {
    padding: 12px 14px !important;
  }

  /* --------------------------------------------------------------------------
     9. TOOL HUBS & APP WORKSPACES ON MOBILE
     -------------------------------------------------------------------------- */
  .drift-hub-top-bar, .axis-hub-top-bar, .kinetic-hub-top-bar, .pdf-hub-top-bar {
    padding: 0 10px !important;
    height: 48px !important;
  }

  .tool-hub-suite-links {
    display: none !important;
  }

  .drift-hub-nav-links {
    gap: 10px !important;
    font-size: 11.5px !important;
  }

  .drift-hub-hero, .axis-hub-hero, .kinetic-hub-hero {
    padding: 16px 12px !important;
  }

  .drift-templates-carousel, .axis-templates-carousel, .kinetic-templates-carousel {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    gap: 10px !important;
    scrollbar-width: none !important;
  }
}

/* Extra small Android phone screens (<= 480px) */
@media (max-width: 480px) {
  .m365-table th:nth-child(3), .m365-table td:nth-child(3),
  .m365-table th:nth-child(4), .m365-table td:nth-child(4) {
    display: none !important;
  }
  .m365-table {
    min-width: 100% !important;
  }
  .m365-hero-title {
    font-size: 20px !important;
  }
  .m365-cards-row .m365-create-card {
    flex: 0 0 110px !important;
    min-width: 110px !important;
  }
}


/* ============================================================================
 * COMPREHENSIVE SUITE-WIDE MOBILE & ANDROID RESPONSIVE ENHANCEMENTS
 * (Forms, Quiz, Lists, Designer, Kinetic Titles/Subtitles & Corner Account)
 * ============================================================================ */
@media (max-width: 768px) {
  /* 1. Corner Account Hub on Mobile */
  .m365-corner-account-hub {
    display: none !important;
  }
  .m365-corner-pill {
    padding: 4px 10px !important;
    font-size: 11px !important;
  }
  .m365-corner-drive-btn {
    display: none !important; /* Conceal secondary drive button to prevent overflow */
  }
  .m365-corner-account-btn .m365-account-badge {
    display: none !important;
  }
  .m365-corner-account-btn .m365-account-name {
    max-width: 90px !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 11px !important;
  }
  #hub-corner-safe-btn span:last-child,
  #hub-corner-author-btn span:last-child,
  #hub-corner-p2p-btn span:last-child {
    display: none !important;
  }

  /* 2. Kinetic Slide Title & Subtitle Mobile Scaling */
  .slide-header-zone {
    margin-bottom: 4px !important;
  }
  .slide-tag-pill {
    font-size: 8px !important;
    padding: 2px 8px !important;
    margin-bottom: 3px !important;
  }
  .slide-h1-editable {
    font-size: 16px !important;
    line-height: 1.2 !important;
    margin: 0 0 4px 0 !important;
    font-weight: 700 !important;
    word-break: break-word !important;
  }
  .slide-p-editable {
    font-size: 11px !important;
    line-height: 1.35 !important;
    margin: 0 !important;
    max-width: 100% !important;
    word-break: break-word !important;
  }
  .slide-cards-grid {
    gap: 6px !important;
    margin-top: 6px !important;
  }
  .pgo-diagram-wrap {
    transform: scale(0.68) !important;
    transform-origin: top center !important;
    margin-top: -10px !important;
  }
  .pgo-loop-node-card {
    padding: 6px 8px !important;
    font-size: 10px !important;
  }

  /* 3. Forms Studio Mobile Layout */
  .giri-forms-root {
    width: 100% !important;
    height: 100vh !important;
  }
  .forms-app-header {
    height: auto !important;
    min-height: 52px !important;
    padding: 8px 12px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  #forms-doc-title-input {
    width: 160px !important;
    max-width: 160px !important;
    font-size: 13px !important;
  }
  .forms-nav-tab {
    padding: 5px 10px !important;
    font-size: 11.5px !important;
  }
  .forms-editor-canvas {
    padding: 12px 10px 80px 10px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .forms-question-card {
    padding: 14px 12px !important;
    margin-bottom: 12px !important;
    border-radius: 10px !important;
  }
  .forms-question-title-input {
    font-size: 14px !important;
  }
  .forms-option-row {
    gap: 8px !important;
    min-height: 42px !important;
  }

  /* 4. Quiz Studio Mobile Layout */
  .giri-quiz-root {
    width: 100% !important;
    height: 100vh !important;
  }
  .quiz-app-header {
    height: auto !important;
    min-height: 52px !important;
    padding: 8px 12px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  #quiz-doc-title-input {
    width: 160px !important;
    max-width: 160px !important;
    font-size: 13px !important;
  }
  .quiz-editor-canvas {
    padding: 12px 10px 80px 10px !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
  }
  .quiz-question-card {
    padding: 14px 12px !important;
    margin-bottom: 12px !important;
    border-radius: 10px !important;
  }
  .quiz-choice-item {
    min-height: 44px !important;
    padding: 10px 12px !important;
    font-size: 13px !important;
  }

  /* 5. Lists Studio Mobile Layout (Kanban & Table) */
  .giri-lists-root {
    width: 100% !important;
    height: 100vh !important;
  }
  .lists-app-header {
    height: auto !important;
    min-height: 52px !important;
    padding: 8px 12px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  #lists-doc-title-input {
    width: 160px !important;
    max-width: 160px !important;
    font-size: 13px !important;
  }
  .lists-kanban-board {
    display: flex !important;
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scroll-snap-type: x mandatory !important;
    padding: 12px 10px 80px 10px !important;
    gap: 12px !important;
  }
  .lists-kanban-col {
    flex: 0 0 82vw !important;
    max-width: 320px !important;
    scroll-snap-align: start !important;
  }
  .lists-grid-container {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    width: 100% !important;
  }

  /* 6. Designer Studio Mobile Layout */
  .giri-designer-root {
    width: 100% !important;
    height: 100vh !important;
  }
  .designer-app-header {
    height: auto !important;
    min-height: 52px !important;
    padding: 8px 12px !important;
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  #designer-doc-title-input {
    width: 150px !important;
    max-width: 150px !important;
    font-size: 13px !important;
  }
  #designer-preset-select {
    font-size: 11.5px !important;
    padding: 4px 8px !important;
    max-width: 130px !important;
  }
  .designer-split-body {
    flex-direction: column !important;
  }
  .designer-sidebar {
    width: 100% !important;
    height: 140px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    border-right: none !important;
    border-bottom: 1px solid #334155 !important;
    order: 2 !important;
  }
  .designer-canvas-viewport {
    flex: 1 !important;
    width: 100% !important;
    overflow: hidden !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    padding: 10px !important;
    order: 1 !important;
  }
  #designer-artboard {
    max-width: 95vw !important;
    max-height: 48vh !important;
    transform-origin: center center !important;
  }
}

/* Extra small phones (<= 480px) */
@media (max-width: 480px) {
  .slide-h1-editable {
    font-size: 14px !important;
  }
  .slide-p-editable {
    font-size: 10px !important;
  }
  #forms-doc-title-input,
  #quiz-doc-title-input,
  #lists-doc-title-input,
  #designer-doc-title-input {
    width: 120px !important;
    max-width: 120px !important;
    font-size: 12px !important;
  }
  .m365-corner-account-btn .m365-account-name {
    display: none !important; /* Show avatar icon only on ultra-compact 320-480px */
  }
  .m365-corner-account-btn {
    padding: 4px !important;
    border-radius: 50% !important;
  }
}
