/* Workshop forms, service suggestions and calendar. Existing app controls remain the entry points. */
body.rd-interface :is(#createOrderPanel, #quickOrderPanel, #calendarPanel) {
  --intake-ink: #102d3c;
  --intake-accent: #075b4e;
  --intake-accent-hover: #06483e;
  --intake-muted: #49636b;
  --intake-line: #dbe3e4;
  --intake-input-line: #aabebb;
  --intake-wash: #f4f8f5;
  --intake-active: #e3efdb;
  --intake-pad: clamp(16px, 2vw, 24px);
  box-sizing: border-box;
  color: var(--intake-ink);
  width: 100%;
  min-width: 0;
  max-width: none;
}

body.rd-interface #calendarPanel > .row h2,
body.rd-interface #quickOrderPanel > details > summary {
  color: var(--intake-ink);
  font-size: 1.125rem;
  line-height: 1.35;
  letter-spacing: -.025em;
  font-weight: 700;
}
body.rd-interface #calendarPanel > .row p,
body.rd-interface #quickOrderPanel > details > p {
  color: var(--intake-muted);
  font-size: .875rem;
  line-height: 1.55;
  margin: .45rem 0 0;
}

body.rd-interface #createOrderPanel .create-form-grid {
  grid-template-columns: minmax(0, 1.6fr) minmax(260px, 1fr);
  align-items: start;
  gap: 18px;
}
body.rd-interface #createOrderPanel :is(.create-form-main, .create-form-side) {
  min-width: 0;
  gap: 16px;
}

body.rd-interface #createOrderPanel .create-form-card {
  min-inline-size: 0;
  border: 1px solid var(--intake-line) !important;
  border-radius: 15px !important;
  padding: var(--intake-pad) !important;
  box-shadow: 0 2px 6px #203c3810 !important;
}
body.rd-interface #createOrderPanel .create-form-card :is(legend, h3) {
  color: var(--intake-ink) !important;
  font-size: 1.12rem !important;
  font-weight: 700 !important;
  line-height: 1.35;
  letter-spacing: -.025em;
  border-color: #e4edeb;
}
body.rd-interface #quickOrderPanel .unified-services h3,
body.rd-interface #calendarPanel :is(#calendarFormHeading, #calendarAgenda h3, #calendarUnscheduledRows h3) {
  color: var(--intake-ink);
  font-size: 1.12rem;
  line-height: 1.4;
  font-weight: 700;
}
body.rd-interface #quickOrderPanel {
  border: 1px solid var(--intake-line);
  background: #fff;
  border-radius: 15px;
  padding: var(--intake-pad);
  box-shadow: 0 2px 6px #203c3810;
}
body.rd-interface #quickOrderPanel > details > summary {
  padding: 0;
  min-height: 44px;
  margin: 0 0 12px;
  background: transparent;
  overflow-wrap: anywhere;
}
body.rd-interface #quickOrderForm {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 15px;
  margin: 18px 0 0;
  min-width: 0;
}
body.rd-interface #quickServicesSection {
  width: 100%;
  padding: var(--intake-pad);
  border: 1px solid var(--intake-line);
  border-radius: 12px;
  background: var(--intake-wash);
}
body.rd-interface :is(#createOrderPanel, #quickOrderForm) .vehicle-identity-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: 12px 14px;
}
body.rd-interface #quickOrderForm .plate-lookup {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}
body.rd-interface #quickOrderForm .plate-lookup > button {
  align-self: end;
}
body.rd-interface #quickOrderForm .plate-lookup > :is(.plate-suggestions, .vehicle-lookup-status) {
  grid-column: 1 / -1;
}

body.rd-interface :is(#createOrderPanel, #quickOrderPanel, #calendarPanel) label {
  min-width: 0;
  color: #315158 !important;
  font-size: .875rem !important;
  font-weight: 600 !important;
  line-height: 1.4;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel, #calendarPanel) label
  :is(input:not([type=checkbox]), select, textarea),
body.rd-interface :is(#createOrderPanel, #quickOrderForm) .service-search-control input {
  max-width: 100%;
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--intake-input-line);
  border-radius: 8px;
  background: #fff;
  color: var(--intake-ink);
  font-size: 1rem !important;
  line-height: 1.35;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel, #calendarPanel) :is(input, textarea)::placeholder {
  color: #587079;
  opacity: 1;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel, #calendarPanel)
  :is(input:not([type=checkbox]), select, textarea):focus-visible {
  border-color: var(--intake-accent);
  outline: 2px solid #297e73;
  outline-offset: 2px;
  box-shadow: none;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel, #calendarPanel) :is(textarea, label) {
  overflow-wrap: anywhere;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel, #calendarPanel) input[type=checkbox] {
  width: 19px;
  height: 19px;
  min-height: 19px;
  accent-color: var(--intake-accent);
}
body.rd-interface #quickOrderPanel label:has(input[type=checkbox]) {
  flex-direction: row;
  align-items: flex-start;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel, #calendarPanel)
  :is(.create-card-description, .vehicle-entry-note, .create-info-note, .create-summary-note,
       .vehicle-norm-hint, .create-schedule-help, .vehicle-lookup-status, #createServicesStatus,
       #quickServicesStatus, #calendarStatus, .calendar-info span, .calendar-hour span) {
  color: var(--intake-muted) !important;
  font-size: .875rem !important;
  line-height: 1.5;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel, #calendarPanel) :is(.create-info-note, .schedule-info) {
  background: var(--intake-wash);
  color: #275840 !important;
  border-color: var(--intake-line);
}
body.rd-interface #createOrderPanel .create-summary-list :is(dt, dd) {
  color: var(--intake-muted);
  line-height: 1.45;
  font-size: .875rem;
}
body.rd-interface #createOrderPanel .create-summary-list dd {
  color: var(--intake-ink);
  font-weight: 650;
}

body.rd-interface :is(#createOrderPanel, #quickOrderPanel, #calendarPanel)
  :is(#createDemoSubmit, #quickOrderSubmit, #calendarNew, #calendarSave, #workScheduleSave) {
  min-height: 44px;
  background: var(--intake-accent);
  color: #fff;
  border-color: var(--intake-accent);
  box-shadow: none;
  font-size: .9375rem;
  font-weight: 650;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel, #calendarPanel)
  :is(#createDemoSubmit, #quickOrderSubmit, #calendarNew, #calendarSave, #workScheduleSave):hover:not(:disabled) {
  background: var(--intake-accent-hover);
  border-color: var(--intake-accent-hover);
  color: #fff;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel) :is(#createAddService, #quickAddService, #createFormCancel),
body.rd-interface :is(#createOrderPanel, #quickOrderPanel) .plate-lookup > button,
body.rd-interface #calendarPanel :is(.calendar-toolbar > button, .calendar-event-actions button,
  #calendarWorkSchedule, #calendarUnscheduled, #workScheduleClose) {
  min-height: 44px;
  background: #fff !important;
  color: var(--intake-accent) !important;
  border: 1px solid var(--intake-input-line) !important;
  border-radius: 8px;
  font-size: .875rem !important;
  font-weight: 650;
  box-shadow: none;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel, #calendarPanel)
  :is(.plate-lookup > button, #createAddService, #quickAddService, #createFormCancel, #calendarWorkSchedule, #calendarUnscheduled,
    .calendar-toolbar > button, .calendar-event-actions button):hover:not(:disabled) {
  background: var(--intake-active) !important;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel, #calendarPanel) :is(button, input):disabled {
  cursor: not-allowed;
}

body.rd-interface :is(#createOrderPanel, #quickOrderPanel) .service-picker {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 9px;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel) .service-picker > button {
  margin-top: 28px;
  white-space: normal;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel) :is(.service-search-results, .plate-suggestions) {
  max-height: min(280px, 37dvh);
  background: #fff;
  border-color: var(--intake-input-line);
  border-radius: 10px;
  box-shadow: 0 2px 12px #203c3812;
  overscroll-behavior: contain;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel)
  :is(.service-search .service-search-option, .plate-suggestions button[data-plate-choice]) {
  min-height: 49px;
  background: #f7faf8;
  color: #183e41;
  border-color: #d8e5df;
  font-size: .9375rem;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel)
  :is(.service-search .service-search-option, .plate-suggestions button[data-plate-choice]):is(:hover, :focus-visible, [aria-selected=true]):not(:disabled) {
  background: var(--intake-active);
  color: var(--intake-ink);
  border-color: #719983;
  outline-color: #297e73;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel)
  :is(.service-search-detail, .plate-suggestions button[data-plate-choice] span, .service-search-hint, .service-search-status) {
  color: var(--intake-muted);
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel) .service-search .service-search-new {
  background: #eaf3e3;
  color: #214f36;
  font-weight: 700;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel) .chosen-service {
  background: #f7faf8;
  color: var(--intake-ink);
  border-color: var(--intake-line);
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel) .chosen-service .service-title {
  color: var(--intake-ink);
  font-size: .9375rem !important;
  font-weight: 650;
}
body.rd-interface #createOrderPanel .chosen-service :is(.service-done, .create-team-planner) {
  background: var(--intake-wash);
  color: var(--intake-accent);
  border-color: var(--intake-line);
}
body.rd-interface #createOrderPanel .chosen-service .chosen-qty {
  color: var(--intake-muted);
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel) .chosen-service button[data-remove-unified] {
  color: #52696c !important;
  min-height: 40px;
  font-size: .875rem;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel) .service-empty {
  background: #fbfdfb;
  border-color: var(--intake-input-line);
  color: var(--intake-muted);
  font-size: .875rem;
}

body.rd-interface :is(#createOrderPanel, #quickOrderPanel) .vehicle-lookup-status[data-result=error] {
  color: #9f2e20 !important;
}
body.rd-interface :is(#createOrderPanel, #quickOrderPanel) .vehicle-lookup-status[data-result=found] {
  color: var(--intake-accent) !important;
}
body.rd-interface #createOrderPanel #createAssignmentChoice {
  color: var(--intake-accent);
  font-size: .875rem;
  font-weight: 650;
  overflow-wrap: anywhere;
}
body.rd-interface #createOrderPanel .create-service-plan {
  border-top-color: var(--intake-line) !important;
}
body.rd-interface #createOrderPanel .create-service-plan > summary {
  color: #315158 !important;
  min-height: 44px;
  flex-wrap: wrap;
  row-gap: 4px;
  font-size: .875rem !important;
  line-height: 1.4;
}
body.rd-interface #createOrderPanel .create-service-plan.has-team > summary,
body.rd-interface #createOrderPanel .create-service-plan [data-create-plan-summary] {
  color: var(--intake-accent) !important;
}
body.rd-interface #createOrderPanel .create-plan-editor {
  background: #fff;
  border: 1px solid var(--intake-line);
  border-radius: 9px;
  padding: 12px !important;
}
body.rd-interface #createOrderPanel .create-plan-editor select:disabled {
  opacity: 1;
  color: #546b6d;
  background: var(--intake-wash);
  border-color: var(--intake-line);
}
body.rd-interface #createOrderPanel .create-service-plan .create-plan-help {
  color: var(--intake-muted);
  font-size: .875rem !important;
}

body.rd-interface #createOrderPanel .create-form-footer {
  position: static;
  z-index: auto;
  padding: 14px 16px;
  color: var(--intake-ink);
  background: #fff;
  border-color: var(--intake-line);
  border-radius: 12px;
  box-shadow: 0 2px 6px #203c3810;
  backdrop-filter: none;
}
body.rd-interface #createOrderPanel #createPilotChoice {
  color: var(--intake-muted) !important;
  font-size: .875rem !important;
}

body.rd-interface #calendarPanel {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
body.rd-interface #calendarPanel > .row {
  gap: 16px;
  margin-bottom: 16px;
}
body.rd-interface #calendarPanel > .row h2 {
  margin: 0;
  gap: 9px;
}
body.rd-interface #calendarPanel :is(.calendar-now, .calendar-toolbar, #calendarAgenda, #calendarUnscheduledRows, .calendar-editor) {
  border: 1px solid var(--intake-line);
  border-radius: 15px;
  background: #fff;
  color: var(--intake-ink);
  padding: var(--intake-pad);
  box-shadow: 0 2px 6px #203c3810;
}
body.rd-interface #calendarPanel .calendar-now {
  background: var(--intake-wash);
  margin: 0 0 12px;
}
body.rd-interface #calendarPanel :is(.calendar-now-caption, #calendarNowDate) {
  color: var(--intake-muted);
}
body.rd-interface #calendarPanel .calendar-now-caption {
  font-size: .75rem;
}
body.rd-interface #calendarPanel :is(.calendar-now-clock, .calendar-period, .calendar-hour) {
  color: var(--intake-accent);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
body.rd-interface #calendarPanel .calendar-toolbar {
  gap: 10px;
  align-items: end;
}
body.rd-interface #calendarPanel .calendar-toolbar label {
  flex: 1 1 130px;
  min-width: 0;
}
body.rd-interface #calendarPanel .calendar-toolbar .calendar-period {
  min-width: 0;
  flex: 1 1 230px;
  align-self: center;
  overflow-wrap: anywhere;
  font-size: 1.125rem;
}
body.rd-interface #calendarPanel :is(.calendar-day, .calendar-week-chip) {
  border-color: var(--intake-line);
  background: #fff;
  color: #255053;
  font-weight: 650;
}
body.rd-interface #calendarPanel :is(.calendar-day, .calendar-week-chip):is(:hover, .calendar-picked) {
  border-color: #649789;
  background: var(--intake-active);
  color: #16443d;
  box-shadow: inset 0 0 0 1px #649789;
}
body.rd-interface #calendarPanel :is(.calendar-day, .calendar-week-chip) > :is(span, small):not(.calendar-work-badge) {
  color: var(--intake-muted);
  line-height: 1.25;
}
body.rd-interface #calendarPanel :is(#calendarAgenda, #calendarUnscheduledRows) {
  margin: 16px 0;
}
body.rd-interface #calendarPanel .calendar-event {
  align-items: start;
  gap: 12px;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--intake-line);
  border-radius: 0;
  box-shadow: none;
  margin: 0;
  padding: 14px 0;
}
body.rd-interface #calendarPanel .calendar-info {
  overflow-wrap: anywhere;
}
body.rd-interface #calendarPanel .calendar-info strong {
  color: var(--intake-ink);
  font-size: 1rem;
}
body.rd-interface #calendarPanel .calendar-event-actions {
  gap: 6px;
  justify-content: flex-end;
}
body.rd-interface :is(#calendarPanel, #createOrderPanel) .dp-panel {
  left: auto;
  right: 0;
  width: min(303px, calc(100vw - 52px));
  border-color: var(--intake-input-line);
  background: #fff;
  z-index: 26;
}
body.rd-interface :is(#calendarPanel, #createOrderPanel) .dp-panel .dp-day {
  background: var(--intake-wash);
  color: #25434a;
  font-size: .875rem;
}
body.rd-interface :is(#calendarPanel, #createOrderPanel) .dp-panel .dp-day.dp-selected {
  background: var(--intake-accent);
  color: #fff;
}
body.rd-interface :is(#calendarPanel, #createOrderPanel) .dp-panel .dp-day.dp-today:not(.dp-selected) {
  color: var(--intake-accent);
  box-shadow: inset 0 0 0 1px #649789;
}
body.rd-interface :is(#calendarPanel, #createOrderPanel) .dp-panel .dp-day:hover:not(.dp-selected) {
  background: var(--intake-active);
}
body.rd-interface :is(#calendarPanel, #createOrderPanel) .dp-wrap > input {
  padding-right: 48px;
}
body.rd-interface :is(#calendarPanel, #createOrderPanel) .dp-trigger {
  min-height: 40px;
  background: var(--intake-wash);
  color: var(--intake-accent);
  border-color: var(--intake-line);
}

/* The available workspace also accounts for the desktop navigation rail. */
@media (max-width: 1030px) {
  body.rd-interface #createOrderPanel .create-form-grid,
  body.rd-interface #createOrderPanel .create-form-side {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (min-width: 601px) and (max-width: 1030px) {
  body.rd-interface #createOrderPanel #createScheduleControls .dp-panel,
  body.rd-interface #calendarPanel .calendar-form-grid .dp-panel {
    left: 0;
    right: auto;
  }
}

@media (max-width: 600px) {
  body.rd-interface :is(#createOrderPanel, #quickOrderForm) .vehicle-identity-grid,
  body.rd-interface #createOrderPanel #createScheduleControls:not(.hidden),
  body.rd-interface #createOrderPanel .create-plan-editor,
  body.rd-interface #calendarPanel .calendar-form-grid,
  body.rd-interface #calendarPanel .work-schedule-fields {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  body.rd-interface :is(#createOrderPanel, #quickOrderForm) :is(.plate-lookup, .service-picker) {
    grid-template-columns: minmax(0, 1fr);
  }
  body.rd-interface :is(#createOrderPanel, #quickOrderForm) :is(.plate-lookup, .service-picker) > button {
    width: 100%;
    margin-top: 0;
  }
  body.rd-interface #createOrderPanel .create-form-footer {
    position: static;
    flex-wrap: wrap;
  }
  body.rd-interface #createOrderPanel .create-form-footer .create-footer-buttons {
    width: 100%;
    justify-content: stretch;
  }
  body.rd-interface #createOrderPanel .create-footer-buttons > button {
    flex: 1 1 0;
    min-width: 0 !important;
    white-space: normal;
  }
  body.rd-interface #calendarPanel :is(.calendar-editor, #calendarAgenda, #calendarUnscheduledRows) {
    padding: 14px;
  }
  body.rd-interface #calendarPanel .calendar-toolbar > label {
    flex-basis: 100%;
  }
  body.rd-interface #calendarPanel .calendar-toolbar .calendar-period {
    flex: 1;
    text-align: center;
    font-size: 1rem;
  }
  body.rd-interface #calendarPanel :is(.calendar-day, .calendar-week-chip) {
    gap: 4px;
    font-size: .75rem;
    min-height: 61px;
    padding: 6px 1px;
  }
  body.rd-interface #calendarPanel :is(.calendar-day, .calendar-week-chip) > :is(strong, span, small) {
    font-size: .625rem;
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

@media (max-width: 380px) {
  body.rd-interface #calendarPanel .calendar-toolbar .calendar-period {
    flex-basis: 100%;
    text-align: left;
  }
  body.rd-interface #calendarPanel .calendar-event {
    display: grid;
    grid-template-columns: minmax(45px, auto) minmax(0, 1fr);
    gap: 9px;
  }
  body.rd-interface #calendarPanel .calendar-event-actions {
    grid-column: 1 / -1;
    justify-content: start;
  }
  body.rd-interface #calendarPanel .calendar-hour {
    min-width: 45px;
  }
}
