/* Shared date and time fields (date-picker.js). Colours come from the host
   app: the dashboard's --primary/--border or the portal's --brand/--rule. */
.od-field, .od-pop, .od-scrim {
  --od-accent: var(--primary, var(--brand, #18a15c));
  --od-accent-dark: var(--primary-hover, var(--brand-hover, #128a4d));
  --od-wash: var(--primary-wash, var(--brand-wash, #e9f6ef));
  --od-border: var(--border, var(--rule, #e4e7e5));
  --od-bg: var(--bg, var(--surface, #fff));
  --od-fg: var(--fg, #1a1f1c);
  --od-muted: var(--muted, #66716b);
  --od-hover: var(--hover, #f4f6f5);
  --od-font: var(--sans, system-ui, sans-serif);
}
.od-field { display: grid; gap: 6px; min-width: 0; font-family: var(--od-font); }
.od-row { display: flex; align-items: center; gap: 6px; min-width: 0; }
.od-field svg, .od-pop svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.od-trigger, .od-time {
  min-height: 36px; box-sizing: border-box; border: 1px solid var(--od-border); border-radius: 8px;
  background: var(--od-bg); color: var(--od-fg); font: 500 13.5px var(--od-font); font-variant-numeric: tabular-nums;
  transition: border-color .12s, box-shadow .12s;
}
.od-trigger { flex: 1.6 1 0; min-width: 0; display: flex; align-items: center; gap: 8px; padding: 0 10px; text-align: left; cursor: pointer; }
.od-trigger svg { color: var(--od-muted); }
.od-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.od-trigger.od-empty .od-text { color: var(--od-muted); font-weight: 400; }
.od-time { flex: 1 1 0; min-width: 72px; max-width: 96px; padding: 0 10px; cursor: text; }
.od-time::placeholder { color: var(--od-muted); }
.od-trigger:hover, .od-time:hover { border-color: var(--od-accent); }
.od-trigger:focus-visible, .od-time:focus, .od-trigger[aria-expanded="true"] {
  outline: none; border-color: var(--od-accent); box-shadow: 0 0 0 3px var(--od-wash);
}
.od-clear { display: inline-grid; place-items: center; width: 32px; height: 32px; flex: none; border: 0; border-radius: 6px; background: transparent; color: var(--od-muted); cursor: pointer; }
.od-clear:hover { background: var(--od-hover); color: var(--od-fg); }
.od-clear[hidden] { display: none; }
.od-clear svg { width: 14px; height: 14px; }

.od-presets, .od-foot { display: flex; flex-wrap: wrap; gap: 6px; }
.od-chip {
  border: 1px solid var(--od-border); background: var(--od-bg); color: var(--od-fg); border-radius: 99px;
  padding: 3px 11px; min-height: 26px; font: 600 12px var(--od-font); cursor: pointer;
}
.od-chip:hover { border-color: var(--od-accent); color: var(--od-accent-dark); background: var(--od-wash); }
.od-chip:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--od-wash); border-color: var(--od-accent); }
.od-chip-clear { margin-left: auto; color: var(--od-muted); }

/* Popover: calendar and time list. */
.od-pop {
  position: fixed; z-index: 1200; box-sizing: border-box; background: var(--od-bg); color: var(--od-fg);
  border: 1px solid var(--od-border); border-radius: 12px; box-shadow: 0 14px 36px rgba(16, 24, 20, .16), 0 2px 6px rgba(16, 24, 20, .06);
  font: 14px var(--od-font); animation: od-in .12s ease-out;
}
@keyframes od-in { from { opacity: 0; transform: translateY(-4px); } }
.od-pop[role="dialog"] { width: 300px; padding: 12px; display: grid; gap: 10px; }
.od-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.od-title { font-weight: 700; font-size: 14.5px; }
.od-nav { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 8px; background: transparent; color: var(--od-fg); cursor: pointer; }
.od-nav:hover:not(:disabled) { background: var(--od-hover); }
.od-nav:disabled { opacity: .3; cursor: default; }
.od-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.od-grid th, .od-grid td { border: 0; background: none; position: static; text-transform: none; letter-spacing: 0; white-space: normal; }
.od-grid th { padding: 0 0 4px; font-size: 11.5px; font-weight: 600; color: var(--od-muted); text-align: center; }
.od-grid td { padding: 1px; text-align: center; }
.od-day {
  width: 100%; aspect-ratio: 1; max-height: 38px; border: 0; border-radius: 99px; background: transparent;
  color: var(--od-fg); font: 500 13.5px var(--od-font); font-variant-numeric: tabular-nums; cursor: pointer;
}
.od-day:hover:not(:disabled) { background: var(--od-hover); }
.od-day.od-out { color: var(--od-muted); opacity: .65; }
.od-day.od-today { box-shadow: inset 0 0 0 1.5px var(--od-accent); color: var(--od-accent-dark); font-weight: 700; }
.od-day.od-selected, .od-day.od-selected:hover { background: var(--od-accent); color: #fff; font-weight: 700; opacity: 1; }
.od-day:disabled { opacity: .25; cursor: default; text-decoration: line-through; }
.od-day:focus-visible, .od-nav:focus-visible { outline: 2px solid var(--od-accent); outline-offset: 1px; }
.od-foot { padding-top: 10px; border-top: 1px solid var(--od-border); }

.od-times { width: 150px; max-height: 260px; overflow-y: auto; padding: 4px; overscroll-behavior: contain; }
.od-slot { padding: 7px 10px; border-radius: 6px; cursor: pointer; font-variant-numeric: tabular-nums; }
.od-slot:hover, .od-slot.od-active { background: var(--od-hover); }
.od-slot.od-selected { color: var(--od-accent-dark); font-weight: 700; background: var(--od-wash); }

/* Phones: bigger targets and the calendar as a bottom sheet. */
.od-scrim { position: fixed; inset: 0; z-index: 1190; background: rgba(10, 16, 13, .38); animation: od-fade .15s ease-out; }
@keyframes od-fade { from { opacity: 0; } }
@media (max-width: 640px) {
  .od-trigger, .od-time { min-height: 44px; font-size: 16px; }
  .od-time { max-width: none; }
  .od-clear { width: 44px; height: 44px; }
  .od-chip { min-height: 34px; padding: 5px 14px; font-size: 13px; }
  .od-pop.od-sheet {
    inset: auto 0 0 0; width: auto; max-width: none; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
    border-radius: 18px 18px 0 0; animation: od-up .18s ease-out;
  }
  @keyframes od-up { from { transform: translateY(100%); } }
  .od-sheet .od-day { max-height: 46px; font-size: 16px; }
  .od-sheet .od-title { font-size: 16px; }
  .od-sheet .od-nav { width: 44px; height: 44px; }
  .od-slot { padding: 11px 12px; font-size: 16px; }
}
