/* Google Fonts Prompt & Base Typography */
@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500;600;700&display=swap');

:root {
  --primary-blue: #0284c7;
  --electric-blue: #2563eb;
  --cyan-glow: #38bdf8;
  --sky-tint: #f0f9ff;
  --glass-white: rgba(255, 255, 255, 0.9);
  --glass-border: rgba(186, 230, 253, 0.7);
  --neon-shadow: 0 8px 32px 0 rgba(14, 165, 233, 0.15);

  /* Apple iOS Safe Area Insets (Notch, Dynamic Island, Home Bar) */
  --sat: env(safe-area-inset-top, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sal: env(safe-area-inset-left, 0px);
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  overflow-x: hidden !important;
  width: 100%;
  max-width: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Prompt', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: #0b1329;
  color: #0f172a;
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden !important;
  position: relative;
  margin: 0;
  padding: 0;
  padding-left: var(--sal);
  padding-right: var(--sar);
  padding-bottom: max(20px, var(--sab));
  touch-action: manipulation;
}

/* Executive Sticky Header with Safe-Area Insets (Notch & Dynamic Island Support) */
header {
  padding-top: max(0px, env(safe-area-inset-top));
  padding-left: max(0px, env(safe-area-inset-left));
  padding-right: max(0px, env(safe-area-inset-right));
}

/* Luxury Hotel Ambient Blurred Background Layer (First Version) */
.app-hotel-backdrop {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  pointer-events: none;
  z-index: -20;
}

.app-hotel-backdrop-image {
  position: absolute;
  inset: -30px;
  background-image: url('bg-hotel.jpg');
  background-size: cover;
  background-position: center 30%;
  background-repeat: no-repeat;
  filter: blur(14px) saturate(135%) brightness(0.96);
  -webkit-filter: blur(14px) saturate(135%) brightness(0.96);
  transform: scale(1.05);
  will-change: transform;
}

.app-hotel-backdrop-overlay {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(circle at 75% 20%, rgba(254, 240, 138, 0.20) 0%, transparent 50%),
    radial-gradient(circle at 20% 80%, rgba(56, 189, 248, 0.16) 0%, transparent 45%),
    linear-gradient(180deg, 
      rgba(240, 249, 255, 0.52) 0%, 
      rgba(248, 250, 252, 0.68) 42%, 
      rgba(241, 245, 249, 0.78) 100%);
}

.app-hotel-backdrop-grid {
  position: absolute;
  inset: 0;
  background-image: 
    linear-gradient(to right, rgba(2, 132, 199, 0.03) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(2, 132, 199, 0.03) 1px, transparent 1px);
  background-size: 32px 32px;
}

/* Responsive Media Rule: Images & embedded media never overflow */
img, svg, video, canvas, audio, iframe, embed, object {
  max-width: 100%;
  height: auto;
}

/* Anti-Overflow Layer */
body::before {
  display: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: #f0f9ff;
}
::-webkit-scrollbar-thumb {
  background: #93c5fd;
  border-radius: 9999px;
  transition: background 0.2s ease;
}
::-webkit-scrollbar-thumb:hover {
  background: #3b82f6;
}

/* Glassmorphism Classes with Authentic Apple Specular Reflection */
.glass-panel {
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 
    0 1px 0 0 rgba(255, 255, 255, 0.95) inset,
    0 0 0 1px rgba(186, 230, 253, 0.65),
    0 8px 24px -4px rgba(14, 165, 233, 0.08);
}

.glass-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 
    0 1px 0 0 rgba(255, 255, 255, 0.95) inset,
    0 0 0 1px rgba(186, 230, 253, 0.7),
    0 8px 24px -4px rgba(14, 165, 233, 0.08);
  position: relative;
  overflow: hidden;
  transition: border-color 0.25s ease, box-shadow 0.25s ease;
}

/* Stationary Cards: Zero shift on hover or active to ensure stable click targets */
.glass-card:hover {
  border-color: rgba(56, 189, 248, 0.85);
  box-shadow: 
    0 1px 0 0 rgba(255, 255, 255, 1) inset,
    0 0 0 1px rgba(56, 189, 248, 0.75),
    0 12px 28px -4px rgba(14, 165, 233, 0.14);
}

.glass-card:active {
  /* Never shift or scale card containers when clicking internal buttons/inputs */
  transform: none !important;
}

/* Symmetrical KPI Card Sizing */
.kpi-card {
  min-height: 148px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* Futuristic Primary Button (Blue Gradient & Shimmer) */
.btn-futuristic-primary {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 50%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
  white-space: nowrap;
}

.btn-futuristic-primary:hover {
  background: linear-gradient(135deg, #0ea5e9 0%, #3b82f6 50%, #2563eb 100%);
  box-shadow: 0 6px 18px rgba(14, 165, 233, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.4);
  transform: translateY(-1px);
}

.btn-futuristic-primary:active {
  transform: translateY(0) scale(0.98);
}

.btn-futuristic-primary::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(
    60deg,
    transparent,
    rgba(255, 255, 255, 0.25),
    transparent
  );
  transform: rotate(30deg);
  animation: shimmer 6s infinite;
}

/* Secondary Button (Ice White with Blue Border) */
.btn-futuristic-secondary {
  background: #ffffff;
  color: #0284c7;
  border: 1px solid #bae6fd;
  box-shadow: 0 2px 6px rgba(14, 165, 233, 0.06);
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.btn-futuristic-secondary:hover {
  background: #f0f9ff;
  border-color: #38bdf8;
  color: #0369a1;
  box-shadow: 0 4px 12px rgba(14, 165, 233, 0.14);
  transform: translateY(-1px);
}

.btn-futuristic-secondary:active {
  transform: translateY(0) scale(0.98);
}

/* Keyframe Animations */
@keyframes shimmer {
  0% { transform: translateX(-150%) rotate(30deg); }
  25%, 100% { transform: translateX(150%) rotate(30deg); }
}

@keyframes pulse-ring {
  0% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0.7);
  }
  70% {
    transform: scale(1);
    box-shadow: 0 0 0 7px rgba(56, 189, 248, 0);
  }
  100% {
    transform: scale(0.95);
    box-shadow: 0 0 0 0 rgba(56, 189, 248, 0);
  }
}

@keyframes float-gentle {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-3px); }
}

@keyframes slideUpFade {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes modalZoomIn {
  from {
    opacity: 0;
    transform: scale(0.94) translateY(6px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Animation Utility Classes */
.animate-slide-up {
  animation: slideUpFade 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.animate-pulse-ring {
  animation: pulse-ring 2s infinite cubic-bezier(0.45, 0, 0.55, 1);
}

.animate-float {
  animation: float-gentle 4s ease-in-out infinite;
}

.animate-gradient-flow {
  background-size: 200% 200%;
  animation: gradientShift 8s ease infinite;
}

.animate-modal-zoom {
  animation: modalZoomIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Nav Tab Active Glow */
.nav-tab-active-glow {
  background: linear-gradient(135deg, #0284c7 0%, #2563eb 100%) !important;
  color: #ffffff !important;
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.32) !important;
  border-color: transparent !important;
}

/* Badges */
.badge-in-stock {
  background: #f0fdf4;
  color: #15803d;
  border: 1px solid #bbf7d0;
}
.badge-low-stock {
  background: #eff6ff;
  color: #1d4ed8;
  border: 1px solid #bfdbfe;
  animation: pulse-ring 2s infinite;
}
.badge-out-of-stock {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

/* Login Glass Card & Glow */
.login-glass-card {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(186, 230, 253, 0.85);
  box-shadow: 0 25px 60px -15px rgba(14, 165, 233, 0.25), 0 0 0 1px rgba(255, 255, 255, 0.8) inset;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20%, 60% { transform: translateX(-5px); }
  40%, 80% { transform: translateX(5px); }
}

.animate-shake {
  animation: shake 0.4s ease-in-out;
}

/* ==================== APPLE IPHONE LOCK SCREEN UNLOCK ANIMATIONS ==================== */

/* 1. Lock Icon Spring Unlock Pop */
.iphone-lock-unlocked {
  transform: scale(1.15) !important;
  background: rgba(16, 185, 129, 0.15) !important;
  border-color: rgba(16, 185, 129, 0.4) !important;
  color: #059669 !important;
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.4) !important;
  animation: iphoneLockBounce 0.45s cubic-bezier(0.18, 0.89, 0.32, 1.28) forwards;
}

@keyframes iphoneLockBounce {
  0% { transform: scale(1); }
  45% { transform: scale(1.3) translateY(-3px); }
  75% { transform: scale(0.95); }
  100% { transform: scale(1.15); }
}

/* 2. Lock Screen Fluid Swipe-Up (iPhone Screen Lift) */
#loginOverlay.iphone-unlocking {
  animation: iphoneLockScreenSwipeUp 0.68s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
  pointer-events: none !important;
}

#loginOverlay.iphone-unlocking .login-glass-card {
  animation: iphoneCardFlyUp 0.64s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
}

@keyframes iphoneLockScreenSwipeUp {
  0% {
    opacity: 1;
    transform: translateY(0);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
  }
  35% {
    opacity: 0.96;
    transform: translateY(-6vh);
  }
  100% {
    opacity: 0;
    transform: translateY(-118vh);
    backdrop-filter: blur(0px);
    -webkit-backdrop-filter: blur(0px);
  }
}

@keyframes iphoneCardFlyUp {
  0% {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0px);
  }
  18% {
    transform: translateY(8px) scale(0.985); /* Apple spring anticipation compression */
  }
  100% {
    opacity: 0;
    transform: translateY(-140px) scale(0.92);
    filter: blur(14px);
  }
}

/* 3. Home Screen Dashboard "Bloom & Zoom" Reveal */
body.iphone-unlock-bloom main,
body.iphone-unlock-bloom header,
body.iphone-unlock-bloom .ios-floating-dock {
  animation: iphoneHomeBloom 0.76s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  will-change: transform, filter, opacity;
}

@keyframes iphoneHomeBloom {
  0% {
    opacity: 0.70;
    transform: scale(0.93);
    filter: blur(10px);
  }
  40% {
    filter: blur(3px);
    opacity: 0.94;
  }
  100% {
    opacity: 1;
    transform: scale(1);
    filter: blur(0px);
  }
}

/* 4. iPhone Specular OLED Unlock Flash */
.iphone-unlock-specular-flash {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 55;
  background: radial-gradient(circle at 50% 35%, rgba(255, 255, 255, 0.65) 0%, rgba(186, 230, 253, 0.3) 45%, transparent 75%);
  animation: iphoneUnlockFlash 0.70s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes iphoneUnlockFlash {
  0% {
    opacity: 0;
    transform: scale(0.6);
  }
  30% {
    opacity: 1;
    transform: scale(1.15);
  }
  100% {
    opacity: 0;
    transform: scale(1.9);
  }
}

/* Futuristic Table & Anti-Overflow Scroll (Stationary & Stable Hitboxes) */
.futuristic-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  transform: none !important;
}

/* Ensure table container cards are 100% stationary and never move under the mouse */
.glass-card:has(table),
.glass-card:has(.overflow-x-auto),
.table-card,
.futuristic-table-wrapper {
  transform: none !important;
  transition: border-color 0.2s ease, box-shadow 0.2s ease !important;
}

.glass-card:has(table):hover,
.glass-card:has(table):active,
.glass-card:has(.overflow-x-auto):hover,
.glass-card:has(.overflow-x-auto):active,
.table-card:hover,
.table-card:active {
  transform: none !important;
}

.glass-card:has(table)::before,
.glass-card:has(.overflow-x-auto)::before,
.table-card::before {
  display: none !important;
}

.futuristic-table tbody tr {
  transition: background-color 0.15s ease !important;
  transform: none !important;
}

.futuristic-table tbody tr:hover {
  background: rgba(240, 249, 255, 0.85) !important;
  box-shadow: inset 4px 0 0 #0284c7;
  transform: none !important;
}

/* Table Action Buttons (+ รับ, - เบิก, etc.) - Completely stationary on click */
.futuristic-table button,
.futuristic-table button:hover,
.futuristic-table button:active,
.table-action-btn,
.table-action-btn:hover,
.table-action-btn:active {
  transform: none !important;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease !important;
}

/* Toast entrance animation */
@keyframes slideInRight {
  from {
    transform: translateX(110%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

.toast-enter {
  animation: slideInRight 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* ==================== EXECUTIVE DUAL-WORKSPACE UI SYSTEM ==================== */

/* ==================== APPLE DYNAMIC ISLAND (TRUE SPRING FLUID MORPH) ==================== */
.dynamic-island-anchor {
  position: relative;
  width: 280px;
  max-width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dynamic-island {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  max-width: 100%;
  height: 38px;
  background: 
    linear-gradient(180deg, rgba(255, 255, 255, 0.20) 0%, rgba(255, 255, 255, 0.04) 40%, rgba(0, 0, 0, 0.15) 60%),
    rgba(10, 15, 28, 0.96);
  backdrop-filter: blur(32px) saturate(210%);
  -webkit-backdrop-filter: blur(32px) saturate(210%);
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 
    0 1px 1px 0 rgba(255, 255, 255, 0.45) inset,
    0 0 0 1px rgba(255, 255, 255, 0.08) inset,
    0 8px 24px -2px rgba(14, 165, 233, 0.32);
  border-radius: 9999px;
  overflow: hidden;
  /* Fluid Apple spring deceleration when collapsing */
  transition: width 0.36s cubic-bezier(0.32, 0.72, 0, 1),
              height 0.36s cubic-bezier(0.32, 0.72, 0, 1),
              border-radius 0.36s cubic-bezier(0.32, 0.72, 0, 1),
              box-shadow 0.36s cubic-bezier(0.32, 0.72, 0, 1),
              background 0.36s cubic-bezier(0.32, 0.72, 0, 1),
              transform 0.22s cubic-bezier(0.32, 0.72, 0, 1);
  will-change: width, height, border-radius, box-shadow, transform;
  transform-origin: 50% 0%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  z-index: 70;
}

.dynamic-island:hover:not(.expanded) {
  background: 
    linear-gradient(180deg, rgba(255, 255, 255, 0.26) 0%, rgba(255, 255, 255, 0.06) 40%, rgba(0, 0, 0, 0.1) 60%),
    rgba(10, 15, 28, 0.98);
  box-shadow: 
    0 1px 1px 0 rgba(255, 255, 255, 0.65) inset,
    0 0 0 1px rgba(56, 189, 248, 0.5) inset,
    0 12px 32px -2px rgba(14, 165, 233, 0.45);
  transform: translateX(-50%) scale(1.025);
}

.dynamic-island:active:not(.expanded) {
  transform: translateX(-50%) scale(0.965);
}

/* Expanded State with Authentic Apple Elastic Spring Curve */
.dynamic-island.expanded {
  width: 480px;
  max-width: 94vw;
  height: 200px;
  border-radius: 26px;
  background: 
    linear-gradient(180deg, rgba(255, 255, 255, 0.16) 0%, rgba(255, 255, 255, 0.02) 30%, transparent 60%),
    rgba(10, 15, 28, 0.98);
  border: 1px solid rgba(255, 255, 255, 0.28);
  box-shadow: 
    0 1px 1.5px 0 rgba(255, 255, 255, 0.60) inset,
    0 28px 75px -12px rgba(0, 0, 0, 0.75),
    0 10px 30px -5px rgba(14, 165, 233, 0.35),
    0 0 0 1px rgba(255, 255, 255, 0.12) inset;
  /* Organic Spring Morph Overshoot on Expand */
  transition: width 0.44s cubic-bezier(0.18, 0.9, 0.2, 1.12),
              height 0.44s cubic-bezier(0.18, 0.9, 0.2, 1.12),
              border-radius 0.40s cubic-bezier(0.18, 0.9, 0.2, 1.12),
              box-shadow 0.44s cubic-bezier(0.18, 0.9, 0.2, 1.12),
              background 0.36s cubic-bezier(0.32, 0.72, 0, 1);
}

/* Collapsed Capsule Content with Soft Fade */
.island-collapsed-content {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) scale(1);
  width: 100%;
  height: 38px;
  opacity: 1;
  pointer-events: auto;
  transition: opacity 0.18s cubic-bezier(0.32, 0.72, 0, 1) 0.08s, 
              transform 0.22s cubic-bezier(0.32, 0.72, 0, 1) 0.08s;
  will-change: opacity, transform;
}

.dynamic-island.expanded .island-collapsed-content {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) scale(0.85);
  transition: opacity 0.12s ease-out, transform 0.14s ease-out;
}

/* Expanded Sheet Content with Staggered Fluid Cascade */
.island-expanded-content {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%) translateY(-6px) scale(0.96);
  width: 480px;
  max-width: 94vw;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.12s ease-out, transform 0.12s ease-out;
  will-change: opacity, transform;
}

.dynamic-island.expanded .island-expanded-content {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(-50%) translateY(0) scale(1);
  transition: opacity 0.26s cubic-bezier(0.16, 1, 0.3, 1) 0.10s, 
              transform 0.34s cubic-bezier(0.16, 1, 0.3, 1) 0.08s;
}

/* Dynamic Island Mobile Responsive Override - Hidden on mobile so it NEVER covers navigation */
@media (max-width: 767px) {
  .dynamic-island-anchor,
  .dynamic-island {
    display: none !important;
  }
}

/* Apple Floating Bottom Dock */
.ios-dock {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(32px) saturate(200%);
  -webkit-backdrop-filter: blur(32px) saturate(200%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 24px 50px -12px rgba(15, 23, 42, 0.18), 0 0 0 1px rgba(255, 255, 255, 0.6) inset;
}

.dock-app {
  transition: transform 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

.dock-app:active {
  transform: scale(0.92);
}

.dock-app.active .dock-dot {
  display: block !important;
}

/* Apple Continuous Squircles & Glass Cards */
.ios-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 
    0 1px 0 0 rgba(255, 255, 255, 0.95) inset,
    0 0 0 1px rgba(186, 230, 253, 0.65),
    0 12px 32px -4px rgba(14, 165, 233, 0.09);
  border-radius: 26px;
  transition: all 0.28s cubic-bezier(0.32, 0.72, 0, 1);
  position: relative;
  overflow: hidden;
}

.ios-card:hover {
  border-color: rgba(56, 189, 248, 0.9);
  box-shadow: 
    0 1px 0 0 rgba(255, 255, 255, 1) inset,
    0 0 0 1px rgba(56, 189, 248, 0.8),
    0 16px 36px -6px rgba(14, 165, 233, 0.14);
}

.ios-card:active {
  transform: none !important;
}

/* Apple Segmented Controls with Tactile Glass Pill */
.ios-segmented {
  background: rgba(224, 242, 254, 0.65);
  padding: 3px;
  border-radius: 18px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(186, 230, 253, 0.85);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(12px);
}

.ios-segmented-btn {
  padding: 6px 14px;
  border-radius: 14px;
  font-size: 12px;
  font-weight: 600;
  color: #334155;
  transition: all 0.22s cubic-bezier(0.32, 0.72, 0, 1);
}

.ios-segmented-btn:hover:not(.active) {
  color: #0284c7;
  background: rgba(255, 255, 255, 0.45);
}

.ios-segmented-btn.active {
  background: #ffffff;
  color: #0284c7;
  box-shadow: 
    0 1px 0 0 rgba(255, 255, 255, 1) inset,
    0 3px 10px rgba(14, 165, 233, 0.24);
  transform: scale(1.02);
}

.ios-segmented-btn:active {
  transform: scale(0.96) !important;
}

/* Dedicated Tactile Touch Feedback - Targeted only to nav tabs */
.nav-tab {
  transition: background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.nav-tab:active {
  transform: scale(0.97);
}

/* Hide horizontal scrollbar completely from navigation bars */
#mainNavTabsRow::-webkit-scrollbar,
#mainNavTabs::-webkit-scrollbar,
nav::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}
#mainNavTabsRow,
#mainNavTabs,
nav {
  -ms-overflow-style: none !important;
  scrollbar-width: none !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-x: contain !important;
}

/* ==================== EXECUTIVE DUAL-SCREEN WORKSPACE SYSTEM ==================== */

/* Full-Screen Symmetry for Duo Mode */
body.duo-mode-active {
  overflow-y: auto !important; /* Allow page scrolling if height is constrained */
  min-height: 100vh;
}

/* Expand Header and Main containers to full screen in Duo Mode */
.duo-mode-active header > div,
.duo-mode-active main {
  max-width: 98% !important;
  width: 98% !important;
  transition: max-width 0.28s cubic-bezier(0.32, 0.72, 0, 1);
}

.duo-mode-active main {
  padding-left: 8px !important;
  padding-right: 8px !important;
  padding-top: 8px !important;
  padding-bottom: 24px !important;
}

/* Hide single-screen main nav tabs in Duo Mode to avoid clutter and save vertical screen space */
.duo-mode-active #mainNavTabsRow {
  display: none !important;
}

/* ==================== IPHONE DUO 3D DUAL-SCREEN ENGINE ==================== */

/* Clean Unfolding & Idle States without breaking CSS overflow clipping */
#duoSplitViewContainer {
  perspective: 1600px;
}

/* Apple Floating Capsule Bar (iPadOS Stage Manager Executive Toolbar) */
.duo-floating-capsule-bar {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(28px) saturate(200%);
  -webkit-backdrop-filter: blur(28px) saturate(200%);
  border: 1px solid rgba(224, 242, 254, 0.95);
  box-shadow: 
    0 1px 0 0 rgba(255, 255, 255, 1) inset,
    0 4px 20px -2px rgba(14, 165, 233, 0.10);
  transition: all 0.25s cubic-bezier(0.32, 0.72, 0, 1);
}

.duo-preset-btn {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

.duo-preset-btn.active {
  background: #ffffff !important;
  color: #0369a1 !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
}

/* Identical Symmetrical Duo Workspace Panes with Specular Rim */
.duo-pane {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(32px) saturate(210%);
  -webkit-backdrop-filter: blur(32px) saturate(210%);
  border-radius: 28px;
  padding: 14px 18px 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 
    0 1px 0 0 rgba(255, 255, 255, 1) inset,
    0 0 0 1px rgba(186, 230, 253, 0.85),
    0 20px 48px -10px rgba(14, 165, 233, 0.15);
  height: calc(100vh - 145px);
  min-height: 480px;
  max-height: calc(100vh - 145px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  position: relative;
  box-sizing: border-box;
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.duo-pane-left {
  border-top-right-radius: 14px;
  border-bottom-right-radius: 14px;
}

.duo-pane-right {
  border-top-left-radius: 14px;
  border-bottom-left-radius: 14px;
}

@media (max-width: 1023px) {
  .duo-pane {
    height: auto !important;
    min-height: 480px !important;
    max-height: 75vh !important;
    border-radius: 22px !important;
    padding: 12px 14px 14px 14px !important;
  }
}

/* Center Metallic Crease / Hinge */
.duo-hinge {
  width: 14px;
  background: linear-gradient(to right,
    rgba(148, 163, 184, 0.6) 0%,
    rgba(226, 232, 240, 0.9) 35%,
    rgba(255, 255, 255, 1) 50%,
    rgba(226, 232, 240, 0.9) 65%,
    rgba(148, 163, 184, 0.6) 100%
  );
  box-shadow: 
    inset 0 0 4px rgba(0, 0, 0, 0.15),
    0 0 12px rgba(186, 230, 253, 0.5);
  position: relative;
  border-radius: 8px;
  align-self: stretch;
  min-height: 100%;
}

.duo-hinge::before,
.duo-hinge::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 40px;
  background: linear-gradient(to bottom, #94a3b8, #cbd5e1, #94a3b8);
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.duo-hinge::before {
  top: 25%;
}

.duo-hinge::after {
  bottom: 25%;
}

/* Pinned Header inside Pane: Compact, elegant, never wraps awkwardly */
.duo-pane-header {
  position: relative;
  z-index: 20;
  background: transparent;
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  padding-bottom: 10px;
  margin-bottom: 8px;
  gap: 8px;
  flex-shrink: 0;
}

/* Segmented Buttons inside Pane Header: horizontally scrollable if needed */
#duoLeftSegmented,
#duoRightSegmented {
  overflow-x: auto !important;
  scrollbar-width: none !important;
  -ms-overflow-style: none !important;
  flex-wrap: nowrap !important;
  gap: 4px !important;
}

#duoLeftSegmented::-webkit-scrollbar,
#duoRightSegmented::-webkit-scrollbar {
  display: none !important;
}

#duoLeftSegmented .ios-segmented-btn,
#duoRightSegmented .ios-segmented-btn {
  padding: 4px 8px !important;
  font-size: 11px !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

/* Scrollable Content inside Duo Panes */
#duoPaneLeftContent,
#duoPaneRightContent {
  flex: 1 1 0% !important;
  min-height: 0 !important;
  min-width: 0 !important;
  width: 100% !important;
  height: 100% !important;
  overflow-y: auto !important;
  overflow-x: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-y: contain !important;
  padding: 8px 4px 20px 4px !important;
  display: block !important;
}

/* Ensure all tab content containers fit within 100% width */
.duo-pane [id^="tabContent-"] {
  min-height: 0 !important;
  width: 100% !important;
  max-width: 100% !important;
  display: block !important;
  overflow: visible !important;
}

/* 1. UNFOLDING: SPREAD OPEN */
.duo-unfolding-in .duo-pane-left {
  animation: iphoneDuoUnfoldLeft 0.72s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: right center;
  backface-visibility: hidden;
}

.duo-unfolding-in .duo-pane-right {
  animation: iphoneDuoUnfoldRight 0.75s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: left center;
  backface-visibility: hidden;
}

.duo-unfolding-in .duo-hinge {
  animation: iphoneDuoHingeOpen 0.72s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transform-origin: center center;
}

@keyframes iphoneDuoUnfoldLeft {
  0% {
    opacity: 0.2;
    transform: rotateY(25deg) scale(0.95);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: rotateY(0deg) scale(1);
    filter: blur(0px);
  }
}

@keyframes iphoneDuoUnfoldRight {
  0% {
    opacity: 0.2;
    transform: rotateY(-25deg) scale(0.95);
    filter: blur(4px);
  }
  100% {
    opacity: 1;
    transform: rotateY(0deg) scale(1);
    filter: blur(0px);
  }
}

@keyframes iphoneDuoHingeOpen {
  0% {
    transform: scaleX(0.15) scaleY(0.9);
    opacity: 0;
    filter: brightness(0.6);
  }
  60% {
    transform: scaleX(1.3) scaleY(1.02);
    opacity: 1;
    filter: brightness(1.35);
  }
  100% {
    transform: scaleX(1) scaleY(1);
    opacity: 1;
    filter: brightness(1);
  }
}

@keyframes iphoneDuoSpecularSweep {
  0% {
    opacity: 0.85;
    transform: translateX(-120%) rotate(25deg);
  }
  100% {
    opacity: 0;
    transform: translateX(220%) rotate(25deg);
  }
}

/* 2. FOLDING: CLOSE BACK (การพับหน้าจอเก็บ) */
.duo-folding-out .duo-pane-left {
  animation: iphoneDuoFoldLeft 0.38s cubic-bezier(0.32, 0, 0.67, 0) forwards;
  transform-origin: right center;
}

.duo-folding-out .duo-pane-right {
  animation: iphoneDuoFoldRight 0.38s cubic-bezier(0.32, 0, 0.67, 0) forwards;
  transform-origin: left center;
}

.duo-folding-out .duo-hinge {
  animation: iphoneDuoHingeClose 0.35s cubic-bezier(0.32, 0, 0.67, 0) forwards;
}

@keyframes iphoneDuoFoldLeft {
  0% {
    opacity: 1;
    transform: rotateY(0deg) scale(1);
    filter: blur(0px) brightness(1);
  }
  100% {
    opacity: 0;
    transform: rotateY(32deg) translateZ(-70px) scale(0.92);
    filter: blur(6px) brightness(0.82);
  }
}

@keyframes iphoneDuoFoldRight {
  0% {
    opacity: 1;
    transform: rotateY(0deg) scale(1);
    filter: blur(0px) brightness(1);
  }
  100% {
    opacity: 0;
    transform: rotateY(-36deg) translateZ(-70px) scale(0.92);
    filter: blur(6px) brightness(0.82);
  }
}

@keyframes iphoneDuoHingeClose {
  0% {
    transform: scaleX(1);
    opacity: 1;
  }
  100% {
    transform: scaleX(0.15);
    opacity: 0;
  }
}

/* 3. RETURN TO SINGLE SCREEN: FLUID SCREEN EXPAND */
.animate-screen-expand {
  animation: screenExpandMorph 0.44s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes screenExpandMorph {
  0% {
    opacity: 0;
    transform: scale(0.95) translateY(14px);
    filter: blur(5px);
  }
  100% {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: blur(0px);
  }
}

/* 4. SPECULAR GLARE OVERLAY (การสะท้อนแสง) */
.duo-specular-glare {
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: linear-gradient(115deg, transparent 35%, rgba(255, 255, 255, 0.7) 50%, transparent 65%);
  pointer-events: none;
  opacity: 0;
  z-index: 40;
}

/* 5. SMOOTH TAB FLUID FADE INSIDE DUO PANES (การเฟดเปลี่ยนแท็บ) */
.duo-tab-fluid-enter {
  animation: duoTabFluidFade 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes duoTabFluidFade {
  0% {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(2px);
  }
  100% {
    opacity: 1;
    transform: none;
    filter: blur(0px);
  }
}

/* Custom Slim & Tactile Scrollbars for Duo Panes */
#duoPaneLeftContent::-webkit-scrollbar,
#duoPaneRightContent::-webkit-scrollbar,
.duo-pane::-webkit-scrollbar {
  width: 7px;
}
#duoPaneLeftContent::-webkit-scrollbar-track,
#duoPaneRightContent::-webkit-scrollbar-track,
.duo-pane::-webkit-scrollbar-track {
  background: rgba(241, 245, 249, 0.65);
  border-radius: 9999px;
}
#duoPaneLeftContent::-webkit-scrollbar-thumb,
#duoPaneRightContent::-webkit-scrollbar-thumb,
.duo-pane::-webkit-scrollbar-thumb {
  background: rgba(56, 189, 248, 0.85);
  border-radius: 9999px;
  border: 1px solid rgba(255, 255, 255, 0.9);
}
#duoPaneLeftContent::-webkit-scrollbar-thumb:hover,
#duoPaneRightContent::-webkit-scrollbar-thumb:hover,
.duo-pane::-webkit-scrollbar-thumb:hover {
  background: rgba(2, 132, 199, 0.95);
}





/* Symmetrical Grid Optimization inside Duo Mode (2 Columns for spacious room cards) */
.duo-mode-active #fullRoomGrid {
  grid-template-columns: 1fr !important;
  gap: 12px !important;
}
@media (min-width: 640px) {
  .duo-mode-active #fullRoomGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
  }
}

.duo-mode-active #dashRoomGrid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 8px !important;
}
@media (min-width: 640px) {
  .duo-mode-active #dashRoomGrid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
}

/* Card & Table Styling inside Duo Pane */
.duo-pane .glass-card {
  background: #ffffff !important;
  border: 1px solid rgba(224, 242, 254, 0.9) !important;
  box-shadow: 0 4px 16px -2px rgba(14, 165, 233, 0.06) !important;
}

.duo-pane .glass-panel {
  padding: 12px 14px !important;
  border-radius: 18px !important;
}

.duo-pane h2 {
  font-size: 14px !important;
}

.duo-pane table {
  font-size: 12px !important;
}

.duo-pane table th {
  padding: 10px 10px !important;
  font-size: 11px !important;
  white-space: nowrap !important;
}

.duo-pane table td {
  padding: 9px 10px !important;
  font-size: 12px !important;
}

/* Status Badges must NEVER wrap */
.room-badge,
.status-pill {
  white-space: nowrap !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 6px !important;
  flex-shrink: 0 !important;
}

/* Apple Pull-Down Bar for Sheets/Modals */
.ios-pull-bar {
  width: 42px;
  height: 5px;
  border-radius: 9999px;
  background-color: #cbd5e1;
  margin: 0 auto 12px auto;
}

/* ==================== FULLY RESPONSIVE MOBILE-FIRST ARCHITECTURE ==================== */

/* 1. Global Viewport & Container Zero-Overflow Guarantees */
main {
  width: 100% !important;
  max-width: 100% !important;
  box-sizing: border-box !important;
  padding-bottom: max(6rem, calc(5rem + env(safe-area-inset-bottom, 0px))) !important;
}

/* 2. Responsive Table Architecture */
.table-card {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
  position: relative !important;
}

.table-card .overflow-x-auto {
  width: 100% !important;
  max-width: 100% !important;
  overflow-x: auto !important;
  -webkit-overflow-scrolling: touch !important;
  overscroll-behavior-x: contain !important;
}

.futuristic-table {
  min-width: 620px !important;
}

@media (max-width: 767px) {
  .table-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 20px;
    background: linear-gradient(to right, transparent, rgba(224, 242, 254, 0.75));
    pointer-events: none;
    opacity: 0.9;
    border-top-right-radius: 16px;
    border-bottom-right-radius: 16px;
  }
}

/* 3. Mobile Touch & Input Optimization (No Auto-Zoom & Tactile Targets) */
@media (max-width: 767px) {
  input, select, textarea {
    font-size: 16px !important; /* Critical: Prevents iOS Safari page auto-zoom */
  }

  button, select, input[type="button"], input[type="submit"] {
    min-height: 40px;
  }

  .btn-futuristic-primary,
  .btn-futuristic-secondary {
    min-height: 40px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .nav-tab {
    min-height: 34px !important;
    padding: 6px 12px !important;
    font-size: 11px !important;
  }

  .ios-segmented-btn {
    min-height: 32px !important;
    padding: 5px 10px !important;
    font-size: 11px !important;
  }
}

/* 4. Native iOS Bottom-Sheet Modals on Mobile */
@media (max-width: 639px) {
  .fixed.inset-0.z-50.flex.items-center.justify-center:not(#loginOverlay) {
    align-items: flex-end !important;
    padding: 0 !important;
  }

  .animate-modal-zoom,
  #duoPromoModalContent {
    width: 100% !important;
    max-width: 100% !important;
    border-bottom-left-radius: 0 !important;
    border-bottom-right-radius: 0 !important;
    border-top-left-radius: 28px !important;
    border-top-right-radius: 28px !important;
    margin: 0 !important;
    max-height: 88vh !important;
    max-height: 88dvh !important;
    animation: modalSlideUpMobile 0.28s cubic-bezier(0.16, 1, 0.3, 1) forwards !important;
    padding-bottom: max(16px, env(safe-area-inset-bottom, 16px)) !important;
  }

  @keyframes modalSlideUpMobile {
    from {
      opacity: 0;
      transform: translateY(100%);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  .animate-modal-zoom::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    border-radius: 9999px;
    background: #cbd5e1;
    margin: 10px auto 4px auto;
  }

  /* Modal Footer Actions on Mobile */
  .animate-modal-zoom form > div:last-child {
    flex-direction: column-reverse !important;
    gap: 8px !important;
  }

  .animate-modal-zoom form > div:last-child button {
    width: 100% !important;
    justify-content: center !important;
    min-height: 42px !important;
  }

  /* Login Card Polish on Mobile */
  #loginOverlay {
    padding: 12px !important;
  }

  .login-glass-card {
    padding: 20px 16px !important;
    border-radius: 24px !important;
    max-height: 94dvh !important;
    overflow-y: auto !important;
  }
}

/* 5. Mobile Toast Positioning */
@media (max-width: 639px) {
  #toastContainer {
    left: 12px !important;
    right: 12px !important;
    bottom: max(14px, env(safe-area-inset-bottom, 14px)) !important;
    max-width: calc(100vw - 24px) !important;
    margin: 0 auto !important;
    align-items: center !important;
  }

  #toastContainer > div {
    width: 100% !important;
    max-width: 380px !important;
  }
}

/* 6. Extra-Small Screen Polish (320px - 360px: iPhone SE 1st gen, etc.) */
@media (max-width: 360px) {
  header > div {
    padding-left: 8px !important;
    padding-right: 8px !important;
  }

  main {
    padding-left: 8px !important;
    padding-right: 8px !important;
    padding-top: 12px !important;
  }

  .glass-panel,
  .glass-card {
    padding: 12px 10px !important;
    border-radius: 18px !important;
  }

  .animate-modal-zoom .px-6,
  .animate-modal-zoom .p-6,
  #duoPromoModalContent .p-5 {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .kpi-card {
    padding: 14px 12px !important;
    min-height: 128px !important;
  }

  .dynamic-island-anchor,
  .dynamic-island {
    display: none !important;
  }

  #mainNavTabsRow {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
    padding: 6px 8px !important;
  }

  #mainNavTabsRow::-webkit-scrollbar {
    display: none !important;
  }

  #dashRoomGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  .ios-segmented {
    padding: 3px !important;
    gap: 4px !important;
  }

  .nav-tab {
    padding: 6px 11px !important;
    font-size: 11px !important;
    gap: 5px !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
  }

  .kpi-card {
    padding: 14px 16px !important;
    border-radius: 18px !important;
  }
}

/* ==================== IPHONE DUO CORNER HUD PROMO NOTIFICATION ==================== */
#duoPhoneWidgetWrapper {
  perspective: 1200px;
  transform-origin: bottom right;
  z-index: 45;
  pointer-events: none;
}

.duo-phone-chassis {
  position: relative;
  width: 280px;
  height: calc(280px * 732 / 525); /* 390.4px - exact 525:732 ratio */
  aspect-ratio: 525 / 732;
  transform-origin: bottom right;
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
  pointer-events: auto;
  user-select: none;
}

.duo-phone-chassis img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  user-select: none;
  pointer-events: none;
}

.duo-phone-chassis.phone-hidden {
  transform: translateY(115%) scale(0.92) !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.duo-phone-chassis.phone-peek {
  transform: translateY(40%) scale(1) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
  cursor: pointer !important;
  filter: drop-shadow(0 15px 35px rgba(0, 0, 0, 0.95)) !important;
}

.duo-phone-chassis.phone-visible {
  transform: translateY(0) scale(1) !important;
  opacity: 1 !important;
  pointer-events: auto !important;
}

.duo-phone-interactive-ui {
  position: absolute;
  top: 3.8%;
  left: 5.6%;
  right: 5.8%;
  bottom: 3.9%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  box-sizing: border-box;
  pointer-events: auto;
  user-select: none;
  overflow: hidden;
}

.duo-weather-pill {
  transition: all 0.3s ease;
}

/* Tablet & Mobile Breakpoints */
@media (max-width: 640px) {
  #duoPhoneWidgetWrapper {
    bottom: max(96px, calc(82px + env(safe-area-inset-bottom, 16px))) !important; /* Safe clearance above mobile browser address bar */
    right: 10px !important;
  }
  #duoPhoneWidgetWrapper.phone-wrapper-peek {
    bottom: max(16px, env(safe-area-inset-bottom, 16px)) !important;
    right: 12px !important;
  }
  #duoPhoneWidgetWrapper.phone-wrapper-full {
    bottom: max(96px, calc(82px + env(safe-area-inset-bottom, 16px))) !important;
    right: 10px !important;
  }
  .duo-phone-chassis.phone-peek {
    transform: translateY(38%) scale(1) !important;
  }
  .duo-phone-chassis {
    width: 215px !important;
    height: calc(215px * 732 / 525) !important; /* ~299.7px - 100% strict ratio, zero stretch */
    aspect-ratio: 525 / 732 !important;
  }
  .duo-phone-interactive-ui {
    padding: 6px 7px !important;
  }
  #duoPhonePromoIsland {
    margin-top: 4px !important;
    padding: 6px 7px !important;
  }
  #duoPromoDesc {
    font-size: 9.5px !important;
    line-height: 1.25 !important;
    -webkit-line-clamp: 1 !important;
    line-clamp: 1 !important;
    margin-top: 2px !important;
  }
  #duoPhoneLargeClock {
    font-size: 1.85rem !important;
    line-height: 1 !important;
    margin: 0 !important;
  }
  #duoPhoneDateText {
    font-size: 9.5px !important;
    margin-top: 1px !important;
  }
  .duo-weather-pill {
    padding: 1px 6px !important;
    font-size: 8px !important;
    gap: 3px !important;
    margin-top: 2px !important;
  }
  .duo-phone-bottom-controls {
    margin-top: auto !important;
    padding-bottom: 2px !important;
    flex-shrink: 0 !important;
  }
  .duo-bottom-hide-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 10px !important;
    padding: 3px 8px !important;
    white-space: nowrap !important;
    pointer-events: auto !important;
    touch-action: manipulation !important;
    -webkit-tap-highlight-color: transparent !important;
  }
}

@media (max-height: 500px) and (orientation: landscape) {
  #duoPhoneWidgetWrapper {
    bottom: 8px !important;
  }
  .duo-phone-chassis {
    width: 165px !important;
    height: calc(165px * 732 / 525) !important;
  }
}

@media (max-width: 380px) {
  .duo-phone-chassis {
    width: 195px !important;
    height: calc(195px * 732 / 525) !important;
  }
  #duoPhoneLargeClock {
    font-size: 1.65rem !important;
  }
}

/* ==================== UNFOLDED DUO SMARTPHONE / TABLET HUB ==================== */
#unfoldedDuoModal {
  perspective: 1200px;
}

#unfoldedDuoContainer {
  aspect-ratio: 1024 / 743;
  transform-origin: center center;
}

.unfolded-screen-inner {
  top: 3.2%;
  bottom: 3.5%;
  left: 3.2%;
  right: 3.2%;
  box-sizing: border-box;
}

.unfolded-shortcut-card {
  user-select: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.duo-bottom-unfold-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 10px !important;
  padding: 3px 8px !important;
  white-space: nowrap !important;
  pointer-events: auto !important;
  touch-action: manipulation !important;
  -webkit-tap-highlight-color: transparent !important;
}

@media (max-width: 640px) {
  #unfoldedDuoContainer {
    width: 98vw !important;
    max-width: 98vw !important;
  }
  .unfolded-screen-inner {
    padding: 6px 8px !important;
  }
  .unfolded-card-desc {
    display: none !important;
  }
  .unfolded-shortcut-card {
    padding: 4px 6px !important;
  }
}


