/* Fraunces — variable display serif */
@font-face {
  font-family: 'Fraunces';
  src: url("/assets/fraunces-latin-wght-normal.woff2") format('woff2');
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* DM Sans — humanist body sans */
@font-face {
  font-family: 'DM Sans';
  src: url("/assets/dm-sans-latin-400-normal.woff2") format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url("/assets/dm-sans-latin-500-normal.woff2") format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'DM Sans';
  src: url("/assets/dm-sans-latin-600-normal.woff2") format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* JetBrains Mono — reference numbers */
@font-face {
  font-family: 'JetBrains Mono';
  src: url("/assets/jetbrains-mono-latin-400-normal.woff2") format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ============================================================
   FULLCALENDAR OVERRIDES
   ============================================================ */
.fc {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.875rem;
  color: var(--text-primary);
}

.fc-theme-standard td,
.fc-theme-standard th,
.fc-theme-standard .fc-scrollgrid {
  border-color: var(--border-default);
}

.fc-col-header-cell {
  background: var(--surface-subtle);
  padding: 8px 0;
}
.fc-col-header-cell-cushion {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  text-decoration: none !important;
}

.fc-daygrid-day-number {
  font-family: 'Fraunces', serif;
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-decoration: none !important;
  padding: 6px 8px;
}

.fc-day-today-custom .fc-daygrid-day-number {
  background: var(--brand-primary);
  color: white;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px;
  padding: 0;
}
.fc-day-today { background: transparent !important; }

.fc-event {
  border-radius: 6px !important;
  border: none !important;
  padding: 2px 6px !important;
  margin-bottom: 2px !important;
  cursor: pointer !important;
}
.fc-event:hover { opacity: 0.85; }

.fc-event-chip {
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
}
.fc-event-icon { font-size: 10px; flex-shrink: 0; }
.fc-event-time {
  font-size: 0.625rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0.9;
}
.fc-event-team {
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.025em;
  white-space: nowrap;
  flex-shrink: 0;
  padding: 0 4px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.22);
}
.fc-event-chip.is-done {
  opacity: 0.78;
}
.fc-event-done {
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.28);
  color: #ffffff;
}
.fc-event-title {
  font-size: 0.75rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.fc-event-ref {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.625rem;
  opacity: 0.75;
  flex-shrink: 0;
}

.fc-timegrid-slot { height: 48px !important; }
.fc-timegrid-slot-label {
  font-size: 0.6875rem;
  color: var(--text-muted);
}

.fc-timegrid-now-indicator-line  { border-color: var(--brand-primary) !important; }
.fc-timegrid-now-indicator-arrow { border-top-color: var(--brand-primary) !important; }

.fc-daygrid-more-link {
  font-size: 0.7rem;
  color: var(--brand-primary);
  font-weight: 600;
}

/* ============================================================
   FILTER PILLS
   ============================================================ */
.filter-pill { cursor: pointer; user-select: none; }

.filter-pill.active.delivery  { background: var(--brand-primary); border-color: var(--brand-primary); color: white; }
.filter-pill.active.pickup    { background: #4F46E5; border-color: #4F46E5; color: white; }
.filter-pill.active.dropoff   { background: #0D9488; border-color: #0D9488; color: white; }
.filter-pill:not(.active)     { background: var(--surface-subtle); border-color: var(--border-default); color: var(--text-muted); }

/* ============================================================
   EVENT POPOVER
   ============================================================ */
#calendar-popover {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 9999;
  animation: fade-in 150ms ease;
}

.calendar-popover-inner {
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: 12px;
  box-shadow: var(--shadow-raised);
  width: 280px;
  overflow: hidden;
}

.popover-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  background: var(--surface-subtle);
  border-bottom: 1px solid var(--border-default);
}
.popover-type {
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.popover-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.25rem;
  line-height: 1;
  padding: 0;
}
.popover-close:hover { color: var(--text-primary); }

.popover-body  { padding: 14px 16px; }
.popover-name  { font-family: 'Fraunces', serif; font-size: 1.125rem; font-weight: 600; color: var(--text-primary); margin: 0 0 2px; }
.popover-ref   { font-family: 'JetBrains Mono', monospace; font-size: 0.75rem; color: var(--text-muted); margin: 0 0 10px; }
.popover-detail { font-size: 0.8125rem; color: var(--text-secondary); margin: 0 0 4px; }

.popover-footer { padding: 10px 16px; border-top: 1px solid var(--border-default); background: var(--surface-subtle); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.popover-link-secondary { font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); text-decoration: none; }
.popover-link-secondary:hover { color: var(--brand-primary); text-decoration: underline; }
.popover-link   { font-size: 0.8125rem; font-weight: 600; color: var(--brand-primary); text-decoration: none; }
.popover-link:hover { opacity: 0.8; }
.popover-maplink { color: var(--brand-primary); text-decoration: none; }
.popover-maplink:hover { text-decoration: underline; }

@media (max-width: 640px) {
  #calendar-popover { top: auto; bottom: 0; left: 0; right: 0; transform: none; }
  .calendar-popover-inner { width: 100%; border-radius: 16px 16px 0 0; }
}

/* ============================================================
   VIEW SWITCHER ACTIVE STATE
   ============================================================ */
[data-view].active    { background: var(--surface-card); box-shadow: 0 1px 3px rgba(60,40,20,0.10); color: var(--text-primary); }
[data-view]:not(.active) { color: var(--text-muted); }

/* ============================================================
   CALENDAR — MOBILE (month view shows dots)
   ============================================================ */
@media (max-width: 640px) {
  .fc-daygrid-event {
    height: 6px;
    width: 6px;
    border-radius: 50% !important;
    margin: 1px !important;
    padding: 0 !important;
    display: inline-block;
  }
  .fc-event-chip        { display: none; }
  .fc-daygrid-event-dot { display: none; }
  .fc-daygrid-day-number  { font-size: 0.75rem; padding: 4px; }
  .fc-col-header-cell-cushion { font-size: 0.625rem; }
}

/* ============================================================
   COMMAND PALETTE
   ============================================================ */
#command-palette:not(.hidden) {
  display: block;
}

.command-item.highlighted,
.command-item:focus {
  background: var(--surface-subtle);
  outline: none;
}

/* ============================================================
   MINI-CALENDAR — heat-coloring for scheduling forms
   ============================================================ */
.availability-calendar-mount .flatpickr-calendar {
  box-shadow: none;
  border: 1px solid var(--border-default);
  border-radius: 12px;
}
.availability-calendar-mount .flatpickr-day {
  border-radius: 6px;
}
.availability-calendar-mount .flatpickr-day.heat-low {
  background: rgb(254 243 199);   /* amber-100 */
  border-color: rgb(252 211 77);  /* amber-300 */
  color: rgb(120 53 15);          /* amber-900 */
}
.availability-calendar-mount .flatpickr-day.heat-medium {
  background: rgb(254 215 170);   /* orange-200 */
  border-color: rgb(251 146 60);  /* orange-400 */
  color: rgb(124 45 18);          /* orange-900 */
}
.availability-calendar-mount .flatpickr-day.heat-high {
  background: rgb(254 205 211);   /* rose-200 */
  border-color: rgb(251 113 133); /* rose-400 */
  color: rgb(136 19 55);          /* rose-900 */
}
.availability-calendar-mount .flatpickr-day.heat-low:hover,
.availability-calendar-mount .flatpickr-day.heat-medium:hover,
.availability-calendar-mount .flatpickr-day.heat-high:hover {
  filter: brightness(0.95);
}
.availability-calendar-mount .flatpickr-day.selected,
.availability-calendar-mount .flatpickr-day.selected:hover {
  background: var(--brand-primary) !important;
  border-color: var(--brand-primary) !important;
  color: white !important;
}

/* Summary line styling by heat level */
[data-availability-calendar-target="summary"][data-heat="none"]   { color: var(--text-muted); }
[data-availability-calendar-target="summary"][data-heat="low"]    { color: rgb(120 53 15); }
[data-availability-calendar-target="summary"][data-heat="medium"] { color: rgb(124 45 18); }
[data-availability-calendar-target="summary"][data-heat="high"]   { color: rgb(136 19 55); font-weight: 500; }
