:root {
  --brand-orange: #FF7A00;
  --dark-grey: #1E1E1E;
  --surface: #111;
  --text: #FFFFFF;
  --text-muted: #B3B3B3;
  --border: var(--brand-orange);
  --focus: var(--brand-orange);
}

/* Modal overlay */
.dtf-overlay {
  position: fixed;
  inset: 0;
  background: transparent;
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 9999;
  padding-top: 20px;
  overflow-y: auto;
}
.dtf-overlay[aria-hidden="false"] { display: flex; }

/* Modal container */
.dtf-modal {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 15px;
  width: min(720px, 95vw);
  max-height: none; /* Remove height restriction for iframe use */
  overflow: visible;
  box-shadow: 0 10px 40px rgba(0,0,0,0.4);
  margin-bottom: 20px;
}

.dtf-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}
.dtf-title { font-size: 1.1rem; font-weight: 600; }
.dtf-close {
  appearance: none;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  width: 44px; height: 36px;
  cursor: pointer;
}
.dtf-close:focus { outline: none; box-shadow: 0 0 0 3px rgba(255,122,0,0.35); }

.dtf-body { padding: 12px; overflow: visible; max-height: none; }
.dtf-footer {
  display: flex; gap: 8px; justify-content: space-between; align-items: center;
  padding: 12px; border-top: 1px solid rgba(255,255,255,0.08);
}

/* Buttons */
.dtf-btn { 
  appearance: none; border-radius: 12px; padding: 12px 16px; cursor: pointer; font-weight: 600; 
  border: 1px solid var(--border); color: var(--text);
}
.dtf-btn-primary { background: var(--brand-orange); border-color: var(--brand-orange); color: #111; }
.dtf-btn-secondary { background: transparent; border-color: rgba(255,255,255,0.25); color: var(--text); }
.dtf-btn:focus { outline: none; box-shadow: 0 0 0 3px rgba(255,122,0,0.35); }

/* Steps */
.dtf-steps { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; padding: 8px 12px; text-align: right; }
.dtf-step {
  appearance: none;
  background: #1a1a1a;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 15px;
  padding: 6px 10px;
  display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 8px;
  color: var(--text-muted);
  cursor: pointer;
}
.dtf-step[aria-current="step"], .dtf-step[data-status="current"] {
  color: #111;
  background: var(--brand-orange);
  border-color: var(--brand-orange);
}
.dtf-step[data-status="done"] { color: var(--text); border-color: rgba(255,255,255,0.35); }
.dtf-step .dtf-step-index {
  width: 22px; height: 22px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,0.1); color: currentColor; font-weight: 700; font-size: 12px;
}
.dtf-step[data-status="current"] .dtf-step-index { background: rgba(0,0,0,0.2); color: #111; }
.dtf-step[data-status="done"] .dtf-step-index { background: rgba(76,175,80,0.15); color: #4CAF50; box-shadow: 0 0 6px rgba(76,175,80,0.25); }
.dtf-step .dtf-label { font-size: 12px; font-weight: 600; text-align: right; }
.dtf-step .dtf-sub { display: none; }

/* Responsive adjustments for steps */
@media (max-width: 640px) {
  .dtf-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; padding: 8px 10px; }
  .dtf-step { padding: 5px 8px; }
  .dtf-step .dtf-label { font-size: 11px; }
  .dtf-step .dtf-step-index { width: 20px; height: 20px; font-size: 11px; }
}
@media (max-width: 420px) {
  .dtf-steps { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 8px; }
  .dtf-step { flex: 0 0 auto; white-space: nowrap; }
}
.dtf-step:focus { outline: none; box-shadow: 0 0 0 3px rgba(255,122,0,0.35); }

/* Weekend hire toggle */
.dtf-weekend-toggle-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 12px 8px 12px;
  background: rgba(255,122,0,0.08);
  border-radius: 10px;
  margin: 0 12px 8px 12px;
  border: 1px solid rgba(255,122,0,0.2);
}
.dtf-weekend-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--text);
}
.dtf-weekend-toggle input { display: none; }
.dtf-weekend-switch {
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: rgba(255,255,255,0.15);
  position: relative;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,0.2);
  flex-shrink: 0;
  transition: background 0.2s ease, box-shadow 0.2s ease;
}
.dtf-weekend-switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform 0.2s ease, background 0.2s ease;
}
.dtf-weekend-toggle input:checked + .dtf-weekend-switch {
  background: rgba(255,122,0,0.3);
  box-shadow: inset 0 0 0 2px var(--brand-orange);
}
.dtf-weekend-toggle input:checked + .dtf-weekend-switch::after {
  transform: translateX(20px);
  background: var(--brand-orange);
}
.dtf-weekend-desc {
  font-size: 11px;
  color: var(--text-muted);
  padding-left: 54px;
}

/* Range summary under steps */
.dtf-range-summary { padding: 0 12px 8px 12px; color: var(--text); font-size: 12px; }
.dtf-range-summary .muted { color: var(--text-muted); }

/* Calendar */
.dtf-calendar { user-select: none; }
.dtf-overlay.confirm-open > .dtf-modal:first-child { opacity: 0.5; }
.dtf-cal-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.dtf-cal-nav { display: flex; gap: 6px; }
.dtf-cal-nav button { width: 44px; height: 36px; border-radius: 10px; border: 1px solid var(--border); background: transparent; color: var(--text); cursor: pointer; }
.dtf-cal-nav button:focus { outline: none; box-shadow: 0 0 0 3px rgba(255,122,0,0.35); }
.dtf-month-label { font-weight: 600; }
.dtf-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; background: #2E3133; padding: 8px; border-radius: 12px; }
.dtf-weekday { text-align: center; font-size: 12px; color: var(--text-muted); padding: 6px 0; }
.dtf-day {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center;
  width: 100%; min-height: 44px; border-radius: 10px; cursor: pointer; border: 1px solid rgba(255,255,255,0.15);
  color: var(--text);
  background: #2E3133;
}
.dtf-day[aria-selected="true"] { background: var(--brand-orange); color: #fff; border-color: var(--brand-orange); }
.dtf-day[aria-disabled="true"] { opacity: 0.4; pointer-events: none; }
.dtf-day.outside-weekend-window { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.dtf-day.no-pickup-slots { background: rgba(255,255,255,0.05); color: var(--text-muted); }
.dtf-day:focus { outline: none; box-shadow: 0 0 0 3px rgba(255,122,0,0.35); }
.dtf-day.today { box-shadow: 0 0 0 2px rgba(255,122,0,0.45) inset; }

/* Times list */
.dtf-times {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: 350px;
  overflow-y: scroll; /* always show scrollbar when content overflows (not just when scrolling) */
  overflow-x: hidden;
  padding: 8px 8px 8px 0;
  scrollbar-width: thin;
  scrollbar-color: var(--brand-orange) rgba(255,255,255,0.15);
}
.dtf-times::-webkit-scrollbar { width: 8px; }
.dtf-times::-webkit-scrollbar-track { background: rgba(255,255,255,0.15); border-radius: 4px; }
.dtf-times::-webkit-scrollbar-thumb { background: var(--brand-orange); border-radius: 4px; min-height: 40px; }
.dtf-times::-webkit-scrollbar-thumb:hover { background: #e66d00; }
.dtf-times::-webkit-scrollbar-thumb:window-inactive { background: var(--brand-orange); opacity: 0.8; }
@media (max-width: 640px) { .dtf-times { grid-template-columns: repeat(2, 1fr); } }
.dtf-time {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 44px; border-radius: 10px; border: 1px solid rgba(255,255,255,0.2);
  color: var(--text); cursor: pointer; background: #1a1a1a;
}
.dtf-time-section-label {
  grid-column: 1 / -1;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.65);
  padding: 10px 4px 4px;
  margin-top: 4px;
}
.dtf-time-section-label:first-child { margin-top: 0; padding-top: 0; }
.dtf-time.dtf-time-ooh {
  border-style: dashed;
  opacity: 0.95;
}
.dtf-time.dtf-time-pickup-hint { border-color: var(--brand-orange); box-shadow: 0 0 0 2px rgba(255,122,0,0.35); }
.dtf-time[aria-selected="true"] { background: var(--brand-orange); color: #111; border-color: var(--brand-orange); }
.dtf-time:focus { outline: none; box-shadow: 0 0 0 3px rgba(255,122,0,0.35); }

/* Review */
.dtf-review { padding: 8px 4px; color: var(--text); }
.dtf-review .muted { color: var(--text-muted); font-size: 0.95em; }
.dtf-note { margin: 8px 0; font-size: 12px; color: var(--text); }
.dtf-info { color: var(--text-muted); display: flex; align-items: flex-start; gap: 6px; }
.dtf-info:before { content: none; display: none; }
@media (max-width: 480px) {
  .dtf-overlay { padding-top: 10px; }
  .dtf-modal { margin-bottom: 10px; }
  .dtf-body { max-height: none; }
  .dtf-times { max-height: 300px; }
}

/* Body scroll lock */
body.dtf-locked { overflow: hidden; }

/* Legacy UI visibility controller */
[data-keep-visible="false"] .legacy-date-ui { display: none; }


