html {
  -webkit-text-size-adjust: 100%;
}

body {
  overscroll-behavior-y: none;
}

.pane {
  min-width: 0;
}

.focus-ring:focus-visible {
  outline: 3px solid #38bdf8;
  outline-offset: 2px;
}

.touch-target {
  min-height: 48px;
  min-width: 48px;
}

#bottom-nav {
  padding-bottom: env(safe-area-inset-bottom);
}

.q-list {
  scrollbar-width: thin;
}

.exec-tab {
  scrollbar-width: none;
}
.exec-tab::-webkit-scrollbar {
  display: none;
}

#toast-box {
  position: fixed;
  left: 50%;
  bottom: 5.5rem;
  transform: translateX(-50%);
  z-index: 80;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  width: max-content;
  max-width: 92vw;
  pointer-events: none;
}
.toast {
  background: #0f172a;
  color: #fff;
  font-size: 0.875rem;
  padding: 0.6rem 1.1rem;
  border-radius: 9999px;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.35);
  animation: toast-in 0.25s ease-out;
}
.toast-error {
  background: #b91c1c;
}
@keyframes toast-in {
  from { transform: translateY(8px); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

@media (min-width: 1024px) {
  #app-stage.desk-dual {
    display: grid;
    grid-template-columns: 330px minmax(0, 1fr);
    height: calc(100vh - 64px);
    overflow: hidden;
  }
  #app-stage.desk-dual > .pane {
    overflow-y: auto;
  }
  #toast-box {
    bottom: 2rem;
  }
}

@media print {
  #app-header,
  #app-sidebar,
  #bottom-nav,
  #fab,
  #toast-box,
  #exec-tabs,
  #pane-queue {
    display: none !important;
  }
  #app-body {
    padding-top: 0 !important;
    display: block !important;
  }
  #app-stage {
    display: block !important;
    height: auto !important;
    overflow: visible !important;
  }
  #pane-work {
    overflow: visible !important;
  }
}

/* 🛠️ DEV-only: mobile view simulation (ลบออกเมื่อพัฒนาเสร็จ) */
body.sim-mobile #app-sidebar {
  display: none !important;
  width: 0;
}
body.sim-mobile #bottom-nav {
  display: flex !important;
}
body.sim-mobile #app-body {
  display: flex;
  justify-content: center;
  padding-top: 3.5rem;
}
body.sim-mobile #app-stage {
  flex: 0 1 430px;
  width: 100%;
  max-width: 100%;
}
body.sim-pc #bottom-nav {
  display: none !important;
}