/* Shared navigation and touch improvements, loaded after page-specific styles. */
.order-controls {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  margin: 8px 0;
}
.order-controls button {
  min-width: 40px;
  min-height: 40px;
  padding: 6px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #fff;
  color: #2d3748;
  cursor: pointer;
}
.order-controls button:disabled {
  opacity: 0.35;
  cursor: default;
}
.reorder-status {
  font-size: 12px;
  min-height: 18px;
  color: #276749;
  margin: 6px 0;
}
:focus-visible {
  outline: 3px solid #805ad5;
  outline-offset: 3px;
}
@media (max-width: 760px) {
  html {
    scroll-padding-top: 16px;
  }
  body {
    min-width: 0;
  }
  .container {
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    backdrop-filter: none;
  }
  .container > div:first-child,
  .container > div[style*="display:flex"],
  .task-group-info > div:first-child,
  .top-bar,
  .top-bar-actions,
  .back-link-container {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }
  .container > div:first-child > div[style*="display:flex"],
  .container > div[style*="display:flex"] > div,
  .task-group-info > div:first-child > div,
  .container > div:first-child > div[style*="display: flex"] {
    flex-wrap: wrap !important;
    gap: 8px !important;
    max-width: 100%;
  }
  h1 {
    font-size: 1.65rem !important;
    overflow-wrap: anywhere;
  }
  .button,
  .btn,
  button.nav-btn,
  button.view-btn {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
  input,
  select,
  textarea {
    font-size: 16px !important;
    max-width: 100%;
  }
  .modal-content,
  .time-popup,
  .gantt-popup,
  .td-card {
    max-width: calc(100vw - 20px) !important;
    max-height: 90dvh !important;
    overflow: auto;
  }
  .task-actions,
  .project-actions,
  .task-group-actions {
    flex-wrap: wrap;
    gap: 8px !important;
  }
  .task-group-card {
    flex-wrap: wrap;
    gap: 12px;
  }
  .task-group-card > div[style*="flex: 1"] {
    flex: 1 1 calc(100% - 40px) !important;
    min-width: 0;
  }
  .task-group-card .project-actions {
    flex: 1;
  }
  .task-name,
  .project-name,
  .task-group-name {
    overflow-wrap: anywhere;
    min-width: 0;
  }
  .gantt-layout {
    min-width: 0;
    flex-direction: column !important;
    height: auto !important;
  }
  .gantt-sidebar {
    width: 100% !important;
    max-height: 180px !important;
    flex-shrink: 0;
    border-right: 0 !important;
  }
  .gantt-main {
    min-width: 0;
    width: 100%;
  }
  .gantt-scroll {
    max-width: 100%;
    height: 65dvh;
    overscroll-behavior: contain;
  }
  .gantt-toolbar {
    gap: 8px !important;
  }
  .gantt-toolbar button,
  .gantt-toolbar select {
    min-height: 44px;
  }
  .calendar-main {
    min-width: 0;
  }
  .calendar-header {
    flex-wrap: wrap;
    gap: 8px !important;
  }
  .calendar-month-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }
  .calendar-day.empty-day {
    min-height: 52px;
  }
  .calendar-day .day-header {
    flex-wrap: wrap;
    padding: 2px 0;
    min-height: 44px;
  }
  .calendar-day .add-task-btn {
    width: 100%;
    min-width: 0;
    min-height: 28px;
  }
  .calendar-day .scheduled-task {
    min-width: 0;
    min-height: 44px;
    padding: 4px 2px;
    overflow: hidden;
  }
  .calendar-day .task-actions {
    display: none;
  }
  .calendar-nav,
  .view-switcher {
    display: flex;
    flex-wrap: wrap;
  }
  body[data-view] .calendar-page-title {
    color: #2d3748 !important;
  }
  body[data-view].dark-mode .calendar-page-title {
    color: #fff !important;
  }
  body[data-view] .container > div:first-child > div {
    width: 100%;
  }
  body[data-view] .container > div:first-child .button {
    width: auto;
    min-width: 0;
    flex: 1 1 calc(50% - 10px);
  }
  .day-section-header .add-task-btn {
    width: 44px;
    min-width: 44px;
    min-height: 44px;
    margin-left: 0 !important;
  }
  .calendar-nav button,
  .view-switcher button {
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
  }
  .calendar-sidebar {
    height: 100dvh !important;
    max-height: 100dvh !important;
    width: 100vw !important;
    max-width: 100vw !important;
  }
  #floatingToggle {
    left: 12px !important;
    bottom: 12px !important;
    top: auto !important;
    transform: none !important;
    width: 48px;
    min-width: 48px;
    height: 48px;
    z-index: 2000;
  }
  .day-project-columns {
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
}
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
