.timeline-calendar.day-calendar,.timeline-calendar.week-calendar { display:block; }
.schedule-move-handle {
  border:1px solid #9ebada;border-radius:7px;background:#fff;color:#23527f;
  padding:5px 9px;font-family:inherit;font-size:12px;font-weight:600;cursor:grab;touch-action:none;
}
.schedule-move-handle:focus-visible { outline:3px solid #236bdd;outline-offset:1px; }
.queue-card > .schedule-move-handle { margin-top:8px;min-height:44px; }
.calendar-event > .schedule-move-handle { display:block;margin-top:5px;min-height:32px; }
.timeline-event { touch-action:pan-x pan-y; }
.timeline-event:has(>.schedule-move-handle) { padding-right:62px; }
.timeline-event > .schedule-move-handle {
  position:absolute;right:29px;top:1px;bottom:9px;width:28px;padding:0;
  font-size:0;min-height:16px;
}
.timeline-event > .schedule-move-handle::after { content:'↕';font:700 18px/1 system-ui; }
.event-resize { touch-action:none; }
/* The browser must know before pointerdown that a card owns this gesture.
   Changing touch-action after movement is too late in Safari/Pointer Events. */
#scheduleWorkspace [draggable="true"],#scheduleWorkspace .schedule-pointer-held {
  touch-action:none!important;-webkit-touch-callout:none;
}
.schedule-drag-ghost {
  position:fixed;z-index:10000;pointer-events:none;padding:9px 12px;
  border-radius:10px;background:#174d83;color:white;box-shadow:0 4px 18px #17345240;
}
.drop-preview { pointer-events:none; }
.timeline-column > .drop-preview.compact { top:4px;height:auto;min-height:38px;white-space:normal; }
.schedule-confirm-fields { display:grid;grid-template-columns:1fr 1fr;gap:12px;margin:16px 0; }
.schedule-confirm-fields label { display:grid;gap:7px;min-width:0;color:#405773;font-weight:600; }
.schedule-confirm-fields input { box-sizing:border-box;width:100%;min-width:0;min-height:46px;padding:10px;border:1px solid #99b1cd;border-radius:9px;background:#f1f6ff;color:#173957;font:inherit;font-size:16px; }
.schedule-confirm-grid { grid-template-columns:minmax(0,2fr) minmax(0,1fr); }
.schedule-confirm-grid article { min-width:0;overflow-wrap:anywhere; }
.schedule-confirm-lead:not([hidden]) { display:grid;gap:6px;margin:12px 0;color:#405773;font-weight:600; }
.schedule-confirm-lead select { width:100%;min-height:46px;padding:8px;border:1px solid #99b1cd;border-radius:9px;color:#173957;background:#f1f6ff;font:inherit;font-size:16px; }

@media(max-width:900px) {
  #scheduleWorkspace .schedule-toolbar { padding:12px;gap:10px;flex-wrap:wrap;min-height:0; }
  #scheduleWorkspace .schedule-toolbar h2 { font-size:18px; }
  #scheduleWorkspace .calendar-nav { margin-left:0;gap:6px; }
  #scheduleWorkspace .calendar-nav button { min-height:44px; }
  #scheduleWorkspace .calendar-views { flex:1 1 100%;margin:0;display:flex;flex-wrap:wrap; }
  #scheduleWorkspace .calendar-views button { flex:1 1 60px;padding:8px;min-height:44px;height:auto; }
  #scheduleWorkspace .schedule-main { display:flex;flex-direction:column;min-height:0; }
  #scheduleWorkspace .dispatch-queue { order:-1;border-left:0;border-bottom:1px solid #cedbe8; }
  #scheduleWorkspace .dispatch-queue header { height:auto;min-height:56px;padding:8px 12px; }
  #scheduleWorkspace .dispatch-queue header > button { width:44px;height:44px; }
  #scheduleWorkspace .queue-controls { display:flex;padding:8px;gap:8px; }
  #scheduleWorkspace .queue-controls select { width:42%;min-width:0;height:44px;font-size:16px; }
  #scheduleWorkspace .queue-controls label { flex:1;min-width:0;height:44px; }
  #scheduleWorkspace .queue-controls input { min-width:0;font-size:16px; }
  /* Size the horizontal row from its content, including requests and part stages.
     A fixed height shrinks the card border while its Schedule action overflows. */
  #scheduleWorkspace .queue-list { display:flex;align-items:stretch;min-height:0;max-height:none;padding:8px;overflow:auto; }
  #scheduleWorkspace .queue-card { display:flex;flex-direction:column;flex:0 0 240px;min-width:0;margin:0; }
  #scheduleWorkspace .queue-card .schedule-card-open { flex:1 0 auto;height:auto; }
  #scheduleWorkspace .queue-card > .schedule-move-handle { flex:0 0 auto;align-self:flex-start; }
  #scheduleWorkspace .queue-card-head { overflow-wrap:anywhere; }
  #scheduleWorkspace .queue-card-meta { flex-wrap:wrap; }
  #scheduleWorkspace .overdue-queue-heading { display:none; }
  #scheduleWorkspace .dispatch-queue > footer { padding:8px 12px; }
  #scheduleWorkspace.queue-collapsed .dispatch-queue { height:auto; }
  #scheduleWorkspace.queue-collapsed .dispatch-queue header { justify-content:space-between; }
  #scheduleWorkspace.queue-collapsed .dispatch-queue header > div { display:block; }
  #scheduleWorkspace.queue-collapsed .queue-controls,#scheduleWorkspace.queue-collapsed .queue-list,#scheduleWorkspace.queue-collapsed .dispatch-queue > footer { display:none; }
  #scheduleWorkspace .calendar-legend { padding:8px 12px;gap:10px; }
  #scheduleWorkspace .calendar-surface { min-height:0;max-height:68vh;max-height:68dvh;overflow:auto;overscroll-behavior:contain;touch-action:pan-x pan-y; }
  #scheduleWorkspace .day-calendar { min-width:100%;width:calc(48px + var(--tech-count) * var(--mobile-lane-width)); }
  #scheduleWorkspace .day-calendar .timeline-header { grid-template-columns:48px repeat(var(--tech-count),minmax(0,1fr)); }
  #scheduleWorkspace .day-calendar .timeline-body { grid-template-columns:48px minmax(0,1fr); }
  #scheduleWorkspace .time-rail { position:sticky;left:0;z-index:7; }
  #scheduleWorkspace .time-rail span { right:5px;font-size:11px; }
  #scheduleWorkspace .timeline-day-head { padding:8px 4px;overflow-wrap:anywhere; }
  #scheduleWorkspace .week-calendar { min-width:980px; }
  #scheduleWorkspace .two-week-calendar { min-width:910px; }
  #scheduleWorkspace .month-calendar { min-width:770px; }
  #scheduleWorkspace .calendar-event > .schedule-move-handle { min-height:44px; }
  #scheduleWorkspace .calendar-event strong { white-space:normal;overflow-wrap:anywhere; }
  #scheduleWorkspace .timeline-event strong { white-space:normal;line-height:1.2; }
}

#scheduleWorkspace .schedule-return-badge{background:#FFF1CF!important;color:#755015!important;border-color:#CDAB64!important;white-space:normal}
