/* ================================================================
   Schedule page — design-system alignment
   Prefix: --sch-*
   Pattern: matches dashboard.css / inspections.css / remedials.css
   ================================================================ */

/* --- 1. Foundation: variables, reset, edge-to-edge --- */

.page-section--schedule {
  --sch-bg: #f7f5f0;
  --sch-card: #ffffff;
  --sch-hover: #f2efe9;
  --sch-inset: #edeae3;
  --sch-inset-deep: #e5e1d8;
  --sch-rule: rgba(0, 0, 0, 0.07);
  --sch-rule-strong: rgba(0, 0, 0, 0.11);
  --sch-ink: #1a1815;
  --sch-ink-2: #3d3a34;
  --sch-ink-3: #6b6458;
  --sch-ink-4: #9a9188;
  --sch-accent: #c49510;
  --sch-accent-bg: rgba(196, 149, 16, 0.08);
  --sch-accent-border: rgba(196, 149, 16, 0.22);
  --sch-green: #1e7a45;
  --sch-green-bg: rgba(30, 122, 69, 0.08);
  --sch-green-border: rgba(30, 122, 69, 0.2);
  --sch-red: #b03030;
  --sch-red-bg: rgba(176, 48, 48, 0.07);
  --sch-red-border: rgba(176, 48, 48, 0.18);
  --sch-blue: #2563a8;
  --sch-blue-bg: rgba(37, 99, 168, 0.08);
  --sch-blue-border: rgba(37, 99, 168, 0.16);
  --sch-shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --sch-shadow-card: 0 1px 4px rgba(0,0,0,0.06), 0 0 0 1px rgba(0,0,0,0.05);
  --sch-shadow-md: 0 4px 16px rgba(0,0,0,0.1), 0 2px 4px rgba(0,0,0,0.06);

  --sch-type-inspection: #2563a8;
  --sch-type-prebooking: #c49510;
  --sch-type-firedoor: #6b46c1;
  --sch-type-remedial: #1e7a45;

  padding: 0 0 28px;
  background: var(--sch-bg);
  color: var(--sch-ink);
}

.content:has(.page-section--schedule) {
  padding-left: 0;
  padding-right: 0;
}

.page-section--schedule svg {
  display: block;
}

/* --- 2. Layout structure (overrides style.css containers) --- */

.page-section--schedule .schedule-workspace {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 100%;
  background: var(--sch-bg);
}

.page-section--schedule .schedule-top {
  display: flex;
  flex-direction: column;
  gap: 0;
  width: 100%;
  flex: none;
  grid-column: 1 / -1;
}

.page-section--schedule .schedule-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 352px;
  gap: 16px;
  align-items: start;
  padding: 16px 28px 0;
  width: 100%;
  box-sizing: border-box;
}

.page-section--schedule .schedule-secondary {
  display: flex;
  flex-direction: column;
  gap: 12px;
  position: sticky;
  top: 16px;
  align-self: start;
}

/* Override old animation — always visible */
.page-section--schedule .schedule-animate {
  opacity: 1;
  transform: none;
}

/* --- 3. Header --- */

.page-section--schedule .sch-header {
  background: var(--sch-card);
  border-bottom: 1px solid var(--sch-rule);
  box-shadow: var(--sch-shadow-sm);
  padding: 20px 28px 18px;
}

.page-section--schedule .sch-header__main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.page-section--schedule .sch-header__eyebrow {
  margin: 0 0 4px;
  color: var(--sch-accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-section--schedule .sch-header__title {
  margin: 0 0 6px;
  color: var(--sch-ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 760px;
}

.page-section--schedule .sch-header__subhead {
  margin: 0;
  color: var(--sch-ink-4);
  font-size: 13px;
  font-weight: 300;
  max-width: 820px;
  line-height: 1.5;
}

.page-section--schedule .sch-header__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 4px;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.page-section--schedule .sch-header-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 7px;
  font-family: var(--font-sans);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.15s;
  border: 1px solid transparent;
}

.page-section--schedule .sch-header-btn svg {
  width: 13px;
  height: 13px;
}

.page-section--schedule .sch-header-btn__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 13px;
  height: 13px;
}

.page-section--schedule .sch-header-btn--primary {
  background: var(--sch-ink);
  color: #fff;
  box-shadow: var(--sch-shadow-sm);
}

.page-section--schedule .sch-header-btn--primary:hover {
  background: var(--sch-ink-2);
}

.page-section--schedule .sch-header-btn--ghost {
  background: var(--sch-card);
  color: var(--sch-ink-2);
  border-color: var(--sch-rule-strong);
  box-shadow: var(--sch-shadow-sm);
}

.page-section--schedule .sch-header-btn--ghost:hover {
  background: var(--sch-hover);
}

/* --- 4. Stats strip --- */

.page-section--schedule .sch-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 16px 28px 18px;
  margin: 0;
}

.page-section--schedule .sch-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  background: var(--sch-card);
  border-radius: 10px;
  padding: 15px 18px 16px;
  border: 1px solid var(--sch-rule);
  box-shadow: var(--sch-shadow-card);
  position: relative;
  overflow: hidden;
}

.page-section--schedule .sch-stat::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: var(--sch-accent-bg);
}

.page-section--schedule .sch-stat:nth-child(1)::before {
  background: var(--sch-blue-bg);
}

.page-section--schedule .sch-stat:nth-child(2)::before {
  background: var(--sch-accent-bg);
}

.page-section--schedule .sch-stat:nth-child(3)::before {
  background: var(--sch-green-bg);
}

.page-section--schedule .sch-stat:nth-child(4)::before {
  background: var(--sch-red-bg);
}

.page-section--schedule .sch-stat:nth-child(5)::before {
  background: var(--sch-inset-deep);
}

.page-section--schedule .sch-stat__label {
  color: var(--sch-ink-4);
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.page-section--schedule .sch-stat__value {
  color: var(--sch-ink);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1;
}

/* --- 5. Flash messages --- */

.page-section--schedule .schedule-flash {
  margin: 0 28px 16px;
}

/* --- 6. Calendar card & panel chrome (overrides style.css) --- */

.page-section--schedule .schedule-card,
.page-section--schedule .schedule-panel,
.page-section--schedule .schedule-card--bookings {
  background: var(--sch-card);
  border-radius: 12px;
  box-shadow: var(--sch-shadow-card);
  border: 1px solid var(--sch-rule);
  padding: 0;
  margin-top: 0;
  overflow: hidden;
}

.page-section--schedule .schedule-card--calendar {
  overflow: hidden;
}

.page-section--schedule .schedule-card__header,
.page-section--schedule .schedule-panel__header {
  padding: 16px 18px 14px;
  border-bottom: 1px solid var(--sch-rule);
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(180deg, #fff 0%, #fff 75%, rgba(247, 245, 240, 0.5) 100%);
}

.page-section--schedule .schedule-card__header h3,
.page-section--schedule .schedule-panel__header h3 {
  color: var(--sch-ink);
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
  font-size: 15px;
}

.page-section--schedule .schedule-card__header .text-muted,
.page-section--schedule .schedule-panel__header .text-muted {
  color: var(--sch-ink-4);
  font-size: 12.5px;
}

/* Override old .schedule-eyebrow inside cards */
.page-section--schedule .schedule-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sch-accent);
  margin: 0 0 4px;
}

.page-section--schedule .schedule-section-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.page-section--schedule .schedule-section-title__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  background: var(--sch-accent-bg);
  color: var(--sch-accent);
  border-radius: 8px;
  box-shadow: none;
}

.page-section--schedule .schedule-section-title__icon svg {
  width: 16px;
  height: 16px;
}

/* Calendar card header buttons (export, sync, enlarge) */
.page-section--schedule .schedule-card__header .btn,
.page-section--schedule .schedule-card__header .btn-outline,
.page-section--schedule .schedule-card__header .btn-sm {
  background: var(--sch-card);
  border: 1px solid var(--sch-rule-strong);
  border-radius: 7px;
  color: var(--sch-ink-3);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--sch-shadow-sm);
  transition: all 0.15s;
}

.page-section--schedule .schedule-card__header .btn:hover,
.page-section--schedule .schedule-card__header .btn-outline:hover,
.page-section--schedule .schedule-card__header .btn-sm:hover {
  background: var(--sch-hover);
  color: var(--sch-ink-2);
}

/* --- 7. Today strip --- */

.page-section--schedule .schedule-today-strip {
  background: linear-gradient(180deg, var(--sch-inset) 0%, rgba(237, 234, 227, 0.82) 100%);
  border-top: 1px solid var(--sch-rule);
  border-bottom: 1px solid var(--sch-rule);
  border-radius: 0;
  padding: 14px 18px;
  margin: 0;
}

.page-section--schedule .schedule-today-strip__header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 10px;
}

.page-section--schedule .schedule-today-strip__summary {
  font-size: 12px;
  color: var(--sch-ink-3);
}

.page-section--schedule .today-visit-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.page-section--schedule .today-visit-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 12px;
  background: var(--sch-card);
  border: 1px solid var(--sch-rule);
  border-radius: 9px;
  font-size: 12.5px;
  transition: background 0.15s;
  border-left-width: 3px;
  box-shadow: var(--sch-shadow-sm);
}

.page-section--schedule .today-visit-item:hover {
  background: var(--sch-hover);
}

.page-section--schedule .today-visit-item--inspection {
  border-left-color: var(--sch-type-inspection);
}

.page-section--schedule .today-visit-item--fire_door {
  border-left-color: var(--sch-type-firedoor);
}

.page-section--schedule .today-visit-item--remedial {
  border-left-color: var(--sch-type-remedial);
}

.page-section--schedule .today-visit-item--pre_booking {
  border-left-color: var(--sch-type-prebooking);
}

.page-section--schedule .today-visit-item__time {
  font-weight: 600;
  color: var(--sch-ink-3);
  flex-shrink: 0;
  min-width: 70px;
}

.page-section--schedule .today-visit-item__label {
  color: var(--sch-ink);
  flex: 1;
  min-width: 0;
}

.page-section--schedule .today-visit-item__label .btn-tiny {
  color: var(--sch-accent);
  font-size: 11px;
  font-weight: 500;
  text-decoration: none;
  margin-left: 8px;
}

.page-section--schedule .today-visit-item__label .table-subtext {
  display: block;
  font-size: 11px;
  color: var(--sch-ink-4);
}

/* --- 8. Mobile bar --- */

.page-section--schedule .schedule-mobile-bar {
  display: none;
  background: var(--sch-card);
  border-bottom: 1px solid var(--sch-rule);
  padding: 12px 16px;
}

.page-section--schedule .schedule-mobile-bar__copy .schedule-eyebrow {
  color: var(--sch-accent);
}

.page-section--schedule .schedule-mobile-bar__range {
  color: var(--sch-ink);
  font-family: var(--font-display);
  font-weight: 700;
}

/* --- 9. Toolbar / filter form --- */

.page-section--schedule .schedule-toolbar,
.page-section--schedule .table-toolbar.schedule-toolbar {
  border-top: 1px solid var(--sch-rule);
  border-bottom: 1px solid var(--sch-rule);
  background: linear-gradient(180deg, rgba(237, 234, 227, 0.95) 0%, rgba(237, 234, 227, 0.82) 100%);
  padding: 14px 18px;
  margin: 0;
  border-radius: 0;
}

.page-section--schedule .schedule-range-form {
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  margin: 0;
}

.page-section--schedule .schedule-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
}

.page-section--schedule .schedule-filter-row label span,
.page-section--schedule .schedule-filter-start span,
.page-section--schedule .schedule-filter-end span {
  color: var(--sch-ink-3);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.page-section--schedule .schedule-filter-row input[type="date"],
.page-section--schedule .schedule-filter-row input[type="search"],
.page-section--schedule .schedule-filter-row select {
  background: var(--sch-card);
  border: 1px solid var(--sch-rule-strong);
  border-radius: 7px;
  color: var(--sch-ink);
  font-size: 12.5px;
  padding: 7px 10px;
}

.page-section--schedule .schedule-filter-row input[type="date"]:focus,
.page-section--schedule .schedule-filter-row input[type="search"]:focus,
.page-section--schedule .schedule-filter-row select:focus {
  outline: 2px solid var(--sch-accent);
  outline-offset: 1px;
}

.page-section--schedule .schedule-preset {
  background: var(--sch-card);
  border: 1px solid var(--sch-rule-strong);
  border-radius: 6px;
  color: var(--sch-ink-3);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.page-section--schedule .schedule-preset:hover {
  background: var(--sch-hover);
  color: var(--sch-ink-2);
}

.page-section--schedule .schedule-preset.is-active {
  background: #1a1815;
  color: #ffffff;
  border-color: #1a1815;
}

.page-section--schedule .schedule-filter-types label span {
  background: var(--sch-card);
  border: 1px solid var(--sch-rule-strong);
  border-radius: 6px;
  color: var(--sch-ink-3);
  font-size: 12px;
  font-weight: 500;
  padding: 5px 10px;
  cursor: pointer;
  transition: all 0.15s;
}

.page-section--schedule .schedule-filter-types label:hover span {
  background: var(--sch-hover);
  color: var(--sch-ink-2);
}

.page-section--schedule .schedule-filter-types input[type='checkbox']:checked + span {
  background: #1a1815;
  color: #ffffff;
  border-color: #1a1815;
}

.page-section--schedule .schedule-filter-types input[type='checkbox']:focus-visible + span {
  outline: 2px solid var(--sch-accent);
  outline-offset: 1px;
}

.page-section--schedule .schedule-filter-apply,
.page-section--schedule .schedule-filter-apply.btn {
  background: var(--sch-ink);
  color: #fff;
  border-color: var(--sch-ink);
  border-radius: 7px;
  font-size: 12.5px;
  font-weight: 500;
}

.page-section--schedule .schedule-filter-apply:hover {
  background: var(--sch-ink-2);
}

.page-section--schedule .schedule-filter-reset {
  color: var(--sch-ink-3);
}

.page-section--schedule .schedule-filter-dirty {
  color: var(--sch-accent);
}

.page-section--schedule .schedule-helper {
  color: var(--sch-ink-4);
}

.page-section--schedule .schedule-filter-summary {
  color: var(--sch-ink-3);
  font-size: 12px;
}

/* Filter chips (JS-rendered) */
.page-section--schedule .schedule-filter-chip {
  background: var(--sch-card);
  border: 1px solid var(--sch-rule-strong);
  color: var(--sch-ink-3);
  border-radius: 999px;
  font-size: 11.5px;
}

.page-section--schedule .schedule-filter-chip:hover {
  background: var(--sch-hover);
}

/* Mobile filter sheet */
.page-section--schedule .schedule-mobile-sheet-header {
  display: none;
}

.page-section--schedule .schedule-mobile-sheet-header {
  border-bottom: 1px solid var(--sch-rule);
}

.page-section--schedule .schedule-mobile-sheet-header h4 {
  color: var(--sch-ink);
}

.page-section--schedule .schedule-mobile-overlay {
  display: none;
}

/* --- 10. Viewbar --- */

.page-section--schedule .schedule-viewbar {
  padding: 10px 18px;
  border-top: 1px solid var(--sch-rule);
  background: var(--sch-card);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.page-section--schedule .schedule-view-tabs {
  display: inline-flex;
  background: var(--sch-inset);
  border-radius: 8px;
  padding: 3px;
  gap: 2px;
}

.page-section--schedule .schedule-view-tab {
  padding: 5px 14px;
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--sch-ink-3);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: all 0.15s;
}

.page-section--schedule .schedule-view-tab:hover {
  color: var(--sch-ink-2);
}

.page-section--schedule .schedule-view-tab.is-active {
  background: var(--sch-card);
  color: var(--sch-ink);
  box-shadow: var(--sch-shadow-sm);
}

.page-section--schedule .schedule-viewbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.page-section--schedule .schedule-range-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--sch-ink-2);
  font-family: var(--font-display);
}

.page-section--schedule .schedule-nav-btn {
  color: var(--sch-ink-3);
  border: 1px solid var(--sch-rule-strong);
  background: var(--sch-card);
  border-radius: 7px;
  transition: all 0.15s;
}

.page-section--schedule .schedule-nav-btn:hover {
  background: var(--sch-hover);
  color: var(--sch-ink);
}

.page-section--schedule .schedule-enlarge-btn {
  background: var(--sch-ink);
  color: #fff;
  border-color: var(--sch-ink);
  border-radius: 7px;
}

.page-section--schedule .schedule-enlarge-btn:hover {
  background: var(--sch-ink-2);
}

/* --- 11. Calendar board (shared) --- */

.page-section--schedule .schedule-calendar {
  background: linear-gradient(180deg, rgba(237, 234, 227, 0.85) 0%, rgba(237, 234, 227, 0.72) 100%);
  border-top: 1px solid var(--sch-rule);
  border-bottom: 1px solid var(--sch-rule);
  min-height: 200px;
}

.page-section--schedule .schedule-calendar__empty {
  color: var(--sch-ink-4);
  padding: 40px 20px;
  text-align: center;
}

.page-section--schedule .schedule-calendar--loading {
  opacity: 0.5;
}

/* --- 12. Week view (planner) --- */

.page-section--schedule .schedule-planner {
  background: transparent;
}

.page-section--schedule .schedule-planner__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.page-section--schedule .schedule-planner__corner {
  background: var(--sch-inset);
  color: var(--sch-ink-4);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-right: 1px solid var(--sch-rule);
  border-bottom: 1px solid var(--sch-rule);
}

.page-section--schedule .schedule-planner__day-header {
  color: var(--sch-ink-3);
  font-family: var(--font-display);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  border-bottom: 1px solid var(--sch-rule);
  border-right: 1px solid var(--sch-rule);
  text-align: center;
  padding: 8px 4px;
  background: rgba(255, 255, 255, 0.94);
}

.page-section--schedule .schedule-planner__day-header--today {
  color: var(--sch-accent);
  background: var(--sch-accent-bg);
}

.page-section--schedule .schedule-planner__day-header--weekend {
  background: var(--sch-inset);
}

.page-section--schedule .schedule-planner__member {
  background: var(--sch-inset);
  color: var(--sch-ink-2);
  font-size: 12px;
  font-weight: 600;
  border-right: 1px solid var(--sch-rule);
  border-bottom: 1px solid var(--sch-rule);
  padding: 8px 10px;
  white-space: nowrap;
}

.page-section--schedule .schedule-planner__cell {
  border-right: 1px solid var(--sch-rule);
  border-bottom: 1px solid var(--sch-rule);
  background: var(--sch-card);
  vertical-align: top;
  padding: 4px;
  min-height: 60px;
}

.page-section--schedule .schedule-planner__cell--today {
  background: var(--sch-accent-bg);
}

.page-section--schedule .schedule-planner__cell--weekend {
  background: var(--sch-inset);
}

.page-section--schedule .schedule-planner__cell--dragover {
  background: rgba(196, 149, 16, 0.14);
  border-color: var(--sch-accent-border);
}

.page-section--schedule .schedule-planner-card {
  background: var(--sch-card);
  border: 1px solid var(--sch-rule);
  border-radius: 7px;
  padding: 6px 8px;
  margin-bottom: 3px;
  font-size: 11px;
  cursor: grab;
  transition: box-shadow 0.15s;
  border-left-width: 3px;
}

.page-section--schedule .schedule-planner-card:hover {
  box-shadow: var(--sch-shadow-sm);
}

.page-section--schedule .schedule-planner-card__title {
  color: var(--sch-ink);
  font-weight: 600;
  font-size: 11px;
}

.page-section--schedule .schedule-planner-card__meta {
  color: var(--sch-ink-4);
  font-size: 10px;
}

/* Week view — type colours */
.page-section--schedule .schedule-planner-card.schedule-event--inspection {
  border-left-color: var(--sch-type-inspection);
}

.page-section--schedule .schedule-planner-card.schedule-event--pre-booking,
.page-section--schedule .schedule-planner-card.schedule-event--pre_booking {
  border-left-color: var(--sch-type-prebooking);
}

.page-section--schedule .schedule-planner-card.schedule-event--fire-door,
.page-section--schedule .schedule-planner-card.schedule-event--fire_door {
  border-left-color: var(--sch-type-firedoor);
}

.page-section--schedule .schedule-planner-card.schedule-event--remedial {
  border-left-color: var(--sch-type-remedial);
}

/* --- 13. Month view --- */

.page-section--schedule .schedule-planner--month {
  background: var(--sch-card);
}

.page-section--schedule .schedule-month__header {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--sch-rule);
}

.page-section--schedule .schedule-month__weekday {
  color: var(--sch-ink-4);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  text-align: center;
  padding: 8px 4px;
}

.page-section--schedule .schedule-month__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
}

.page-section--schedule .schedule-month__cell {
  background: var(--sch-card);
  border-right: 1px solid var(--sch-rule);
  border-bottom: 1px solid var(--sch-rule);
  min-height: 90px;
  position: relative;
  padding: 0;
}

.page-section--schedule .schedule-month__cell--today {
  background: var(--sch-accent-bg);
}

.page-section--schedule .schedule-month__cell--weekend {
  background: var(--sch-inset);
}

.page-section--schedule .schedule-month__cell--outside {
  opacity: 0.4;
}

.page-section--schedule .schedule-month__cell--dragover {
  background: rgba(196, 149, 16, 0.14);
  border-color: var(--sch-accent-border);
}

.page-section--schedule .schedule-month__cell-top {
  padding: 6px 8px 2px;
}

.page-section--schedule .schedule-month__day-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 12px;
  font-weight: 600;
  color: var(--sch-ink-2);
  background: transparent;
  border: none;
  cursor: pointer;
  transition: background 0.15s;
}

.page-section--schedule .schedule-month__day-button:hover {
  background: var(--sch-hover);
}

.page-section--schedule .schedule-month__day-button--today {
  background: var(--sch-accent-bg);
  color: var(--sch-accent);
  box-shadow: inset 0 0 0 1.5px var(--sch-accent-border);
}

.page-section--schedule .schedule-month__events {
  padding: 2px 4px 4px;
}

.page-section--schedule .schedule-month-chip {
  display: block;
  padding: 2px 6px;
  margin-bottom: 2px;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--sch-ink-2);
  background: var(--sch-card);
  border: 1px solid var(--sch-rule);
  border-left-width: 3px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: grab;
  transition: background 0.1s;
}

.page-section--schedule .schedule-month-chip:hover {
  background: var(--sch-hover);
}

/* Month view — type colours */
.page-section--schedule .schedule-month-chip.schedule-event--inspection {
  border-left-color: var(--sch-type-inspection);
}

.page-section--schedule .schedule-month-chip.schedule-event--pre-booking,
.page-section--schedule .schedule-month-chip.schedule-event--pre_booking {
  border-left-color: var(--sch-type-prebooking);
}

.page-section--schedule .schedule-month-chip.schedule-event--fire-door,
.page-section--schedule .schedule-month-chip.schedule-event--fire_door {
  border-left-color: var(--sch-type-firedoor);
}

.page-section--schedule .schedule-month-chip.schedule-event--remedial {
  border-left-color: var(--sch-type-remedial);
}

.page-section--schedule .schedule-month__more {
  display: none;
  font-size: 10px;
  color: var(--sch-accent);
  font-weight: 600;
  padding: 2px 6px;
  cursor: pointer;
}

/* --- 14. Day view --- */

.page-section--schedule .schedule-planner--day {
  padding: 16px 20px;
  background: var(--sch-inset);
}

.page-section--schedule .schedule-day__title {
  color: var(--sch-ink);
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 12px;
}

.page-section--schedule .schedule-day__list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.page-section--schedule .schedule-day-row {
  display: flex;
  gap: 14px;
  padding: 12px 16px;
  background: var(--sch-card);
  border: 1px solid var(--sch-rule);
  border-radius: 10px;
  border-left-width: 4px;
  transition: box-shadow 0.15s;
}

.page-section--schedule .schedule-day-row:hover {
  box-shadow: var(--sch-shadow-sm);
}

.page-section--schedule .schedule-day-row__time {
  color: var(--sch-ink-3);
  font-size: 12px;
  font-weight: 600;
  min-width: 80px;
  flex-shrink: 0;
}

.page-section--schedule .schedule-day-row__body {
  flex: 1;
  min-width: 0;
}

.page-section--schedule .schedule-day-row__title {
  color: var(--sch-ink);
  font-size: 13px;
  font-weight: 600;
}

.page-section--schedule .schedule-day-row__meta {
  color: var(--sch-ink-4);
  font-size: 11.5px;
}

/* Day view — type colours */
.page-section--schedule .schedule-day-row.schedule-event--inspection {
  border-left-color: var(--sch-type-inspection);
}

.page-section--schedule .schedule-day-row.schedule-event--pre-booking,
.page-section--schedule .schedule-day-row.schedule-event--pre_booking {
  border-left-color: var(--sch-type-prebooking);
}

.page-section--schedule .schedule-day-row.schedule-event--fire-door,
.page-section--schedule .schedule-day-row.schedule-event--fire_door {
  border-left-color: var(--sch-type-firedoor);
}

.page-section--schedule .schedule-day-row.schedule-event--remedial {
  border-left-color: var(--sch-type-remedial);
}

/* --- 14b. List / agenda view --- */

.page-section--schedule .schedule-planner--list {
  padding: 8px 0;
}

.page-section--schedule .schedule-list__group {
  margin-bottom: 4px;
}

.page-section--schedule .schedule-list__date {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 8px 16px 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--sch-ink);
  background: var(--sch-bg);
  border-bottom: 1px solid var(--sch-rule);
}

.page-section--schedule .schedule-list__row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  border-bottom: 1px solid var(--sch-rule-soft, rgba(0, 0, 0, 0.05));
  cursor: pointer;
  transition: background 0.1s;
}

.page-section--schedule .schedule-list__row:hover {
  background: var(--sch-bg-hover, rgba(0, 0, 0, 0.025));
}

.page-section--schedule .schedule-list__dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: var(--sch-type-prebooking);
}

.page-section--schedule .schedule-list__row.schedule-event--inspection .schedule-list__dot {
  background: var(--sch-type-inspection);
}

.page-section--schedule .schedule-list__row.schedule-event--remedial .schedule-list__dot {
  background: var(--sch-type-remedial);
}

.page-section--schedule .schedule-list__row.schedule-event--fire-door .schedule-list__dot,
.page-section--schedule .schedule-list__row.schedule-event--fire_door .schedule-list__dot {
  background: var(--sch-type-firedoor);
}

.page-section--schedule .schedule-list__time {
  font-size: 11px;
  font-weight: 600;
  color: var(--sch-ink-3);
  min-width: 90px;
  flex-shrink: 0;
}

.page-section--schedule .schedule-list__type {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--sch-ink-4);
  min-width: 75px;
  flex-shrink: 0;
}

.page-section--schedule .schedule-list__title {
  font-size: 13px;
  font-weight: 600;
  color: var(--sch-ink);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.page-section--schedule .schedule-list__meta {
  font-size: 11px;
  color: var(--sch-ink-4);
  flex-shrink: 0;
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .page-section--schedule .schedule-list__row {
    flex-wrap: wrap;
    gap: 4px 8px;
    padding: 10px 14px;
  }
  .page-section--schedule .schedule-list__time {
    min-width: auto;
  }
  .page-section--schedule .schedule-list__type {
    min-width: auto;
  }
  .page-section--schedule .schedule-list__title {
    flex-basis: 100%;
    order: 10;
  }
  .page-section--schedule .schedule-list__meta {
    flex-basis: 100%;
    order: 11;
    max-width: none;
  }
}

/* --- 15. Drag states (all views) --- */

.page-section--schedule .schedule-event--dragging {
  opacity: 0.5;
  box-shadow: var(--sch-shadow-md);
}

.page-section--schedule .schedule-event--highlight {
  box-shadow: 0 0 0 3px var(--sch-accent-border);
}

.page-section--schedule .schedule-event--conflict {
  box-shadow: 0 0 0 3px var(--sch-red-border);
}

.page-section--schedule .schedule-event--actionable,
.page-section--schedule .schedule-planner-card.schedule-event--actionable,
.page-section--schedule .schedule-day-row.schedule-event--actionable,
.page-section--schedule .schedule-month-chip.schedule-event--actionable,
.page-section--schedule .schedule-event.schedule-event--actionable {
  cursor: pointer;
}

/* --- 16. Column board (legacy list view, kept as fallback) --- */

.page-section--schedule .schedule-calendar__column {
  border-right: 1px solid var(--sch-rule);
  background: var(--sch-card);
}

.page-section--schedule .schedule-calendar__heading {
  color: var(--sch-ink-2);
  font-family: var(--font-display);
  font-size: 12px;
  font-weight: 700;
  border-bottom: 1px solid var(--sch-rule);
  padding: 10px 12px;
  background: var(--sch-inset);
}

.page-section--schedule .schedule-calendar__column--dragover {
  background: var(--sch-accent-bg);
  border-color: var(--sch-accent-border);
}

.page-section--schedule .schedule-event {
  background: var(--sch-card);
  border: 1px solid var(--sch-rule);
  border-radius: 8px;
  box-shadow: var(--sch-shadow-sm);
  border-left-width: 3px;
}

.page-section--schedule .schedule-event__title {
  color: var(--sch-ink);
}

.page-section--schedule .schedule-event__time,
.page-section--schedule .schedule-event__meta,
.page-section--schedule .schedule-event__client {
  color: var(--sch-ink-4);
}

.page-section--schedule .schedule-event__status {
  color: var(--sch-ink-3);
}

/* Column board — type colours */
.page-section--schedule .schedule-event--inspection {
  border-left-color: var(--sch-type-inspection);
}

.page-section--schedule .schedule-event--pre-booking,
.page-section--schedule .schedule-event--pre_booking {
  border-left-color: var(--sch-type-prebooking);
}

.page-section--schedule .schedule-event--fire-door,
.page-section--schedule .schedule-event--fire_door {
  border-left-color: var(--sch-type-firedoor);
}

.page-section--schedule .schedule-event--remedial {
  border-left-color: var(--sch-type-remedial);
}

/* --- 17. Sidebar accordion panels --- */

.page-section--schedule .schedule-accordion {
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(180deg, #fff 0%, #fff 80%, rgba(247, 245, 240, 0.35) 100%);
}

.page-section--schedule .schedule-accordion__summary {
  padding: 16px 18px;
  border-bottom: 1px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  list-style: none;
  transition: background 0.15s;
}

.page-section--schedule .schedule-accordion__summary:hover {
  background: var(--sch-hover);
}

.page-section--schedule .schedule-accordion__summary::-webkit-details-marker {
  display: none;
}

.page-section--schedule .schedule-accordion__summary:focus-visible {
  outline: 2px solid var(--sch-accent);
  outline-offset: -2px;
}

.page-section--schedule .schedule-accordion[open] .schedule-accordion__summary {
  border-bottom-color: var(--sch-rule);
}

.page-section--schedule .schedule-accordion__aside {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.page-section--schedule .schedule-accordion__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 22px;
  padding: 0 6px;
  background: var(--sch-inset);
  border: 1px solid var(--sch-rule-strong);
  border-radius: 6px;
  color: var(--sch-ink-2);
  font-size: 11px;
  font-weight: 700;
}

.page-section--schedule .schedule-accordion__chevron {
  width: 14px;
  height: 14px;
  color: var(--sch-ink-4);
  transition: transform 0.2s;
}

.page-section--schedule .schedule-accordion[open] .schedule-accordion__chevron {
  transform: rotate(90deg);
}

.page-section--schedule .schedule-accordion__body {
  padding: 16px 18px 18px;
}

.page-section--schedule .schedule-accordion__body .text-muted {
  color: var(--sch-ink-4);
}

/* Pipeline stats */
.page-section--schedule .schedule-card__stats {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.page-section--schedule .schedule-stat {
  background: var(--sch-inset);
  border: 1px solid var(--sch-rule);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.page-section--schedule .schedule-stat__label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.page-section--schedule .schedule-stat__label-text {
  color: var(--sch-ink-3);
  font-size: 12px;
  font-weight: 500;
}

.page-section--schedule .schedule-stat__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  flex-shrink: 0;
}

.page-section--schedule .schedule-stat__icon svg {
  width: 14px;
  height: 14px;
}

.page-section--schedule .schedule-stat strong {
  color: var(--sch-ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.page-section--schedule .schedule-stat--inspection .schedule-stat__icon {
  background: var(--sch-blue-bg);
  color: var(--sch-blue);
}

.page-section--schedule .schedule-stat--firedoor .schedule-stat__icon {
  background: rgba(107, 70, 193, 0.08);
  color: #6b46c1;
}

.page-section--schedule .schedule-stat--remedial .schedule-stat__icon {
  background: var(--sch-green-bg);
  color: var(--sch-green);
}

.page-section--schedule .schedule-stat--prebooking .schedule-stat__icon {
  background: var(--sch-accent-bg);
  color: var(--sch-accent);
}

/* Inspector load table */
.page-section--schedule .schedule-panel-table {
  overflow-x: auto;
}

.page-section--schedule .inspector-load-table {
  width: 100%;
  border-collapse: collapse;
}

.page-section--schedule .inspector-load-table thead th {
  color: var(--sch-ink-4);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 8px 10px;
  border-bottom: 1px solid var(--sch-rule);
  text-align: left;
}

.page-section--schedule .inspector-load-table tbody td {
  padding: 8px 10px;
  font-size: 12px;
  color: var(--sch-ink-2);
  border-bottom: 1px solid var(--sch-rule);
}

.page-section--schedule .inspector-load-status--over {
  color: var(--sch-red);
  font-weight: 600;
}

.page-section--schedule .inspector-load-status--busy {
  color: var(--sch-accent);
  font-weight: 600;
}

.page-section--schedule .inspector-load-status--ok {
  color: var(--sch-blue);
}

.page-section--schedule .inspector-load-status--free {
  color: var(--sch-green);
}

/* Sidebar list items (unassigned jobs, open pre-bookings) */
.page-section--schedule .schedule-accordion__body .schedule-event {
  margin-bottom: 8px;
}

.page-section--schedule .schedule-accordion__body .schedule-event:last-child {
  margin-bottom: 0;
}

/* --- 18. Legend --- */

.page-section--schedule .schedule-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 20px;
  border-top: 1px solid var(--sch-rule);
  background: var(--sch-card);
}

.page-section--schedule .schedule-legend__item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--sch-ink-3);
  font-size: 11px;
  font-weight: 500;
}

.page-section--schedule .schedule-legend__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.page-section--schedule .schedule-legend__dot--inspection {
  background: var(--sch-type-inspection);
}

.page-section--schedule .schedule-legend__dot--prebooking {
  background: var(--sch-type-prebooking);
}

.page-section--schedule .schedule-legend__dot--firedoor {
  background: var(--sch-type-firedoor);
}

.page-section--schedule .schedule-legend__dot--remedial {
  background: var(--sch-type-remedial);
}



/* --- 19. Focus states --- */

.page-section--schedule :focus-visible {
  outline: 2px solid var(--sch-accent);
  outline-offset: 2px;
}

/* --- 20. Calendar export/sync buttons in header --- */

.page-section--schedule .calendar-sync-trigger,
.page-section--schedule [data-calendar-export-btn] {
  background: var(--sch-card);
  border: 1px solid var(--sch-rule-strong);
  border-radius: 7px;
  color: var(--sch-ink-3);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--sch-shadow-sm);
  transition: all 0.15s;
}

.page-section--schedule .calendar-sync-trigger:hover,
.page-section--schedule [data-calendar-export-btn]:hover {
  background: var(--sch-hover);
  color: var(--sch-ink-2);
}

/* --- 21. Modals --- */

/* Day details modal */
.schedule-day-details-modal .modal__title {
  font-family: var(--font-display);
  font-weight: 700;
}

.schedule-day-details-modal .schedule-day-details-row {
  display: flex;
  gap: 14px;
  padding: 12px 16px;
  background: var(--sch-card);
  border: 1px solid var(--sch-rule);
  border-radius: 10px;
  margin-bottom: 8px;
  border-left-width: 4px;
}

.schedule-day-details-modal .schedule-day-details-row__time {
  color: var(--sch-ink-3);
  font-size: 12px;
  font-weight: 600;
  min-width: 80px;
}

.schedule-day-details-modal .schedule-day-details-row__title {
  color: var(--sch-ink);
  font-size: 13px;
  font-weight: 600;
}

.schedule-day-details-modal .schedule-day-details-row__meta {
  color: var(--sch-ink-4);
  font-size: 11.5px;
}

/* --- 22. Responsive --- */

@media (max-width: 1024px) {
  .page-section--schedule .sch-header {
    padding: 16px 20px 15px;
  }

  .page-section--schedule .sch-header__main {
    flex-direction: column;
    gap: 12px;
  }

  .page-section--schedule .sch-header__actions {
    justify-content: flex-start;
  }

  .page-section--schedule .sch-stats {
    padding: 14px 20px 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-section--schedule .schedule-flash {
    margin: 0 20px 12px;
  }

  .page-section--schedule .schedule-shell {
    grid-template-columns: 1fr;
    padding: 14px 20px 0;
  }

  .page-section--schedule .schedule-secondary {
    position: static;
  }

  .page-section--schedule .schedule-card__header {
    padding: 14px 16px 12px;
  }

  .page-section--schedule .schedule-today-strip {
    padding: 12px 16px;
  }

  .page-section--schedule .schedule-viewbar {
    padding: 8px 16px;
  }

  .page-section--schedule .schedule-toolbar,
  .page-section--schedule .table-toolbar.schedule-toolbar {
    padding: 12px 16px;
  }

  .page-section--schedule .schedule-accordion__summary {
    padding: 14px 16px;
  }

  .page-section--schedule .schedule-accordion__body {
    padding: 14px 16px;
  }
}

@media (max-width: 900px) {
  .page-section--schedule .sch-header {
    padding: 14px 16px;
  }

  .page-section--schedule .sch-header__title {
    font-size: 19px;
  }

  .page-section--schedule .sch-stats {
    display: flex;
    flex-direction: row;
    gap: 12px;
    padding: 14px 16px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-snap-type: x proximity;
    scroll-padding-left: 16px;
    scroll-padding-right: 16px;
    flex-wrap: nowrap;
  }

  .page-section--schedule .sch-stats::-webkit-scrollbar {
    display: none;
  }

  .page-section--schedule .sch-stat {
    flex: 0 0 min(240px, 76vw);
    scroll-snap-align: start;
  }

  .page-section--schedule .sch-stat__value {
    font-size: 24px;
  }

  .page-section--schedule .schedule-flash {
    margin: 0 16px 12px;
  }

  .page-section--schedule .schedule-shell {
    grid-template-columns: 1fr;
    padding: 12px 16px 0;
    gap: 16px;
  }

  .page-section--schedule .schedule-planner__scroll {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .page-section--schedule .schedule-planner__day-header,
  .page-section--schedule .schedule-planner__cell {
    min-width: 120px;
  }

  .page-section--schedule .schedule-planner__member {
    min-width: 90px;
  }

  .page-section--schedule .schedule-card__stats {
    grid-template-columns: 1fr;
  }

  .page-section--schedule .schedule-accordion__summary {
    padding: 12px 16px;
  }

  .page-section--schedule .schedule-accordion__body {
    padding: 12px 16px;
  }
}

/* --- 23. Schedule surface refresh --- */

.page-section--schedule .schedule-workspace {
  gap: 0;
}

.page-section--schedule .schedule-shell {
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 14px;
  padding: 14px 28px 0;
}

.page-section--schedule .schedule-main {
  min-width: 0;
}

.page-section--schedule .schedule-secondary {
  gap: 12px;
  top: 14px;
}

.page-section--schedule .schedule-workspace > .ipi-page-header {
  padding: 24px 28px 20px;
  background: var(--sch-card);
  border-bottom: 1px solid var(--sch-rule);
}

.page-section--schedule .ipi-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 0;
  background: transparent;
  border: 0;
}

.page-section--schedule .ipi-ph-eyebrow {
  margin: 0 0 4px;
  color: var(--sch-accent);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.page-section--schedule .ipi-ph-title {
  margin: 0 0 5px;
  color: var(--sch-ink);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 760px;
}

.page-section--schedule .ipi-ph-sub {
  margin: 0;
  color: var(--sch-ink-4);
  font-size: 13px;
  font-weight: 300;
  line-height: 1.5;
  max-width: 760px;
}

.page-section--schedule .ipi-ph-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 4px;
  flex-shrink: 0;
}

.page-section--schedule .ipi-ph-note {
  color: var(--sch-ink-4);
  font-size: 12px;
}

.page-section--schedule .btn svg,
.page-section--schedule .btn .sch-header-btn__icon svg {
  width: 13px;
  height: 13px;
}

.page-section--schedule .btn.btn-secondary {
  background: var(--sch-card);
  border-color: var(--sch-rule-strong);
  color: var(--sch-ink-2);
  box-shadow: var(--sch-shadow-sm);
}

.page-section--schedule .btn.btn-secondary:hover {
  background: var(--sch-hover);
}

.page-section--schedule .ipi-stats-strip {
  display: none;
}

.page-section--schedule .schedule-flash {
  margin: 0 28px 14px;
}

.page-section--schedule .schedule-card,
.page-section--schedule .schedule-panel,
.page-section--schedule .schedule-card--bookings {
  background: var(--sch-card);
  border: 1px solid var(--sch-rule);
  border-radius: 14px;
  box-shadow: var(--sch-shadow-card);
  overflow: hidden;
}

.page-section--schedule .schedule-card__header,
.page-section--schedule .schedule-panel__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--sch-rule);
  background: linear-gradient(180deg, #fff 0%, #fff 74%, rgba(244, 241, 234, 0.45) 100%);
}

.page-section--schedule .schedule-card__header h3,
.page-section--schedule .schedule-panel__header h3 {
  margin: 0;
  color: var(--sch-ink);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.015em;
}

.page-section--schedule .schedule-card__header .text-muted,
.page-section--schedule .schedule-panel__header .text-muted {
  color: var(--sch-ink-4);
  font-size: 12px;
}

.page-section--schedule .schedule-section-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.page-section--schedule .schedule-section-title__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--sch-accent-bg);
  color: var(--sch-accent);
  box-shadow: none;
}

.page-section--schedule .schedule-section-title__icon svg {
  width: 16px;
  height: 16px;
}

.page-section--schedule .schedule-card__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.page-section--schedule .schedule-card__header .btn,
.page-section--schedule .schedule-card__header .btn-outline,
.page-section--schedule .schedule-card__header .btn-sm {
  background: var(--sch-card);
  border: 1px solid var(--sch-rule-strong);
  border-radius: 7px;
  color: var(--sch-ink-3);
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--sch-shadow-sm);
}

.page-section--schedule .schedule-card__header .btn:hover,
.page-section--schedule .schedule-card__header .btn-outline:hover,
.page-section--schedule .schedule-card__header .btn-sm:hover {
  background: var(--sch-hover);
  color: var(--sch-ink-2);
}

.page-section--schedule .schedule-toolbar,
.page-section--schedule .table-toolbar.schedule-toolbar {
  margin: 0;
  padding: 9px 14px 10px;
  border-top: 1px solid var(--sch-rule);
  border-bottom: 1px solid var(--sch-rule);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 246, 240, 0.95) 100%);
}

.page-section--schedule .schedule-viewbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 0 6px;
  border-bottom: 1px solid var(--sch-rule);
  background: transparent;
}

.page-section--schedule .schedule-view-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 8px;
  background: var(--sch-inset);
}

.page-section--schedule .schedule-view-tab {
  min-width: 56px;
  padding: 5px 13px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--sch-ink-3);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.page-section--schedule .schedule-view-tab:hover {
  color: var(--sch-ink-2);
}

.page-section--schedule .schedule-view-tab.is-active {
  background: var(--sch-card);
  color: var(--sch-ink);
  box-shadow: var(--sch-shadow-sm);
}

.page-section--schedule .schedule-viewbar__right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-section--schedule .schedule-range-label {
  color: var(--sch-ink-2);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
}

.page-section--schedule .schedule-nav {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.page-section--schedule .schedule-nav-btn,
.page-section--schedule .schedule-enlarge-btn {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 7px;
}

.page-section--schedule .schedule-nav-btn {
  background: var(--sch-card);
  border: 1px solid var(--sch-rule-strong);
  color: var(--sch-ink-3);
}

.page-section--schedule .schedule-nav-btn:hover {
  background: var(--sch-hover);
  color: var(--sch-ink);
}

.page-section--schedule .schedule-enlarge-btn {
  background: var(--sch-ink);
  border-color: var(--sch-ink);
  color: #fff;
}

.page-section--schedule .schedule-enlarge-btn:hover {
  background: var(--sch-ink-2);
}

.page-section--schedule .schedule-range-form {
  padding-top: 6px;
}

.page-section--schedule .schedule-filter-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-section--schedule .schedule-filter-row--compact-main {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
}

.page-section--schedule .schedule-filter-row--compact-main label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.page-section--schedule .schedule-filter-start,
.page-section--schedule .schedule-filter-end {
  flex: 0 0 138px;
}

.page-section--schedule .schedule-filter-inspector {
  flex: 0 0 172px;
}

.page-section--schedule .schedule-presets {
  display: flex;
  flex-wrap: wrap;
  align-self: flex-end;
  gap: 5px;
}

.page-section--schedule .schedule-filter-search {
  position: relative;
  flex: 1 1 240px;
  min-width: 180px;
}

.page-section--schedule .schedule-filter-row label span,
.page-section--schedule .schedule-filter-start span,
.page-section--schedule .schedule-filter-end span {
  color: var(--sch-ink-3);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.page-section--schedule .schedule-filter-row input[type="date"],
.page-section--schedule .schedule-filter-row input[type="search"],
.page-section--schedule .schedule-filter-row select {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid var(--sch-rule-strong);
  border-radius: 7px;
  background: var(--sch-card);
  color: var(--sch-ink);
  font-size: 12.5px;
}

.page-section--schedule .schedule-filter-row input[type="date"]:focus,
.page-section--schedule .schedule-filter-row input[type="search"]:focus,
.page-section--schedule .schedule-filter-row select:focus {
  outline: 2px solid var(--sch-accent);
  outline-offset: 1px;
}

.page-section--schedule .schedule-preset {
  padding: 5px 9px;
  border: 1px solid var(--sch-rule-strong);
  border-radius: 999px;
  background: var(--sch-card);
  color: var(--sch-ink-3);
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.page-section--schedule .schedule-preset:hover {
  background: var(--sch-hover);
  color: var(--sch-ink-2);
}

.page-section--schedule .schedule-preset.is-active {
  background: #1a1815;
  border-color: #1a1815;
  color: #ffffff;
}

.page-section--schedule .schedule-filter-search input[type="search"] {
  width: 100%;
}

.page-section--schedule .schedule-filter-types {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
  flex: 1 1 300px;
  align-self: center;
}

.page-section--schedule .schedule-filter-types label span {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border: 1px solid var(--sch-rule-strong);
  border-radius: 999px;
  background: var(--sch-card);
  color: var(--sch-ink-3);
  font-size: 10.5px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}

.page-section--schedule .schedule-filter-types label:hover span {
  background: var(--sch-hover);
  color: var(--sch-ink-2);
}

.page-section--schedule .schedule-filter-types input[type='checkbox']:checked + span {
  background: #1a1815;
  border-color: #1a1815;
  color: #ffffff;
}

.page-section--schedule .schedule-filter-types input[type='checkbox']:focus-visible + span {
  outline: 2px solid var(--sch-accent);
  outline-offset: 1px;
}

/* Hide native checkbox; span is the visible control (full label remains the hit target). */
.page-section--schedule .schedule-filter-types label {
  position: relative;
  display: inline-flex;
  align-items: stretch;
  margin: 0;
  cursor: pointer;
  font-weight: 500;
}

.page-section--schedule .schedule-filter-types label span {
  position: relative;
  z-index: 0;
}

.page-section--schedule .schedule-filter-types input[type='checkbox'] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
  border: 0;
  padding: 0;
  border-radius: inherit;
}

.page-section--schedule .schedule-filter-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-wrap: wrap;
  align-self: center;
}

.page-section--schedule .schedule-filter-reset {
  padding: 0 8px;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--sch-ink-3);
  box-shadow: none;
}

.page-section--schedule .schedule-filter-reset:hover {
  background: var(--sch-hover);
  color: var(--sch-ink-2);
}

.page-section--schedule .schedule-filter-apply,
.page-section--schedule .schedule-filter-apply.btn {
  min-height: 32px;
  padding: 0 12px;
  border-radius: 7px;
  background: var(--sch-ink);
  border-color: var(--sch-ink);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
}

.page-section--schedule .schedule-filter-apply:hover {
  background: var(--sch-ink-2);
}

.page-section--schedule .schedule-filter-dirty {
  color: var(--sch-accent);
}

.page-section--schedule .schedule-helper {
  display: none;
}

.page-section--schedule .schedule-filter-summary {
  min-height: 0;
  margin: 0;
  color: var(--sch-ink-3);
  font-size: 12px;
}

.page-section--schedule .schedule-filter-summary:empty {
  display: none;
}

.page-section--schedule .schedule-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.page-section--schedule .schedule-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px;
  border: 1px solid var(--sch-rule-strong);
  border-radius: 999px;
  background: var(--sch-card);
  color: var(--sch-ink-3);
  font-size: 11px;
}

.page-section--schedule .schedule-filter-chip:hover {
  background: var(--sch-hover);
}

.page-section--schedule .schedule-filter-chip__x {
  color: var(--sch-ink-4);
  font-size: 12px;
}

.page-section--schedule .schedule-calendar {
  background: var(--sch-card);
  border-top: 1px solid var(--sch-rule);
  border-radius: 0 0 16px 16px;
  overflow: hidden;
}

.page-section--schedule .schedule-planner--month {
  padding: 12px;
  background: linear-gradient(180deg, #f5f2eb 0%, #f0ece3 100%);
}

.page-section--schedule .schedule-month__header {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border: 1px solid rgba(32, 28, 22, 0.08);
  border-bottom: 0;
  background: #f8f5ee;
}

.page-section--schedule .schedule-month__weekday {
  padding: 11px 10px 10px;
  border-right: 1px solid rgba(32, 28, 22, 0.08);
  border-bottom: 1px solid rgba(32, 28, 22, 0.08);
  background: #f8f5ee;
  color: var(--sch-ink-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
  text-transform: uppercase;
}

.page-section--schedule .schedule-month__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-left: 1px solid rgba(32, 28, 22, 0.08);
  border-right: 1px solid rgba(32, 28, 22, 0.08);
  border-bottom: 1px solid rgba(32, 28, 22, 0.08);
  background: #fff;
}

.page-section--schedule .schedule-month__cell {
  position: relative;
  min-height: 132px;
  padding: 0;
  border-right: 1px solid rgba(32, 28, 22, 0.08);
  border-bottom: 1px solid rgba(32, 28, 22, 0.08);
  background: #fff;
}

.page-section--schedule .schedule-month__cell-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 8px 8px 10px;
}

.page-section--schedule .schedule-month__cell--today .schedule-month__cell-inner {
  background: linear-gradient(180deg, rgba(196, 149, 16, 0.08) 0%, rgba(196, 149, 16, 0.03) 100%);
  box-shadow: inset 0 0 0 1px rgba(196, 149, 16, 0.3);
}

.page-section--schedule .schedule-month__cell--weekend {
  background: #fbfaf7;
}

.page-section--schedule .schedule-month__cell--outside {
  background: #f3efe7;
}

.page-section--schedule .schedule-month__cell-top {
  padding: 0;
}

.page-section--schedule .schedule-month__day-button {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border-radius: 999px;
  justify-content: center;
  background: transparent;
  color: var(--sch-ink-2);
}

.page-section--schedule .schedule-month__cell--outside .schedule-month__day-button {
  color: var(--sch-ink-4);
  opacity: 0.8;
}

.page-section--schedule .schedule-month__day-button:hover {
  background: var(--sch-hover);
}

.page-section--schedule .schedule-month__day-button--today {
  background: var(--sch-accent-bg);
  color: var(--sch-accent);
  box-shadow: inset 0 0 0 1px var(--sch-accent-border);
}

.page-section--schedule .schedule-month__day-num {
  font-size: 12px;
  font-weight: 700;
}

.page-section--schedule .schedule-month__events {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0;
}

.page-section--schedule .schedule-month__event {
  display: block;
}

.page-section--schedule .schedule-month-chip {
  display: block;
  padding: 5px 7px;
  margin-bottom: 0;
  border: 1px solid rgba(31, 27, 21, 0.08);
  border-left-width: 4px;
  border-radius: 8px;
  background: #fff;
  box-shadow: none;
  color: var(--sch-ink-2);
  font-size: 10.5px;
  line-height: 1.2;
  cursor: grab;
  transition: background 0.15s, border-color 0.15s;
}

.page-section--schedule .schedule-month-chip:hover {
  background: var(--sch-hover);
}

.page-section--schedule .schedule-month__event-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.page-section--schedule .schedule-month__event-time {
  color: var(--sch-ink-4);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.page-section--schedule .schedule-month__event-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--sch-ink);
  font-size: 10.5px;
  font-weight: 600;
}

.page-section--schedule .schedule-month-chip.schedule-event--inspection {
  border-left-color: var(--sch-type-inspection);
  background: linear-gradient(180deg, rgba(37, 99, 168, 0.06) 0%, #fff 100%);
}

.page-section--schedule .schedule-month-chip.schedule-event--pre-booking,
.page-section--schedule .schedule-month-chip.schedule-event--pre_booking {
  border-left-color: var(--sch-type-prebooking);
  background: linear-gradient(180deg, rgba(196, 149, 16, 0.07) 0%, #fff 100%);
}

.page-section--schedule .schedule-month-chip.schedule-event--fire-door,
.page-section--schedule .schedule-month-chip.schedule-event--fire_door {
  border-left-color: var(--sch-type-firedoor);
  background: linear-gradient(180deg, rgba(107, 70, 193, 0.06) 0%, #fff 100%);
}

.page-section--schedule .schedule-month-chip.schedule-event--remedial {
  border-left-color: var(--sch-type-remedial);
  background: linear-gradient(180deg, rgba(30, 122, 69, 0.06) 0%, #fff 100%);
}

.page-section--schedule .schedule-month__more {
  display: none;
  padding: 2px 4px 0;
  color: var(--sch-ink-4);
  font-size: 10px;
  font-weight: 600;
}

.page-section--schedule .schedule-secondary {
  gap: 12px;
}

.page-section--schedule .schedule-support-card .schedule-card__header {
  padding-bottom: 10px;
}

.page-section--schedule .schedule-support-card .schedule-accordion__body {
  padding: 14px 16px 16px;
}

.page-section--schedule .schedule-support-group + .schedule-support-group {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--sch-rule);
}

.page-section--schedule .schedule-support-group__label {
  margin: 0 0 8px;
  color: var(--sch-ink-2);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-section--schedule .schedule-support-card .today-visit-list {
  gap: 5px;
}

.page-section--schedule .schedule-support-card .today-visit-item {
  padding: 7px 9px;
  border-radius: 10px;
  font-size: 11.5px;
  box-shadow: none;
}

.page-section--schedule .schedule-support-card .today-visit-item__time {
  min-width: 56px;
  font-size: 11px;
}

.page-section--schedule .schedule-day-row {
  background: var(--sch-card);
  border: 1px solid var(--sch-rule);
  border-radius: 10px;
  box-shadow: none;
}

.page-section--schedule .schedule-day-row:hover {
  box-shadow: var(--sch-shadow-sm);
}

.page-section--schedule .schedule-event {
  background: var(--sch-card);
  border: 1px solid var(--sch-rule);
  border-radius: 8px;
  box-shadow: var(--sch-shadow-sm);
}

.page-section--schedule .schedule-event__title {
  color: var(--sch-ink);
}

.page-section--schedule .schedule-event__time,
.page-section--schedule .schedule-event__meta,
.page-section--schedule .schedule-event__client {
  color: var(--sch-ink-4);
}

.page-section--schedule .schedule-event__status {
  color: var(--sch-ink-3);
}

.page-section--schedule .schedule-planner-card {
  background: var(--sch-card);
  border: 1px solid var(--sch-rule);
  border-radius: 7px;
  border-left-width: 3px;
}

.page-section--schedule .schedule-planner-card__title {
  color: var(--sch-ink);
}

.page-section--schedule .schedule-planner-card__meta {
  color: var(--sch-ink-4);
}

.page-section--schedule .schedule-planner--day {
  background: var(--sch-inset);
}

.page-section--schedule .schedule-calendar__column {
  background: var(--sch-card);
}

.page-section--schedule .schedule-calendar__heading {
  background: var(--sch-inset);
  color: var(--sch-ink-2);
}

.page-section--schedule .schedule-accordion {
  background: linear-gradient(180deg, #fff 0%, #fff 80%, rgba(244, 241, 234, 0.35) 100%);
  border-radius: 12px;
  overflow: hidden;
}

.page-section--schedule .schedule-accordion__summary {
  padding: 16px 18px;
}

.page-section--schedule .schedule-accordion__body {
  padding: 16px 18px 18px;
}

.page-section--schedule .schedule-accordion__count {
  background: var(--sch-inset);
  border: 1px solid var(--sch-rule-strong);
  color: var(--sch-ink-2);
}

.page-section--schedule .schedule-legend {
  background: var(--sch-card);
}

@media (max-width: 1200px) {
  .page-section--schedule .schedule-shell {
    grid-template-columns: minmax(0, 1fr) 260px;
  }

  .page-section--schedule .schedule-filter-row--compact-main {
    gap: 8px;
  }

  .page-section--schedule .schedule-filter-row--compact-secondary {
    gap: 8px;
  }

  .page-section--schedule .schedule-filter-search {
    flex: 1 1 100%;
  }

  .page-section--schedule .schedule-filter-types {
    flex: 1 1 100%;
  }
}

@media (max-width: 1024px) {
  .page-section--schedule .schedule-workspace > .ipi-page-header {
    padding: 20px 20px 18px;
  }

  .page-section--schedule .ipi-page-header {
    flex-direction: column;
    gap: 12px;
  }

  .page-section--schedule .ipi-ph-right {
    justify-content: flex-start;
  }

  .page-section--schedule .schedule-shell {
    grid-template-columns: 1fr;
    padding: 12px 20px 0;
  }

  .page-section--schedule .schedule-secondary {
    position: static;
  }

  .page-section--schedule .schedule-filter-row--compact-main {
    align-items: stretch;
  }

  .page-section--schedule .schedule-filter-start,
  .page-section--schedule .schedule-filter-end,
  .page-section--schedule .schedule-filter-inspector {
    flex: 1 1 160px;
  }

  .page-section--schedule .schedule-filter-actions {
    margin-left: 0;
  }
}

@media (max-width: 900px) {
  .page-section--schedule .schedule-workspace > .ipi-page-header {
    padding: 18px 16px 16px;
  }

  .page-section--schedule .schedule-shell {
    padding: 10px 16px 0;
  }

  .page-section--schedule .schedule-flash {
    margin: 0 16px 12px;
  }

  .page-section--schedule .ipi-ph-title {
    font-size: 20px;
  }

  .page-section--schedule .btn.btn--compact {
    padding: 7px 12px;
  }

  .page-section--schedule .schedule-toolbar,
  .page-section--schedule .table-toolbar.schedule-toolbar {
    padding: 10px 12px 12px;
  }

  .page-section--schedule .schedule-viewbar {
    flex-wrap: wrap;
    gap: 8px;
    padding-bottom: 10px;
  }

  .page-section--schedule .schedule-viewbar__right {
    width: 100%;
    justify-content: space-between;
  }

  .page-section--schedule .schedule-range-label {
    font-size: 18px;
  }

  .page-section--schedule .schedule-filter-row--compact-main {
    gap: 8px;
  }

  .page-section--schedule .schedule-filter-search,
  .page-section--schedule .schedule-filter-inspector,
  .page-section--schedule .schedule-filter-start,
  .page-section--schedule .schedule-filter-end {
    width: 100%;
    flex: 1 1 100%;
  }

  .page-section--schedule .schedule-filter-actions {
    margin-left: 0;
  }

  .page-section--schedule .schedule-helper {
    display: block;
  }

  /* .schedule-month__cell + cell-inner + weekday mobile rules are
     owned by section 32 (mobile schedule authority). */
}

/* --- 24. Unified schedule surface --- */

.page-section--schedule .schedule-workspace {
  gap: 0;
}

.page-section--schedule .schedule-top {
  display: contents;
}

.page-section--schedule .schedule-workspace > .ipi-page-header {
  padding: 24px 28px 20px;
  margin: 0;
  background: var(--sch-card);
  border-bottom: 1px solid var(--sch-rule);
  box-shadow: none;
}

.page-section--schedule .schedule-shell {
  display: block;
  width: 100%;
  padding: 0;
}

.page-section--schedule .schedule-main {
  width: 100%;
  min-width: 0;
}

.page-section--schedule .schedule-secondary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  width: 100%;
  margin-top: 12px;
  position: static;
  align-self: stretch;
}

.page-section--schedule .ipi-stats-strip,
.page-section--schedule .sch-stats {
  display: none;
}

.page-section--schedule .schedule-card,
.page-section--schedule .schedule-panel,
.page-section--schedule .schedule-card--bookings,
.page-section--schedule .schedule-details,
.page-section--schedule .schedule-details-surface,
.page-section--schedule [data-schedule-details-surface] {
  background: var(--sch-card);
  border: 1px solid var(--sch-rule);
  border-radius: 12px;
  box-shadow: none;
  overflow: hidden;
}

.page-section--schedule .schedule-card--calendar {
  border-top: 0;
  border-radius: 0 0 14px 14px;
}

.page-section--schedule .schedule-card__header,
.page-section--schedule .schedule-panel__header {
  background: var(--sch-card);
  border-bottom: 1px solid var(--sch-rule);
  padding: 16px 18px 14px;
  gap: 10px;
  box-shadow: none;
}

.page-section--schedule .schedule-card__header--planner {
  align-items: center;
}

.page-section--schedule .schedule-card__actions {
  gap: 8px;
}

.page-section--schedule .schedule-card__header .btn,
.page-section--schedule .schedule-card__header .btn-outline,
.page-section--schedule .schedule-card__header .btn-sm,
.page-section--schedule .schedule-utilitybar .btn,
.page-section--schedule .calendar-sync-trigger,
.page-section--schedule [data-calendar-export-btn] {
  box-shadow: none;
}

.page-section--schedule .schedule-mobile-bar {
  box-shadow: none;
}

.page-section--schedule .schedule-toolbar,
.page-section--schedule .table-toolbar.schedule-toolbar {
  background: var(--sch-card);
  border-top: 0;
  border-bottom: 1px solid var(--sch-rule);
  padding: 0;
  margin: 0;
  border-radius: 0;
  box-shadow: none;
  /* Override the generic `.table-toolbar` utility (style.css:3423) which
     sets `flex-wrap: wrap; justify-content: space-between`. On the
     schedule page we want each direct child (viewbar, form, utilitybar,
     legend) to occupy its own full-width row in source order. Mobile
     drawer state (`.is-mobile-open`) still works — it hides all children
     except the form, so flex-direction becomes moot. */
  flex-direction: column;
  align-items: stretch;
  justify-content: flex-start;
  flex-wrap: nowrap;
}

.page-section--schedule .schedule-viewbar {
  margin: 0;
  padding: 0 18px 10px;
  border-bottom: 1px solid var(--sch-rule);
  background: transparent;
  gap: 10px;
}

.page-section--schedule .schedule-viewbar__right {
  gap: 8px;
  flex-wrap: wrap;
}

.page-section--schedule .schedule-range-form {
  padding: 6px 18px 6px;
}

.page-section--schedule .schedule-filter-stack {
  gap: 4px;
}

.page-section--schedule .schedule-filter-row--compact-main {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: flex-end;
  align-content: flex-start;
}

.page-section--schedule .schedule-filter-row--compact-secondary {
  display: flex;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px 8px;
  flex-wrap: wrap;
}

.page-section--schedule .schedule-filter-start,
.page-section--schedule .schedule-filter-end {
  flex: 0 0 138px;
}

.page-section--schedule .schedule-filter-inspector {
  flex: 0 0 172px;
}

.page-section--schedule .schedule-filter-search {
  flex: 1 1 260px;
  min-width: 220px;
}

.page-section--schedule .schedule-filter-types {
  flex: 0 1 auto;
  align-self: flex-start;
}

.page-section--schedule .schedule-filter-actions {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  flex-wrap: nowrap;
  align-self: flex-end;
}

/* Removed 2026-04-22: the `@media (min-width: 1180px)` block that
   re-rendered `.schedule-range-form` as `display: inline-flex; width: auto`
   for a side-by-side viewbar+form layout. At typical desktop widths the
   viewbar + form sum exceeded the toolbar width and wrapped into
   fragmented half-rows. With `.schedule-toolbar` now stacking vertically
   via `flex-direction: column`, the form naturally fills its own
   full-width row and its inner filter items wrap cleanly inside it. */

.page-section--schedule .schedule-filter-reset {
  min-height: 26px;
  padding: 0 6px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.page-section--schedule .schedule-filter-apply,
.page-section--schedule .schedule-filter-apply.btn {
  min-height: 28px;
  padding: 0 10px;
  box-shadow: none;
}

.page-section--schedule .schedule-filter-summary,
.page-section--schedule .schedule-helper {
  margin: 0;
}

.page-section--schedule .schedule-utilitybar {
  display: flex;
  width: 100%;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px 10px;
  border-top: 0;
  border-bottom: 1px solid var(--sch-rule);
  background: #faf8f3;
}

.page-section--schedule .schedule-utilitybar__meta,
.page-section--schedule .schedule-utilitybar__tools {
  display: flex;
  align-items: center;
  gap: 6px 10px;
  flex-wrap: wrap;
}

.page-section--schedule .schedule-utilitybar__meta:empty {
  display: none;
}

.page-section--schedule .schedule-utilitybar__tools {
  margin-left: auto;
  justify-content: flex-end;
}

.page-section--schedule .schedule-utilitybar .schedule-filter-summary {
  display: flex;
  align-items: center;
}

.page-section--schedule .schedule-utility-btn,
.page-section--schedule .schedule-utility-btn.btn,
.page-section--schedule .schedule-utility-btn[href] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--sch-rule);
  border-radius: 10px;
  background: var(--sch-card);
  color: var(--sch-ink-2);
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  box-shadow: none;
}

.page-section--schedule .schedule-utility-btn:hover,
.page-section--schedule .schedule-utility-btn.btn:hover {
  background: var(--sch-hover);
  border-color: var(--sch-rule-strong);
  color: var(--sch-ink);
}

.page-section--schedule .schedule-utility-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(0, 0, 0, 0.07);
  background: rgba(0, 0, 0, 0.025);
  color: var(--sch-ink-4);
  font-size: 10px;
  font-weight: 500;
}

.page-section--schedule .schedule-filter-summary:empty {
  display: none;
}

.page-section--schedule .schedule-calendar {
  background: var(--sch-card);
  border-top: 1px solid var(--sch-rule);
  border-bottom: 1px solid var(--sch-rule);
  border-radius: 0 0 14px 14px;
  overflow: hidden;
  box-shadow: none;
}

.page-section--schedule .schedule-planner--month {
  padding: 0;
  background: var(--sch-card);
}

.page-section--schedule .schedule-month__header {
  border: 1px solid var(--sch-rule);
  border-bottom: 0;
  background: #faf8f3;
}

.page-section--schedule .schedule-month__weekday {
  padding: 10px 8px;
  border-right: 1px solid var(--sch-rule);
  border-bottom: 1px solid var(--sch-rule);
  background: #faf8f3;
  color: var(--sch-ink-3);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-align: left;
}

.page-section--schedule .schedule-month__grid {
  border-left: 1px solid var(--sch-rule);
  border-right: 1px solid var(--sch-rule);
  border-bottom: 1px solid var(--sch-rule);
  background: #fff;
}

.page-section--schedule .schedule-month__cell {
  height: 148px;
  min-height: 136px;
  border-right: 1px solid var(--sch-rule);
  border-bottom: 1px solid var(--sch-rule);
  background: #fff;
}

.page-section--schedule .schedule-month__cell-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
  height: 100%;
  padding: 8px 8px 8px;
}

.page-section--schedule .schedule-month__cell--today .schedule-month__cell-inner {
  background: var(--sch-accent-bg);
  box-shadow: inset 0 0 0 1px var(--sch-accent-border);
}

.page-section--schedule .schedule-month__cell--weekend {
  background: #fbfaf7;
}

.page-section--schedule .schedule-month__cell--outside {
  background: #f5f2ec;
}

.page-section--schedule .schedule-month__day-button {
  width: 28px;
  height: 28px;
  border-radius: 999px;
  color: var(--sch-ink-2);
  background: transparent;
}

.page-section--schedule .schedule-month__day-button--today {
  background: var(--sch-accent-bg);
  color: var(--sch-accent);
  box-shadow: inset 0 0 0 1px var(--sch-accent-border);
}

.page-section--schedule .schedule-month__events {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  padding: 0;
  min-height: 0;
}

.page-section--schedule .schedule-month__events--scrollable {
  max-height: 100%;
  overflow-y: auto;
  padding-right: 2px;
  scrollbar-width: thin;
}

.page-section--schedule .schedule-month-chip {
  padding: 4px 6px;
  margin-bottom: 0;
  border: 1px solid var(--sch-rule);
  border-left-width: 3px;
  border-radius: 6px;
  background: #fcfbf8;
  box-shadow: none;
  color: var(--sch-ink-2);
  font-size: 10px;
  line-height: 1.2;
}

.page-section--schedule .schedule-month-chip:hover {
  background: var(--sch-hover);
}

.page-section--schedule .schedule-month__event-body {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.page-section--schedule .schedule-month__event-time {
  color: var(--sch-ink-4);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.page-section--schedule .schedule-month__event-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--sch-ink);
  font-size: 10px;
  font-weight: 600;
}

.page-section--schedule .schedule-month-chip.schedule-event--inspection,
.page-section--schedule .schedule-planner-card.schedule-event--inspection,
.page-section--schedule .schedule-day-row.schedule-event--inspection,
.page-section--schedule .schedule-event--inspection {
  border-left-color: var(--sch-type-inspection);
}

.page-section--schedule .schedule-month-chip.schedule-event--pre-booking,
.page-section--schedule .schedule-month-chip.schedule-event--pre_booking,
.page-section--schedule .schedule-planner-card.schedule-event--pre-booking,
.page-section--schedule .schedule-planner-card.schedule-event--pre_booking,
.page-section--schedule .schedule-day-row.schedule-event--pre-booking,
.page-section--schedule .schedule-day-row.schedule-event--pre_booking,
.page-section--schedule .schedule-event--pre-booking,
.page-section--schedule .schedule-event--pre_booking {
  border-left-color: var(--sch-type-prebooking);
}

.page-section--schedule .schedule-month-chip.schedule-event--fire-door,
.page-section--schedule .schedule-month-chip.schedule-event--fire_door,
.page-section--schedule .schedule-planner-card.schedule-event--fire-door,
.page-section--schedule .schedule-planner-card.schedule-event--fire_door,
.page-section--schedule .schedule-day-row.schedule-event--fire-door,
.page-section--schedule .schedule-day-row.schedule-event--fire_door,
.page-section--schedule .schedule-event--fire-door,
.page-section--schedule .schedule-event--fire_door {
  border-left-color: var(--sch-type-firedoor);
}

.page-section--schedule .schedule-month-chip.schedule-event--remedial,
.page-section--schedule .schedule-planner-card.schedule-event--remedial,
.page-section--schedule .schedule-day-row.schedule-event--remedial,
.page-section--schedule .schedule-event--remedial {
  border-left-color: var(--sch-type-remedial);
}

.page-section--schedule .schedule-month-chip.schedule-event--inspection,
.page-section--schedule .schedule-planner-card.schedule-event--inspection,
.page-section--schedule .schedule-day-row.schedule-event--inspection,
.page-section--schedule .schedule-event--inspection {
  background: rgba(37, 99, 168, 0.045);
}

.page-section--schedule .schedule-month-chip.schedule-event--pre-booking,
.page-section--schedule .schedule-month-chip.schedule-event--pre_booking,
.page-section--schedule .schedule-planner-card.schedule-event--pre-booking,
.page-section--schedule .schedule-planner-card.schedule-event--pre_booking,
.page-section--schedule .schedule-day-row.schedule-event--pre-booking,
.page-section--schedule .schedule-day-row.schedule-event--pre_booking,
.page-section--schedule .schedule-event--pre-booking,
.page-section--schedule .schedule-event--pre_booking {
  background: rgba(196, 149, 16, 0.05);
}

.page-section--schedule .schedule-month-chip.schedule-event--fire-door,
.page-section--schedule .schedule-month-chip.schedule-event--fire_door,
.page-section--schedule .schedule-planner-card.schedule-event--fire-door,
.page-section--schedule .schedule-planner-card.schedule-event--fire_door,
.page-section--schedule .schedule-day-row.schedule-event--fire-door,
.page-section--schedule .schedule-day-row.schedule-event--fire_door,
.page-section--schedule .schedule-event--fire-door,
.page-section--schedule .schedule-event--fire_door {
  background: rgba(107, 70, 193, 0.045);
}

.page-section--schedule .schedule-month-chip.schedule-event--remedial,
.page-section--schedule .schedule-planner-card.schedule-event--remedial,
.page-section--schedule .schedule-day-row.schedule-event--remedial,
.page-section--schedule .schedule-event--remedial {
  background: rgba(30, 122, 69, 0.045);
}

.page-section--schedule .schedule-planner--day {
  padding: 12px 16px 16px;
  background: var(--sch-card);
}

.page-section--schedule .schedule-day__title {
  margin-bottom: 12px;
}

.page-section--schedule .schedule-day-row,
.page-section--schedule .schedule-event,
.page-section--schedule .schedule-planner-card {
  box-shadow: none;
}

.page-section--schedule .schedule-day-row:hover,
.page-section--schedule .schedule-event:hover,
.page-section--schedule .schedule-planner-card:hover {
  box-shadow: none;
}

.page-section--schedule .schedule-accordion,
.page-section--schedule .schedule-accordion__summary,
.page-section--schedule .schedule-accordion__body {
  background: var(--sch-card);
  box-shadow: none;
}

.page-section--schedule .schedule-accordion {
  border: 1px solid var(--sch-rule);
}

.page-section--schedule .schedule-accordion__summary {
  padding: 14px 16px;
}

.page-section--schedule .schedule-accordion__body {
  padding: 14px 16px 16px;
}

.page-section--schedule .schedule-support-card .schedule-card__header {
  padding: 14px 16px 6px;
  background: var(--sch-card);
  border-bottom: 0;
}

.page-section--schedule .schedule-support-card .schedule-section-title {
  width: 100%;
}

.page-section--schedule .schedule-support-card .schedule-section-title > div {
  display: grid;
  gap: 4px;
}

.page-section--schedule .schedule-support-card .schedule-card__header .schedule-eyebrow,
.page-section--schedule .schedule-support-card .schedule-card__header h3,
.page-section--schedule .schedule-support-card .schedule-card__header .text-muted {
  margin: 0;
}

.page-section--schedule .schedule-support-card .schedule-accordion__count {
  margin-left: auto;
  align-self: flex-start;
}

.page-section--schedule .schedule-support-card .schedule-accordion__body {
  padding: 8px 16px 14px;
}

.page-section--schedule .schedule-support-card .today-visit-list {
  gap: 5px;
}

.page-section--schedule .schedule-support-card .today-visit-item {
  padding: 7px 9px;
  border-radius: 10px;
  box-shadow: none;
}

.page-section--schedule .schedule-support-card .today-visit-item__time {
  min-width: 56px;
}

.page-section--schedule .schedule-legend {
  border-top: 1px solid var(--sch-rule);
  background: var(--sch-card);
}

.page-section--schedule .schedule-fullscreen-modal .modal__header,
.page-section--schedule .schedule-day-details-modal .modal__header {
  background: var(--sch-card);
  border-bottom: 1px solid var(--sch-rule);
}

.page-section--schedule .schedule-day-details-modal .schedule-day-details-row {
  box-shadow: none;
}

.page-section--schedule .schedule-details-toggle,
.page-section--schedule details.schedule-details > summary,
.page-section--schedule [data-schedule-details-toggle] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 34px;
  padding: 10px 14px;
  border: 1px solid var(--sch-rule);
  border-radius: 10px;
  background: var(--sch-card);
  color: var(--sch-ink);
  font: inherit;
  cursor: pointer;
  list-style: none;
}

.page-section--schedule details.schedule-details > summary::-webkit-details-marker {
  display: none;
}

.page-section--schedule details.schedule-details[open] > summary {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
  border-bottom-color: var(--sch-rule);
}

.page-section--schedule .schedule-details-surface,
.page-section--schedule details.schedule-details,
.page-section--schedule [data-schedule-details-surface] {
  border-radius: 12px;
  border: 1px solid var(--sch-rule);
  background: var(--sch-card);
  box-shadow: none;
  overflow: visible;
  position: relative;
  min-width: 170px;
}

.page-section--schedule .schedule-details__body,
.page-section--schedule [data-schedule-details-body] {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px 16px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  z-index: 12;
  width: min(720px, calc(100vw - 88px));
  border: 1px solid var(--sch-rule);
  border-radius: 12px;
  background: var(--sch-card);
  box-shadow: var(--sch-shadow-md);
}

.page-section--schedule .schedule-details__summary-label,
.page-section--schedule .schedule-details-toggle__label {
  color: var(--sch-ink-2);
  font-size: 12px;
  font-weight: 600;
}

.page-section--schedule .schedule-details__summary-count,
.page-section--schedule .schedule-details-toggle__count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  border: 1px solid var(--sch-rule-strong);
  background: var(--sch-inset);
  color: var(--sch-ink-3);
  font-size: 11px;
  font-weight: 700;
}

.page-section--schedule .schedule-details-toggle__meta {
  color: var(--sch-ink-4);
  font-size: 11px;
  font-weight: 500;
}

.page-section--schedule .schedule-details-surface:not([open]) > .schedule-details__body,
.page-section--schedule details.schedule-details:not([open]) > .schedule-details__body,
.page-section--schedule [data-schedule-details-surface]:not([open]) > [data-schedule-details-body] {
  display: none;
}

.page-section--schedule .schedule-details__body .schedule-panel {
  min-width: 0;
}

@media (max-width: 1200px) {
  .page-section--schedule .schedule-shell {
    padding: 0;
  }

  .page-section--schedule .schedule-secondary {
    grid-template-columns: 1fr;
  }

  .page-section--schedule .schedule-filter-search,
  .page-section--schedule .schedule-filter-types {
    flex-basis: 100%;
  }

  .page-section--schedule .schedule-details__body,
  .page-section--schedule [data-schedule-details-body] {
    width: min(680px, calc(100vw - 72px));
  }
}

@media (max-width: 1024px) {
  .page-section--schedule .schedule-workspace > .ipi-page-header {
    padding: 20px 20px 18px;
  }

  .page-section--schedule .schedule-shell {
    padding: 0;
  }

  .page-section--schedule .schedule-secondary {
    margin-top: 12px;
  }

  .page-section--schedule .schedule-viewbar,
  .page-section--schedule .schedule-range-form {
    padding-left: 16px;
    padding-right: 16px;
  }

  .page-section--schedule .schedule-range-form {
    display: block;
    width: 100%;
    max-width: none;
  }

  .page-section--schedule .schedule-filter-stack {
    display: flex;
    width: 100%;
  }

  .page-section--schedule .schedule-filter-row--compact-secondary {
    align-items: stretch;
  }

  .page-section--schedule .schedule-utilitybar {
    flex-direction: column;
    align-items: stretch;
  }

  .page-section--schedule .schedule-utilitybar__tools {
    margin-left: 0;
    justify-content: flex-start;
  }

  .page-section--schedule .schedule-details__body,
  .page-section--schedule [data-schedule-details-body] {
    width: min(100%, calc(100vw - 64px));
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .page-section--schedule .schedule-workspace > .ipi-page-header {
    padding: 18px 16px 16px;
  }

  .page-section--schedule .schedule-shell {
    padding: 0;
  }

  .page-section--schedule .schedule-secondary {
    grid-template-columns: 1fr;
    margin-top: 10px;
  }

  .page-section--schedule .schedule-toolbar,
  .page-section--schedule .table-toolbar.schedule-toolbar {
    padding: 0;
  }

  .page-section--schedule .schedule-viewbar {
    margin: 0;
    padding: 0 12px 10px;
    flex-wrap: wrap;
  }

  .page-section--schedule .schedule-viewbar__right {
    width: 100%;
    justify-content: space-between;
  }

  .page-section--schedule .schedule-range-form {
    padding: 6px 12px 6px;
  }

  .page-section--schedule .schedule-utilitybar {
    padding: 8px 12px 10px;
  }

  .page-section--schedule .schedule-utilitybar__meta,
  .page-section--schedule .schedule-utilitybar__tools {
    width: 100%;
  }

  .page-section--schedule .schedule-details-surface,
  .page-section--schedule details.schedule-details,
  .page-section--schedule [data-schedule-details-surface] {
    width: 100%;
  }

  .page-section--schedule .schedule-details__body,
  .page-section--schedule [data-schedule-details-body] {
    position: static;
    width: 100%;
    margin-top: 8px;
    box-shadow: none;
  }

  .page-section--schedule .schedule-filter-row--compact-main {
    gap: 8px;
  }

  .page-section--schedule .schedule-filter-start,
  .page-section--schedule .schedule-filter-end,
  .page-section--schedule .schedule-filter-inspector,
  .page-section--schedule .schedule-filter-search {
    width: 100%;
    flex: 1 1 100%;
  }

  .page-section--schedule .schedule-filter-actions {
    margin-left: 0;
  }

  /* .schedule-month__cell + cell-inner + weekday mobile rules are
     owned by section 32 (mobile schedule authority). */
}

/* --- 25. Hard flatten remaining legacy gradients --- */

.page-section--schedule .schedule-card__header,
.page-section--schedule .schedule-panel__header,
.page-section--schedule .schedule-today-strip,
.page-section--schedule .schedule-toolbar,
.page-section--schedule .table-toolbar.schedule-toolbar,
.page-section--schedule .schedule-calendar,
.page-section--schedule .schedule-accordion,
.page-section--schedule .schedule-planner--month,
.page-section--schedule .schedule-fullscreen-modal .modal__header {
  background: var(--sch-card);
  background-image: none;
}

.page-section--schedule .schedule-card__header,
.page-section--schedule .schedule-panel__header,
.page-section--schedule .schedule-today-strip,
.page-section--schedule .schedule-toolbar,
.page-section--schedule .table-toolbar.schedule-toolbar,
.page-section--schedule .schedule-calendar,
.page-section--schedule .schedule-accordion {
  box-shadow: none;
}

.page-section--schedule .schedule-month__cell--today .schedule-month__cell-inner {
  background: var(--sch-accent-bg);
  box-shadow: inset 0 0 0 1px var(--sch-accent-border);
}

.page-section--schedule .schedule-month-chip.schedule-event--inspection {
  background: #f7fbff;
}

.page-section--schedule .schedule-month-chip.schedule-event--pre-booking,
.page-section--schedule .schedule-month-chip.schedule-event--pre_booking {
  background: #fff9e8;
}

.page-section--schedule .schedule-month-chip.schedule-event--fire-door,
.page-section--schedule .schedule-month-chip.schedule-event--fire_door {
  background: #f6f3fd;
}

.page-section--schedule .schedule-month-chip.schedule-event--remedial {
  background: #f4fbf6;
}

.page-section--schedule .schedule-calendar__heading {
  background: var(--sch-inset);
}

/* --- 26. Minimal month grid --- */

.page-section--schedule .schedule-planner--month {
  padding: 0;
  background: #fff;
}

.page-section--schedule .schedule-month__header {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-top: 1px solid rgba(26, 24, 21, 0.06);
  border-bottom: 1px solid rgba(26, 24, 21, 0.06);
  border-radius: 0;
  overflow: visible;
  background: #f6f1e6;
}

.page-section--schedule .schedule-month__weekday {
  padding: 10px 12px;
  border-right: 1px solid rgba(26, 24, 21, 0.05);
  background: #f6f1e6;
  color: #6d6559;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.page-section--schedule .schedule-month__weekday:last-child {
  border-right: 0;
}

.page-section--schedule .schedule-month__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid rgba(26, 24, 21, 0.06);
  background: #fff;
}

.page-section--schedule .schedule-planner--month .schedule-month__grid {
  gap: 0;
  margin: 0;
  grid-auto-rows: auto;
}

.page-section--schedule .schedule-month__cell {
  height: 148px;
  min-height: 148px;
  display: block;
  padding: 0;
  border-right: 1px solid rgba(26, 24, 21, 0.05);
  border-bottom: 1px solid rgba(26, 24, 21, 0.05);
  border-radius: 0;
  background: #fff;
  box-shadow: none;
  cursor: default;
}

.page-section--schedule .schedule-month__cell:nth-child(7n) {
  border-right: 0;
}

.page-section--schedule .schedule-month__cell:hover,
.page-section--schedule .schedule-month__cell--outside:hover,
.page-section--schedule .schedule-month__cell--today {
  box-shadow: none;
}

.page-section--schedule .schedule-month__cell--today {
  border-color: rgba(26, 24, 21, 0.05);
}

.page-section--schedule .schedule-month__cell-inner {
  display: flex;
  flex-direction: column;
  gap: 5px;
  height: 100%;
  padding: 8px 8px 10px;
  background: transparent;
  box-shadow: none;
}

.page-section--schedule .schedule-month__cell--today {
  background: #fff;
}

.page-section--schedule .schedule-month__cell--today .schedule-month__cell-inner {
  background: transparent;
  box-shadow: inset 0 2px 0 var(--sch-accent);
}

.page-section--schedule .schedule-month__cell--weekend {
  background: #fff;
}

.page-section--schedule .schedule-month__cell--outside {
  background: #fcfcfb;
  opacity: 1;
}

.page-section--schedule .schedule-month__cell--outside .schedule-month__day-button,
.page-section--schedule .schedule-month__cell--outside .schedule-month__event-time,
.page-section--schedule .schedule-month__cell--outside .schedule-month__event-title {
  opacity: 0.5;
}

.page-section--schedule .schedule-month__cell-top {
  position: static;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 0;
  padding-bottom: 0;
  background: transparent;
  backdrop-filter: none;
  z-index: auto;
}

.page-section--schedule .schedule-month__day-button {
  min-width: 0;
  width: auto;
  height: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--sch-ink-2);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.1;
  gap: 0;
}

.page-section--schedule .schedule-month__day-button:hover,
.page-section--schedule .schedule-month__day-button--today {
  background: transparent;
  box-shadow: none;
}

.page-section--schedule .schedule-month__day-button--today {
  color: var(--sch-accent);
}

.page-section--schedule .schedule-month__day-num {
  min-width: 0;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-weight: inherit;
}

.page-section--schedule .schedule-month__events {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 1px;
  min-height: 0;
  padding: 0;
}

.page-section--schedule .schedule-month__events--scrollable {
  overflow-y: auto;
  scrollbar-width: thin;
}

.page-section--schedule .schedule-month-chip {
  display: block;
  padding: 4px 6px 4px 8px;
  border: 0;
  border-left: 2px solid transparent;
  border-radius: 6px;
  background: #f8f7f4;
  box-shadow: none;
  color: var(--sch-ink-2);
  font-size: 10.5px;
  line-height: 1.22;
  white-space: normal;
  transform: none;
  transition: background 120ms ease, border-color 120ms ease;
}

.page-section--schedule .schedule-month-chip:hover {
  background: #f2efe9;
  transform: none;
  box-shadow: none;
}

.page-section--schedule .schedule-month__event-body {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 6px;
  align-items: start;
  min-width: 0;
}

.page-section--schedule .schedule-month__event-time {
  color: #6f685e;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.page-section--schedule .schedule-month__event-title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--sch-ink);
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.22;
  white-space: normal;
}

.page-section--schedule .schedule-month-chip.schedule-event--inspection {
  border-left-color: var(--sch-type-inspection);
  background: #eef6ff;
}

.page-section--schedule .schedule-month-chip.schedule-event--pre-booking,
.page-section--schedule .schedule-month-chip.schedule-event--pre_booking {
  border-left-color: var(--sch-type-prebooking);
  background: #fff6dc;
}

.page-section--schedule .schedule-month-chip.schedule-event--fire-door,
.page-section--schedule .schedule-month-chip.schedule-event--fire_door {
  border-left-color: var(--sch-type-firedoor);
  background: #f3edff;
}

.page-section--schedule .schedule-month-chip.schedule-event--remedial {
  border-left-color: var(--sch-type-remedial);
  background: #eaf7ef;
}

@media (max-width: 1024px) {
  .page-section--schedule .schedule-month__cell {
    height: 124px;
    min-height: 124px;
  }

  .page-section--schedule .schedule-month__cell-inner {
    padding: 7px 7px 8px;
    gap: 4px;
  }

  .page-section--schedule .schedule-month__event-body {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 5px;
  }
}

/* Mobile overrides for the month grid live in section 32
   ("Mobile schedule authority") — kept as single source of truth. */

/* --- 28. Calendar sync modal (canonical `.sched-modal` family, rebuilt 2026-04-22) ---
   Chrome (header, body scroll, footer, stable dialog height) inherits from
   .sched-modal. Eyebrow uses canonical `.eyebrow`, title uses `.modal__title`,
   tabs use `.ipi-tabs` / `.ipi-tab`, buttons use `.btn.btn-primary/.btn-secondary`.
   Only genuinely unique primitives (status chip, URL row, pill list, numbered
   guide list, install step list) live here. */

/* Dialog width — wider than default sched-modal to fit two-column subscribe content. */
.page-section--schedule .modal.schedule-sync-modal .schedule-sync-modal__dialog {
  width: min(760px, calc(100vw - 32px));
}

/* --ipi-* token aliases at modal scope so canonical `.ipi-tabs` + `.ipi-tab`
   render correctly (tokens are otherwise scoped to `.inspections-page` et al.
   and don't cascade into modals). */
.schedule-sync-modal {
  --ipi-bg-inset: var(--surface-inset, #edeae3);
  --ipi-bg-card: var(--surface-card, #ffffff);
  --ipi-rule-h: rgba(26, 24, 21, 0.11);
  --ipi-shadow-sm: 0 1px 3px rgba(26, 24, 21, 0.06), 0 1px 2px rgba(26, 24, 21, 0.04);
  --ipi-ink: var(--ink, #1a1815);
  --ipi-ink-4: var(--ink-4, #9a9188);
  --ipi-accent: var(--accent, #c49510);
  --ipi-accent-bg: rgba(196, 149, 16, 0.08);
}
html[data-theme="dark"] .schedule-sync-modal {
  --ipi-bg-inset: rgba(15, 23, 42, 0.62);
  --ipi-bg-card: rgba(15, 23, 42, 0.7);
  --ipi-rule-h: rgba(148, 163, 184, 0.22);
  --ipi-shadow-sm: none;
  --ipi-ink: #e2e8f0;
  --ipi-ink-4: #64748b;
  --ipi-accent: #e3b008;
  --ipi-accent-bg: rgba(227, 176, 8, 0.18);
}

/* Body: flex column with gap between tabs / panels / sections.
   Direct children MUST NOT shrink — body owns the scroll via
   `overflow-y: auto` (canonical), so content should render at natural
   size and let the body's scrollbar handle overflow. Without this,
   the default `flex-shrink: 1` on children causes them to collapse
   below content size when the body's flex allocation is smaller than
   its content, which paints children on top of each other. */
.page-section--schedule .schedule-sync-modal__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px 20px 20px;
}

.page-section--schedule .schedule-sync-modal__body > * {
  flex-shrink: 0;
}

.page-section--schedule .schedule-sync-modal__tabs {
  align-self: flex-start;
}

.page-section--schedule .schedule-sync-modal__panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  /* Panel + its flex children MUST NOT shrink. The canonical
     `.sched-modal form { flex: 1 1 auto; min-height: 0 }` rule assumes
     a form that wraps body+footer; here the form is a child of this
     flex-column panel with an aside sibling, so the shrink factor causes
     the form to collapse below its content size and its section spills
     over the aside (visual overlap + broken scroll). Keep everything
     at its natural size and rely on the body's `overflow-y: auto` to
     provide scrolling. */
  flex-shrink: 0;
}

.page-section--schedule .schedule-sync-modal__panel > * {
  flex-shrink: 0;
  min-height: auto;
}

.page-section--schedule .schedule-sync-modal__notice {
  margin: 0;
}

.page-section--schedule .schedule-sync-modal__form {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  /* Override `.sched-modal form { flex: 1 1 auto; min-height: 0 }` so the
     form doesn't try to grow/shrink inside the panel's flex column. */
  flex: 0 0 auto;
  min-height: auto;
}

/* Section card — warm card with rule + padding + gap. */
.page-section--schedule .schedule-sync-modal__section {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 18px;
  background: var(--surface-card, #ffffff);
  border: 1px solid var(--rule, rgba(26, 24, 21, 0.08));
  border-radius: 12px;
}

.page-section--schedule .schedule-sync-modal__section--guide {
  background: var(--surface-subtle, #f2efe9);
}

.page-section--schedule .schedule-sync-modal__section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.page-section--schedule .schedule-sync-modal__section-head > div {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.page-section--schedule .schedule-sync-modal__section-title {
  margin: 0;
  font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
  color: var(--ink, #1a1815);
}

/* Enabled / Disabled status chip. */
.page-section--schedule .schedule-sync-modal__status {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 12px;
  border-radius: 999px;
  background: var(--surface-subtle, #f2efe9);
  border: 1px solid var(--rule, rgba(26, 24, 21, 0.08));
  color: var(--ink-3, #6b6458);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex-shrink: 0;
  white-space: nowrap;
}

.page-section--schedule .schedule-sync-modal__status--on {
  background: rgba(30, 122, 69, 0.1);
  border-color: rgba(30, 122, 69, 0.28);
  color: var(--success, #1e7a45);
}

/* Meta pill list. */
.page-section--schedule .schedule-sync-modal__pills {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.page-section--schedule .schedule-sync-modal__pills li {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 11px;
  border: 1px solid var(--rule, rgba(26, 24, 21, 0.08));
  border-radius: 999px;
  background: var(--surface-subtle, #f2efe9);
  color: var(--ink-3, #6b6458);
  font-size: 12px;
  font-weight: 600;
}

/* Canonical label + input. */
.page-section--schedule .schedule-sync-modal__field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-weight: 400;
}

.page-section--schedule .schedule-sync-modal__field > span:first-of-type {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3, #6b6458);
}

.page-section--schedule .schedule-sync-modal__field .form-hint {
  font-size: 12px;
  font-weight: 400;
  letter-spacing: normal;
  text-transform: none;
  color: var(--ink-3, #6b6458);
}

.page-section--schedule .schedule-sync-modal__url-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.page-section--schedule .schedule-sync-modal__url-row input {
  min-width: 0;
  min-height: 40px;
  padding: 10px 13px;
  border: 1px solid rgba(26, 24, 21, 0.14);
  border-radius: 9px;
  background: var(--surface-card, #ffffff);
  color: var(--ink, #1a1815);
  font-size: 13.5px;
  font-weight: 500;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.page-section--schedule .schedule-sync-modal__url-row input:focus-visible {
  border-color: rgba(196, 149, 16, 0.55);
  box-shadow: 0 0 0 3px rgba(196, 149, 16, 0.18);
}

.page-section--schedule .schedule-sync-modal__toggle {
  margin: 0;
}

.page-section--schedule .schedule-sync-modal__copy-hint {
  min-height: 16px;
}

/* Footer-actions — tab-switched button groups inside canonical `.sched-modal__footer`.
   One group visible per active tab (JS toggles `hidden` attribute).
   Canonical sched-modal__footer-actions provides `display: flex; gap: 10px` on desktop;
   we stretch the visible group to fill the footer (right-aligned). */
.page-section--schedule .schedule-sync-modal__footer-actions {
  flex: 1 1 auto;
  justify-content: flex-end;
}

/* Quick-setup numbered guide list. */
.page-section--schedule .schedule-sync-modal__guide {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: schedule-sync-guide;
}

.page-section--schedule .schedule-sync-modal__guide li {
  display: grid;
  gap: 4px;
  padding-left: 36px;
  position: relative;
}

.page-section--schedule .schedule-sync-modal__guide li::before {
  content: counter(schedule-sync-guide);
  counter-increment: schedule-sync-guide;
  position: absolute;
  left: 0;
  top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: rgba(196, 149, 16, 0.15);
  color: var(--accent-strong, #a97807);
  font-size: 11px;
  font-weight: 700;
}

.page-section--schedule .schedule-sync-modal__guide strong {
  color: var(--ink, #1a1815);
  font-size: 13px;
}

.page-section--schedule .schedule-sync-modal__guide span {
  color: var(--ink-3, #6b6458);
  font-size: 12px;
  line-height: 1.55;
}

/* Install step list — one canonical card per step. */
.page-section--schedule .schedule-sync-modal__steps {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.page-section--schedule .schedule-sync-modal__steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px 16px;
  background: var(--surface-card, #ffffff);
  border: 1px solid var(--rule, rgba(26, 24, 21, 0.08));
  border-radius: 10px;
}

.page-section--schedule .schedule-sync-modal__steps li > div {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.page-section--schedule .schedule-sync-modal__steps strong {
  color: var(--ink, #1a1815);
  font-size: 13.5px;
  font-weight: 700;
}

.page-section--schedule .schedule-sync-modal__step-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  margin-top: 2px;
  border-radius: 999px;
  background: rgba(196, 149, 16, 0.15);
  color: var(--accent-strong, #a97807);
  font-size: 11px;
  font-weight: 700;
}

/* Mobile (≤900px) — canonical full-screen chrome takes over.
   Content-specific overrides only. */
@media (max-width: 900px) {
  .page-section--schedule .schedule-sync-modal__body {
    padding: 14px 16px 18px;
    gap: 14px;
  }

  .page-section--schedule .schedule-sync-modal__section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .page-section--schedule .schedule-sync-modal__url-row {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  /* Canonical 2-col footer action grid with odd-last-child full-width rule.
     Applied to the visible `.schedule-sync-modal__footer-actions` (hidden
     group is removed from layout via [hidden] display:none). */
  .page-section--schedule .schedule-sync-modal__footer-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 10px;
  }

  .page-section--schedule .schedule-sync-modal__footer-actions > *:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .page-section--schedule .schedule-sync-modal__footer-actions .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }

  .page-section--schedule .schedule-sync-modal__url-row .btn {
    width: 100%;
    justify-content: center;
    min-height: 44px;
  }
}

/* Dark mode. */
html[data-theme="dark"] .page-section--schedule .schedule-sync-modal__section {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .page-section--schedule .schedule-sync-modal__section--guide {
  background: rgba(15, 23, 42, 0.45);
}

html[data-theme="dark"] .page-section--schedule .schedule-sync-modal__section-title {
  color: var(--text);
}

html[data-theme="dark"] .page-section--schedule .schedule-sync-modal__status {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--text-muted);
}

html[data-theme="dark"] .page-section--schedule .schedule-sync-modal__status--on {
  background: rgba(30, 122, 69, 0.24);
  border-color: rgba(30, 122, 69, 0.48);
  color: #6ae79c;
}

html[data-theme="dark"] .page-section--schedule .schedule-sync-modal__pills li {
  background: rgba(15, 23, 42, 0.5);
  border-color: rgba(148, 163, 184, 0.22);
  color: var(--text-muted);
}

html[data-theme="dark"] .page-section--schedule .schedule-sync-modal__field > span:first-of-type {
  color: var(--text-muted);
}

html[data-theme="dark"] .page-section--schedule .schedule-sync-modal__url-row input {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--text);
}

html[data-theme="dark"] .page-section--schedule .schedule-sync-modal__guide strong {
  color: var(--text);
}

html[data-theme="dark"] .page-section--schedule .schedule-sync-modal__guide span {
  color: var(--text-muted);
}

html[data-theme="dark"] .page-section--schedule .schedule-sync-modal__steps li {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .page-section--schedule .schedule-sync-modal__steps strong {
  color: var(--text);
}

html[data-theme="dark"] .page-section--schedule .schedule-sync-modal__guide li::before,
html[data-theme="dark"] .page-section--schedule .schedule-sync-modal__step-num {
  background: rgba(227, 176, 8, 0.25);
  color: #e3b008;
}

/* --- 28b. Pre-booking capture modal (guided-tour-picker shell + planner schedule-view-tabs + remedial mobile sheet) --- */

.page-section--schedule .modal.prebooking-capture-modal .prebooking-capture-modal__dialog {
  width: min(640px, calc(100vw - 32px));
  max-height: min(88vh, 900px);
  border-radius: 14px;
  border: 1px solid rgba(26, 24, 21, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #ffffff;
  box-shadow:
    0 4px 24px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.04);
}

.page-section--schedule .prebooking-capture-modal__form {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.page-section--schedule .prebooking-capture-modal__header.modal__header {
  flex-shrink: 0;
  padding: 18px 20px 12px;
  border-bottom: 1px solid rgba(26, 24, 21, 0.07);
  align-items: flex-start;
  background: #ffffff;
}

.page-section--schedule .prebooking-capture-modal__header-main {
  min-width: 0;
  flex: 1 1 auto;
  padding-right: 8px;
}

.page-section--schedule .prebooking-capture-modal__eyebrow {
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c49510;
}

.page-section--schedule .prebooking-capture-modal__title {
  margin: 0 0 6px;
  font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
  font-size: 1.28rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #1a1815;
}

.page-section--schedule .prebooking-capture-modal__subtitle {
  margin: 0;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.45;
  max-width: 54ch;
  color: #6b6458;
}

/* Planner-style tabs; full width, no horizontal scroll (avoids bogus mobile scrollbars) */
.page-section--schedule .prebooking-capture-modal__view-tabs.schedule-view-tabs {
  margin-top: 8px;
  align-self: stretch;
  width: 100%;
  max-width: 100%;
  display: flex;
  flex-wrap: nowrap;
  overflow: visible;
  box-sizing: border-box;
}

.page-section--schedule .prebooking-capture-modal__view-tabs .schedule-view-tab {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
  white-space: normal;
  line-height: 1.25;
  padding: 6px 8px;
  font-size: 11px;
}

@media (min-width: 480px) {
  .page-section--schedule .prebooking-capture-modal__view-tabs .schedule-view-tab {
    font-size: 12px;
    padding: 5px 12px;
    white-space: nowrap;
  }
}

.page-section--schedule .prebooking-capture-modal__body.modal__body {
  padding: 16px 20px 18px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #f7f5f0;
}

.page-section--schedule .prebooking-capture-modal .booking-pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 0;
}

.page-section--schedule .prebooking-capture-modal__section {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 16px;
  border: 1px solid rgba(26, 24, 21, 0.08);
  border-radius: 10px;
  background: #ffffff;
  box-shadow: none;
}

.page-section--schedule .prebooking-capture-modal__section-title {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b6458;
}

.page-section--schedule .prebooking-capture-modal__lede {
  margin: 0 0 4px;
  line-height: 1.45;
}

.page-section--schedule .prebooking-modal__grid {
  display: grid;
  gap: 12px 14px;
  grid-template-columns: 1fr;
}

@media (min-width: 540px) {
  .page-section--schedule .prebooking-modal__grid:not(.prebooking-modal__grid--stack) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.page-section--schedule .prebooking-modal__grid--stack {
  grid-template-columns: 1fr;
}

.page-section--schedule .prebooking-capture-modal__field-span {
  grid-column: 1 / -1;
}

.page-section--schedule .prebooking-capture-modal__body label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b6458;
}

.page-section--schedule .prebooking-capture-modal__body label input,
.page-section--schedule .prebooking-capture-modal__body label textarea {
  width: 100%;
  max-width: 100%;
  margin: 0;
  text-transform: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: normal;
  line-height: 1.3;
  color: #1a1815;
  background: #ffffff;
  border: 1px solid rgba(26, 24, 21, 0.12);
  border-radius: 8px;
  padding: 9px 12px;
  box-sizing: border-box;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.page-section--schedule .prebooking-capture-modal__body label select {
  width: 100%;
  max-width: 100%;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  text-transform: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: normal;
  line-height: 1.3;
  color: #1a1815;
  background-color: #ffffff;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='none' stroke='%239A9188' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 10px;
  border: 1px solid rgba(26, 24, 21, 0.12);
  border-radius: 8px;
  padding: 9px 34px 9px 12px;
  box-sizing: border-box;
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.page-section--schedule .prebooking-capture-modal__body label input:focus-visible,
.page-section--schedule .prebooking-capture-modal__body label select:focus-visible,
.page-section--schedule .prebooking-capture-modal__body label textarea:focus-visible {
  border-color: rgba(196, 149, 16, 0.55);
  box-shadow: 0 0 0 3px rgba(196, 149, 16, 0.15);
}

.page-section--schedule .prebooking-capture-modal__body label textarea {
  min-height: 72px;
  resize: vertical;
  line-height: 1.45;
}

.page-section--schedule .prebooking-capture-modal__quote-summary {
  margin: 0;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(26, 24, 21, 0.08);
  background: rgba(255, 255, 255, 0.72);
  font-size: 13px;
  line-height: 1.45;
  color: #3d3a34;
}

.page-section--schedule .prebooking-capture-modal__quote-summary p {
  margin: 0 0 6px;
}

.page-section--schedule .prebooking-capture-modal__quote-summary p:last-child {
  margin-bottom: 0;
}

.page-section--schedule .prebooking-capture-modal__inline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin-top: 6px;
}

.page-section--schedule .prebooking-capture-modal__inline-row__grow {
  flex: 1 1 160px;
  min-width: 0;
}

.page-section--schedule .prebooking-capture-modal__inline-row .btn {
  flex: 0 0 auto;
  align-self: center;
}

.page-section--schedule .prebooking-capture-modal__chips {
  margin-top: 8px;
}

.page-section--schedule .prebooking-capture-modal__notes-label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #6b6458;
}

.page-section--schedule .prebooking-capture-modal__notes-label textarea {
  text-transform: none;
  letter-spacing: normal;
  font-size: 13px;
  font-weight: 500;
  width: 100%;
  padding: 9px 12px;
  border: 1px solid rgba(26, 24, 21, 0.12);
  border-radius: 8px;
  background: #ffffff;
  color: #1a1815;
  min-height: 88px;
  resize: vertical;
}

.page-section--schedule .prebooking-capture-modal__section--notes-global {
  margin: 14px 0 0;
}

.page-section--schedule .prebooking-capture-modal__footer {
  flex-shrink: 0;
  padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(26, 24, 21, 0.07);
  background: #ffffff;
}

.page-section--schedule .prebooking-capture-modal__actions.modal__actions {
  margin: 0;
  width: 100%;
  justify-content: flex-end;
}

@media (max-width: 900px) {
  .page-section--schedule .prebooking-capture-modal__header.modal__header {
    padding: 14px 16px 10px;
  }

  .page-section--schedule .prebooking-capture-modal__body.modal__body {
    padding: 14px 16px 16px;
  }

  .page-section--schedule .prebooking-capture-modal__footer {
    padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px));
  }

  .page-section--schedule .prebooking-capture-modal__actions.modal__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: stretch;
    gap: 10px;
  }

  .page-section--schedule .prebooking-capture-modal__actions > *:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .page-section--schedule .prebooking-capture-modal__actions .btn {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }
}

html[data-theme="dark"] .page-section--schedule .modal.prebooking-capture-modal .prebooking-capture-modal__dialog {
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--panel-shadow);
}

html[data-theme="dark"] .page-section--schedule .prebooking-capture-modal__header.modal__header {
  background: var(--card);
  border-bottom-color: var(--border);
}

html[data-theme="dark"] .page-section--schedule .prebooking-capture-modal__eyebrow {
  color: #e3b008;
}

html[data-theme="dark"] .page-section--schedule .prebooking-capture-modal__title {
  color: var(--text);
}

html[data-theme="dark"] .page-section--schedule .prebooking-capture-modal__subtitle {
  color: var(--text-muted);
}

html[data-theme="dark"] .page-section--schedule .prebooking-capture-modal__body.modal__body {
  background: rgba(15, 23, 42, 0.65);
}

html[data-theme="dark"] .page-section--schedule .prebooking-capture-modal__footer {
  background: var(--card);
  border-top-color: var(--border);
}

html[data-theme="dark"] .page-section--schedule .prebooking-capture-modal__section {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .page-section--schedule .prebooking-capture-modal__section-title,
html[data-theme="dark"] .page-section--schedule .prebooking-capture-modal__notes-label {
  color: var(--text-muted);
}

html[data-theme="dark"] .page-section--schedule .prebooking-capture-modal__body label {
  color: var(--text-muted);
}

html[data-theme="dark"] .page-section--schedule .prebooking-capture-modal__body label input,
html[data-theme="dark"] .page-section--schedule .prebooking-capture-modal__body label textarea,
html[data-theme="dark"] .page-section--schedule .prebooking-capture-modal__notes-label textarea {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--text);
}

html[data-theme="dark"] .page-section--schedule .prebooking-capture-modal__body label select {
  background-color: rgba(15, 23, 42, 0.9);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6' fill='none' stroke='%2394a3b8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 1l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 10px;
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--text);
}

html[data-theme="dark"] .page-section--schedule .prebooking-capture-modal__quote-summary {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--text-muted);
}

/* --- 29. Week planner cleanup --- */

.page-section--schedule .schedule-planner--week .schedule-planner__scroll {
  overflow: auto;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.page-section--schedule .schedule-planner--week .schedule-planner__grid {
  min-width: 860px;
  grid-auto-rows: minmax(112px, auto);
  grid-template-columns: 160px repeat(7, minmax(100px, 1fr));
}

.page-section--schedule .schedule-planner--week .schedule-planner__corner,
.page-section--schedule .schedule-planner--week .schedule-planner__day-header {
  background: #fff;
  border-bottom: 1px solid var(--sch-rule);
  padding: 10px 12px;
  color: var(--sch-ink-3);
  font-size: 11px;
  font-weight: 700;
}

.page-section--schedule .schedule-planner--week .schedule-planner__day-header--today {
  background: var(--sch-accent-bg);
  border-bottom-color: var(--sch-accent-border);
  color: var(--sch-accent);
}

.page-section--schedule .schedule-planner--week .schedule-planner__day-header--weekend {
  background: #faf8f3;
}

.page-section--schedule .schedule-planner--week .schedule-planner__corner,
.page-section--schedule .schedule-planner--week .schedule-planner__member {
  left: 0;
  background: #fff;
  min-width: 0;
}

.page-section--schedule .schedule-planner--week .schedule-planner__member {
  padding: 10px 12px;
  color: var(--sch-ink-2);
  font-size: 12px;
  font-weight: 600;
}

.page-section--schedule .schedule-planner--week .schedule-planner__cell {
  min-width: 0;
  min-height: 112px;
  padding: 8px;
  background: #fff;
}

.page-section--schedule .schedule-planner--week .schedule-planner__cell--today {
  background: #fffcf4;
}

.page-section--schedule .schedule-planner--week .schedule-planner__cell--weekend {
  background: #fcfbf8;
}

.page-section--schedule .schedule-planner--week .schedule-planner__cell-list {
  gap: 6px;
}

.page-section--schedule .schedule-planner--week .schedule-planner-card {
  border-radius: 8px;
  padding: 6px 8px;
  box-shadow: none;
  transform: none;
}

.page-section--schedule .schedule-planner--week .schedule-planner-card:hover {
  transform: none;
  box-shadow: none;
  border-color: var(--sch-rule-strong);
}

@media (max-width: 900px) {
  .page-section--schedule .schedule-planner--week .schedule-planner__grid {
    min-width: 780px;
    grid-template-columns: 132px repeat(7, minmax(92px, 1fr));
  }
}

/* --- 30. Fullscreen planner alignment --- */

.page-section--schedule .schedule-fullscreen-modal .modal__overlay {
  background: rgba(26, 24, 21, 0.42);
}

/* Legacy .page-section--schedule .schedule-fullscreen-modal__dialog rule
   removed 2026-04-12 — its properties (position/background/border-radius/overflow)
   are now owned by .sched-modal__dialog--fullscreen in the canonical block. */

.page-section--schedule .schedule-fullscreen-modal__close {
  position: absolute;
  top: 16px;
  right: 18px;
  z-index: 5;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--sch-rule);
  box-shadow: none;
}

.page-section--schedule .schedule-fullscreen-modal__shell {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--canvas);
}

.page-section--schedule .schedule-fullscreen-modal__shell .schedule-main {
  padding: 0;
}

.page-section--schedule .schedule-fullscreen-modal__shell .schedule-card--calendar-fullscreen-shell,
.page-section--schedule .schedule-fullscreen-modal__shell .schedule-card--calendar {
  border: 0;
  border-radius: 0;
  box-shadow: none;
  background: transparent;
}

.page-section--schedule .schedule-fullscreen-modal__shell .schedule-toolbar {
  border-bottom: 1px solid var(--sch-rule);
  box-shadow: none;
}

.page-section--schedule .schedule-fullscreen-modal__shell .schedule-utilitybar,
.page-section--schedule .schedule-fullscreen-modal__shell .schedule-enlarge-btn {
  display: none;
}

.page-section--schedule .schedule-fullscreen-modal__shell .schedule-calendar {
  min-height: calc(100vh - 170px);
  min-height: calc(100dvh - 170px);
}

@media (max-width: 900px) {
  .page-section--schedule .schedule-fullscreen-modal__close {
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: 12px;
  }

  .page-section--schedule .schedule-fullscreen-modal__shell .schedule-calendar {
    min-height: calc(100vh - 198px);
    min-height: calc(100dvh - 198px);
  }
}

/* --- 31. Standalone calendar shell --- */

body.calendar-shell .page-section--schedule.page-section--schedule-shell {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 0;
}

body.calendar-shell .page-section--schedule.page-section--schedule-shell .schedule-workspace--shell {
  min-height: 100vh;
  min-height: 100dvh;
}

body.calendar-shell .page-section--schedule.page-section--schedule-shell .schedule-shell {
  padding: 0;
}

body.calendar-shell .page-section--schedule.page-section--schedule-shell .schedule-card--calendar {
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

body.calendar-shell .page-section--schedule.page-section--schedule-shell .schedule-toolbar {
  border-bottom: 1px solid var(--sch-rule);
  box-shadow: none;
}

body.calendar-shell .page-section--schedule.page-section--schedule-shell .schedule-utilitybar {
  padding-bottom: 12px;
}

/* --- 32. Mobile schedule authority ---
   Single source of truth for the schedule page at ≤900px (canonical
   tenant-app breakpoint). Owns the mobile bar, the filter sheet, and the
   month / week / day / list view treatments. */

@media (max-width: 900px) {
  body.schedule-mobile-filters-open {
    overflow: hidden;
  }

  body.schedule-mobile-filters-open .page-section--schedule .schedule-calendar {
    pointer-events: none;
  }

  .page-section--schedule .schedule-shell {
    padding: 0;
  }

  .page-section--schedule .schedule-main {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .page-section--schedule .schedule-card--calendar {
    border-left: 0;
    border-right: 0;
    border-radius: 0;
  }

  /* Two-row layout: (copy | actions) on row 1, planner on row 2.
     Saves a full row's vertical space versus the previous 3-row stack. */
  .page-section--schedule .schedule-mobile-bar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "copy actions"
      "planner planner";
    column-gap: 10px;
    row-gap: 8px;
    min-width: 0;
    position: sticky;
    top: 0;
    z-index: 40;
    margin: 0;
    padding: 10px 16px;
    border: 0;
    border-bottom: 1px solid var(--sch-rule);
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }

  .page-section--schedule .schedule-mobile-bar__copy {
    grid-area: copy;
    min-width: 0;
    align-self: center;
  }

  .page-section--schedule .schedule-mobile-bar__copy .schedule-eyebrow {
    margin: 0 0 1px;
    font-size: 0.6rem;
    letter-spacing: 0.16em;
  }

  .page-section--schedule .schedule-mobile-bar__range {
    display: block;
    font-size: 0.95rem;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page-section--schedule .schedule-mobile-bar__actions {
    grid-area: actions;
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
    min-width: 0;
    /* Safety net: if sync + settings + Filters collectively overflow on
       very narrow phones, allow horizontal scroll inside just this
       cluster instead of pushing copy off-screen. */
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: none;
  }

  .page-section--schedule .schedule-mobile-bar__actions::-webkit-scrollbar {
    display: none;
  }

  .page-section--schedule .schedule-mobile-bar__planner {
    grid-area: planner;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
  }

  .page-section--schedule .schedule-mobile-bar__view-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .page-section--schedule .schedule-mobile-bar__view-tabs .schedule-view-tab {
    width: 100%;
    justify-content: center;
    padding: 9px 8px;
    font-size: 0.82rem;
  }

  .page-section--schedule .schedule-mobile-bar__nav {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
    gap: 6px;
    width: 100%;
  }

  .page-section--schedule .schedule-mobile-bar__nav .schedule-nav-btn {
    width: 100%;
    justify-content: center;
  }

  /* Match Filters: all planner strip controls use btn-outline + shared compact sizing */
  .page-section--schedule .schedule-mobile-bar__action {
    font-size: 0.72rem;
    font-weight: 600;
    padding-inline: 8px;
    min-height: 32px;
    white-space: nowrap;
    flex: 0 0 auto;
  }

  .page-section--schedule .schedule-mobile-bar__actions .btn {
    min-height: 32px;
    flex: 0 0 auto;
  }

  .page-section--schedule .schedule-mobile-overlay[hidden] {
    display: none;
  }

  .page-section--schedule .schedule-mobile-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(26, 24, 21, 0.32);
    backdrop-filter: blur(2px);
    z-index: 1198;
  }

  .page-section--schedule .schedule-toolbar,
  .page-section--schedule .table-toolbar.schedule-toolbar {
    display: none;
    padding: 0;
    position: static;
    z-index: auto;
    border-bottom: 0;
  }

  .page-section--schedule .schedule-toolbar.is-mobile-open,
  .page-section--schedule .table-toolbar.schedule-toolbar.is-mobile-open {
    display: flex;
    position: fixed;
    inset: auto 0 0 0;
    z-index: 1199;
    margin: 0;
    background: transparent;
  }

  .page-section--schedule .schedule-toolbar.is-mobile-open .schedule-viewbar,
  .page-section--schedule .table-toolbar.schedule-toolbar.is-mobile-open .schedule-viewbar {
    display: none;
  }

  .page-section--schedule .schedule-toolbar.is-mobile-open .schedule-view-tabs,
  .page-section--schedule .table-toolbar.schedule-toolbar.is-mobile-open .schedule-view-tabs {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    padding: 4px;
  }

  .page-section--schedule .schedule-toolbar.is-mobile-open .schedule-view-tab,
  .page-section--schedule .table-toolbar.schedule-toolbar.is-mobile-open .schedule-view-tab {
    width: 100%;
    justify-content: center;
    padding: 9px 10px;
    font-size: 0.88rem;
  }

  .page-section--schedule .schedule-toolbar.is-mobile-open .schedule-viewbar__right,
  .page-section--schedule .table-toolbar.schedule-toolbar.is-mobile-open .schedule-viewbar__right {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: 8px;
  }

  .page-section--schedule .schedule-toolbar.is-mobile-open .schedule-range-label,
  .page-section--schedule .table-toolbar.schedule-toolbar.is-mobile-open .schedule-range-label {
    min-width: 0;
    font-size: 0.84rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .page-section--schedule .schedule-toolbar.is-mobile-open .schedule-nav,
  .page-section--schedule .table-toolbar.schedule-toolbar.is-mobile-open .schedule-nav {
    justify-self: center;
  }

  .page-section--schedule .schedule-toolbar.is-mobile-open .schedule-range-form,
  .page-section--schedule .table-toolbar.schedule-toolbar.is-mobile-open .schedule-range-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    width: 100%;
    padding: 16px 16px calc(18px + env(safe-area-inset-bottom, 0px));
    border: 0;
    border-radius: 20px 20px 0 0;
    background: #fff;
    box-shadow: 0 -18px 40px rgba(15, 23, 42, 0.18);
    max-height: min(78dvh, 720px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .page-section--schedule .schedule-toolbar.is-mobile-open .schedule-utilitybar,
  .page-section--schedule .table-toolbar.schedule-toolbar.is-mobile-open .schedule-utilitybar,
  .page-section--schedule .schedule-toolbar.is-mobile-open .schedule-legend,
  .page-section--schedule .table-toolbar.schedule-toolbar.is-mobile-open .schedule-legend {
    display: none;
  }

  .page-section--schedule .schedule-mobile-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(226, 232, 240, 0.85);
  }

  .page-section--schedule .schedule-mobile-sheet-header h4 {
    margin: 0;
    font-size: 1.12rem;
    line-height: 1.2;
  }

  .page-section--schedule .schedule-filter-stack {
    gap: 10px;
  }

  .page-section--schedule .schedule-filter-row--compact-main,
  .page-section--schedule .schedule-filter-row--compact-secondary {
    grid-template-columns: 1fr;
    gap: 10px;
    align-items: stretch;
  }

  /* Direct row labels only — not .schedule-filter-types label (would force 4 stacked rows). */
  .page-section--schedule .schedule-filter-row > label,
  .page-section--schedule .schedule-filter-search,
  .page-section--schedule .schedule-filter-start,
  .page-section--schedule .schedule-filter-end,
  .page-section--schedule .schedule-filter-inspector {
    width: 100%;
    min-width: 0;
  }

  .page-section--schedule .schedule-presets {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
  }

  .page-section--schedule .schedule-preset {
    width: 100%;
    justify-content: center;
    padding: 6px 4px;
    font-size: 0.72rem;
  }

  .page-section--schedule .schedule-toolbar.is-mobile-open .schedule-filter-actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    width: 100%;
    margin-left: 0;
    margin-top: 12px;
    padding: 12px 0 0;
    position: sticky;
    bottom: calc(env(safe-area-inset-bottom, 0px) * -1);
    background: #fff;
    z-index: 3;
    border-top: 1px solid rgba(226, 232, 240, 0.85);
  }

  .page-section--schedule .schedule-toolbar.is-mobile-open .schedule-filter-actions > *:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .page-section--schedule .schedule-toolbar.is-mobile-open .schedule-filter-actions .schedule-filter-reset,
  .page-section--schedule .schedule-toolbar.is-mobile-open .schedule-filter-actions .schedule-filter-apply {
    width: 100%;
    min-height: 44px;
    justify-content: center;
  }

  .page-section--schedule .schedule-toolbar.is-mobile-open .schedule-filter-actions .schedule-filter-dirty {
    grid-column: 1 / -1;
    text-align: center;
  }

  .page-section--schedule .schedule-toolbar.is-mobile-open .schedule-filter-types,
  .page-section--schedule .table-toolbar.schedule-toolbar.is-mobile-open .schedule-filter-types,
  body.calendar-shell .page-section--schedule .schedule-toolbar .schedule-filter-types,
  body.calendar-shell .page-section--schedule .table-toolbar.schedule-toolbar .schedule-filter-types,
  .page-section--schedule .schedule-fullscreen-modal__shell .schedule-toolbar .schedule-filter-types,
  .page-section--schedule .schedule-fullscreen-modal__shell .table-toolbar.schedule-toolbar .schedule-filter-types {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    align-items: stretch;
    width: 100%;
    flex: 1 1 auto;
  }

  .page-section--schedule .schedule-toolbar.is-mobile-open .schedule-filter-types label,
  .page-section--schedule .table-toolbar.schedule-toolbar.is-mobile-open .schedule-filter-types label,
  body.calendar-shell .page-section--schedule .schedule-toolbar .schedule-filter-types label,
  body.calendar-shell .page-section--schedule .table-toolbar.schedule-toolbar .schedule-filter-types label,
  .page-section--schedule .schedule-fullscreen-modal__shell .schedule-toolbar .schedule-filter-types label,
  .page-section--schedule .schedule-fullscreen-modal__shell .table-toolbar.schedule-toolbar .schedule-filter-types label {
    width: auto;
    min-width: 0;
    justify-self: stretch;
  }

  .page-section--schedule .schedule-toolbar.is-mobile-open .schedule-filter-types label span,
  .page-section--schedule .table-toolbar.schedule-toolbar.is-mobile-open .schedule-filter-types label span,
  body.calendar-shell .page-section--schedule .schedule-toolbar .schedule-filter-types label span,
  body.calendar-shell .page-section--schedule .table-toolbar.schedule-toolbar .schedule-filter-types label span,
  .page-section--schedule .schedule-fullscreen-modal__shell .schedule-toolbar .schedule-filter-types label span,
  .page-section--schedule .schedule-fullscreen-modal__shell .table-toolbar.schedule-toolbar .schedule-filter-types label span {
    width: 100%;
    justify-content: center;
    padding: 5px 8px;
    font-size: 11px;
    line-height: 1.25;
    border-radius: 999px;
    text-align: center;
  }

  .page-section--schedule .schedule-filter-dirty {
    grid-column: 1 / -1;
    text-align: center;
  }

  .page-section--schedule .schedule-utilitybar {
    padding: 10px 12px 12px;
    gap: 10px;
  }

  .page-section--schedule .schedule-utilitybar__meta,
  .page-section--schedule .schedule-utilitybar__tools {
    width: 100%;
  }

  /* Month grid fits the viewport — NO horizontal scroll. 7 columns at
     ~14% each on any phone width. */
  .page-section--schedule .schedule-calendar {
    overflow-x: visible;
  }

  .page-section--schedule .schedule-planner--month {
    min-width: 0;
  }

  .page-section--schedule .schedule-month__header {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  .page-section--schedule .schedule-month__weekday {
    padding: 8px 2px;
    font-size: 9px;
    letter-spacing: 0.04em;
  }

  .page-section--schedule .schedule-month__grid {
    grid-template-columns: repeat(7, minmax(0, 1fr));
  }

  /* Whole cell is the tap target — opens the day-details modal. */
  .page-section--schedule .schedule-month__cell {
    height: 72px;
    min-height: 72px;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(196, 149, 16, 0.14);
  }

  .page-section--schedule .schedule-month__cell:focus-visible {
    outline: 2px solid var(--sch-accent);
    outline-offset: -2px;
  }

  .page-section--schedule .schedule-month__cell-inner {
    padding: 6px 4px 5px;
    gap: 4px;
    overflow: hidden;
  }

  .page-section--schedule .schedule-month__cell-top {
    padding: 0;
  }

  .page-section--schedule .schedule-month__day-button {
    font-size: 11px;
    pointer-events: none;
  }

  /* Events: horizontal dot row instead of stacked chips. */
  .page-section--schedule .schedule-month__events {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 3px;
    padding: 0;
    align-content: flex-start;
    min-height: 0;
  }

  /* `--scrollable` is meaningless at dot size — undo vertical scroll. */
  .page-section--schedule .schedule-month__events--scrollable {
    overflow: visible;
    max-height: none;
  }

  /* Chip → coloured dot. Text hidden; the cell handles all taps. */
  .page-section--schedule .schedule-month-chip {
    width: 7px;
    height: 7px;
    padding: 0;
    margin: 0;
    border: 0;
    border-left: 0;
    border-radius: 50%;
    font-size: 0;
    line-height: 0;
    overflow: hidden;
    background: var(--sch-ink-4);
    pointer-events: none;
    transition: none;
  }

  .page-section--schedule .schedule-month__event-body {
    display: none;
  }

  /* Type-colour dots — strip background tint (inherited from desktop),
     colour the dot itself. */
  .page-section--schedule .schedule-month-chip.schedule-event--inspection {
    background: var(--sch-type-inspection);
  }
  .page-section--schedule .schedule-month-chip.schedule-event--pre-booking,
  .page-section--schedule .schedule-month-chip.schedule-event--pre_booking {
    background: var(--sch-type-prebooking);
  }
  .page-section--schedule .schedule-month-chip.schedule-event--fire-door,
  .page-section--schedule .schedule-month-chip.schedule-event--fire_door {
    background: var(--sch-type-firedoor);
  }
  .page-section--schedule .schedule-month-chip.schedule-event--remedial {
    background: var(--sch-type-remedial);
  }

  /* Hide chips beyond the first 3 — the `+N` badge takes their place. */
  .page-section--schedule .schedule-month__events > .schedule-month-chip:nth-of-type(n+4) {
    display: none;
  }

  /* `+N more` badge rendered by JS when >3 events. Sits on the dot row. */
  .page-section--schedule .schedule-month__more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 12px;
    min-width: 14px;
    padding: 0 4px;
    border-radius: 6px;
    background: var(--sch-inset);
    color: var(--sch-ink-3);
    font-size: 9px;
    font-weight: 700;
    line-height: 1;
    letter-spacing: 0;
    pointer-events: none;
  }

  .page-section--schedule .schedule-planner--week .schedule-planner__grid {
    min-width: 760px;
    grid-template-columns: 128px repeat(7, minmax(90px, 1fr));
  }

  .modal.schedule-day-details-modal {
    padding: 0;
    align-items: stretch;
    justify-content: stretch;
  }

  .modal.schedule-day-details-modal .schedule-day-details-modal__dialog {
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    max-block-size: 100vh;
    max-block-size: 100dvh;
    border-radius: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  .modal.schedule-day-details-modal .schedule-day-details-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    -webkit-overflow-scrolling: touch;
  }

  .modal.schedule-day-details-modal .schedule-day-details__list {
    flex: 1 1 auto;
    min-height: 0;
    padding-bottom: 16px;
  }

  body.calendar-shell .page-section--schedule.page-section--schedule-shell .schedule-mobile-bar,
  .page-section--schedule .schedule-fullscreen-modal__shell .schedule-mobile-bar,
  body.calendar-shell .page-section--schedule.page-section--schedule-shell .schedule-mobile-overlay,
  .page-section--schedule .schedule-fullscreen-modal__shell .schedule-mobile-overlay {
    display: none;
  }

  body.calendar-shell .page-section--schedule.page-section--schedule-shell .schedule-toolbar,
  body.calendar-shell .page-section--schedule.page-section--schedule-shell .table-toolbar.schedule-toolbar,
  .page-section--schedule .schedule-fullscreen-modal__shell .schedule-toolbar,
  .page-section--schedule .schedule-fullscreen-modal__shell .table-toolbar.schedule-toolbar {
    display: flex;
    position: static;
    z-index: auto;
    padding: 0;
    background: transparent;
  }

  body.calendar-shell .page-section--schedule.page-section--schedule-shell .schedule-viewbar,
  .page-section--schedule .schedule-fullscreen-modal__shell .schedule-viewbar {
    margin: 0;
    padding: 12px 16px 10px;
  }

  body.calendar-shell .page-section--schedule.page-section--schedule-shell .schedule-range-form,
  .page-section--schedule .schedule-fullscreen-modal__shell .schedule-range-form {
    display: flex;
    width: 100%;
    max-height: none;
    padding: 12px 16px 14px;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
    overflow: visible;
  }

  body.calendar-shell .page-section--schedule.page-section--schedule-shell .schedule-mobile-sheet-header,
  .page-section--schedule .schedule-fullscreen-modal__shell .schedule-mobile-sheet-header {
    display: none;
  }

  .page-section--schedule .schedule-fullscreen-modal__shell .schedule-calendar {
    min-height: calc(100vh - 208px);
    min-height: calc(100dvh - 208px);
  }
}

/* Narrow-phone refinements: two-column preset grid so labels like "This
   month" don't risk wrapping at 320–360px widths. */
@media (max-width: 400px) {
  .page-section--schedule .schedule-presets {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --- 33. Legacy schedule ownership extracted from global CSS --- */

body.calendar-shell {
  background: var(--canvas);
}

body.calendar-shell .calendar-shell-stage {
  min-height: 100vh;
  min-height: 100dvh;
}

.schedule-search-clear {
  position: absolute;
  right: 10px;
  bottom: 10px;
  width: 28px;
  height: 28px;
  border-radius: 10px;
  border: 1px solid rgba(203, 213, 225, 0.9);
  background: rgba(255, 255, 255, 0.95);
  color: #64748b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  line-height: 1;
}

.schedule-search-clear:hover {
  background: rgba(241, 245, 249, 0.95);
  color: #0f172a;
}

.schedule-day-details-modal__subtitle {
  margin: 2px 0 0 0;
}

.schedule-day-details-modal__dialog {
  width: min(980px, 100%);
  max-block-size: min(92dvh, 920px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.schedule-day-details-modal__header {
  position: sticky;
  top: 0;
  z-index: 2;
}

.schedule-day-details-modal__body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schedule-day-details__list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.schedule-status-alert {
  margin-top: 0.25rem;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(196, 149, 16, 0.2);
  background: #fdf6e3;
  color: #856404;
  font-size: 13px;
  line-height: 1.4;
}

/* ── Status modals (inspection / fire door / remedial) ── */

[data-inspection-status-modal] > .modal__overlay,
[data-firedoor-status-modal] > .modal__overlay,
[data-remedial-schedule-modal] > .modal__overlay {
  background: rgba(26, 24, 21, 0.42);
}

.page-section--schedule .schedule-status-modal__dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: min(88vh, 750px);
  border-radius: 14px;
  border: 1px solid rgba(26, 24, 21, 0.08);
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  background: #ffffff;
  box-shadow:
    0 4px 24px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(0, 0, 0, 0.04);
}

.page-section--schedule .schedule-status-modal__header.modal__header {
  flex-shrink: 0;
  padding: 18px 20px 14px;
  border-bottom: 1px solid rgba(26, 24, 21, 0.07);
  background: #ffffff;
  align-items: flex-start;
}

.page-section--schedule .schedule-status-modal__header-main {
  min-width: 0;
  flex: 1 1 auto;
  padding-right: 8px;
}

.page-section--schedule .schedule-status-modal__eyebrow {
  margin: 0 0 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c49510;
}

.page-section--schedule .schedule-status-modal__heading {
  margin: 0;
  font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: #1a1815;
}

.page-section--schedule .schedule-status-modal__body {
  padding: 16px 20px 18px;
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  background: #f7f5f0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.schedule-status-modal__summary {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 16px;
  border: 1px solid rgba(26, 24, 21, 0.08);
  border-radius: 10px;
  background: #ffffff;
}

.schedule-status-modal__summary-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.schedule-status-modal__summary-label {
  margin: 0;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #6b6458;
}

.schedule-status-modal__summary-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  color: #1a1815;
}

.schedule-status-modal__summary-meta {
  margin: 0;
  font-size: 13px;
  color: #6b6458;
  line-height: 1.4;
}

.schedule-status-modal__badge {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  flex-shrink: 0;
  color: #6b6458;
  font-size: 11px;
}

.schedule-status-modal__badge strong {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  background: #ffffff;
  border: 1px solid rgba(26, 24, 21, 0.12);
  color: #1a1815;
  font-size: 12px;
  font-weight: 700;
  text-transform: capitalize;
}

.schedule-status-modal__form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.schedule-status-modal__field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.schedule-status-modal__field > span {
  font-size: 13px;
  font-weight: 600;
  color: #1a1815;
}

.schedule-status-modal__field select,
.schedule-status-modal__field input {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(26, 24, 21, 0.12);
  background: #ffffff;
  font-size: 14px;
  font-weight: 500;
  color: #1a1815;
  transition: border-color 0.15s;
}

.schedule-status-modal__field select:focus,
.schedule-status-modal__field input:focus {
  outline: none;
  border-color: #c49510;
  box-shadow: 0 0 0 3px rgba(196, 149, 16, 0.12);
}

.schedule-status-modal__hint {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #6b6458;
}

.prebooking-convert-form {
  margin-top: 14px;
}

.prebooking-convert-form__btn {
  width: 100%;
}

.page-section--schedule .schedule-status-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-shrink: 0;
  padding: 12px 20px;
  border-top: 1px solid rgba(26, 24, 21, 0.07);
  background: #ffffff;
}

.page-section--schedule .schedule-status-modal__btn {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: none;
  transition: background 0.15s, border-color 0.15s;
}

.page-section--schedule .schedule-status-modal__btn--primary {
  border: 1px solid #1a1815;
  background: #1a1815;
  color: #fff;
}

.page-section--schedule .schedule-status-modal__btn--primary:hover,
.page-section--schedule .schedule-status-modal__btn--primary:focus-visible {
  border-color: #2a2723;
  background: #2a2723;
}

.page-section--schedule .schedule-status-modal__btn--secondary {
  border: 1px solid rgba(26, 24, 21, 0.14);
  background: #fff;
  color: #1a1815;
}

.page-section--schedule .schedule-status-modal__btn--secondary:hover,
.page-section--schedule .schedule-status-modal__btn--secondary:focus-visible {
  border-color: #c9bea9;
  background: #faf8f3;
}

/* ── Dark mode ── */

html[data-theme="dark"] .schedule-status-modal__dialog {
  background: rgba(15, 23, 42, 0.95);
  border-color: rgba(71, 85, 105, 0.58);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

html[data-theme="dark"] .schedule-status-modal__header.modal__header {
  background: rgba(15, 23, 42, 0.95);
  border-bottom-color: rgba(71, 85, 105, 0.38);
}

html[data-theme="dark"] .schedule-status-modal__eyebrow {
  color: #e3b008;
}

html[data-theme="dark"] .schedule-status-modal__heading {
  color: #f1f5f9;
}

html[data-theme="dark"] .schedule-status-modal__body {
  background: rgba(2, 6, 23, 0.42);
}

html[data-theme="dark"] .schedule-status-modal__summary {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(71, 85, 105, 0.38);
}

html[data-theme="dark"] .schedule-status-modal__summary-label {
  color: #94a3b8;
}

html[data-theme="dark"] .schedule-status-modal__summary-title {
  color: #f1f5f9;
}

html[data-theme="dark"] .schedule-status-modal__summary-meta {
  color: #94a3b8;
}

html[data-theme="dark"] .schedule-status-modal__badge {
  color: #94a3b8;
}

html[data-theme="dark"] .schedule-status-modal__badge strong {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(148, 163, 184, 0.22);
  color: #f1f5f9;
}

html[data-theme="dark"] .schedule-status-modal__field > span {
  color: #e2e8f0;
}

html[data-theme="dark"] .schedule-status-modal__field select,
html[data-theme="dark"] .schedule-status-modal__field input {
  background: rgba(15, 23, 42, 0.55);
  border-color: rgba(71, 85, 105, 0.58);
  color: #f1f5f9;
}

html[data-theme="dark"] .schedule-status-modal__field select:focus,
html[data-theme="dark"] .schedule-status-modal__field input:focus {
  border-color: #e3b008;
  box-shadow: 0 0 0 3px rgba(227, 176, 8, 0.15);
}

html[data-theme="dark"] .schedule-status-modal__hint {
  color: #94a3b8;
}

html[data-theme="dark"] .schedule-status-modal__footer {
  background: rgba(15, 23, 42, 0.95);
  border-top-color: rgba(71, 85, 105, 0.38);
}

html[data-theme="dark"] .schedule-status-modal__btn--primary {
  border-color: #e2e8f0;
  background: #e2e8f0;
  color: #0f172a;
}

html[data-theme="dark"] .schedule-status-modal__btn--secondary {
  border-color: rgba(148, 163, 184, 0.22);
  background: transparent;
  color: #e2e8f0;
}

@media (max-width: 900px) {
  .page-section--schedule .schedule-status-modal__footer {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
}

.schedule-fullscreen-modal__dialog {
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  border-radius: 0;
}

.schedule-fullscreen-modal__board {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.schedule-fullscreen-open {
  overflow: hidden;
}

.schedule-calendar--fullscreen {
  min-height: 0;
}

.schedule-calendar--fullscreen.schedule-calendar--planner {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.schedule-calendar--fullscreen .schedule-planner {
  flex: 1 1 auto;
  min-height: 0;
}

.schedule-calendar--fullscreen .schedule-planner--week {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

.schedule-calendar--fullscreen .schedule-planner--week .schedule-planner__scroll {
  flex: 1 1 auto;
  min-height: 0;
}

.schedule-calendar--fullscreen .schedule-planner--week .schedule-planner__grid {
  min-height: 100%;
}

.schedule-calendar.schedule-density--compact .schedule-planner__cell-list {
  gap: 4px;
}

.schedule-calendar.schedule-density--compact .schedule-planner-card {
  padding: 6px 8px;
  border-radius: 10px;
}

.schedule-calendar.schedule-density--compact .schedule-planner-card__title {
  font-size: 0.82rem;
}

.schedule-calendar.schedule-density--compact .schedule-planner-card__meta {
  font-size: 0.74rem;
}

.schedule-calendar.schedule-density--compact .schedule-month__cell {
  padding: 8px;
}

.schedule-calendar.schedule-density--compact .schedule-month-chip {
  padding: 4px 6px;
  font-size: 0.74rem;
}

.schedule-calendar.schedule-density--compact .schedule-day__list {
  gap: 8px;
}

.schedule-calendar.schedule-density--compact .schedule-day-row {
  padding: 8px 10px;
  border-radius: 12px;
}

.schedule-calendar.schedule-density--compact .schedule-event-list {
  gap: 6px;
}

.schedule-calendar.schedule-density--compact .schedule-event {
  padding: 6px 16px 6px 8px;
  border-radius: 10px;
  font-size: 0.82rem;
}

.schedule-calendar.schedule-density--compact .schedule-event__title {
  font-size: 0.9rem;
}

.schedule-event-list--scrollable {
  max-height: 13rem;
  overflow-y: auto;
  padding-right: 6px;
  scrollbar-width: thin;
  scrollbar-color: rgba(15, 23, 42, 0.35) transparent;
}

.schedule-event-list--scrollable::-webkit-scrollbar {
  width: 6px;
}

.schedule-event-list--scrollable::-webkit-scrollbar-thumb {
  background: rgba(15, 23, 42, 0.35);
  border-radius: 999px;
}

.schedule-event-list--scrollable::-webkit-scrollbar-track {
  background: transparent;
}

.schedule-month__events.schedule-event-list--scrollable > * {
  flex: 0 0 auto;
}

.schedule-event__actions {
  position: absolute;
  top: 6px;
  right: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.schedule-event__delete-btn {
  border: none;
  background: transparent;
  color: #94a3b8;
  font-size: 0.9rem;
  line-height: 1;
  padding: 0 4px;
  cursor: pointer;
  transition: color 0.15s ease;
}

.schedule-event__delete-btn:hover {
  color: #1a1815;
}

.schedule-event__delete-btn:focus-visible {
  outline: 2px solid #1a1815;
  outline-offset: 2px;
}

.schedule-event--status-scheduled,
.schedule-event--status-pending {
  border-color: rgba(37, 99, 235, 0.65);
  background: rgba(59, 130, 246, 0.12);
}

.schedule-event--status-in_progress {
  border-color: rgba(234, 179, 8, 0.8);
  background: rgba(250, 204, 21, 0.18);
}

.schedule-event--status-completed,
.schedule-event--status-verified {
  border-color: rgba(22, 163, 74, 0.8);
  background: rgba(34, 197, 94, 0.18);
}

.schedule-event--status-cancelled,
.schedule-event--status-rejected {
  border-color: rgba(239, 68, 68, 0.85);
  background: rgba(248, 113, 113, 0.22);
}

html[data-theme="dark"] .schedule-search-clear {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(148, 163, 184, 0.28);
  color: rgba(226, 232, 240, 0.78);
}

html[data-theme="dark"] .schedule-search-clear:hover {
  background: rgba(30, 41, 59, 0.75);
  color: rgba(248, 250, 252, 0.96);
}

html[data-theme="dark"] .schedule-day-details-modal__subtitle {
  color: rgba(148, 163, 184, 0.92);
}

html[data-theme="dark"] .schedule-month__events.schedule-event-list--scrollable {
  scrollbar-color: rgba(148, 163, 184, 0.28) transparent;
}

html[data-theme="dark"] .schedule-month__events.schedule-event-list--scrollable::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.28);
}

html[data-theme="dark"] .schedule-status-alert {
  background: rgba(251, 191, 36, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.22);
  color: #fdba74;
}

html[data-theme="dark"] .schedule-today-strip {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(148, 163, 184, 0.24);
}

html[data-theme="dark"] .schedule-today-strip__summary {
  color: rgba(226, 232, 240, 0.78);
}

html[data-theme="dark"] .schedule-card,
html[data-theme="dark"] .schedule-panel,
html[data-theme="dark"] .schedule-card--bookings {
  background: var(--card);
  border-color: var(--border);
  box-shadow: var(--panel-shadow);
}

html[data-theme="dark"] .schedule-section-title__icon {
  background: rgba(59, 130, 246, 0.16);
  color: #93c5fd;
  box-shadow: 0 10px 18px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .schedule-accordion__body {
  border-top-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .schedule-accordion__count {
  background: rgba(15, 23, 42, 0.7);
  border-color: rgba(148, 163, 184, 0.28);
  color: rgba(248, 250, 252, 0.96);
}

html[data-theme="dark"] .schedule-accordion__chevron {
  border-right-color: rgba(226, 232, 240, 0.6);
  border-bottom-color: rgba(226, 232, 240, 0.6);
}

html[data-theme="dark"] .schedule-filter-types {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(148, 163, 184, 0.28);
}

html[data-theme="dark"] .schedule-filter-actions {
  background: rgba(2, 6, 23, 0.62);
  border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .schedule-filter-types label {
  color: var(--text);
}

html[data-theme="dark"] .schedule-filter-types label span {
  background: rgba(15, 23, 42, 0.75) !important;
  border-color: rgba(148, 163, 184, 0.28) !important;
  color: rgba(226, 232, 240, 0.92) !important;
}

html[data-theme="dark"] .schedule-filter-types label:hover span {
  background: rgba(30, 41, 59, 0.72) !important;
  border-color: rgba(59, 130, 246, 0.35) !important;
}

html[data-theme="dark"] .schedule-filter-types input[type='checkbox']:checked + span {
  background: rgba(248, 250, 252, 0.96) !important;
  color: #1a1815 !important;
  border-color: rgba(248, 250, 252, 0.96) !important;
}

html[data-theme="dark"] .schedule-filter-types input[type='checkbox']:focus-visible + span {
  outline-color: rgba(248, 250, 252, 0.96);
}

html[data-theme="dark"] .schedule-filter-row label,
html[data-theme="dark"] .schedule-filter-search {
  color: var(--text-muted);
}

html[data-theme="dark"] .schedule-toolbar .schedule-range-form {
  background: rgba(2, 6, 23, 0.62);
  border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .schedule-toolbar .schedule-filter-row input[type='date'],
html[data-theme="dark"] .schedule-toolbar .schedule-filter-row input[type='search'],
html[data-theme="dark"] .schedule-toolbar .schedule-filter-row select,
html[data-theme="dark"] .schedule-toolbar .schedule-filter-search input {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(148, 163, 184, 0.28);
  color: var(--text);
}

html[data-theme="dark"] .schedule-toolbar .schedule-filter-row input::placeholder,
html[data-theme="dark"] .schedule-toolbar .schedule-filter-search input::placeholder {
  color: rgba(148, 163, 184, 0.85);
}

html[data-theme="dark"] .schedule-quick-ranges {
  background: transparent;
}

html[data-theme="dark"] .schedule-quick-range {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(148, 163, 184, 0.28);
  color: rgba(226, 232, 240, 0.78);
}

html[data-theme="dark"] .schedule-quick-range:hover {
  background: rgba(30, 41, 59, 0.72);
  border-color: rgba(59, 130, 246, 0.35);
  color: rgba(248, 250, 252, 0.96);
}

html[data-theme="dark"] .schedule-density-toggle {
  background: rgba(148, 163, 184, 0.12);
}

html[data-theme="dark"] .schedule-density-option {
  color: rgba(226, 232, 240, 0.72);
}

html[data-theme="dark"] .schedule-density-option.is-active {
  background: rgba(15, 23, 42, 0.75);
  color: rgba(248, 250, 252, 0.96);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .schedule-presets {
  background: transparent;
  border-color: transparent;
}

html[data-theme="dark"] .schedule-preset {
  background: rgba(15, 23, 42, 0.6);
  border-color: rgba(148, 163, 184, 0.22);
  color: rgba(226, 232, 240, 0.82);
}

html[data-theme="dark"] .schedule-preset.is-active {
  background: rgba(248, 250, 252, 0.96);
  color: #1a1815;
  border-color: rgba(248, 250, 252, 0.96);
  box-shadow: none;
}

html[data-theme="dark"] .schedule-preset:hover {
  background: rgba(30, 41, 59, 0.55);
  border-color: rgba(59, 130, 246, 0.3);
  color: rgba(248, 250, 252, 0.96);
}

html[data-theme="dark"] .schedule-filter-chip {
  background: rgba(15, 23, 42, 0.75);
  border-color: rgba(148, 163, 184, 0.28);
  color: rgba(226, 232, 240, 0.9);
}

html[data-theme="dark"] .schedule-filter-chip:hover {
  background: rgba(30, 41, 59, 0.72);
  border-color: rgba(59, 130, 246, 0.35);
  color: rgba(248, 250, 252, 0.96);
}

html[data-theme="dark"] .schedule-filter-chip__x {
  color: rgba(148, 163, 184, 0.85);
}

html[data-theme="dark"] .schedule-stat {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .schedule-stat__icon {
  box-shadow: 0 8px 14px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .schedule-stat__label {
  color: var(--text-muted);
}

html[data-theme="dark"] .schedule-stat strong {
  color: var(--text);
}

html[data-theme="dark"] .schedule-view-tabs {
  background: rgba(148, 163, 184, 0.12);
}

html[data-theme="dark"] .schedule-view-tab {
  color: rgba(226, 232, 240, 0.72);
}

html[data-theme="dark"] .schedule-view-tab.is-active {
  background: rgba(15, 23, 42, 0.9);
  color: rgba(248, 250, 252, 0.96);
  box-shadow: none;
}

html[data-theme="dark"] .schedule-empty-card {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(148, 163, 184, 0.28);
}

html[data-theme="dark"] .schedule-empty-card h4 {
  color: var(--text);
}

html[data-theme="dark"] .schedule-calendar__column {
  background: rgba(15, 23, 42, 0.65);
  border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .schedule-calendar {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.75), rgba(2, 6, 23, 0.45));
  border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .schedule-calendar__column:hover {
  border-color: rgba(59, 130, 246, 0.28);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .schedule-panel-table {
  background: rgba(2, 6, 23, 0.5);
  border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .schedule-panel-table thead th {
  background: rgba(2, 6, 23, 0.72);
  color: rgba(148, 163, 184, 0.92);
}

html[data-theme="dark"] .schedule-month__weekday,
html[data-theme="dark"] .schedule-month__more {
  color: rgba(226, 232, 240, 0.85);
}

html[data-theme="dark"] .schedule-month__cell {
  background: rgba(15, 23, 42, 0.6) !important;
  border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .schedule-planner--month .schedule-month__header {
  background: rgba(2, 6, 23, 0.88);
  border-bottom-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .schedule-month__cell--weekend {
  background: rgba(148, 163, 184, 0.08);
}

html[data-theme="dark"] .schedule-month__cell-top {
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.68));
}

html[data-theme="dark"] .schedule-month__cell--weekend .schedule-month__cell-top {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.64));
}

html[data-theme="dark"] .schedule-month__day-button {
  background: rgba(248, 250, 252, 0.16);
  color: rgba(248, 250, 252, 0.96);
  border: 1px solid rgba(148, 163, 184, 0.3);
}

html[data-theme="dark"] .schedule-month__day-dow {
  color: rgba(148, 163, 184, 0.92);
}

html[data-theme="dark"] .schedule-month__day-num {
  background: rgba(59, 130, 246, 0.18);
  color: rgba(248, 250, 252, 0.96);
}

html[data-theme="dark"] .schedule-month__day-button:hover {
  background: rgba(59, 130, 246, 0.22);
  border-color: rgba(59, 130, 246, 0.35);
}

html[data-theme="dark"] .schedule-month__day-button--today {
  background: rgba(59, 130, 246, 0.28);
  border-color: rgba(59, 130, 246, 0.45);
  box-shadow: 0 12px 24px rgba(59, 130, 246, 0.12);
}

html[data-theme="dark"] .schedule-month-chip {
  background: rgba(2, 6, 23, 0.62);
  border-color: rgba(148, 163, 184, 0.22);
  color: var(--text);
}

html[data-theme="dark"] .schedule-planner__scroll {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(2, 6, 23, 0.55);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .schedule-planner__corner,
html[data-theme="dark"] .schedule-planner__day-header {
  background: rgba(2, 6, 23, 0.92);
  border-bottom-color: rgba(148, 163, 184, 0.2);
  color: var(--text);
}

html[data-theme="dark"] .schedule-planner__day-header--today {
  background: linear-gradient(180deg, rgba(59, 130, 246, 0.22), rgba(2, 6, 23, 0.92));
  border-bottom-color: rgba(59, 130, 246, 0.35);
}

html[data-theme="dark"] .schedule-planner__day-header--weekend {
  background: rgba(15, 23, 42, 0.9);
}

html[data-theme="dark"] .schedule-planner__corner {
  border-right-color: rgba(148, 163, 184, 0.2);
}

html[data-theme="dark"] .schedule-planner__member {
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(15, 23, 42, 0.72) 100%);
  border-right-color: rgba(148, 163, 184, 0.2);
  border-bottom-color: rgba(148, 163, 184, 0.18);
  color: var(--text);
}

html[data-theme="dark"] .schedule-planner__cell {
  border-bottom-color: rgba(148, 163, 184, 0.16);
  border-right-color: rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.52);
}

html[data-theme="dark"] .schedule-planner__cell--today {
  background: rgba(59, 130, 246, 0.1);
}

html[data-theme="dark"] .schedule-planner__cell--weekend {
  background: rgba(148, 163, 184, 0.08);
}

html[data-theme="dark"] .schedule-planner__cell--dragover {
  background: rgba(59, 130, 246, 0.14);
}

html[data-theme="dark"] .schedule-planner-card {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.22);
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.45);
}

html[data-theme="dark"] .schedule-planner-card__title {
  color: var(--text);
}

html[data-theme="dark"] .schedule-planner-card__meta {
  color: rgba(148, 163, 184, 0.92);
}

html[data-theme="dark"] .schedule-day-details-row {
  background: rgba(15, 23, 42, 0.72);
  border-color: rgba(148, 163, 184, 0.22);
}

html[data-theme="dark"] .schedule-day-details-row:hover {
  border-color: rgba(59, 130, 246, 0.35);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .schedule-day-details-row__time {
  color: rgba(226, 232, 240, 0.9);
}

html[data-theme="dark"] .schedule-day-details-row__meta {
  color: rgba(148, 163, 184, 0.92);
}

html[data-theme="dark"] .schedule-kpi {
  border-color: rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.65);
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .schedule-kpi--warn {
  border-color: rgba(234, 179, 8, 0.28);
  background: rgba(234, 179, 8, 0.1);
}

html[data-theme="dark"] .schedule-kpi--good {
  border-color: rgba(16, 185, 129, 0.22);
  background: rgba(16, 185, 129, 0.1);
}

html[data-theme="dark"] .schedule-kpi--person {
  border-color: rgba(59, 130, 246, 0.22);
  background: rgba(59, 130, 246, 0.12);
}

html[data-theme="dark"] .schedule-kpi__label {
  color: rgba(148, 163, 184, 0.92);
}

html[data-theme="dark"] .schedule-kpi__value {
  color: var(--text);
}

/* --- Calendar PWA install (?page=schedule-install) --- */

body.calendar-install .schedule-install-page {
  background: var(--ipi-bg, #f7f5f0);
  color: var(--ipi-ink, #1a1815);
}

body.calendar-install .schedule-install-page .inspections-proto {
  margin-inline: 0;
}

body.calendar-install .schedule-install-page .ipi-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  padding: 22px var(--ipi-page-gutter, 28px) 20px;
  margin: 0 auto;
  max-width: 920px;
  box-sizing: border-box;
  background: var(--ipi-bg-card, #ffffff);
  border-bottom: 1px solid var(--ipi-rule, rgba(0, 0, 0, 0.07));
  box-shadow: var(--ipi-shadow-sm, 0 1px 3px rgba(0, 0, 0, 0.06));
}

body.calendar-install .schedule-install-page .ipi-ph-left {
  flex: 1 1 260px;
  min-width: 0;
}

body.calendar-install .schedule-install-page .ipi-ph-eyebrow {
  display: block;
  margin: 0 0 6px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ipi-accent, #c49510);
}

body.calendar-install .schedule-install-page .ipi-ph-title,
body.calendar-install .schedule-install-page h1.ipi-ph-title {
  margin: 0 0 10px;
  font-family: var(--font-display, "Space Grotesk", system-ui, sans-serif);
  font-size: clamp(1.375rem, 2.8vw, 1.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ipi-ink, #1a1815);
  max-width: 38rem;
}

body.calendar-install .schedule-install-page .ipi-ph-sub {
  margin: 0;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ipi-ink-3, #6b6458);
  max-width: 40rem;
}

body.calendar-install .schedule-install-page .ipi-ph-sub strong {
  color: var(--ipi-ink-2, #3d3a34);
  font-weight: 600;
}

body.calendar-install .schedule-install-page .ipi-ph-right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 2px;
}

body.calendar-install .schedule-install__body {
  padding: 12px var(--ipi-page-gutter, 28px) 32px;
  max-width: 920px;
  margin-inline: auto;
  box-sizing: border-box;
}

body.calendar-install .schedule-install__device-hint {
  margin: 0 0 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--ipi-ink-3, #6b6458);
}

body.calendar-install .schedule-install__hero {
  display: grid;
  grid-template-columns: minmax(0, 140px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  margin-bottom: 16px;
}

@media (max-width: 640px) {
  body.calendar-install .schedule-install__hero {
    grid-template-columns: 1fr;
  }
}

body.calendar-install .schedule-install__icon-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 16px 12px;
  background: var(--ipi-bg-card, #fff);
  border-radius: 12px;
  box-shadow: var(--ipi-shadow-card, 0 1px 4px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.05));
}

body.calendar-install .schedule-install__icon-preview img {
  width: 96px;
  height: 96px;
  border-radius: 20px;
  display: block;
}

body.calendar-install .schedule-install__icon-caption {
  margin: 12px 0 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--ipi-ink-4, #9a9188);
}

body.calendar-install .schedule-install__card {
  background: var(--ipi-bg-card, #fff);
  border-radius: 12px;
  box-shadow: var(--ipi-shadow-card, 0 1px 4px rgba(0, 0, 0, 0.06), 0 0 0 1px rgba(0, 0, 0, 0.05));
  padding: 20px 22px;
  margin-bottom: 14px;
}

body.calendar-install .schedule-install__card--muted {
  background: var(--ipi-bg-inset, #edeae3);
  box-shadow: none;
  border: 1px solid var(--ipi-rule, rgba(0, 0, 0, 0.07));
}

body.calendar-install .schedule-install__h2 {
  margin: 0 0 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--ipi-rule-h, rgba(0, 0, 0, 0.11));
  font-family: var(--font-display, "Space Grotesk", system-ui, sans-serif);
  font-size: 1.0625rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.02em;
  color: var(--ipi-ink, #1a1815);
}

body.calendar-install .schedule-install__steps {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ipi-ink-2, #3d3a34);
}

body.calendar-install .schedule-install__steps li {
  margin-bottom: 8px;
}

body.calendar-install .schedule-install__steps li:last-child {
  margin-bottom: 0;
}

body.calendar-install .schedule-install__bullets {
  margin: 0 0 16px;
  padding-left: 1.2rem;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ipi-ink-2, #3d3a34);
}

body.calendar-install .schedule-install__bullets li {
  margin-bottom: 8px;
}

body.calendar-install .schedule-install__bullets li:last-child {
  margin-bottom: 0;
}

body.calendar-install .schedule-install__callout {
  margin: 14px 0 0;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ipi-ink-3, #6b6458);
  background: var(--ipi-accent-bg, rgba(196, 149, 16, 0.08));
  border: 1px solid var(--ipi-accent-border, rgba(196, 149, 16, 0.22));
  border-radius: 10px;
}

body.calendar-install .schedule-install__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
}

body.calendar-install .schedule-install__actions-note {
  font-size: 12px;
  line-height: 1.45;
  flex: 1 1 200px;
}

body.calendar-install .schedule-install__intro-card .schedule-install__bullets {
  margin-bottom: 18px;
}

body.calendar-install .ipi-ph-right .btn svg {
  width: 16px;
  height: 16px;
}

html[data-theme="dark"] body.calendar-install .schedule-install-page {
  --ipi-bg: #0f172a;
  --ipi-bg-card: rgba(15, 23, 42, 0.92);
  --ipi-bg-inset: rgba(30, 41, 59, 0.85);
  --ipi-ink: #f1f5f9;
  --ipi-ink-2: #e2e8f0;
  --ipi-ink-3: #94a3b8;
  --ipi-ink-4: #64748b;
  --ipi-rule: rgba(148, 163, 184, 0.2);
  --ipi-rule-h: rgba(148, 163, 184, 0.28);
  --ipi-shadow-card: 0 16px 30px rgba(0, 0, 0, 0.45);
  --ipi-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.35);
  --ipi-accent: #eab308;
  --ipi-accent-bg: rgba(234, 179, 8, 0.12);
  --ipi-accent-border: rgba(234, 179, 8, 0.28);
}

html[data-theme="dark"] body.calendar-install .schedule-install__icon-preview img {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* ============================================================================
   Schedule canonical modal primitives — `.sched-modal*`
   ----------------------------------------------------------------------------
   Canonical umbrella chrome block for all Schedule/pre-bookings modals. Every
   schedule modal shares the same shell, inputs, footer slots and mobile
   bottom-sheet behaviour. Values lifted from settings-shell.css `.set-modal`
   block (~line 6320).
   ============================================================================ */

.sched-modal {
    --sched-accent: var(--accent, #c49510);
    --sched-accent-soft: var(--accent-soft, rgba(196, 149, 16, 0.1));
    --sched-accent-strong: rgba(196, 149, 16, 0.34);
    --sched-ink: var(--ink, #1a1815);
    --sched-ink-muted: var(--ink-3, #6b6458);
    --sched-ink-faint: var(--ink-4, #9a9188);
    --sched-border: var(--rule, rgba(26, 24, 21, 0.08));
    --sched-border-rule: rgba(26, 24, 21, 0.07);
    --sched-border-input: rgba(26, 24, 21, 0.14);
    --sched-bg-warm: #f7f5f0;
    --sched-surface: var(--surface-card, #ffffff);
    --sched-surface-soft: #fcfaf4;

    /* --ipi-* token aliases so canonical primitives (.ipi-tabs, .ipi-tab,
       .ipi-filter-search) render correctly inside the modal scope. */
    --ipi-bg: var(--canvas, #f7f5f0);
    --ipi-bg-inset: var(--surface-inset, #edeae3);
    --ipi-bg-card: var(--surface-card, #ffffff);
    --ipi-bg-hover: rgba(26, 24, 21, 0.04);
    --ipi-rule: var(--rule, rgba(26, 24, 21, 0.08));
    --ipi-rule-h: rgba(26, 24, 21, 0.11);
    --ipi-ink: var(--ink, #1a1815);
    --ipi-ink-2: #3d3a34;
    --ipi-ink-3: var(--ink-3, #6b6458);
    --ipi-ink-4: var(--ink-4, #9a9188);
    --ipi-accent: var(--accent, #c49510);
    --ipi-accent-bg: rgba(196, 149, 16, 0.08);
    --ipi-accent-border: rgba(196, 149, 16, 0.34);
    --ipi-shadow-sm: 0 1px 3px rgba(26, 24, 21, 0.06), 0 1px 2px rgba(26, 24, 21, 0.04);
    --ipi-shadow-card: 0 1px 4px rgba(26, 24, 21, 0.06), 0 0 0 1px rgba(26, 24, 21, 0.05);
}

/* Default dialog: content-driven height. Use --stable on tabbed/multi-state modals. */
.sched-modal .sched-modal__dialog {
    width: min(880px, calc(100vw - 32px));
    max-height: min(90vh, 960px);
    border-radius: 16px;
    border: 1px solid var(--sched-border);
    background: var(--sched-surface);
    box-shadow:
        0 20px 60px rgba(0, 0, 0, 0.18),
        0 4px 16px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
}

/* Higher-specificity --stable rule so it wins over the legacy
   .page-section--schedule .modal.schedule-sync-modal .schedule-sync-modal__dialog
   and .prebooking-capture-modal__dialog rules (specificity 0,4,0) which both
   set min-height: 0. */
.modal.sched-modal .sched-modal__dialog--stable,
.page-section--schedule .modal.sched-modal .sched-modal__dialog--stable.schedule-sync-modal__dialog,
.page-section--schedule .modal.sched-modal .sched-modal__dialog--stable.prebooking-capture-modal__dialog {
    height: min(85vh, 760px);
    min-height: min(60vh, 520px);
    max-height: min(90vh, 960px);
}

.sched-modal .sched-modal__dialog--narrow {
    width: min(560px, calc(100vw - 32px));
}

.sched-modal .sched-modal__dialog--wide {
    width: min(1280px, calc(100vw - 32px));
}

/* Fullscreen variant — full viewport canvas takeover (e.g. schedule planner).
   !important required to override the canonical .modal--sheet mobile rule
   in style.css which otherwise forces standard full-screen dialog chrome. */
.sched-modal .sched-modal__dialog--fullscreen {
    width: 100vw !important;
    max-width: none !important;
    height: 100dvh !important;
    max-height: none !important;
    min-height: 100dvh !important;
    border-radius: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    margin: 0 !important;
    background: var(--canvas);
    overflow: auto;
    padding: 0;
}

.sched-modal .sched-modal__dialog--fullscreen .modal__body.sched-modal__body {
    padding: 0;
    overflow: hidden;
    flex: 1 1 auto;
    min-height: 0;
    background: transparent;
}

.modal.sched-modal.schedule-fullscreen-modal {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
}

/* Form wrapping body+footer must be flex so body's overflow-y:auto has a
   constrained parent. */
.sched-modal form {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    margin: 0;
    width: 100%;
}

.sched-modal .sched-modal__header {
    padding: 20px 22px 16px;
    border-bottom: 1px solid var(--sched-border-rule);
    flex-shrink: 0;
    background: var(--sched-surface);
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.sched-modal .sched-modal__header > div:first-child {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
    flex: 1 1 auto;
}

.sched-modal .sched-modal__header-tools {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.sched-modal .sched-modal__header .eyebrow {
    margin: 0;
    color: var(--sched-accent);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.sched-modal .sched-modal__header .modal__title,
.sched-modal .sched-modal__header h3 {
    margin: 0;
    font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
    font-size: 1.28rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--sched-ink);
}

.sched-modal .sched-modal__header .text-muted,
.sched-modal .sched-modal__header > div > p:not(.eyebrow) {
    margin: 4px 0 0;
    max-width: 60ch;
    color: var(--sched-ink-muted);
    font-size: 13px;
    font-weight: 400;
    line-height: 1.45;
}

.sched-modal .modal__close {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--surface-inset, #edeae3);
    border: none;
    color: var(--sched-ink-muted);
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.15s ease, color 0.15s ease;
}

.sched-modal .modal__close:hover {
    background: rgba(26, 24, 21, 0.1);
    color: var(--sched-ink);
}

.sched-modal .sched-modal__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    padding: 20px 22px 22px;
    background: var(--sched-bg-warm);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sched-modal .sched-modal__footer {
    padding: 13px 22px 14px;
    border-top: 1px solid var(--sched-border-rule);
    background: var(--sched-surface);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.sched-modal .sched-modal__footer-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.sched-modal .sched-modal__footer-copy strong {
    font-family: var(--font-display, 'Space Grotesk', system-ui, sans-serif);
    font-size: 13px;
    font-weight: 700;
    color: var(--sched-ink);
}

.sched-modal .sched-modal__footer-copy p {
    margin: 0;
    font-size: 12px;
    color: var(--sched-ink-faint);
}

.sched-modal .sched-modal__footer-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.sched-modal .sched-modal__footer .btn {
    min-height: 40px;
    padding: 8px 18px;
}

/* --------------------------------------------------------------------------
   .sched-modal--danger — destructive action modifier (Delete booking)
   `!important` on color required to beat canonical eyebrow rule per css-standards gotcha #10.
   -------------------------------------------------------------------------- */
.modal.sched-modal.sched-modal--danger .sched-modal__header .eyebrow {
    color: var(--danger, #b03030) !important;
}

.modal.sched-modal.sched-modal--danger .sched-modal__footer-actions .btn-danger {
    background: var(--danger, #b03030);
    color: #ffffff;
    border: none;
    font-weight: 600;
}

.modal.sched-modal.sched-modal--danger .sched-modal__footer-actions .btn-danger:hover {
    background: #952828;
}

html[data-theme="dark"] .modal.sched-modal.sched-modal--danger .sched-modal__header .eyebrow {
    color: #f87171 !important;
}

html[data-theme="dark"] .modal.sched-modal.sched-modal--danger .sched-modal__footer-actions .btn-danger {
    background: #dc2626;
}

html[data-theme="dark"] .modal.sched-modal.sched-modal--danger .sched-modal__footer-actions .btn-danger:hover {
    background: #b91c1c;
}

/* Form controls */
.sched-modal :where(input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], input[type="url"], input[type="search"], input[type="date"], input[type="time"], input[type="datetime-local"], select, textarea) {
    min-height: 40px;
    padding: 10px 13px;
    border-radius: 9px;
    border: 1px solid var(--sched-border-input);
    background: var(--sched-surface);
    font-family: var(--font-sans, inherit);
    font-size: 13.5px;
    font-weight: 400;
    text-transform: none;
    letter-spacing: normal;
    color: var(--sched-ink);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    box-sizing: border-box;
    width: 100%;
}

.sched-modal :where(input[type="text"], input[type="email"], input[type="password"], input[type="number"], input[type="tel"], input[type="url"], input[type="search"], input[type="date"], input[type="datetime-local"], select, textarea):focus {
    border-color: var(--sched-accent-strong);
    box-shadow: 0 0 0 3px var(--sched-accent-soft);
    outline: none;
}

.sched-modal textarea {
    min-height: 72px;
    resize: vertical;
    line-height: 1.5;
}

.sched-modal select {
    padding-right: 34px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%239a9188' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 5l3 3 3-3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    cursor: pointer;
}

/* Dark mode */
html[data-theme="dark"] .sched-modal {
    --sched-surface: #0f172a;
    --sched-surface-soft: rgba(15, 23, 42, 0.6);
    --sched-bg-warm: #0b1220;
    --sched-ink: #e2e8f0;
    --sched-ink-muted: #94a3b8;
    --sched-ink-faint: #94a3b8;
    --sched-border: rgba(148, 163, 184, 0.22);
    --sched-border-rule: rgba(148, 163, 184, 0.18);
    --sched-border-input: rgba(148, 163, 184, 0.28);
    --sched-accent: #e3b008;
    --sched-accent-soft: rgba(227, 176, 8, 0.18);
    --sched-accent-strong: rgba(244, 217, 139, 0.5);

    --ipi-bg: rgba(15, 23, 42, 0.55);
    --ipi-bg-inset: rgba(15, 23, 42, 0.62);
    --ipi-bg-card: rgba(15, 23, 42, 0.7);
    --ipi-bg-hover: rgba(148, 163, 184, 0.08);
    --ipi-rule: rgba(148, 163, 184, 0.22);
    --ipi-rule-h: rgba(148, 163, 184, 0.28);
    --ipi-ink: #e2e8f0;
    --ipi-ink-2: #cbd5e1;
    --ipi-ink-3: #94a3b8;
    --ipi-ink-4: #94a3b8;
    --ipi-accent: #e3b008;
    --ipi-accent-bg: rgba(227, 176, 8, 0.18);
    --ipi-accent-border: rgba(244, 217, 139, 0.5);
    --ipi-shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
    --ipi-shadow-card: 0 1px 4px rgba(0, 0, 0, 0.4), 0 0 0 1px rgba(148, 163, 184, 0.1);
}

html[data-theme="dark"] .sched-modal .sched-modal__dialog {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .sched-modal .modal__close {
    background: rgba(148, 163, 184, 0.16);
    color: rgba(226, 232, 240, 0.92);
}

html[data-theme="dark"] .sched-modal .modal__close:hover {
    background: rgba(148, 163, 184, 0.28);
}

/* Mobile modal behaviour (≤900px) — canonical full-screen rule lives in
   style.css; header/body/footer chrome owned by gold-spec there too.
   Schedule-specific content layout below. */
@media (max-width: 900px) {
    .sched-modal .sched-modal__body {
        gap: 12px;
    }

    .sched-modal .sched-modal__footer-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
        width: 100%;
    }

    /* When the last button would sit alone on its row (odd count), span full width. */
    .sched-modal .sched-modal__footer-actions > *:last-child:nth-child(odd) {
        grid-column: 1 / -1;
    }

    .sched-modal .sched-modal__footer-actions .btn {
        width: 100%;
        justify-content: center;
        min-height: 44px;
        font-size: 13px;
        padding-left: 6px;
        padding-right: 6px;
    }

}
